Questions Tagged with #Gitx

GitX is a GUI git tool made for Mac OS X.

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

Split string into array

In JS if you would like to split user entry into an array what is the best way of going about it? For example: entry = prompt("Enter your name") for (i=0; i<entry.length; i++) { entryArray[i] =..

Convert RGB values to Integer

So in a BufferedImage, you receive a single integer that has the RGB values represented in it. So far I use the following to get the RGB values from it: // rgbs is an array of integers, every single ..

How to Call a JS function using OnClick event

I am trying to call my JS function that I added in the header. Please find below code that shows my problem scenario. Note: I don't have access to the body in my application. Everytime I click on t..

Creating an instance of class

What's the difference between lines 1 , 2 , 3 , 4? When do I use each? Why line 3 prints the constructor Foo and line 7 returns an error and line 8 doesn't? #include <iostream> using nam..

Git merge without auto commit

Is it possible to do a git merge, but without a commit? "man git merge" says this: With --no-commit perform the merge but pretend the merge failed and do not autocommit, to give the user a chance to..

Numpy: find index of the elements within range

I have a numpy array of numbers, for example, a = np.array([1, 3, 5, 6, 9, 10, 14, 15, 56]) I would like to find all the indexes of the elements within a specific range. For instance, if the ra..

Laravel 4: Redirect to a given url

Is there a method in Redirect class of laravel where the parameter is a complete url? We all know parameters to these methods are just route name,action, slash,..etc but what I want now is like retu..

Add a column to a table, if it does not already exist

I want to write a query for MS SQL Server that adds a column into a table. But I don't want any error display, when I run/execute the following query. I am using this sort of query to add a table .....

Error:java: javacTask: source release 8 requires target release 1.8

Using IntelliJ IDE can't compile any projects. Screenshots of settings below: Used JDK: Project SDK and Language level: Language Level: Anybody have any ideas?..

The OutputPath property is not set for this project

When I try to compile my project from x86 debug mode in Visual Studio 2008. I am getting this error. When I looked at the property group of the project that complained, I see output path is set. Here..

Make error: missing separator

I am getting the following error running make: Makefile:168: *** missing separator. Stop. What is causing this?..

npm can't find package.json

I'm trying to install the dependencies of some example: npm's express 2.5.8 that I've downloaded, but all of the apps throw the same error: c:\node\stylus>npm install -d npm info it worked if it e..

Passing on command line arguments to runnable JAR

I built a runnable JAR from an Eclipse project that processes a given XML file and extracts the plain text. However, this version requires that the file be hard-coded in the code. Is there a way to ..

COALESCE Function in TSQL

Can someone explain how the COALESCE function in TSQL works? The syntax is as follows COALESCE(x, y) The MSDN document on this function is pretty vague..

How can I set the form action through JavaScript?

I have an HTML form whose action should be set dynamically through JavaScript. How do I do it? Here is what I am trying to achieve: <script type="text/javascript"> function get_act..

Java Convert GMT/UTC to Local time doesn't work as expected

In Order to show a reproducible scenario, I am doing the following Get the current system time (local time) Convert Local time to UTC // Works Fine Till here Reverse the UTC time, back to local time..

Load HTML file into WebView

I have a local html page along with several other resources pointed by it (css files and Javascript libraries) that I would like to load into a WebView . How could this be achieved ? Perhaps not the ..

Xampp localhost/dashboard

I downloaded the recent version of xampp and I installed it and everything but when i type "localhost" in the browser it redirects me to localhost/dashboard is there a way to type localhost and see th..

TypeScript hashmap/dictionary interface

I'm new to using TypeScript and I'm trying to implement a hashmap/dictionary interface. So far I have export interface IHash { [details: string] : string; } I'm having some trouble understandi..

What .NET collection provides the fastest search

I have 60k items that need to be checked against a 20k lookup list. Is there a collection object (like List, HashTable) that provides an exceptionly fast Contains() method? Or will I have to write my ..

read subprocess stdout line by line

My python script uses subprocess to call a linux utility that is very noisy. I want to store all of the output to a log file and show some of it to the user. I thought the following would work, but ..

How do I get a list of folders and sub folders without the files?

I am trying to print a list of the folders and sub folders of a directory to a file. When I run dir /s/b/o:n > f.txt, I get a list of the files also. I only need the folders and sub folders. Any..

Sending email from Azure

Hope someone can help. I want to send email from my Azure account. My domain name is configured to work with Azure. I could not find easily on the web how to send an email from an Azure account. The..

Android, How to limit width of TextView (and add three dots at the end of text)?

I have a TextView that I want to limit characters of it. Actually, I can do this but the thing that I'm looking for is how to add three dots (...) at the end of string. This one shows the text has con..

C#, Looping through dataset and show each record from a dataset column

In C#, I'm trying to loop through my dataset to show data from each row from a specific column. I want the get each date under the column name "TaskStart" and display it on a report, but its just sho..

Pass request headers in a jQuery AJAX GET call

I am trying to pass request headers in an AJAX GET using jQuery. In the following block, "data" automatically passes the values in the querystring. Is there a way to pass that data in the request head..

How to clear browsing history using JavaScript?

I am doing a simple project, let us take high secure website. I have 5 different JSP pages. If I started from first JSP page, it is redirecting to second JSP page and so on. In the meanwhile, it shoul..

C++ catching all exceptions

Is there a c++ equivalent of Java's try { ... } catch (Throwable t) { ... } I am trying to debug Java/jni code that calls native windows functions and the virtual machine keeps crashing. T..

Using number_format method in Laravel

I am fairly new in Laravel and Blade templating. Can anyone help show me how to do this? I have a view like this: @foreach ($Expenses as $Expense) <tr> <td>{{{ $Expense->..

merge two object arrays with Angular 2 and TypeScript?

I have gone across the JavaScript questions on this topic, this question is specifically about Angular2 with TypeScript. What I am trying to do is to concatenate the json objects to an array. My cod..

Why doesn't logcat show anything in my Android?

Why doesn't logcat show anything in my Android (while developing apps with Eclipse)? It just doesn't print anything. It's empty...

In HTML5, can the <header> and <footer> tags appear outside of the <body> tag?

I'm currently using the above tags in this way (classic tag order): <html> <head>...</head> <body> <header>...</header> <section>...</section&..

Event when window.location.href changes

I'm writing a Greasemonkey script for a site which at some point modifies location.href. How can I get an event (via window.addEventListener or something similar) when window.location.href changes on..

Import pfx file into particular certificate store from command line

It's relatively easy to import a certificate into the user's personal store from a pfx file by using CertUtil: certutil –f –p [certificate_password] –importpfx C:\[certificate_path_and_name].pf..

Property 'value' does not exist on type 'EventTarget'

I am using TypeScript Version 2 for an Angular 2 component code. I am getting error "Property 'value' does not exist on type 'EventTarget'" for below code, what could be the solution. Thanks..

How to make a submit out of a <a href...>...</a> link?

I got an image with which links to another page using <a href="..."> <img ...> </a>. How can I make it make a post like if it was a button <input type="submit"...>?..

How to configure nginx to enable kinda 'file browser' mode?

Once I've seen this before when I type a URL http://test.com/test/, instead of give me a html page, it gives me a 'file browser' like interface to browse all the files in the given location. I think ..

Waiting for another flutter command to release the startup lock

When I run my flutter application it show Waiting for another flutter command to release the startup lock this messages and not proceed further...

subtract two times in python

I have two datetime.time values, exit and enter and I want to do something like: duration = exit - enter However, I get this error: TypeError: unsupported operand type(s) for -: 'datetime.time'..

Swift 3 URLSession.shared() Ambiguous reference to member 'dataTask(with:completionHandler:) error (bug)

Hello I have working json parsing code for swift2.2 but when i use it for Swift 3.0 gives me that error ViewController.swift:132:31: Ambiguous reference to member 'dataTask(with:completionHandler:..

How to redirect both stdout and stderr to a file

I am running a bash script that creates a log file for the execution of the command I use the following Command1 >> log_file Command2 >> log_file This only sends the standard output an..

Convert date to datetime in Python

Is there a built-in method for converting a date to a datetime in Python, for example getting the datetime for the midnight of the given date? The opposite conversion is easy: datetime has a .date() m..

Change the maximum upload file size

I have a website hosted on a PC I have no access to. I have an upload form allowing people to upload mp3 files up to 30MB big. My server side script is done in PHP. Every time I try and upload a file..

Aggregate function in SQL WHERE-Clause

In a test at university there was a question; is it possible to use an aggregate function in the SQL WHERE clause. I always thought this isn't possible and I also can't find any example how it would..

How to advance to the next form input when the current input has a value?

I am having a form with lots of entries. I would like to change my focus to the next textbox, once I entered the value in the current textbox. and want to continue this process up to the last field. M..

Android - How to regenerate R class?

Possible Duplicate: Developing for Android in Eclipse: R.java not generating I have imported a project into my Eclipse IDE, but it's giving me an error since R file is not generated automat..

Tomcat won't stop or restart

I tried stopping tomcat. It failed with this message: Tomcat did not stop in time. PID file was not removed. I then tried again and got this: PID file (/opt/tomcat/work/catalina.pid) found but ..

How can I turn a List of Lists into a List in Java 8?

If I have a List<List<Object>>, how can I turn that into a List<Object> that contains all the objects in the same iteration order by using the features of Java 8?..

Comparing two maps

I have two maps declared as Map<String, Object>. The Object here could be another Map<String, Object> (and so on). I want to check if two maps are exactly the same without knowing their de..

How to Refresh a Component in Angular

I am working on an Angular project. I'm struggling with refresh action in a component. I would like to refresh the router's components on button click. I have refresh button when I click on it the co..

How to read .pem file to get private and public key

I am writing a small piece of code which reads public and private key stored in .pem file. I am using the following commands to generate the keys. Below command to generate pair of key. $open..

adb shell command to make Android package uninstall dialog appear

I have adb running and device is connected to my system in debugging mode, I want to uninstall app using intent launch using adb shell am start <INTENT> I don't want to uninstall using adb uni..

Finding the mode of a list

Given a list of items, recall that the mode of the list is the item that occurs most often. I would like to know how to create a function that can find the mode of a list but that displays a message ..

What is MATLAB good for? Why is it so used by universities? When is it better than Python?

I've been recently asked to learn some MATLAB basics for a class. What does make it so cool for researchers and people that works in university? I saw it's cool to work with matrices and plotting thi..

The import org.junit cannot be resolved

I need to solve a java problem for an interview, and they have sent me the test class. It starts with import org.junit.Before; and also has the following syntax at places: @RunWith(JUnit4.class) ..

jQuery - Click event on <tr> elements with in a table and getting <td> element values

I have the following HTML in a JSP file: <div class="custList"> <table class="dataGrid"> <c:forEach var="cust" items="${custList}"> <tr> <td&g..

How can I set size of a button?

I put my buttons in a JPane with GridLayout. Then I put JPanel into another JPanel with BoxLayout.Y_AXIS. I want buttons in the GridLayout to be square. I use tmp.setSize(30,30) and it does not work. ..

./xx.py: line 1: import: command not found

I am trying to use this Python urllib2 Basic Auth Problem bit of code to download a webpage content from an URL which requires authentication. The code I am trying is: import urllib2, base64 reques..

Convert INT to VARCHAR SQL

I am using Sybase and I am doing a select which returns me a column called "iftype", but its type is int and I need to convert into varchar. When I try to do the select without the convert function I ..

How can I get a specific parameter from location.search?

If I had a URL such as http://localhost/search.php?year=2008 How would I write a JavaScript function to grab the variable year and see if it contains anything? I know it can be done with location...

Print <div id="printarea"></div> only?

How do I print the indicated div (without manually disabling all other content on the page)? I want to avoid a new preview dialog, so creating a new window with this content is not useful. The page ..

jquery AJAX and json format

I have a webservice that expects to receive json, like so: {"first_name":"test","last_name":"teste","email":"[email protected]","mobile":"+44 22 2222 2222", "password":"testing"} My ajax call in jq..

How to install Visual C++ Build tools?

I need to install Visual C++ Build Tools. When I've download installer, I've tried to install it, however it's telling me I need to uninstall VS 2015! How can I solve it? Why is Visual C++ Build tool..

How to get a random number between a float range?

randrange(start, stop) only takes integer arguments. So how would I get a random number between two float values?..

Android emulator: How to monitor network traffic?

How do I monitor network traffic sent and received from my android emulator?..

Violation Long running JavaScript task took xx ms

Recently, I got this kind of warning, and this is my first time getting it: [Violation] Long running JavaScript task took 234ms [Violation] Forced reflow while executing JavaScript took 45ms I'..

Simple JavaScript login form validation

Just a really simple login and redirect, but the script doesn't fire since I changed the button input type to 'submit' and the onClick event to onSubmit. All is does now is just add the username and p..

How to set the allowed url length for a nginx request (error code: 414, uri too large)

I am using Nginx in front of 10 mongrels. When I make a request with size larger then 2900 I get back an: error code 414: uri too large Does anyone know the setting in the nginx configuration f..

Unity 2d jumping script

Does anyone have a good jumping script for 2d games in unity? The code I have works but still is far from jumping, it looks like it is flying. using UnityEngine; using System.Collections; public cla..

What is the size of a boolean variable in Java?

Can any one tell the bit size of boolean in Java?..

How to prevent a jQuery Ajax request from caching in Internet Explorer?

How do I prevent a jQuery Ajax request from caching in Internet Explorer?..

Format specifier %02x

I have a simple program : #include <stdio.h> int main() { long i = 16843009; printf ("%02x \n" ,i); } I am using %02x format specifier to get 2 char output, However, the outpu..

What is the default encoding of the JVM?

Is UTF-8 the default encoding in Java? If not, how can I know which encoding is used by default?..

Subclipse svn:ignore

I'm new to Eclipse. I'm using subclipse for connecting to my SVN. There are some folders and files I would like to add to svn:ignore, but it's grayed out. Is there an easy way to get subclipse to ig..

How to get a list of all files in Cloud Storage in a Firebase app?

I'm working on uploading images, everything works great, but I have 100 pictures and I would like to show all of them in my View, as I get the complete list of the images in a folder, I can not find a..

Disable Copy or Paste action for text box?

I have two textboxes, and I want to prevent user from copying the value from the first (email) textbox and pasting it in the second (confirmEmail) textbox. Email: <input type="textbox" id="email"&..

Getting "error": "unsupported_grant_type" when trying to get a JWT by calling an OWIN OAuth secured Web Api via Postman

I have followed this article to implement an OAuth Authorization server. However when I use post man to get a token, I get an error in the response: "error": "unsupported_grant_type" I read some..

Waiting for Target Device to Come Online

I recently updated to Android Studio 2.3, and now when I try to run the application, the emulator does not come online. It times out after 300 seconds. Additionally, The app has been experiencing a F..

How to determine if object is in array

I need to determine if an object already exists in an array in javascript. eg (dummycode): var carBrands = []; var car1 = {name:'ford'}; var car2 = {name:'lexus'}; var car3 = {name:'maserati'}; var..

How to insert selected columns from a CSV file to a MySQL database using LOAD DATA INFILE

I have a CSV file which contains 10 columns. I want to select only some columns from that file and load them into a MySQL database using the LOAD DATA INFILE command...

Java: how do I check if a Date is within a certain range?

I have a series of ranges with start dates and end dates. I want to check to see if a date is within that range. Date.before() and Date.after() seem to be a little awkward to use. What I really need ..

Return anonymous type results?

Using the simple example below, what is the best way to return results from multiple tables using Linq to SQL? Say I have two tables: Dogs: Name, Age, BreedId Breeds: BreedId, BreedName I want t..

Add disabled attribute to input element using Javascript

I have an input box and I want it to be disabled and at the same time hide it to avoid problems when porting my form. So far I have the following code to hide my input: $(".shownextrow").click(funct..

How do I get the calling method name and type using reflection?

Possible Duplicate: How can I find the method that called the current method? I'd like to write a method which obtains the name of the calling method, and the name of the class containing t..

Sending emails in Node.js?

I recently started programming my first node.js. However, I discovered that I am unable to create a contact me form that sends straight to my email since I can't find any modules from node that is abl..

How do I hide anchor text without hiding the anchor?

Say I have the following markup: <li><a href="somehwere">Link text</a></li> If I have a background image on the a tag, how would I hide the link text using just css?..

Reload browser window after POST without prompting user to resend POST data

When a user visits my website there is a "Login" link on every page. Clicking this uses some JavaScript to show an overlay window where the user is prompted for their credentials. After entering these..

Styling HTML5 input type number

I'm writing a form in HTML5. One of the inputs is type=number. I want the input to only show 2 digits but it seems to default to showing at least 5 digits, which takes up extra space. I've tried addin..

Count number of iterations in a foreach loop

How to calculate how many items in a foreach? I want to count total rows. foreach ($Contents as $item) { $item[number];// if there are 15 $item[number] in this foreach, I want get the value : 15..

The best way to calculate the height in a binary search tree? (balancing an AVL-tree)

I'm looking for the best way to calculate a nodes balance in an AVL-tree. I thought I had it working, but after some heavy inserting/updating I can see that it's not working correct (at all). This i..

How to remove a package from Laravel using composer?

What is the correct way to remove a package from Laravel using composer? So far I've tried: Remove declaration from composer.json (in "require" section) Remove any Class Aliases from app.ph..

How do I move focus to next input with jQuery?

I am using the autocomplete plugin with jQuery and it is working fine. However, in IE, when the user selects an item in the autocomplete, the focus does not then move to the next input field. Naturall..

Does a foreign key automatically create an index?

I've been told that if I foreign key two tables, that SQL Server will create something akin to an index in the child table. I have a hard time believing this to be true, but can't find much out there..

std::queue iteration

I need to iterate over std::queue. www.cplusplus.com says: By default, if no container class is specified for a particular queue class, the standard container class template deque is used. So ca..

PostgreSQL - SQL state: 42601 syntax error

I would like to know how to use a dynamic query inside a function. I've tried lots of ways, however, when I try to compile my function a message SQL 42601 is displayed. The code that I use: CREATE O..

How do you send an HTTP Get Web Request in Python?

I am having trouble sending data to a website and getting a response in Python. I have seen similar questions, but none of them seem to accomplish what I am aiming for. This is my C# code I'm trying ..

How to unapply a migration in ASP.NET Core with EF Core

When I run PM> Remove-Migration -context BloggingContext in VS2015 with an ASP.NET Core project using EF Core I get the following error: System.InvalidOperationException: The migration '2016070319..

jQuery UI Dialog with ASP.NET button postback

I have a jQuery UI Dialog working great on my ASP.NET page: jQuery(function() { jQuery("#dialog").dialog({ draggable: true, resizable: true, show: 'Transfer', hide..

Android - default value in editText

In my app I have an edit user details page and I want to display the current name, email address etc in the corresponding editText fields and then the user can just erase that and enter a new one if t..

Keep placeholder text in UITextField on input in IOS

Is there any way to prevent placeholder text in a UITextField from being overwritten when the text field receives an input? I have a text field that takes an expiration date in this format "MM/YYYY" w..

How to set the From email address for mailx command?

I am working on a KornShell (ksh) script running on a Solaris server that will send out an email when and error condition is met. I am sending the email via mailx. Question: How do I set the "From..

Implement a simple factory pattern with Spring 3 annotations

I was wondering how I could implement the simple factory pattern with Spring 3 annotations. I saw in the documentation that you can create beans that call the factory class and run a factory method. ..

Invert "if" statement to reduce nesting

When I ran ReSharper on my code, for example: if (some condition) { Some code... } ReSharper gave me the above warning (Invert "if" statement to reduce nesting), and..

What are the differences between char literals '\n' and '\r' in Java?

In Java, the newline and carriage return characters are both seem to be showing same effect. What are the actual differences between char literals \n and \r in Java? Note that the above asks about..

Array of PHP Objects

So I have been searching for a while and cannot find the answer to a simple question. Is it possible to have an array of objects in PHP? Such as: $ar=array(); $ar[]=$Obj1 $ar[]=$obj2 For so..

How do I compile a .c file on my Mac?

How do I compile a .c file on my Mac? ..

How to center a table of the screen (vertically and horizontally)

I have these code block: <table border="1px"> <tr> <td> my content </td> </tr> </table> I'd like to show my table in the center of the screen (vertically and hor..

E: Unable to locate package mongodb-org

I am trying to download mongodb and I am following the steps on this link. But when I get to the step: sudo apt-get install -y mongodb-org I get the following error: Reading package lists... Done..

Immediate exit of 'while' loop in C++

How do I exit a while loop immediately without going to the end of the block? For example, while (choice != 99) { cin >> choice; if (choice == 99) //Exit here and don't get add..

MySQL CREATE FUNCTION Syntax

I am trying to create a function in MySQL: Here is the SQL code: CREATE FUNCTION F_Dist3D (x1 decimal, y1 decimal) RETURNS decimal DETERMINISTIC BEGIN DECLARE dist decimal; SET dist = SQRT(x1 - ..

In Visual Studio Code How do I merge between two local branches?

In Visual Studio Code it seems that I am only allowed to push, pull and sync. There is documented support for merge conflicts but I can't figure out how to actually merge between two branches. The Git..

Using margin / padding to space <span> from the rest of the <p>

Ive got a block of text, and i want to write the authors name and date bellow it in small italics, so i put it in a <span> block and styled it, but i want to space the name out a little bit so i..

Git: cannot checkout branch - error: pathspec '...' did not match any file(s) known to git

I'm not sure why I'm unable to checkout a branch that I had worked on earlier. See the commands below (note: co is an alias for checkout): ramon@ramon-desktop:~/source/unstilted$ git branch -a * deve..

How to create relationships in MySQL

In class, we are all 'studying' databases, and everyone is using Access. Bored with this, I am trying to do what the rest of the class is doing, but with raw SQL commands with MySQL instead of using A..

PHP: Inserting Values from the Form into MySQL

I created a users table in mysql from the terminal and I am trying to create simple task: insert values from the form. This is my dbConfig file <?php $mysqli = new mysqli("localhost", "root", "pa..

"No Content-Security-Policy meta tag found." error in my phonegap application

After update Cordova 5.0 in my system, I create new applications. When I tested my application on a device that time I get an error in the console log: No Content-Security-Policy meta tag found. Plea..

How to activate virtualenv?

I have been through search and tried various alternatives without success and spent several days on it now - driving me mad. Running on Red Hat Linux with Python 2.5.2 Began using most recent Virtual..

Does C have a "foreach" loop construct?

Almost all languages have a foreach loop or something similar. Does C have one? Can you post some example code?..

How to getElementByClass instead of GetElementById with JavaScript?

I'm trying to toggle the visibility of certain DIV elements on a website depending on the class of each DIV. I'm using a basic JavaScript snippet to toggle them. The problem is that the script only us..

Disabling the button after once click

I need to disable a button once it's clicked so the user can't click it more than once. (My application is written in MVC ASP.NET, I've done this in a normal ASP.NET application.) I tried using JavaS..

Create Django model or update if exists

I want to create a model object, like Person, if person's id doesn't not exist, or I will get that person object. The code to create a new person as following: class Person(models.Model): ident..

How can I get the first two digits of a number?

I want to check the first two digits of a number in Python. Something like this: for i in range(1000): if(first two digits of i == 15): print("15") elif(first two digits of i == 16)..

Does java have a int.tryparse that doesn't throw an exception for bad data?

Possible Duplicate: Java: Good way to encapsulate Integer.parseInt() how to convert a string to float and avoid using try/catch in java? C# has Int.TryParse: Int32.TryParse Method (String..

ReactJS SyntheticEvent stopPropagation() only works with React events?

I'm trying to use event.stopPropagation() within a ReactJS component to stop a click event from bubbling up and triggering a click event that was attached with JQuery in legacy code, but it seems like..

adding text to an existing text element in javascript via DOM

I am trying to figure how to add text to a p tag or h1 tag that already has a text node. For example: _x000D_ _x000D_ var t = document.getElementById("p").textContent;_x000D_ var y = document.creat..

jQuery: how do I animate a div rotation?

I can rotate a div with css, and jquery .rotate, but i don't know how to animate it...

How can I get just the first row in a result set AFTER ordering?

This gives me just one row (the first one): SELECT BLA FROM BLA WHERE BLA AND ROWNUM < 2 However, I want the most recent date val; I can make that the first row this way: SELECT BLA FROM BLA WH..

Counting the number of True Booleans in a Python List

I have a list of Booleans: [True, True, False, False, False, True] and I am looking for a way to count the number of True in the list (so in the example above, I want the return to be 3.) I have f..

How to search for a string in an arraylist

I want to search for a string in an arraylist. My ArrayList contains: ArrayList <String> list = new ArrayList(); list.add("behold"); list.add("bend"); list.add("bet"); list.add("bear"); list...

Why is volatile needed in C?

Why is volatile needed in C? What is it used for? What will it do?..

Take a screenshot via a Python script on Linux

I want to take a screenshot via a python script and unobtrusively save it. I'm only interested in the Linux solution, and should support any X based environment...

Bootstrap Modal Backdrop Remaining

I am showing a Bootstrap modal window for loading when performing AJAX calls. I broadcast a "progress.init" event when the loading modal should show and a "progress.finish" when I want the modal to hi..

Measuring function execution time in R

Is there a standardized way in R of measuring execution time of function? Obviously I can take system.time before and after execution and then take the difference of those, but I would like to know i..

How to upgrade Angular CLI project?

I'm attempting to upgrade my angular 2 project from 2.0.0 to 2.4.1. I understand that semantic versioning has been adopted since the 2.0.0 release and 2.x.x releases should be drop-in replacements. ..

How do I combine two data-frames based on two columns?

I know I can use the plyr and its friends to combine dataframes, and merge as well, but so far I don't know how to merge two dataframes with multiple columns based on 2 columns?..

Command to list all files in a folder as well as sub-folders in windows

I tried searching for a command that could list all the file in a directory as well as subfolders using a command prompt command. I have read the help for "dir" command but coudn't find what I was loo..

RequestDispatcher.forward() vs HttpServletResponse.sendRedirect()

What is the conceptual difference between forward() and sendRedirect()?..

JTable won't show column headers

I have the following code to instantiate a JTable: the table comes up with the right number of rows and columns, but there is no sign of the titles atop the columns. public Panel1() { int nmbrR..

JSON datetime between Python and JavaScript

I want to send a datetime.datetime object in serialized form from Python using JSON and de-serialize in JavaScript using JSON. What is the best way to do this?..

How to force DNS refresh for a website?

I'm moving my web application to another server and in the next few days I'll refresh the DNS to point to the new IP location. Unfortunately some browsers and SOs keep a DNS cache that will make user..

Plotting of 1-dimensional Gaussian distribution function

How do I make plots of a 1-dimensional Gaussian distribution function using the mean and standard deviation parameter values (µ, s) = (-1, 1), (0, 2), and (2, 3)? I'm new to programming, using Pytho..

Export pictures from excel file into jpg using VBA

I have an Excel file which includes pictures in column B and I want like to export them into several files as .jpg (or any other picture file format). The name of the file should be generated from tex..

How to printf uint64_t? Fails with: "spurious trailing ‘%’ in format"

I wrote a very simple test code of printf uint64_t: #include <inttypes.h> #include <stdio.h> int main() { uint64_t ui64 = 90; printf("test uint64_t : %" PRIu64 "\n", ui64); return ..

Why maven settings.xml file is not there?

I installed maven plugin for eclipse and was able to use it only in eclipse. I want to be able to run maven commands from terminal so installed maven as explained in the below link: http://www.mkyong..

How Can I Resolve:"can not open 'git-upload-pack' " error in eclipse?

I am building an android app with the facebook api and I need to import the facebook android sdk. When I want to import this file from github it throws the .."can not list the available branches..'can..

React JSX: selecting "selected" on selected <select> option

In a React component for a <select> menu, I need to set the selected attribute on the option that reflects the application state. In render(), the optionState is passed from the state owner to ..

Find mouse position relative to element

I want to make a little painting app using canvas. So I need to find the mouse's position on the canvas...

How to Set the Background Color of a JButton on the Mac OS

Normally with Java Swing you can set the background color of a button with: myJButton.setBackground(Color.RED); which would cause the button to be red. But on the Mac OS, this method seems to be ig..

What is sharding and why is it important?

I think I understand sharding to be putting back your sliced up data (the shards) into an easy to deal with aggregate that makes sense in the context. Is this correct? Update: I guess I am struggli..

How can I switch to another branch in git?

Which one of these lines is correct? git checkout 'another_branch' Or git checkout origin 'another_branch' Or git checkout origin/'another_branch' And what is the difference between them? ..

Error:Execution failed for task ':app:compileDebugKotlin'. > Compilation error. See log for more details

Error:Execution failed for task ':app:compileDebugKotlin'. > Compilation error. See log for more details build:gradle(Module:app) buildscript { repositories { maven { url '..

Errors: Data path ".builders['app-shell']" should have required property 'class'

I am getting this error while running my application. Here are the details of my application. Angular CLI: 7.3.3 Node: 10.15.1 Angular: 7.2.7 @angular-devkit/architect -0.13.3 @angular-devkit/bu..

Find index of a value in an array

Can linq somehow be used to find the index of a value in an array? For instance, this loop locates the key index within an array. for (int i = 0; i < words.Length; i++) { if (words[i].IsKey) ..

How to get calendar Quarter from a date in TSQL

I have different dates in a column. For example: 20080102 20070821 I want to convert these dates in Year and calendar quarter. E.g., Year Quarter 2008 2008-Q1 2007 2007-Q3 I can..

Check if character is number?

I need to check whether justPrices[i].substr(commapos+2,1). The string is something like: "blabla,120" In this case it would check whether '0' is a number. How can this be done?..

C# looping through an array

I am looping through an array of strings, such as (1/12/1992 apple truck 12/10/10 orange bicycle). The array's length will always be divisible by 3. I need to loop through the array and grab the first..

Best way to remove from NSMutableArray while iterating?

In Cocoa, if I want to loop through an NSMutableArray and remove multiple objects that fit a certain criteria, what's the best way to do this without restarting the loop each time I remove an object? ..

Html.HiddenFor value property not getting set

I could have used @Html.HiddenFor(x=> ViewData["crn"]) but, I get, <input id="ViewData_crn_" name="ViewData[crn]" type="hidden" value="500" /> To somehow circumvent that issue(id=ViewDa..

CSS ''background-color" attribute not working on checkbox inside <div>

The heading pretty much explains it. I have a couple of checkboxes inside a scrollable div. But for some reasons the 'background-color' attribute doesn't work. Although the 'margin-top' does seem to w..

How do I make case-insensitive queries on Mongodb?

var thename = 'Andrew'; db.collection.find({'name':thename}); How do I query case insensitive? I want to find result even if "andrew";..

Java POI : How to read Excel cell value and not the formula computing it?

I am using Apache POI API to getting values from an Excel file. Everything is working great except with cells containing formulas. In fact, the cell.getStringCellValue() is returning the formula used..

Copy all the lines to clipboard

Is there any way to copy all lines from open file to clipboard in VI editor. I tried yG but it's not using clipboard to store those lines. So is it possible?..

bash assign default value

${parameter:=word} Assign Default Values. If parameter is unset or null, the expansion of word is assigned to parameter. The value of parameter is then substituted. Posit..

Your password does not satisfy the current policy requirements

I want to create a new user in mysql with syntax: create user 'demo'@'localhost' identified by 'password'; But it returns an error: Your password does not satisfy the current policy requiremen..

Xcode 10, Command CodeSign failed with a nonzero exit code

Everytime I build console is showing this message. CodeSign /Users/admin/Desktop/AppStoreBuild/Project201/build/Debug-iphonesimulator/Project.app (in target: Desker) cd /Users/admin/Desktop/..

Retrieving the COM class factory for component failed

I am using an excel object (COM component) for excel manipulation. It works fine on my PC, but when I deploy the application to our Intranet I am getting this error: Retrieving the COM class facto..

How to extract numbers from a string and get an array of ints?

I have a String variable (basically an English sentence with an unspecified number of numbers) and I'd like to extract all the numbers into an array of integers. I was wondering whether there was a qu..

Pandas sum by groupby, but exclude certain columns

What is the best way to do a groupby on a Pandas dataframe, but exclude some columns from that groupby? e.g. I have the following dataframe: Code Country Item_Code Item Ele_Code Unit ..

Which UUID version to use?

Which version of the UUID should you use? I saw a lot of threads explaining what each version entails, but I am having trouble figuring out what's best for what applications...

How to display errors for my MySQLi query?

I am using the following script to process a form to add info to my website. The problem I am having is when I submit the form nothing gets submitted to the database, and there are no errors. How can ..

Adding rows to tbody of a table using jQuery

I am trying to add rows to the tbody of a table. But I am having issues with achieving that. Firstly, the function where everything takes place is called on change of a dropdown from a html page. I cr..

How to store Configuration file and read it using React

I am new on react.js I have implemented one component in which I am fetching the data from server and use it like, CallEnterprise:function(TenantId){ fetchData('http://xxx.xxx.xx.xx:8090/Enter..

Can I call an overloaded constructor from another constructor of the same class in C#?

Can I call an overloaded constructor from another constructor of the same class in C#?..

How to [recursively] Zip a directory in PHP?

Directory is something like: home/ file1.html file2.html Another_Dir/ file8.html Sub_Dir/ file19.html I am using the same PHP Zip class used in PHPMyAdmin http://trac.seagul..

How can you run a Java program without main method?

Possible Duplicate: Printing message on Console without using main() method Can someone suggest how can a JAVA program run without writing a main method.. For eg: System.out.println("Main..

Troubleshooting "Warning: session_start(): Cannot send session cache limiter - headers already sent"

i am getting Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at error If i submit form data to a different file for pro..

finding and replacing elements in a list

I have to search through a list and replace all occurrences of one element with another. So far my attempts in code are getting me nowhere, what is the best way to do this? For example, suppose my li..

Permanently adding a file path to sys.path in Python

I had a file called example_file.py, which I wanted to use from various other files, so I decided to add example_file.py to sys.path and import this file in another file to use the file. To do so, I r..

Solution to INSTALL_FAILED_INSUFFICIENT_STORAGE error on Android

The INSTALL_FAILED_INSUFFICIENT_STORAGE error is the bane of every Android developer's life. It happens regardless of app size, or how much storage is available. Rebooting the target device fixes the ..

How do I use sudo to redirect output to a location I don't have permission to write to?

I've been given sudo access on one of our development RedHat linux boxes, and I seem to find myself quite often needing to redirect output to a location I don't normally have write access to. The tro..

Numpy `ValueError: operands could not be broadcast together with shape ...`

Im using python 2.7 and am attempting a forcasting on some random data from 1.00000000 to 3.0000000008. There are approx 196 items in my array and I get the error ValueError: operands could not be br..

Runnable with a parameter?

I have a need for a "Runnable that accepts a parameter" although I know that such runnable doesn't really exist. This may point to fundamental flaw in the design of my app and/or a mental block in my..

Best way to restrict a text field to numbers only?

I'm using the following Javascript to restrict a text field on my website to only accept numerical input, and no other letters or characters. The problem is, it REALLY rejects all other key inputs, li..

CSS to make table 100% of max-width

Given the following for an email template: <style> @import url("http://fonts.googleapis.com/css?family=Open Sans"); </style> <div style="width:100%; background:#F2F2F2"> <ta..

How to make Git "forget" about a file that was tracked but is now in .gitignore?

There is a file that was being tracked by git, but now the file is on the .gitignore list. However, that file keeps showing up in git status after it's edited. How do you force git to completely forg..

Swift GET request with parameters

I'm very new to swift, so I will probably have a lot of faults in my code but what I'm trying to achieve is send a GET request to a localhost server with paramters. More so I'm trying to achieve it gi..

How to handle anchor hash linking in AngularJS

Do any of you know how to nicely handle anchor hash linking in AngularJS? I have the following markup for a simple FAQ-page <a href="#faq-1">Question 1</a> <a href="#faq-2">Questio..

Write output to a text file in PowerShell

I've compared two files using the following code: Compare-Object $(Get-Content c:\user\documents\List1.txt) $(Get-Content c:\user\documents\List2.txt) How can I write the output of this to a new t..

How do I make an http request using cookies on Android?

I'd like to make an http request to a remote server while properly handling cookies (eg. storing cookies sent by the server, and sending those cookies when I make subsequent requests). It'd be nice t..

Return current date plus 7 days

I'm Trying to get the current date plus 7 days to display. Example: Today is August 16, 2012, so this php snippet would output August 23, 2012. $date = strtotime($date); $date = strtotime("+7..

sequelize findAll sort order in nodejs

I'm trying to output all object list from database with sequelize as follow and want to get data are sorted out as I added id in where clause. exports.getStaticCompanies = function () { return Co..

Bootstrap 3 Carousel Not Working

My carousel from Bootstrap won't display my images or react to the controls. This is my HTML: <!DOCTYPE HTML> <html> <head> <title>Skates R Us</title> ..

Using R to download zipped data file, extract, and import data

@EZGraphs on Twitter writes: "Lots of online csvs are zipped. Is there a way to download, unzip the archive, and load the data to a data.frame using R? #Rstats" I was also trying to do this today, bu..

Max retries exceeded with URL in requests

I'm trying to get the content of App Store > Business: import requests from lxml import html page = requests.get("https://itunes.apple.com/in/genre/ios-business/id6000?mt=8") tree = html.fromstring(..

Opening new window in HTML for target="_blank"

<a href="facebook.com/sharer" target="_blank" >Share this</a> How do I make this a certain width and height, in a new window, when the user clicks on it? In firefox, the current code on..

Run a PostgreSQL .sql file using command line arguments

I have some .sql files with thousands of INSERT statements in them and need to run these inserts on my PostgreSQL database in order to add them to a table. The files are that large that it is impossib..

How to programmatically take a screenshot on Android?

How can I take a screenshot of a selected area of phone-screen not by any program but from code?..

Select from table by knowing only date without time (ORACLE)

I'm trying to retrieve records from table by knowing the date in column contains date and time. Suppose I have table called t1 which contains only two column name and date respectively. The data sto..

How to add a Hint in spinner in XML

I am trying to add a Hint in the spinner widget as there is no option of Hint as in EditText, I want to show Gender as a Hint and when clicked it must show only Male and Female not the hint. How it ..

Add a custom attribute to a Laravel / Eloquent model on load?

I'd like to be able to add a custom attribute/property to an Laravel/Eloquent model when it is loaded, similar to how that might be achieved with RedBean's $model->open() method. For instance, at ..