Questions Tagged with #Itemcommand

How to properly -filter multiple strings in a PowerShell copy script

I am using the PowerShell script from this answer to do a file copy. The problem arises when I want to include multiple file types using the filter. Get-ChildItem $originalPath -filter "*.htm" | ` ..

Creating a folder if it does not exists - "Item already exists"

I am trying to create a folder using PowerShell if it does not exists so I did : $DOCDIR = [Environment]::GetFolderPath("MyDocuments") $TARGETDIR = "$DOCDIR\MatchedLog" if(!(Test-Path -Path MatchedLo..

Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack

I am getting the error: Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack. I have redirected to a new page in repeater's itemcommand event..

WPF Databinding: How do I access the "parent" data context?

I have a list (see below) contained in a window. The window's DataContext has two properties, Items and AllowItemCommand. How do I get the binding for the Hyperlink's Command property needs to resolv..

Understanding colors on Android (six characters)

I am trying to understand how colors work in Android. I have this color set as the background of my LinearLayout, and I get a background gray with some transparency: <gradient android:startColor="..

Extract names of objects from list

I have a list of objects. How do I grab the name of just one object from the list? As in: LIST <- list(A=1:5, B=1:10) LIST$A$A) #function I hope exists "A" #yay! it..

How to verify if $_GET exists?

So, I have some PHP code that looks a bit like this: <body> The ID is <?php echo $_GET["id"] . "!"; ?> </body> Now, when I pass an ID like http://localhost/myph..

How can I do a case insensitive string comparison?

How can I make the line below case insensitive? drUser["Enrolled"] = (enrolledUsers.FindIndex(x => x.Username == (string)drUser["Username"]) != -1); I was given some advice earlier today ..

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

HTTP Status 500 - org.apache.jasper.JasperException: java.lang.NullPointerException

I deployed my project on the production server and getting the below error. It's a live project so , after getting error i replaced this with previous version that was running fine but now that is al..

Display a angular variable in my html page

as the title says I'm trying to display an Angular variable in a html page. I have this function inside the controller I'm using : $http.get('/api/tasks/?format=json').success(function(data) { ..

How do I find files that do not contain a given string pattern?

How do I find out the files in the current directory which do not contain the word foo (using grep)?..

How to delete a file from SD card?

I am creating a file to send as an attachment to an email. Now I want to delete the image after sending the email. Is there a way to delete the file? I have tried myFile.delete(); but it didn't delet..

How to create a sleep/delay in nodejs that is Blocking?

I'm currently trying to learn nodejs and a small project I'm working is writing an API to control some networked LED lights. The microprocessor controlling the LEDs has a processing delay, and I need..

Keeping session alive with Curl and PHP

I'm trying to connect to an API, authenticate a user and then view the user details. This is accomplished by first accessing the login endpoint at<username>/<pa..

How do I mock an open used in a with statement (using the Mock framework in Python)?

How do I test the following code with unittest.mock: def testme(filepath): with open(filepath) as f: return ..

Reading JSON from a file?

I am getting a bit of headache just because a simple looking, easy statement is throwing some errors in my face. I have a json file called strings.json like this: "strings": [{"-name": "city", "#tex..

NLTK and Stopwords Fail #lookuperror

I am trying to start a project of sentiment analysis and I will use the stop words method. I made some research and I found that nltk have stopwords but when I execute the command there is an error. ..

Find UNC path of a network drive?

I need to be able determine the path of the network Q drive at work for a WEBMethods project. The code that I have before is in my configuration file. I placed single character leters inside of the di..

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

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

PHP is not recognized as an internal or external command in command prompt

I got the following error when I run a command with php C:\xampp\htdocs>php 'php' is not recognized as an internal or external command, operable program or batch file. I don't get any error when..

Generating random numbers with Swift

I need to generate a random number. It appears the arc4random function no longer exists as well as the arc4random_uniform function. The options I have are arc4random_stir(), arc4random_buf(Unsaf..

What is "String args[]"? parameter in main method Java

I'm just beginning to write programs in Java. What does the following Java code mean? public static void main(String[] args) What is String[] args? When would you use these args? Source code an..

Making a Windows shortcut start relative to where the folder is?

I have a game that uses this file structure: GAME FOLDER ->data ->data->run.bat I want to put a shortcut to run.bat in GAME FOLDER, but if I move it, or someone else installs it it won't w..

MySQL - UPDATE query based on SELECT Query

I need to check (from the same table) if there is an association between two events based on date-time. One set of data will contain the ending date-time of certain events and the other set of data w..

Access And/Or exclusions

I have some sample data like: |H.RISK|NOTE|NORMAL| The | are actually in the data, it's a String. I am using Access, and am trying to exclude records that contain RISK in the String. Sample query..

How can I find the product GUID of an installed MSI setup?

I need to find the product GUID for an installed MSI file in order to perform maintenance such as patching, uninstall (how-to uninstall) and also for auditing purposes...

MD5 is 128 bits but why is it 32 characters?

I read some docs about md5, it said that its 128 bits, but why is it 32 characters? I can't compute the characters. 1 byte is 8 bits if 1 character is 1 byte then 128 bits is 128/8 = 16 bytes right?..

Which variable size to use (db, dw, dd) with x86 assembly?

I am a beginner to assembly and I don't know what all the db, dw, dd, things mean. I have tried to write this little script that does 1+1, stores it in a variable and then displays the result. Here is..

Disable ScrollView Programmatically?

I would like to enable ScrollView and disable it by a Button Click. Disable means like if the ScrollView wasn't there.. and enable it returns the ScrollView. I want that because I have a gallery wi..

How to set image for bar button with swift?

I am trying to set an Image for bar button Item for that I have an image like: with resolution 30 * 30 but while I assign this Image to Bar button Its looks like: I have assigned image this way ..

Android Studio doesn't see device

The AVD Manager in Android Studio doesn't show my device but adb devices does show it. Am I missing something obvious here?..

Java for loop multiple variables

I'm not sure why my Java code wont compile, any suggestions would be appreciated. String rank = card.substring(0,1); String suit = card.substring(1); String cards = "A23456789TJQKDHSCl"; ..

Environment variables in Mac OS X

Update: The link below does not have a complete answer. Having to set the path or variable in two places (one for GUI and one for shell) is lame. Not Duplicate of: Setting environment variables in OS..

Print a file's last modified date in Bash

I can't seem to find how to print out the date of a file. I'm so far able to print out all the files in a directory, but I need to print out the dates with it. I know I need to attach a date format ..

What are the best JVM settings for Eclipse?

What are the best JVM settings you have found for running Eclipse?..

How to automatically allow blocked content in IE?

I am using below code for sample menu. <html> <head> <title>Tree Demo</title> <script type="text/javascript" src="jquery.js"></script> <script type="text/ja..

How to import functions from different js file in a Vue+webpack+vue-loader project

(See end for why this is not a dupe of How do I include a JavaScript file in another JavaScript file?) Javascipt + Vue + webpack + vue-loader noob... stumbling on the simplest of things! I have App..

What is the C# version of's InputDialog?

What is the C# version of's InputBox?..

Replacing some characters in a string with another character

I have a string like AxxBCyyyDEFzzLMN and I want to replace all the occurrences of x, y, and z with _. How can I achieve this? I know that echo "$string" | tr 'x' '_' | tr 'y' '_' would work..

Allow access permission to write in Program Files of Windows 7

My application throws 'Access denied' errors when writing temporary files in the installation directory where the executable resides. However it works perfectly well in Windows XP. How to provide acce..

What does .pack() do?

I am learning about JPanel and GridLayout , this snippet of code will produce a simple JPanel with 6 buttons package testing; import*; import java.util.*; import*; import j..

matplotlib savefig in jpeg format

I am using matplotlib (within pylab) to display figures. And I want to save them in .jpg format. When I simply use the savefig command with jpg extension this returns : ValueError: Format "jpg" is no..

Conversion from List<T> to array T[]

Is there a short way of converting a strongly typed List<T> to an Array of the same type, e.g.: List<MyClass> to MyClass[]? By short i mean one method call, or at least shorter than: MyC..

C pointers and arrays: [Warning] assignment makes pointer from integer without a cast

I'm having some trouble with pointers and arrays in C. Here's the code: #include<stdio.h> int *ap; int a[5]={41,42,43,44,45}; int x; int main() { ap = a[4]; x = *ap; printf("%d",..

How to get week number of the month from the date in sql server 2008

In SQL Statement in microsoft sql server, there is a built-in function to get week number but it is the week of the year. Select DatePart(week, '2012/11/30') // **returns 48** The returned value 48..

Add class to <html> with Javascript?

How do you add a class to the <html> root element using Javascript?..

How to print a certain line of a file with PowerShell?

I don't have a decent text editor on this server, but I need to see what's causing an error on line 10 of a certain file. I do have PowerShell though.....

Create a new file in git bash

I've got Git for Windows running, I'm not sure if it's supposed to function as a text editor though? I think I installed it with the Vim editor, but in a Git Bash shell how do I create a file, such a..

How do I get some variable from another class in Java?

I am "playing around" with Java, watching tutorials and trying to get the hang of it. For this question, I'm trying to figure out how I can take a variable from another class and use it in my main one..


Which of these queries is the faster? NOT EXISTS: SELECT ProductID, ProductName FROM Northwind..Products p WHERE NOT EXISTS ( SELECT 1 FROM Northwind..[Order Details] od WHERE p.Produ..

java: How can I do dynamic casting of a variable from one type to another?

I would like to do dynamic casting for a Java variable, the casting type is stored in a different variable. This is the regular casting: String a = (String) 5; This is what I want: String theTy..

UILabel Align Text to center

How do I align text in UILabel?..

Select NOT IN multiple columns

I need to implement the following query: SELECT * FROM friend WHERE ( friend.id1, friend.id2 ) NOT IN (SELECT id1, id2 FROM likes) But N..

How to implement "select all" check box in HTML?

I have an HTML page with multiple checkboxes. I need one more checkbox by the name "select all". When I select this checkbox all checkboxes in the HTML page must be selected. How can I do this?..

How to get an ASP.NET MVC Ajax response to redirect to new page instead of inserting view into UpdateTargetId?

I am using the Ajax.BeginForm to create a form the will do an ajax postback to a certain controller action and then if the action is successful, the user should get redirected to another page (if the ..

$location / switching between html5 and hashbang mode / link rewriting

I was under the impression that Angular would rewrite URLs that appear in href attributes of anchor tags within tempaltes, such that they would work whether in html5 mode or hashbang mode. The documen..

Create sequence of repeated values, in sequence?

I need a sequence of repeated numbers, i.e. 1 1 ... 1 2 2 ... 2 3 3 ... 3 etc. The way I implemented this was: nyear <- 20 names <- c(rep(1,nyear),rep(2,nyear),rep(3,nyear),rep(4,nyear), ..

adding css file with jquery

I am creating a popupwindow and I want to add a css file to that popupwindow below is the code for popupwindow. I have a javascript with creates a popupwindow. <a href="popupwindowcontent.xhtml" ..

How to fix Subversion lock error

How do you fix the Subversion/Subclipse error "Attempted to lock an already-locked dir"? Googling shows people routinely encounter this error, and the only solution I've seen posted is to run Subclip..

CSS selector for first element with class

I have a bunch of elements with a class name red, but I can't seem to select the first element with the class="red" using the following CSS rule: _x000D_ _x000D_ .red:first-child {_x000D_ border:..

How to do a SQL NOT NULL with a DateTime?

This might be simple, but I cant figure out how to do a simple DateTime with a NOT NULL? I want to do something like this: SELECT * FROM someTable WHERE thisDateTime IS NOT NULL But that obviously..

What is the equivalent of "none" in django templates?

I want to see if a field/variable is none within a Django template. What is the correct syntax for that? This is what I currently have: {% if profile.user.first_name is null %} <p> -- </p..

Checking for directory and file write permissions in .NET

In my .NET 2.0 application, I need to check if sufficient permissions exist to create and write to files to a directory. To this end, I have the following function that attempts to create a file and w..

Check if a path represents a file or a folder

I need a valid method to check if a String represents a path for file or a directory. What are valid directory names in Android? As it comes out, folder names can contain '.' chars, so how does system..

How to efficiently count the number of keys/properties of an object in JavaScript?

What's the fastest way to count the number of keys/properties of an object? It it possible to do this without iterating over the object? i.e. without doing var count = 0; for (k in myobj) if (myobj..

how to increase java heap memory permanently?

I have one problem with java heap memory. I developed one client server application in java which is run as a windows service it requires more than 512MB of memory. I have 2GB of RAM but when I run my..

How to undo a git pull?

I would like to undo my git pull on account of unwanted commits on the remote origin, but I don't know to which revision I have to reset back to. How can I just go back to the state before I did the ..

unexpected T_VARIABLE, expecting T_FUNCTION

I am expecting this to be a basic syntax error I overlooked, but I can't figure it out. In a PHP script, I keep getting the following error. Parse error: syntax error, unexpected T_VARIABLE, expecti..

c++ integer->std::string conversion. Simple function?

Problem: I have an integer; this integer needs to be converted to a stl::string type. In the past, I've used stringstream to do a conversion, and that's just kind of cumbersome. I know the C way is ..

Replace duplicate spaces with a single space in T-SQL

I need to ensure that a given field does not have more than one space (I am not concerned about all white space, just space) between characters. So 'single spaces only' needs to be turned int..

HTTP test server accepting GET/POST requests

I need a live test server that accepts my requests for basic information via HTTP GET and also allows me to POST (even if it's really not doing anything). This is entirely for test purposes. A good e..

Regular expression to match DNS hostname or IP Address?

Does anyone have a regular expression handy that will match any legal DNS hostname or IP address? It's easy to write one that works 95% of the time, but I'm hoping to get something that's well tested..

How to add hamburger menu in bootstrap

I need some help with bootstrap nav. I want it to be toggled via a hamburger icon on mobile. Here it is on codepen: (link invalid) _x000D_ _x000D_ .navbar,_x000D_..

Android button onClickListener

I am trying to open new Activity by clicking on a button in my OnClickListener method. How does OnClickListener method work and what should be done in it to start a new Activity? ..

Show percent % instead of counts in charts of categorical variables

I'm plotting a categorical variable and instead of showing the counts for each category value. I'm looking for a way to get ggplot to display the percentage of values in that category. Of course, it ..

How to run Gradle from the command line on Mac bash

I have a very simple question. I am brand new to Mac and I am trying to get my Java project moved over to my new Mac. The project has a Gradlew file that I thought I could run from the command line to..

How can I get the session object if I have the entity-manager?

I have private EntityManager em; public List getAll(DetachedCriteria detachedCriteria) { return detachedCriteria.getExecutableCriteria("....").list(); } How can I retrieve the sessi..

Executing a batch script on Windows shutdown

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

How do I make HttpURLConnection use a proxy?

If I do this... conn = new URL(urlString).openConnection(); System.out.println("Proxy? " + conn.usingProxy()); it prints Proxy? false The problem is, I am behind a proxy. Where does the JVM get ..

How to remove error about glyphicons-halflings-regular.woff2 not found

ASP.NET MVC4 Bootstrap 3 application is running from Microsoft Visual Studio Express 2013 for Web IDE. Chrome console shows always error http://localhost:52216/admin/fonts/glyphicons-halflings-regul..

How to list AD group membership for AD users using input list?

I'm fairly new PS user... Looking for some assistance with a powershell script to obtain list of security groups user is member of. To describe what I need: I have input list (txt file) with many u..

Get google map link with latitude/longitude

I want to get google map link that show title/content in marker that located at latitude/longitude. so parameters are title, content, latitude , longitude . Result is a link like this https://maps...

Regular vs Context Free Grammars

I'm studying for my computing languages test, and there's one idea I'm having problems wrapping my head around. I understood that regular grammars are simpler and cannot contain ambiguity, but can'..

MySQL: update a field only if condition is met

Is it possible to do an UPDATE query in MySQL which updates field value only if certain condition is met? Something like this: UPDATE test SET CASE WHEN true THEN field = 1 E..

How do I check what version of Python is running my script?

How can I check what version of the Python Interpreter is interpreting my script?..

Accessing a property in a parent Component

I have a property in a top level Component that is used data from a HTTP source like so (this is in a file called app.ts): import {UserData} from './services/user-data/UserData'; Component({ sel..

Java and HTTPS url connection without downloading certificate

This code connects to a HTTPS site and I am assuming I am not verifying the certificate. But why don't I have to install a certificate locally for the site? Shouldn't I have to install a certificat..

UnicodeEncodeError: 'ascii' codec can't encode character at special name

My python (ver 2.7) script is running well to get some company name from local html files but when it comes to some specific country name, it gives this error "UnicodeEncodeError: 'ascii' codec can't ..

Unix - copy contents of one directory to another

Folder1/ -fileA.txt -fileB.txt -fileC.txt > mkdir Folder2/ > [copy command] And now Folder2/ looks like: Folder2/ -fileA.txt -fileB.txt -fileC.txt How to make t..

Convert python datetime to epoch with strftime

I have a time in UTC from which I want the number of seconds since epoch. I am using strftime to convert it to the number of seconds. Taking 1st April 2012 as an example. >>>datetime.dateti..

identifier "string" undefined?

I am receiving the error: identifier "string" undefined. However, I am including string.h and in my main file, everything is working fine. CODE: #pragma once #include <iostream> #include <..

Interfaces vs. abstract classes

In C#, when should you use interfaces and when should you use abstract classes? What can be the deciding factor?..

Closing a Userform with Unload Me doesn't work

I need to close an Excel userform using VBA when a user has clicked a submit button and operations have been carried out. How can I close a Userform from itself? I have tried this but it returns a 3..

Dialog throwing "Unable to add window — token null is not for an application” with getApplication() as context

My Activity is trying to create an AlertDialog which requires a Context as a parameter. This works as expected if I use: AlertDialog.Builder builder = new AlertDialog.Builder(this); However, I am l..

Matplotlib/pyplot: How to enforce axis range?

I would like to draw a standard 2D line graph with pylot, but force the axes' values to be between 0 and 600 on the x, and 10k and 20k on the y. Let me go with an example... import pylab as p p.tit..

Finding all objects that have a given property inside a collection

I have some complicated object, such as a Cat, which has many properties, such as age, favorite cat food, and so forth. A bunch of Cats are stored in a Java Collection, and I need to find all the C..

Merging dictionaries in C#

What's the best way to merge 2 or more dictionaries (Dictionary<T1,T2>) in C#? (3.0 features like LINQ are fine). I'm thinking of a method signature along the lines of: public static Dictionar..

Deleting records before a certain date

How would I go about deleting all records from a MySQL table from before a certain date, where the date column is in DATETIME format? An example datetime is 2011-09-21 08:21:22...

Simple tool to 'accept theirs' or 'accept mine' on a whole file using git

I don't want a visual merge tool, and I also don't want to have to vi the conflicted file and manually choose the between HEAD (mine) and the imported change (theirs). Most of the time I either want ..

How do I alter the position of a column in a PostgreSQL database table?

I've tried the following, but I was unsuccessful: ALTER TABLE person ALTER COLUMN dob POSITION 37; ..

Convert the values in a column into row names in an existing data frame

I would like to convert the values in a column of an existing data frame into row names. Is is possible to do this without exporting the data frame and then reimporting it with a row.names = call? Fo..

Press TAB and then ENTER key in Selenium WebDriver

Press TAB and then ENTER key in Selenium WebDriver GenericKeywords.typein(class.variable, PageLength); pagelength is nothing but string. After this code, I have to give Tab key. I don't know how to ..

What are some reasons for jquery .focus() not working?

Some thoughts are that the ELEMENT_ID.focus() is inside divs that are hidden at certain times. This should be an easy problem to solve -- but I'm struggling :( ***code works fine -- the text field ..

Clearing NSUserDefaults

I'm using +[NSUserDefaults standardUserDefaults] to store application settings. This consists of roughly a dozen string values. Is it possible to delete these values permanently instead of just settin..

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

Center/Set Zoom of Map to cover all visible Markers?

I am setting multiple markers on my map and I can set statically the zoom levels and the center but what I want is, to cover all the markers and zoom as much as possible having all markets visible A..

While, Do While, For loops in Assembly Language (emu8086)

I want to convert simple loops in high-level languages into assembly language (for emu8086) say, I have this code: for(int x = 0; x<=3; x++) { //Do something! } or int x=1; do{ //Do som..

SQL Server 2005 How Create a Unique Constraint?

How do I create a unique constraint on an existing table in SQL Server 2005? I am looking for both the TSQL and how to do it in the Database Diagram...

Setup a Git server with msysgit on Windows

My friends and I are trying to setup Git for Windows using the tutorial Git Server: Gitosis and Cygwin on Windows, but we just keep running into problems. What would a "Setup Git Server" guide for W..

DATEDIFF function in Oracle

I need to use Oracle but DATEDIFF function doesn't work in Oracle DB. How to write the following code in Oracle? I saw some examples using INTERVAL or TRUNC. SELECT DATEDIFF ('2000-01-01','2000-01-..

What does "control reaches end of non-void function" mean?

I've been getting strange compiler errors on this binary search algorithm. I get a warning that control reaches end of non-void function. What does this mean? int binary(int val, int sorted[], int lo..

TextFX menu is missing in Notepad++

There is no TextFX menu in the menu bar in my Notepad++ installation. How do I add it? There is nothing in Plugins -> Plugin Manager -> Show Plugin Manager -> Available tab I reinstalle..

How to solve java.lang.OutOfMemoryError trouble in Android

Altough I have very small size image in drawable folder, I am getting this error from users. And I am not using any bitmap function in code. At least intentionally :) java.lang.OutOfMemoryError a..

Mixing a PHP variable with a string literal

Say I have a variable $test and it's defined as: $test = 'cheese' I want to output cheesey, which I can do like this: echo $test . 'y' But I would prefer to simplify the code to something more lik..

How do I write the 'cd' command in a makefile?

For example, I have something like this in my makefile: all: cd some_directory But when I typed make I saw only 'cd some_directory', like in the echo command...

SQL Error: ORA-00936: missing expression

Qns: Item Description and the treatment date of all treatments for any patients named Jessie Stange (ie GivenName is Jessie & FamilyName is Stange) What I wrote: SELECT DISTINCT Description, Da..

How can I change the thickness of my <hr> tag

I want to change the thickness of my horizontal rule (<hr>)in CSS. I know it can be done in HTML like so - <hr size="10"> But I hear that this is deprecated as mentioned on MDN here. I..

Github: Can I see the number of downloads for a repo?

In Github, is there a way I can see the number of downloads for a repo? ..

How to deselect a selected UITableView cell?

I am working on a project on which I have to preselect a particular cell. I can preselect a cell using -willDisplayCell, but I can't deselect it when the user clicks on any other cell. - (void..

How to disable HTML button using JavaScript?

I’ve read that you can disable (make physically unclickable) an HTML button simply by appending disable to its tag, but not as an attribute, as follows: <input type="button" name=myButton value=..

Package opencv was not found in the pkg-config search path

I have installed OpenCV using the instructions in $ sudo su $ sudo apt-get install build-essential $ sudo apt-get install libavformat-dev $ sudo apt-get insta..

Can I map a hostname *and* a port with /etc/hosts?

Can I map an IP address like to a domain name and a port? For example, I would like to map to

Passing environment-dependent variables in webpack

I'm trying to convert an angular app from gulp to webpack. in gulp I use gulp-preprocess to replace some variables in the html page (e.g. database name) depending on the NODE_ENV. What is the best way..

Slidedown and slideup layout with animation

how can I display a layout in the center with slideUp when I press the button, and press again to hide ... slideDown in ANDROID help me with that, thnkss..

Clear image on picturebox

How can I clear draw image on picturebox? The following doesn't help me: pictbox.Image = null; pictbox.Invalidate(); Please help. EDIT private void pictbox_Paint(object sender, PaintEventArgs e) ..

An established connection was aborted by the software in your host machine

[2011-04-11 13:27:36 - ddmlib]An established connection was aborted by the software in your host machine An established connection was aborted by the software in your host machin..


Is the following the most efficient in SQL to achieve its result: SELECT * FROM Customers WHERE Customer_ID NOT IN (SELECT Cust_ID FROM SUBSCRIBERS) Could some use of joins be better and achie..

How to use bootstrap-theme.css with bootstrap 3?

After downloading a complete pack of bootstrap 3 from, I noticed that there is a separate css file for theme. How to make use of it? Please explain? I included bootstrap-theme..

How to add jQuery code into HTML Page

_x000D_ _x000D_ $(".icon-bg").click(function () {_x000D_ $(".btn").toggleClass("active");_x000D_ $(".icon-bg").toggleClass("active");_x000D_ $(".container").toggleClass("active");_x000D_ ..

What is the simplest and most robust way to get the user's current location on Android?

The LocationManager API on Android seems like it's a bit of a pain to use for an application that only needs an occasional and rough approximation of the user's location. The app I'm working on isn't..

Push eclipse project to GitHub with EGit

I am successfully pushing my project to GitHub using EGit. My repository is called HelloWorld. My project in eclipse is also called HelloWorld. My problem is when i push the project it is upload the p..

How to get the indexpath.row when an element is activated?

I have a tableview with buttons and I want to use the indexpath.row when one of them is tapped. This is what I currently have, but it always is 0 var point = Int() func buttonPressed(sender: AnyObjec..

Can a foreign key refer to a primary key in the same table?

I just think that the answer is false because the foreign key doesn't have uniqueness property. But some people said that it can be in case of self joining the table. I am new to SQL. If its true ple..

Android: How to change the ActionBar "Home" Icon to be something other than the app icon?

My application's main icon consists of two parts in one image: a logo and a few letters below it. This works well for the launcher icon for the app, but when the icon appears on the left edge of the A..

Difference between except: and except Exception as e: in Python

Both the following snippets of code do the same thing. They catch every exception and execute the code in the except: block Snippet 1 - try: #some code that may throw an exception except: #..

how to avoid a new line with p tag?

How can I stay on the same line while working with <p> tag?..

How do you query for "is not null" in Mongo?

I would like to execute a following query: db.mycollection.find(HAS IMAGE URL) What should be the correct syntax?..

Android emulator: How to monitor network traffic?

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

Static methods in Python?

Is it possible to have static methods in Python which I could call without initializing a class, like: ClassName.static_method() ..

Make child div stretch across width of page

Suppose I have the following HTML code: <div id="container" style="width: 960px"> <div id="help_panel" style="width: 100%; margin: 0 auto;"> Content goes here. </div> &l..

How do I insert values into a Map<K, V>?

I am trying to create a map of strings to strings. Below is what I've tried but neither method works. What's wrong with it? public class Data { private final Map<String, String> data = new ..

Can a unit test project load the target application's app.config file?

I am unit testing a .NET application (.exe) that uses an app.config file to load configuration properties. The unit test application itself does not have an app.config file. When I try to unit tes..

Select row with most recent date per user

I have a table ("lms_attendance") of users' check-in and out times that looks like this: id user time io (enum) 1 9 1370931202 out 2 9 1370931664 out 3 6 1370932128 out 4 12 ..

How to compress an image via Javascript in the browser?

TL;DR; Is there a way to compress an image (mostly jpeg, png and gif) directly browser-side, before uploading it ? I'm pretty sure JavaScript can do this, but I can't find a way to achieve it. Here..

Select distinct rows from datatable in Linq

I am trying to get distinct rows based on multiple columns (attribute1_name, attribute2_name) and get datarows from datatable using Linq-to-Dataset. I want results like this attribute1_name att..

How do I get a UTC Timestamp in JavaScript?

While writing a web application, it makes sense to store (server side) all datetimes in the DB as UTC timestamps. I was astonished when I noticed that you couldn't natively do much in terms of Timezo..

Meaning of tilde in Linux bash (not home directory)

First off, I know that ~/ is the home directory. CDing to ~ or ~/ takes me to the home directory. However, cd ~X takes me to a special place, where X seems to be anything. In bash, if I hit "cd ~" a..

Google Maps API v2: How to make markers clickable?

How to I make the markers in Android Google Maps API v2 become clickable so they will either bring up a menu with options or just start a new activity? I believe I made the markers in my app currently..

Minimum 6 characters regex expression

I m looking for regex which checks for at least 6 characters, regardless of which type of character...

How can I get the console logs from the iOS Simulator?

I want to see what happens in the iOS Simulator if I'm not testing the app in Xcode. For example, if I open a link in the Safari simulator, see what happens in the console, or if I install a web-app,..

ng-if check if array is empty

The API I am working with returns this if there are no items in the array items: [] If there are items in the array it returns something like items: [ { name: 'Bla' } ] In my template I ..

How does @synchronized lock/unlock in Objective-C?

Does @synchronized not use "lock" and "unlock" to achieve mutual exclusion? How does it do lock/unlock then? The output of the following program is only "Hello World". @interface MyLock: NSLock<N..

How to search a string in another string?

Possible Duplicate: How to see if a substring exists inside another string in Java 1.4 How would I search for a string in another string? This is an example of what I'm talking about: Str..

How to open this .DB file?

I have a few database files with .db extension and I want to take a peek. However I don't know what program should I use to open the files. I've found a similar quesiton that says checking the header ..

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

Difference between jQuery .hide() and .css("display", "none")

Is there any difference between jQuery('#id').show() and jQuery('#id').css("display","block") and jQuery('#id').hide() and jQuery('#id').css("display","none") ..

RegEx to exclude a specific string constant

Can regular expression be utilized to match any string except a specific string constant let us say "ABC" ? Is this possible to exclude just one specific string constant? Thanks your help in advance...

Example use of "continue" statement in Python?

The definition of the continue statement is: The continue statement continues with the next iteration of the loop. I can't find any good examples of code. Could someone suggest some simple ca..

SQL Server - Return value after INSERT

I'm trying to get a the key-value back after an INSERT-statement. Example: I've got a table with the attributes name and id. id is a generated value. INSERT INTO table (name) VALUES('bob'); N..

Remote origin already exists on 'git push' to a new repository

I have my project on GitHub at some location, [email protected]:myname/oldrep.git. Now I want to push all my code to a new repository at some other location, [email protected]:newname/newrep.git. I used t..

How to perform a mysqldump without a password prompt?

I would like to know the command to perform a mysqldump of a database without the prompt for the password. REASON: I would like to run a cron job, which takes a mysqldump of the database once everyda..

Difference between iCalendar (.ics) and the vCalendar (.vcs)

I want to send booking information through mail in an attachment to add in MS Outlook. Which format is better? Especially for MS Outlook 2003?..

How to combine two strings together in PHP?

I don't actually know how to describe what I wanted but I'll show you: For example: $data1 = "the color is"; $data2 = "red"; What should I do (or process) so $result is the combination of $data1 a..

jQuery Date Picker - disable past dates

I am trying to have a date Range select using the UI date picker. in the from/to field people should not be able to view or select dates previous to the present day. This is my code: $(function() {..

What's the best way to select the minimum value from several columns?

Given the following table in SQL Server 2005: ID Col1 Col2 Col3 -- ---- ---- ---- 1 3 34 76 2 32 976 24 3 7 235 3 4 245 1 792 What ..

Iterate through a HashMap

What's the best way to iterate over the items in a HashMap?..

Android Push Notifications: Icon not displaying in notification, white square shown instead

My app generates a notification, but the icon I set for that notification is not being displayed. Instead, I get a white square. I have tried resizing the png of the icon (dimensions 720x720, 66x66, 4..

Remove characters from a string

What are the different ways I can remove characters from a string in JavaScript?..

Only using @JsonIgnore during serialization, but not deserialization

I have a user object that is sent to and from the server. When I send out the user object, I don't want to send the hashed password to the client. So, I added @JsonIgnore on the password property, but..

Unsuccessful append to an empty NumPy array

I am trying to fill an empty(not np.empty!) array with values using append but I am gettin error: My code is as follows: import numpy as np result=np.asarray([np.asarray([]),np.asarray([])]) result[..

How do I specify the exit code of a console application in .NET?

I have a trivial console application in .NET. It's just a test part of a larger application. I'd like to specify the "exit code" of my console application. How do I do this?..

Is there a way to specify a max height or width for an image?

I'd like to have an image to have either a height of 725 or a width of 500 and maintain it's aspect ratio. When I have images with a height of over 725 and thinner than 500 they get stretched out to ..

How can I check the current status of the GPS receiver?

How can I check the current status of the GPS receiver? I already checked the LocationListener onStatusChanged method but somehow it seems that is not working, or just the wrong possibility. Basicall..

How to change the bootstrap primary color?

Is it possible to change the bootstrap primary color to match to the brand color? I am using bootswatch's paper theme in my case. ..

Assignment inside lambda expression in Python

I have a list of objects and I want to remove all objects that are empty except for one, using filter and a lambda expression. For example if the input is: [Object(name=""), Object(name="fake_name..

difference between @size(max = value ) and @min(value) @max(value)

I want to do some domain validation in my object I am having one integer, now my question is: if I write @Min(SEQ_MIN_VALUE) @Max(SEQ_MAX_VALUE) private Integer sequence; and @Size(min = 1, max = NA..

jQuery multiple events to trigger the same function

Is there a way to have keyup, keypress, blur, and change events call the same function in one line or do I have to do them separately? The problem I have is that I need to validate some data with a d..


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

See line breaks and carriage returns in editor

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

Creating your own header file in C

Can anyone explain how to create a header file in C with a simple example from beginning to end...

How to uninstall a package installed with pip install --user

There is a --user option for pip which can install a Python package per user: pip install --user [python-package-name] I used this option to install a package on a server for which I do not have ro..

Assign multiple values to array in C

Is there any way to do this in a condensed form? GLfloat coordinates[8]; ... coordinates[0] = 1.0f; coordinates[1] = 0.0f; coordinates[2] = 1.0f; coordinates[3] = 1.0f; coordinates[4] = 0.0f; coordin..

How to do Base64 encoding in node.js?

Does node.js have built-in base64 encoding yet? The reason why I ask this is that final() from crypto can only output hex, binary or ascii data. For example: var cipher = crypto.createCipheriv('des-..

event.returnValue is deprecated. Please use the standard event.preventDefault() instead

I have this script: <script> $(document).ready(function () { $("#changeResumeStatus").click(function () { $.get("{% url 'main:changeResumeStatus' %}", function (data) { ..

Angular 2 two way binding using ngModel is not working

Can't bind to 'ngModel' since it isn't a know property of the 'input' element and there are no matching directives with a corresponding property Note: im using alpha.31 import { Component, View, boo..

How can I clear or empty a StringBuilder?

I'm using a StringBuilder in a loop and every x iterations I want to empty it and start with an empty StringBuilder, but I can't see any method similar to the .NET StringBuilder.Clear in the documenta..

How do I get the max ID with Linq to Entity?

I have a table User which has an identity column UserID, now what is the correct Linq to Entity line of code that would return me the max UserID? I've tried: using (MyDBEntities db = new MyDBEntitie..

Cast object to T

I'm parsing an XML file with the XmlReader class in .NET and I thought it would be smart to write a generic parse function to read different attributes generically. I came up with the following functi..

How to select specified node within Xpath node sets by index with Selenium?

I'm writing a Selenium testcase. And here's the xpath expression I use to match all 'Modify' buttons within a data table. //img[@title='Modify'] My question is, how can I visit the matched node set..

How do I suspend painting for a control and its children?

I have a control which I have to make large modifications to. I'd like to completely prevent it from redrawing while I do that - SuspendLayout and ResumeLayout aren't enough. How do I suspend painti..

How to make a <svg> element expand or contract to its parent container?

The goal is to have the <svg> element expand to the size of its parent container, in this case a <div>, no matter how big or small that container may be. The code: <style> svg,..

Convert Bitmap to File

I understand that using BitmapFactory can convert a File to a Bitmap, but is there any way to convert a Bitmap image to a File?..

Auto select file in Solution Explorer from its open tab

Normally, many files in Visual Studio 2010 are opened in many tabs, while massively working on a project. Many times, I find myself right-clicking on a tab title and searching for Show/Selec..

FIX CSS <!--[if lt IE 8]> in IE

How can I use this: <!--[if lt IE 8]> <style type='text/css'> #header ul#h-menu li a{font-weight:normal!important} </style> <![endif]--> If I remove <..

How to markdown nested list items in Bitbucket?

I'm trying to see my markdown nested list items rendered with corresponding indentation when viewed in a browser live from the Bitbucket pages. But I can't figure out how it works even when using thei..

How to Generate a random number of fixed length using JavaScript?

I'm trying to generate a random number that must have a fixed length of exactly 6 digits. I don't know if JavaScript has given below would ever create a number less than 6 digits? Math.floor((Math.r..

what is the difference between $_SERVER['REQUEST_URI'] and $_GET['q']?

what is the difference between $_SERVER['REQUEST_URI'] and $_GET['q'] (which is used in Drupal)?..

Hide div if screen is smaller than a certain width

I want to hide a floating div if the user screen is < 1024px as it will overlay with my blog content area. I found this jQuery on the net but I am not sure how to use it. $(document).ready(functio..

Assigning the output of a command to a variable

I am new with unix and I am writing a shell script. When I run this line on the command prompt, it prints the total count of the number of processes which matches: ps -ef | awk '/siebsvc –s siebs..

How to set bootstrap navbar active class with Angular JS?

If I have a navbar in bootstrap with the items Home | About | Contact How do I set the active class for each menu item when they are active? That is, how can I set class="active" when the angular r..

How can I drop a "not null" constraint in Oracle when I don't know the name of the constraint?

I have a database which has a NOT NULL constraint on a field, and I want to remove this constraint. The complicating factor is that this constraint has a system-defined name, and that constraint's na..

How to acces external json file objects in vue.js app

How to access JSON objects in the vue.js app I am new in this import json from './json/data.json' the JSON file is loaded and now I have to access the objects within it ..

How to list the properties of a JavaScript object?

Say I create an object thus: var myObject = {"ircEvent": "PRIVMSG", "method": "newURI", "regex": "^http://.*"}; What is the best way to retrieve a list of the property names? i.e. I would l..