Questions

How can I check the version before installing a package using 'apt-get'?

I'm thinking to install version 5.5.4 which was released last month on my [Debian](http://en.wikipedia.org/wiki/Debian) PC. I checked `dpkg -l | grep "hylafax"` and found out that the current version...

3 Aug at 22:11

How to list all the available keyspaces in Cassandra?

I am newbie in Cassandra and trying to implement one toy application using Cassandra. I had created one keyspace and few column families in my Cassandra DB but I forgot the name of my cluster. I am t...

23 Sep at 13:45

Textarea Auto height

I want to make height of textarea equal to height of the text within it (And remove the scroll bar) HTML ``` <textarea id="note">SOME TEXT</textarea> ``` CSS ``` textarea#note { width:100%; ...

28 Dec at 12:19

Label points in geom_point

The data I'm playing with comes from the internet source listed below ``` nba <- read.csv("http://datasets.flowingdata.com/ppg2008.csv", sep=",") ``` What I want to do, is create a 2D points graph ...

12 May at 05:26

how to get request path with express req object

I'm using express + node.js and I have a req object, the request in the browser is /account but when I log req.path I get '/' --- not '/account'. ``` //auth required or redirect app.use('/account',...

21 Sep at 07:32

Right mime type for SVG images with fonts embedded

This is the usual SVG mime type: ``` image/svg+xml ``` And it works great. However, when embedding an SVG font, chrome tells you the mime type is incorrect, obviously because you return a font inst...

5 May at 16:9

Iterate over object attributes in python

I have a python object with several attributes and methods. I want to iterate over object attributes. ``` class my_python_obj(object): attr1='a' attr2='b' attr3='c' def method1(se...

22 Oct at 19:23

Pandas convert dataframe to array of tuples

I have manipulated some data using pandas and now I want to carry out a batch save back to the database. This requires me to convert the dataframe into an array of tuples, with each tuple correspondin...

4 Jan at 21:49

How can I use if/else in a dictionary comprehension?

Does there exist a way in Python 2.7+ to make something like the following? ``` { something_if_true if condition else something_if_false for key, value in dict_.items() } ``` I know you can make an...

Add icon to submit button in twitter bootstrap 2

I want to use the twitter bootstrap icons on my form input submit buttons. The examples on [http://twitter.github.com/bootstrap/base-css.html#icons](http://twitter.github.com/bootstrap/base-css.html...

Count Rows in Doctrine QueryBuilder

I'm using Doctrine's QueryBuilder to build a query, and I want to get the total count of results from the query. ``` $repository = $em->getRepository('FooBundle:Foo'); $qb = $repository->createQu...

10 Feb at 00:56

Can't use modulus on doubles?

I have a program in C++ (compiled using g++). I'm trying to apply two doubles as operands to the modulus function, but I get the following error: > error: invalid operands of types 'double' and 'doub...

15 Dec at 21:22

Link to reload current page

Is it possible to have a normal link pointing to the current location? I have currently found 2 solutions, but one of them includes JavaScript and in the other you have to know the absolute path to t...

17 Nov at 17:59

How can I set a custom date time format in Oracle SQL Developer?

By default, Oracle SQL developer displays date values as `15-NOV-11`. I would like to see the time part (hour/minute/second) by default. Is there a way to configure this within Oracle SQL Developer?...

11 Jul at 14:24

Java compiler level does not match the version of the installed Java project facet

I have created a New Dynamic Project under Eclipse Helios Version, where my JRE Version is set to 1.6. I have added Maven capabilities to the Web Application by clicking on → . After adding this, a ...

24 Jan at 09:12

How to Remove Array Element and Then Re-Index Array?

I have some troubles with an array. I have one array that I want to modify like below. I want to remove element (elements) of it by index and then re-index array. Is it possible? ``` $foo = array( ...

7 Mar at 09:4

How to convert a Base64 string into a Bitmap image to show it in a ImageView?

I have a Base64 String that represents a BitMap image. I need to transform that String into a BitMap image again to use it on a ImageView in my Android app How to do it? This is the code that I use...

23 Nov at 18:54

Left Join With Where Clause

I need to retrieve all default settings from the settings table but also grab the character setting if exists for x character. But this query is only retrieving those settings where character is = 1...

20 Jan at 20:59

Trying to mock datetime.date.today(), but not working

Can anyone tell me why this isn't working? ``` >>> import mock >>> @mock.patch('datetime.date.today') ... def today(cls): ... return date(2010, 1, 1) ... >>> from datetime import date >>> date.today...

16 Jan at 15:42

Numpy - add row to array

How does one add rows to a numpy array? I have an array A: ``` A = array([[0, 1, 2], [0, 2, 0]]) ``` I wish to add rows to this array from another array X if the first element of each row in X mee...

7 Oct at 12:21

How can I get dictionary key as variable directly in Python (not by searching from value)?

Sorry for this basic question but my searches on this are not turning up anything other than how to get a dictionary's key based on its value which I would prefer not to use as I simply want the text/...

17 Jul at 18:33

An existing connection was forcibly closed by the remote host

I am working with a commercial application which is throwing a SocketException with the message, > An existing connection was forcibly closed by the remote host This happens with a socket connection b...

15 Apr at 18:9

has_next in Python iterators?

Have Python iterators got a `has_next` method?

8 Jan at 09:32

How to compare two Dates without the time portion?

I would like to have a compareTo method that ignores the time portion of a java.util.Date. I guess there are a number of ways to solve this. What's the simplest way?

18 Jun at 21:47

python: Change the scripts working directory to the script's own directory

I run a python shell from crontab every minute: ``` * * * * * /home/udi/foo/bar.py ``` `/home/udi/foo` has some necessary subdirectories, like `/home/udi/foo/log` and `/home/udi/foo/config`, which ...

16 Sep at 13:41