Questions

How do I run a terminal inside of Vim?

I am used to Emacs, but I am trying out Vim to see which one I like better. One thing that I like about Emacs is the ability to run a terminal inside Emacs. Is this possible inside of Vim? I know th...

31 Dec at 12:30

Python convert tuple to string

I have a tuple of characters like such: ``` ('a', 'b', 'c', 'd', 'g', 'x', 'r', 'e') ``` How do I convert it to a string so that it is like: ``` 'abcdgxre' ```

How to change a table name using an SQL query?

How can I in change the table name using a query statement? I used the following syntax but I couldn't find the rename keyword in SQL server 2005. ``` Alter table Stu_Table rename to Stu_Table_10 ``...

24 Jan at 10:6

How can I remove the extension of a filename in a shell script?

What's wrong with the following code? ``` name='$filename | cut -f1 -d'.'' ``` As is, I get the literal string `$filename | cut -f1 -d'.'`, but if I remove the quotes I don't get anything. Meanwhil...

4 Apr at 22:25

How do I remove duplicates from a C# array?

I have been working with a `string[]` array in C# that gets returned from a function call. I could possibly cast to a `Generic` collection, but I was wondering if there was a better way to do it, poss...

26 Sep at 19:21

Make a negative number positive

I have a Java method in which I'm summing a set of numbers. However, I want any negatives numbers to be treated as positives. So (1)+(2)+(1)+(-1) should equal 5. I'm sure there is very easy way of d...

8 Aug at 09:59

jQuery UI " $("#datepicker").datepicker is not a function"

When i use DatePicker, jQuery's UI plugin, in an existing .aspx page I get errors that: ``` $("#datepicker").datepicker is not a function ``` However, when I copy and paste the same code that creat...

3 Oct at 08:38

Merging dictionaries in C#

What's the best way to merge 2 or more dictionaries (`Dictionary<TKey, TValue>`) in C#? (3.0 features like LINQ are fine). I'm thinking of a method signature along the lines of: ``` public static Dict...

19 Dec at 11:56

How to determine when a Git branch was created?

Is there a way to determine a Git branch was created? I have a branch in my repo and and I don't remember creating it and thought maybe seeing the creation timestamp would jog my memory.

24 Jul at 18:21

Git: How to pull a single file from a server repository in Git?

I am working on a site with a server running Git. I am using Git for deployment (not GitHub). This was set up prior to my involvement using a [hook method](https://danbarber.me/using-git-for-deploymen...

9 Oct at 14:23

Get month name from date in Oracle

How to fetch month name from a given date in Oracle? If the given date is `'15-11-2010'` then I want `November` from this date.

14 Sep at 09:38

How to find SQL Server running port?

Yes I read this [How to find the port for MS SQL Server 2008?](https://stackoverflow.com/questions/1518823/how-to-find-the-port-for-ms-sql-server-2008) no luck. > telnet 1433 returns connection fai...

Convert Linq Query Result to Dictionary

I want to add some rows to a database using Linq to SQL, but I want to make a "custom check" before adding the rows to know if I must add, replace or ignore the incomming rows. I'd like to keep the tr...

4 Jan at 09:38

Python set to list

How can I convert a set to a list in Python? Using ``` a = set(["Blah", "Hello"]) a = list(a) ``` doesn't work. It gives me: ``` TypeError: 'set' object is not callable ```

26 Jul at 10:35

How to concatenate strings of a string field in a PostgreSQL 'group by' query?

I am looking for a way to concatenate the strings of a field within a group by query. So for example, I have a table: | ID | COMPANY_ID | EMPLOYEE | | -- | ---------- | -------- | | 1 | 1 | Anna | ...

Get time in milliseconds using C#

I'm making a program in which I need to get the time in milliseconds. By time, I mean a number that is never equal to itself, and is always 1000 numbers bigger than it was a second ago. I've tried con...

How to find a parent with a known class in jQuery?

I have a `<div>` that has many other `<div>`s within it, each at a different nesting level. Rather than give every child `<div>` an identifier, I rather just give the root `<div>` the identifier. Here...

2 Nov at 05:13

Create Map in Java

I'd like to create a `map` that contains entries consisting of `(int, Point2D)` How can I do this in Java? I tried the following unsuccessfully. ``` HashMap hm = new HashMap(); hm.put(1, new Point...

7 Feb at 04:23

Angular 2 - NgFor using numbers instead collections

...for example... ``` <div class="month" *ngFor="#item of myCollection; #i = index"> ... </div> ``` Is possible to do something like... ``` <div class="month" *ngFor="#item of 10; #i = index"> ......

1 Apr at 10:45

Compare if BigDecimal is greater than zero

How can I compare if `BigDecimal` value is greater than zero?

10 Dec at 16:56

Get the real width and height of an image with JavaScript? (in Safari/Chrome)

I am creating a jQuery plugin. How do I get the real image width and height with Javascript in Safari? The following works with Firefox 3, IE7 and Opera 9: ``` var pic = $("img") // need to remove...

Declare global variables in Visual Studio 2010 and VB.NET

How do I declare a global variable in Visual Basic? These variables need to be accessible from all the Visual Basic forms. I know how to declare a public variable for a specific form, but how do I do...

18 Oct at 08:36

LINQ .Any VS .Exists - What's the difference?

Using LINQ on collections, what is the difference between the following lines of code? ``` if(!coll.Any(i => i.Value)) ``` and ``` if(!coll.Exists(i => i.Value)) ``` When I disassemble `.Exist...

18 Jan at 03:53

How to append rows in a pandas dataframe in a for loop?

I have the following for loop: ``` for i in links: data = urllib2.urlopen(str(i)).read() data = json.loads(data) data = pd.DataFrame(data.items()) data = data.transpose() dat...

28 Jul at 11:21

How to force open links in Chrome not download them?

I want to open a link that is .psd format with Photoshop when clicked in Google Chrome like Firefox that asks me to open or download the file. But Google Chrome downloads the file automatically. How c...

21 Mar at 12:37