Questions

Properly close mongoose's connection once you're done

I'm using mongoose in a script that is not meant to run continuously, and I'm facing what seems to be a very simple issue yet I can't find an answer; simply put once I make a call to any mongoose func...

19 Dec at 21:0

Access denied for user 'root'@'localhost' while attempting to grant privileges. How do I grant privileges?

I've looked at a number of similar questions and so I'm demonstrating that I've checked the basics. Though of course, that doesn't mean I haven't missed something totally obvious. :-) My question is:...

1 Aug at 03:52

Query a parameter (postgresql.conf setting) like "max_connections"

Does anyone know if it's even possible (and how, if yes) to query a database server setting in PostgreSQL (9.1)? I need to check the `max_connections` (maximum number of open db connections) setting....

Should I call Close() or Dispose() for stream objects?

Classes such as `Stream`, `StreamReader`, `StreamWriter` etc implements `IDisposable` interface. That means, we can call `Dispose()` method on objects of these classes. They've also defined a `public`...

Error in if/while (condition) {: missing Value where TRUE/FALSE needed

I received this error message: ``` Error in if (condition) { : missing value where TRUE/FALSE needed ``` or ``` Error in while (condition) { : missing value where TRUE/FALSE needed ``` What does...

26 Dec at 16:32

Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints

I make an outer join and executed successfully in the `informix` database but I get the following exception in my code: ``` DataTable dt = TeachingLoadDAL.GetCoursesWithEvalState(i, bat); ``` > Fai...

2 Jan at 12:23

Java Byte Array to String to Byte Array

I'm trying to understand a byte[] to string, string representation of byte[] to byte[] conversion... I convert my byte[] to a string to send, I then expect my web service (written in python) to echo t...

13 Jul at 19:48

Determine direct shared object dependencies of a Linux binary?

How can I easily find out the direct shared object dependencies of a Linux binary in ELF format? I'm aware of the ldd tool, but that appears to output all dependencies of a binary, including the depe...

19 Dec at 13:36

Initialize a byte array to a certain value, other than the default null?

I'm busy rewriting an old project that was done in C++, to C#. My task is to rewrite the program so that it functions as close to the original as possible. During a bunch of file-handling the previ...

23 Jul at 13:34

SSL and cert keystore

How does my Java program know where my keystore containing the certificate is? Or alternatively: How do I tell my Java program where to look for the keystore? After specifying the keystore in some way...

16 Aug at 11:21

Where is the WPF Timer control?

Where can I find a control which is like the C# Timer Control in WPF?

21 Oct at 15:2

What is the benefit of zerofill in MySQL?

I just want to know what is the benefit/usage of defining `ZEROFILL` for `INT` DataType in `MySQL`? ``` `id` INT UNSIGNED ZEROFILL NOT NULL ```

27 Dec at 19:27

Find and copy files

Why does the following does not copy the files to the destination folder? ``` # find /home/shantanu/processed/ -name '*2011*.xml' -exec cp /home/shantanu/tosend {} \; cp: omitting directory `/home/s...

15 Aug at 04:40

Removing the first 3 characters from a string

What is the most efficient way to remove the first 3 characters of a string? For example:

14 Dec at 00:8

Slicing of a NumPy 2d array, or how do I extract an mxm submatrix from an nxn array (n>m)?

I want to slice a NumPy nxn array. I want to extract an selection of m rows and columns of that array (i.e. without any pattern in the numbers of rows/columns), making it a new, mxm array. For this e...

3 Mar at 20:40

MySQL Like multiple values

I have this MySQL query. I have database fields with this contents ``` sports,shopping,pool,pc,games shopping,pool,pc,games sports,pub,swimming, pool, pc, games ``` Why does this like query does...

19 Aug at 19:7

Android: remove notification from notification bar

I have created an application and with an event I manage to add notification in android notification bar. Now I need sample how to remove that notification from notification bar on an event ??

7 Mar at 13:54

Convert decimal to binary in python

Is there any module or function in python I can use to convert a decimal number to its binary equivalent? I am able to convert binary to decimal using int('[binary_value]',2), so any way to do the rev...

4 Oct at 13:26

Can I simultaneously declare and assign a variable in VBA?

Can I convert the following declaration and assignment into one line: ``` Dim clientToTest As String clientToTest = clientsToTest(i) ``` or ``` Dim clientString As Variant clientString = Split(client...

29 Dec at 03:11

How do I comment on the Windows command line?

In Bash, # is used to comment the following. How do I make a comment on the Windows command line?

6 Dec at 14:7

Detect Windows version in .NET

How can I detect the Windows OS versions in .NET? What code can I use?

20 Sep at 04:9

Remove characters after specific character in string, then remove substring?

I feel kind of dumb posting this when this seems kind of simple and there are tons of questions on strings/characters/regex, but I couldn't find quite what I needed (except in another language: [Remov...

23 May at 11:47

Android - shadow on text?

I am wondering how to add shadow on text in android? I have the following code which is applied on a bitmap and I wanted to be shadowed... ``` paint.setColor(Color.BLACK); paint.setTextSize(55); pai...

24 Sep at 05:14

Fastest way to find second (third...) highest/lowest value in vector or column

R offers max and min, but I do not see a really fast way to find another value in the order, apart from sorting the whole vector and then picking a value x from this vector. Is there a faster way to g...

22 Jul at 15:16

How To Test if Type is Primitive

I have a block of code that serializes a type into a Html tag. ``` Type t = typeof(T); // I pass <T> in as a paramter, where myObj is of type T tagBuilder.Attributes.Add("class", t.Name); foreach (Pr...

14 Mar at 15:38