How to create Windows EventLog source from command line?
I'm creating an ASP.NET application that will log some stuff to Windows EventLog. To do this an event source has to be created first. This requires administrative priviledges so I cannot do it in the ...
- Modified
- 15 Jan at 13:22
Capture characters from standard input without waiting for enter to be pressed
I can never remember how I do this because it comes up so infrequently for me. But in C or C++, what is the best way to read a character from standard input without waiting for a newline (press enter)...
- Modified
- 20 Sep at 07:44
Why is the Date constructor deprecated, and what do I use instead?
I come from the C# world, so not too experienced with Java yet. I was just told by Eclipse that `Date` was deprecated: ``` Person p = new Person(); p.setDateOfBirth(new Date(1985, 1, 1)); ``` Why? ...
- Modified
- 6 Feb at 10:18
How to change MySQL column definition?
I have a mySQL table called test: ``` create table test( locationExpect varchar(120) NOT NULL; ); ``` I want to change the locationExpect column to: ``` create table test( locationExpect v...
- Modified
- 11 Sep at 13:3
Calling a particular PHP function on form submit
I was trying to call a particular php function in submit of a form both the form and php scripts are in same page. My code is below.(it is not working and so I need help) ``` <html> <body> <f...
In Git, what is the difference between origin/master vs origin master?
I know, is a term for the remote repository and is the branch there. I am purposely omitting the "context" here and I am hoping that the answer should not depend upon the context. So in git command...
- Modified
- 9 Aug at 00:24
Passing data between different controller action methods
I'm using `ASP.NET MVC 4`. I am trying to pass data from one controller to another controller. I'm not getting this right. I'm not sure if this is possible? Here is my source action method where I ...
- Modified
- 2 Aug at 09:26
How do I use the JAVA_OPTS environment variable?
How do I use the `JAVA_OPTS` variable to configure a web server (a linux server)? How can I set `-Djava.awt.headless=true` using `JAVA_OPTS`?
Remove insignificant trailing zeros from a number?
Have I missed a standard API call that removes trailing insignificant zeros from a number? ``` var x = 1.234000; // to become 1.234 var y = 1.234001; // stays 1.234001 ``` `Number.toFixed()` and `Num...
- Modified
- 22 Sep at 07:42
How to use a table type in a SELECT FROM statement?
This question is more or less the same as [this](https://stackoverflow.com/questions/1573877/selecting-values-from-oracle-table-variable-array) Declared the following row type: ``` TYPE exch_row IS...
Catch a thread's exception in the caller thread?
I'm very new to Python and multithreaded programming in general. Basically, I have a script that will copy files to another location. I would like this to be placed in another thread so I can output...
- Modified
- 5 Jul at 13:41
Reload current activity in Android
I my Android app to refresh its current activity on ButtonClick. I have a button on the top of the activity layout which should do the job. When I click on the button, the current activity should relo...
- Modified
- 10 Oct at 17:48
Concatenate strings from several rows using Pandas groupby
I want to merge several strings in a dataframe based on a groupedby in Pandas. This is my code so far: ``` import pandas as pd from io import StringIO data = StringIO(""" "name1","hej","2014-11-01...
- Modified
- 25 Nov at 20:30
How do I get user IP address in Django?
How do I get user's IP in Django? I have a view like this: ``` # Create your views from django.contrib.gis.utils import GeoIP from django.template import RequestContext from django.shortcuts import r...
What is the difference between a generative and a discriminative algorithm?
What is the difference between a and a algorithm?
- Modified
- 5 Dec at 01:21
Execute function after Ajax call is complete
I am new to Ajax and I am attempting to use Ajax while using a for loop. After the Ajax call I am running a function that uses the variables created in the Ajax call. The function only executes two ti...
- Modified
- 25 Apr at 02:49
How can I update the current line in a C# Windows Console App?
When building a Windows Console App in C#, is it possible to write to the console without having to extend a current line or go to a new line? For example, if I want to show a percentage representing...
When should I use "this" in a class?
I know that `this` refers to a current object. But I do not know when I really need to use it. For example, will be there any difference if I use `x` instead of `this.x` in some of the methods? May be...
How to allow only numbers in textbox in mvc4 razor
I have 3 text box which takes values postal code & mobile number & residential number. I got the solution for allowing only number in text box using jquery from Bellow post. [I would like to make an ...
- Modified
- 23 May at 12:18
How to start debug mode from command prompt for apache tomcat server?
I want to start debug mode for my application. But I need to start the debug mode from command prompt. Is it possible ? And will the procedure vary between tomcat 5.5 to tomcat 6.?
R - do I need to add explicit new line character with print()?
How do I use the new line character in R? ``` myStringVariable <- "Very Nice ! I like"; myStringVariabel <- paste(myStringVariable, "\n", sep=""); ``` The above code P.S There's significant cha...
Where is the IIS Express configuration / metabase file found?
Where can the IIS Express configuration / metabase file be found?
- Modified
- 8 Jul at 10:7
Calling a JavaScript function named in a variable
I have a JavaScript variable which contains the name of a JavaScript function. This function exists on the page by having been loaded in and placed using $.ajax, etc. Can anyone tell me how I would c...
- Modified
- 9 Oct at 05:42
Convert JSON String to Pretty Print JSON output using Jackson
This is the JSON string I have: ``` {"attributes":[{"nm":"ACCOUNT","lv":[{"v":{"Id":null,"State":null},"vt":"java.util.Map","cn":1}],"vt":"java.util.Map","status":"SUCCESS","lmd":13585},{"nm":"PROFIL...
- Modified
- 14 Dec at 08:29
How can I print the contents of an array horizontally?
Why doesn't the console window print the array contents horizontally rather than vertically? Is there a way to change that? How can I display the content of my array horizontally instead of vertical...