Questions Tagged with #Cumulative frequency

How can I temporarily disable a foreign key constraint in MySQL?

Is it possible to temporarily disable constraints in MySQL? I have two Django models, each with a foreign key to the other one. Deleting instances of a model returns an error because of the foreign ke..

Difference between two DateTimes C#?

I need a function that can return the difference between the below two dates as 24. DateTime a = new DateTime(2008, 01, 02, 06, 30, 00); DateTime b = new DateTime(2008, 01, 03, 06, 30, 00); ..

Redirection of standard and error output appending to the same log file

I need to collect the standard output and error log from several processes into one single log file. So every output must append to this log file. I want to call all the jobs with lines like this: ..

How to remove trailing whitespaces with sed?

I have a simple shell script that removes trailing whitespace from a file. Is there any way to make this script more compact (without creating a temporary file)? sed 's/[ \t]*$//' $1 > $1__.tmp ca..

Float vs Decimal in ActiveRecord

Sometimes, Activerecord data types confuse me. Err, often. One of my eternal questions is, for a given case, Should I use :decimal or :float? I've often come across this link, ActiveRecord: :dec..

set option "selected" attribute from dynamic created option

I have a dynamically created select option using a javascript function. the select object is <select name="country" id="country"> </select> when the js function is executed, the "countr..

cocoapods - 'pod install' takes forever

I was trying to update the existing pods with the pod install command, but it takes forever to run. The verbose mode shows it was stuck at the following line (forever) Updating spec repo master $ /us..

How to reload / refresh model data from the server programmatically?

Background I have the most basic "newbie" AngularJS question, forgive my ignorance: how do I refresh the model via code? I'm sure it's answered multiple times somewhere, but I simply couldn't find i..

How to quickly and conveniently create a one element arraylist

Is there a Utility method somewhere that can do this in 1 line? I can't find it anywhere in Collections, or List. public List<String> stringToOneElementList(String s) { List<String> l..

use localStorage across subdomains

I'm replacing cookies with localStorage on browsers that can support it (anyone but IE). The problem is and store their own separate localStorage objects. I believe www is consid..

HTML5 placeholder css padding

