Questions

Plotting time-series with Date labels on x-axis

I know that this question might be a cliche, but I'm having hard time doing it. I've data set in the following format: I want to create a time-series plot, with x-axis representing time & y-axis v...

21 Dec at 18:40

PowerShell to remove text from a string

What is the best way to remove all text in a string after a specific character? In my case "=" and after another character in my case a `,`, but keep the text between? ### Sample input > =keep this...

20 Jun at 09:12

Returning IEnumerable<T> vs. IQueryable<T>

What is the difference between returning `IQueryable<T>` vs. `IEnumerable<T>`, when should one be preferred over the other? ``` IQueryable<Customer> custs = from c in db.Customers where c.City == "<Ci...

How to read GET data from a URL using JavaScript?

I'm trying to pass data from one page to another. > www.mints.com?name=something How to read `name` using JavaScript?

15 Jan at 09:10

Index (zero based) must be greater than or equal to zero

Hey I keep getting an error: > Index (zero based) must be greater than or equal to zero and less than the size of the argument list. My code: ``` OdbcCommand cmd = new OdbcCommand("SELECT FirstName...

1 Jul at 12:40

Determine a user's timezone

Is there a standard way for a web server to be able to determine a user's timezone within a web page? Perhaps from an HTTP header or part of the `user-agent` string?

C compile error: Id returned 1 exit status

For some reason, when I try compiling a program, the compiler says permission denied and Id returned 1 exit status. Could anyone tell me what that means? Thank you ``` #include <stdio.h> ...

18 Jul at 08:14

Java Regex Capturing Groups

I am trying to understand this code block. In the first one, what is it we are looking for in the expression? My understanding is that it is any character (0 or more times *) followed by any number b...

13 Mar at 16:41

How to set selected value from Combobox?

I use combobox in c# windows form. I bound the item list as below: ``` var employmentStatus = new BindingList<KeyValuePair<string, string>>(); employmentStatus.Add(new KeyValuePair<string, string>("...

how to convert image to byte array in java?

I want to convert an image to byte array and vice versa. Here, the user will enter the name of the image (`.jpg`) and program will and will convert it to a byte array.

4 May at 00:6

Accessing a Dictionary.Keys Key through a numeric index

I'm using a `Dictionary<string, int>` where the `int` is a count of the key. Now, I need to access the last-inserted Key inside the Dictionary, but I do not know the name of it. The obvious attempt: ...

7 Apr at 12:16

Java random numbers using a seed

This is my code to generate random numbers using a seed as an argument: ``` double randomGenerator(long seed) { Random generator = new Random(seed); double num = generator.nextDouble() * (0.5...

28 Apr at 17:59

Why does this UnboundLocalError occur (closure)?

What am I doing wrong here? ``` counter = 0 def increment(): counter += 1 increment() ``` The above code throws an `UnboundLocalError`.

How to execute the start script with Nodemon

How can I execute the start script from a file with Nodemon?

28 May at 11:38

Producing a new line in XSLT

I want to produce a newline for text output in XSLT. Any ideas?

16 Apr at 03:6

jQuery ajax call to REST service

I'm trying to make an ajax call from jquery to a rest service. The rest service used is right from a tutorial of mkyong's blog, this one: [http://www.mkyong.com/webservices/jax-rs/integrate-jackson-wi...

19 Dec at 11:1

HTML text input field with currency symbol

I would like to have a text input field containing the "$" sign in the very beginning, and no matter what editing occurs to the field, for the sign to be persistent. I would be good if only numbers w...

21 Sep at 19:50

Animate change of view background color on Android

How do you animate the change of background color of a view on Android? For example: I have a view with a red background color. The background color of the view changes to blue. How can I do a smo...

How do I redirect a user when a button is clicked?

I have a view with a button. When the user clicks the button I want them redirected to a data entry view. How do I accomplish this? I should mention the views are created, tested, and functioning. I c...

How to install an apk on the emulator in Android Studio?

How do you install an apk on the emulator in Android Studio from the terminal? In Eclipse we did ``` /home/pcname/android-sdks/platform-tools/adb -s emulator-5554 install /home/pcname/Downloads/ap...

5 Sep at 06:41

How to get the last row of an Oracle table

I want to get the last row, which I inserted into a table in an Oracle 11g Express database. How can I do this?

29 May at 08:46

How to set level logging to DEBUG in Tomcat?

I would like to set level logging to DEBUG in tomcat but in console nevertheless only INFO and WARN output. Could anybody tell me what's wrong? My C:\tomcat\logging.properties: ``` # Licensed to the...

How to add an auto-incrementing primary key to an existing table, in PostgreSQL?

I have a table with existing data. Is there a way to add a primary key without deleting and re-creating the table?

Why should a Java class implement comparable?

Why is Java `Comparable` used? Why would someone implement `Comparable` in a class? What is a real life example where you need to implement comparable?

27 Jan at 12:36

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

15 Feb at 11:52