Questions

Use String.split() with multiple delimiters

I need to split a string base on delimiter `-` and `.`. Below are my desired output. `AA.BB-CC-DD.zip` -> ``` AA BB CC DD zip ``` but my following code does not work. ``` private void getId(Str...

15 Apr at 20:24

Why does this iterative list-growing code give IndexError: list assignment index out of range? How can I repeatedly add (append) elements to a list?

I tried writing some code like: ``` i = [1, 2, 3, 5, 8, 13] j = [] k = 0 for l in i: j[k] = l k += 1 ``` But I get an error message that says `IndexError: list assignment index out of range`...

11 Oct at 03:37

Java: Check if enum contains a given string?

Here's my problem - I'm looking for (if it even exists) the enum equivalent of `ArrayList.contains();`. Here's a sample of my code problem: ``` enum choices {a1, a2, b1, b2}; if(choices.???(a1)}{ /...

22 Jan at 09:22

Is it possible to import a whole directory in sass using @import?

I'm modularizing my stylesheets with SASS partials like so: ``` @import partials/header @import partials/viewport @import partials/footer @import partials/forms @import partials/list_container @import...

24 Jun at 23:13

Dictionary text file

I am writing a program that needs a list of English words as a source file for it to work. I realise that these source files are available for students writing games such as Hangman or Crossword solve...

25 Aug at 06:24

Get full path without filename from path that includes filename

Is there anything built into `System.IO.Path` that gives me just the filepath? For example, if I have a `string` > @"c:\webserver\public\myCompany\configs\promo.xml", is there any BCL method that ...

22 Apr at 16:3

navigator.geolocation.getCurrentPosition sometimes works sometimes doesn't

So I have a pretty simple bit of JS using the navigator.geolocation.getCurrentPosition jammy. ``` $(document).ready(function(){ $("#business-locate, #people-locate").click(function() { navigato...

3 Aug at 15:0

What does it mean: The serializable class does not declare a static final serialVersionUID field?

I have the warning message given in the title. I would like to understand and remove it. I found already some answers on this question but I do not understand these answers because of an overload with...

18 Feb at 13:40

Why use try {} finally {} with an empty try block?

I noticed in `System.Threading.TimerBase.Dispose()` the method has a `try{} finally{}` block but the `try{}` is empty. Is there any value in using `try{} finally{}` with an empty `try`? [http://labs...

4 Feb at 08:56

How to create NSIndexPath for TableView

I need delete row 1 of a table in a function I have defined. In order to use `deleteRowAtIndexPath` you must use an `IndexPath` with a section and row defined. How can I create an indexpath like this?...

30 May at 11:39

nullable object must have a value

There is paradox in the exception description: Nullable object must have a value (?!) This is the problem: I have a `DateTimeExtended` class, that has ``` { DateTime? MyDataTime; int? otherda...

Execute stored procedure with an Output parameter?

I have a stored procedure that I am trying to test. I am trying to test it through SQL Management Studio. In order to run this test I enter ... ``` exec my_stored_procedure 'param1Value', 'param2Valu...

9 Oct at 02:54

any tool for java object to object mapping?

I am trying to convert DO to DTO using java and looking for automated tool before start writing my own. I just wanted to know if there any free tool available for the same.

24 Jun at 19:12

How may I sort a list alphabetically using jQuery?

I'm a bit out of my depth here and I'm hoping this is actually possible. I'd like to be able to call a function that would sort all the items in my list alphabetically. I've been looking through the...

15 Oct at 19:30

Why Would I Ever Need to Use C# Nested Classes

I'm trying to understand about nested classes in C#. I understand that a nested class is a class that is defined within another class, what I don't get is why I would ever need to do this.

25 Sep at 10:23

Initialise a list to a specific length in Python

How do I initialise a list with 10 times a default value in Python? I'm searching for a good-looking way to initialize a empty list with a specific range. So make a list that contains 10 zeros or so...

4 Nov at 13:28

How can a LEFT OUTER JOIN return more records than exist in the left table?

I have a very basic LEFT OUTER JOIN to return all results from the left table and some additional information from a much bigger table. The left table contains 4935 records yet when I LEFT OUTER JOIN ...

21 Sep at 19:25

How do I create a slug in Django?

I am trying to create a `SlugField` in Django. I created this simple model: ``` from django.db import models class Test(models.Model): q = models.CharField(max_length=30) s = models.SlugFie...

10 May at 18:34

How to retrieve checkboxes values in jQuery

How to use [jQuery](http://en.wikipedia.org/wiki/JQuery) to get the checked checkboxes values, and put it into a textarea immediately? Just like this code: ``` <html> <head> </head> <body> ...

3 Nov at 02:36

Why doesn't java.util.Set have get(int index)?

I'm sure there's a good reason, but could someone please explain why the `java.util.Set` interface lacks `get(int Index)`, or any similar `get()` method? It seems that sets are great for putting thin...

13 Mar at 13:40

Questions every good .NET developer should be able to answer?

My company is about to hire . We work on a variety of .NET platforms: ASP.NET, Compact Framework, Windowsforms, Web Services. I'd like to compile a list/catalog of good questions, a kind of minimum st...

24 Dec at 10:32

How can I completely remove TFS Bindings

I have a solution that contains a good deal of projects, I would like to remove the source control bindings completely, how can I do this? What I really want to do is move one solution and its pro...

How to delete files older than X hours

I'm writing a bash script that needs to delete old files. It's currently implemented using : ``` find $LOCATION -name $REQUIRED_FILES -type f -mtime +1 -delete ``` This will delete of the files ol...

30 Oct at 08:31

Unsubscribe anonymous method in C#

Is it possible to unsubscribe an anonymous method from an event? If I subscribe to an event like this: ``` void MyMethod() { Console.WriteLine("I did it!"); } MyEvent += MyMethod; ``` I can u...

8 Oct at 15:24

Stop jQuery .load response from being cached

I have the following code making a GET request on a URL: ``` $('#searchButton').click(function() { $('#inquiry').load('/portal/?f=searchBilling&pid=' + $('#query').val()); }); ``` B...

3 Oct at 21:23