Questions Tagged with #Toolstripdropdown

Using (Ana)conda within PyCharm

I've got Pycharm 4 running on my Linux (Ubuntu 14.04) machine. In addition to the system python, I've also got Anaconda installed. Getting the two to play nicely together seems to be a bit of a prob..

Vim delete blank lines

What command can I run to remove blank lines in Vim?..

Eclipse add Tomcat 7 blank server name

I was trying to add Tomcat 7 in my Eclipse in Ubuntu. When I click "Add new server" in Eclipse and select "Tomcat v7.0 Server", the field "Server Name" is blank and I cannot type in anything in that t..

Why XML-Serializable class need a parameterless constructor

I'm writing code to do Xml serialization. With below function. public static string SerializeToXml(object obj) { XmlSerializer serializer = new XmlSerializer(obj.GetType()); using (StringWrit..

"SyntaxError: Unexpected token < in JSON at position 0"

In a React app component which handles Facebook-like content feeds, I am running into an error: Feed.js:94 undefined "parsererror" "SyntaxError: Unexpected token < in JSON at position 0 I ra..

Webpack.config how to just copy the index.html to the dist folder

I am trying to automate assets going into /dist. I have the following config.js: module.exports = { context: __dirname + "/lib", entry: { main: [ "./baa.ts" ] ..

How to change dot size in gnuplot

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

Scrollview can host only one direct child

I have multiple LinearLayouts with a combined height that easily exceeds a device's screen height. So in order to make my layout scrollable, I tried adding in a ScrollView, but unfortunately I get the..

What is a regular expression which will match a valid domain name without a subdomain?

I need to validate a domain name: So a domain in its rawest form - not even a subdomain like www. Characters should only be a-z | A-Z | 0-9 and period(.) and dash(-) ..

Add an incremental number in a field in INSERT INTO SELECT query in SQL Server

I have an INSERT INTO SELECT query. In the SELECT statement I have a subquery in which I want to add an incremental number in a field. This query will work fine if my SELECT query and returns only on..

Select multiple rows with the same value(s)

I have a table, sort of like this: ID | Chromosome | Locus | Symbol | Dominance | =============================================== 1 | 10 | 2 | A | Full | 2 | 10 ..

Python Pandas User Warning: Sorting because non-concatenation axis is not aligned

I'm doing some code practice and applying merging of data frames while doing this getting user warning /usr/lib64/python2.7/site-packages/pandas/core/ FutureWarning: Sorting becaus..

Uninstall / remove a Homebrew package including all its dependencies

I have a Homebrew formula that I wish to uninstall/remove along with all its dependencies, skipping packages whom other packages depend upon (a.k.a. Cascading package removal in Package manager parlan..

Symfony2 : How to get form validation errors after binding the request to the form

Here's my saveAction code (where the form passes the data to) public function saveAction() { $user = OBUser(); $form = $this->createForm(new OBUserType(), $user); if ($this->reque..

Regex to match 2 digits, optional decimal, two digits

I've spent half an hour trying to get this, maybe someone can come up with it quickly. I need a regular expression that will match one or two digits, followed by an optional decmial point, followed b..

How to Bootstrap navbar static to fixed on scroll?

I would like to make static navbar to fixed navbar on scroll, when it reaches top of the page. Is there a way to get it using bootstrap 3 css or javascript?..

How to install Visual Studio 2015 on a different drive

I'm trying to figure out how to install Visual Studio Community 2015 on another drive besides my C:\ drive. Every time I open the installer of VS it shows the save location but won't let me change it:..

Android- Error:Execution failed for task ':app:transformClassesWithDexForRelease'

The Problem is that i am able to run my app when i change to debug mode but it fails when i switch to release mode. Exception: **FAILURE: Build failed with an exception.** > Execution failed for ..

Inserting data into a temporary table

After having created a temporary table and declaring the data types like so; CREATE TABLE #TempTable( ID int, Date datetime, Name char(20)) How do I then insert the relevant data which is already hel..

GROUP BY + CASE statement

I have a working query that is grouping data by hardware model and a result, but the problem is there are many "results". I have tried to reduce that down to "if result = 0 then keep as 0, else set ..

Retrieve only the queried element in an object array in MongoDB collection

Suppose you have the following documents in my collection: { "_id":ObjectId("562e7c594c12942f08fe4192"), "shapes":[ { "shape":"square", "color":"blue" }, ..

How to draw a graph in LaTeX?

First of all, let me say I'm using LyX, though I have no problem using ERT. Secondly, what is the most simplest way to draw a simple graph like this in Latex? I've seen some documents with graphs and..

Up, Down, Left and Right arrow keys do not trigger KeyDown event

I am building an application where all the key input must be handled by the windows itself. I set tabstop to false for each control witch could grab the focus except a panel (but I don't know if it h..

variable is not declared it may be inaccessible due to its protection level

My VB skills are not the best, and this problem has had me stumped for a few days. In the list of controls shown in Visual Studio that are not defined in the code behind, I can "mouseover" them and t..

Is it possible to CONTINUE a loop from an exception?

I have a fetch being executed inside of a loop. If this fetch fails (no data) I would like to CONTINUE the loop to the next record from within the EXCEPTION. Is this possible? I'm getting a ORA-065..

Accessing localhost of PC from USB connected Android mobile device

I have an android device (Samsung galaxy tab) connected to my PC via USB . I want to use WebServices and run a web page which is located on my local xampp server of my PC on my android device . I ca..

Running a cron every 30 seconds

Ok so I have a cron that I need to run every 30 seconds. Here is what I have: */30 * * * * /bin/bash -l -c 'cd /srv/last_song/releases/20120308133159 && script/rails runner -e production '\'..

Chrome Uncaught Syntax Error: Unexpected Token ILLEGAL

Receiving the subject error when Chrome tries to load the script file on the page. It says it's at the last line of the javascript file. I can't seem to find anything wrong with it. No errors in firef..

What is the return value of os.system() in Python?

I came across this: >>> import os >>> os.system('ls') file.txt README 0 What is return value of os.system()? Why I get 0?..

Django - "no module named"

I get the following error when trying to run Django from the command line. File, line 8, in <module>      from import execute_from_command_line ImportError:..

Java how to replace 2 or more spaces with single space in string and delete leading and trailing spaces

Looking for quick, simple way in Java to change this string " hello there " to something that looks like this "hello there" where I replace all those multiple spaces with a single space, ..

How to check Grants Permissions at Run-Time?

In Android M (Preview) the user can choose a specific app and retreive specific permission. So I am asking How to check Grants Permissions at Run-Time?..

How to use a link to call JavaScript?

How to use a link to call JavaScript code?..

Graphical HTTP client for windows

I am looking for a Windows graphical utility for performing HTTP operations. For example, I want to be able to say things like: POST to With a POST body: "Data goes h..

Git: force user and password prompt

I recently updated my local Git installation to 1.8.1 from I'm noticing that, when I work on GitHub, it doesn't prompt me for username and password on push anymore. This troubles me, as..

How can I debug a Perl script?

When I run a Perl script, how can I debug it? For example, in ksh I add the -x flag. But how I do the same in Perl?..

How to use if statements in underscore.js templates?

I'm using the underscore.js templating function and have done a template like this: <script type="text/template" id="gridItem"> <div class="griditem <%= gridType %> <%= gridSiz..

How to find lines containing a string in linux

I have a file in Linux, I would like to diplay lines which contain a specific string in that file, how to do this?..

What does git rev-parse do?

What does git rev-parse do? I have read the man page but it raised more questions than answers. Things like: Pick out and massage parameters Massage? What does that mean? I'm using as a resolv..

Difference between map and collect in Ruby?

I have Googled this and got patchy / contradictory opinions - is there actually any difference between doing a map and doing a collect on an array in Ruby/Rails? The docs don't seem to suggest any, ..

How to determine if a type implements an interface with C# reflection

Does reflection in C# offer a way to determine if some given System.Type type models some interface? public interface IMyInterface {} public class MyType : IMyInterface {} // should yield 'true' ty..

YAML equivalent of array of objects in JSON

I have a JSON array of objects that I'm trying to convert to YAML. {"AAPL": [ { "shares": -75.088, "date": "11/27/2015" }, { "shares": 75.088, "date": "11/26/2015" }, ]} Is..

How do you format code on save in VS Code

I would like to automatically format TypeScript code using the build-in formatter when I save a file in Visual Studio Code. I'm aware of the following options, but none of them is good enough: Fo..

Changing case in Vim

Is there a command in Vim that changes the case of the selected text?..

Troubleshooting misplaced .git directory (nothing to commit)

I started getting this message. No matter what I edit and try to commit, it says there is nothing to commit. Looks like git does not see my working directory and looking somewhere else. If I run git..

Select N random elements from a List<T> in C#

I need a quick algorithm to select 5 random elements from a generic list. For example, I'd like to get 5 random elements from a List<string>...

How to get the anchor from the URL using jQuery?

I have a URL that is like: How can I get the a_1 anchor value using jQuery and store it as a variable?..

Retain precision with double in Java

public class doublePrecision { public static void main(String[] args) { double total = 0; total += 5.6; total += 5.8; System.out.println(total); } } The abov..

How to uncheck a checkbox in pure JavaScript?

Here is the HTML Code: <div class="text"> <input value="true" type="checkbox" checked="" name="copyNewAddrToBilling"><label> I want to change the value to false. Or just unchec..

How to convert column with string type to int form in pyspark data frame?

I have dataframe in pyspark. Some of its numerical columns contain 'nan' so when I am reading the data and checking for the schema of dataframe, those columns will have 'string' type. How I can change..

Programmatically add custom event in the iPhone Calendar

Is there any way to add iCal event to the iPhone Calendar from the custom App?..

RAW POST using cURL in PHP

How can I do a RAW POST in PHP using cURL? Raw post as in without any encoding, and my data is stored in a string. The data should be formatted like this: ... usual HTTP header ... Content-Length: 1..

How to parse a text file with C#

By text formatting I meant something more complicated. At first I began manually adding the 5000 lines from the text file I'm asking this question for,into my project. The text file has 5000 lines w..

org.hibernate.MappingException: Unknown entity: annotations.Users

Consider the hierarchy : And the following classes and xml : package annotations; import org.hibernate.SessionFactory; import org.hibernate.cfg.Configuration; import org.hib..

How to return a value from try, catch, and finally?

So when I do a code of blocks inside a try{}, and I try to return a value, it tells me no return values import org.w3c.dom.ranges.RangeException; public class Pg257E5 { public static void ma..

Phone: numeric keyboard for text input

Is there a way to force the number keyboard to come up on the phone for an <input type="text">? I just realized that <input type="number"> in HTML5 is for “floating-point numbers”, so ..

How to go to a specific element on page?

On my HTML page, I want to be able to 'go to' / 'scroll to' / 'focus on' an element on the page. Normally, I'd use an anchor tag with a href="#something", but I'm already using the hashchange event ..

Android Location Manager, Get GPS location ,if no GPS then get to Network Provider location

I am using this given below code to get locations: public Location getLocation() { try { mLocationManager = (LocationManager) context.getSystemService(LOCATION_SERVICE); ..

Android change SDK version in Eclipse? Unable to resolve target android-x

I developed an Android aplication against 2.1 SDK. Since then I have re-installed Eclipse/Android SDK; with the new install, I want to 'upgrade' the dependancy of the Android application to 2.2 SDK (b..

Cutting the videos based on start and end time using ffmpeg

I tried to cut the video using the start and end time of the video by using the following command ffmpeg -ss 00:00:03 -t 00:00:08 -i movie.mp4 -acodec copy -vcodec copy -async 1 cut.mp4 By using t..

Get table name by constraint name

Oracle constraint name is known. How do I find the name of the table for which this constraint is applied?..

How to get the path of current worksheet in VBA?

I wrote a macro as an add-in, and I need to get the path of the current worksheet on which it is being executed. How do I do this? How do I get the file path (just the directory)?..

What uses are there for "placement new"?

Has anyone here ever used C++'s "placement new"? If so, what for? It looks to me like it would only be useful on memory-mapped hardware...

How do I generate a random int number?

How do I generate a random integer in C#?..

How to change port for jenkins window service when 8080 is being used

I installed Jenkins on a windows virtual server and want to run it as window service. Since the port 8080 is being used by other service, I changed the http port to 8081 in jenkins.xml file. However..

ES6 export all values from object

Say I have a module (./my-module.js) that has an object which should be its return value: let values = { a: 1, b: 2, c: 3 } // "export values" results in SyntaxError: Unexpected token So I can imp..

Unix epoch time to Java Date object

I have a string containing the UNIX Epoch time, and I need to convert it to a Java Date object. String date = "1081157732"; DateFormat df = new SimpleDateFormat(""); // This line try { Date expiry ..

How to stop VMware port error of 443 on XAMPP Control Panel v3.2.1

When I run XAMPP Control Panel v3.2.1 I get this error: 07:37:24 [Apache] Problem detected! 07:37:24 [Apache] Port 443 in use by ""C:\Program Files (x86)\VMware\VMware Workstation\vmware-hostd.ex..

How do I send an HTML Form in an Email .. not just MAILTO

I have an HTML form for people to fill out, and I want it so when they click the submit button, it will just send the email, not bring up their email and ask them to send the message themselves. When..

make: *** No rule to make target `all'. Stop

I keep getting this error: make: *** No rule to make target `all'. Stop. Even though my make file looks like this: CC=gcc CFLAGS=-c -Wall all: build build: inputText.o outputText.o main.o ..

Range with step of type float

The documentation basically says that range must behave exactly as this implementation (for positive step): def range(start, stop, step): x = start while True: if x >= stop: return yie..

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

Call method when home button pressed

I have this method in one of my Android Activities: @Override public boolean onKeyDown(int keyCode, KeyEvent event) { if(keyCode == KeyEvent.KEYCODE_BACK) { Log.d("Test", "Back button..

css absolute position won't work with margin-left:auto margin-right: auto

Say you have the following css applied to a div tag .divtagABS { position: absolute; margin-left: auto; margin-right:auto; } the margin-left and margin-right does not take effect bu..

phpmyadmin "Not Found" after install on Apache, Ubuntu

Setting up a development environment with Ubuntu 14.04 running in VirtualBox, following this guide: After installing phpmyadmin, it seems I should be able to access it at http://l..

vertical alignment of text element in SVG

Let's say I have the SVG file: <svg width="1024" height="768" xmlns="" xmlns:xlink=""> <text x='20' y='60' style="font-size: 60px"&g..

How to save and extract session data in codeigniter

I save some data in session on my verify controller then I extract this session data into user_activity model and insert session data into activity table. My problem is only username data saved in ses..

How can I get onclick event on webview in android?

I want to know when the user clicks on webview but not on a hyperlink. On that click I want to show/hide a view of my activity that holds a webview. Any suggestion?..

How to pass arguments to Shell Script through docker run

I am new to the docker world. I have to invoke a shell script that takes command line arguments through a docker container. Ex: My shell script looks like: #!bin/bash echo $1 Dockerfile looks like ..

Bash ignoring error for a particular command

I am using following options set -o pipefail set -e In bash script to stop execution on error. I have ~100 lines of script executing and I don't want to check return code of every line in the scrip..

Key existence check in HashMap

Is checking for key existence in HashMap always necessary? I have a HashMap with say a 1000 entries and I am looking at improving the efficiency. If the HashMap is being accessed very frequently, the..

SQL Server Profiler - How to filter trace to only display events from one database?

How do I limit a SQL Server Profiler trace to a specific database? I can't see how to filter the trace to not see events for all databases on the instance I connect to...

What does OpenCV's cvWaitKey( ) function do?

What happens during the execution of cvWaitKey()? What are some typical use cases? I saw it in OpenCV reference but the documentation isn't clear on its exact purpose...

Sending multipart/formdata with jQuery.ajax

I've got a problem sending a file to a serverside PHP-script using jQuery's ajax-function. It's possible to get the File-List with $('#fileinput').attr('files') but how is it possible to send this Dat..

Command to remove all npm modules globally?

Is there a command to remove all global npm modules? If not, what do you suggest?..

Jenkins/Hudson - accessing the current build number?

I have a report file I'm generating, and I would like to be able to add the current build number to that file within a Jenkins job. Is there an environment variable or plugin I can use to get at the c..

overlay a smaller image on a larger image python OpenCv

Hi I am creating a program that replaces a face in a image with someone else's face. However, I am stuck on trying to insert the new face into the original, larger image. I have researched ROI and add..

Issue when importing dataset: `Error in scan(...): line 1 did not have 145 elements`

I'm trying to import my dataset in R using read.table(): Dataset.df <- read.table("C:\\dataset.txt", header=TRUE) But I get the following error message: Error in scan(file, what, nmax, sep, dec..

How to modify JsonNode in Java?

I need to change a JSON attribute's value in Java, I can get the value properly but I couldn't modify the JSON. here is the code below JsonNode blablas = mapper.readTree(parser).get("blablas"); ..

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

How to check if an int is a null

I have an object called Person. it has several attributes in it; int id; String name; i set a person object like Person p = new Person(1,"Joe");. 1.) I need to check if the object is not null; Is..

How can I see normal print output created during pytest run?

Sometimes I want to just insert some print statements in my code, and see what gets printed out when I exercise it. My usual way to "exercise" it is with existing pytest tests. But when I run these, I..

How to access the SMS storage on Android?

Beginner Android dev here. I'm trying to create an app that will read the SMS messages stored on the device and then give the user statistics about their habits (like who they message often, common w..

`ui-router` $stateParams vs. $state.params

With ui-router, it's possible to inject either $state or $stateParams into a controller to get access to parameters in the URL. However, accessing parameters through $stateParams only exposes paramete..

How to See the Contents of Windows library (*.lib)

I have a binary file - Windows static library (*.lib). Is there a simple way to find out names of the functions and their interface from that library ? Something similar to emfar and elfdump utilitie..

Android - java.lang.SecurityException: Permission Denial: starting Intent

I have a library (jar) on build path of my project. The project accesses the MainActivity in the jar, using the following intent: final Intent it = new Intent(); it.setClassName("com.example.lib", "c..

How to set cookie in node js using express framework?

In my application, I need to set a cookie using the express framework.I have tried the following code but it's not setting the cookie. Can anyone help me to do this? var express = require('express')..

Running shell command and capturing the output

I want to write a function that will execute a shell command and return its output as a string, no matter, is it an error or success message. I just want to get the same result that I would have gotte..

How to enable local network users to access my WAMP sites?

First of all, I read at least 20 articles about this topic, and not one of them can match up the scenario and I screwed up the process numerous times. So I turn help by offering my specific scenario i..

What is the purpose of the vshost.exe file?

When I create and compile a "Hello, World!" application in C#, I get three files in the Debug folder apart from the main exe (e.g. HelloWorld.exe) HelloWorld.vshost.exe HelloWorld.pdb HelloWorld.vsh..

How to close a web page on a button click, a hyperlink or a link button click?

How can we provide a hyperlink or button to close a web page ?..

check if array is empty (vba excel)

These if ... then statements are getting the wrong results in my opinion. The first is returning the value 'false' when it should be 'true'. The fourth returns the right value. The second and third re..

Pandas: Setting no. of max rows

I have a problem viewing the following DataFrame: n = 100 foo = DataFrame(index=range(n)) foo['floats'] = np.random.randn(n) foo The problem is that it does not print all rows per default in ipyth..

How do I view executed queries within SQL Server Management Studio?

I am new to SQL Server Management Studio and am wondering: is there is a way to see which queries have been run against a database? In the Activity monitor, there is a "Recent Expensive Queries" rep..

Cannot delete directory with Directory.Delete(path, true)

I'm using .NET 3.5, trying to recursively delete a directory using: Directory.Delete(myPath, true); My understanding is that this should throw if files are in use or there is a permissions problem,..

Print PDF directly from JavaScript

I am building a list of PDFs in HTML. In the list I'd like to include a download link and a print button/link. Is there some way to directly open the Print dialog for the PDF without the user seeing t..

Remove header and footer from window.print()

I am using window.print() for printing page, but I got header and footer contains page title, file path, page number and date. How to remove them? I tried print stylesheet also. #header, #nav, .nop..

Implicit function declarations in C

What is meant by the term "implicit declaration of a function"? A call to a standard library function without including the appropriate header file produces a warning as in the case of: int main(){ ..

Transition of background-color

I'm trying to make a transition effect with background-color when hovering menu items, but it does not work. Here is my CSS code: #content #nav a:hover { color: black; background-color: #AD31..

Take a list of numbers and return the average

Doing GCSE computing and as a homework task I need to do the below. I'm only starting out with programming and I've been trying to figure out how to do it but to no avail. I believe I need to use a fu..

MySQL Update Column +1?

I was wondering what would be the easiest way to update a column by +1? I will be updating a post count of a category based on when users submits a new post. Thanks...

Why does my JavaScript code receive a "No 'Access-Control-Allow-Origin' header is present on the requested resource" error, while Postman does not?

Mod note: This question is about why Postman is not subject to CORS restrictions in the same way an XMLHttpRequest is. This question is not about how to fix a "No 'Access-Control-Allow-Origin'..." ..

What's the difference between a single precision and double precision floating point operation?

What is the difference between a single precision floating point operation and double precision floating operation? I'm especially interested in practical terms in relation to video game consoles. Fo..

How to Get the Current URL Inside @if Statement (Blade) in Laravel 4?

I am using Laravel 4. I would like to access the current URL inside an @if condition in a view using the Laravel's Blade templating engine but I don't know how to do it. I know that it can be done us..

Maven: repository element was not specified in the POM inside distributionManagement?

I am trying to run the command, mvn release:perform, but I get this error: Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.5:deploy (default-deploy) on project git-demo: Deploy..

How to center a "position: absolute" element

I'm having a problem centering an element that has the attribute position set to absolute. Does anyone know why the images are not centered? _x000D_ _x000D_ body { text-align: center; } #slideshowW..

SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed

I am using Authlogic-Connect for third party logins. After running appropriate migrations, Twitter/Google/yahoo logins seem to work fine but the facebook login throws exception: SSL_connect returned=..

How do I read the contents of a Node.js stream into a string variable?

I'm hacking on a Node program that uses smtp-protocol to capture SMTP emails and act on the mail data. The library provides the mail data as a stream, and I don't know how to get that into a string. ..

Getting IP address of client

I am developing a web application using JSP, Servlets (Container: Glassfish) in which I need to get clients IP Address. I am getting the clients IP address, because I want to give access to some page..

Should black box or white box testing be the emphasis for testers?

Which type of testing would you say should be the emphasis (for testers/QAs), and why? A quick set of definitions from wikipedia: Black box testing takes an external perspective of the test objec..

Tensorflow: Using Adam optimizer

I am experimenting with some simple models in tensorflow, including one that looks very similar to the first MNIST for ML Beginners example, but with a somewhat larger dimensionality. I am able to use..

HRESULT: 0x800A03EC on Worksheet.range

I am getting HRESULT: 0x800A03EC on Worksheet.range method. Number of rows are more than 70K. Office 2007. Code: Microsoft.Office.Interop.Excel.Range neededRange = currentWS.Range[cell.Cells[1, ..

List all kafka topics

I'm using kafka 0.10 without zookeeper. I want to get kafka topics list. This command is not working since we're not using zookeeper: bin/ --list --zookeeper localhost:2181. How can I ..

Can't use System.Windows.Forms

I have tried making (my first) a C# program: using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ConsoleApplication1 { class Program { sta..

Clear text input on click with AngularJS

How can I clear a text input on click of a button using angularJS? The X is a seperate link, on which I would like to trigger a function. HTML <input type="text" class="form-control" data-ng-m..

Jquery to get SelectedText from dropdown

I am trying to get the selected Text from the dropdownlist using Jquery. <div> @Html.DropDownList("SelectedCountryId", Model.CountryList, "(Select one Country)") </div> Given below ..

A potentially dangerous Request.Path value was detected from the client (*)

I am receiving the rather self explanatory error: A potentially dangerous Request.Path value was detected from the client (*). The issue is due to * in the request URL:

undefined reference to 'std::cout'

Shall this be the example: #include <iostream> using namespace std; int main() { cout << "Hola, moondo.\n"; } It throws the error: gcc -c main.cpp gcc -o edit main.o main.o: In fu..

How to input automatically when running a shell over SSH?

In my shell script I am running a command which is asking me for input. How can I give the command the input it needs automatically? For example: $cat ssh-copy-id [email protected] When run..

PDO support for multiple queries (PDO_MYSQL, PDO_MYSQLND)

I do know that PDO does not support multiple queries getting executed in one statement. I've been Googleing and found few posts talking about PDO_MYSQL and PDO_MYSQLND. PDO_MySQL is a more dangero..

How I can check if an object is null in ruby on rails 2?

I want to check when my object @objectname is not equal to null to show the values of the @objectname else to show that no values found. I tried this: <% if (@objectname != null) then %> bu..

What is an abstract class in PHP?

What is an abstract class in PHP? How can it be used?..

Cannot simply use PostgreSQL table name ("relation does not exist")

I'm trying to run the following PHP script to do a simple database query: $db_host = "localhost"; $db_name = "showfinder"; $username = "user"; $password = "password"; $dbconn = pg_connect("host=$db_h..

How to read value of a registry key c#

At start up of my application I am trying to see if the user has a specific version of a software installed, specifically the MySQL connector, all using c#. In the registry, the MySQL contains a versi..

How do I center text vertically and horizontally in Flutter?

I'd like to know how to center the contents of a Text widget vertically and horizontally in Flutter. I only know how to center the widget itself using Center(child: Text("test")) but not the..

php - get numeric index of associative array

I have an associative array and I need to find the numeric position of a key. I could loop through the array manually to find it, but is there a better way build into PHP? $a = array( 'blue' =>..

How can I parse a String to BigDecimal?

I have this String: 10,692,467,440,017.120 (it's an amount). I want to parse it to a BigDecimal. The problem is that I have tried both DecimalFormat and NumbeFormat in vain...

Zooming MKMapView to fit annotation pins?

I am using MKMapView and have added a number of annotation pins to the map about a 5-10 kilometre area. When I run the application my map starts zoomed out to show the whole world, what is the best wa..

Defining a variable with or without export

What is export for? What is the difference between: export name=value and name=value ..

Overriding a JavaScript function while referencing the original

I have a function, a(), that I want to override, but also have the original a() be performed in an order depending on the context. For example, sometimes when I'm generating a page I'll want to overri..

Laravel 5.2 - pluck() method returns array

I'm trying to upgrade my project L5.1 -> L5.2. In upgrade guide there's one thing which isn't clear for me: The lists method on the Collection, query builder and Eloquent query builder objects h..

Can I change the name of `nohup.out`?

When I run nohup some_command &, the output goes to nohup.out; man nohup says to look at info nohup which in turn says: If standard output is a terminal, the command's standard output is app..

Append column to pandas dataframe

This is probably easy, but I have the following data: In data frame 1: index dat1 0 9 1 5 In data frame 2: index dat2 0 7 1 6 I want a data frame with the following form: index..

DataTables: Cannot read property style of undefined

I am getting this error with the following: jquery.dataTables.js:4089 Uncaught TypeError: Cannot read property 'style' of undefined(…) _fnCalculateColumnWidths @ jquery.dataTables.js:4089 _fnInitia..

Using VBA to get extended file attributes

Trying to use Excel VBA to capture all the file attributes from files on disk, including extended attributes. Was able to get it to loop through the files and capture the basic attributes (that come f..

I want to vertical-align text in select box

I want to vertically align the text in select box. I tried using select{ verticle-align:middle; } however it does not work in any browsers. Chrome seems to align the text in select box to the c..

Why does my 'git branch' have no master?

I'm a git newbie and I keep reading about a "master" branch. Is "master" just a conventional name that people used or does it have special meaning like HEAD? When I do git branch on the clone that I ..

How can I set the opacity or transparency of a Panel in WinForms?

I was wondering how to change or modify the transparency of a Panel in C#, not the whole form, but the panel only.. I've seen many C# tutorials on Opacity, but its for the Form. im looking for how it ..

How to group time by hour or by 10 minutes

like when I do SELECT [Date] FROM [FRIIB].[dbo].[ArchiveAnalog] GROUP BY [Date] how can I specify the group period ? MS SQL 2008 2nd Edit I'm trying SELECT MIN([Date]) AS RecT, AVG(Value)..

.htaccess deny from all

I have copied one of my old applications and renamed it to New_application. I want to access .htaccess file that is inside the New_application folder. When I opened it with my text editor, it just sho..

IOError: [Errno 2] No such file or directory trying to open a file

I am very new to Python so please forgive the following basic code and problem, but I have been trying to figure out what is causing the error I am getting (I have even looked at similar threads on S...

trim left characters in sql server?

I want to write a sql statement to trim a string 'Hello' from the string "Hello World'. Please suggest...

Calling a JavaScript function returned from an Ajax response

I have a system where I send an Ajax command, which returns a script block with a function in it. After this data is correctly inserted in the DIV, I want to be able to call this function to perform t..

Hibernate Auto Increment ID

I have a j2ee application using hibernate with annotation. How do I annotate the Id field in my pojo class to set it as auto increment or auto generated. and in adding the bean do I leave that field i..

Postgres and Indexes on Foreign Keys and Primary Keys

Does Postgres automatically put indexes on Foreign Keys and Primary Keys? How can I tell? Is there a command that will return all indexes on a table?..

What does the Visual Studio "Any CPU" target mean?

I have some confusion related to the .NET platform build options in Visual Studio 2008. What is the "Any CPU" compilation target, and what sort of files does it generate? I examined the output execut..

"The POM for ... is missing, no dependency information available" even though it exists in Maven Repository

Problem: A dependency will not download even though I copied it from the Maven Repository. When I hover over the dependency in Eclipse, it warns: "Maven Missing artifact org.raml:jaxrs-code-generato..

How to get text with Selenium WebDriver in Python

I'm trying to get text using Selenium WebDriver and here is my code. Please note that I don't want to use XPath, because in my case the ID gets changed on every relaunch of the web page. My code: text..

How to use moment.js library in angular 2 typescript app?

I tried to use it with typescript bindings: npm install moment --save typings install moment --ambient -- save test.ts: import {moment} from 'moment/moment'; And without: npm install moment --s..

Android: java.lang.SecurityException: Permission Denial: start Intent

I have created an application containing GWVectraNotifier activity which is called from other applications to display Notification. In the Notification dialog, there will be 'show' button and 'close'..

IE throws JavaScript Error: The value of the property 'googleMapsQuery' is null or undefined, not a Function object (works in other browsers)

I'm having a real problem with JavaScript scope in IE 9. This is inside the body of my document (yes, I realize script should go in the head for proper HTML, but I've never had it break a script befo..

Get month name from number

How can I get the month name from the month number? For instance, if I have 3, I want to return march date.tm_month() How to get the string march?..

How do I use a custom deleter with a std::unique_ptr member?

I have a class with a unique_ptr member. class Foo { private: std::unique_ptr<Bar> bar; ... }; The Bar is a third party class that has a create() function and a destroy() function. I..

How can I get name of element with jQuery?

How can I get name property of HTML element with jQuery?..

Why is there no Constant feature in Java?

I was trying to identify the reason behind constants in Java I have learned that Java allows us to declare constants by using final keyword. My question is why didn't Java introduce a Constant (const..

What are sessions? How do they work?

I am just beginning to start learning web application development, using python. I am coming across the terms 'cookies' and 'sessions'. I understand cookies in that they store some info in a key value..

HTML input type=file, get the image before submitting the form

I'm building a basic social network and in the registration the user uploads a display image. Basically I wanted to display the image, like a preview on the same page as the form, just after they sele..

Responsive timeline UI with Bootstrap3

How can I create a UI with a vertical timeline bar where on desktop it shows as timeline-bar in middle and event boxes on both sides. On smaller mobile screen, the timeline-bar on the left and all eve..

The Role Manager feature has not been enabled

Got the following ProviderException : The Role Manager feature has not been enabled. So far so good. Is there somewhere a method that can be called to check if the Role Manager has been enabl..

What are allowed characters in cookies?

What are the allowed characters in both cookie name and value? Are they same as URL or some common subset? Reason I'm asking is that I've recently hit some strange behavior with cookies that have - i..

ASP.NET Core 1.0 on IIS error 502.5

I just updated my server (Windows 2012R2) to .Net Core 1.0 RTM Windows Hosting pack from the previous .Net Core 1.0 RC2. My app works on my PC without any issues but the server keeps showing: HTTP Er..

How to check which PHP extensions have been enabled/disabled in Ubuntu Linux 12.04 LTS?

I'm using Ubuntu Linux 12.04 LTS on my local machine. I've installed LAMP long ago on my machine. Now I want to enable following PHP extensions: php_zip php_xml php_gd2 For it first I want to chec..

Fixed GridView Header with horizontal and vertical scrolling in

I want to fix(Freeze) gridview header while vertical scrolling. I also want to fix first column while horizontal scrolling. I want this in both chrome and IE...

Why is it common to put CSRF prevention tokens in cookies?

I'm trying to understand the whole issue with CSRF and appropriate ways to prevent it. (Resources I've read, understand, and agree with: OWASP CSRF Prevention CHeat Sheet, Questions about CSRF.) As I..

Gradle - Could not find or load main class

I'm trying to run a very simple project using Gradle and running into the following error when using the gradlew run command: could not find or load main class 'hello.HelloWorld' Here is my file st..

If statement in aspx page

I want to write a basic if statement on my site to display either item 1 or item 2 depending on if a variable is set to true. I'm not too familiar with .NET and need a little help with the basic stru..

Calling a Javascript Function from Console

In Chrome's JavaScript console, how do I call a function that belongs to a .js file included in the webpage I am viewing?..

Difference between [routerLink] and routerLink

What is the difference between [routerLink] and routerLink ? How should you use each one?..

How do I convert a double into a string in C++?

I need to store a double as a string. I know I can use printf if I wanted to display it, but I just want to store it in a string variable so that I can store it in a map later (as the value, not the..

Some dates recognized as dates, some dates not recognized. Why?

Here is a list of dates: 04-22-11 12-19-11 11-04-11 12-08-11 09-27-11 09-27-11 04-01-11 When you copy this list in Excel, some of them are recognized as dates, others not, in the following manner: ..

XML Carriage return encoding

I was looking to represent a carriage return within an xml node. I have tried a whitespace preserve, hex entity with no luck- and a \n. viewing via a browser. Example <Quote> Alas, poor..

Angular2 router (@angular/router), how to set default route?

How can I set a default route in my @Routes route metadata collection? If you use the angular2 router from @angular/router-deprecated you define the routes in @routeConfig object, which is a collecti..

How to raise a ValueError?

I have this code which finds the largest index of a specific character in a string, however I would like it to raise a ValueError when the specified character does not occur in a string. So something..

JavaFX and OpenJDK

I'm trying to decide whether I could switch to JavaFX for the user interface of my Java application. Most of my users would be using the Oracle JRE, which has JavaFX integrated these days. However, so..

Locate the nginx.conf file my nginx is actually using

Working on a client's server where there are two different versions of nginx installed. I think one of them was installed with the brew package manager (its an osx box) and the other seems to have bee..

How to develop or migrate apps for iPhone 5 screen resolution?

The new iPhone 5 display has a new aspect ratio and a new resolution (640 x 1136 pixels). What is required to develop new or transition already existing applications to the new screen size? What sho..

How to restart kubernetes nodes?

The status of nodes is reported as unknown "conditions": [ { "type": "Ready", "status": "Unknown", "lastHeartbeatTime": "2015-11-12T06:03:19Z", ..

How can I run specific migration in laravel

I create on address table migration but one migration is already in the database it gives following error : Base table or view already exists: 1050 Table 'notification' already exists So, Can I ..

How do you create a UIImage View Programmatically - Swift

I'm trying to create a UIImage View programmatically, I have a new view and I tried doing this let imageName = "yourImage.png" yourview.backgroundColor = UIColor.colorWithPatternImage(UIImage(named:i..

Basic Apache commands for a local Windows machine

I have installed XAMPP on my Windows 7 machine and created a number of virtual servers. This part is straightforward enough. Each time I add a new virtual server I am having to reboot my computer in ..

Android Studio Run/Debug configuration error: Module not specified

I am getting a 'Module not specified' error in my run config. I have no module showing in the drop down yet I can see my module no probs. The issue came about when I refactored my module name, changed..

Android Studio cannot resolve R in imported project?

I'm trying the new Android Studio. I've exported a project from eclipse, using the build gradle option. I've then imported it in Android Studio. The file under gen has a j in a little red circl..

How to prevent column break within an element?

Consider the following HTML: <div class='x'> <ul> <li>Number one</li> <li>Number two</li> <li>Number three</li> <..

How to insert values in two dimensional array programmatically?

I want to do this dynamically in java. I know how to insert values in single dimensional array. I am bit confused in two dimensional array. static final String shades[][] = { // Shades of grey ..

Node/Express file upload

I'm using node v0.10.26 and express v4.2.0 and I'm pretty new to node. I've been beating my head against my desk for the past three or so hours trying to get a file upload form working with node. At..

CSS Child vs Descendant selectors

I am a bit confused between these 2 selectors. Does the descendent selector: div p select all p within a div whether or not it's an immediate descedent? So if the p is inside another div it will ..


What am I missing? This query is returning duplicate data over and over again. The count is correct for a complete total, but I am expecting one row, and yet I am getting the value repeated about 40..

Bootstrap 3 Flush footer to bottom. not fixed

I am using Bootstrap 3 for a site I am designing. I want to have a footer like this sample. Sample Please note that I don't want it FIXED so bootstrap navbar-fixed-bottom does not solve my problem. ..

How to track down access violation "at address 00000000"

I know how to create a .map file to track down access violation errors when the error message includes an actual address. But what if the error message says Access violation at address 00000000. Rea..

How can I verify if one list is a subset of another?

I need to verify if a list is a subset of another - a boolean return is all I seek. Is testing equality on the smaller list after an intersection the fastest way to do this? Performance is of utmost..