Questions

How to change the DataTable Column Name?

I have one DataTable which has four columns such as ``` StudentID CourseID SubjectCode Marks ------------ ---------- ------------- -------- 1 ...

20 Jun at 05:44

How to remove leading and trailing zeros in a string? Python

I have several alphanumeric strings like these ``` listOfNum = ['000231512-n','1209123100000-n00000','alphanumeric0000', '000alphanumeric'] ``` The desired output for removing zeros would be: ```...

How can I export tables to Excel from a webpage

How can I export tables to Excel from a webpage. I want the export to contain all the formatting and colours.

17 Sep at 20:50

Git push error: Unable to unlink old (Permission denied)

In the remote server I have a post-receive hook set up in order to make a git checkout of my repository: ``` #!/bin/sh GIT_WORK_TREE=/var/www/<website> git checkout -f ``` But when I make a push fr...

23 Jan at 05:49

If "0" then leave the cell blank

I am trying to create a simple ledger and on the far right of the "Book" it totals any debit/credit that I input. But instead of leaving the unused rows blank, it keeps repeating the latest total to t...

6 Dec at 20:49

Pass variables to Ruby script via command line

I've installed RubyInstaller on Windows and I'm running [IMAP Sync](http://wonko.com/post/ruby_script_to_sync_email_from_any_imap_server_to_gmail) but I need to use it to sync hundreds of accounts. If...

7 Oct at 21:44

A top-like utility for monitoring CUDA activity on a GPU

I'm trying to monitor a process that uses CUDA and MPI, is there any way I could do this, something like the command "top" but that monitors the GPU too?

How to use MySQLdb with Python and Django in OSX 10.6?

This is a much discussed issue for OSX 10.6 users, but I haven't been able to find a solution that works. Here's my setup: Python 2.6.1 64bit Django 1.2.1 MySQL 5.1.47 osx10.6 64bit I create a virtu...

Fit Image in ImageButton in Android

I have 6 ImageButton in my activity, I set images through my code in them ( not using xml). I want them to cover 75% of the button area. But where as some images cover less area, some are too big to ...

function is not defined error in Python

I am trying to define a basic function in python but I always get the following error when I run a simple test program; ``` >>> pyth_test(1, 2) Traceback (most recent call last): File "<pyshell#2>...

5 Sep at 01:55

Floating Point Exception C++ Why and what is it?

I'm building a program for the Euler projects question 3, and while that might not really matter as a result I'm current trying to make this code take a number and test if it is prime or not. Now then...

21 Oct at 20:57

What is lazy loading in Hibernate?

What is lazy loading in Java? I don't understand the process. Can anybody help me to understand the process of lazy loading?

1 May at 00:42

Optional query string parameters in ASP.NET Web API

I need to implement the following WebAPI method: ``` /api/books?author=XXX&title=XXX&isbn=XXX&somethingelse=XXX&date=XXX ``` All of the query string parameters can be null. That is, the caller can ...

13 Sep at 12:28

Convert string to boolean in C#

I need help converting a string to a bool value: I've been trying to get the value (true or false) from the TopMost for my program and save it in my settings. ``` Settings1.Default["tm"] = ; Setting...

1 Apr at 01:12

Linq select to new object

I have a linq query ``` var x = (from t in types select t).GroupBy(g =>g.Type) ``` which groups objects by their type, as a result I want to have single new object containing all of the grouped ob...

25 May at 17:20

Using Excel VBA to run SQL query

I am fairly new to SQL and VBA. I have written a SQL query that I would like to be able to call and run from a VBA sub in an excel workbook and then bring the query results into the workbook. I have f...

6 Feb at 19:7

How do you convert Html to plain text?

I have snippets of Html stored in a table. I would like to be able to display that Html as text only, , on a given page (actually just the first 30 - 50 characters but that's the easy bit). How do ...

27 May at 19:5

How to get row number in dataframe in Pandas?

How can I get the number of the row in a dataframe that contains a certain value in a certain column using Pandas? For example, I have the following dataframe: ``` ClientID LastName 0 34 J...

3 Apr at 20:42

What properties can I use with event.target?

I need to identify elements from which events are fired. Using `event.target` gets the respective element. What properties can I use from there? - - - I cannot find a whole lot of info on it, ev...

8 Jul at 15:8

How to run vi on docker container?

I have installed docker on my host virtual machine. And now want to create a file using `vi`. But it's showing me an error: ``` bash: vi: command not found ```

30 Oct at 00:45

How to grep, excluding some patterns?

I'd like find lines in files with an occurrence of some pattern and an absence of some other pattern. For example, I need find all files/lines including `loom` except ones with `gloom`. So, I can find...

20 Jun at 09:12

Combining two lists and removing duplicates, without removing duplicates in original list

I have two lists that i need to combine where the second list has any duplicates of the first list ignored. .. A bit hard to explain, so let me show an example of what the code looks like, and what i ...

23 Aug at 19:49

Difference between HashSet and HashMap?

Apart from the fact that `HashSet` does not allow duplicate values, what is the difference between `HashMap` and `HashSet`? I mean implementation wise? It's a little bit vague because both use to st...

3 Nov at 05:21

jQuery: How to get to a particular child of a parent?

To give a simplified example, I've got the following block repeated on the page lots of times (it's dynamically generated): ``` <div class="box"> <div class="something1"></div> <div class="some...

R apply function with multiple parameters

I have a function `f(var1, var2)` in R. Suppose we set `var2 = 1` and now I want to apply the function `f()` to the list `L`. Basically I want to get a new list L* with the outputs ``` [f(L[1],1),f(...

17 May at 13:18