VBA: Selecting range by variables
I want to select the formatted range of an Excel sheet. To define the last and first row I use the following functions: ``` lastColumn = ActiveSheet.UsedRange.Column - 1 + ActiveSheet.UsedRange.Colum...
How to access the first property of a Javascript object?
Is there an elegant way to access the first property of an object... 1. where you don't know the name of your properties 2. without using a loop like for .. in or jQuery's $.each For example, I n...
- Modified
- 27 Apr at 11:49
TypeError: unhashable type: 'dict'
This piece of code is giving me an error `unhashable type: dict` can anyone explain to me what the solution is? ``` negids = movie_reviews.fileids('neg') def word_feats(words): return dict([(word,...
- Modified
- 9 Mar at 00:43
Is there a format code shortcut for Visual Studio?
In [Eclipse](http://en.wikipedia.org/wiki/Eclipse_%28software%29) there is a shortcut, ++, that re-indents code and fixes comments and blank lines. Is there an equivalent for Visual Studio 2010?
- Modified
- 20 Jul at 10:53
How do I get the path of the assembly the code is in?
Is there a way to get the path for the assembly in which the current code resides? I do not want the path of the calling assembly, just the one containing the code. Basically my unit test needs to ...
- Modified
- 15 Jan at 08:49
Where is array's length property defined?
We can determine the length of an `ArrayList<E>` using its public method `size()`, like ``` ArrayList<Integer> arr = new ArrayList(10); int size = arr.size(); ``` Similarly we can determine the len...
How can I use Python to get the system hostname?
I'm writing a chat program for a local network. I would like be able to identify computers and get the user-set computer name with Python.
How do you read a file into a list in Python?
I want to prompt a user for a number of random numbers to be generated and saved to a file. He gave us that part. The part we have to do is to open that file, convert the numbers into a list, then fin...
Pipe to/from the clipboard in a Bash script
Is it possible to pipe to/from the clipboard in Bash? Whether it is piping to/from a device handle or using an auxiliary application, I can't find anything. For example, if `/dev/clip` was a device li...
Setting a max character length in CSS
I am making responsive website for school and my question is: How do I set a max character length of the sentences (with CSS) on my website (like 75 characters) that when I have a very large screen, ...
Improve subplot size/spacing with many subplots
I need to generate a whole bunch of vertically-stacked plots in matplotlib. The result will be saved using `savefig` and viewed on a webpage, so I don't care how tall the final image is, as long as th...
- Modified
- 26 Aug at 20:28
How do I get the current username in .NET using C#?
How do I get the current username in .NET using C#?
Transferring files over SSH
I'm SSHing into a remote server on the command line, and trying to copy a directory onto my local machine with the `scp` command. However, the remote server returns this "usage" message: ``` [Stewart...
SQL Server - Return value after INSERT
I'm trying to get a the key-value back after an INSERT-statement. Example: I've got a table with the attributes name and id. id is a generated value. ``` INSERT INTO table (name) VALUES('bob'); ```...
- Modified
- 27 Oct at 14:46
How do I make a text input non-editable?
So I have a text input ``` <input type="text" value="3" class="field left"> ``` Here is my CSS for it ``` background:url("images/number-bg.png") no-repeat scroll 0 0 transparent; border:0 none; co...
- Modified
- 29 Apr at 16:39
Apache is not running from XAMPP Control Panel ( Error: Apache shutdown unexpectedly. This may be due to a blocked port)
I have installed XAMPP (xampp-win32-1.8.2-0-VC9-installer.exe) on Windows 7 successfully. But unfortunately, the following error was found during running Apache from XAMPP Control Panel: ``` 5:38:38...
This application has no explicit mapping for /error
I used maven to do the tutorial [https://spring.io/guides/gs/uploading-files/](https://spring.io/guides/gs/uploading-files/) All the codes I used was copied. The Application can run, but I get the er...
- Modified
- 2 May at 20:22
How do I get the last character of a string?
How do I get the last character of a string? ``` public class Main { public static void main(String[] args) { String s = "test string"; //char lastChar = ??? } } ```
What is the difference between POST and GET?
I've only recently been getting involved with PHP/AJAX/jQuery and it seems to me that an important part of these technologies is that of `POST` and `GET`. First, what is the difference between `POST` ...
- Modified
- 23 Jun at 22:59
Create a git patch from the uncommitted changes in the current working directory
Say I have uncommitted changes in my working directory. How can I make a patch from those without having to create a commit?
JavaScript code to stop form submission
One way to stop form submission is to return false from your JavaScript function. When the submit button is clicked, a validation function is called. I have a case in form validation. If that conditi...
- Modified
- 27 Jan at 18:26
In C, how should I read a text file and print all strings
I have a text file named `test.txt` I want to write a C program that can read this file and print the content to the console (assume the file contains only ASCII text). I don't know how to get the s...
- Modified
- 11 Aug at 23:7
How to change XAMPP apache server port?
This is my Apache httpd.conf settings : ``` Listen 8012 ServerName localhost:8012 ``` Every time I start Apache via `XAMPP` I see this message: ``` Status Check OK Busy… Apache Started [Port 80] `...
C: printf a float value
I want to print a float value which has 2 integer digits and 6 decimal digits after the comma. If I just use `printf("%f", myFloat)` I'm getting a truncated value. I don't know if this always happens...
- Modified
- 19 Jun at 01:32