Questions Tagged with #Pshost

How can I trigger the click event of another element in ng-click using angularjs?

I'm trying to trigger the click event of the <input type="file"> element from the button. <input id="upload" type="file" ng-file-select="onFileSelect($files)" style="display: non..

Twitter Bootstrap: Print content of modal window

I'm developing a site using Bootstrap which has 28 modal windows with information on different products. I want to be able to print the information in an open modal window. Each window has an id. &l..

How to set bootstrap navbar active class with Angular JS?

If I have a navbar in bootstrap with the items Home | About | Contact How do I set the active class for each menu item when they are active? That is, how can I set class="active" when the angular r..

Session state can only be used when enableSessionState is set to true either in a configuration

I am working on MVC 2 app with c# by using vs 2010.I am having below mentioned error when I run my app locally under debug mode. Error message image is as below : Error message text is as..

check if variable empty

if ($user_id == NULL || $user_name == NULL || $user_logged == NULL) { $user_id = '-1'; $user_name = NULL; $user_logged = NULL; } if ($user_admin == NULL) { $user_admin = NULL; } Is ..

How to split CSV files as per number of rows specified?

I've CSV file (around 10,000 rows ; each row having 300 columns) stored on LINUX server. I want to break this CSV file into 500 CSV files of 20 records each. (Each having same CSV header as present i..

VBA procedure to import csv file into access

i need procedure in VBA to import data into access from csv excel file without some records,, as header and footer. Example,,, i have table in csv file, which contains some sentence which not belon..

