Questions Tagged with #Wss

WSS stands for Windows SharePoint Services, SharePoint Server 2007's "little" brother. It forms the basis for the full blown server product. As of SharePoint Server 2010 it is called SharePoint Server Foundation.

Cannot open include file: 'stdio.h' - Visual Studio Community 2017 - C++ Error

I am trying to Build a Solution on Visual Studio Community 2017, but I keep getting the error "Cannot open include file: 'stdio.h' ". I've read through several similar questions, but still can't fix t..

docker cannot start on windows

Executing docker version command on Windows returns the following results: C:\Projects> docker version Client: Version: 1.13.0-dev API version: 1.25 Go version: go1.7.3 Git commit: d8..

fs.writeFile in a promise, asynchronous-synchronous stuff

I need some help with my code. I'm new at Node.js and have a lot of trouble with it. What I'm trying to do: 1) Fetch a .txt with Amazon products (ASINs) ; 2) Fetch all products using the amazon-pro..

Failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED

I try to connect with socket to my server. My server is running server socket with Rachet on port 8080. I try to run this code: <script> try{ conn = new WebSocket('wss://localhost:8..

android lollipop toolbar: how to hide/show the toolbar while scrolling?

I'm using the new toolbar widget introduced in the appcompat / support-v7. I would like to hide/show the toolbar depending on if the user is scrolling up/down the page, just like in the new Google's p..

AppCompat v7 r21 returning error in values.xml?

I'm using Android Studio and when I add compile "com.android.support:appcompat-v7:21.0.0" to my Gradle file, I'm getting a ton of errors: C:\Users\WindowsSucks\AndroidStudioProjects\MMMeds\app\build..

No found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations:

I am trying to write a SOAP service using Spring, however I receive a Dependency Injection issue. I'm having problems using @Autowired through the Service like this: public interface UserDao { ..

Cannot use mkdir in home directory: permission denied (Linux Lubuntu)

I am trying to create a directory in my home directory on Linux using the mkdir command, but am getting a 'permission denied' error. I have recently installed Lubuntu on my laptop, and have the only ..

Bootstrap 3 .img-responsive images are not responsive inside fieldset in FireFox

In Firefox (tested on Win7 and Win8), with the code below - when a responsive image is inside of a <fieldset> it is no longer responsive. This means that as my form resizes for the phone, the i..

Python "SyntaxError: Non-ASCII character '\xe2' in file"

I am writing some python code and I am receiving the error message as in the title, from searching this has to do with the character set. Here is the line that causes the error hc = HealthCheck("in..

Htaccess: add/remove trailing slash from URL

My website runs a script called -> WSS wallpaper script My Problem -> I have been trying to force remove or add trailing slash to the end of my URL to prevent duplicated content and also to clean up ..

PHP cURL error code 60

Whilst trying to setup a php environment on windows (using wamp) to use the Amazon PHP SDK, when i try to run a sample test I get the following error: Fatal error: Uncaught exception 'cURL_Exception'..

Setting up a websocket on Apache?

So I'm doing some research on websockets, and I have a few questions I can't seem to find a definitive answer for: How can I set up a web socket on my Linux server? Is there an Apache module? Would ..

How can I pass a username/password in the header to a SOAP WCF Service

I'm trying to consume a third-party web service https://staging.identitymanagement.lexisnexis.com/identity-proofing/services/identityProofingServiceWS/v2?wsdl I already added it as a service referenc..

Bash script and /bin/bash^M: bad interpreter: No such file or directory

I'm learning through this tutorial to learn bash scripts to automate a few tasks for me. I'm connecting to a server using putty. The script, located in .../Documents/LOG, is: #!/bin/bash # My first ..

Windows service with timer

I have created a windows service with timer in c#.net. it works fine while i debug/build the project in visual studio but it does not perform its operation after installation. What might be the reaso..

NGINX to reverse proxy websockets AND enable SSL (wss://)?

I'm so lost and new to building NGINX on my own but I want to be able to enable secure websockets without having an additional layer. I don't want to enable SSL on the websocket server itself but ins..

how to save canvas as png image?

I have a canvas element with a drawing in it, and I want to create a button that when clicked on, it will save the image as a png file. So it should open up the save, open, close dialog box... I do i..

How to construct a WebSocket URI relative to the page URI?

I want to construct a WebSocket URI relative to the page URI at the browser side. Say, in my case convert HTTP URIs like http://example.com:8000/path https://example.com:8000/path to ws://example...

What to use now Google News API is deprecated?

As part of a Project I'm working on I've been instructed to implement Google News API into a Web Application. However, I've checked the Google News API site, and I see the following message: Impo..

Merging multiple PDFs using iTextSharp in c#.net

Well i'm trying to merge multiple PDFs in to one. I gives no errors while compiling. I tried to merge the docs first but that went wrong because I'm working with tables. This is the asp.net code-beh..

How to add soap header in java

i have a NO-.net webservice from oracle To access i need to add the soap header. How can i add the soap header in java? Authenticator.setDefault(new ProxyAuthenticator("username", "password")); ..

Start / Stop a Windows Service from a non-Administrator user account

I have a WindowsService named, say, BST. And I need to give a non-Administrator user, UserA, the permissions to Start/Stop this particular service. My service runs on a variety of Windows OS, starting..

Example of SOAP request authenticated with WS-UsernameToken

I'm trying to authenticate a SOAP request using WS-UsernameToken spec, but the target device is always denying access. My non-working request looks like this. (The password I'm trying to hash is syste..

How to copy commits from one branch to another?

I've got two branches from my master: v2.1: (version 2) I've been working on for several months wss: that I created yesterday to add one specific feature to my master (in production) Is there a wa..

JAX-WS - Adding SOAP Headers

I am trying to create a standalone client to consume some web services. I must add my username and password to the SOAP Header. I tried adding the credentials as follows: OTSWebSvcsService service =..

Solving SharePoint Server 2010 - 503. The service is unavailable, After installation

Installed: SharePoint Server 2010 for Internet Enterprise Beta (x64) On: Windows Server 2008 Standard (x64) on 64 bit hardware Attempts to access the Central Administration console led to IIS returni..

Pass path with spaces as parameter to bat file

I have a simple bat script that copies files from an known directory to a directory given by the user. How can I pass the path (it might contain spaces) to my script and use it with the xcopy command?..

Best way to convert text files between character sets?

What is the fastest, easiest tool or method to convert text files between character sets? Specifically, I need to convert from UTF-8 to ISO-8859-15 and vice versa. Everything goes: one-liners in you..

Error handling in Bash

What is your favorite method to handle errors in Bash? The best example of handling errors I have found on the web was written by William Shotts, Jr at http://www.linuxcommand.org. He suggests usin..

UITableView - scroll to the top

In my table view I have to scroll to the top. But I cannot guarantee that the first object is going to be section 0, row 0. May be that my table view will start from section number 5. So I get an exc..

Make page to tell browser not to cache/preserve input values

Most browsers cache form input values. So when the user refreshes a page, the inputs have the same values. Here's my problem. When a user clicks Save, the server validates POSTed data (e.g. checked p..

Available text color classes in Bootstrap

I'm developing a sign up page, by putting some text as the title at the navigation bar. I want to give those texts different colors. For this purpose I'm using a separate CSS file, but I want to do th..

Conversion of Char to Binary in C

I am trying to convert a character to its binary representation (so character --> ascii hex --> binary). I know to do that I need to shift and AND. However, my code is not working for some reason. H..

Spring AMQP + RabbitMQ 3.3.5 ACCESS_REFUSED - Login was refused using authentication mechanism PLAIN

I am getting below exception org.springframework.amqp.AmqpAuthenticationException: com.rabbitmq.client.AuthenticationFailureException: ACCESS_REFUSED - Login was refused using authentication mecha..

tar: Error is not recoverable: exiting now

when I untar doctrine -rw-r--r-- 1 root root 660252 2010-10-16 23:06 Doctrine-1.2.0.tgz I always get this error messages root@X100e:/usr/local/lib/Doctrine/stable# tar -xvzf Doctrine-1.2.0.tgz . ..

How to format DateTime columns in DataGridView?

I'm using a DataGridView with object data binding to display information about logging entities in a system, retrieved via SOAP from a remote service. One of the columns is called "Last action" and me..

How can I remove a trailing newline?

What is the Python equivalent of Perl's chomp function, which removes the last character of a string if it is a newline?..

Change the project theme in Android Studio?

I created some project using the light theme and now I want to change it to dark and I can't figure out how to do that. BTW, I'm not asking on how to do it in code, just how to change the project's de..

document.getelementbyId will return null if element is not defined?

In my code, I see this: if (document.getElementById('xx') !=null) { //do stuff } if xx element is not defined, will this evaluate to true or false? Should I write: if (document.getElementByI..

select count(*) from select

I am trying to get row count from the following query. I get only row count as 1 but there are 35 records. Could you please let me know how to get the count from inner query? Thank you SELECT COUNT(..

PHP fopen() Error: failed to open stream: Permission denied

I learning how to write a WordPress plugin. I need some help writing some data to an XML file. I'm on my local machine, a Mac running MAMP. I have PHP 5.2.13. In my plugin, I've got: $file_handle = ..

How to convert text column to datetime in SQL

I have a column that's a text: Remarks (text, null) A sample value is "5/21/2013 9:45:48 AM" How do I convert it to a datetime format like this: "2013-05-21 09:45:48.000" The re..

Asp.net - <customErrors mode="Off"/> error when trying to access working webpage

I have created an asp.net webpage and have uploaded it onto a webserver. However when I try to view the page remotely, I get errors about the customerror tag in the web.config file. The page works loc..

How do you import classes in JSP?

I am a complete JSP beginner. I am trying to use a java.util.List in a JSP page. What do I need to do to use classes other than ones in java.lang?..

Body of Http.DELETE request in Angular2

I'm trying to talk to a somewhat RESTful API from an Angular 2 frontend. To remove some item from a collection, I need to send some other data in addition to the removée unique id(that can be append..

SQL Query for Student mark functionality

Got this as an interview question from Amazon to test basic SQL skills and I kind of flopped it. Consider the following tables: Student - Stid, Stname, Details Subject - Subid, Subname Marks - Stid, ..

Plot data in descending order as appears in data frame

I've been battling to order and plot a simple dataframe as a bar chart in ggplot2. I want to plot the data as it appears, so that the values ('count' variable) for the corresponding categories (e.g..

Cancel a UIView animation?

Is it possible to cancel a UIView animation while it is in progress? Or would I have to drop to the CA level? i.e. I've done something like this (maybe setting an end animation action too): [UIView ..

Is there a mechanism to loop x times in ES6 (ECMAScript 6) without mutable variables?

The typical way to loop x times in JavaScript is: for (var i = 0; i < x; i++) doStuff(i); But I don't want to use the ++ operator or have any mutable variables at all. So is there a way, in ES..

Detect click event inside iframe

I'm writing a plugin for TinyMCE and have a problem with detecting click events inside an iframe. From my search I've come up with this: Loading iframe: <iframe src='resource/file.php?mode=tiny..

LINQ .Any VS .Exists - What's the difference?

Using LINQ on collections, what is the difference between the following lines of code? if(!coll.Any(i => i.Value)) and if(!coll.Exists(i => i.Value)) Update 1 When I disassemble .Exists i..

Does C have a string type?

I have recently started programming in C, coming from Java and Python. Now, in my book I have noticed that to make a "Hello World" program, the syntax is something like this: char message[10] strcpy(..

What's the difference between returning value or Promise.resolve from then()

What is the difference between: _x000D_ _x000D_ new Promise(function(res, rej) {_x000D_ res("aaa");_x000D_ })_x000D_ .then(function(result) {_x000D_ return "bbb";_x000D_ })_x000D_ .th..

How do I make a JAR from a .java file?

I was writing a simple program using a Java application (not application that has projects, but application within a project; .java) that has a single frame. Both of the files are .java so I can't wri..

How to make a local variable (inside a function) global

Possible Duplicate: Using global variables in a function other than the one that created them I'm using functions so that my program won't be a mess but I don't know how to make a local var..

Commenting multiple lines in DOS batch file

I have written huge MS DOS Batch file. To test this batch file I need to execute some lines only and want to hide/comment out remaining. I have some existing comment lines starting with :: hence I can..

Chrome: Uncaught SyntaxError: Unexpected end of input

When loading my page in Google Chrome, I get a vague error in the console: Uncaught SyntaxError: Unexpected end of input I have no idea what is causing it. How would I go about debugging this er..

How to upload file to server with HTTP POST multipart/form-data?

I am developing Windows Phone 8 app. I want to upload SQLite database via PHP web service using HTTP POST request with MIME type multipart/form-data & a string data called "userid=SOME_ID". I do..

What's the difference between including files with JSP include directive, JSP include action and using JSP Tag Files?

It seems that there are two methods for templating with JSP. Including files with one of these statements <%@ include file="foo.html" %> <jsp:include page="foo.html" /> or using JSP ta..

How to use subList()

I have a JSF page which displays list of Glassfish log files. I use lazy loading for pagination. I keep the list of the log files names into Java List. private List<directoryListObj> dataList =..

Scroll part of content in fixed position container

I have a position: fixed div in a layout, as a sidebar. I've been asked to have part of it's content stay fixed to the top of it (internally), and the rest to scroll if it overflows the bottom of the ..

When to use NSInteger vs. int

When should I be using NSInteger vs. int when developing for iOS? I see in the Apple sample code they use NSInteger (or NSUInteger) when passing a value as an argument to a function or returning a va..

How do I get formatted JSON in .NET using C#?

I am using .NET JSON parser and would like to serialize my config file so it is readable. So instead of: {"blah":"v", "blah2":"v2"} I would like something nicer like: { "blah":"v", "blah..

Accessing member of base class

See the inheritance example from the playground on the TypeScript site: class Animal { public name; constructor(name) { this.name = name; } move(meters) { alert(this.name + " moved " ..

How to get the number of threads in a Java process

How can I see the number of threads in a Java process? ..

IOException: Too many open files

I'm trying to debug a file descriptor leak in a Java webapp running in Jetty 7.0.1 on Linux. The app had been happily running for a month or so when requests started to fail due to too many open file..

javax.naming.NameNotFoundException

I am running an example of ejb using JBoss5 Container. I am using an example from here(Part one). In the example I deployed bean in JBoss and an application in Tomcat(to acces the bean from JBoss). I..

How to remove only 0 (Zero) values from column in excel 2010

I want to remove the values from entire column where cells value is 0. The resultant Cells should be blank. How can I write a formula for this? Any suggestions? TELEPHONE NUMBERS ---------- 49 52..

How can I use Bash syntax in Makefile targets?

I often find Bash syntax very helpful, e.g. process substitution like in diff <(sort file1) <(sort file2). Is it possible to use such Bash commands in a Makefile? I'm thinking of something like..

How do I pass an object to HttpClient.PostAsync and serialize as a JSON body?

I'm using System.Net.Http, I found several examples on the web. I managed to create this code for make a POST request: public static string POST(string resource, string token) { using (var client..

MVC pattern on Android

Is it possible to implement the model–view–controller pattern in Java for Android? Or is it already implemented through Activities? Or is there a better way to implement the MVC pattern for Andro..

How to truncate milliseconds off of a .NET DateTime

I'm trying to compare a time stamp from an incoming request to a database stored value. SQL Server of course keeps some precision of milliseconds on the time, and when read into a .NET DateTime, it in..

What does #defining WIN32_LEAN_AND_MEAN exclude exactly?

I found the explanation defining WIN32_LEAN_AND_MEAN "reduces the size of the Win32 header files by excluding some of the less frequently used APIs". Somewhere else I read that it speeds up..

Simple PowerShell LastWriteTime compare

I need a PowerShell script that can access a file's properties and discover the LastWriteTime property and compare it with the current date and return the date difference. I have something like this...

How do I access Configuration in any class in ASP.NET Core?

I have gone through configuration documentation on ASP.NET core. Documentation says you can access configuration from anywhere in the application. Below is Startup.cs created by template public clas..

nginx missing sites-available directory

I installed Nginx on Centos 6 and I am trying to set up virtual hosts. The problem I am having is that I can't seem to find the /etc/nginx/sites-available directory. Is there something I need to do i..

How to open some ports on Ubuntu?

I know little about Linux.Today I create a VPN server on My ubuntu according to https://github.com/philplckthun/setup-simple-ipsec-l2tp-vpn But when I finish the installation. I use my iphone to conn..

Current time in microseconds in java

On a Unix system, is there a way to get a timestamp with microsecond level accuracy in Java? Something like C's gettimeofday function...

difference between throw and throw new Exception()

what is the difference between try { ... } catch{ throw } and try{ ... } catch(Exception e) {throw new Exception(e.message) } Regardless that the second shows a message ?..

How to convert a byte array to its numeric value (Java)?

I have an 8 byte array and I want to convert it to its corresponding numeric value. e.g. byte[] by = new byte[8]; // the byte array is stored in 'by' // CONVERSION OPERATION // return the numeric ..

The forked VM terminated without saying properly goodbye. VM crash or System.exit called

Please help me to solve this issue. I do not exactly understand what the error in the log means. [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [..

angularjs - ng-repeat: access key and value from JSON array object

I have JSON Array object as shown below. $scope.items = [ {Name: "Soap", Price: "25", Quantity: "10"}, {Name: "Bag", Price: "100", Quantity: "15"}, {Name: "Pen", Price: "15", ..

window.history.pushState refreshing the browser

I am working on some javascript code, and using window.History.pushState to load new HTML pages, instead of using href tags. My code (which is working fine) looks like this. window.History.pushState..

How to create a database from shell command?

I'm looking for something like createdb in PostgreSQL or any other solution that would allow me to create database with a help of a shell command. Any hints?..

Setting paper size in FPDF

i want to seting paper size in fpdf to a half of letter size, it's approximately 8.5x5.5 inc. How can i do that? My fpdf function in php language is $pdf = new FPDF('P','mm','?????'); is..

How to install Boost on Ubuntu

I'm on Ubuntu, and I want to install Boost. I tried with sudo apt-get install boost But there was no such package. What is the best way to install Boost on Ubuntu?..

To show error message without alert box in Java Script

Please correct the below code it is not working as expected i.e, i need a error message to be shown just beside the textfield in the form when user enters an invalid name <html> <head> ..

Why doesn't wireshark detect my interface?

I just installed Wireshark, but when I click capture > interfaces, the dialog box appears, but it does not contain my network interface. When click on capture > interfaces it appears as in the ..

How to print (using cout) a number in binary form?

I'm following a college course about operating systems and we're learning how to convert from binary to hexadecimal, decimal to hexadecimal, etc. and today we just learned how signed/unsigned numbers ..

How do I select a MySQL database through CLI?

I've managed to get into MySQL using the command line terminal, but when I tried to enter some SQL, it said 'no database selected' how do I select a database? my database name is: photogallery What..

How to remove an element slowly with jQuery?

$target.remove() can remove the element,but now I want the process to be down with some feel animation,how to do it?..

How to open a web page automatically in full screen mode

How do I open a web page automatically in full screen mode? I am looking for a solution to open an web page automatically in full screen mode, without expecting user to users press F11 or any other b..

Java: Finding the highest value in an array

For some reason this code is printing three values for the highest value in the array when I'm trying to print just one (which is 11.3). Can someone please explain to me why it is doing this? Thanks...

How can I select the first day of a month in SQL?

I just need to select the first day of the month of a given datetime variable. I know it's quite easy to do using this kind of code: select CAST(CAST(YEAR(@mydate) AS VARCHAR(4)) + '/' + CAST(MONTH..

Breaking to a new line with inline-block?

I want to remove the <br />'s and do the break lines through CSS. If I change the spans to display:block the width will go 100% and I need the width to be exactly the length of the text, like it..

How do I create an Android Spinner as a popup?

I want to bring up a spinner dialog when the user taps a menu item to allow the user to select an item. Do I need a separate dialog for this or can I use Spinner directly? I see this link, mentions a..

How to use particular CSS styles based on screen size / device

Bootstrap 3 has nice CSS classes in responsive utilities that allow me to hide or show some blocks depending upon the screen resolution http://getbootstrap.com/css/#responsive-utilities-classes I ha..

How to assign the output of a Bash command to a variable?

I have a problem putting the content of pwd command into a shell variable that I'll use later. Here is my shell code (the loop doesn't stop): #!/bin/bash pwd= `pwd` until [ $pwd = "/" ] do ..

how to get file path from sd card in android

hi all i have mp3 files in sd card. how to get file path of mp3 song from sd card. please assist me...

Initializing a list to a known number of elements in Python

Right now I am using a list, and was expecting something like: verts = list (1000) Should I use array instead?..

regular expression for Indian mobile numbers

I want regular expression for indian mobile numbers which consists of 10 digits. The numbers which should match start with 9 or 8 or 7. For example: 9882223456 8976785768 7986576783 It should n..

Implementing a slider (SeekBar) in Android

I want to implement a slider, which is basically two lines, one vertical and one horizontal, crossing where the screen is touched. I have managed to make one but I have to issues: The slider is not ..

How to retrieve data from a SQL Server database in C#?

I have a database table with 3 columns firstname, Lastname and age. In my C# Windows application I have 3 textboxes called textbox1... I made my connectivity to my SQL Server using this code: SqlConn..

How to Check if value exists in a MySQL database

Suppose I have this table: id | name | city ------------------ 1 | n1 | c1 2 | n2 | c2 3 | n3 | c3 4 | n4 | c4 I want to check if the value c7 exists under the variable city or not. ..

converting Java bitmap to byte array

Bitmap bmp = intent.getExtras().get("data"); int size = bmp.getRowBytes() * bmp.getHeight(); ByteBuffer b = ByteBuffer.allocate(size); bmp.copyPixelsToBuffer(b); byte[] bytes = new b..

Is there a way to continue broken scp (secure copy) command process in Linux?

I am copying 7.5 GB file to a remote server using scp command. At some point in time file transfer breaks and I have to start all over again. Is the temporary amount of file being transferred complet..

Exception: "URI formats are not supported"

I have an absolute local path pointing to a dir: "file:\\C:\\Users\\john\\documents\\visual studio 2010\\Projects\\proj" But when I try to throw it into DirectoryInfo's ctor I get the "URI formats ar..

SyntaxError: Unexpected token o in JSON at position 1

I parse few data using a type class in my controller I'm getting data as follows: { "data":{ "userList":[ { "id":1, "name":"soni" } ] ..

SQL: how to select a single id ("row") that meets multiple criteria from a single column

I have a very narrow table: user_id, ancestry. The user_id column is self explanatory. The ancestry column contains the country from where the user's ancestors hail. A user can have multiple rows o..

How do I import a .sql file in mysql database using PHP?

I'm trying to import a .sql file through PHP code. However, my code shows this error: There was an error during import. Please make sure the import file is saved in the same folder as this script and..

SQL selecting rows by most recent date with two unique columns

Using the following query and results, I'm looking for the most recent entry where the ChargeId and ChargeType are unique. select chargeId, chargeType, serviceMonth from invoice CHARGEID CHAR..

Iterate over array of objects in Typescript

I need to iterate over the array of objects in angular 2 and limit the string length display for a particular key in the object. this.productService.loadAllProducts(product).subscribe(data => { ..

Bootstrap - Removing padding or margin when screen size is smaller

EDITED: Maybe I should ask which selector sets up the side padding when the screen is reduced to below 480px width? I have been browsing bootstrap-responsiveness.css for a while to locate this but no..

How do I automatically scroll to the bottom of a multiline text box?

I have a textbox with the .Multiline property set to true. At regular intervals, I am adding new lines of text to it. I would like the textbox to automatically scroll to the bottom-most entry (the n..

The following artifacts could not be resolved: javax.jms:jms:jar:1.1

I am trying to compile a maven project, but I systematically get the following error message: [ERROR]Failed to execute goal on project ...: Could not resolve dependencies for project ...:war:1.0.0: T..

Replace HTML page with contents retrieved via AJAX

I have an HTML page with a typical structure: <html> <head> <script src="..." ></script> <style>...</style> </head> <body> content <..

How to watch and reload ts-node when TypeScript files change

I'm trying to run a dev server with TypeScript and an Angular application without transpiling ts files every time. I found that I can do the running with ts-node but I want also to watch .ts files and..

Linq to Entities join vs groupjoin

I have web searched but I still cant find a simple answer. Can someone please explain (in simple English) what a GroupJoin is? How is it different from a regular inner Join? Is it commonly used? Is it..

How do I extract data from a DataTable?

I have a DataTable that is filled in from an SQL query to a local database, but I don't know how to extract data from it. Main method (in test program): static void Main(string[] args) { const st..

Easiest way to pass an AngularJS scope variable from directive to controller?

What is the easiest way to pass an AngularJS scope variable from directive to controller? All of the examples that I've seen seem so complex, isn't there a way I can access a controller from a direct..

Abort a Git Merge

I am working on a project using Git as the VCS. I got a branch xyz cut from the mainline branch of master. After working for a while, I committed my code and took a pull of the branch mainline. The p..

How to print a float with 2 decimal places in Java?

Can I do it with System.out.print?..

Is it possible to cast a Stream in Java 8?

Is it possible to cast a stream in Java 8? Say I have a list of objects, I can do something like this to filter out all the additional objects: Stream.of(objects).filter(c -> c instanceof Client) ..

Difference between StringBuilder and StringBuffer

What is the main difference between StringBuffer and StringBuilder? Is there any performance issues when deciding on any one of these?..

Removing legend on charts with chart.js v2

I'm making a homepage using, Bootstrap, JQuery and Chart.js (v2). I had my implementation working using v1, but recently just got into Bower and downloaded v2 using that. I'm making a grid of 4 colum..

Change WPF window background image in C# code

I have a couple of Images configured as application resources. When my application starts, the background of the main window is set via XAML: <Window.Background> <ImageBrush ImageSource..

Any difference between await Promise.all() and multiple await?

Is there any difference between: const [result1, result2] = await Promise.all([task1(), task2()]); and const t1 = task1(); const t2 = task2(); const result1 = await t1; const result2 = await t2; ..

XSL substring and indexOf

I'm new to XSLT. I wonder if it is possible to select a substring of an item. I'm trying to parse an RSS feed. The description value has more text than what I want to show. I'd like to get a subtring ..

java: Class.isInstance vs Class.isAssignableFrom

Let clazz be some Class and obj be some Object. Is clazz.isAssignableFrom(obj.getClass()) always the same as clazz.isInstance(obj) ? If not, what are the differences?..

How do I time a method's execution in Java?

How do I get a method's execution time? Is there a Timer utility class for things like timing how long a task takes, etc? Most of the searches on Google return results for timers that schedule ..

Use String.split() with multiple delimiters

I need to split a string base on delimiter - and .. Below are my desired output. AA.BB-CC-DD.zip -> AA BB CC DD zip but my following code does not work. private void getId(String pdfName){ ..

Removing Spaces from a String in C?

What is the easiest and most efficient way to remove spaces from a string in C?..

Cleanest Way to Invoke Cross-Thread Events

I find that the .NET event model is such that I'll often be raising an event on one thread and listening for it on another thread. I was wondering what the cleanest way to marshal an event from a bac..

Automatically deleting related rows in Laravel (Eloquent ORM)

When I delete a row using this syntax: $user->delete(); Is there a way to attach a callback of sorts, so that it would e.g. do this automatically: $this->photo()->delete(); Preferably i..

How to change the button text of <input type="file" />?

<input type="file" value="Browse" name="avatar" id="id_avatar" /> I tried to modify the value, but it's not working. How to customize the button text?..

Check if input value is empty and display an alert

How is it possible to display an alert with jQuery if I click the submit button and the value of the input field is empty? <input type="text" id="myMessage" name="shoutbox_..

CSS: background-color only inside the margin

I have searched for an answer but couldn't find it anywhere. My question is reasonably simple: I have a background color of my body, then a large margin, and now I want a different background color in..

R Apply() function on specific dataframe columns

I want to use the apply function on a dataframe, but only apply the function to the last 5 columns. B<- by(wifi,(wifi$Room),FUN=function(y){apply(y, 2, A)}) This applies A to all the columns of ..

What's the best way to build a string of delimited items in Java?

While working in a Java app, I recently needed to assemble a comma-delimited list of values to pass to another web service without knowing how many elements there would be in advance. The best I could..

What is the difference between Serializable and Externalizable in Java?

What is the difference between Serializable and Externalizable in Java?..

Random strings in Python

How do you create a random string in Python? I needed it to be number then character repeat till you're done this is what I created def random_id(length): number = '0123456789' alpha = 'abcd..

Couldn't connect to server 127.0.0.1:27017

I'm getting the following error: alex@alex-K43U:/$ mongo MongoDB shell version: 2.2.0 connecting to: test Thu Oct 11 11:46:53 Error: couldn't connect to server 127.0.0.1:27017 src/mongo/shell/mongo.j..

SVN undo delete before commit

If you delete a directory from an SVN working copy, but haven't committed yet, it's not obvious how to get it back. Google even suggests "svn undo delete before commit" as a common query when you type..

The requested URL /about was not found on this server

The home page of my wordpress website seems to be displaying correctly but if you click through to any of the other pages I get the following error message: Not Found The requested URL /about was no..

How to clear https proxy setting of NPM?

How can I clear the previous ssl proxy setting of NPM? well, I search a lot, but all post I got is mainly about how to set proxy in corporate network. I try to set proxy to nothing: npm config set ..

Get list from pandas DataFrame column headers

I want to get a list of the column headers from a pandas DataFrame. The DataFrame will come from user input so I won't know how many columns there will be or what they will be called. For example, if..

Multidimensional Array [][] vs [,]

double[][] ServicePoint = new double[10][9]; // <-- gives an error (1) double[,] ServicePoint = new double[10,9]; // <-- ok (2) What's their difference? (1) yields an error, what's the reason?..

The HTTP request is unauthorized with client authentication scheme 'Ntlm' The authentication header received from the server was 'NTLM'

I know there's a lot of questions on SO similar to this, but I couldn't find one for this particular issue. A couple of points, first: I have no control over our Sharepoint server. I cannot tweak any..

Exists Angularjs code/naming conventions?

Does anyone know if exists any official or most accepted reference for Angular naming conventions to use when we build our applications? Angular has many different types of components such as filters,..

What does the "$" sign mean in jQuery or JavaScript?

Possible Duplicate: What is the meaning of “$” sign in JavaScript Now this must seem to be an easy and stupid question to ask but I must know why we use the dollar ($) symbol in..

Fatal error: Maximum execution time of 30 seconds exceeded

I am downloading a JSON file from an online source and and when it runs through the loop I am getting this error: Fatal error: Maximum execution time of 30 seconds exceeded in C:\wamp\www\temp\fet..

"Error 1067: The process terminated unexpectedly" when trying to start MySQL

I'm using Windows 7 and running XAMPP MySQL SVC service. I'm seeing the following error: Windows could not start the Mysql service on Local Computer. Error 1067: The process terminated unexpectedly. ..

How to check if a number is between two values?

In JavaScript, I'm telling the browser to do something if the window size is greater than 500px. I do it like so: if (windowsize > 500) { // do this } This works great, but I would like to a..

I didn't find "ZipFile" class in the "System.IO.Compression" namespace

I can't use "Zipfile" class in the name space "System.IO.Compression" my code is : using System; using System.IO; using System.IO.Compression; namespace ConsoleApplication { class Program { ..

Calculating distance between two points, using latitude longitude?

Here's my try, it's just a snippet of my code: final double RADIUS = 6371.01; double temp = Math.cos(Math.toRadians(latA)) * Math.cos(Math.toRadians(latB)) * Math.cos(Math.toR..

Is it possible to specify proxy credentials in your web.config?

I need to configure a website to access a webservice on another machine, via a proxy. I can configure the website to use a proxy, but I can't find a way of specifying the credentials that the proxy r..

Are table names in MySQL case sensitive?

Are table names in MySQL case sensitive? On my Windows development machine the code I have is able to query my tables which appear to be all lowercase. When I deploy to the test server in our datacen..

How do I properly escape quotes inside HTML attributes?

I have a drop down on a web page which is breaking when the value string contains a quote. The value is "asd, but in the DOM it always appears as an empty string. I have tried every way I know to es..

Copy Files from Windows to the Ubuntu Subsystem

I have enabled developer mode and installed Bash on Ubuntu on Windows. My home directory can be found under %localappdata%\Lxss\home\<ubuntu.username>\, i have created a sub-directory called Pi..

The module was expected to contain an assembly manifest

I have a project in c# that uses c++ library and some dlls. When I run it it works great. The library is Awesomium, contains both c++ library and c# wrappers When I create reference to this project ..

ActiveX component can't create object

I have just installed a third party app on my Windows Server 2008 server and I get the ActiveX Component can't create object message when I try to access using a CreateObject in VBScript. It i..

HTML img tag: title attribute vs. alt attribute?

I was browsing Amazon and I noticed that when searching "1TB" if you hover the mouse cursor over the stars rating image, you only see the score if using IE. If you are using another browser then the..

How do I upload a file to an SFTP server in C# (.NET)?

Does a free .NET library exist with which I can upload a file to a SFTP (SSH FTP) server, which throws exceptions on problems with the upload and allows the monitoring of its progress?..

ExpressJS - throw er Unhandled error event

I created expressjs application using the following commands: express -e folderName npm install ejs --save npm install When I run the application with: node app.js, I have the following errors: ev..

How can I perform an inspect element in Chrome on my Galaxy S3 Android device?

How can I perform an inspect element in Chrome on my Galaxy S3 Android device? I've tried a couple of guides online, one saying to use this android SDK thing to run adb forward tcp:9222 localabstract..

Remove all occurrences of a value from a list?

In Python remove() will remove the first occurrence of value in a list. How to remove all occurrences of a value from a list? This is what I have in mind: >>> remove_values_from_list([1, 2..

Invalid default value for 'dateAdded'

I got a stupid problem with SQL that I can't fix. ALTER TABLE `news` ADD `dateAdded` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP AUTO_INCREMENT , ADD PRIMARY KEY ( `dateAdded` ) Error: (#10..

How do I create ColorStateList programmatically?

I am trying to create a ColorStateList programatically using this: ColorStateList stateList = new ColorStateList(states, colors); But I am not sure what are the two parameters. As per the docum..

Android Center text on canvas

I'm trying to display a text using the code below. The problem is that the text is not centered horizontally. When I set the coordinates for drawText, it sets the bottom of the text at this position. ..

How many socket connections possible?

Has anyone an idea how many tcp-socket connections are possible on a modern standard root server? (There is in general less traffic on each connection, but all the connections have to be up all the ti..

HEAD and ORIG_HEAD in Git

What do these symbols refer to and what do they mean? (I can't find any explanation in official documentation)..

How do you add a JToken to an JObject?

I'm trying to add a JSON object from some text to an existing JSON file using JSON.Net. For example if I have the JSON data as below: { "food": { "fruit": { "apple": { "colour":..

How to extract epoch from LocalDate and LocalDateTime?

How do I extract the epoch value to Long from instances of LocalDateTime or LocalDate? I've tried the following, but it gives me other results: LocalDateTime time = LocalDateTime.parse("04.02.2014 ..

Encode html entities in javascript

I am working in a CMS which allows users to enter content. The problem is that when they add symbols ® , it may not display well in all browsers. I would like to set up a list of symbols that must be..

What is the official "preferred" way to install pip and virtualenv systemwide?

Is it this, which people seem to recommend most often: $ sudo apt-get install python-setuptools $ sudo easy_install pip $ sudo pip install virtualenv Or this, which I got from http://www.pip-instal..

Using multiple parameters in URL in express

I am using Express with Node and I have a requirement in which the user can request the URL as: http://myhost/fruit/apple/red. Such a request will return a JSON response. The JSON data, before t..

How to get a parent element to appear above child

I have two nested CSS elements. I need to get the parent to be on top, that is, above in z-axis, of the child element. Just setting z-index is not sufficient. I can't set a negative z-index on the c..

How to Customize a Progress Bar In Android

I am working on an app in which I want to show a ProgressBar, but I want to replace the default Android ProgressBar. So how can I customize the ProgressBar? Do I need some graphics and animation for..

Selecting a row in DataGridView programmatically

How can I select a particular range of rows in a DataGridView programmatically at runtime?..

here-document gives 'unexpected end of file' error

I need my script to send an email from terminal. Based on what I've seen here and many other places online, I formatted it like this: /var/mail -s "$SUBJECT" "$EMAIL" << EOF Here's a line of my..

PHP - warning - Undefined property: stdClass - fix?

I get this warning in my error logs and wanted to know how to correct this issues in my code. Warning: PHP Notice: Undefined property: stdClass::$records in script.php on line 440 Some Code: // P..

Creating a file only if it doesn't exist in Node.js

We have a buffer we'd like to write to a file. If the file already exists, we need to increment an index on it, and try again. Is there a way to create a file only if it doesn't exist, or should I jus..

Javascript - How to show escape characters in a string?

Very simple question, but for some reason I can't find the answer anywhere after 10 minutes of Googling. How can I show escape characters when printing in Javascript? Example: str = "Hello\nWorld"; ..

jackson deserialization json to java-objects

Here is my Java code which is used for the de-serialization, i am trying to convert json string into java object. In doing so i have used the following code: package ex1jackson; import com.fasterxml..

What is the correct way to declare a boolean variable in Java?

I have just started learning Java. In the online course I am following, I am asked to try the following code: String email1 = "[email protected]"; String email2 = "[email protected]"; Boolean isMatch = false; i..

json_decode() expects parameter 1 to be string, array given

What causes this error in my code? $query = $this->db->query("SELECT * FROM tour_foreign ORDER BY id desc"); $data = array(); foreach ($query->result() as $row) $..

python request with authentication (access_token)

I am trying to get an API query into python. The command line curl --header "Authorization:access_token myToken" https://website.com/id gives some json output. myToken is a hexadecimal variable tha..

The origin server did not find a current representation for the target resource or is not willing to disclose that one exists. on deploying to tomcat

I have built an application using Spring with Eclipse IDE. When I launch the project from Eclipse IDE everything is fine but when I package the maven project as a war file and deployed to separate tom..

Xcode 8 shows error that provisioning profile doesn't include signing certificate

Xcode 8 shows error that provisioning profile doesn't include signing certificate. This issue is with Xcode-8 only with Xcode 7, same provisioning profile showing related identified certificate...

Navigation drawer: How do I set the selected item at startup?

My code works perfectly: every time an item in Navigation Drawer is clicked the item is selected. Of course I want to start the app with a default fragment (home), but Navigation Drawer doesn't have ..

Multiple Errors Installing Visual Studio 2015 Community Edition

When installing Visual Studio 2015 Community Edition on Windows 10, using the web installer, everything runs fine, however, the following packages fail to install: Team Explorer for Visual Studio 20..

Is it a good practice to place C++ definitions in header files?

My personal style with C++ has always to put class declarations in an include file, and definitions in a .cpp file, very much like stipulated in Loki's answer to C++ Header Files, Code Separation. Adm..

Best Timer for using in a Windows service

I need to create some windows service which will execute every N period of time. The question is: Which timer control should I use: System.Timers.Timer or System.Threading.Timer one? Does it influence..

Fastest way to write huge data in text file Java

I have to write huge data in text[csv] file. I used BufferedWriter to write the data and it took around 40 secs to write 174 mb of data. Is this the fastest speed java can offer? bufferedWriter = new..

Auto height of div

Browser shows div only when I set exact height. But i want to create resizable div according it's contents. Tried height: auto and height:100%. It doesn't help. My div looks like that. It's backgroun..

Best way to work with dates in Android SQLite

I'm having some trouble working with dates on my Android application that uses SQLite. I have a couple questions: What type should I use to store dates in SQLite (text, integer, ...)? Given the best..

How to change dot size in gnuplot

How to change point size and shape and color in gnuplot. plot "./points.dat" using 1:2 title with dots I am using above command to plot graph ,but it shows very small size points. I tried to use c..

How can I check if a single character appears in a string?

In Java is there a way to check the condition: "Does this single character appear at all in string x" without using a loop?..

jQuery CSS Opacity

What's wrong? I want to change the opacity if #nav .drop is display:block; jQuery(document).ready(function(){ if (jQuery('#nav .drop').css('display') === 'block') { jQuery('#main').css('o..

Finding last occurrence of substring in string, replacing that

So I have a long list of strings in the same format, and I want to find the last "." character in each one, and replace it with ". - ". I've tried using rfind, but I can't seem to utilize it properly ..

php check if array contains all array values from another array

$all = array ( 0 => 307, 1 => 157, 2 => 234, 3 => 200, 4 => 322, 5 => 324 ); $search_this = array ( 0 => 200, 1 => 234 ); I would like to find..

What does "./" (dot slash) refer to in terms of an HTML file path location?

I know ../ means go up a path, but what does ./ mean exactly? I was recently going through a tutorial and it seems to be referring to just a file in the same location, so is it necessary at all? Can ..

DateTime vs DateTimeOffset

Currently, we have a standard way of dealing with .NET DateTime's in a TimeZone aware way: Whenever we produce a DateTime we do it in UTC (e.g. using DateTime.UtcNow), and whenever we display one, we ..

How to force a WPF binding to refresh?

I have got a combo box with items source attached using simple binding. Is there any way to refresh this binding once combo box is loaded?..

URL format with GET parameters?

Is there a specification somewhere listing the correct way to pass GET variables to a URL? Normally I do it like this (first variable indicated by ?, second and subsequent indicated by &: http:/..

How to retrieve inserted id after inserting row in SQLite using Python?

How to retrieve inserted id after inserting row in SQLite using Python? I have table like this: id INT AUTOINCREMENT PRIMARY KEY, username VARCHAR(50), password VARCHAR(50) I insert a new row with ..

Format numbers in JavaScript similar to C#

Is there a simple way to format numbers in JavaScript, similar to the formatting methods available in C# (or VB.NET) via ToString("format_provider") or String.Format()?..

How to correctly link php-fpm and Nginx Docker containers?

I am trying to link 2 separate containers: nginx:latest php:fpm The problem is that php scripts do not work. Perhaps the php-fpm configuration is incorrect. Here is the source code, which is in my..

MS Access DB Engine (32-bit) with Office 64-bit

We currently have a major issue using Microsoft Access Database Engine 2010. The engine comes in 64-bit and 32-bit forms, which is good. However, apparently you need to always install the 32-bit versi..

Which Android phones out there do have a gyroscope?

I find it very hard to get any consolidating information about which Android phones do have a gyroscope, or if there are Android phones with this sensor at all. I read about some (especially Samsung) ..

Pie chart with jQuery

I want to create a pie chart in JavaScript. On searching I found the Google Charts API. Since we are using jQuery I found that there is jQuery integration for Google Charts available. But my problem..

How to get row count in an Excel file using POI library?

Guys I'm currently using the POI 3.9 library to work with excel files. I know of the getLastRowNum() function, which returns a number of rows in an Excel file. The only problem is getLastRowNum() ret..

Why are unnamed namespaces used and what are their benefits?

I just joined a new C++ software project and I'm trying to understand the design. The project makes frequent use of unnamed namespaces. For example, something like this may occur in a class definiti..

Accessing MVC's model property from Javascript

I have the following model which is wrapped in my view model public class FloorPlanSettingsModel { public int Id { get; set; } public int? MainFloorPlanId { get; set; } public string Imag..

How to unpack and pack pkg file?

I have a pkg file created by Install Maker for Mac. I want to replace one file in pkg. But I must do this under Linux system, because this is a part of download process. When user starts to download f..

Vue equivalent of setTimeout?

I'm making a shopping cart system with Laravel and Vue. When I add an item to the basket, I display a confirmation message by toggling a Vue variable being watched by a v-if: <div class="alert ale..

QuotaExceededError: Dom exception 22: An attempt was made to add something to storage that exceeded the quota

Using LocalStorage on iPhone with iOS 7 throws this error. I've been looking around for a resolvant, but considering I'm not even browsing in private, nothing is relevant. I don't understand why loca..

System.BadImageFormatException: Could not load file or assembly (from installutil.exe)

I am trying to install a Windows service using InstallUtil.exe and am getting the error message System.BadImageFormatException: Could not load file or assembly '{xxx.exe}' or one of its dependenci..

How to change link color (Bootstrap)

<div class="collapse navbar-collapse"> <ul class="nav pull-right"> <li class="active"><a href="#">? ???</a></li> ..

How to load a resource bundle from a file resource in Java?

I have a file called mybundle.txt in c:/temp - c:/temp/mybundle.txt How do I load this file into a java.util.ResourceBundle? The file is a valid resource bundle. This does not seem to work: java.n..

You need to use a Theme.AppCompat theme (or descendant) with this activity

Android Studio 0.4.5 Android documentation for creating custom dialog boxes: http://developer.android.com/guide/topics/ui/dialogs.html If you want a custom dialog, you can instead display an Activit..

How to append text to a text file in C++?

How to append text to a text file in C++? And create a new text file if it does not already exist and append text to it if it does exist...

urllib2 and json

can anyone point out a tutorial that shows me how to do a POST request using urllib2 with the data being in JSON format?..

getting JRE system library unbound error in build path

getting a JRE system library unbound error in build path, tried all suggestions from the below links, however did not work. I have jdk 1.6.0_29, I have also tried to install other versions but no help..

What is the default boolean value in C#?

A boolean (bool) can't be null. And: bool foo; if(foo){} // Use of unassigned local variable 'foo' Why the default value is not false? So what is the value if it is not null? What is the reason? E..

ORA-01036: illegal variable name/number when running query through C#

I am trying to use ALTER USER query for Oracle database using OracleCommand in C# in the following code. It creates the query if the values for Username and password are not empty strings. But I get a..

How to recover a dropped stash in Git?

I frequently use git stash and git stash pop to save and restore changes in my working tree. Yesterday I had some changes in my working tree that I had stashed and popped, and then I made more changes..

Regular expression negative lookahead

In my home directory I have a folder drupal-6.14 that contains the Drupal platform. From this directory I use the following command: find drupal-6.14 -type f -iname '*' | grep -P 'drupal-6.14/(?!sit..

How to effectively work with multiple files in Vim

I've started using Vim to develop Perl scripts and am starting to find it very powerful. One thing I like is to be able to open multiple files at once with: vi main.pl maintenance.pl and then hop..