I've seen this post already and tried everything I could to change the padding for my placeholder but alas, it seems it just doesn't want to cooperate. Anyway, here is the code for the css. (EDIT: Th..

Shell command to tar directory excluding certain files/folders

Is there a simple shell command/script that supports excluding certain files/folders from being archived? I have a directory that need to be archived with a sub directory that has a number of very la..

Why would an Enum implement an Interface?

I just found out that Java allows enums to implement an interface. What would be a good use case for that?..

For homebrew mysql installs, where's my.cnf?

For homebrew mysql installs, where's my.cnf? Does it install one?..

How to indent/format a selection of code in Visual Studio Code with Ctrl + Shift + F

I want to indent a specific section of code in Visual Studio Code. I read How do you format code in Visual Studio Code? that gives shortcuts to indent the whole code, but it doesn't work when selecti..

Loop through all elements in XML using NodeList

I want to loop through all elements in a piece of XML printing each one. My problem is that I keep getting a null pointer exception after the staff1 tag, i.e. john 465456433 gmail1 area1 city1 This ..

build maven project with propriatery libraries included

How to create maven pom, which will make project buildable, can I include propriatery jars with my project directly without having to take them from repository? anyone did this before ? EDIT : I do..

When to use MongoDB or other document oriented database systems?

We offer a platform for video- and audio-clips, photos and vector-grafics. We started with MySQL as the database backend and recently included MongoDB for storing all meta-information of the files, be..

Bash loop ping successful

I'm thinking that this needs to be changed to a while clause, at the moment it'll wait till all 10000 pings are done, I need it to return when the ping is successful. The program "say" is on OSX it ma..

How to convert a DataFrame back to normal RDD in pyspark?

I need to use the (rdd.)partitionBy(npartitions, custom_partitioner) method that is not available on the DataFrame. All of the DataFrame methods refer only to DataFrame results. So then how to c..

Adding sheets to end of workbook in Excel (normal method not working?)

This is the VBA code im using to try add a new sheet to the last place in the workbook mainWB.Sheets.Add(After:=Sheets(Sheets.Count)).Name = new_sheet_name I saw this in a similar question on this ..

How to set background image in Java?

I am developing a simple platform game using Java using BlueJ as the IDE. Right now I have player/enemy sprites, platforms and other items in the game drawn using polygons and simple shapes. Eventuall..

How to put a Scanner input into an array... for example a couple of numbers

Scanner scan = new Scanner(; double numbers = scan.nextDouble(); double[] avg =..???? ..

Warning: Null value is eliminated by an aggregate or other SET operation in Aqua Data Studio

I have a problem when data is null and the warning has appear when the result is display. How to solve this problem?. How to change the null data to 0 when no data in the table?. This is my code:- S..

Access host database from a docker container

If I have a mysql database running on some host machine, and that host is also running a docker container: How would I access the mysql database from within the docker container that is running on the..

Get installed applications in a system

How to get the applications installed in the system using c# code?..

React Checkbox not sending onChange

TLDR: Use defaultChecked instead of checked, working jsbin. Trying to setup a simple checkbox that will cross out its label text when it is checked. For some reason handleChange is not getting fired..

Way to get all alphabetic chars in an array in PHP?

Is there a way to get all alphabetic chars (A-Z) in an array in PHP so I can loop through them and display them?..

List of All Locales and Their Short Codes?

I'm looking for a list of all locales and their short codes for a PHP application I am writing. Is there much variation in this data between platforms? Also, if I am developing an international appli..

How to do a SOAP Web Service call from Java class?

I'm relative new to the webservices world and my research seems to have confused me more than enlighten me, my problem is that I was given a library(jar) which I have to extend with some webservice fu..

How to repair COMException error 80040154?

Moving a working C# project from a 64-bit Windows 7 machine to a 32-bit XP machine caused the following error: Retrieving the COM class factory for component with CLSID {681EF637-F129-4AE9-94BB-61..

How to return XML in ASP.NET?

I have encountered many half-solutions to the task of returning XML in ASP.NET. I don't want to blindly copy & paste some code that happens to work most of the time, though; I want the right code,..

How to set background color in jquery

How to set background color of td in jQuery? e.g $(this).css({**BackgroundColor:Red**}) Thanks..

Push git commits & tags simultaneously

I'm aware of the reason that git push --tags is a separate operation to plain old git push. Pushing tags should be a conscious choice since you don't want accidentally push one. That's fine. But is th..

scrollTop jquery, scrolling to div with id?

So this is the current code I have $(document).ready(function() { $('.abouta').click(function(){ $('html, body').animate({scrollTop:308}, 'slow'); return false; }); $('.po..

Service Reference Error: Failed to generate code for the service reference

I have a Windows Service Solution and am trying to add a service reference to a Hermes(Opensource ebms message server) Web Service in VS2010. I can find the Web Service using it's URL, but when I try..

auto refresh for every 5 mins

this is my code <html> <head> <script language="javascript" src="JS/jQuery.js"></script> <script> function page_refresh(){ document.getElemen..

ERROR 403 in loading resources like CSS and JS in my index.php

I'm in Linux, Elementary OS, and installed lampp in opt. My CSS and JS won't load. When I inspect my page through browser. The console says Failed to load resource: the server responded with a status..

How To Define a JPA Repository Query with a Join

I would like to make a Join query using Jpa repository with annotation @Query. I have two tables: table user with iduser,user_name and: table area with idarea, area_name and iduser The ..

How do you round to 1 decimal place in Javascript?

Can you round a number in javascript to 1 character after the decimal point (properly rounded)? I tried the *10, round, /10 but it leaves two decimals at the end of the int...

When should iteritems() be used instead of items()?

Is it legitimate to use items() instead of iteritems() in all places? Why was iteritems() removed from Python 3? Seems like a terrific and useful method. What's the reasoning behind it? Edit: To clar..

HTML5 Dynamically create Canvas

Hi there I have a question about dynamically creating a canvas using javascript. I create a canvas like this: var canvas = document.createElement('canvas'); = "CursorLayer"; canvas.wid..

In Tkinter is there any way to make a widget not visible?

Something like this, would make the widget appear normally: Label(self, text = 'hello', visible ='yes') While something like this, would make the widget not appear at all: Label(self, text = 'hel..

How to mock void methods with Mockito

How to mock methods with void return type? I implemented an observer pattern but I can't mock it with Mockito because I don't know how. And I tried to find an example on the Internet but didn't suc..

How to write a PHP ternary operator

How do I write a PHP ternary operator with the elseif portion? I see basic examples with the if and else portions of the PHP ternary operator like this: echo (true) ? "yes" : "no"; //prints yes ..

Open file by its full path in C++

I want the user to give me the full path where the file exists and not just the file name. How do I open the file this way? Is it something like this: ifstream file;"C:/Demo.txt", ios::in..

How to correctly iterate through getElementsByClassName

I am Javascript beginner. I am initing web page via the window.onload, I have to find bunch of elements by their class name (slide) and redistribute them into different nodes based on some logic. I h..

How to use the unsigned Integer in Java 8 and Java 9?

In the Oracle "Primitive data types" page, it mentions that Java 8 adds support for unsigned ints and longs: int: By default, the int data type is a 32-bit signed two's complement integer, ..

How to trim a string to N chars in Javascript?

How can I, using Javascript, make a function that will trim string passed as argument, to a specified length, also passed as argument. For example: var string = "this is a string"; var length = 6; va..

Numpy: Get random set of rows from 2D array

I have a very large 2D array which looks something like this: a= [[a1, b1, c1], [a2, b2, c2], ..., [an, bn, cn]] Using numpy, is there an easy way to get a new 2D array with, e.g., 2 random rows..

php $_POST array empty upon form submission

I have a custom Content Management System (CMS) I've built that works perfectly on my dev box (Ubuntu/PHP5+/MySQL5+). I just moved it up to the production box for my client and now all form submission..

Handling the window closing event with WPF / MVVM Light Toolkit

I'd like to handle the Closing event (when a user clicks the upper right 'X' button) of my window in order to eventually display a confirm message or/and cancel the closing. I know how to do this in ..

SQL Server 2005 Using CHARINDEX() To split a string

How can I split the following string based on the '-' character? So if I had this string: LD-23DSP-1430 How could I split it into separate columns like this: LD 23DSP 1430 Also, ..

Where does MySQL store database files on Windows and what are the names of the files?

So I accidentally formatted my hard drive and re-installed Windows and forgot to backup an important database I had in my MySQL server. I'm trying to salvage files now using some software, but I don't..

Android Studio Stuck at Gradle Download on create new project

I have installed the new Android Studio. Everything was working fine but when I try to create a new project it gets stuck at downloading Gradle. Is there any way to install the Gradle required by And..

Thread pooling in C++11

Relevant questions: About C++11: C++11: std::thread pooled? Will async(launch::async) in C++11 make thread pools obsolete for avoiding expensive thread creation? About Boost: C++ boost thread r..

Execute combine multiple Linux commands in one line

I am trying to merge multiple linux commands in one line to perform deployment operation. For example cd /my_folder rm *.jar svn co path to repo mvn compile package install ..

How to make join queries using Sequelize on Node.js

I am using sequelize ORM; everything is great and clean, but I had a problem when I use it with join queries. I have two models: users and posts. var User = db.seq.define('User',{ username: { typ..

Push method in React Hooks (useState)?

How to push element inside useState array React hook? Is that as an old method in react state? Or something new? E.g. setState push example ?..

ComboBox: Adding Text and Value to an Item (no Binding Source)

In C# WinApp, how can I add both Text and Value to the items of my ComboBox? I did a search and usually the answers are using "Binding to a source".. but in my case I do not have a binding source read..

How to get domain URL and application name?

Here's the scenario. My Java web application has following path Let's say there is a JSP file ..

SQL like search string starts with

Learning SQL. Have a simple table games with field title. I want to search based on title. If I have a game called Age of Empires III: Dynasties, and I use LIKE with parameter Age of Empires III: Dyna..

How to set border's thickness in percentages?

How to set border-width of an element in percentages? I tried the syntax border-width:10%; But it doesn't work. The reason I want to set border-width in percentages is I have an element with width..

Split a List into smaller lists of N size

I am attempting to split a list into a series of smaller lists. My Problem: My function to split lists doesn't split them into lists of the correct size. It should split them into lists of size 30 bu..

What is the difference between & and && in Java?

I always thought that && operator in Java is used for verifying whether both its boolean operands are true, and the & operator is used to do Bit-wise operations on two integer types. Rece..

Multiple WHERE clause in Linq

I'm new to LINQ and want to know how to execute multiple where clause. This is what I want to achieve: return records by filtering out certain user names. I tried the code below but not working as exp..

How to add an integer to each element in a list?

If I have list=[1,2,3] and I want to add 1 to each element to get the output [2,3,4], how would I do that? I assume I would use a for loop but not sure exactly how...

How do I remove the passphrase for the SSH key without having to create a new key?

I set a passphrase when creating a new SSH key on my laptop. But, as I realise now, this is quite painful when you are trying to commit (Git and SVN) to a remote location over SSH many times in an hou..

Converting double to string with N decimals, dot as decimal separator, and no thousand separator

I need to convert a decimal to a string with N decimals (two or four) and NO thousand separator: 'XXXXXXX (dot) DDDDD' The problem with CultureInfo.InvariantCulture is that is places ',' to separate..

how to put image in center of html page?

Possible Duplicate: How to center div horizontally and vertically I need to put image in center of html page, both vertical and horizontal ... been trying few stuff but seems to work fine. ..

Visual Studio 2017 - Could not load file or assembly 'System.Runtime, Version=' or one of its dependencies

I am using Visual Studio 2017 and am trying to create a .Net Standard 1.5 library and use it in a .Net 4.6.2 nUnit test project. I am getting the following error... Could not load file or assemb..

Chart.js v2 hide dataset labels

I have the following codes to create a graph using Chart.js v2.1.3: var ctx = $('#gold_chart'); var goldChart = new Chart(ctx, { type: 'line', data: { labels: dates, datasets:..

How to download python from command-line?

I'm on windows, but I'm using a putty shell to connect to a linux machine, and want to install python 2.7. Can't figure out how to do it. How can I download python from command line?..

MySQL load NULL values from CSV data

I have a file that can contain from 3 to 4 columns of numerical values which are separated by comma. Empty fields are defined with the exception when they are at the end of the row: 1,2,3,4,5 1,2,3,,..

img tag displays wrong orientation

I have an image at this link: As you can see, this is a normal image with correct orientation. However, when I set this link..

Get file content from URL?

When I use following URL in browser then it prompt me to download a text file with JSOn content.,40&chl=Hello|World&chof..

How to insert a character in a string at a certain position?

I'm getting in an int with a 6 digit value. I want to display it as a String with a decimal point (.) at 2 digits from the end of int. I wanted to use a float but was suggested to use String for a bet..

iFrame src change event detection?

Assuming I have no control over the content in the iframe, is there any way that I can detect a src change in it via the parent page? Some sort of onload maybe? My last resort is to do a 1 second int..

PHP send mail to multiple email addresses

What code I should do change in this PHP script to send one email to more than 20 email addresses? <?php $email_to = "[email protected]"; // your email address $email_subject = "Con..

How to remove old Docker containers

This question is related to Should I be concerned about excess, non-running, Docker containers?. I'm wondering how to remove old containers. The docker rm 3e552code34a lets you remove a single one, b..

why should I make a copy of a data frame in pandas

When selecting a sub dataframe from a parent dataframe, I noticed that some programmers make a copy of the data frame using the .copy() method. For example, X = my_dataframe[features_list].copy() .....

Safe width in pixels for printing web pages?

What is the safe width in pixels to print a web page? My page includes large images and I want to make sure they will not be cut of when printed. I know about different browser margins and US Lette..

How to check date of last change in stored procedure or function in SQL server

I need to check when function was changed last time. I know how to check creation date (it is in function properties window in SQL Server Management Studio). I found that in SQL Server 2000 it wasn't ..

How do I "select Android SDK" in Android Studio?

After a successful import of an Eclipse-Android-Project into "Android Studio 1.4", I get the error "Please select Android SDK" when I click on the button to run the application in simulator, bu..

How do I make an html link look like a button?

I'm using ASP.NET, some of my buttons just do redirects. I'd rather they were ordinary links, but I don't want my users to notice much difference in the appearance. I considered images wrapped by an..

How to dockerize maven project? and how many ways to accomplish it?

I am new to Docker, and don't know how to run a java project with maven even though I have read many documents and tried many methods. Should I build the image using Dockerfile? What is the command..

MySQL WHERE: how to write "!=" or "not equals"?

I need to do this DELETE FROM konta WHERE taken != '' But != doesn't exist in mysql. Anyone know how to do this?..

Controlling a USB power supply (on/off) with Linux

Is it possible to turn on/off power supplies from USB manually with Linux? There's this external USB cooling fan (the kind you use to cool yourself off, not the PC), and it would be nice to be able t..

Disabling Chrome Autofill

I have been running into issues with the chrome autofill behavior on several forms. The fields in the form all have very common and accurate names, such as "email", "name", or "password", and they a..

Combine two arrays

I have two arrays like this: array( '11' => '11', '22' => '22', '33' => '33', '44' => '44' ); array( '44' => '44', '55' => '55', '66' => '66', '77' => '77' ); I want to c..

ListView item background via custom selector

Is it possible to apply a custom background to each Listview item via the list selector? The default selector specifies @android:color/transparent for the state_focused="false" case, but changing thi..

Remove all constraints affecting a UIView

I have a UIView which is placed on the screen via several constraints. Some of the constraints are owned by the superview, others are owned by other ancestors (e.g. perhaps the view property of a UIVi..

Convert dateTime to ISO format yyyy-mm-dd hh:mm:ss in C#

Is there a standard way in .NET/C# to convert a datetime object to ISO 8601 format yyyy-mm-dd hh:mm:ss? Or do I need to do some string manipulation to get the date string?..

Animation fade in and out

Using this code I only have a fade in, I'm looking for how to add a fade out as well. I've added another xml called "fadeout" but I can't integrate it in my code. ImageView imageView = (ImageView)fin..

Access to the path denied error in C#

I have read a similar post, but i just cant figure out the problem. I have changed the windows permissions and changed routes. When i try to save a file it throws me the exception: Access to th..

SQL Server check case-sensitivity?

How can I check to see if a database in SQL Server is case-sensitive? I have previously been running the query: SELECT CASE WHEN 'A' = 'a' THEN 'NOT CASE SENSITIVE' ELSE 'CASE SENSITIVE' END But I ..

MySQL select 10 random rows from 600K rows fast

How can I best write a query that selects 10 rows randomly from a total of 600k?..

Add attribute 'checked' on click jquery

I've been trying to figure out how to add the attribute "checked" to a checkbox on click. The reason I want to do this is so if I check off a checkbox; I can have my local storage save that as the htm..

Add image to layout in ruby on rails

I would like to add an image in my template for my ruby on rails project where i currenly have the code <img src="../../../public/images/rss.jpg" alt="rss feed" /> in a the layout

Is there a Visual Basic 6 decompiler?

I lost the source code from one project I did on the company I'm working for and haven't been able to find a Visual Basic 6 decompiler; does that even exists? I only have the EXE that I've rescued fr..

Split string in JavaScript and detect line break

I have a small function I found that takes a string from a textarea and then puts it into a canvas element and wraps the text when the line gets too long. But it doesn't detect line breaks. This is wh..

How to convert Set to Array?

Set seems like a nice way to create Arrays with guaranteed unique elements, but it does not expose any good way to get properties, except for generator [Set].values, which is called in an awkward way ..

Frame Buster Buster ... buster code needed

Let's say you don't want other sites to "frame" your site in an <iframe>: <iframe src=""></iframe> So you insert anti-framing, frame busting JavaScript into all ..

Java format yyyy-MM-dd'T'HH:mm:ss.SSSz to yyyy-mm-dd HH:mm:ss

I'm trying to format a date in yyyy-MM-dd'T'HH:mm:ss.SSSz format to yyyy-mm-dd HH:mm:ss, which should be easy but I can't get it to work. A date that has to be parsed is in the form of: 2012-10-01T09..

See line breaks and carriage returns in editor

Does anyone know of a text editor on Linux that allows me to see line breaks and carriage returns? Does Vim support this feature?..

How do I get the absolute directory of a file in bash?

I have written a bash script that takes an input file as an argument and reads it. This file contains some paths (relative to its location) to additional files used. I would like the script to go to..

The system cannot find the file specified. in Visual Studio

I keep getting this error with these lines of code: include <iostream> int main() { cout << "Hello World" >>; system("pause"); return 0; } "The s..

Removing whitespace between HTML elements when using line breaks

I have a page with a row of about 10 imgs. For readability of the HTML, I want to put a linebreak in between each img tag, but doing so renders whitespace between the images, which I do not want. Is t..

Google API for location, based on user IP address

I am looking for a way to get the user's current location (city) based on is IP address using the Google Maps APIs. Something similar to but only using the Google Maps APIs...

How do I pause my shell script for a second before continuing?

I have only found how to wait for user input. However, I only want to pause so that my while true doesn't crash my computer. I tried pause(1), but it says -bash: syntax error near unexpected token '..

Serializing class instance to JSON

I am trying to create a JSON string representation of a class instance and having difficulty. Let's say the class is built like this: class testclass: value1 = "a" value2 = "b" A call to th..

set up device for development (???????????? no permissions)

I am using a Samsung galaxy nexus phone (Android 4.0 platform) . I am developing Android app on Ubuntu linux OS. I would like to run my application directly on the Samsung handset device, so I perfor..

How to strip HTML tags from string in JavaScript?

How can I strip the HTML from a string in JavaScript?..

Adding integers to an int array

I am trying to add integers into an int array, but Eclipse says: cannot invoke add(int) on the array type int[] Which is completely illogical to me. I also tried addElement() and addInt(), howe..

Fixing slow initial load for IIS

IIS has an annoying feature for low traffic websites where it recycles unused worker processes, causing the first user to the site after some time to get an extremely long delay (30+ seconds). I've b..

Upload Image using POST form data in Python-requests

I'm working with wechat APIs ... here I've to upload an image to wechat's server using this API url = 'http://file.api.we..

Transform char array into String

I have a function that returns a char array and I want that turned into a String so I can better process it (compare to other stored data). I am using this simple for that should work, but it doesn't ..

How do I turn a String into a InputStreamReader in java?

How can I transform a String value into an InputStreamReader?..

How to convert / cast long to String?

I just created sample BB app, which can allow to choose the date. DateField curDateFld = new DateField("Choose Date: ", System.currentTimeMillis(), DateField.DATE | DateField.FIELD_LEFT); After c..

What is phtml, and when should I use a .phtml extension rather than .php?

I'm wondering what the difference between .phtml and .php files is, and when to use one over the other...

How to read and write into file using JavaScript?

Can anybody give some sample code to read and write a file using JavaScript?..

How to Set JPanel's Width and Height?

I'm developing Snake game using Java. Board's (where all action takes it place) width and height should be fixed (640 pixels * 480 pixels). Structure: Main class that extends from JFrame class, Boa..

CORS: credentials mode is 'include'

Yes, I know what you are thinking - yet another CORS question, but this time I'm stumped. So to start off, the actual error message: XMLHttpRequest cannot load http://localhost/Foo.API/token. The..

onclick="location.href='link.html'" does not load page in Safari

I cannot get onclick="location.href='link.html'" to load a new page in Safari (5.0.4). I am building a drop-down navigation menu using the <select> and <option> HTML tags. I am using the ..

How do I add records to a DataGridView in VB.Net?

How do I add new record to DataGridView control in VB.Net? I don't use dataset or database binding. I have a small form with 3 fields and when the user clicks OK they should be added to the DataGridV..

How to remove "disabled" attribute using jQuery?

I have to disable inputs at first and then on click of a link to enable them. This is what I have tried so far, but it doesn't work. HTML: <input type="text" disabled="disabled" class="inputDisa..

Declaring functions in JSP?

I come from PHP world, where declaring a function in the middle of a php page is pretty simple. I tried to do the same in JSP: public String getQuarter(int i){ String quarter; switch(i){ case 1: ..

Is there a way to force npm to generate package-lock.json?

I deleted it by accident and have made many changes to package.json since. An npm install or npm update do not generate package-lock.json anymore. I tried clearing my npm cache and my nvm cache, but n..

How to properly make a http web GET request

i am still new on c# and i'm trying to create an application for this page that will tell me when i get a notification (answered, commented, etc..). But for now i'm just trying to make a simple call t..

How to sort an ArrayList in Java

I have a class named Fruit. I am creating a list of this class and adding each fruit in the list. I want to sort this list based on the order of fruit name. public class Fruit{ private String fr..

Create a user with all privileges in Oracle

I was googling about how to create a user and grant all privileges to him. I found these two methods : The first method : create user userName identified by password; grant connect to userName; gra..

How can I solve the error LNK2019: unresolved external symbol - function?

I get this error, but I don't know how to fix it. I'm using Visual Studio 2013. I made the solution name MyProjectTest This is the structure of my test solution: -function.h #ifndef MY_FUNCTION_H #de..

Simple 'if' or logic statement in Python

How would you write the following in Python? if key < 1 or key > 34: I've tried every way I can think of and am finding it very frustrating...

How to supply value to an annotation from a Constant java

I am thinking this may not be possible in Java because annotation and its parameters are resolved at compile time. I have an interface as follows, public interface FieldValues { String[] FIELD1 = ..

Best dynamic JavaScript/JQuery Grid

I'm working with JavaScript, JQuery and HTML. UI Of my project is completely dynamic. I am looking for a dynamic JavaScript/JQuery Grid which supports following features. Can anybody tell me is there..

How do I set the selenium webdriver get timeout?

When I am using a proxy in webdriver like FirefoxDriver, if the proxy is bad then the get method will block forever. I set some timeout parameters, but this did not work out. This is my code: Firefo..

Twitter Bootstrap carousel different height images cause bouncing arrows

I've been using Bootstrap's carousel class and it has been straightforward so far, however one problem I've had is that images of different heights cause the arrows to bounce up and down to adjust to ..

How can I make one python file run another?

How can I make one python file to run another? For example I have two .py files. I want one file to be run, and then have it run the other .py file...

Difference between Pig and Hive? Why have both?

My background - 4 weeks old in the Hadoop world. Dabbled a bit in Hive, Pig and Hadoop using Cloudera's Hadoop VM. Have read Google's paper on Map-Reduce and GFS (PDF link). I understand that- Pig'..

Disabled href tag

Although that link is disabled, it's still clickable. <a href="/" disabled="disabled">123n</a> Can I make it not-clickable if it's disabled? Should I use JavaScript necessarily?..

How does cellForRowAtIndexPath work?

I HAVE READ apple documentation and it's not understandable for such a beginner in Objective-C as me. I'm trying to implement multicolumn UITableView following this link example and it just doesn't w..

Select All Rows Using Entity Framework

I'm trying to select all the rows out of a database using entity framework for manipulation before they're sent to the form var ptx = [modelname].[tablename](); ptx.[tablename].Select(????) what go..

How to add element in List while iterating in java?

Say I have a List like: List<String> list = new ArrayList<>(); list.add("a"); list.add("h"); list.add("f"); list.add("s"); While iterating through this list I want to add an element at ..

Makefile - missing separator

Possible Duplicate: Make error: missing separator Have this code in makefile: PROG = semsearch all: $(PROG) %: %.c gcc -o $@ $< -lpthread clean: rm $(PROG) and the error missing sep..

Downloading MySQL dump from command line

I am moving away from Linode because I don't have the Linux sysadmin skills necessary; before I complete the transition to a more noob-friendly service, I need to download the contents of a MySQL data..

How to change the name of a Django app?

I have changed the name of an app in Django by renaming its folder, imports and all its references (templates/indexes). But now I get this error when I try to run python runserver Error: Co..

Multiple conditions in an IF statement in Excel VBA

Probably an easy one but my prog skills are limited. I've created an account entry tool and want to warn the user if they've entered a credit amount for an Expenditure type of which there are two typ..

Reading Datetime value From Excel sheet

when am trying to read datetime type value from excel sheet it is returning a double value.for example if want to read value '2007-02-19 14:11:45.730' like this, i am getting a double type value .furt..

Can a main() method of class be invoked from another class in java

Can a main() method of class be invoked in another class in java? e.g. class class1{ public static void main(String []args){ } } class class2{ public static void main(String []args){ ..

How to convert a private key to an RSA private key?

Let me explain my question first. I bought a certificate from a CA and used the following format to generate the csr and the private key: openssl req -new -newkey rsa:2048 -nodes -keyout server.key -..

top -c command in linux to filter processes listed based on processname

top -c Top lists all the processes, there are good options to filter the processes by username by using the option -u but I am wondering if there is any easy way to filter the processes based on pr..

How to send/receive SOAP request and response using C#?

private static string WebServiceCall(string methodName) { WebRequest webRequest = WebRequest.Create("http://localhost/AccountSvc/DataInquiry.asmx"); HttpWebRequest httpRequest = (HttpW..

How to store a command in a variable in a shell script?

I would like to store a command to use at a later period in a variable (not the output of the command, but the command itself) I have a simple script as follows: command="ls"; echo "Command: $comman..

Passing 'this' to an onclick event

Possible Duplicate: The current element as its Event function param Would this work <script type="text/javascript"> var foo = function(param) { param.innerHTML = "Not a button"; ..

How to bind multiple values to a single WPF TextBlock?

I'm currently using the TextBlock below to bind the value of a property named Name: <TextBlock Text="{Binding Name}" /> Now, I want to bind another property named ID to the same TextBlock. I..

What is the difference between “int” and “uint” / “long” and “ulong”?

I know about int and long (32-bit and 64-bit numbers), but what are uint and ulong?..

Powershell script to see currently logged in users (domain and machine) + status (active, idle, away)

I am searching for a simple command to see logged on users on server. I know this one : Get-WmiObject -Class win32_computersystem but this will not provide me the info I need. It returns : domain M..

How to use sbt from behind proxy?

How do I configure sbt to use a proxy? For example, my build definition needs to connect to GitHub, specifying connection parameters for http.proxy, http.proxyPort, user, and password. How would I p..

What is an OS kernel ? How does it differ from an operating system?

I am not able to understand the difference between a kernel and an operating system. I do not see any difference between them. Is the kernel an operating system?..

A server is already running. Check …/tmp/pids/ Exiting - rails

..$ rails s => Booting WEBrick => Rails 4.0.4 application starting in development on => Run `rails server -h` for more startup options => Ctrl-C to shutdown server A se..

SQL Server: Cannot insert an explicit value into a timestamp column

When using this statement create table demo ( ts timestamp ) insert into demo select current_timestamp I get the following error: Cannot insert an explicit value into a timestamp column. U..

What is the purpose of mvnw and mvnw.cmd files?

When I created a Spring Boot application I could see mvnw and mvnw.cmd files in the root of the project. What is the purpose of these two files?..

Tool to generate JSON schema from JSON data

We have this json schema draft. I would like to get a sample of my JSON data and generate a skeleton for the JSON schema, that I can rework manually, adding things like description, required, etc, whi..

How to execute function in SQL Server 2008

I build a function and I am trying to execute it...but some errors are occurring CREATE FUNCTION dbo.Afisho_rankimin(@emri_rest int) RETURNS int AS BEGIN Declare @rankimi int Select ..

Setting a max character length in CSS

I am making responsive website for school and my question is: How do I set a max character length of the sentences (with CSS) on my website (like 75 characters) that when I have a very large screen, ..

Asp Net Web API 2.1 get client IP address

Hello I need get client IP that request some method in web api, I have tried to use this code from here but it always returns server local IP, how to get in correct way ? HttpContext.Current.Request..

Android - Using Custom Font

I applied a custom font to a TextView, but it doesn't seems to change the typeface. Here is my code: Typeface myTypeface = Typeface.createFromAsset(getAssets(), "fonts/myFont.ttf"); TextView..

How can I initialise a static Map?

How would you initialise a static Map in Java? Method one: static initialiser Method two: instance initialiser (anonymous subclass) or some other method? What are the pros and cons of each? Here i..

Firefox "ssl_error_no_cypher_overlap" error

My co-workers and I are having a problem using Firefox 3.0.6 to access a Java 1.6.0___11 web application we're developing. Everything works fine anywhere from 1-30 minutes into the session...but even..

How can I make a checkbox readonly? not disabled?

I have a form where I have to post form values to my action class. In this form I have a checkbox that needs to be readonly. I tried setting disabled="true" but that doesn't work when posting to the a..

'' is not recognized as an internal or external command, operable program or batch file

Whenever I try and run mycommand.exe from my windows cmd.exe terminal, I get this error: ''mycommand.exe' is not recognized as an internal or external command, operable program or batch file' Th..

How to get Android GPS location

Cheers, I'm trying to get the current GPS-Location via Android. I followed this Tutorial and Vogellas article aswell. Though it ain't working. When using LocationManager.NETWORK_PROVIDER I'm always ge..

How can I specify system properties in Tomcat configuration on startup?

I understand that I can specify system properties to Tomcat by passing arguments with the -D parameter, for example "-Dmy.prop=value". I am wondering if there is a cleaner way of doing this by specif..

How to scp in Python?

What's the most pythonic way to scp a file in Python? The only route I'm aware of is os.system('scp "%s" "%s:%s"' % (localfile, remotehost, remotefile) ) which is a hack, and which doesn't work o..

GitHub - error: failed to push some refs to '[email protected]:myrepo.git'

I am getting the following error. How do I resolve?: git add . git commit -m 't' git push origin development To [email protected]:myrepo.git ! [rejected] development -> developme..

Remove special symbols and extra spaces and replace with underscore using the replace method

I want to remove all special characters and spaces from a string and replace with an underscore. The string is var str = "hello world & hello universe"; I have this now which replaces only ..

How to create a popup window (PopupWindow) in Android

To create a simple working PopupWindow, we need to do the following: popup_example.xml: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="

How can I copy the content of a branch to a new local branch?

I have worked on a local branch and also pushed the changes to remote. I want to revert the changes on that branch and do something else on it, but I don't want to lose the work completely. I was thin..

Multiple separate IF conditions in SQL Server

I have multiple IF statements that are independent of each other in my stored procedure. But for some reason they are being nested inside each other as if they are part of one big if statement ELSE I..

Copy map values to vector in STL

Working my way through Effective STL at the moment. Item 5 suggests that it's usually preferable to use range member functions to their single element counterparts. I currently wish to copy all the va..

phpMyAdmin + CentOS 6.0 - Forbidden

I always get this message when I would like access my phpMyAdmin. w3m localhost/phpmyadmin Forbidden You don't have permission to access /phpmyadmin/ on this server. Apache/2.2.15 (CentOS) Server ..

JavaScript + Unicode regexes

How can I use Unicode-aware regular expressions in JavaScript? For example, there should be something akin to \w that can match any code-point in Letters or Marks category (not just the ASCII ones), ..

Gradient text color

Is there a generator , or an easy way to generate text like this but without having to define every letter So something like this: _x000D_ _x000D_ .rainbow {_x000D_ background-image: -webkit-gradi..

How to enable directory listing in apache web server

I am not able to enable directory listing in my apache web server. I have tried various solutions posted but not working. I just freshly installed httpd 2.4.6 and enabled https using ssl.conf under /e..

Property getters and setters

With this simple class I am getting the compiler warning Attempting to modify/access x within its own setter/getter and when I use it like this: var p: point = Point() p.x = 12 I get an EXC_..

Pushing from local repository to GitHub hosted remote

I created a local repository of my Visual Studio 2010 solution folder using Git GUI on my dev machine. I then created a remote repository in my GitHub account. Now, I am looking for how to push my loc..

Creating an instance using the class name and calling constructor

Is there a way to create an instance of a particular class given the class name (dynamic) and pass parameters to its constructor. Something like: Object object = createInstance("mypackage.MyClass","..

How to work offline with TFS

Our TFS server has some temporary connectivity issues right now, and as such VS has gone unresponsive, leaving 50+ developers unable to work! Is it possible to switch TFS into an offline mode in the ..

How do I make a WPF TextBlock show my text on multiple lines?

i have a wpf window where i have a stackpanel with two viewports in it - each Viewport with a textblock in it. <Grid> <StackPanel VerticalAlignment="Center" Orientation="Vertical" > ..

How to execute the start script with Nodemon

How can I execute the start script from a package.json file with Nodemon?..

Why an inline "background-image" style doesn't work in Chrome 10 and Internet Explorer 8?

Why the following example shows the image in Firefox 4, but not in Chrome 10 and Internet Explorer 8? HTML: <div style="background-image: url('

How to HTML encode/escape a string? Is there a built-in?

I have an untrusted string that I want to show as text in an HTML page. I need to escape the chars '<' and '&' as HTML entities. The less fuss the better. I'm using UTF8 and don't need other ..

What is the difference between float and double?

I've read about the difference between double precision and single precision. However, in most cases, float and double seem to be interchangeable, i.e. using one or the other does not seem to affect t..

Convert Array to Object

What is the best way to convert: ['a','b','c'] to: { 0: 'a', 1: 'b', 2: 'c' } ..

Google Recaptcha v3 example demo

Until now, I was working with Google Recaptcha v2, but now I want to update my WebApp using the lastest version (v3). Is it possible to anyone add a fully working Google Recaptcha v3 example for a ba..

Slicing a dictionary

I have a dictionary, and would like to pass a part of it to a function, that part being given by a list (or tuple) of keys. Like so: # the dictionary d = {1:2, 3:4, 5:6, 7:8} # the subset of keys I'..

Replace values in list using Python

I have a list where I want to replace values with None where condition() returns True. [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10] For example, if condition checks bool(item%2) should return: [None, 1, Non..

How to build PDF file from binary string returned from a web-service using javascript

I am trying to build a PDF file out of a binary stream which I receive as a response from an Ajax request. Via XmlHttpRequest I receive the following data: %PDF-1.4.... ..... ....hole data represent..

What is a "cache-friendly" code?

What is the difference between "cache unfriendly code" and the "cache friendly" code? How can I make sure I write cache-efficient code? ..

Detailed 500 error message, ASP + IIS 7.5

IIS 7.5 , 2008rc2, classic asp, 500 error msg: The page cannot be displayed because an internal server error has occurred. I need to know how to configure IIS to get a more detailed error. I've ..