Questions Tagged with #In clause

IN Clause with NULL or IS NULL

Postgres is the database Can I use a NULL value for a IN clause? example: SELECT * FROM tbl_name WHERE id_field IN ('value1', 'value2', 'value3', NULL) I want to limit to these four values. I hav..

PreparedStatement IN clause alternatives?

What are the best workarounds for using a SQL IN clause with instances of java.sql.PreparedStatement, which is not supported for multiple values due to SQL injection attack security issues: One ? plac..

Linq to Entities - SQL "IN" clause

In T-SQL you could have a query like: SELECT * FROM Users WHERE User_Rights IN ("Admin", "User", "Limited") How would you replicate that in a LINQ to Entities query? Is it even possible?..

SQLAlchemy IN clause

I'm trying to do this query in sqlalchemy SELECT id, name FROM user WHERE id IN (123, 456) I would like to bind the list [123, 456] at execution time...

How to put more than 1000 values into an Oracle IN clause

Is there any way to get around the Oracle 10g limitation of 1000 items in a static IN clause? I have a comma delimited list of many of IDs that I want to use in an IN clause, Sometimes this list can..

PreparedStatement with list of parameters in a IN clause

How to set value for in clause in a preparedStatement in JDBC while executing a query. Example: connection.prepareStatement("Select * from test where field in (?)"); If this in-clause can hold mul..

SQL Server - In clause with a declared variable

Let say I got the following : DECLARE @ExcludedList VARCHAR(MAX) SET @ExcludedList = 3 + ', ' + 4 + ' ,' + '22' SELECT * FROM A WHERE Id NOT IN (@ExcludedList) Error : Conversion failed when conv..

How to get column values in one comma separated value

I have a table which contains rows like below ID User Department 1 User1 Admin 2 User1 Accounts 3 User2 Finance 4 User3 Sales 5 User3 Finance I need a select que..

What is console.log?

What is the use of console.log? Please explain how to use it in JavaScript, with a code example...

How to get a table cell value using jQuery?

I am trying to work out how to get the value of table cell for each row using jQuery. My table looks like this: <table id="mytable"> <tr> <th>Customer Id</th> <t..

How to cast or convert an unsigned int to int in C?

My apologies if the question seems weird. I'm debugging my code and this seems to be the problem, but I'm not sure. Thanks!..

Creating a batch file, for simple javac and java command execution

It is a really simple thing but I cannot get my head around it. I have looked at plenty of StackOverFlow post and as well as on internet. My goal is to create a .bat which will open cmd and execute m..

JSONObject - How to get a value?

I'm using a java class on http://json.org/javadoc/org/json/JSONObject.html. The following is my code snippet: String jsonResult = UtilMethods.getJSON(this.jsonURL, null); json = new JSONObject(jsonRes..

How to compare two NSDates: Which is more recent?

I am trying to achieve a dropBox sync and need to compare the dates of two files. One is on my dropBox account and one is on my iPhone. I came up with the following, but I get unexpected results. I ..

How to install pkg config in windows?

I am trying to do it, but all I can get is some source code that I don't know how to do deal with I downloaded from http://pkgconfig.freedesktop.org/releases/ . Any help?..

Stopping a CSS3 Animation on last frame

I have a 4 part CSS3 animation playing on click - but the last part of the animation is meant to take it off the screen. However, it always goes back to its original state once it has played. Anyon..

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

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

Force a screen update in Excel VBA

My Excel tool performs a long task, and I'm trying to be kind to the user by providing a progress report in the status bar, or in some cell in the sheet, as shown below. But the screen doesn't refresh..

How can I add new dimensions to a Numpy array?

I'm starting off with a numpy array of an image. In[1]:img = cv2.imread('test.jpg') The shape is what you might expect for a 640x480 RGB image. In[2]:img.shape Out[2]: (480, 640, 3) However, thi..

How to discover number of *logical* cores on Mac OS X?

How can you tell, from the command line, how many cores are on the machine when you're running Mac OS X? On Linux, I use: x=$(awk '/^processor/ {++n} END {print n+1}' /proc/cpuinfo) It's not perfe..

The provider is not compatible with the version of Oracle client

I'm trying to use the Oracle ODP.NET 11g (11.1.0.6.20) Instant Client on my ASP.net project as a Data Provider but when I run the aspx page I get a "The provider is not compatible with the version of ..

Changing the browser zoom level

I have need to create 2 buttons on my site that would change the browser zoom level (+) (-). I'm requesting browser zoom and not css zoom because of image size and layout issues. Well, is this even p..

Git push: "fatal 'origin' does not appear to be a git repository - fatal Could not read from remote repository."

I know similar questions have already been asked. But, I believe my issue is due to a mistake I have previously made and therefore is different: let me explain. Everything was working smoothly, as I..

Setting Curl's Timeout in PHP

I'm running a curl request on an eXist database through php. The dataset is very large, and as a result, the database consistently takes a long amount of time to return an XML response. To fix that, w..

How do I convert 2018-04-10T04:00:00.000Z string to DateTime?

I get a date from a JSON API which looks like this "2018-04-10T04:00:00.000Z". I want to convert it in order to obtain a Date or String object and get something like "01-04-2018" that its "dd-MM-YYYY"..

