Questions

MySQL foreign key constraints, cascade delete

I want to use foreign keys to keep the integrity and avoid orphans (I already use innoDB). How do I make a SQL statment that DELETE ON CASCADE? If I delete a category then how do I make sure that it...

27 May at 07:24

Error in setting JAVA_HOME

I have recently downloaded Maven and followed the instructions given on this [this](http://www.example.com/) page. I already have ant installed on my machine. Now, if I want to verify that Maven is in...

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

Center div on the middle of screen

What is the best pattern to align a semantic ui grid in the middle of the screen? the css for this will ideal be this one. ``` .div{ position: absolute; top: 50%; left: 50%; margin-t...

10 Apr at 13:20

Are complex expressions possible in ng-hide / ng-show?

I want to do so: ``` ng-hide="!globals.isAdmin && mapping.is_default" ``` but the expression evaluates always to `false`. I do not want to define special function on `$scope`.

1 Mar at 20:19

Set database timeout in Entity Framework

My command keeps timing out, so I need to change the default command timeout value. I've found `myDb.Database.Connection.ConnectionTimeout`, but it's `readonly`.

Make xargs execute the command once for each line of input

How can I make xargs execute the command exactly once for each line of input given? It's default behavior is to chunk the lines and execute the command once, passing multiple lines to each instance. ...

13 Oct at 23:43

ORA-12154 could not resolve the connect identifier specified

I have switched over to the 64bit Windows 7 and created a simple web app to test the connection to the database. I am using VS 2010 - plain asp.net web project and I am running the application from wi...

31 Oct at 18:24

How to show PIL Image in ipython notebook

This is my code ``` from PIL import Image pil_im = Image.open('data/empire.jpg') ``` I would like to do some image manipulation on it, and then show it on screen. I am having problem with showing P...

Add and Remove Views in Android Dynamically?

How do I add and remove views such as `TextView`s from Android app like on the original stock Android contacts screen where you press a small icon on the right side of a field and it adds or deletes a...

28 Oct at 06:21

C# testing to see if a string is an integer?

I'm just curious as to whether there is something built into either the C# language or the .NET Framework that tests to see if something is an integer ``` if (x is an int) // Do something ``` It...

25 Jan at 08:35

How can I get a list of all classes within current module in Python?

I've seen plenty of examples of people extracting all of the classes from a module, usually something like: ``` # foo.py class Foo: pass # test.py import inspect import foo for name, obj in ins...

24 Oct at 18:6

Can I pass an array as arguments to a method with variable arguments in Java?

I'd like to be able to create a function like: ``` class A { private String extraVar; public String myFormat(String format, Object ... args){ return String.format(format, extraVar, args); }...

python tuple to dict

For the tuple, `t = ((1, 'a'),(2, 'b'))` `dict(t)` returns `{1: 'a', 2: 'b'}` Is there a good way to get `{'a': 1, 'b': 2}` (keys and vals swapped)? Ultimately, I want to be able to return `1` given...

8 Jun at 19:37

How to include external Python code to use in other files?

If you have a collection of methods in a file, is there a way to include those files in another file, but call them without any prefix (i.e. file prefix)? So if I have: ``` [Math.py] def Calculate (...

3 Apr at 17:35

How to ISO 8601 format a Date with Timezone Offset in JavaScript?

Find the `local time` and `UTC time offset` then construct the URL in following format. Example URL: `/Actions/Sleep?duration=2002-10-10T12:00:00−05:00` The format is based on the [W3C recommendation...

Why use Redux over Facebook Flux?

I've read [this answer](https://stackoverflow.com/questions/32021763/what-could-be-the-downsides-of-using-redux-instead-of-flux), [reducing boilerplate](http://redux.js.org/docs/recipes/ReducingBoiler...

Page redirect with successful Ajax request

I have a form that uses Ajax for client-side verification. The end of the form is the following: ``` $.ajax({ url: 'mail3.php', type: 'POST', data: 'contactName=' + name + '&c...

18 Aug at 16:37

How can I find out what version of Log4J I am using?

As we all know, at least four or five Log4j JAR files end up being in the classpath. How can I tell which version I am using?

26 Jan at 03:31

Configuring diff tool with .gitconfig

How do I configure Git to use a different tool for diffing with the .gitconfig file? I have this in my .gitconfig: ``` [diff] tool = git-chdiff #also tried /bin/git-chdiff ``` It does not work...

20 Jul at 23:26

Set session variable in laravel

I would like to set a variable in the session using laravel this way ``` Session::set('variableName')=$value; ``` but the problem is that I don't know where to put this code, 'cause I would like to...

what is the difference between GROUP BY and ORDER BY in sql

When do you use which in general? Examples are highly encouraged! I am referring so MySql, but can't imagine the concept being different on another DBMS

25 Apr at 03:2

Auto-redirect to another HTML page

What is the syntax for making a page auto-redirect to a different HTML file in a separate folder? All of my searching returns how to redirect from one website to another.

14 Mar at 22:43

Check if image exists on server using JavaScript?

Using javascript is there a way to tell if a resource is available on the server? For instance I have images 1.jpg - 5.jpg loaded into the html page. I'd like to call a JavaScript function every minut...

16 Sep at 21:42

Android studio 3.2.1 ArtifactResolveException: Could not resolve all artifacts for configuration ':classpath'

After I update Android Studio to 3.2.1 and gradle version in my project I am getting following build error. I have already checked lots of questions related this question but no luck. ``` buildscr...