setting textColor in TextView in layout/main.xml main layout file not referencing colors.xml file. (It wants a #RRGGBB instead of @color/text_color)

I'm trying to set some general colors for a program I'm writing. I created a colors.xml file and am trying to directly reference the colors from the layout.xml file. I believe I'm am doing this correc..

Reading a .txt file using Scanner class in Java

I am working on a Java program that reads a text file line-by-line, each with a number, takes each number throws it into an array, then tries and use insertion sort to sort the array. I need help with..

jQuery.ajax returns 400 Bad Request

This works fine: jQuery('#my_get_related_keywords').click(function() { if (jQuery('#my_keyword').val() == '') return false; jQuery.getJSON("" ..

Write values in app.config file

can anyone please help me how can I set/store values in the app.config file using c#, is it possible at all?..

How to sort a Pandas DataFrame by index?

When there is an DataFrame like the following: import pandas as pd df = pd.DataFrame([1, 1, 1, 1, 1], index=[100, 29, 234, 1, 150], columns=['A']) How can I sort this dataframe by index with each c..

How to do a LIKE query with linq?

How can i perform an LIKE query within Linq? I have the following query i would like to execute. var results = from c in db.costumers where c.FullName LIKE "%"+FirstName+"%,"+LastName ..

How to get the current location latitude and longitude in android

In my application, I get the current location's latitude and longitude when application is open, but not when the application is closed. I am using Service class to get the current location latitude ..

How can I write output from a unit test?

Any call in my unit tests to either Debug.Write(line) or Console.Write(Line) simply gets skipped over while debugging and the output is never printed. Calls to these functions from within classes I'm ..

Why shouldn't I use PyPy over CPython if PyPy is 6.3 times faster?

I've been hearing a lot about the PyPy project. They claim it is 6.3 times faster than the CPython interpreter on their site. Whenever we talk about dynamic languages like Python, speed is one of the..

Remove all whitespace from C# string with regex

I am building a string of last names separated by hyphens. Sometimes a whitespace gets caught in there. I need to remove all whitespace from end result. Sample string to work on: Anderson -Reed-S..

SpringMVC RequestMapping for GET parameters

How to make the RequestMapping to handle GET parameters in the url? For example i have this url http://localhost:8080/userGrid?_search=false&nd=1351972571018&rows=10&page=1&sidx=id&am..

Perform a Shapiro-Wilk Normality Test

I want to perform a Shapiro-Wilk Normality Test test. My data is csv format. It looks like this: heisenberg HWWIchg 1 -15.60 2 -21.60 3 -19.50 4 -19.10 5 -20.90 6 -20.70 7 -..

How do you view ALL text from an ntext or nvarchar(max) in SSMS?

How do you view ALL text from an NTEXT or NVARCHAR(max) in SQL Server Management Studio? By default, it only seems to return the first few hundred characters (255?) but sometimes I just want a quick ..

Java Error: illegal start of expression

I'm basically refining, completing and trying to compile a test code from a reference book for java beginners. The objective is to create a guessing game wherein the target is located in 3 continuous ..

How do I edit $PATH (.bash_profile) on OSX?

I am trying to edit an entry to PATH, as I did something wrong. I am using Mac OS X 10.10.3 I have tried: > touch ~/.bash_profile; open ~/.bash_profile But the file editor opens with nothin..

"message failed to fetch from registry" while trying to install any module

I can't install any node module from the npm. npm install The above command resulted to below output, it is not able to install npm http GET

How to replace a set of tokens in a Java String?

I have the following template String: "Hello [Name] Please find attached [Invoice Number] which is due on [Due Date]". I also have String variables for name, invoice number and due date - what's the ..

Swift Beta performance: sorting arrays

I was implementing an algorithm in Swift Beta and noticed that the performance was very poor. After digging deeper I realized that one of the bottlenecks was something as simple as sorting arrays. The..

Understanding esModuleInterop in tsconfig file

I was checking out someone .tsconfig file and there I spotted --esModuleInterop This is his .tsconfig file { "compilerOptions": { "moduleResolution": "node", &q..

adb uninstall failed

I am writing some sample apps. After I debug these apps, I don't see an uninstall button in my device's application management. When I do adb uninstall, it always says Failure without any reason. In D..

jquery change style of a div on click

I have a div, with a specific style(let's say a certain background). What I want is, when one clicks on a list element having that div applied another specific style (another background type) to be a..

how to query for a list<String> in jdbctemplate

I'm using springs jdbctemplate and running a query like below: SELECT COLNAME FROM TABLEA GROUP BY COLNAME There are no named parameters being passed, however, column name, COLNAME, will be passed b..

IntelliJ - Convert a Java project/module into a Maven project/module

I have a project on Bitbucket. Only the sources are committed. To retrieve the project onto a new machine, I used Version Control > Checkout from Version Control from within IntelliJ. It then asks wh..

Cast received object to a List<object> or IEnumerable<object>

I'm trying to perform the following cast private void MyMethod(object myObject) { if(myObject is IEnumerable) { List<object> collection = (List<object>)myObject; ..

Android: Flush DNS

We recently released an android application that pulls information from an external server. Last week we moved from shared hosting to a dedicated server, that went smoothly up until we started gettin..

How to convert date in to yyyy-MM-dd Format?

Sat Dec 01 00:00:00 GMT 2012 I have to convert above date into below format 2012-12-01 How can i? i have tried with following method but its not working public Date ConvertDate(Date date..

How do I get the current time only in JavaScript

How can I get the current time in JavaScript and use it in a timepicker? I tried var x = Date() and got: Tue May 15 2012 05:45:40 GMT-0500 But I need only current time, for example, 05:45 How..

How to set TextView textStyle such as bold, italic

How to set TextView style (bold or italic) within Java and without using the XML layout? In other words, I need to write android:textStyle with Java...

DB query builder toArray() laravel 4

I'm trying to convert a query to an array with the method toArray() but it doesn't work for the query builder. Any ideas for convert it? Example DB::table('user')->where('name',=,'Jhon')->get(..

c# write text on bitmap

I have following problem. I want to make some graphics in c# windows form. I want to read bitmap to my program and after it write some text on this bitmap. In the end I want this picture load to pict..

Label word wrapping

Is there a way to do a word wrap in a .NET label control? I know there is an alternate way of using a TextBox, make property BorderStyle to none, property ReadOnly to true and set property WordWrap a..

How to use ng-if to test if a variable is defined

Is there a way to use ng-if to test if a variable is defined, not just if it's truthy? In the example below (live demo), the HTML displays a shipping cost for the red item only, because item.shipping..

How to restart a windows service using Task Scheduler

The easiest way to do this is to create a batch file with: NET stop <service name> NET start <service name> Once the batch file is created and tested, add it to Windows Task Scheduler a..

VB.Net .Clear() or txtbox.Text = "" textbox clear methods

Not far into programming and just joined this forum of mighty company so this is a silly question, but what is the best way to clear textboxes in VB.Net and what is the difference between the two meth..

XSLT string replace

I don't really know XSL but I need to fix this code, I have reduced it to make it simpler. I am getting this error Invalid XSLT/XPath function on this line <xsl:variable name="text" select=..

AngularJS event on window innerWidth size change

I'm looking for a way to watch changes on window inner width size change. I tried the following and it didn't work: $scope.$watch('window.innerWidth', function() { console.log(window.innerWidth)..

X-Frame-Options on apache

I am trying to allow some particular domain to access my site via iframe Header set X-Frame-Options ALLOW-FROM I know this could be done by add the line above to the conf..

sending mail from Batch file

We have a script to backup files. After the backup operation is over, we would like to send a report as an email notification to some of our email addresses. How could this be done?..

How do I trigger a macro to run after a new mail is received in Outlook?

I'm writing a macro that creates tickets on a database based on alerts received from a Nagios server as an email. However, I cannot let the macro run in an infinite loop while checking for mails becau..

How to use <md-icon> in Angular Material?

I was wondering how to use Material's icons, as this is not working: <material-icon icon = "/img/icons/ic_access_time_24px.svg"> </material-icon> I guess there is a problem with the p..

Server Client send/receive simple text

I have a homework to build an application which will send and receive simple string between server and client. I know how to establish connection, but don't know how to send and receive string. This i..

Calling C++ class methods via a function pointer

How do I obtain a function pointer for a class member function, and later call that member function with a specific object? I’d like to write: class Dog : Animal { Dog (); void bark (); } ..

How to find all the dependencies of a table in sql server

I have a database where i have list of tables,procedures,views and triggers. But i want a query to get all the dependencies of a table including child tables which are referring the parent table...

java : non-static variable cannot be referenced from a static context Error

The following code is generating an error on the variable con2 saying "non-static variable con2 cannot be referenced from a static context Error." I Googled for a resolution and they are suggesting t..

Using grep to search for a string that has a dot in it

I am trying to search for a string 0.49 (with dot) using the command grep -r "0.49" * But what happening is that I am also getting unwanted results which contains the string such as 0449, 0949 etc,..

UIView Hide/Show with animation

My simple goal is to fade animate hiding and showing functions. Button.hidden = YES; Simple enough. However, is it possible to have it fade out rather than just disappearing? It looks rather unprof..

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

Few days ago I had quite a headache with authentication problems when using Windows authentication between client and wcf web service. The error I was getting was "The HTTP request is unauthorized wit..

stopPropagation vs. stopImmediatePropagation

What's the difference between event.stopPropagation() and event.stopImmediatePropagation()?..

Get properties and values from unknown object

From the world of PHP I have decided to give C# a go. I've had a search but can't seem to find the answer of how to do the equivalent to this. $object = new Object(); $vars = get_class_vars(get_clas..

What are the differences between git branch, fork, fetch, merge, rebase and clone?

I want to understand the difference between a branch, a fork and a clone in Git? Similarly, what does it mean when I do a git fetch as opposed to a git pull? Also, what does rebase mean in comparis..

Good PHP ORM Library?

Is there a good object-relational-mapping library for PHP? I know of PDO/ADO, but they seem to only provide abstraction of differences between database vendors not an actual mapping between the doma..

Can we import XML file into another XML file?

Can we import an XML file into another XML file? I mean is there any import tag in XML that takes XML path as parameter and imports XML (for which path is provided)...

Moment.js - two dates difference in number of days

I get incorrect results when trying to find numeric difference between two dates: var startDate = moment( $('[name="date-start"]').val(), "DD.MM.YYYY"), // $('[name="date-start"]').val() === "13.04.2..

How do I compare two strings in Perl?

How do I compare two strings in Perl? I am learning Perl, I had this basic question looked it up here on StackOverflow and found no good answer so I thought I would ask...

CSS: fixed to bottom and centered

I need my footer to be fixed to the bottom of the page and to center it. The contents of the footer may change at all time so I can't just center it via margin-left: xxpx; margin-right: xxpx; The pro..

TCPDF Save file to folder?

I'm using TCPDF to print a receipt and then send it to customer with phpMailer, but I have a problem: I have no idea how to save the file into a pdf. I've tried this: // reset pointer to the last ..

Wordpress plugin install: Could not create directory

I'm using WordPress on centos 6. I try to install a plugin. But I got this error: Installing Plugin: bbPress 2.5.9 Downloading install package from

Is there any 'out-of-the-box' 2D/3D plotting library for C++?

I looked at the different options for plotting functions (or other types of graphs) in an interactive window. I mostly use wxWidgets but I'd be open to any other "interfaces". Looking at what is ava..

Package php5 have no installation candidate (Ubuntu 16.04)

When i try to install php5 in Ubuntu 16.04 by using following code: sudo apt-get install php5 php5-mcrypt I get following error: Reading package lists... Done Building dependency tree Readi..

Is it possible to have a HTML SELECT/OPTION value as NULL using PHP?

The following is a snippet from my HTML form which pulls the options from the table rows accordingly. What I want to do is have the first option value to be NULL so when no choice is made, NULL is en..

Is not required for packages in Python 3.3+

I am using Python 3.5.1. I read the document and the package section here: Now, I have the following structure: /home/wujek/Playground/a/b/mo..

How to make background of table cell transparent

I am creating a table inside a table for my "all users" page. The first table was divided in to two parts--the ads and the users--. Inside the "users" table under <tr><td&..

What is the difference between Serializable and Externalizable in Java?

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

How to query MongoDB with "like"?

I want to query something with SQL's like query: SELECT * FROM users WHERE name LIKE '%m%' How to do I achieve the same in MongoDB? I can't find an operator for like in the documentation...

XMLHttpRequest cannot load file. Cross origin requests are only supported for HTTP

I am getting the following error: XMLHttpRequest cannot load file:///C:/Users/richa.agiwal/Desktop/get/rm_Library/templates/template_viewSettings.html. Cross origin requests are only supported for HT..

How to concatenate a std::string and an int?

I thought this would be really simple but it's presenting some difficulties. If I have std::string name = "John"; int age = 21; How do I combine them to get a single string "John21"?..

How to fix Uncaught InvalidValueError: setPosition: not a LatLng or LatLngLiteral: in property lat: not a number?

I'm trying to port my googlemaps v2 functions to v3. But somehow i stuck in a strange error and i could not find, what i'm doing wrong. Error : Uncaught InvalidValueError: setPosition: not a LatL..

add new element in laravel collection object

I want to add new element in $items array, I don't want to use joins for certain reasons. $items = DB::select(DB::raw('SELECT * FROM items WHERE = '.$id.' ;')); foreach($items as $i..

Best way to test exceptions with Assert to ensure they will be thrown

Do you think that this is a good way for testing exceptions? Any suggestions? Exception exception = null; try{ //I m sure that an exeption will happen here } catch (Exception ex){ exception =..

Disable form autofill in Chrome without disabling autocomplete

How can we disable Chrome's autofill feature on certain <input>s to prevent them from being automatically populated when the page loads? At the same time I need to keep autocomplete enabled, s..

What is parsing in terms that a new programmer would understand?

I am a college student getting my Computer Science degree. A lot of my fellow students really haven't done a lot of programming. They've done their class assignments, but let's be honest here those ..

How to get history on react-router v4?

I having some little issue migrating from React-Router v3 to v4. in v3 I was able to do this anywhere: import { browserHistory } from 'react-router'; browserHistory.push('/some/path'); How do I ach..

Check if xdebug is working

Without installing a texteditor or an IDE, is it possible to test if xdebug is working, i.e. if it can debug php code? The only part xdebug comes up in phpinfo() is the following: Additional .ini..

grep a tab in UNIX

How do I grep tab (\t) in files on the Unix platform?..

ng-change not working on a text input

I am new to angular js. In my code there is color picker initialized from a text field. User changes the value of color and I want that color to be reflected as a background of a text in a span. It is..

How do I make a new line in swift

Is there a way to have a way to make a new line in swift like "\n" for java? var example: String = "Hello World \n This is a new line" ..

Base64 encoding and decoding in client-side Javascript

Are there any methods in JavaScript that could be used to encode and decode a string using base64 encoding?..

How to remove multiple deleted files in Git repository

I have deleted some files and git status shows as below. I have committed and pushed. GitHub still shows the deleted files in the repository. How can I delete files in the GitHub repository? # On ..

UIButton Image + Text IOS

I need a UIButton with image & text. Image should be in the top & text comes under the image both should be clickable...

How to loop over grouped Pandas dataframe?

DataFrame: c_os_family_ss c_os_major_is l_customer_id_i 0 Windows 7 90418 1 Windows 7 90418 2 Windows 7 90418 ..

JavaScript set object key by variable

I am building some objects in JavaScript and pushing those objects into an array, I am storing the key I want to use in a variable then creating my objects like so: var key = "happyCount"; myArray.pu..

Combining the results of two SQL queries as separate columns

I have two queries which return separate result sets, and the queries are returning the correct output. How can I combine these two queries into one so that I can get one single result set with each ..

How to monitor the memory usage of Node.js?

How can I monitor the memory usage of Node.js?..

What are the differences between struct and class in C++?

This question was already asked in the context of C#/.Net. Now I'd like to learn the differences between a struct and a class in C++. Please discuss the technical differences as well as reasons for c..

Sending HTTP Post request with SOAP action using org.apache.http

I'm trying to write a hard-coded HTTP Post request with SOAP action, using the org.apache.http api. My problem is I didn't find a way to add a request body (in my case - SOAP action). I'll be glad for..

How to change ViewPager's page?

I'm using ViewPager in my app and define it in the main Activity. Inside onCreate method I load some number of pages from SharedPreferences and then pass it to PagerAdapter: @Override public int getC..

How to select last child element in jQuery?

How to select last child element in jQuery? Just the last child, not its descendants...

How can I get a file's size in C++?

Let's create a complementary question to this one. What is the most common way to get the file size in C++? Before answering, make sure it is portable (may be executed on Unix, Mac and Windows), relia..

Superscript in markdown (Github flavored)?

Following this lead, I tried this in a Github <span style="vertical-align: baseline; position: relative;top: -0.5em;>text in superscript</span> Does not work, the text appear..

angular-cli where is webpack.config.js file - new angular6 does not support ng eject

UPDATE: December 2018 (see 'Aniket' answer) With Angular CLI 6 you need to use builders as ng eject is deprecated and will soon be removed in 8.0 UPDATE: June 2018: Angular 6 does not support ng eje..

Global npm install location on windows?

I'm not 100% sure, but I believe I installed node v5 from the windows installer on both my home and office PCs. On my home PC global installs happen under %APPDATA%: (dev) go|c:\srv> which lessc ..

JsonParseException : Illegal unquoted character ((CTRL-CHAR, code 10)

I'm trying to use org.apache.httpcomponents to consume a Rest API, which will post JSON format data to API. I get this exception: Caused by: com.fasterxml.jackson.core.JsonParseException: Illega..

Summarizing count and conditional aggregate functions on the same factor

Quick and short of it is I'm having problems summarizing count and aggregate functions with conditions on the same factor. Suppose I have this dataframe: library(dplyr) df = tbl_df(data.frame( ..

PHP Include for HTML?

I have a navigational bar, an image, and a heading that I'll be including in every page of my website, so I wanted to use php include to refer to this code in several pages. However, I think I may hav..

Links in <select> dropdown options

Is it possible for each dropdown options to link somewhere when selected without the need for an external button? <select> <option value="x">x</option> <option value="y">y..

Converting of Uri to String

Is it possible to convert an Uri to String and vice versa? Because I want to get the the Uri converted into String to pass into another activity via intent.putextra() and if it's not possible can anyo..

Google Chrome redirecting localhost to https

When I debug a Visual Studio project using Chrome the browser tries to redirect to the https equivalent of my web address. I do not have SSL enabled in the web project and the start URL is the http UR..

What is external linkage and internal linkage?

I want to understand the external linkage and internal linkage and their difference. I also want to know the meaning of const variables internally link by default unless otherwise declared as ex..

What is the best collation to use for MySQL with PHP?

I'm wondering if there is a "best" choice for collation in MySQL for a general website where you aren't 100% sure of what will be entered? I understand that all the encodings should be the same, such ..

How to initialize a list of strings (List<string>) with many string values

How is it possible to initialize (with a C# initializer) a list of strings? I have tried with the example below but it's not working. List<string> optionList = new List<string> { "Add..

How to add smooth scrolling to Bootstrap's scroll spy function

I've been trying to add a smooth scrolling function to my site for a while now but can't seem to get it to work. Here is my HTML code relating to my navigation: <div id="nav-wrapper"> <di..

rotate image with css

I would like to rotate an image by 90 degrees with CSS only. I can do the rotation, but then the position of the image is not what it should be. First, it will overlay some other elements in the same..

How can I style even and odd elements?

Is it possible to use CSS pseudo-classes to select even and odd instances of list items? I'd expect the following to produce a list of alternating colors, but instead I get a list of blue items: <..

How can I define an array of objects?

I am creating an array of objects in TypeScript: userTestStatus xxxx = { "0": { "id": 0, "name": "Available" }, "1": { "id": 1, "name": "Ready" }, "2": { "id": 2, "name": "Started" } };..

How to call a RESTful web service from Android?

I have written a REST web service in Netbean IDE using Jersey Framework and Java. For every request the user needs to provide a username and a password, I know that this authentication is not a best..

Python 3 turn range to a list

I'm trying to make a list with numbers 1-1000 in it. Obviously this would be annoying to write/read, so I'm attempting to make a list with a range in it. In Python 2 it seems that: some_list = range(..

Comparing two hashmaps for equal values and same key sets?

How can I best compare two HashMaps, if I want to find out if none of them contains different keys than the other, and if the values of that keys match each other. Map<objA, objB> mapA = new Ha..

TensorFlow not found using pip

I'm trying to install TensorFlow using pip: $ pip install tensorflow --user Collecting tensorflow Could not find a version that satisfies the requirement tensorflow (from versions: ) No matching dist..

Call js-function using JQuery timer

Is there anyway to implement a timer for JQuery, eg. every 10 seconds it needs to call a js function. I tried the following window.setTimeout(function() { alert('test'); }, 10000); but this only..

Output in a table format in Java's System.out

I'm getting results from a database and want to output the data as a table in Java's standard output I've tried using \t but the first column I want is very variable in length. Is there a way to dis..

Why does the PHP json_encode function convert UTF-8 strings to hexadecimal entities?

I have a PHP script that deals with a wide variety of languages. Unfortunately, whenever I try to use json_encode, any Unicode output is converted to hexadecimal entities. Is this the expected behavio..

Visual Studio 2017: Display method references

How can I display the references on top of a method declaration? I looked for it in the Visual Studio properties, but could not find it...

LaTeX source code listing like in professional books

How should a latex source code listing look like to produce an output like in known books, for example one for the Spring Framework? I've tried with the latex listings package but wasn't able to produ..

Simplest way to detect keypresses in javascript

I have an idea for a game in javascript (I'm going to make it with EaselJS) and I'll have to detect keypresses. After looking around on the internet I've seen a lot of suggestions (use window.onkeypre..

Rolling back local and remote git repository by 1 commit

I've read the similar posts on this topic, and can't for the life of me figure out how to do this properly. I checked in about 1000 files that I don't want, and I'd rather not have to go through 1by1..

git ignore vim temporary files

What is the correct way to make git ignore temporary files produced by vim in all directories (either globally across the system or locally for a single project)?..

How can I make a UITextField move up when the keyboard is present - on starting to edit?

With the iOS SDK: I have a UIView with UITextFields that bring up a keyboard. I need it to be able to: Allow scrolling of the contents of the UIScrollView to see the other text fields once the keyb..

Can I dispatch an action in reducer?

is it possible to dispatch an action in a reducer itself? I have a progressbar and an audio element. The goal is to update the progressbar when the time gets updated in the audio element. But I don't ..

Sticky and NON-Sticky sessions

I want to know the difference between sticky- and non-sticky sessions. What I understood after reading from internet: Sticky : only single session object will be there. Non-sticky session : session ..

Remove not alphanumeric characters from string

I want to convert the following string to the provided output. Input: "\\test\red\bob\fred\new" Output: "testredbobfrednew" I've not found any solution that will handle special characters like \r..

Set default heap size in Windows

I want to set Java heap size permanently and don't want to run every jar file with options. I use Windows and Java 1.7...

Retrofit 2: Get JSON from Response body

I want to get string json from my api using retrofit 2, I have no problem when using retrofit 1 to get this json but using retrofit 2 returns null for me. This is what my json looks like {"id":1,"Us..

How do you Change a Package's Log Level using Log4j?

I've encountered the following bug: It states the following: This error only occurs when log level for org.apache.axiom is DEBUG so a workarou..

Using LIKE in an Oracle IN clause

I know I can write a query that will return all rows that contain any number of values in a given column, like so: Select * from tbl where my_col in (val1, val2, val3,... valn) but if val1, for exa..

How to select option in drop down using Capybara

I'm trying to select an item from a drop down menu using Capybara (2.1.0). I want to select by number (meaning select the second, third, etc option). I've Googled like crazy trying all sorts of thin..

JAVA_HOME and PATH are set but java -version still shows the old one

I am using Linux Mint Cinnamon 14. I have set the $JAVA_HOME and $PATH environment variables in ~/.profile as follows: export JAVA_HOME=/home/aqeel/development/jdk/jdk1.6.0_35 export PATH=/home/aqeel..

Android - running a method periodically using postDelayed() call

I have a situation in an Android app where I want to start a network activity (sending out some data) which should run every second. I achieve this as follows: In the onCreate() I have the code: tv ..

Error CS1705: "which has a higher version than referenced assembly"

I've been looking into this for a bit now and haven't gotten it resolved. I get the following error message: Compiler Error Message: CS1705: Assembly 'My.Model, Version=1.1.4422.23773, Culture=neutra..

vba listbox multicolumn add

Possible Duplicate: Adding items in a Listbox with multiple columns With MFC VC++ there are two controls, ListBox and ListCtrl. But with VBA it seems we have only ListBox. I want to create..

Rules for C++ string literals escape character

What are the rules for the escape character \ in string literals? Is there a list of all the characters that are escaped? In particular, when I use \ in a string literal in gedit, and follow it by an..

Error reading JObject from JsonReader. Current JsonReader item is not an object: StartArray. Path

I am working on a Windows Phone 8.1 application involving location. I am receiving Json data from my API. My API returns data that looks like: [{ "country": "India", "city": "Mall Road, Gurga..

Why are empty catch blocks a bad idea?

I've just seen a question on try-catch, which people (including Jon Skeet) say empty catch blocks are a really bad idea? Why this? Is there no situation where an empty catch is not a wrong design deci..

Split a string using C++11

What would be easiest method to split a string using c++11? I've seen the method used by this post, but I feel that there ought to be a less verbose way of doing it using the new standard. Edit: I w..

How can you get the first digit in an int (C#)?

In C#, what's the best way to get the 1st digit in an int? The method I came up with is to turn the int into a string, find the 1st char of the string, then turn it back to an int. int start = Conver..

How to stop event bubbling on checkbox click

I have a checkbox that I want to perform some Ajax action on the click event, however the checkbox is also inside a container with it's own click behaviour that I don't want to run when the checkbox i..

How to display data from database into textbox, and update it

I can display my data in my textbox, dropdownlist after retrieve data from sql database, but when i proceed with my update button, the information edited in the textbox or dropdownlist wouldn't update..

How to display a readable array - Laravel

After I write: Route::get('/', function() { dd(User::all()); }); And after I refresh the browser I get an unreadable array. Is there a way to get that array in a readable format?..

How do I filter query objects by date range in Django?

I've got a field in one model like: class Sample(models.Model): date = fields.DateField(auto_now=False) Now, I need to filter the objects by a date range. How do I filter all the objects that ..

Oracle: SQL query to find all the triggers belonging to the tables?

how can i find all the triggers that belong to a table?..

React.js: onChange event for contentEditable

How do I listen to change event for contentEditable-based control? var Number = React.createClass({ render: function() { return <div> <span contentEditable={true} onC..

How to send a simple email from a Windows batch file?

I'm running Windows 2003 Service Pack 2. I have a batch file that runs on demand. I want to have an email sent every time the batch file runs. The email is simple, just a sentence indicating that the ..

Excel VBA select range at last row and column

I'm trying to create a macro that selects the range of last row and last column. E.g. I want to select 1, 2, 3, 4 from my spreadsheet and then delete the selection. Data: John | 10 | 10 | 10 Smith..

SecurityError: Blocked a frame with origin from accessing a cross-origin frame

I am loading an <iframe> in my HTML page and trying to access the elements within it using Javascript, but when I try to execute my code, I get the following error: SecurityError: Blocked a fra..

Android WebView style background-color:transparent ignored on android 2.2

I'm struggling to create a WebView with transparent background. webView.setBackgroundColor(0x00FFFFFF); webView.setBackgroundDrawable(myDrawable); Then I load a html page with <body style="bac..

How to create a link to another PHP page

I just converted some of my HTML pages to PHP pages, and I'm not that familiar with PHP. In my HTML pages, assuming it's just a static web app, I can link to another page quite simply by playing the f..

Google Chrome display JSON AJAX response as tree and not as a plain text

I cannot find an answer to this one: My AJAX calls return JSON data. In Google Chrome Developer Tools > Resources > XHR when I click on the resource on the left and then on the Content tab I see the ..

Recursive query in SQL Server

I have a table with following structure Table name: matches That basically stores which product is matching which product. I need to process this table And store in a groups table like below. Tab..

How to create a directory in Java?

How do I create Directory/folder? Once I have tested System.getProperty("user.home"); I have to create a directory (directory name "new folder" ) if and only if new folder does not exist...

How do I close an Android alertdialog

I am developing a quiz and I need the user to answer all the questions before proceeding. When the user has not answered all the questions I display a simple alertdialog informing him or her. The pro..

Deep copy in ES6 using the spread syntax

I am trying to create a deep copy map method for my Redux project that will work with objects rather than arrays. I read that in Redux each state should not change anything in the previous states. ex..

creating charts with angularjs

I've also been looking at charting solutions that will blend well with Angular.JS directives. I came across a few but got really confused. Does anyone have any suggestions for how to create interactiv..

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..

Get URL query string parameters

What is the "less code needed" way to get parameters from a URL query string which is formatted like the following? Output should be: myqueryhash ..

How do I find if a string starts with another string in Ruby?

What the best way to find if a string starts with another in Ruby (without rails)?..

rand() returns the same number each time the program is run

In this rather basic C++ code snippet involving random number generation: include <iostream> using namespace std; int main() { cout << (rand() % 100); return 0; } Why am I alwa..

Escaping Strings in JavaScript

Does JavaScript have a built-in function like PHP's addslashes (or addcslashes) function to add backslashes to characters that need escaping in a string? For example, this: This is a demo string ..

How do I convert special UTF-8 chars to their iso-8859-1 equivalent using javascript?

I'm making a javascript app which retrieves .json files with jquery and injects data into the webpage it is embedded in. The .json files are encoded with UTF-8 and contains accented chars like é, ö..

How to select all checkboxes with jQuery?

I need help with jQuery selectors. Say I have a markup as shown below: _x000D_ _x000D_ <form>_x000D_ <table>_x000D_ <tr>_x000D_ <td><input type="checkbox" id="s..

Python: For each list element apply a function across the list

Given [1,2,3,4,5], how can I do something like 1/1, 1/2, 1/3,1/4,1/5, ...., 3/1,3/2,3/3,3/4,3/5,.... 5/1,5/2,5/3,5/4,5/5 I would like to store all the results, find the minimum, and return the two..

Plotting using a CSV file

I have a csv file which has 5 entries on every row. Every entry is whether a network packet is triggered or not. The last entry in every row is the size of packet. Every row = time elapsed in ms. e.g..

Radio buttons not checked in jQuery

I have this line of code for page load: if ($("input").is(':checked')) { and it works fine when the radio button input is checked. However, I want the opposite. Something along the lines of if ..

The thread has exited with code 0 (0x0) with no unhandled exception

While debugging my C# application I have noticed a large amount occurrences of the following sentence: The thread -- has exited with code 0 (0x0). The application continues to work and no except..

Select count(*) from result query

I need help from you, this is my sql query: select count(SID) from Test where Date = '2012-12-10' group by SID this is my result: |2| |3| |4| |3| and now I have to count the results from firs..

How to hide a status bar in iOS?

I can hide a status bar in my app: - (void)viewDidLoad{ [[UIApplication sharedApplication] setStatusBarHidden:YES]; [super viewDidLoad]; } When I chose my launch image and start it firs..

Moving items around in an ArrayList

I've been playing around with ArrayLists. What I'm trying to achieve is a method to do something like this: Item 1 Item 2 Item 3 Item 4 I'm trying to be able to move items up in the list, unless it..

How to import data from one sheet to another

I have two different work sheets in excel with the same headings in in all the row 1 cells(a1 = id, b1 = name, c1 = price). My question is, is there a way to import data(like the name) from 1 workshee..

HTML: how to force links to open in a new tab, not new window

I use target="_blank" to open links in a new tab. But in IE it opens a new window which is completely logical because that is what _blank is supposed to do. And i don't know how target="_blank" behav..

What is a blob URL and why it is used?

I am having a lot of problems with blob URL. I was searching for src of a video tag on YouTube and I found that the video src was like: src="blob:https://crap.crap" I opened the blob URL that was ..

Which icon sizes should my Windows application's icon include?

I have a Windows application which will run in Windows XP and newer (i.e. Vista/7). According to the Vista UI Guidelines, the standard sizes are 16x16, 32x32, 48x48, 256x256 (XP standard sizes do not ..

Settings to Windows Firewall to allow Docker for Windows to share drive

Windows Firewall is blocking my attempt to allows Docker for Windows to share C: on windows 10 machine. Works fine when Windows Firewall off. When its on I get A firewall is blocking file Sharin..

Order by in Inner Join

I am putting inner join in my query.I have got the result but didn't know that how the data is coming in output.Can anyone tell me that how the Inner join matching the data.Below I am showing a image...

How can I apply a function to every row/column of a matrix in MATLAB?

You can apply a function to every item in a vector by saying, for example, v + 1, or you can use the function arrayfun. How can I do it for every row/column of a matrix without using a for loop?..

How can I create a small color box using html and css?

I have a picture on a html file/site and I want to add the list of available colors for that picture. I want to create very small boxes or dots, a small box for every color. How can I do this? Thank..

nginx: [emerg] "server" directive is not allowed here

I have reconfigured nginx but i can't get it to restart using the following config: conf: server { listen 80; server_name; return 301 $scheme://$request_uri; } server { ..

Postgres: clear entire database before re-creating / re-populating from bash script

I'm writing a shell script (will become a cronjob) that will: 1: dump my production database 2: import the dump into my development database Between step 1 and 2, I need to clear the development da..

What does Include() do in LINQ?

I tried to do a lot of research but I'm more of a db guy - so even the explanation in the MSDN doesn't make any sense to me. Can anyone please explain, and provide some examples on what Include() stat..

GridView sorting: SortDirection always Ascending

I have a gridview and I need to sort its elements when the user clicks on the header. Its datasource is a List object. The aspx is defined this way : <asp:GridView ID="grdHeader" AllowSorting="tr..

python: How do I know what type of exception occurred?

I have a function called by the main program: try: someFunction() except: print "exception happened!" but in the middle of the execution of the function it raises exception, so it jumps to ..

PostgreSQL: export resulting data from SQL query to Excel/CSV

I need to export the resulting data from a query in PostgreSQL to Excel/CSV. I use PostgreSQL 8.2.11. SQL error: ERROR: relative path not allowed for COPY to file In statement: COPY (select distin..

How to print without newline or space?

I'd like to do it in python. What I'd like to do in this example in c: In C: #include <stdio.h> int main() { int i; for (i=0; i<10; i++) printf("."); return 0; } Output: ....

How to implement a SQL like 'LIKE' operator in java?

I need a comparator in java which has the same semantics as the sql 'like' operator. For example:"digital","%ital%");"digital","%gi?a%");"digi..

OpenJDK8 for windows

Im a bit confused about how to download openjdk8 for windows. If I go to then under JDK 8 there are only two sections: "Debian, Ubuntu, etc." and "Fedora, Oracle Linu..

How can I get the behavior of GNU's readlink -f on a Mac?

On Linux, the readlink utility accepts an option -f that follows additional links. This doesn't seem to work on Mac and possibly BSD based systems. What would the equivalent be? Here's some debug inf..

How to hide app title in android?

I want to hide the app title bar...

function is not defined error in Python

I am trying to define a basic function in python but I always get the following error when I run a simple test program; >>> pyth_test(1, 2) Traceback (most recent call last): File "<py..

Run all SQL files in a directory

I have a number of .sql files which I have to run in order to apply changes made by other developers on an SQL Server 2005 database. The files are named according to the following pattern: 0001 - abc..

JavaScript before leaving the page

I want to make a confirmation before user leaving the page. If he says ok then it would redirect to new page or cancel to leave. I tried to make it with onunload <script type="text/javascript">..

java.lang.RuntimeException: Unable to instantiate activity ComponentInfo

I was trying to run a sample code While launching the application in the android 1.5 emulator , I got these errors.... Any one have some hint..? ERROR from LogCat: 01-13 02:28:08.392: ERROR/Android..

Calculate correlation with cor(), only for numerical columns

I have a dataframe and would like to calculate the correlation (with Spearman, data is categorical and ranked) but only for a subset of columns. I tried with all, but R's cor() function only accepts n..

How to handle iframe in Selenium WebDriver using java

<div> <iframe id="cq-cf-frame "> <iframe id="gen367"> <body spellcheck="false" id="CQrte" style="height: 255px; font-size: 12px; font-family:tahoma,arial,he..

MySQL integer field is returned as string in PHP

I have a table field in a MySQL database: userid INT(11) So I am calling it to my page with this query: "SELECT userid FROM DB WHERE name='john'" Then for handling the result I do: $row=$resu..

How do I get the serial key for Visual Studio Express?

I am Visual Studio 2010 Professional user. But for a reason I need Visual Web Developer 2008 Express edition. I downloaded this, but I need the serial key to activate the product, otherwise it will e..

JavaScript Nested function

I got a piece of code for javascript which I just do not understand: function dmy(d) { function pad2(n) { return (n < 10) ? '0' + n : n; } return pad2(d.getUTCDate()) + '/' + ..