Questions

TypeError: 'builtin_function_or_method' object is not subscriptable

``` elif( listb[0] == "-test"): run_all.set("testview") listb.pop[0] ``` > : Exception in Tkinter callback Traceback (most recent call last): File "/tools/python/2.7.2/lib/python2.7/li...

2 Aug at 08:33

Convert number to month name in PHP

I have this PHP code: ``` $monthNum = sprintf("%02s", $result["month"]); $monthName = date("F", strtotime($monthNum)); echo $monthName; ``` But it's returning `December` rather than `August`. `$r...

4 Jun at 19:45

What are the pros and cons of the SVN plugins for Eclipse, Subclipse and Subversive?

SVN in Eclipse is spread into two camps. The SVN people have developed a plugin called [Subclipse](http://subclipse.tigris.org/). The Eclipse people have a plugin called [Subversive](http://www.eclips...

19 Dec at 01:57

Why is enum class preferred over plain enum?

I heard a few people recommending to use enum in C++ because of their . But what does that really mean?

8 Aug at 13:33

Chrome desktop notification example

How does one use [Chrome desktop notifications](http://techcrunch.com/2009/09/01/chrome-is-gaining-desktop-notifications/)? I'd like that use that in my own code. : Here's [a blog post](http://0xfe.b...

Get local href value from anchor (a) tag

I have an anchor tag that has a local href value, and a JavaScript function that uses the href value but directs it to a slightly different place than it would normally go. The tag looks like ``` <a...

15 Mar at 18:39

Find the files existing in one directory but not in the other

I'm trying to find the files existing in one directory but not in the other, I tried to use this command: ``` diff -q dir1 dir2 ``` The problem with the above command that it finds both the files i...

7 Oct at 01:8

CSS selector based on element text?

Is there a way to select an element in css based on element text? ie: ``` li[text=*foo] <li>foo</li> <li>bar</li> ``` That probably doesn't work. Edit: Also only need to support Chrome.

31 Jan at 07:10

Set value to NULL in MySQL

I want a value to be set to `NULL` if nothing is put into the text box in the form I'm submitting. How can I make this happen? I've tried inserting `'NULL'` but this just adds the word `NULL` into the...

13 Nov at 15:16

Rename a dictionary key

Is there a way to rename a dictionary key, without reassigning its value to a new name and removing the old name key; and without iterating through dict key/value? In case of [OrderedDict](https://doc...

10 Nov at 08:56

Typescript react - Could not find a declaration file for module ''react-materialize'. 'path/to/module-name.js' implicitly has an any type

I am trying to import components from react-materialize as - ``` import {Navbar, NavItem} from 'react-materialize'; ``` But when the webpack is compiling my `.tsx` it throws an error for the above as...

18 Jan at 12:9

Convert SVG to image (JPEG, PNG, etc.) in the browser

I want to convert SVG into bitmap images (like JPEG, PNG, etc.) through JavaScript.

17 Nov at 02:0

Eclipse Error: Could not find or load main class

Have Googled extensively on this error, but I can't seem to fix the problem. I've written a basic java program in Eclipse Juno, as follows: ``` public class HelloWorld { /** * @param args ...

2 May at 09:30

Java ArrayList how to add elements at the beginning

I need to add elements to an `ArrayList` queue whatever, but when I call the function to add an element, I want it to add the element at the beginning of the array (so it has the lowest index) and if ...

18 Jun at 12:30

How to check if a file exists in Go?

Go's standard library does not have a function solely intended to check if a file exists or not (like Python's [os.path.exists](http://docs.python.org/library/os.path.html#os.path.exists)). What is th...

21 Sep at 20:13

ThreadStart with parameters

How do you start a thread with parameters in C#?

18 May at 18:26

Set Focus on EditText

I have an EditText-Field and set an OnFocusChangeListener for it. When it has lost focus, a method is called, which checks the value of the EditText with one in the database. If the return-value of th...

15 Jan at 21:3

Strip Leading and Trailing Spaces From Java String

Is there a convenience method to strip any leading or trailing spaces from a Java String? Something like: ``` String myString = " keep this "; String stripppedString = myString.strip(); System.out...

23 Sep at 19:15

Conda command is not recognized on Windows 10

I installed Anaconda 4.4.0 (Python 3.6 version) on Windows 10 by following the instructions here: [https://www.continuum.io/downloads](https://www.continuum.io/downloads). However, when I open the Com...

Why isn't the 'global' keyword needed to access a global variable?

From my understanding, Python has a separate namespace for functions, so if I want to use a global variable in a function, I should probably use `global`. However, I was able to access a global variab...

10 Sep at 09:37

Why does AngularJS include an empty option in select?

I've been working with AngularJS for the last few weeks, and the one thing which is really bothering me is that even after trying all permutations or the configuration defined in the specification at ...

7 Jan at 13:54

How to change default Anaconda python environment

I've installed Anaconda and created two extra environments: py3k (which holds Python 3.3) and py34 (which holds Python 3.4). Besides those, I have a default environment named 'root' which the Anaconda...

18 May at 02:41

How to programmatically take a screenshot on Android?

How can I take a screenshot of a selected area of phone-screen not by any program but from code?

30 Apr at 13:43

Update style of a component onScroll in React.js

I have built a component in React which is supposed to update its own style on window scroll to create a parallax effect. The component `render` method looks like this: ``` function() { let styl...

27 Sep at 13:53

Update a local branch with the changes from a tracked remote branch

I have a local branch named '`my_local_branch`', which tracks a remote branch `origin/my_remote_branch`. Now, the remote branch has been updated, and I am on the '`my_local_branch`' and want to pull ...

30 Jun at 23:38