How to set a value to a file input in HTML?
How can I set the value of this? ``` <input type="file" /> ```
- Modified
- 18 Jun at 04:21
How can I list all foreign keys referencing a given table in SQL Server?
I need to remove a highly referenced table in a SQL Server database. How can I get a list of all the foreign key constraints I will need to remove in order to drop the table? (SQL answers preferable...
- Modified
- 22 Nov at 17:43
psql: FATAL: Ident authentication failed for user "postgres"
I have installed PostgreSQL and pgAdminIII on my Ubuntu Karmic box. I am able to use pgAdminIII successfully (i.e. connect/log on), however when I try to login to the server using the same username/p...
- Modified
- 25 Jul at 19:27
How to run the sftp command with a password from Bash script?
I need to transfer a log file to a remote host using [sftp](http://en.wikipedia.org/wiki/Secure_file_transfer_program) from a Linux host. I have been provided credentials for the same from my operatio...
Using Enum values as String literals
What is the best way to use the values stored in an Enum as String literals? For example: ``` public enum Modes { some-really-long-string, mode1, mode2, mode3 } ``` Then later I cou...
How to check which locks are held on a table
How can we check which database locks are applied on which rows against a query batch? Any tool that highlights table row level locking in real time? DB: SQL Server 2005
- Modified
- 4 Aug at 10:28
How do I run a Python program in the Command Prompt in Windows 7?
I'm trying to figure out how to run Python programs with the Command Prompt on Windows 7. (I should have figured this out by now...) When I typed "python" into the command prompt, I got the following ...
Convert a list of characters into a string
If I have a list of chars: ``` a = ['a','b','c','d'] ``` How do I convert it into a single string? ``` a = 'abcd' ```
Comments in Markdown
How do you write a comment in Markdown, i.e. text that is not rendered in the HTML output? I found nothing on the [Markdown project](http://daringfireball.net/projects/markdown/).
Get current directory or folder name (without the full path)
How could I retrieve the current working directory/folder name in a bash script, or even better, just a terminal command. `pwd` gives the full path of the current working directory, e.g. `/opt/local/b...
Input string was not in a correct format
I'm new with C#, I have some basic knowledge in Java but I can't get this code to run properly. It's just a basic calculator, but when I run the program VS2008 gives me this error: ![Calculator](htt...
- Modified
- 11 Oct at 14:50
Decode Base64 data in Java
I have an image that is Base64 encoded. What is the best way to decode that in Java? Hopefully using only the libraries included with Sun Java 6.
Print ArrayList
I have an ArrayList that contains Address objects. How do I print the values of this ArrayList, meaning I am printing out the contents of the Array, in this case numbers. I can only get it to print ...
How can I import a database with MySQL from terminal?
How can I import a database with mysql from terminal? I cannot find the exact syntax.
How can I deal with this Git warning? "Pulling without specifying how to reconcile divergent branches is discouraged"
After a `git pull origin master`, I get the following message: ``` warning: Pulling without specifying how to reconcile divergent branches is discouraged. You can squelch this message by running one o...
- Modified
- 22 Sep at 18:10
How do I install the yaml package for Python?
I have a Python program that uses YAML. I attempted to install it on a new server using `pip install yaml` and it returns the following: ``` $ sudo pip install yaml Downloading/unpacking yaml Coul...
- Modified
- 18 Jan at 21:3
Javascript Object push() function
I have a javascript object (I actually get the data through an ajax request): ``` var data = {}; ``` I have added some stuff into it: ``` data[0] = { "ID": "1"; "Status": "Valid" } data[1] = { "ID...
- Modified
- 16 Apr at 11:37
How can I use pickle to save a dict (or any other Python object)?
I have looked through the information that the [Python docs](https://docs.python.org/3/library/pickle.html) give, but I'm still a little confused. Could somebody post sample code that would write a ne...
- Modified
- 6 Mar at 04:3
Amazon Linux: "apt-get: command not found"
I'm trying to install an [Apache](https://en.wikipedia.org/wiki/Apache_HTTP_Server) server on my AWS instance. However, it seems that it doesn't have the apt package installed. I googled and all I fou...
- Modified
- 11 May at 22:57
How to delete the contents of a folder?
How can I delete the contents of a local folder in Python? The current project is for Windows, but I would like to see *nix also.
How do I create a DataTable, then add rows to it?
I've tried creating a `DataTable` and adding rows to it like this: ``` DataTable dt = new DataTable(); dt.clear(); dt.Columns.Add("Name"); dt.Columns.Add("Marks"); ``` How do I see the structure o...
Copy tables from one database to another in SQL Server
I have a database called foo and a database called bar. I have a table in foo called tblFoobar that I want to move (data and all) to database bar from database foo. What is the SQL statement to do thi...
- Modified
- 8 Dec at 02:19
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 work w...
Python 3: ImportError "No Module named Setuptools"
I'm having troubles with installing packages in Python 3. I have always installed packages with `setup.py install`. But now, when I try to install the ansicolors package I get: ``` importerror "No Mod...
- Modified
- 24 Feb at 13:22
Selecting with complex criteria from pandas.DataFrame
For example I have simple DF: ``` import pandas as pd from random import randint df = pd.DataFrame({'A': [randint(1, 9) for x in range(10)], 'B': [randint(1, 9)*10 for x in range(1...