Delete directories recursively in Java
Is there a way to delete entire directories recursively in Java? In the normal case it is possible to delete an empty directory. However when it comes to deleting entire directories with contents, it...
- Modified
- 14 Sep at 13:35
TypeError: You provided an invalid object where a stream was expected. You can provide an Observable, Promise, Array, or Iterable
I am trying to `map` from a service call but getting an error. Looked at [subscribe is not defined in angular 2?](https://stackoverflow.com/questions/41995647/subscribe-is-not-defined-in-angular-2) an...
- Modified
- 19 Mar at 20:18
Decimal values in SQL for dividing results
In SQL, I have `col1` and `col2`. Both are integers. I want to do like: ``` select col1/col2 from tbl1 ``` I get the result `1` where `col1=3` and `col2=2` The result I want is `1.1` I put `roun...
- Modified
- 15 May at 12:22
java.lang.NoClassDefFoundError: Could not initialize class org.codehaus.groovy.vmplugin.v7.Java7
I am getting this exception `java.lang.NoClassDefFoundError: Could not initialize class org.codehaus.groovy.vmplugin.v7.Java7 and java.lang.NoClassDefFoundError: Could not initialize class org.codeha...
- Modified
- 28 Aug at 11:56
Generating Fibonacci Sequence
``` var x = 0; var y = 1; var z; fib[0] = 0; fib[1] = 1; for (i = 2; i <= 10; i++) { alert(x + y); fib[i] = x + y; x = y; z = y; } ``` I'm trying to get to generate a simple Fibonacci Sequ...
- Modified
- 10 May at 03:45
Easiest way to compare arrays in C#
In Java, `Arrays.equals()` allows to easily compare the content of two basic arrays (overloads are available for all the basic types). Is there such a thing in C#? Is there any "magic" way of compari...
Thread-safe List<T> property
I want an implementation of `List<T>` as a property which can be used thread-safely without any doubt. Something like this: ``` private List<T> _list; private List<T> MyT { get { // return a co...
- Modified
- 2 Jun at 04:28
How do I get an element to scroll into view, using jQuery?
I have an HTML document with images in a grid format using `<ul><li><img...`. The browser window has both vertical & horizontal scrolling. When I click on an image `<img>`, how then do I get the w...
- Modified
- 9 Nov at 02:16
CSS : center form in page horizontally and vertically
How can i center the form called form_login horizontally and vertically in my page ? Here is the HTML I'm using right now: ``` <body> <form id="form_login"> <p> <input type="...
What is JNDI? What is its basic use? When is it used?
- What is ?- What is its basic use?- When is it used?
- Modified
- 23 Apr at 12:31
Python UTC datetime object's ISO format doesn't include Z (Zulu or Zero offset)
Why python 2.7 doesn't include Z character (Zulu or zero offset) at the end of UTC datetime object's isoformat string unlike JavaScript? ``` >>> datetime.datetime.utcnow().isoformat() '2013-10-29T09:...
- Modified
- 15 Apr at 17:7
No grammar constraints (DTD or XML schema) detected for the document
I have this dtd : [http://fast-code.sourceforge.net/template.dtd](http://fast-code.sourceforge.net/template.dtd) But when I include in an xml I get the warning : No grammar constraints (DTD or XML sch...
- Modified
- 26 May at 12:15
Equal height rows in CSS Grid Layout
I gather that this is impossible to achieve using Flexbox, as each row can only be the minimal height required to fit its elements, but can this be achieved using the newer CSS Grid? To be clear, I w...
- Modified
- 12 Jun at 18:32
In Java, how do I call a base class's method from the overriding method in a derived class?
I have two Java classes: B, which extends another class A, as follows : ``` class A { public void myMethod() { /* ... */ } } class B extends A { public void myMethod() { /* Another code */ }...
- Modified
- 18 Dec at 13:32
How to pass data to view in Laravel?
Im passing data to my blade view with `return View::make('blog', $posts);` and in my blade view I'm trying to run an `@foreach ($posts as $post)` I end up with an error saying that `$posts` isn't defi...
- Modified
- 26 Dec at 10:54
Convert integer into byte array (Java)
what's a fast way to convert an `Integer` into a `Byte Array`? e.g. `0xAABBCCDD => {AA, BB, CC, DD}`
Find unused npm packages in package.json
Is there a way to determine if you have packages in your `package.json` file that are no longer needed? For instance, when trying out a package and later commenting or deleting code, but forgetting to...
- Modified
- 20 Oct at 13:10
How can I convert this foreach code to Parallel.ForEach?
I am a bit of confused about `Parallel.ForEach`. What is `Parallel.ForEach` and what does it exactly do? Please don't reference any MSDN link. Here's a simple example : ``` string[] lines = File....
- Modified
- 14 Dec at 21:44
Creating a zero-filled pandas data frame
What is the best way to create a zero-filled pandas data frame of a given size? I have used: ``` zero_data = np.zeros(shape=(len(data),len(feature_list))) d = pd.DataFrame(zero_data, columns=featur...
Can you get the column names from a SqlDataReader?
After connecting to the database, can I get the name of all the columns that were returned in my `SqlDataReader`?
- Modified
- 11 Aug at 09:27
What does 'index 0 is out of bounds for axis 0 with size 0' mean?
I am new to both python and numpy. I ran a code that I wrote and I am getting this message: 'index 0 is out of bounds for axis 0 with size 0' Without the context, I just want to figure out what this m...
- Modified
- 8 Feb at 22:17
How does the SQL injection from the "Bobby Tables" XKCD comic work?
Just looking at: ![XKCD Strip](https://i.stack.imgur.com/G0ifh.png) [https://xkcd.com/327/](https://xkcd.com/327/) What does this SQL do: ``` Robert'); DROP TABLE STUDENTS; -- ``` I know both `'`...
- Modified
- 21 Mar at 21:26
Cycles in family tree software
I am the developer of some family tree software (written in C++ and Qt). I had no problems until one of my customers mailed me a bug report. The problem is that the customer has two children with thei...
- Modified
- 13 Aug at 23:13
Quick Way to Implement Dictionary in C
One of the things which I miss while writing programs in C is a dictionary data structure. What's the most convenient way to implement one in C? I am not looking for performance, but ease of coding it...
- Modified
- 31 Dec at 15:44
Search for string within text column in MySQL
I have mysql table that has a column that stores xml as a string. I need to find all tuples where the xml column contains a given string of 6 characters. Nothing else matters--all I need to know is if...