Questions Tagged with #Git amend

Parameter of git-commit command that adds the current staging area to the last commit and allows you to (by default) edit previously used commit message or (if other options were given) reuse it or even discard it and write a new one.

How to undo "git commit --amend" done instead of "git commit"

I accidentally amended my previous commit. The commit should have been separate to keep history of the changes I made to a particular file. Is there a way to undo that last commit? If I do something ..

How do I push amended commit to the remote Git repository?

When I've worked a bit with my source code, I did my usual thing commit and then I pushed to a remote repository. But then I noticed I forgot to organize my imports in the source code. So I do the ame..

How to modify existing, unpushed commit messages?

I wrote the wrong thing in a commit message. How can I change the message? The commit has not been pushed yet...

Mercurial: how to amend the last commit?

I'm looking for a counter-part of git commit --amend in Mercurial, i.e. a way to modify the commit which my working copy is linked to. I'm only interested in the last commit, not an arbitrary earlier ..

How to amend a commit without changing commit message (reusing the previous one)?

Is there a way to amend a commit without vi (or your $EDITOR) popping up with the option to modify your commit message, but simply reusing the previous message?..

how to use jQuery ajax calls with node.js

This is similar to Stream data with Node.js, but I don't feel that question was answered sufficiently. I'm trying to use a jQuery ajax call (get, load, getJSON) to transfer data between a page and a ..

Executing a batch script on Windows shutdown

