Questions Tagged with #Shellexecuteex

A Windows shell function used to perform action(s) on a file system object. Differs from the basic shell execute/run and ShellExecute functions in that it utilizes the SHELLEXECUTEINFO structure.

How to run python script with elevated privilege on windows

I am writing a pyqt application which require to execute admin task. I would prefer to start my script with elevate privilege. I am aware that this question is asked many times in SO or in other forum..

jQuery UI accordion that keeps multiple sections open?

I may be an idiot, but how do you keep multiple sections in jQuery UI's accordion open? The demos all have only one open at a time... I'm looking for a collapseable menu type system...

Adding a parameter to the URL with JavaScript

In a web application that makes use of AJAX calls, I need to submit a request but add a parameter to the end of the URL, for example: Original URL: http://server/myapp.php?id=10 Resulting URL:..

How to convert string to datetime format in pandas python?

I have a column I_DATE of type string(object) in a dataframe called train as show below. I_DATE 28-03-2012 2:15:00 PM 28-03-2012 2:17:28 PM 28-03-2012 2:50:50 PM How to convert I_DATE from stri..

Fixed positioning in Mobile Safari

Is it possible to position an element fixed relative to the viewport in Mobile Safari? As many have noted, position: fixed doesn't work, but Gmail just came out with a solution that almost is what I w..

Deleting all records in a database table

How do I delete all records in one of my database tables in a Ruby on Rails app?..

How to tell whether a point is to the right or left side of a line

I have a set of points. I want to separate them into 2 distinct sets. To do this, I choose two points (a and b) and draw an imaginary line between them. Now I want to have all points that are left fro..

Change background position with jQuery

I'd like to change the background position of a CSS-class while hovering a li-element. HTML: <div id="carousel"> <ul id="submenu"> <li>Apple</li> <li&..

Error C1083: Cannot open include file: 'stdafx.h'

When I compiled this program (from C++ Programming Language 4th edition): main.cpp #include <stdafx.h> #include <iostream> #include <cmath> #include "vector.h" using namespace std;..

ssh: Could not resolve hostname [hostname]: nodename nor servname provided, or not known

I am trying to set up a VPN with a Raspberry Pi, and the first step is gaining the ability to ssh into the device from outside my local network. For whatever reason, this is proving to be impossible a..

How do I run msbuild from the command line using Windows SDK 7.1?

I'm setting up .NET 4.0 support on our CI server. I've installed .NET 4.0, and the .NET tools from the Windows 7.1 SDK. On .NET 2.0 and 3.5, that just worked. With .NET 4, when I run the "Windows SDK..

"Port 4200 is already in use" when running the ng serve command

I am learning angular 2 and for the first time I am using the angular CLI project to create a sandbox project. I was able to run the command "ng serve" and it works great. I wanted to stop it from r..

How do you change video src using jQuery?

How do you change the src of a HTML5 video tag using jQuery? I got this HTML: <div id="divVideo"> <video controls> <source src="test1.mp4" type="video/mp4" /> </video>..

Are table names in MySQL case sensitive?

Are table names in MySQL case sensitive? On my Windows development machine the code I have is able to query my tables which appear to be all lowercase. When I deploy to the test server in our datacen..

How to restart service using command prompt?

I want to restart Windows service using command prompt in [Icons] section using Inno Setup. Please help me to solve the problem...

What is the suggested way to install brew, node.js, io.js, nvm, npm on OS X?

I am trying to use homebrew as much as possible. What's the suggested way to install the following on OS X? node.js io.js nvm npm and hopefully supports development for: ionic ngCordova ..

Why is JavaFX is not included in OpenJDK 8 on Ubuntu Wily (15.10)?

I've downloaded OpenJDK 8 today via sudo apt-get install openjdk-8-jdk and it seems like JavaFX is not included in it. > java -version openjdk version "1.8.0_66-internal" OpenJDK Runtime Environme..

The specified child already has a parent. You must call removeView() on the child's parent first (Android)

I have to switch between two layouts frequently. The error is happening in the layout posted below. When my layout is called the first time, there doesn't occur any error and everything's fine. When ..

Keep placeholder text in UITextField on input in IOS

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

Center fixed div with dynamic width (CSS)

I have a div that will have this CSS: #some_kind_of_popup { position: fixed; top: 100px; min-height: 300px; width: 90%; max-width: 900px; } Now, how can i make this div centered..

List of remotes for a Git repository?

I have a Git repository. This repository has multiple remote repositories (I think). How can I get a list of the remote repositories that belong to said repository? Like git list --remotes or somethi..

use jQuery's find() on JSON object

Similar to brnwdrng's question, I'm looking for a way to search through a JSON-like object. supposing my object's structure is like so: TestObj = { "Categories": [{ "Products": [{ ..

Docker error: invalid reference format: repository name must be lowercase

Ran into this Docker error with one of my projects: invalid reference format: repository name must be lowercase What are the various causes for this generic message? I already figured it out after ..

In DB2 Display a table's definition

Hello everybody I am learning DB2 and would like to know how to see a table's characteristics after I create one. Similar to the EXPLAIN TABLE command in MySQL. Thank you...