find index of an int in a list

Is there a way to get the index of an int from a list? Looking for something like list1.FindIndex(5) where I want to find the position of 5 in the list...

How to set combobox default value?

In windows form, It has a ComboBox, Which have data binded by the DataSource. When going to set the text property for a ComboBox. Selected ComboBox -> Property -> Text : "--Select--". Design ..

jQuery callback for multiple ajax calls

I want to make three ajax calls in a click event. Each ajax call does a distinct operation and returns back data that is needed for a final callback. The calls themselves are not dependent on one anot..

How to place and center text in an SVG rectangle

I have the following rectangle... <rect x="0px" y="0px" width="60px" height="20px"/> I would like to center the word "Fiction" inside of it. For other rectangles, does svg word wrap to stay w..

SQL using sp_HelpText to view a stored procedure on a linked server

Anyone have an idea about how to use sp_helptext to view a stored procedure on a linked server? basically something like this. I don't have the credentials to that linked server to look at it. EXEC ..

Convert to Datetime MM/dd/yyyy HH:mm:ss in Sql Server

How to convert given date format to MM/dd/yyyy HH:mm:ss I tried this one below but not achieved. Can anyone help me? SELECT CONVERT(VARCHAR(20), GETDATE(), 120) ..

Swift 3: Display Image from URL

