Questions

Python integer incrementing with ++

I've always laughed to myself when I've looked back at my VB6 days and thought, "What modern language doesn't allow incrementing with double plus signs?": ``` number++ ``` To my surprise, I can't fin...

21 Oct at 09:35

CSS selector for first element with class

I have a bunch of elements with a class name `red`, but I can't seem to select the first element with the `class="red"` using the following CSS rule: ``` .home .red:first-child { border: 1px solid...

13 Mar at 14:2

How to reload .bashrc settings without logging out and back in again?

If I make changes to `.bashrc`, how do I reload it without logging out and back in?

3 Jan at 22:4

How do I run a Java program from the command line on Windows?

I'm trying to execute a Java program from the command line in Windows. Here is my code: ``` import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOExce...

10 Apr at 03:5

How to convert byte array to string

I created a byte array with two strings. How do I convert a byte array to string? ``` var binWriter = new BinaryWriter(new MemoryStream()); binWriter.Write("value1"); binWriter.Write("value2"); binWr...

14 Jun at 17:56

How to insert spaces/tabs in text using HTML/CSS

Possible ways: ``` <pre> ... </pre> ``` or ``` style="white-space:pre" ``` Anything else?

27 Jul at 17:21

What's the difference between tilde(~) and caret(^) in package.json?

After I upgraded to the latest stable `node` and `npm`, I tried `npm install moment --save`. It saves the entry in the `package.json` with the caret `^` prefix. Previously, it was a tilde `~` prefix. ...

Disable ONLY_FULL_GROUP_BY

I accidentally enabled ONLY_FULL_GROUP_BY mode like this: ``` SET sql_mode = 'ONLY_FULL_GROUP_BY'; ``` How do I disable it?

30 Jul at 16:38

Fetch: POST JSON data

I'm trying to POST a JSON object using [fetch](https://developer.mozilla.org/en-US/docs/Web/API/GlobalFetch/fetch). From what I can understand, I need to attach a stringified object to the body of the...

18 Aug at 07:9

Convert pandas dataframe to NumPy array

How do I convert a pandas dataframe into a NumPy array? DataFrame: ``` import numpy as np import pandas as pd index = [1, 2, 3, 4, 5, 6, 7] a = [np.nan, np.nan, np.nan, 0.1, 0.1, 0.1, 0.1] b = [0.2, ...

13 Jun at 07:30

How can I upload files asynchronously with jQuery?

I would like to upload a file asynchronously with jQuery. ``` $(document).ready(function () { $("#uploadbutton").click(function () { var filename = $("#file").val(); $.ajax({ ...

Getting key with maximum value in dictionary?

I have a dictionary where keys are strings, and values are integers. ``` stats = {'a': 1, 'b': 3000, 'c': 0} ``` How do I get the key with the maximum value? In this case, it is `'b'`. --- Is ther...

9 Apr at 09:53

Bootstrap NavBar with left, center or right aligned items

In , what is the most platform-friendly way to create a navigation bar that has Logo A on the left, menu items in the center, and Logo B on the right? Here is what I've tried so far, and it ends up ...

Command to list all files in a folder as well as sub-folders in windows

I tried searching for a command that could list all the file in a directory as well as subfolders using a command prompt command. I have read the help for "dir" command but coudn't find what I was loo...

11 Mar at 08:35

How can I get list of values from dict?

How can I get a list of the values in a dict in Python? In Java, getting the values of a Map as a List is as easy as doing `list = map.values();`. I'm wondering if there is a similarly simple way in...

30 Mar at 19:27

How to change to an older version of Node.js

I am running Node.js version `v0.5.9-pre` on Ubuntu 10.10. I would like to be using version `v0.5.0-pre`. How do I roll back to the older version of node?

11 Jun at 02:25

Batch file to copy files from one folder to another folder

I have a storage folder on a network in which all users will store their active data on a server. Now that server is going to be replaced by a new one due to place problem so I need to copy sub folder...

11 Apr at 16:27

How do you get a list of the names of all files present in a directory in Node.js?

I'm trying to get a list of the names of all the files present in a directory using Node.js. I want output that is an array of filenames. How can I do this?

What is the { get; set; } syntax in C#?

I am learning ASP.NET MVC and I can read English documents, but I don't really understand what is happening in this code: ``` public class Genre { public string Name { get; set; } } ``` What do...

7 Aug at 00:21

Reset identity seed after deleting records in SQL Server

I have inserted records into a SQL Server database table. The table had a primary key defined and the auto increment identity seed is set to “Yes”. This is done primarily because in SQL Azure, each ta...

How is an HTTP POST request made in node.js?

How can I make an outbound HTTP POST request, with data, in node.js?

5 Mar at 02:35

Detecting a mobile browser

I'm looking for a function that returns a boolean value if the user is using a mobile browser or not. I know that I can use `navigator.userAgent` and write that function by using regex, but user-agent...

Change color of PNG image via CSS?

Given a transparent PNG displaying a simple shape in white, is it possible to somehow change the color of this through CSS? Some kind of overlay or what not?

11 Apr at 21:45

Updating a local repository with changes from a GitHub repository

I've got a project checked locally from GitHub, and that remote repository has since had changes made to it. What's the correct command to update my local copy with the latest changes?

9 Apr at 00:2

Getting only Month and Year from SQL DATE

I need to access only Month.Year from Date field in SQL Server.

23 Jan at 10:22