How do you check if a certain index exists in a table?
Something like this: ``` SELECT * FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS WHERE CONSTRAINT_NAME ='FK_TreeNodesBinaryAssets_BinaryAssets' and TABLE_NAME = 'TreeNodesBinaryAssets' ``` but for ind...
- Modified
- 22 Apr at 09:55
How to avoid Dependency Injection constructor madness?
I find that my constructors are starting to look like this: ``` public MyClass(Container con, SomeClass1 obj1, SomeClass2, obj2.... ) ``` with ever increasing parameter list. Since "Container" is m...
- Modified
- 11 Mar at 15:24
Assign output of a program to a variable using a MS batch file
I need to assign the output of a program to a variable using a MS batch file. So in GNU Bash shell I would use `VAR=$(application arg0 arg1)`. I need a similar behavior in Windows using a batch file. ...
- Modified
- 24 May at 16:9
Where can I set environment variables that crontab will use?
I have a crontab running every hour. The user running it has environment variabless in the `.bash_profile` that work when the user runs the job from the terminal, however, obviously these don't get pi...
- Modified
- 12 Apr at 04:4
How do I group Windows Form radio buttons?
How can I group the radio buttons in Windows Form application (a lot like ASP.NET's radiobuttonlist!)? So I can switch between each case chosen from the options.
- Modified
- 2 Apr at 08:13
How do I implement interfaces in python?
``` public interface IInterface { void show(); } public class MyClass : IInterface { #region IInterface Members public void show() { Console.WriteLine("Hello World!"); ...
How to read/write from/to a file using Go
I've been trying to learn Go on my own, but I've been stumped on trying read from and write to ordinary files. I can get as far as `inFile, _ := os.Open(INFILE, 0, 0)`, but actually getting the conten...
Evaluate expression given as a string
I'm curious to know if R can use its `eval()` function to perform calculations provided by e.g. a string. This is a common case: ``` eval("5+5") ``` However, instead of 10 I get: ``` [1] "5+5" ``...
C default arguments
Is there a way to specify default arguments to a function in C?
- Modified
- 8 May at 09:2
Remove Safari/Chrome textinput/textarea glow
I am wondering if its possible to remove the default blue and yellow glow when I click on a text input / text area using CSS?
- Modified
- 19 Feb at 15:38
How to get first character of a string in SQL?
I have a SQL column with a length of 6. Now want to take only the first char of that column. Is there any string function in SQL to do this?
- Modified
- 8 Aug at 14:32
How can I remove an element from a list?
I have a list and I want to remove a single element from it. How can I do this? I've tried looking up what I think the obvious names for this function would be in the reference manual and I haven't ...
Div width 100% minus fixed amount of pixels
How can I achieve the following structure without using tables or JavaScript? The white borders represent edges of divs and aren't relevant to the question. ![Structure 1](https://i.stack.imgur.com/z...
Nullable type as a generic parameter possible?
I want to do something like this : ``` myYear = record.GetValueOrNull<int?>("myYear"), ``` Notice the nullable type as the generic parameter. Since the `GetValueOrNull` function could return null...
Get viewport/window height in ReactJS
How do I get the viewport height in ReactJS? In normal JavaScript I use ``` window.innerHeight() ``` but using ReactJS, I'm not sure how to get this information. My understanding is that ``` React...
- Modified
- 24 Jan at 19:12
Array<Type> VS Type[] in Typescript
As far as I know a property's type can be defined in two ways when it's an Array. ``` property_name: type ``` where type can be either ``` Array<string>, Array<MyType>, etc. (e.g. let prop1: Array...
- Modified
- 12 Apr at 14:53
Electron: jQuery is not defined
Problem: while developing using Electron, when you try to use any JS plugin that requires jQuery, the plugin doesn't find jQuery, even if you load in the correct path using script tags. For example, ...
What is the purpose of nameof?
Version 6.0 got a new feature of `nameof`, but I can't understand the purpose of it, as it just takes the variable name and changes it to a string on compilation. I thought it might have some purpose...
Generate 'n' unique random numbers within a range
I know how to generate a random number within a range in Python. ``` random.randint(numLow, numHigh) ``` And I know I can put this in a loop to generate n amount of these numbers ``` for x in rang...
How do you install Google frameworks (Play, Accounts, etc.) on a Genymotion virtual device?
I'm currently trying out Genymotion and boy, it's so much faster than the ADT emulator. But I need to install Google Play to download some apps into it. How do I do this?
- Modified
- 25 Nov at 09:30
Using two CSS classes on one element
What am I doing wrong here? I have a `.social` `div`, but on the first one I want zero padding on the top, and on the second one I want no bottom border. I have attempted to create classes for this ...
Sibling package imports
I've tried reading through questions about sibling imports and even the [package documentation](http://docs.python.org/tutorial/modules.html#intra-package-references), but I've yet to find an answer. ...
- Modified
- 25 Feb at 15:28
Add default value of datetime field in SQL Server to a timestamp
I've got a table that collects forms submitted from our website, but for some reason, when they created the table, they didn't put a timestamp in the table. I want it to enter the exact date and time ...
- Modified
- 19 Dec at 14:50
String comparison using '==' or '===' vs. 'strcmp()'
It seems that PHP's `===` operator is case sensitive. So is there a reason to use `strcmp()`? Is it safe to do something like the following? ``` if ($password === $password2) { ... } ```
- Modified
- 31 Aug at 23:54