In Swift 3, I am trying to capture an image from the internet, and have these lines of code: var catPictureURL = NSURL(fileURLWithPath: "http://i.imgur.com/w5rkSIj.jpg") var catPictureData = NSData(c..

Changing cell color using apache poi

I'm using Apache POI to read data in a spreadsheet of part numbers. I look up the part number in our database, if we have a CAD drawing of the part I color the part number cell green, if we don't I c..

How to push both key and value into an Array in Jquery

I am reading RSS feed and pushing both Title and Link into an Array in Jquery. What i did is var arr = []; $.getJSON("displayjson.php",function(data){ $.each(data.news,..

Intellisense and code suggestion not working in Visual Studio 2012 Ultimate RC

I have just downloaded and installed Visual Studio 2012 Ultimate RC, but I'm having an issue with the intellisense: it does not work until I press Ctrl+Space. Code suggestions are disabled also (metho..

CSS: create white glow around image

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

Maven error "Failure to transfer..."

I am trying to set up a project using Maven (m2eclipse), but I get this error in Eclipse: Description Resource Path Location Type Could not calculate build plan: Failure to transfer ..

How to create a custom string representation for a class object?

Consider this class: class foo(object): pass The default string representation looks something like this: >>> str(foo) "<class '__main__.foo'>" How can I make this display a c..

Which characters are valid in CSS class names/selectors?

What characters/symbols are allowed within the CSS class selectors? I know that the following characters are invalid, but what characters are valid? ~ ! @ $ % ^ & * ( ) + = , . / ' ; : " ? > &..

Close Form Button Event

in my application, the user is first presented with the log in screen, and the form that shows up after you log in has a Menu Bar. On that menu bar are 2 items: "log out" and "exit". If the user selec..

What is the difference between a database and a data warehouse?

What is the difference between a database and a data warehouse? Aren't they the same thing, or at least written in the same thing (ie. Oracle RDBMS)?..

How to replace case-insensitive literal substrings in Java

Using the method replace(CharSequence target, CharSequence replacement) in String, how can I make the target case-insensitive? For example, the way it works right now: String target = "FooBar"; targ..

Select objects based on value of variable in object using jq

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

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

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

Why is C so fast, and why aren't other languages as fast or faster?

In listening to the StackOverflow podcast, the jab keeps coming up that "real programmers" write in C, and that C is so much faster because it's "close to the machine." Leaving the former assertion fo..

Formatting html email for Outlook

I have an html newsletter which works in most email clients, but the formatting is messed up in Outlook. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4..

C Programming: How to read the whole file contents into a buffer

I want to write the full contents of a file into a buffer. The file actually only contains a string which i need to compare with a string. What would be the most efficient option which is portable ev..

java.lang.ClassNotFoundException: javax.servlet.jsp.jstl.core.Config

When I am run my application after entering the URL, this exception is coming.I am using Eclipse and Tomcat7.0.35. I also added Jstl.jar and jstl1.2.jar My code is java.lang.ClassNotFoundException: ..

jQuery Set Selected Option Using Next

How can I, using jQuery, set the "next" item of an already selected item as "selected." For example, if I have: <select> <option value="1" >Number 1</option> <option value..

Where is the Keytool application?

I need to use mapview control in android and I can't seem to understand how to run keytool. Is it installed with eclipse? I can't seem to find a download link. Thanks..

Static method in a generic class?

In Java, I'd like to have something as: class Clazz<T> { static void doIt(T object) { // ... } } But I get Cannot make a static reference to the non-static type T I don't understand..

How to loop through all the properties of a class?

I have a class. Public Class Foo Private _Name As String Public Property Name() As String Get Return _Name End Get Set(ByVal value As String) _..

PHP import Excel into database (xls & xlsx)

I tried to search for some plugins to import Excel file into MySQL database, one of them is http://code.google.com/p/php-excel-reader/ The tool is so powerful that it displays the entire excel conten..

Javascript - Get Image height

I need to display a bunch of images on a web page using AJAX. All of them have different dimensions, so I want to adjust their size before displaying them. Is there any way to do this in JavaScript? ..

How can I capitalize the first letter of each word in a string?

s = 'the brown fox' ...do something here... s should be: 'The Brown Fox' What's the easiest way to do this?..

How to SELECT WHERE NOT EXIST using LINQ?

I have to list all "shift" data to be assigned to an "employee" but shift data must not be included if it is already existing in employee's data. Let's see the image sample. This query solves the..

Convert a timedelta to days, hours and minutes

I've got a timedelta. I want the days, hours and minutes from that - either as a tuple or a dictionary... I'm not fussed. I must have done this a dozen times in a dozen languages over the years but P..

Rollback transaction after @Test

First of all, I've found a lot of threads on StackOverflow about this, but none of them really helped me, so sorry to ask possibly duplicate question. I'm running JUnit tests using spring-test, my co..

C programming in Visual Studio

Can I use Visual Studio to learn C programming? In the new project menu I can choose between Visual Basic, Visual C#, Visual C++, Visual F# and others but I don't see "C" or "Visual C"...

Getting Serial Port Information

I have some code that loads the serial ports into a combo-box: List<String> tList = new List<String>(); comboBoxComPort.Items.Clear(); foreach (string s in SerialPort.Ge..

How to get index of an item in java.util.Set

I know the differences between Set and List(unique vs. duplications allowed, not ordered/ordered, etc). What I'm looking for is a set that keeps the elements ordered(that's easy), but I also need to b..

Run C++ in command prompt - Windows

I know that everyone uses an IDE nowadays, but I just find it simpler to write my code in notepad++, compile it using a command prompt command, and run it from there too. At least that works for Java ..

vector vs. list in STL

I noticed in Effective STL that vector is the type of sequence that should be used by default. What's does it mean? It seems that ignore the efficiency vector can do anything. Could anybody..

Java: Integer equals vs. ==

As of Java 1.5, you can pretty much interchange Integer with int in many situations. However, I found a potential defect in my code that surprised me a bit. The following code: Integer cdiCt = ...;..

Can't include C++ headers like vector in Android NDK

When I try to include any C++ class like vector in my Android NDK project (using NDK r5b, the latest), I get an error like the following... Compile++ thumb : test-libstl <= test-libstl.cpp /Users..

What is the difference between "SMS Push" and "WAP Push"?

The terms WAP Push and SMS Push seems to both be used when talking about pushing messages to a mobile application to trigger download of WAP content. Do the terms refer to the same mechanism or do th..

PostgreSQL: how to convert from Unix epoch to date?

The statement gives me the date and time. How could I modify the statement so that it returns only the date (and not the time)? SELECT to_timestamp( TRUNC( CAST( epoch_ms AS bigint ) / 1000 ) ); ..

Use URI builder in Android or create URL with variables

I'm developing an Android app. I need to build a URI for my app to make an API request. Unless there's another way to put a variable in a URI, this is the easiest way I've found. I found that you need..

Delete everything in a MongoDB database

I'm doing development on MongoDB. For totally non-evil purposes, I sometimes want to blow away everything in a database—that is, to delete every single collection, and whatever else might be lying a..

'git status' shows changed files, but 'git diff' doesn't

I've had a look at all similar questions. However, I've double checked and something strange is definitely happening. On one server (Solaris with Git 1.8.1) I cloned the Git repository then copied th..

pgadmin4 : postgresql application server could not be contacted.

I have installed PostgreSQL 9.6.2 on my Windows 8.1. But the pgadmin4 is not able to contact the local server. I have tried several solutions suggested here in stackoverflow, tried to uninstall and re..

Creating a comma separated list from IList<string> or IEnumerable<string>

What is the cleanest way to create a comma-separated list of string values from an IList<string> or IEnumerable<string>? String.Join(...) operates on a string[] so can be cumbersome to wo..

addEventListener in Internet Explorer

What is the equivalent to the Element Object in Internet Explorer 9? if (!Element.prototype.addEventListener) { Element.prototype.addEventListener = function() { .. } } How does it works in I..

How to clear form after submit in Angular 2?

I have some simple angular 2 component with template. How to clear form and all fields after submit?. I can't reload page. After set data with date.setValue('') field is stil touched. import {Compon..

SSRS - Checking whether the data is null

I've the following expression in my report. =FormatNumber(MAX(Fields!Reading.Value, "CellReading_Reading"),3) Now when the dataset is empty 'Fields!Reading.Value' becomes empty and finding their ma..

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

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

How can I plot with 2 different y-axes?

I would like superimpose two scatter plots in R so that each set of points has its own (different) y-axis (i.e., in positions 2 and 4 on the figure) but the points appear superimposed on the same figu..

How to save user input into a variable in html and js

i am making a game and at the start it asks for your name. I want this name to be saved as varible. i have this html code: <form id="form" onsubmit="return false;"> <input style=position:a..

Remove trailing comma from comma-separated string

I got String from the database which have multiple commas (,) . I want to remove the last comma but I can't really find a simple way of doing it. What I have: kushalhs, mayurvm, narendrabz, What I w..

Repair all tables in one go

How to check all the tables in the database in one go? Rather than typing the query check table ''tablename''; for all the tables one by one. Is there any simple command like check all or anything l..

Slide up/down effect with ng-show and ng-animate

I'm trying to use ng-animate to get a behavior similar to JQuery's slideUp() and slideDown(). Only I'd rather use ng-show I'm looking at the ng-animate tutorial here - http://www.yearofmoo.com/2013/0..

Get the date of next monday, tuesday, etc

I would like to find the date stamp of monday, tuesday, wednesday, etc. If that day hasn't come this week yet, I would like the date to be this week, else, next week. Thanks!..

"PKIX path building failed" and "unable to find valid certification path to requested target"

I'm trying to get tweets using twitter4j library for my java project which uses under the covers java.net.HttpURLConnection (as can be seen in stack trace). On my first run I got an error about certif..

CSS Background image not loading

I have followed all of the tutorials, which all say the say thing. I specify my background inside of body in my css style sheet, but the page just displays a blank white background. Image is in the s..

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

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

Add a column with a default value to an existing table in SQL Server

How can I add a column with a default value to an existing table in SQL Server 2000 / SQL Server 2005?..

How do I remove the file suffix and path portion from a path string in Bash?

Given a string file path such as /foo/fizzbuzz.bar, how would I use bash to extract just the fizzbuzz portion of said string?..

Is there a pretty print for PHP?

I'm fixing some PHP scripts and I'm missing ruby's pretty printer. i.e. require 'pp' arr = {:one => 1} pp arr will output {:one => 1}. This even works with fairly complex objects and makes diggi..

When doing a MERGE in Oracle SQL, how can I update rows that aren't matched in the SOURCE?

I have a main database and a report database, and I need to sync a table from main into report. However, when an item gets deleted in the main database, I only want to set an IsDeleted flag in the re..

ruby 1.9: invalid byte sequence in UTF-8

I'm writing a crawler in Ruby (1.9) that consumes lots of HTML from a lot of random sites. When trying to extract links, I decided to just use .scan(/href="(.*?)"/i) instead of nokogiri/hpricot (major..

How do I automatically set the $DISPLAY variable for my current session?

I see that $DISPLAY is set to localhost:0.0 if I am running over a vnc server this may not be correct, is there a way to automatically set it in my login script?..

Catch an exception thrown by an async void method

Using the async CTP from Microsoft for .NET, is it possible to catch an exception thrown by an async method in the calling method? public async void Foo() { var x = await DoSomethingAsync(); ..

get the margin size of an element with jquery

How can I get the properties of an element with jquery? I want to get the size of the margin of a div in particular. I have set the style of the div in a .css file, for instance, .item-form { marg..

How to compare two columns in Excel and if match, then copy the cell next to it

I've tried =IF(ISNUMBER(ISMATCH(D2,G:G,0)),H:H,"") to match numbers with a key, here are my rules: Column D (starting at D2) match with Column G (starts at D2 as well) If match, then Copy the cell..

HttpRequest maximum allowable size in tomcat?

What is the maximum data size I can send in a single HttpURLConnection to Tomcat? Is there any limitation for the request size?..

How can I access each element of a pair in a pair list?

I have a list called pairs. pairs = [("a", 1), ("b", 2), ("c", 3)] And I can access elements as: for x in pairs: print x which gives output like: ('a', 1) ('b', 2) ('c', 3) But I want to ..

How to show empty data message in Datatables

Suppose i get empty data from server sometimes, i want to display No Data found message in DataTables?. How is this possible?..

Is it possible to forward-declare a function in Python?

Is it possible to forward-declare a function in Python? I want to sort a list using my own cmp function before it is declared. print "\n".join([str(bla) for bla in sorted(mylist, cmp = cmp_configs..

How to resolve a Java Rounding Double issue

Seems like the subtraction is triggering some kind of issue and the resulting value is wrong. double tempCommission = targetPremium.doubleValue()*rate.doubleValue()/100d; 78.75 = 787.5 * 10.0/100d ..

How to execute shell command in Javascript

I want to write a JavaScript function which will execute the system shell commands (ls for example) and return the value. How do I achieve this?..

How to disable a particular checkstyle rule for a particular line of code?

I have a checkstyle validation rule configured in my project, that prohibits to define class methods with more than 3 input parameters. The rule works fine for my classes, but sometimes I have to exte..

Bootstrap 3 Collapse show state with Chevron icon

Using the core example taken from the Bootstrap 3 Javascript examples page for Collapse, I have been able to show the state of collapse using chevron icons. I have this working using: $('#accordion..

Create instance of generic type in Java?

Is it possible to create an instance of a generic type in Java? I'm thinking based on what I've seen that the answer is no (due to type erasure), but I'd be interested if anyone can see something I'm ..

set value of input field by php variable's value

I have a simple php calculator which code is: <html> <head> <title>PHP calculator</title> </head> <body bgcolor="orange"> <h1 align..

How to Set OnClick attribute with value containing function in ie8?

My goal is to change the onclick attribute of a link. I can do it successfully, but the resulting link doesn't work in ie8. It does work in ff3. For example, this works in Firefox 3, but not IE8. Why..

Homebrew refusing to link OpenSSL

I'm on: OSX 10.11.6, Homebrew version 0.9.9m OpenSSL 0.9.8zg 14 July 2015 I'm trying to play with with dotnetcore and by following their instructions, I've upgraded/installed the latest version of ..

Partial Dependency (Databases)

I fabricated a definition that a partial dependency is when fields are indirectly dependent on the primary key or partially dependent but are also dependent on other keys that depend on the primary su..

GitLab remote: HTTP Basic: Access denied and fatal Authentication

I am on mac OS unlike this post: 'git push origin MyBranchName' throws error "HTTP Basic: Access denied" I have password configured in GitLab. I have SSL key created AFTER the..

Detecting negative numbers

I was wondering if there is any way to detect if a number is negative in PHP? I have the following code: $profitloss = $result->date_sold_price - $result->date_bought_price; I need to find o..

Postgres "psql not recognized as an internal or external command"

For Postgres, I keep getting this error multiple times even though I have already set the location of the bin folder to the path variable in Windows 8. Is there something else I'm missing? (I can't p..

How to list installed packages from a given repo using yum

I want to list all packages I have installed on a system from a given repo using yum. Usually to do this I use yum list installed | grep "something". But now I am faced with a problem. The repo I am i..

Javascript receipt printing using POS Printer

In a web application I want to print a receipt using a POS (Point of Sale) Printer. I want to do that with Javascript. Can anyone provide me an example for that?..

PowerShell To Set Folder Permissions

I am trying to use the "default" options in applying folder permissions; by that, I mean that using the "Full Controll, Write, Read, etc" in the 'Properties' for a folder. The following script works ..

Is there any way to call a function periodically in JavaScript?

Is there any way to call a function periodically in JavaScript?..

How to select rows in a DataFrame between two values, in Python Pandas?

I am trying to modify a DataFrame df to only contain rows for which the values in the column closing_price are between 99 and 101 and trying to do this with the code below. However, I get the error ..

Rails 4 - passing variable to partial

I am following the Ruby on Rails tutorial and have come across a problem while trying to pass variables to partials. My _user partial is as follows <li> <%= gravatar_for user, size: 52 %&..

Generating a SHA-256 hash from the Linux command line

I know the string "foobar" generates the SHA-256 hash c3ab8ff13720e8ad9047dd39466b3c8974e592c2fa383d4a3960714caef0c4f2 using http://hash.online-convert.com/sha256-generator However the command line s..

rails simple_form - hidden field - create?

How can you have a hidden field with simple form? The following code: = simple_form_for @movie do |f| = f.hidden :title, "some value" = f.button :submit results in this error: undefined metho..

Visual Studio: How to break on handled exceptions?

I would like Visual Studio to break when a handled exception happens (i.e. I don't just want to see a "First chance" message, I want to debug the actual exception). e.g. I want the debugger to break ..

Multi-Line Comments in Ruby?

How can I comment multiple lines in Ruby?..

Python: maximum recursion depth exceeded while calling a Python object

I've built a crawler that had to run on about 5M pages (by increasing the url ID) and then parses the pages which contain the info' I need. after using an algorithm which run on the urls (200K) and s..

Error:(23, 17) Failed to resolve: junit:junit:4.12

Why is it that every time I create a new project in Android Studio, it always comes up with: Error:(23, 17) Failed to resolve: junit:junit:4.12? When I remove testCompile 'junit:junit:4.12' in d..

Shell script to capture Process ID and kill it if exist

I tried this code and it is not working #!/bin/sh #Find the Process ID for syncapp running instance PID=`ps -ef | grep syncapp 'awk {print $2}'` if [[ -z "$PID" ]] then Kill -9 PID fi It is show..

Cannot obtain value of local or argument as it is not available at this instruction pointer, possibly because it has been optimized away

Visual Studio 2010 kills (there is no other word) data in one of the arguments of the function in the unsafe block. What could cause this error? The following message shows by the debugger. Cannot o..

How to wait 5 seconds with jQuery?

I'm trying to create an effect where the page loads, and after 5 seconds, the success message on the screen fades out, or slides up. How can I achieve this?..

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 java.io.*; import java.util.*; import java.security.*; import j..

Python creating a dictionary of lists

I want to create a dictionary whose values are lists. For example: { 1: ['1'], 2: ['1','2'], 3: ['2'] } If I do: d = dict() a = ['1', '2'] for i in a: for j in range(int(i), int(i) + 2..

$this->session->set_flashdata() and then $this->session->flashdata() doesn't work in codeigniter

Please take a look at the following code: $this->session->set_flashdata('message', 'This is a message.'); var_dump($this->session->flashdata('message')); It returns bool(false). I hope..

How to convert comma-separated String to List?

Is there any built-in method in Java which allows us to convert comma separated String to some container (e.g array, List or Vector)? Or do I need to write custom code for that? String commaSeparated ..

Check if value exists in Postgres array

Using Postgres 9.0, I need a way to test if a value exists in a given array. So far I came up with something like this: select '{1,2,3}'::int[] @> (ARRAY[]::int[] || value_variable::int) But I k..

Android intent for playing video?

I'm trying to play video's on Android, by launching an intent. The code I'm using is: tostart = new Intent(Intent.ACTION_VIEW); tostart.setDataAndType(Uri.parse(movieurl), "video/*"); startActivity(t..

Interface/enum listing standard mime-type constants

I am looking among the standard libraries (like apache commons, jax, jboss, javax) for an interface or enum that lists the values of all the standard mime-type (aka content-type). This interface shou..

Convert String to System.IO.Stream

I need to convert a String to System.IO.Stream type to pass to another method. I tried this unsuccessfully. Stream stream = new StringReader(contents); ..

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

Google Maps API v3: How do I dynamically change the marker icon?

Using Google Maps API v3, how do I programmatically change the marker icon? What I would like to do is, when someone hovers over a link - to have the corresponding marker icon on the map change color..

Checking if a key exists in a JS object

I have the following JavaScript object: var obj = { "key1" : val, "key2" : val, "key3" : val } Is there a way to check if a key exists in the array, similar to this? testArray = jQuery..

Display unescaped HTML in Vue.js

How can I manage to get HTML interpreted inside a mustache binding? At the moment the break (<br />) is just displayed/escaped. Small Vue app: var logapp = new Vue({ el: '#logapp', data: {..

Where is Maven Installed on Ubuntu

I installed maven on my Ubuntu machine with the command sudo apt-get install maven Now I need to know where it is installed in order to configure the same in IntelliJ....

MessageBox with YesNoCancel - No & Cancel triggers same event

I have a message box with the YesNoCancel buttons... Pressing Yes will do some action and close the application - works fine Pressing No will do nothing and close the application - (see below) Press..

Memory Allocation "Error: cannot allocate vector of size 75.1 Mb"

In the course of vectorizing some simulation code, I've run into a memory issue. I'm using 32 bit R version 2.15.0 (via RStudio version 0.96.122) under Windows XP. My machine has 3.46 GB of RAM. >..

Difference between Node object and Element object?

I am totally confused between Node object and Element object. document.getElementById() returns Element object while document.getElementsByClassName() returns NodeList object(Collection of Elements or..

Highcharts - how to have a chart with dynamic height?

I want to have a chart that resizes with the browser window, but the problem is that the height is fixed to 400px. This JSFiddle example has the same problem. How can I do that? I tried using the cha..

Windows batch: echo without new line

What is the Windows batch equivalent of the Linux shell command echo -n which suppresses the newline at the end of the output? The idea is to write on the same line inside a loop...

No serializer found for class org.hibernate.proxy.pojo.javassist.Javassist?

I am working on SpringMVC, Hibernate & JSON but I am getting this error. HTTP Status 500 - Could not write JSON: No serializer found for class org.hibernate.proxy.pojo.javassist.JavassistLazyIni..

How to view the list of compile errors in IntelliJ?

I am looking for a way to view all compile errors in IntelliJ, similar to how they are displayed in Eclipse. I tried searching here and Google but have not really found a solution. I really like Int..

How do I connect to a Websphere Datasource with a given JNDI name?

I'm using Websphere Portal 7.0 and creating a portlet with RAD 8.0. My portlet is trying to make a db2 connection to a remote server. I wrote a java program locally to do a basic JDBC connection to th..

How to drop all stored procedures at once in SQL Server database?

Currently we use separate a drop statements for each stored procedure in the script file: IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MySP]') AND type in (N'P', N..

Replacing &nbsp; from javascript dom text node

I am processing xhtml using javascript. I am getting the text content for a div node by concatenating the nodeValue of all child nodes where nodeType == Node.TEXT_NODE. The resulting string sometimes..

OOP vs Functional Programming vs Procedural

What are the differences between these programming paradigms, and are they better suited to particular problems or do any use-cases favour one over the others? Architecture examples appreciated!..

how do I use an enum value on a switch statement in C++

I would like to use an enum value for a switch statement. Is it possible to use the enum values enclosed in "{}" as choices for the switch()"? I know that switch() needs an integer value in order to d..

Defining TypeScript callback type

I've got the following class in TypeScript: class CallbackTest { public myCallback; public doWork(): void { //doing some work... this.myCallback(); //calling callback ..

How can I repeat a character in Bash?

How could I do this with echo? perl -E 'say "=" x 100' ..

How do I get the AM/PM value from a DateTime?

The code in question is below: public static string ChangePersianDate(DateTime dateTime) { System.Globalization.GregorianCalendar PC = new System.Globalization.GregorianCalendar(); PC.Calen..

Is there any way to specify a suggested filename when using data: URI?

If for example you follow the link: data:application/octet-stream;base64,SGVsbG8= The browser will prompt you to download a file consisting of the data held as base64 in the hyperlink itself. Is th..

What is ROWS UNBOUNDED PRECEDING used for in Teradata?

I am just starting on Teradata and I have come across an Ordered Analytical Function called "Rows unbounded preceding" in Teradata. I tried several sites to learn about the function but all of them us..

Graphical HTTP client for windows

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

How to force link from iframe to be opened in the parent window

I need to open the link in the same parent page, instead of open it in a new page. note : The iframe and parent page are the same domain...

Getting error "No such module" using Xcode, but the framework is there

I'm currently coding in Swift, and I've got an error: No such module Social But I don't understand, because the module is in my project, declared in "Linked frameworks and Libraries" and in "Emb..

Array of char* should end at '\0' or "\0"?

Lets say we have an array of char pointers char* array[] = { "abc", "def" }; Now what should be put in the end ? char* array[] = { "abc", "def", '\0' }; or char* array[] = { "abc", "def", "\0" ..

Expansion of variables inside single quotes in a command in Bash

I want to run a command from a bash script which has single quotes and some other commands inside the single quotes and a variable. e.g. repo forall -c '....$variable' In this format, $ is escaped a..

Git: How to pull a single file from a server repository in Git?

I am working on a site with a server running Git. I am using Git for deployment (not GitHub). This was set up prior to my involvement using a hook method, and I referred to this question and entered t..

Auto Increment after delete in MySQL

I have a MySQL table with a primary key field that has AUTO_INCREMENT on. After reading other posts on here I've noticed people with the same problem and with varied answers. Some recommend not using ..

How to dynamically set bootstrap-datepicker's date value?

I am using bootstrap datepicker along with a line highchart. I want the datepicker date to update when the chart is zoomed. Once that event triggers I update the values of the datepicker. The values ..

Google Play app description formatting

I've made an Android application that is available on Google Play. Now I want to add some more formatting to my app description (eg. indent, links, lists..). But I cannot find any website where possib..

Php - Your PHP installation appears to be missing the MySQL extension which is required by WordPress

How do I fix the error below? Your PHP installation appears to be missing the MySQL extension which is required by WordPress. I use my NAS with a telnet connection. I installed FFP 0.7 My php...

Android: making a fullscreen application

What is the simplest change that I can make to a new Blank Activity, as created by the latest version of Android Studio, to get the app to appear fullscreen? I want to create a fullscreen Android app..

Can't find the 'libpq-fe.h header when trying to install pg gem

I am using the Ruby on Rails 3.1 pre version. I like to use PostgreSQL, but the problem is installing the pg gem. It gives me the following error: $ gem install pg Building native extensions. This c..

Custom method names in ASP.NET Web API

I'm converting from the WCF Web API to the new ASP.NET MVC 4 Web API. I have a UsersController, and I want to have a method named Authenticate. I see examples of how to do GetAll, GetOne, Post, and De..

Parse a URI String into Name-Value Collection

I've got the URI like this: https://google.com.ua/oauth/authorize?client_id=SS&response_type=code&scope=N_FULL&access_type=offline&redirect_uri=http://localhost/Callback I need a coll..

How to capture a backspace on the onkeydown event

I have a function that is triggered by the onkeydown event of a textbox. How can I tell if the user has hit either the backspace key or the del key?..

Exit a while loop in VBS/VBA

Is there a method of exiting/breaking a while in VBS/VBA? Following code won't work as intended: num = 0 while (num < 10) if (status = "Fail") then exit while end if num = n..

Javascript/jQuery detect if input is focused

How do I detect when .click event triggers if textarea is already focused? I have this jquery: $(".status").on("click","textarea",function(){ if ($(this) == "focused") { // fire ..

How to put an image next to each other

I'm trying to put these two 'hyperlinked' icons next to each other but I can't seem to do that. As you can see, the twitter icon falls to the next line.. (they are both hyperlinked to their respective..

Get human readable version of file size?

A function to return human readable size from bytes size: >>> human_readable(2048) '2 kilobytes' >>> How to do this?..

A div with auto resize when changing window width\height

I've looked everywhere . and still couldn't come up with sample code of a very "basic" idea: A div that is taking 90% of the screen size and it is adjusting itself whenever the browser size changes ..

Convert DateTime to TimeSpan

I want to convert a DateTime instance into a TimeSpan instance, is it possible? I've looked around but I couldn't find what I want, I only find time difference. More specifically, I want to convert ..

Node.js - get raw request body using Express

When I use Express, and my code is: app.use(express.bodyParser()); How would I get the raw request body?..

After Spring Boot 2.0 migration: jdbcUrl is required with driverClassName

SOLVED: My solution: I delete dataSource() method from DatabaseConfig.java. Then, the application was started successfully :) I've just updated my Spring Boot project from 1.5.x to 2.0.0. Before the ..

How to extract .war files in java? ZIP vs JAR

I have a web program where I want the user to be able to import a .war file and I can extract certain files out of the .war file. I have found two class libraries: java.util.zip.* and java.util.jar...

Using Excel as front end to Access database (with VBA)

I am building a small application for a friend and they'd like to be able to use Excel as the front end. (the UI will basically be userforms in Excel). They have a bunch of data in Excel that they wou..

How can I find my Apple Developer Team id and Team Agent Apple ID?

I am trying to transfer an app. I am having troubles finding my team agent apple id and my team id. I have found it before and I have searched for 30 min without any luck now that i need it. The pe..

Submit form and stay on same page?

I have a form that looks like this <form action="receiver.pl" method="post"> <input name="signed" type="checkbox"> <input value="Save" type="submit"> </form> and I would..

How can I debug what is causing a connection refused or a connection time out?

I have the following code that has worked for about a year: import urllib2 req = urllib2.Request('https://somewhere.com','<Request></Request>') data = urllib2.urlopen(req) print data.rea..

How can I count the numbers of rows that a MySQL query returned?

How can I count the number of rows that a MySQL query returned?..

Execute PHP scripts within Node.js web server

What steps are necessary to have a Node.js web server function like Apache executing PHP scripts? Any way to integrate PHP within Node.js? Note: I don't want to execute PHP scripts directly within No..

Converting string to integer

PrinterLabel = Printer + PrinterNumber If Floors = 1 And (PrinterLabel) > 127 Then Wscript.Echo "Invalid Printer11 Selection " Wscript.Quit End If If Floors = 2 And PrinterLabel >..

How can moment.js be imported with typescript?

I'm trying to learn Typescript. While I don't think it's relevant, I'm using VSCode for this demo. I have a package.json that has these pieces in it: { "devDependencies": { "gulp": "^3.9.1", ..

Getting an odd error, SQL Server query using `WITH` clause

The following query: WITH CteProductLookup(ProductId, oid) AS ( SELECT p.ProductID, p.oid FROM [dbo].[ME_CatalogProducts] p ) SELECT rel.Name as Relationship..

Access a JavaScript variable from PHP

I need to access a JavaScript variable with PHP. Here's a stripped-down version of the code I'm currently trying, which isn't working: <script type="text/javascript" charset="utf-8"> var te..

Where does Vagrant download its .box files to?

What happens to the .box file after the following command is executed? vagrant box add lucid32 http://files.vagrantup.com/lucid32.box I can't find the lucid32.box file on the file system after down..

How to generate JAXB classes from XSD?

I'm a total newbie with XML. I'm doing a Java EE project REST implementation and we return a lot of XML. With this we decided to use JAXB. So far, we manually coded the Models for the XML. But there ..

MVC 3: How to render a view without its layout page when loaded via ajax?

I am learning about Progressive Enhancement and I have a question about AJAXifying views. In my MVC 3 project I have a layout page, a viewstart page, and two plain views. The viewstart page is in the..

Difference between VARCHAR2(10 CHAR) and NVARCHAR2(10)

I've installed Oracle Database 10g Express Edition (Universal) with the default settings: SELECT * FROM NLS_DATABASE_PARAMETERS; NLS_CHARACTERSET AL32UTF8 ..

Why shouldn't I use PyPy over CPython if PyPy is 6.3 times faster?

I've been hearing a lot about the PyPy project. They claim it is 6.3 times faster than the CPython interpreter on their site. Whenever we talk about dynamic languages like Python, speed is one of the..

Speech input for visually impaired users without the need to tap the screen

We're working on a app for blind and visually impaired users. We've been experimenting with a third party library to get spoken user input and convert it to text, which we then parse as commands to co..

CardView background color always white

I am using RecyclerView with GridLayoutManager and I have each item as CardView. Unfortunately, the CardView here does not seem to change its background color. I tried in layout and programmatically ..

Update a local branch with the changes from a tracked remote branch

I have a local branch named 'my_local_branch', which tracks a remote branch origin/my_remote_branch. Now, the remote branch has been updated, and I am on the 'my_local_branch' and want to pull in tho..

How to set min-height for bootstrap container

I have some issues with the container in bootstrap. My goal is to have a container which is only as high as the content. For example: <div class="container"> <img src="#.jpg" height="200px..

Reducing video size with same format and reducing frame size

This question might be very basic Is there a way to reduce the frame size/rate of Lossy compressed (WMV, MPEG) format, to get a smaller video, of lesser size, with same format. Are there any open so..

How to get a variable value if variable name is stored as string?

How can I retrieve a bash variable value if I have the variable name as string? var1="this is the real value" a="var1" Do something to get value of var1 just using variable a. Con..

Catch browser's "zoom" event in JavaScript

Is it possible to detect, using JavaScript, when the user changes the zoom in a page? I simply want to catch a "zoom" event and respond to it (similar to window.onresize event). Thanks...

Array.size() vs Array.length

What is the difference between the two? So I know that array.size() is a function while array.length is a property. Is there a usecase for using one over the other? Is one more efficient? (I would im..

What is a predicate in c#?

I am very new to using predicates and just learned how to write: Predicate<int> pre = delegate(int a){ a %2 == 0 }; What will the predicate return, and how is it useful when programming?..

How to vertically align into the center of the content of a div with defined width/height?

What would be the correct method to vertically center any content in a defined width/height div. In the example there are two contents with different heights, what is the best way to center verticall..

How do I detect the Python version at runtime?

I have a Python file which might have to support Python versions < 3.x and >= 3.x. Is there a way to introspect the Python runtime to know the version which it is running (for example, 2.6 or 3.2.x..

Package signatures do not match the previously installed version

This my project: https://github.com/kenpeter/my_hak_news, which is a direct copy of https://github.com/grigio/HAgnostic-News. Git clone https://github.com/kenpeter/my_hak_news, then run react-native ..

How To have Dynamic SQL in MySQL Stored Procedure

How do you build and use dynamic sql in a MySQL stored procedure?..