Is there any way, in Windows 7 Professional, to run a batch script (e.g., a .BAT file) when the user clicks on "shutdown" (not a batch file scheduled to shut down the machine, just one that runs only ..

jQuery UI Sortable, then write order into a database

I want to use the jQuery UI sortable function to allow users to set an order and then on change, write it to the database and update it. Can someone write an example on how this would be done?..

How to generate a Makefile with source in sub-directories using just one makefile

I have source in a bunch of subdirectories like: src/widgets/apple.cpp src/widgets/knob.cpp src/tests/blend.cpp src/ui/flash.cpp In the root of the project I want to generate a single Makefile usin..

cannot convert data (type interface {}) to type string: need type assertion

I am pretty new to go and I was playing with this notify package. At first I had code that looked like this: func doit(w http.ResponseWriter, r *http.Request) { notify.Post("my_event", "Hello Wo..

Is there a naming convention for git repositories?

For example, I have a RESTful service called Purchase Service. Should I name my repository: purchaserestservice purchase-rest-service purchase_rest_service or something else? What's the convention..

dbms_lob.getlength() vs. length() to find blob size in oracle

I'm getting the same results from select length(column_name) from table as select dbms_lob.getlength(column_name) from table However, the answers to this question seem to favor using dbms_lob.g..

Android. WebView and loadData

It's possible to use following method for content's setting of a web-view loadData(String data, String mimeType, String encoding) How to handle the problem with unknown encoding of html data?! Is th..

NPM clean modules

Is there a way to get npm to unbuild all the modules under node_modules? Something like npm rebuild that removes all build artifacts but doesn't rebuild them?..

Removing single-quote from a string in php

I have an HTML form that a user can input text into a title field, I then have php creating an HTML file called title.html My problem is that users can input spaces and apostrophes into the title fie..

Debugging with Android Studio stuck at "Waiting For Debugger" forever

UPDATE The supposed duplicate is a question on being stucking in "Waiting For Debugger" when executing Run, while this question is on being stucking in "Waiting For Debugger" when executing Debug, the..

How to replicate vector in c?

In the days before c++ and vector/lists, how did they expand the size of arrays when they needed to store more data?..

In c, in bool, true == 1 and false == 0?

Just to clarify I found similar answer but for C++, I'm kinda new to coding so I'm not sure whether it applies to C as well...

error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65

I've build a react-native application and suddenly I get this error message on my terminal during run of the command react-native run-ios. The same code work fine 10 minutes ago and suddenly I get thi.."#element") not working when code above the html element

This works: <div id="chart"></div> <script>var svg ="#chart").append("svg:svg");</script> This doesn't: <script>var svg ="#chart").append("svg:s..

Calculate difference between two datetimes in MySQL

I am storing the last login time in MySQL in, datetime-type filed. When users logs in, I want to get the difference between the last login time and the current time (which I get using NOW()). How can..

How do I split a multi-line string into multiple lines?

I have a multi-line string literal that I want to do an operation on each line, like so: inputString = """Line 1 Line 2 Line 3""" I want to do something like the following: for line in inputString..

How to fix IndexError: invalid index to scalar variable

This code generates error: IndexError: invalid index to scalar variable. at the line: results.append(RMSPE(np.expm1(y_train[testcv]), [y[1] for y in y_test])) How to fix it? import pandas as pd i..

When use ResponseEntity<T> and @RestController for Spring RESTful applications

I am working with Spring Framework 4.0.7, together with MVC and Rest I can work in peace with: @Controller ResponseEntity<T> For example: @Controller @RequestMapping("/person") @Profile("..

How to deselect all selected rows in a DataGridView control?

I'd like to deselect all selected rows in a DataGridView control when the user clicks on a blank (non-row) part of the control. How can I do this?..

Launch an app from within another (iPhone)

Is it possible to launch any arbitrary iPhone application from within another app?, For example in my application if I want the user to push a button and launch right into the Phone app (close the cur..

Create a date from day month and year with T-SQL

I am trying to convert a date with individual parts such as 12, 1, 2007 into a datetime in SQL Server 2005. I have tried the following: CAST(DATEPART(year, DATE)+'-'+ DATEPART(month, DATE) +'-'+ DATE..

Difference between IISRESET and IIS Stop-Start command

Is there any difference between commands iisreset and iisreset /stop followed by iisreset /start ? ..

JavaScript - XMLHttpRequest, Access-Control-Allow-Origin errors

I'm attempting to send a XMLHttpRequest to a paste site. I'm sending an object containing all the fields that the api requires, but I keep getting this issue. I have read over the issue, and I thought..

How do the major C# DI/IoC frameworks compare?

At the risk of stepping into holy war territory, What are the strengths and weaknesses of these popular DI/IoC frameworks, and could one easily be considered the best? ..: Ninject Unity Castle.Wind..

How to style the <option> with only CSS?

Note: This question is not about making a custom dropdown. It's only about possibilities of styling <option> elements within the select element in CSS How can I style <option>s of a <s..

The remote certificate is invalid according to the validation procedure

Running the following code, I get an exception: using (var client = new Pop3Client()) { client.Connect(provider.ServerWithoutPort, provider.Port, true); } The Exception I get: The remote certi..

Cassandra cqlsh - connection refused

I've just started working with Cassandra (datastax), version 2.1.3 and cqlsh version 5.0.1. Cassandra starts up fine and the cluster is operational instantly. Cqlsh is not working (on any of the nod..

How to force page refreshes or reloads in jQuery?

The code below displays a Google map and search results when you enter an address and hit the submit button. I've been playing with it to try and force the page to completely refresh or reload once y..

how to access iFrame parent page using jquery?

I have an iframe and in order to access parent element I implemented following code: window.parent.document.getElementById('parentPrice').innerHTML How to get the same result using jquery? UPDATE: ..

Calling one method from another within same class in Python

I am very new to python. I was trying to pass value from one method to another within the class. I searched about the issue but i could not get proper solution. Because in my code, "if" is calling cla..

matplotlib: plot multiple columns of pandas data frame on the bar chart

I am using the following code to plot a bar-chart: import matplotlib.pyplot as pls my_df.plot(x='my_timestampe', y='col_A', kind='bar') The plot works fine. However, I want to improve ..

YouTube URL in Video Tag

I am using the <video> tag, and I want to use any URL from YouTube in it. I have this but it's not working. I have checked this Show Youtube video source into HTML5 vi..

Python Selenium accessing HTML source

How can I get the HTML source in a variable using the Selenium module with Python? I wanted to do something like this: from selenium import webdriver browser = webdriver.Firefox() browser.get("http..

Can't accept license agreement Android SDK Platform 24

I'm getting the following error when trying to install an android platform on a Cordova project. I've been following this guide: Error occurs when..

combining results of two select statements

I'm using T-SQL with ASP.NET, and c# and i'm pretty new to SQL. I was wondering how i could combine the results of two queries Query1: SELECT tableA.Id, tableA.Name, [tableB].Username AS Owner, [t..

How to deal with "data of class uneval" error from ggplot2?

While trying to overlay a new line to a existing ggplot I am getting the following error: Error: ggplot2 doesn't know how to deal with data of class uneval The first part of my code works fine. B..

Parsing JSON giving "unexpected token o" error

I am having a problem parsing simple JSON strings. I have checked them on JSONLint and it shows that they are valid. But when I try to parse them using either JSON.parse or the jQuery alternative it g..

HTTP vs HTTPS performance

Are there any major differences in performance between http and https? I seem to recall reading that HTTPS can be a fifth as fast as HTTP. Is this valid with the current generation webservers/browse..

How to search a specific value in all tables (PostgreSQL)?

Is it possible to search every column of every table for a particular value in PostgreSQL? A similar question is available here for Oracle. ..

Spring Boot application as a Service

How to configure nicely Spring Boot application packaged as executable jar as a Service in the Linux system? Is this recommended approach, or should I convert this app to war and install it into Tomca..

Rounding a double to turn it into an int (java)

Right now I'm trying this: int a = round(n); where n is a double but it's not working. What am I doing wrong? ..

Javascript: convert 24-hour time-of-day string to 12-hour time with AM/PM and no timezone

The server is sending a string in this format: 18:00:00. This is a time-of-day value independent of any date. How to convert it to 6:00PM in Javascript? I could prepend today's date as a string to the..

How may I reference the script tag that loaded the currently-executing script?

How can I reference the script element that loaded the javascript that is currently running? Here's the situation. I have a "master" script being loaded high in the page, first thing under the HEAD t..

Java Long primitive type maximum limit

I am using the Long primitive type which increments by 1 whenever my 'generateNumber'method called. What happens if Long reaches to his maximum limit? will throw any exception or will reset to minimum..

matplotlib.pyplot will not forget previous plots - how can I flush/refresh?

How do you get matplotlib.pyplot to "forget" previous plots I am trying to plot multiple time using matplotlib.pyplot The code looks like this: def plottest(): import numpy as np import mat..

Fill remaining vertical space with CSS using display:flex

In a 3-row layout: the top row should be sized according to its contents the bottom row should have a fixed height in pixels the middle row should expand to fill the container The problem is that ..

How to determine the number of days in a month in SQL Server?

I need to determine the number of days in a month for a given date in SQL Server. Is there a built-in function? If not, what should I use as the user-defined function?..

Replace console output in Python

I'm wondering how I could create one of those nifty console counters in Python as in certain C/C++-programs. I've got a loop doing things and the current output is along the lines of: Doing thing 0 ..

TypeError: expected string or buffer

I have this simple code: import re, sys f = open('findallEX.txt', 'r') lines = f.readlines() match = re.findall('[A-Z]+', lines) print match I don't know why I am getting the error: 'expected ..

Subprocess changing directory

I want to execute a script inside a subdirectory/superdirectory (I need to be inside this sub/super-directory first). I can't get subprocess to enter my subdirectory: tducin@localhost:~/Projekty/test..

Which websocket library to use with Node.js?

Currently there is a plethora of websocket libraries for node.js, the most popular seem to be:

Create empty data frame with column names by assigning a string vector?

Create an empty data frame: y <- data.frame() Assign x, a string vector, to y as its column names: x <- c("name", "age", "gender") colnames(y) <- x ..

if else statement in AngularJS templates

I want to do a condition in an AngularJS template. I fetch a video list from the Youtube API. Some of the videos are in 16:9 ratio and some are in 4:3 ratio. I want to make a condition like this: if..

What is the use of ObservableCollection in .net?

What is the use of ObservableCollection in .net?..

How to create and add users to a group in Jenkins for authentication?

I choose to use "Jenkins's own user database" security realm for user login as I couldn't use LDAP in my company. And Google's OpenID has issue when you decided to change the hostname or port number ..

Check if table exists

I have a desktop application with a database embedded in it. When I execute my program I need to check that specific table exists, or create it if not. Given a Connection object named conn for my dat..

How do I get the MAX row with a GROUP BY in LINQ query?

I am looking for a way in LINQ to match the follow SQL Query. Select max(uid) as uid, Serial_Number from Table Group BY Serial_Number Really looking for some help on this one. The above query gets..

GetElementByID - Multiple IDs

doStuff(document.getElementById("myCircle1" "myCircle2" "myCircle3" "myCircle4")); This doesn't work, so do I need a comma or semi-colon to make this work?..

How do I get a reference to the app delegate in Swift?

How do I get a reference to the app delegate in Swift? Ultimately, I want to use the reference to access the managed object context...

How to make a Java thread wait for another thread's output?

I'm making a Java application with an application-logic-thread and a database-access-thread. Both of them persist for the entire lifetime of the application and both need to be running at the same tim..

Can't bind to 'formControl' since it isn't a known property of 'input' - Angular2 Material Autocomplete issue

I am trying to use Angular Material Autocomplete component in my Angular 2 project. I added the following to my template. <md-input-container> <input mdInput placeholder="Category" [mdAut..

How to count rows with SELECT COUNT(*) with SQLAlchemy?

I'd like to know if it's possible to generate a SELECT COUNT(*) FROM TABLE statement in SQLAlchemy without explicitly asking for it with execute(). If I use: session.query(table).count() then it gen..

Reading int values from SqlDataReader

hi can anyone please help me with this fetching from database of int values im having difficulty in fetching int values , it works for varchar but not int can someone help me out please if (int.TryP..

PHP PDO with foreach and fetch

The following code: <?php try { $dbh = new PDO("mysql:host=$hostname;dbname=$dbname", $username, $password); echo "Connection is successful!<br/>"; $sql = "SELECT * FROM users"; ..

How to concatenate strings in windows batch file for loop?

I'm familiar with Unix shell scripting, but new to windows scripting. I have a list of strings containing str1, str2, str3...str10. I want to do like this: for string in string_list do var = stri..

Keep values selected after form submission

Consider: <form method="get" action=""> <select name="name"> <option value="a">a</option> <option value="b">b</option> </select> <sel..

Sending intent to BroadcastReceiver from adb

I've got BroadcastReceiver class: public class IntentReceiver extends BroadcastReceiver { final String tag = "Intent Intercepter"; @Override public void onReceive(Context context, Inten..

Get Environment Variable from Docker Container

What's the simplest way to get an environment variable from a docker container that has not been declared in the Dockerfile? For instance, an environment variable that has been set through some docke..

CSS div element - how to show horizontal scroll bars only?

I have a div container and have defined its style as follows: div#tbl-container { width: 600px; overflow: auto; scrollbar-base-color:#ffeaff } This gives me both horizontal and ..

Only allow specific characters in textbox

How can I only allow certain characters in a Visual C# textbox? Users should be able to input the following characters into a text box, and everything else should be blocked: 0-9, +, -, /, *, (, ). I..

How to keep the header static, always on top while scrolling?

How would I go about keeping my header from scrolling with the rest of the page? I thought about utilizing frame-sets and iframes, just wondering if there is a easier and more user friendly way, what ..

CSS selectors ul li a {...} vs ul > li > a {...}

What is the difference between ul > li > a {...} and ul li a {...} in CSS? Which one is more efficient and why? ..

Check if year is leap year in javascript

function leapYear(year){ var result; year = parseInt(document.getElementById("isYear").value); if (years/400){ result = true } else if(years/100){ result = false ..

Access files in /var/mobile/Containers/Data/Application without jailbreaking iPhone

A program logs some message in directory /var/mobile/Containers/Data/Application on iPhone. Is there any way I can get access to this directory without jailbreaking iPhone? If no, is there any directo..

Best /Fastest way to read an Excel Sheet into a DataTable?

I'm hoping someone here can point me in the right direction - I'm trying to create a fairly robust utility program to read the data from an Excel sheet (may be .xls OR .xlsx) into a DataTable as quick..

How do I set a VB.Net ComboBox default value

I can not locate the correct method to make the first item in a combo box visible. The app starts with an empty combo box. The user makes a radio box selection then clicks Go! (how original). The com..

Bootstrap 3 Gutter Size

I've only just started working with bootstrap and unsure about how to achieve my goal. I would like the gutters to all be even, like they are in this image: by default, they look like this, the ve..

Page Redirect after X seconds wait using JavaScript

I need to redirect to specific url after 5 seconds after putting an error message. First i have used Javascript as below. document.ready(window.setTimeout(location.href = "",5..

What is the best way to exit a function (which has no return value) in python before the function ends (e.g. a check fails)?

Let's assume an iteration in which we call a function without a return value. The way I think my program should behave is explained in this pseudocode: for element in some_list: foo(element) def..

Declaring a variable and setting its value from a SELECT query in Oracle

In SQL Server we can use this: DECLARE @variable INT; SELECT @variable= mycolumn from myTable; How can I do the same in Oracle? I'm currently attempting the following: DECLARE COMPID VARCHAR2(20);..

JSON post to Spring Controller

Hi I am starting with Web Services in Spring, so I am trying to develop small application in Spring + JSON + Hibernate. I have some problem with HTTP-POST. I created a method: @RequestMapping(value="..

Is there a developers api for

I am building an application and would like to automatically post to craigslist with a click of a button. Is there any way to do this? I have an account and will pay for each post...

SQL Query to concatenate column values from multiple rows in Oracle

Would it be possible to construct SQL to concatenate column values from multiple rows? The following is an example: Table A PID A B C Table B PID SEQ Desc A 1 Have A 2 ..

Check if string contains \n Java

How do I check if string contains \n or new line character ? word.contains("\\n") word.contains("\n") ..

Set focus to field in dynamically loaded DIV

What is the proper method to set the focus to a specific field within a dynamically loaded DIV? $("#display").load("?control=msgs"); // loads the HTML into the DIV $('#display').fadeIn("fast"); // di..

How to replace multiple strings in a file using PowerShell

I am writing a script for customising a configuration file. I want to replace multiple instances of strings within this file, and I tried using PowerShell to do the job. It works fine for a single re..

This version of the application is not configured for billing through Google Play

When I try to run my application with in-app billing I am getting the error: "This version of the application is not configured for billing through Google Play. Check the help center for more informat..

Eclipse executable launcher error: Unable to locate companion shared library

I had Eclipse Indigo installed on my computer with the Android plugin and it was working perfectly for about two weeks. Today, I updated java and quicktime then restarted my computer. When it booted b..

What do 'lazy' and 'greedy' mean in the context of regular expressions?

What are these two terms in an understandable way?..

How to get POSTed JSON in Flask?

I'm trying to build a simple API using Flask, in which I now want to read some POSTed JSON. I do the POST with the Postman Chrome extension, and the JSON I POST is simply {"text":"lalala"}. I try to r..

Ruby on Rails 3 Can't connect to local MySQL server through socket '/tmp/mysql.sock' on OSX

I have a standard Rails3 environment, RVM 1.2.9, Rails 3.0.5, Ruby 1.9.2p180, MySQL2 Gem 0.2.7, mysql-5.5.10-osx10.6-x86_64 Error I get when running rake db:migrate to create database is: Can't con..

What is the max size of VARCHAR2 in PL/SQL and SQL?

I am on Oracle 10g. In a requirement I need to increase the size of a pl/sql VARCHAR2 variable. It is already at 4000 size. I have read that in PL/SQL, VARCHAR2 can be up to 32767 bytes. For SQL ..

How can I start PostgreSQL server on Mac OS X?

Final update: I had forgotten to run the initdb command. By running this command ps auxwww | grep postgres I see that postgres is not running > ps auxwww | grep postgres remcat 1789 0...

Should you use .htm or .html file extension? What is the difference, and which file is correct?

What is the difference between the .htm and .html file extension? Why there are two of them? Which is correct?..

What is the purpose of Node.js module.exports and how do you use it?

What is the purpose of Node.js module.exports and how do you use it? I can't seem to find any information on this, but it appears to be a rather important part of Node.js as I often see it in source c..

mysql said: Cannot connect: invalid settings. xampp

I changed the root password to test and now I cannot login in phpMyAdmin page in XAMPP. I looked for help here and here which basically says changed file in XAMPP\PHPMYADMIN folder. /*..

Javascript regular expression password validation having special characters

I am trying to validate the password using regular expression. The password is getting updated if we have all the characters as alphabets. Where am i going wrong ? is the regular expression right ? f..

How can I delete all of my Git stashes at once?

How can I delete all of my Git stashes at once? Specifically I mean, with typing in one command...

Android Open External Storage directory(sdcard) for storing file

I want to open external storage directory path for saving file programatically.I tried but not getting sdcard path. How can i do this?is there any solution for this?? private File path = new File(Env..

Getting the button into the top right corner inside the div box

I can't figure out how to get the [X] button into the top right corner of my custom css box. Here's the result so far: _x000D_ _x000D_ #wrapper {_x000D_ height: 100px;_x000D_ width: 500px;_x00..

Spring MVC Multipart Request with JSON

I want to post a file with some JSON data using Spring MVC. So I've developed a rest service as @RequestMapping(value = "/servicegenerator/wsdl", method = RequestMethod.POST,consumes = { "multipart/m..

Abstract Class:-Real Time Example

Recently in a interview I was asked a very general question "what is abstract in java".I gave the definition and it was followed with some other question on abstract as what is abstract method and dif..

How to negate a method reference predicate

In Java 8, you can use a method reference to filter a stream, for example: Stream<String> s = ...; long emptyStrings = s.filter(String::isEmpty).count(); Is there a way to create a method ref..

Passing variable number of arguments around

Say I have a C function which takes a variable number of arguments: How can I call another function which expects a variable number of arguments from inside of it, passing all the arguments that got i..

Change Select List Option background colour on hover

Is it possible to change the default background color of a select list option on hover? HTML: <select id="select"> <option value="1">One</option> <option value="2">Tw..

JavaScript - Hide a Div at startup (load)

I have a div in my php page that uses jQuery to hide it once the page has loaded. But is there a way to hide it from the very start of loadup? The reason I ask is because for a brief second, you can ..

How can I get the index from a JSON object with value?

This is my JSON string. [{ "name": "placeHolder", "section": "right" }, { "name": "Overview", "section": "lef..

Android file chooser

I want to make a file uploader. And I hence I need a file chooser but I don't want to write this by myself. I find OI file manager and I think it suits me. But how can I force user to install OI file ..

Error when checking model input: expected convolution2d_input_1 to have 4 dimensions, but got array with shape (32, 32, 3)

I want to train a deep network starting with the following layer: model = Sequential() model.add(Conv2D(32, 3, 3, input_shape=(32, 32, 3))) using history = model.fit_generator(get_training_data()..

What's the difference between a proxy server and a reverse proxy server?

What is the difference between a proxy server and a reverse proxy server?..

How to disable/enable a button with a checkbox if checked

Please i need a script that can work with the HTML code bellow to disable/enable the button when a checkbox is checked or unchecked, <input type="submit" name="sendNewSms" class="inputButton" id=..

Indentation Error in Python

I can't compile because of this part in my code: if command == 'HOWMANY': opcodegroupr = "A0" opcoder = "85" elif command == 'IDENTIFY': opcodegroupr = "A0" opcoder = "81" I have th..

How to "grep" for a filename instead of the contents of a file?

grep is used to search within a file to see if any line matches a given regular expression. However, I have this situation - I want to write a regular expression that will match the filename itself (a..

How do I convert uint to int in C#?

How do I convert uint to int in C#?..

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

iPhone system font

What is the name of the default system font on the iPhone? I would like to retrieve this for customizing a UIView...

Get first date of current month in java

I am trying to get to and from date where ToDate will have previous date and FromDate will have first date of the current month. For January it would be 1/1/2013 and so on. How to get the first date o..

Inverse of matrix in R

I was wondering what is your recommended way to compute the inverse of a matrix? The ways I found seem not satisfactory. For example, > c=rbind(c(1, -1/4), c(-1/4, 1)) > c [,1] [,2..

Find duplicate values in R

I have a table with 21638 unique* rows: vocabulary <- read.table("", header=T) This table has five colum..

How to call a button click event from another method

How can I call SubGraphButton_Click(object sender, RoutedEventArgs args) from another method? private void SubGraphButton_Click(object sender, RoutedEventArgs args) { } private void ChildNode_Click..

Is there an opposite to display:none?

The opposite of visibility: hidden is visibility: visible. Similarly, is there any opposite for display: none? Many people become confused figuring out how to show an element when it has display: no..

Return multiple values from a function in swift

How do I return 3 separate data values of the same type(Int) from a function in swift? I'm attempting to return the time of day, I need to return the Hour, Minute and Second as separate integers, but..

How can I find a file/directory that could be anywhere on linux command line?

Ideally, I would be able to use a program like find [file or directory name] to report the paths with matching filenames/directories. Unfortunately this seems to only check the current directory, ..

Array functions in jQuery

I am using jQuery in my web application. I want to use arrays, but I am not able to find out functions for arrays (add, remove or append elements in array) in jQuery. Is there any link related to jQue..

Setting up a cron job in Windows

I have to download a file from an SFTP server everyday. I have the program which retrieves the file from the server but I was thinking of setting up a cron job (or anything similar) to automate that. ..

Google Maps API v3: InfoWindow not sizing correctly

It appears my InfoWindow, when you click on the home icon on my Google Maps v3, is not properly auto-sizing to the content of the InfoWindow. It gives scrollbars when it should not. The InfoWindow sh..

no overload for matches delegate 'system.eventhandler'

As I'm pretty new to C#, I struggle with the following piece of code. When I click to button 'knop', the method 'klik' has to be executed. The method has to draw the Bitmap 'b', generated by 'DrawMand..

Ignore python multiple return value

Say I have a Python function that returns multiple values in a tuple: def func(): return 1, 2 Is there a nice way to ignore one of the results rather than just assigning to a temporary variable..

How to fix "could not find a base address that matches schema http"... in WCF

I'm trying to deploy a WCF service to my server, hosted in IIS. Naturally it works on my machine :) But when I deploy it, I get the following error: This collection already contains an address..

What is the difference between functional and non-functional requirements?

What is the difference between functional and non-functional requirements in the context of designing a software system? Give examples for each case...

How can I implement a theme from bootswatch or wrapbootstrap in an MVC 5 project?

I am about to create a new ASP.Net MVC5 web application. I would like to use a theme from bootswatch or wrapbootstrap in the application, but cannot find a set of instructions on how to do this...

Can regular JavaScript be mixed with jQuery?

For example, can I take this script (from mozilla tutorial): <html> <head> <script type="application/javascript"> function draw() { var canvas = document.getElementById..

Convert string in base64 to image and save on filesystem in Python

I have a string in base64 format, which represents PNG image. Is there a way to save this image to the filesystem, as a PNG file? I encoded the image using flex. Actually this is what I get on serv..

Half circle with CSS (border, outline only)

I'm trying to create a circle with CSS, which looks exactly like on the following picture: ...with only one div: <div class="myCircle"></div> and by using only CSS definitions. No SV..

In CSS how do you change font size of h1 and h2

In a word press twenty eleven theme. I want to change the size of headings When I wrap my headings around h1 and h2 tags as follows <h1>My h1 heading </h1> <h2> My h2 heading <..

Netbeans how to set command line arguments in Java

I am trying to set command line arguments in a Netbeans 7.1 Java project on Windows 7 64 bit. Netbeans is not passing the arguments I give it. I go to Project --> Properties --> Run --> and type th..

How to start new activity on button click

In an Android application, how do you start a new activity (GUI) when a button in another activity is clicked, and how do you pass data between these two activities?..

How can I change the Y-axis figures into percentages in a barplot?

How can we change y axis to percent like the figure? I can change y axis range but I can't make it to percent. ..

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

SQL Server GROUP BY datetime ignore hour minute and a select with a date and sum value

I have a table with two fields - datetime and int. I want to do a group by on the datetime only on the date ignoring the hour and minute. The SELECT statement should return a date that maps to the sum..

Call a method of a controller from another controller using 'scope' in AngularJS

I am trying to call a method of second controller in first controller by using scope variable. This is a method in my first controller: $scope.initRestId = function(){ var catapp = document.g..

Simulate a button click in Jest

Simulating a button click seems like a very easy/standard operation. Yet, I can't get it to work in Jest.js tests. This is what I tried (and also doing it using jQuery), but it didn't seem to trigger ..

Android Shared preferences for creating one time activity (example)

I have three activities A,B and C where A and B are forms and after filling and saving the form data in database(SQLITE). I am using intent from A to B and then B to C.What i want is that every time I..

How to find if a file contains a given string using Windows command line

I am trying to create a batch (.bat) file for windows XP to do the following: If (file.txt contains the string 'searchString') then (ECHO found it!) ELSE(ECHO not found) So far, I have found a way..

Having links relative to root?

Is there a way to have all links on a page be relative to the root directory? For example, on I could have a link saying: <a href="fruits/index.html">B..

Message Queue vs. Web Services?

Under what conditions would one favor apps talking via a message queue instead of via web services (I just mean XML or JSON or YAML or whatever over HTTP here, not any particular type)? I have to tal..

Is there a need for range(len(a))?

One frequently finds expressions of this type in python questions on SO. Either for just accessing all items of the iterable for i in range(len(a)): print(a[i]) Which is just a clumbersome way ..

C# How to determine if a number is a multiple of another?

Without using string manipulation (checking for an occurrence of the . or , character) by casting the product of an int calculation to string. and without using try / catch scenarios relying on err..

How to get a specific output iterating a hash in Ruby?

I want to get a specific output iterating a Ruby Hash. This is the Hash I want to iterate over: hash = { 1 => ['a', 'b'], 2 => ['c'], 3 => ['d', 'e', 'f', 'g'], 4 => ['h'] } ..

Retrieve version from maven pom.xml in code

What is the simplest way to retrieve version number from maven's pom.xml in code, i.e., programatically?..

Spring Boot Java Config Set Session Timeout

How can I configure my (embedded) Tomcat Session Timeout in a Spring Boot Application? public class SessionListener implements HttpSessionListener{ @Override public void sessionCreated(HttpSessionEv..

Find and replace with a newline in Visual Studio Code

I am trying out the new Microsoft Visual Studio Code editor in Linux Fedora environment. I would like to know how to replace new line (\n) in place of some other text. For example, I have html text ..

How to handle change of checkbox using jQuery?

I have some code <input type="checkbox" id="chk" value="value" /> <label for="chk">Value </label> <br/> <input type="button" id="But1" value="set value" /> <br /> ..

how to hide keyboard after typing in EditText in android?

I have a EditText and button aligned to parent's bottom. When I enter text in it and press the button to save data, the virtual keyboard does not disappear. Can any one guide me how to hide the keyb..

Error in Process.Start() -- The system cannot find the file specified

I am using the following code to fire the iexplore process. This is done in a simple console app. public static void StartIExplorer() { var info = new ProcessStartInfo("iexplore"); info.UseSh..

Purpose of "%matplotlib inline"

Could someone explain to me what exactly is the use of %matplotlib inline? ..

Effects of the extern keyword on C functions

In C, I did not notice any effect of the extern keyword used before function declaration. At first, I thought that when defining extern int f(); in a single file forces you to implement it outside of ..

Use Invoke-WebRequest with a username and password for basic authentication on the GitHub API

With cURL, we can pass a username with an HTTP web request as follows: $ curl -u <your_username> The -u flag accepts a username for authentication, and then cURL ..

How to format code in Xcode?

I wonder how can I format my code to align it neatly? Does it have a feature similar to Eclipse's ctrlshiftf?..

Select objects based on value of variable in object using jq

I have the following json file: { "FOO": { "name": "Donald", "location": "Stockholm" }, "BAR": { "name": "Walt", "location": "Stockholm" }, "BAZ": ..

Declare variable in SQLite and use it

I want to declare a variable in SQLite and use it in insert operation. Like in MS SQL: declare @name as varchar(10) set name = 'name' select * from table where name = @name For example, I will nee..

Exception in thread "main" java.lang.Error: Unresolved compilation problems

I am having a problem importing classes and setting variables and I need help with a test program I am doing. So I am testing out a program that just simply outputs what your input was and puts a time..

How to extend a class in python?

In python how can you extend a class? For example if I have class Color: def __init__(self, color): self.color = color def getcolor(self): return self.color color_..

Regex AND operator

Based on this answer Regular Expressions: Is there an AND operator? I tried the following on but was unable to get it to work. What am missing? Does javascript not support it? ..

Strange PostgreSQL "value too long for type character varying(500)"

I have a Postgres schema which looks like: The problem is that whenever I save text longer than 500 characters in the description column I get the error: value too long for type character varying(..

How do you import an Eclipse project into Android Studio now?

Using "Import Project" in Android Studio for an Eclipse project used to change the project structure and generate Gradle files, but right now (I'm using AS 0.5.3) it's only generating IDEA files (.iml..

Recursive Fibonacci

I'm having a hard time understanding why #include <iostream> using namespace std; int fib(int x) { if (x == 1) { return 1; } else { return fib(x-1)+fib(x-2); } } ..

Pandas: drop a level from a multi-level column index?

If I've got a multi-level column index: >>> cols = pd.MultiIndex.from_tuples([("a", "b"), ("a", "c")]) >>> pd.DataFrame([[1,2], [3,4]], columns=cols) a ---+-- b | c --..

Initializing entire 2D array with one value

With the following declaration int array[ROW][COLUMN]={0}; I get the array with all zeroes but with the following one int array[ROW][COLUMN]={1}; I don’t get the array with all one value. The..

How do I get the current year using SQL on Oracle?

I need to add the current year as a variable in an SQL statement, how can I retrieve the current year using SQL? i.e. BETWEEN TO_DATE('01/01/**currentYear** 00:00:00', 'DD/MM/YYYY HH24:MI:SS..

How to convert a const char * to std::string

What is the correct/best/simplest way to convert a c-style string to a std::string. The conversion should accept a max_length, and terminate the string at the first \0 char, if this occur before max_..

Altering a column to be nullable

I want to alter a table column to be nullable. I have used: ALTER TABLE Merchant_Pending_Functions Modify NumberOfLocations NULL This gives an error at Modify. What is the correct syntax?..

How to enter in a Docker container already running with a new TTY

I have a container that is running the Apache service in the foreground. I would like to be able to access the container from another shell in order to "poke around" inside it and examine the files. A..

Reading specific columns from a text file in python

I have a text file which contains a table comprised of numbers e.g: 5 10 6 6 20 1 7 30 4 8 40 3 9 23 1 4 13 6 if for example I want the numbers contained only in the second column, how do i extract ..

"SSL certificate verify failed" using pip to install packages

I am trying to install the Scrapy package (among others) for python using pip. I have tried doing the installation using python 3 and python 2, I have installed/upgraded the setuptools like so: $ pip3..

How to set page content to the middle of screen?

Possible Duplicate: How to align a <div> to the middle of the page I need is to show the content of a web page in the middle of the screen, no matter what screen size it is, big or sm..

OS X cp command in Terminal - No such file or directory

this might be one of those days my brain just does not work, or i'm incredibly dumb. i've been trying to copy files (which are actually directories .app, .bundle, etc.) but consistently get an error '..

PHP $_POST not working?

I have the simplest form possible and all I want to do is echo whatever is written in text box. HTML: <form action="" method="post"> <input type="text" name="firstname"> <input ty..

How to print a string in C++

I tried this, but it didn't work. #include <string> string someString("This is a string."); printf("%s\n", someString); ..

RestSharp simple complete example

I've been trying to create a simple prototype web application that uses RestSharp to call Rest API. I've not been able to find one good example of it. Could anyone please share and direct me to right..

PHP random string generator

I'm trying to create a randomized string in PHP, and I get absolutely no output with this: <?php function RandomString() { $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEF..

How are zlib, gzip and zip related? What do they have in common and how are they different?

The compression algorithm used in zlib is essentially the same as that in gzip and zip. What are gzip and zip? How are they different and how are they same?..

Redirecting new tab on button click.(Response.Redirect) in C#

I'm trying to open a page in new tab/window on button click.I tried in the google got this code but its not working. Can anybody help me with this? <asp:Button ID="btn" runat="Server" Text="SUBMI..

Is there any way to install Composer globally on Windows?

I've read the global installation documentation for Composer, but it's for *nix systems only: curl -s | php sudo mv composer.phar /usr/local/bin/composer I would..

How to set full calendar to a specific start date when it's initialized for the 1st time?

I would like to set the initial month to an arbitrary month when I call the function to display the calendar. Say for example the user selects a date last june (June 2011) somewhere else and I want ..

How to get the day of week and the month of the year?

I don't know much about Javascript, and the other questions I found are related to operations on dates, not only getting the information as I need it. Objective I wish to get the date as below-forma..

Can't connect Nexus 4 to adb: unauthorized

I have a Nexus 4 with Android 4.3 and I am trying to connect the device to a computer with Windows 7 64bit. I installed the latest drivers and the latest adb version. I think I tried almost everythin..

How to check if a file exists in Go?

Go's standard library does not have a function solely intended to check if a file exists or not (like Python's os.path.exists). What is the idiomatic way to do it?..

How to make inline plots in Jupyter Notebook larger?

I have made my plots inline on my Ipython Notebook with "%matplotlib inline." Now, the plot appears. However, it is very small. Is there a way to make it appear larger using either notebook setting..

Java Thread Example?

Could anyone give an example program that explains Java Threads in a simple way? For example, say I have three threads t1, t2 and t3. I want a code that demonstrates that the threads execute simultane..

How to force JS to do math instead of putting two strings together

I need javascript to add 5 to an integer variable, but instead it treats the variable as a string, so it write out the variable, then add 5 onto the end of the "string". How can I force it to do math ..

deleted object would be re-saved by cascade (remove deleted object from associations)

i have the following two entities: 1- PlayList: @OneToMany(fetch = FetchType.EAGER, mappedBy = "playlist", orphanRemoval = true, cascade = CascadeType.ALL) @OrderBy("adOrder") private Set<Playl..

Cache an HTTP 'Get' service response in AngularJS?

I want to be able to create a custom AngularJS service that makes an HTTP 'Get' request when its data object is empty and populates the data object on success. The next time a call is made to this se..

RichTextBox (WPF) does not have string property "Text"

I am trying to set/get the text of my RichTextBox, but Text is not among list of its properties when I want to get test.Text... I am using code behind in C# (.net framework 3.5 SP1) RichTextBox test..

I need to round a float to two decimal places in Java

Possible Duplicate: How to round a number to n decimal places in Java I am having difficulties rounding a float to two decimal places. I have tried a few methods I have seen on here includ..

SQL Server Operating system error 5: "5(Access is denied.)"

I am starting to learn SQL and I have a book that provides a database to work on. These files below are in the directory but the problem is that when I run the query, it gives me this error: Msg 5..

Eclipse gives “Java was started but returned exit code 13”

All hell broke loose after i uninstalled my java 6 and installed java 7 (both jdk and jre). On opening eclipse it gave the error that "No JVM found at.....". So, i explicitly gave the location of java..

How do I create batch file to rename large number of files in a folder?

I'd like to rename a large number of files within a folder on a WinXP system, preferably using a batch file. The files are currently named like this: Vacation2010 001.jpg Vacation2010 002.jpg ..

How do I modify a MySQL column to allow NULL?

MySQL 5.0.45 What is the syntax to alter a table to allow a column to be null, alternately what's wrong with this: ALTER mytable MODIFY mycolumn varchar(255) null; I interpreted the manual as jus..