Questions

Static vs class functions/variables in Swift classes?

The following code compiles in Swift 1.2: ``` class myClass { static func myMethod1() { } class func myMethod2() { } static var myVar1 = "" } func doSomething() { myClass.myM...

14 Apr at 20:17

Getting "net::ERR_BLOCKED_BY_CLIENT" error on some AJAX calls

Recently I've realised that, some adblocker extensions (such as adBlocker plus) block some Ajax calls. I get that error on the console: ``` GET http://localhost/prj/conn.php?q=users/list/ net::ERR_BL...

Explanation of JSONB introduced by PostgreSQL

PostgreSQL just introduced [JSONB](http://www.depesz.com/2014/03/25/waiting-for-9-4-introduce-jsonb-a-structured-format-for-storing-json/) in version 9.4, and it's already trending [on hacker news](ht...

What does numpy.random.seed(0) do?

What does [np.random.seed](https://numpy.org/doc/stable/reference/random/generated/numpy.random.seed.html) do? ``` np.random.seed(0) ```

20 Jun at 03:18

Maintaining the final state at end of a CSS animation

I'm running an animation on some elements that are set to `opacity: 0;` in the CSS. The animation class is applied onClick, and, using keyframes, it changes the opacity from `0` to `1` (among other th...

30 Jan at 19:54

IntelliJ does not show project folders

I have an issue with IntelliJ. It doesn't show any folders in my project view on the left. My setting is "View As: Project" How can I manage it so that the folders and packages are shown again? I don...

19 Jan at 18:33

Android Min SDK Version vs. Target SDK Version

When it comes to developing applications for Android, what is the difference between Min and Target SDK version? Eclipse won't let me create a new project unless Min and Target versions are the same! ...

4 Feb at 02:28

asynchronous and non-blocking calls? also between blocking and synchronous

What is the difference between asynchronous and non-blocking calls? Also between blocking and synchronous calls (with examples please)?

11 May at 03:1

How do I write the 'cd' command in a makefile?

For example, I have something like this in my makefile: ``` all: cd some_directory ``` But when I typed `make` I saw only 'cd some_directory', like in the `echo` command.

19 Aug at 22:54

Better way to check if a Path is a File or a Directory?

I am processing a `TreeView` of directories and files. A user can select either a file or a directory and then do something with it. This requires me to have a method which performs different actions ...

7 Sep at 12:39

Find intersection of two nested lists?

I know how to get an intersection of two flat lists: ``` b1 = [1,2,3,4,5,9,11,15] b2 = [4,5,6,7,8] b3 = [val for val in b1 if val in b2] ``` or ``` def intersect(a, b): return list(set(a) & set(b...

20 Jun at 09:12

How do I install Java on Mac OSX allowing version switching?

I want to install OpenJDK Java on Mac OSX and have it work alongside other JDK's since it is a newer release. Currently, I downloaded the tar.gz and placed it in my path but that is hard to maintain....

29 Sep at 20:52

Fixing Xcode 9 issue: "iPhone is busy: Preparing debugger support for iPhone"

I'm looking for more information on the message below. Xcode 9 seems to be hanging for a couple minutes already... > .Alex’s iPhone is busy: Preparing debugger support for .Alex’s iPhone Xcode will c...

31 Aug at 13:10

Missing Compliance status in TestFlight

When I added my latest build for internal testing with TestFlight, I saw that it had a "Missing Compliance" status. Is this a major problem? Why does this appear? How can I resolve this issue? [](http...

What's the correct way to communicate between controllers in AngularJS?

What's the correct way to communicate between controllers? I'm currently using a horrible fudge involving `window`: ``` function StockSubgroupCtrl($scope, $http) { $scope.subgroups = []; $sc...

12 Feb at 13:35

How to find the last day of the month from date?

How can I get the last day of the month in PHP? Given: ``` $a_date = "2009-11-23" ``` I want 2009-11-30; and given ``` $a_date = "2009-12-23" ``` I want 2009-12-31.

25 Nov at 06:42

Replacing .NET WebBrowser control with a better browser, like Chrome?

Is there any relatively easy way to insert a modern browser into a .NET application? As far as I understand, the `WebBrowser` control is a wrapper for , which wouldn't be a problem except that it lo...

4 Oct at 20:53

How do I display the current value of an Android Preference in the Preference summary?

This must come up very often. When the user is editing preferences in an Android app, I'd like them to be able to see the currently set value of the preference in the `Preference` summary. Example: ...

How to get list of arguments?

I'd like to find a Windows batch counterpart to Bash's `$@` that holds a list of all arguments passed into a script. Or I have to bother with `shift`?

15 Apr at 02:38

How to know the git username and email saved during configuration?

While configuring `git` I ran these two commands: ``` git config --global user.name "My Name" git config --global user.email "myemail@example.com" ``` However, I doubt whether I made a typo or not...

6 Jul at 13:19

Pandas conditional creation of a series/dataframe column

How do I add a `color` column to the following dataframe so that `color='green'` if `Set == 'Z'`, and `color='red'` otherwise? ``` Type Set 1 A Z 2 B Z 3 B ...

20 Nov at 14:4

Building and running app via Gradle and Android Studio is slower than via Eclipse

I have a multi-project (~10 modules) of which building takes about 20-30 seconds each time. When I press Run in Android Studio, I have to wait every time to rebuild the app, which is extremely slow. ...

How do I see the commit differences between branches in git?

I'm on branch-X and have added a couple more commits on top of it. I want to see all the differences between MASTER and the branch that I am on in terms of commits. I could just do a ``` git checkou...

4 Nov at 16:46

Why can't I use the 'await' operator within the body of a lock statement?

The `await` keyword in C# (.NET Async CTP) is not allowed from within a `lock` statement. From [MSDN](https://learn.microsoft.com/en-us/previous-versions/visualstudio/visual-studio-2012/hh191443(v=vs....

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