C# generic list <T> how to get the type of T?

I'm working on a reflection project, and now I'm stuck. If I have an object of myclass that can hold a List<SomeClass>, does anyone know how to get the type as in the code below if the property..

Case insensitive regular expression without re.compile?

In Python, I can compile a regular expression to be case-insensitive using re.compile: >>> s = 'TeSt' >>> casesensitive = re.compile('test') >>> ignorecase = re.compile('te..

Is the ternary operator faster than an "if" condition in Java

I am prone to "if-conditional syndrome" which means I tend to use if conditions all the time. I rarely ever use the ternary operator. For instance: //I like to do this: int a; if (i == 0) { a = ..

What is a difference between unsigned int and signed int in C?

Consider these definitions: int x=5; int y=-5; unsigned int z=5; How are they stored in memory? Can anybody explain the bit representation of these in memory? Can int x=5 and int y=-5 have same bi..

getResources().getColor() is deprecated

Using: buildToolsVersion "22.0.1" , targetSdkVersion 22 in my gradle file. I found that the useful getResources().getColor(R.color.color_name) is deprecated. What should I use instead?..

Removing u in list

I have read up on remove the character 'u' in a list but I am using google app engine and it does not seem to work! def get(self): players = db.GqlQuery("SELECT * FROM Player") print players ..

PHP + JQuery - How to use these two together? Please see my example

I have a php based website. As in, all of the pages html is output via php. Here is a simple example: <?php ob_start(); $pageStart = ' <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitiona..

Powershell Execute remote exe with command line arguments on remote computer

I've searched all over and tried different variations of commands, but I am still not there yet. My goal is to run an exe that already resides on a remote machine and pass in command line arguments. ..

Sql server - log is full due to ACTIVE_TRANSACTION

I have a very large database (50+ GB). In order to free space in my hard drive, I tried deleting old records from one of the tables . I ran the command: delete from Table1 where TheDate<'2004-01-0..

Encoding conversion in java

Is there any free java library which I can use to convert string in one encoding to other encoding, something like iconv? I'm using Java version 1.3...

How using try catch for exception handling is best practice

while maintaining my colleague's code from even someone who claims to be a senior developer, I often see the following code: try { //do something } catch { //Do nothing } or sometimes they write ..

How to create a zip file in Java

I have a dynamic text file that picks content from a database according to the user's query. I have to write this content into a text file and zip it in a folder in a servlet. How should I do this?..

Default fetch type for one-to-one, many-to-one and one-to-many in Hibernate

What is the default fetch type in hibernate mappings? What I got to know after exploring is: for one-to-one it is eager. for one-to-many it is lazy. But after testing it in Eclipse, it was eager ..

get basic SQL Server table structure information

I can get the number of columns in an SQL Server database with this: SELECT COUNT(*) FROM INFORMATION_SCHEMA.COLUMNS WHERE table_name = 'Address' But is there any way (for an unknown number of colu..

jQuery UI Dialog - missing close icon

I'm using a custom jQuery 1.10.3 theme. I downloaded every straight from the theme roller and I have intentionally not changed anything. I created a dialog box and I get an empty gray square where the..

Initializing multiple variables to the same value in Java

I'm looking for a clean and efficient method of declaring multiple variables of the same type and of the same value. Right now I have: String one = "", two = "", three = "" etc... But I'm looking f..

Git: Find the most recent common ancestor of two branches

How to find the most recent common ancestor of two Git branches?..

Retrieve all values from HashMap keys in an ArrayList Java

Good day, this is kind of confusing me now(brain freeze!) and seem to be missing something. Have an ArrayList which i populate with a HashMap. now i put in my HashMap and arraylist. Map.put(DATE, va..

what's the default value of char?

char c = '\u0000'; When I print c, it shows 'a' in the command line window. So what's the default value of a char type field? Someone said '\u0000' means null in unicode; is that right?..

With CSS, how do I make an image span the full width of the page as a background image?

Say, like in this example here: When I do it, I end up getting white borders around the image no matter what I do. What am I doing w..

How to send a model in jQuery $.ajax() post request to MVC controller method

In doing an auto-refresh using the following code, I assumed that when I do a post, the model will automatically sent to the controller: $.ajax({ url: '<%=Url.Action("ModelPage")%>', ty..

How do I wait for an asynchronously dispatched block to finish?

I am testing some code that does asynchronous processing using Grand Central Dispatch. The testing code looks like this: [object runSomeLongOperationAndDo:^{ STAssert… }]; The tests have to w..

SQL Inner-join with 3 tables?

I'm trying to join 3 tables in a view; here is the situation: I have a table that contains information of students who are applying to live on this College Campus. I have another table that lists the..

How to stop BackgroundWorker correctly

I have a form with 2 comboboxes on it. And I want to fill combobox2.DataSource based on combobox1.Text and combobox2.Text (I assume that the user has completed input in combobox1 and is in the middle..

java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver

I wrote a Java Servlet program but when I run it, it was showing the Exception java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver My code is package skypark; import*; imp..

Eclipse: Set maximum line length for auto formatting?

I am working with Java. If I hit Ctrl+Shift+F in Eclipse Helios, it will auto format my code. At a certain point, it wraps lines. I would like to increase the maximum line length. How can I do this?..

Redirecting to another page in ASP.NET MVC using JavaScript/jQuery

I want to redirect from one page to another page in ASP.NET MVC 3.0 using JavaScript/jQuery/Ajax. On button click event I have written JavaScript code like below. function foo(id) { $.post('/Bran..

How to get list of all installed packages along with version in composer?

I have been working on a project using Symfony 2.1 on my local machine. I have uploaded it to my server but when I try and install the vendor bundles using Composer, I'm getting a lot of dependency e..

How to set response header in JAX-RS so that user sees download popup for Excel?

I wrote code that generate Excel file using REST JAX-RS and I confirmed that the generated Excel file is in GlassFish server directory. But my goal is when user click on the button (which generate Ex..

logger configuration to log to file and print to stdout

I'm using Python's logging module to log some debug strings to a file which works pretty well. Now in addition, I'd like to use this module to also print the strings out to stdout. How do I do this? I..

How to condense if/else into one line in Python?

Possible Duplicate: Python Ternary Operator Putting a simple if-then statement on one line Is there a way to compress an if/else statement to one line in Python? I oftentimes see all sort..

How to copy static files to build directory with Webpack?

I'm trying to move from Gulp to Webpack. In Gulp I have task which copies all files and folders from /static/ folder to /build/ folder. How to do the same with Webpack? Do I need some plugin?..

ADB Driver and Windows 8.1

I waste a lot of time trying to successfully install the ADB driver for my tablet in Windows 8.1. So here I will post what I did, in case anyone has the same problem...

Scanner vs. BufferedReader

As far I know, the two most common methods of reading character-based data from a file in Java is using Scanner or BufferedReader. I also know that the BufferedReader reads files efficiently by using ..

Disable/turn off inherited CSS3 transitions

So I have the following CSS transitions attached to an element: a { -webkit-transition:color 0.1s ease-in, background-color 0.1s ease-in ; -moz-transition:color 0.1s ease-in, background-color 0..

Delete file from internal storage

I'm trying to delete images stored in internal storage. I've come up with this so far: File dir = getFilesDir(); File file = new File(dir, id+".jpg"); boolean deleted = file.delete(); And this is f..

What is the difference between a static and a non-static initialization code block

My question is about one particular usage of static keyword. It is possible to use static keyword to cover a code block within a class which does not belong to any function. For example following code..

sudo in php exec()

I don't know what the deal is here… So I want to run an applescript: sudo osascript myscript.scpt This works fine in the terminal, but not when I execute it via PHP's exec(); nothing happens. The ..

Setting Java heap space under Maven 2 on Windows

I get this message during build of my project java.lang.OutOfMemoryError: Java heap space How do I increase heap space, I've got 8Gb or RAM its impossible that maven consumed that much, I fou..

Python Remove last char from string and return it

While I know that there is the possibility: >>> a = "abc" >>> result = a[-1] >>> a = a[:-1] Now I also know that strings are immutable and therefore something like this: ..

How to pass variables from one php page to another without form?

I want to know how to pass a variable from one page to another in PHP without any form. What I want to achieve is this: The user clicks on a link A variable is passed which contains a string. The v..

Create boolean column in MySQL with false as default value?

I want to create a table in MySQL with a boolean column whose default value is false. But it's accepting NULL as default.....

ERROR Android emulator gets killed

After updating to Android Studio 2 when I try to run my application and choose an emulator, I wait for the emulator to start and it suddenly gets killed. I can see emulator process for some minutes bu..

Unique constraint violation during insert: why? (Oracle)

I'm trying to create a new row in a table. There are two constraints on the table -- one is on the key field (DB_ID), the other constrains a value to be one of several the the field ENV. When I do a..

How to place a JButton at a desired location in a JFrame using Java

I want to put a Jbutton on a particular coordinate in a JFrame. I put setBounds for the JPanel (which I placed on the JFrame) and also setBounds for the JButton. However, they dont seem to function as..

Changing navigation title programmatically

I have a navigation bar with a title. When I double click the text to rename it, it actually says it's a navigation item, so it might be that. I'm trying to change the text using code, like: declare..

Reading InputStream as UTF-8

I'm trying to read from a text/plain file over the internet, line-by-line. The code I have right now is: URL url = new URL(""); BufferedReader in = new BufferedReader(n..

How do I pass parameters to a jar file at the time of execution?

How do I pass parameters to a JAR file at the time of execution?..

How to convert a string to an integer in JavaScript?

How do I convert a string to an integer in JavaScript?..

The ScriptManager must appear before any controls that need it

I have created a new ASP.NET Web Application, and after debugging i got Server Error The control with ID 'WaitingPopup1' requires a ScriptManager on the page. The ScriptManager must appear before ..

Jenkins restrict view of jobs per user

Is there a way to restrict user to view only certain jobs in Jenkins. Jenkins allows the restriction of user ability per project via the "Project-based Matrix Authorization Strategy". The problem is..

Write to rails console

When I want to try or debug smthing I run rails console and do some stuff there. I can print some text or variables from code by raising exception with raise "blablabla". Question: How I can just writ..

NodeJS - Error installing with NPM

Microsoft Windows [Version 6.3.9600] (c) 2013 Microsoft Corporation. All rights reserved. C:\Windows\system32>npm install caress-server npm http GET npm ht..

Getting the location from an IP address

I want to retrieve information like the city, state, and country of a visitor from their IP address, so that I can customize my web page according to their location. Is there a good and reliable way t..

SQL: parse the first, middle and last name from a fullname field

How do I parse the first, middle, and last name out of a fullname field with SQL? I need to try to match up on names that are not a direct match on full name. I'd like to be able to take the full n..

Oracle (ORA-02270) : no matching unique or primary key for this column-list error


Disable/enable an input with jQuery?

$input.disabled = true; or $input.disabled = "disabled"; Which is the standard way? And, conversely, how do you enable a disabled input?..

How to install gdb (debugger) in Mac OSX El Capitan?

How to install gdb (debugger) in Mac OSX El Capitan ? I have tried installing gdb but failed couple of time. I was following this URL : , MAC doesn..

Replace transparency in PNG images with white background

I've got some PNG images with transparency, and I need to create versions with the image layer composed onto a white background. I've tried various things with Image Magick "convert" operations, but ..

How to sort an array of integers correctly

Trying to get the highest and lowest value from an array that I know will contain only integers seems to be harder than I thought. _x000D_ _x000D_ var numArray = [140000, 104, 99]; numArray = numArray..

how to access downloads folder in android?

I am new android, i'm making an app in which one can download files to downloads folder (using Download Manager). I can see pictures if i go to downloads folder in emulator. So if i want to show a sli..

jQuery: checking if the value of a field is null (empty)

Is this a good way to check if the value of a field is null? if($('#person_data[document_type]').value() != 'NULL'){} Or is there a better way?..

Make install, but not to default directories?

I want to run 'make install' so I have everything I need, but I'd like it to install the things in their own folder as opposed to the system's /usr/bin etc. is that possible? even if it references too..

Generating matplotlib graphs without a running X server

Matplotlib seems to require the $DISPLAY environment variable which means a running X server.Some web hosting services do not allow a running X server session.Is there a way to generate graphs using m..

Delete column from SQLite table

I have a problem: I need to delete a column from my SQLite database. I wrote this query alter table table_name drop column column_name but it does not work. Please help me...

How do I wrap text in a span?

I've got a span that's 350 pixels wide. If there's more text than that, it just goes straight out to the right off to the side of the span. How do I force the text to wrap down into a paragraph? I've ..

How to set minDate to current date in jQuery UI Datepicker?

This is my code and it is not working correctly. I want to set minDate to the current date. How can I do it? $("input.DateFrom").datepicker({ changeMonth: true, changeYear: true, dateFo..

How to return a value from a Form in C#?

I have a main form (let's call it frmHireQuote) that is a child of a main MDI form (frmMainMDI), that shows another form (frmImportContact) via ShowDialog() when a button is clicked. When the user cl..

Exploring Docker container's file system

I've noticed with docker that I need to understand what's happening inside a container or what files exist in there. One example is downloading images from the docker index - you don't have a clue wha..

Hive load CSV with commas in quoted fields

I am trying to load a CSV file into a Hive table like so: CREATE TABLE mytable ( num1 INT, text1 STRING, num2 INT, text2 STRING ) ROW FORMAT DELIMITED FIELDS TERMINATED BY ","; LOAD DATA LOCAL INPAT..

mcrypt is deprecated, what is the alternative?

The mcrypt-extension is deprecated will be removed in PHP 7.2 according to the comment posted here. So I am looking for an alternative way to encrypt passwords. Right now I am using something like m..

git: fatal unable to auto-detect email address

I just cannot commit with git on Ubuntu 14.04 Error message is: git: fatal unable to auto-detect email address (got "some wrong email") I tried git-config with and without the --global option s..

How to implement a Keyword Search in MySQL?

I am new to SQL programming. I have a table job where the fields are id, position, category, location, salary range, description, refno. I want to implement a keyword search from the front end. The ..

How do I include negative decimal numbers in this regular expression?

How do I match negative numbers as well by this regular expression? This regex works fine with positive values, but I want it to also allow negative values e.g. -10, -125.5 etc. ^[0-9]\d*(\.\d+)?$ ..

How can I pad a value with leading zeros?

What is the recommended way to zerofill a value in JavaScript? I imagine I could build a custom function to pad zeros on to a typecasted value, but I'm wondering if there is a more direct way to do th..

How to make a gui in python

I was wondering if any of you know where I could find a simple tutorial on the web maybe to make a very simplistic gui. I have no idea how to start out in code to make one so I need your help. What I ..

How to overplot a line on a scatter plot in python?

I have two vectors of data and I've put them into matplotlib.scatter(). Now I'd like to over plot a linear fit to these data. How would I do this? I've tried using scikitlearn and np.scatter...

Import Certificate to Trusted Root but not to Personal [Command Line]

I am trying to import two certificates to my local machine using the command line. I have one certificate to add to the Personal Store of the local machine, and another one to add to the Trusted Root..

Postgresql - unable to drop database because of some auto connections to DB

Whenever I try to drop database I get: ERROR: database "pilot" is being accessed by other users DETAIL: There is 1 other session using the database. When I use: SELECT pg_terminate_backend(pg_st..

Flatten nested dictionaries, compressing keys

Suppose you have a dictionary like: {'a': 1, 'c': {'a': 2, 'b': {'x': 5, 'y' : 10}}, 'd': [1, 2, 3]} How would you go about flattening that into something like: {'a': 1, 'c_..

How can I enable "URL Rewrite" Module in IIS 8.5 in Server 2012?

I have windows server 2012 and I have installed the IIS 8.5 but I could not see the URL rewrite module. How can I enable or install?..

'if' in prolog?

Is there a way to do an if in prolog, e.g. if a variable is 0, then to do some actions (write text to the terminal). An else isn't even needed, but I can't find any documentation of if...

Error: select command denied to user '<userid>'@'<ip-address>' for table '<table-name>'

In my website, I am using MySQL database. I am using a webservice where in I do all my database related manipulations. Now In one of the methods of that webservice, I get the following Error. sel..

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

Django - limiting query results

I want to take the last 10 instances of a model and have this code: Model.objects.all().order_by('-id')[:10] Is it true that firstly pick up all instances, and then take only 10 last ones? Is ther..

Global variables in AngularJS

I have a problem where i'm initialising a variable on the scope in a controller. Then it gets changed in another controller when a user logs in. This variable is used to control things such as the nav..

commands not found on zsh

I am using the z Shell (zsh) instead of the default bash, and something wrong happen so that all commands who used to work are no longer recognized: ls zsh: command not found: ls open -e .zshrc zsh:..

Pass command parameter to method in ViewModel in WPF?

I am trying to pass CommandParameter to the method in my ViewModel. How to do this? private void Open(object sender) { if (sender==this.objMainWindow.btnHistory) { objMainWindow.Conta..

HttpClient won't import in Android Studio

I have a simple class written in Android Studio: package com.mysite.myapp; import org.apache.http.client.HttpClient; public class Whatever { public void headBangingAgainstTheWallExample () { ..

How do I fix a NoSuchMethodError?

I'm getting a NoSuchMethodError error when running my Java program. What's wrong and how do I fix it?..

How to query DATETIME field using only date in Microsoft SQL Server?

I have a table TEST with a DATETIME field, like this: ID NAME DATE 1 TESTING 2014-03-19 20:05:20.000 What I need a query returning this row and every row with date 03/19/2014, no matter what the time..

How can I install packages using pip according to the requirements.txt file from a local directory?

Here is the problem: I have a requirements.txt file that looks like: BeautifulSoup==3.2.0 Django==1.3 Fabric==1.2.0 Jinja2==2.5.5 PyYAML==3.09 Pygments==1.4 SQLAlchemy==0.7.1 South==0.7.3 amqplib==0.6..

Playing sound notifications using Javascript?

How can I do that, so whenever a user clicks a link we play a sound? Using javascript and jquery here...

Stop Visual Studio from launching a new browser window when starting debug?

I already have a window open with the web site I'm debugging. I don't need VS to launch another one for me every time I need to debug. Is there a way to stop this behavior?..

How to insert a value that contains an apostrophe (single quote)?

What is the correct SQL syntax to insert a value with an apostrophe in it? Insert into Person (First, Last) Values 'Joe', 'O'Brien' I keep getting an error as I think the apostrophe after the..

How to redirect to previous page in Ruby On Rails?

I have a page that lists all of the projects that has sortable headers and pagination. path: /projects?order=asc&page=3&sort=code I choose to edit one of the projects path: projects/436/ed..

How to put a jpg or png image into a button in HTML

I want a button with an image in it. I am using this: <input type="submit" name="submit" src="images/stack.png" /> But it does not show the image. I want the whole button to be the image...

How do I trap ctrl-c (SIGINT) in a C# console app

I would like to be able to trap CTRL+C in a C# console application so that I can carry out some cleanups before exiting. What is the best way of doing this?..

A monad is just a monoid in the category of endofunctors, what's the problem?

Who first said the following? A monad is just a monoid in the category of endofunctors, what's the problem? And on a less important note, is this true and if so could you give an explanation..

CSS: create white glow around image

How can I create a white glow as the border of an unknown size image?..

how to check if object already exists in a list

I have a list List<MyObject> myList and I am adding items to a list and I want to check if that object is already in the list. so before I do this: myList.Add(nextObject); I want to ..

Split string and get first value only

I wonder if it's possible to use split to devide a string with several parts that are separated with a comma, like this: title, genre, director, actor I just want the first part, the title of each ..

What is the bower (and npm) version syntax?

Bower enables me to specify version requirements for packages using the following syntax: "dependencies": { "<name>": "<version>", }, But I have not been able to find what is the synt..

How to run Nginx within a Docker container without halting?

I have Nginx installed on a Docker container, and am trying to run it like this: docker run -i -t -p 80:80 mydockerimage /usr/sbin/nginx The problem is that the way Nginx works, is that the initial..

How can one print a size_t variable portably using the printf family?

I have a variable of type size_t, and I want to print it using printf(). What format specifier do I use to print it portably? In 32-bit machine, %u seems right. I compiled with g++ -g -W -Wall -Werr..

With MySQL, how can I generate a column containing the record index in a table?

Is there any way I can get the actual row number from a query? I want to be able to order a table called league_girl by a field called score; and return the username and the actual row position of th..

500.21 Bad module "ManagedPipelineHandler" in its module list

I am getting the error: HTTP Error 500.21 - Internal Server Error Handler "CloudConnectHandler" has a bad module "ManagedPipelineHandler" in its module list my web.config file looks like this: <..

Cannot read property 'style' of undefined -- Uncaught Type Error

I would like to change the color, fontsize and font weight of the text in a span element of the html page. I am using the following code: if(window.location.href.indexOf("test") > -1){ var se..

What is the purpose of Android's <merge> tag in XML layouts?

I've read Romain Guy's post on the <merge /> tag, but I still don't understand how it's useful. Is it a sort-of replacement of the <Frame /> tag, or is it used like so: <merge xmlns:an..

Print an ArrayList with a for-each loop

Given the following exists in a class, how do I write a for-each that prints each item in the list? private ArrayList<String> list; list = new ArrayList<String>(); I have: for (String ..

Convert xlsx file to csv using batch

How do you convert multiple xlsx files to csv files with a batch script?..

Difference between /res and /assets directories

I know that files in the res directory are accessible from R.class while assets behaves like a file system, but I would like to know, in general, when it's best to use one and the other. Can anyone he..

How do I use $rootScope in Angular to store variables?

How do I use $rootScope to store variables in a controller I want to later access in another controller? For example: angular.module('myApp').controller('myCtrl', function($scope) { var a = //somet..

Animate element to auto height with jQuery

I want to animate a <div> from 200px to auto height. I can’t seem to make it work though. Does anyone know how? Here’s the code: $("div:first").click(function(){ $("#first").animate({ ..

ImportError: DLL load failed: %1 is not a valid Win32 application

I have this issue where I try to import cv2 on python and get the following error message. >>> import cv2 Traceback (most recent call last): File "<stdin>", line 1, in <module> I..

Create web service proxy in Visual Studio from a WSDL file

My application needs to talk to a web service that hasn't got an online WSDL definition. The developers however supplied me with a WSDL file. With a public WSDL Visual Studio can generate this code f..

How do I put a variable inside a string?

I would like to put an int into a string. This is what I am doing at the moment: num = 40 plot.savefig('hanning40.pdf') #problem line I have to run the program for several different numbers, so I'd..

super() fails with error: TypeError "argument 1 must be type, not classobj" when parent does not inherit from object

I get some error that I can't figure out. Any clue what is wrong with my sample code? class B: def meth(self, arg): print arg class C(B): def meth(self, arg): super(C, self)...

Install npm (Node.js Package Manager) on Windows (w/o using Node.js MSI)

The problem: while using nvm to install Node.js I was able to install the version of Node.js I need, but nvm does not install npm automatically. NPM's page provides no information about installing it...

How do I cast a JSON Object to a TypeScript class?

I read a JSON object from a remote REST server. This JSON object has all the properties of a typescript class (by design). How do I cast that received JSON object to a type var? I don't want to popul..

How to change font size on part of the page in LaTeX?

I'd like to change text size for some page part, e.g. for verbatim block: \begin{verbatim} <how to set font size here to 10 px ? /> \end{verbatim} Regards..

How to connect to Oracle 11g database remotely

I have Oracle 11g XE installed on computer A. I can connect through the sql command line using the command connect username/password. I also can send SQL instructions to the Demo database: Select * fr..

What is meant by the term "hook" in programming?

I recently heard the term "hook" while talking to some people about a program I was writing. I'm unsure exactly what this term implies although I inferred from the conversation that a hook is a type ..

Unable to connect to mongodb Error: couldn't connect to server at src/mongo/shell/mongo.js:L112

When ever I try to connect to mongo db I always get this error as below. MongoDB shell version: 2.4.3 connecting to: test Fri Apr 26 14:31:46.941 JavaScript execution failed: Error: couldn't connect..

Set width to match constraints in ConstraintLayout

I would like to constrain a View's left and right sides to it's parent view's margins and make it fill the allotted space. However, setting width to either match_parent or wrap_content appears to prod..

Select all columns except one in MySQL?

I'm trying to use a select statement to get all of the columns from a certain MySQL table except one. Is there a simple way to do this? EDIT: There are 53 columns in this table (NOT MY DESIGN)..

RabbitMQ / AMQP: single queue, multiple consumers for same message?

I am just starting to use RabbitMQ and AMQP in general. I have a queue of messages I have multiple consumers, which I would like to do different things with the same message. Most of the RabbitMQ..

What's the difference between primitive and reference types?

This is a past exam question and I was wondering what a primitive type and reference type are first off? With an array I know the a reference type is where the array is composed of objects or variable..

How to get certain commit from GitHub project

I need to download the Facebook API from GitHub. Normally, I just click on the 'Downloads" tab to download the latest source code. In this case, I need an older commit: 91f256424531030a454548693c3a6ca..

Save multiple sheets to .pdf

I have a reporting spreadsheet that grabs some data from a database and forms three sheets of summary report information. I want to run the spreadsheet automatically from the command line, and have it..

What is initial scale, user-scalable, minimum-scale, maximum-scale attribute in meta tag?

I was going through the source code of a website and found this piece of code. <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=1.0, minimum-scale=1.0, maximum-s..

CodeIgniter 500 Internal Server Error

I downloaded a PHP script written using CodeIgniter. when I run it from the localhost, on going to the admin folder, it shows localhost again. Also when running from my web host, it shows a 500 Intern..

Specifying maxlength for multiline textbox

I'm trying to use asp: <asp:TextBox ID="txtInput" runat="server" TextMode="MultiLine"></asp:TextBox> I want a way to specify the maxlength property, but apparently there's no way possib..

Can't create handler inside thread which has not called Looper.prepare()

I have an Activity, and in that I have a class. text=new Dynamictext(...); text.setText("txt"); in my DynamicText java I have this code: public void setText(String text) { this.text=text; ..

Select multiple columns from a table, but group by one

The table name is "OrderDetails" and columns are given below: OrderDetailID || ProductID || ProductName || OrderQuantity I'm trying to select multiple columns and Group By ProductID while having SU..

Attribute 'nowrap' is considered outdated. A newer construct is recommended. What is it?

I'm getting an error when compiling this within an ASPX page using Visual Studio 2010: <td valign="top" nowrap width="237"> The error message is "Attribute 'nowrap' is considered out..

Save file Javascript with file name

I'm working on a text editor in pure Javascript. I'd like it so that when the user clicks the 'Save' button, the editor downloads the file. I've already got this partly working: uriContent = "data:ap..

How to change line width in ggplot?

Datalink: the data used My code: ccfsisims <- read.csv(file = "F:/Purdue University/RA_Position/PhD_ResearchandDissert/PhD_Draft/GTAP-CGE/GTAP_NewAggDatabase/NewFiles/GTAP_ConsIndex.csv", header=..


My site is rather extensive, and I just recently made the switch to PHP5 (call me a late bloomer). All of my MySQL query's before were built as such: "SELECT * FROM tablename WHERE field1 = 'value' ..

SQL update from one Table to another based on a ID match

I have a database with account numbers and card numbers. I match these to a file to update any card numbers to the account number, so that I am only working with account numbers. I created a view li..

DateTime2 vs DateTime in SQL Server

Which one: datetime datetime2 is the recommended way to store date and time in SQL Server 2008+? I'm aware of differences in precision (and storage space probably), but ignoring those for now, i..

httpd: Could not reliably determine the server's fully qualified domain name, using for ServerName

I tried to restart my Apache server on CentOS 5.0 and got this message: httpd: Could not reliably determine the server's fully qualified domain name, using for ServerName Here is the /..

Java FileReader encoding issue

I tried to use to read some text files and convert them into a string, but I found the result is wrongly encoded and not readable at all. Here's my environment: Windows 2003, OS ..

Flexbox: 4 items per row

I'm using a flex box to display 8 items that will dynamically resize with my page. How do I force it to split the items into two rows? (4 per row)? Here is a relevant snip: (Or if you prefer jsfiddl..

How do I access store state in React Redux?

I am just making a simple app to learn async with redux. I have gotten everything working, now I just want to display the actual state onto the web-page. Now, how do I actually access the store's stat..

TypeError: 'dict_keys' object does not support indexing

def shuffle(self, x, random=None, int=int): """x, random=random.random -> shuffle list x in place; return None. Optional arg random is a 0-argument function returning a random float in..

Getting current directory in VBScript

I'm trying to get the current directory and use it to run an application no matter where the file is put and no matter how the path is changed Dim fso: set fso = CreateObject("Scripting.FileSystemObj..

List the queries running on SQL Server

Is there a way to list the queries that are currently running on MS SQL Server (either through the Enterprise Manager or SQL) and/or who's connected? I think I've got a very long running query is bei..

How to increase icons size on Android Home Screen?

I am trying to make changes to default Android Home Screen (like changing cell dimensions, number of elements per row etc) and wondering if there any way I can change apps icon sizes placed on the hom..

jQuery getJSON save result into variable

I use getJSON to request a JSON from my website. It works great, but I need to save the output into another variable, like this: var myjson= $.getJSON("", function..

Is there a way to make Firefox ignore invalid ssl-certificates?

I am maintaining a few web applications. The development and qa environments use invalid/outdated ssl-certificates. Although it is generally a good thing, that Firefox makes me click like a dozen tim..

Print to the same line and not a new line?

Basically I want to do the opposite of what this guy did... hehe. Python Script: Print new line each time to shell rather than update existing line I have a program that is telling me how far along ..

Java: Convert String to TimeStamp

I have an issue while I try to convert a String to a TimeStamp. I have an array that has the date in the format of yyyy-MM-dd and I want to change in the format of yyyy-MM-dd HH:mm:ss.SSS. So, I use t..

How do I check if an object has a specific property in JavaScript?

How do I check if an object has a specific property in JavaScript? Consider: x = {'key': 1}; if ( x.hasOwnProperty('key') ) { //Do this } Is that the best way to do it?..

How to scroll to bottom in a ScrollView on activity startup

I am displaying some data in a ScrollView. On activity startup (method onCreate) I fill the ScrollView with data and want to scroll to the bottom. I tried to use getScrollView().fullScroll(ScrollView..

Concatenating bits in VHDL

How do you concatenate bits in VHDL? I'm trying to use the following code: Case b0 & b1 & b2 & b3 is ... and it throws an error Thanks..

How to open URL in Microsoft Edge from the command line?

I need to open URL in Microsoft Edge (on Windows 10). When I invoke start shell:AppsFolder\Microsoft.MicrosoftEdge_8wekyb3d8bbwe!MicrosoftEdge then Microsoft Edge is started c..

Bootstrap 3 2-column form layout

I am still learning the proper use of Bootstrap 3 and was wondering if you all could help me out. I would like a layout something like this: Label Label Textbox ..

using jquery $.ajax to call a PHP function

This may be a simple answer, but I'm using jQuery's $.ajax to call a PHP script. What I want to do is basically put that PHP script inside a function and call the PHP function from javascript. <?..

Can I run Keras model on gpu?

I'm running a Keras model, with a submission deadline of 36 hours, if I train my model on the cpu it will take approx 50 hours, is there a way to run Keras on gpu? I'm using Tensorflow backend and ru..

python: how to send mail with TO, CC and BCC?

I need for testing purposes to populate few hundred email boxes with various messages, and was going to use smtplib for that. But among other things I need to be able to send messages not only TO spec..

apache ProxyPass: how to preserve original IP address

We are using ProxyPass to redirect all "/r" requests to jboss on port 18080 as follows: ProxyPreserveHost on ProxyPass /r http://localhost:18080/redirectService/ ProxyPassReverse /r http://localhost:..

Which header file do you include to use bool type in c in linux?

Here's all .h files I've included so far,but non have the definition of bool: #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/types.h> #include <s..

How to use glyphicons in bootstrap 3.0

I have already used glyphicons in bootstrap 2.3 but now I have upgraded to bootstrap 3.0. Now, I am unable to use the icon property. In bootstrap 2.3, below tag is working <i class="icon-search"&..

Passing std::string by Value or Reference

Possible Duplicate: Are the days of passing const std::string & as a parameter over? Should I pass std::string by value or by reference (to a un-inlined function) if move semantics is s..

Installing Pandas on Mac OSX

I'm having trouble installing the Python Pandas library on my Mac OSX computer. I type the following in Terminal: $ sudo easy_install pandas But then I get the following: Searching for pandas Rea..

How to use clock() in C++

How do I call clock() in C++? For example, I want to test how much time a linear search takes to find a given element in an array...

Find if value in column A contains value from column B?

I have two columns- column E which extends upto 99504(values) and column I which extends to 2691(values).Both the columns contains filenames with extension. Something like this E I TSL..

How to take MySQL database backup using MySQL Workbench?

How to take database backup using MySQL Workbench? Can we take backup in the following ways- Backup file(.sql) contains both Create Table statements and Insert into Table Statements Backup file(.sql..

What is the inclusive range of float and double in Java?

What is the inclusive range of float and double in Java? Why are you not recommended to use float or double for anything where precision is critical?..

How do I delete unpushed git commits?

I accidentally committed to the wrong branch. How do I delete that commit?..

How to set selected index JComboBox by value

I want to set the selected index in a JComboBox by the value not the index. How to do that? Example public class ComboItem { private String value; private String label; public ComboItem..

Check if a Postgres JSON array contains a string

I have a table to store information about my rabbits. It looks like this: create table rabbits (rabbit_id bigserial primary key, info json not null); insert into rabbits (info) values ('{"name":"He..

show more/Less text with just HTML and JavaScript

I am needing to create a show more/less text function, but with just JavaScript and HTML.. I can't use any additional libraries such as jQuery and it can't be done with CSS. The sample code I have add..

LINQ equivalent of foreach for IEnumerable<T>

I'd like to do the equivalent of the following in LINQ, but I can't figure out how: IEnumerable<Item> items = GetItems(); items.ForEach(i => i.DoStuff()); What is the real syntax?..

Open two instances of a file in a single Visual Studio session

I have a file, xyz.cpp. I want to open two instances of this file in Visual studio (BTW, I am using Visual Studio 2005). Why would I want to do so? I want to compare two sections of the same..

How to make a div fill a remaining horizontal space?

I have 2 divs: one in the left side and one in the right side of my page. The one in the left side has fixed width and I want the one of the right side to fill the remaining space. _x000D_ _x000D_ #s..