Questions

Android Support plugin for IntelliJ IDEA (or Android Studio) cannot open this project

I've tried to run Android Studio project from github but I've got this message: ``` This version of the Android Support plugin for IntelliJ IDEA (or Android Studio) cannot open this project, please re...

1 Jul at 14:10

Enumerate or map through a list with index and value in Dart

In dart there any equivalent to the common: ``` enumerate(List) -> Iterator((index, value) => f) or List.enumerate() -> Iterator((index, value) => f) or List.map() -> Iterator((index, value) => f) ...

24 Sep at 06:32

How kubectl port-forward works?

`kubectl` exposes commands that can be used to create a Service for an application and assigns an IP address to access it from internet. As far as I understand, to access any application within Kuber...

22 Apr at 05:33

How to specify credentials when connecting to boto3 S3?

On boto I used to specify my credentials when connecting to S3 in such a way: ``` import boto from boto.s3.connection import Key, S3Connection S3 = S3Connection( settings.AWS_SERVER_PUBLIC_KEY, setti...

JAVA_HOME is set to an invalid directory:

I have set `JAVA_HOME` in my system `C:\Program Files\Java\jdk1.8.0_ 131\bin;` and I am trying to run cordova command( cordova build ) on command prompt, but I'm getting the error bellow. I have tried...

22 Apr at 21:18

VirtualBox Cannot register the hard disk already exists

I created a virtual disk file . Then I moved it into another folder. I tried to update VM settings (right click on virtual machine -> settings -> Storage -> Controller SATA tab, path). I wanted to se...

22 May at 14:0

How can I get the arguments called in jest mock function?

How can I get the arguments called in jest mock function? I want to inspect the object that is passed as argument.

13 Oct at 19:1

How to redirect docker container logs to a single file?

I want to redirect all the logs of my docker container to single log file to analyse them. I tried ``` docker logs container > /tmp/stdout.log 2>/tmp/stderr.log ``` but this gives log in two diffe...

20 Sep at 11:15

How to mock imported named function in Jest when module is unmocked

I have the following module I'm trying to test in Jest: ``` // myModule.js export function otherFn() { console.log('do something'); } export function testFn() { otherFn(); // do other things...

28 Sep at 18:48

How to check if a value exists in an object using JavaScript

I have an object in JavaScript: ``` var obj = { "a": "test1", "b": "test2" } ``` How do I check that test1 exists in the object as a value?

9 Jul at 19:46

querySelector vs. getElementById

I have heard that `querySelector` and `querySelectorAll` are new methods to select DOM elements. How do they compare to the older methods, `getElementById` and `getElementsByClassName` in terms of per...

15 Feb at 18:1

Build not visible in itunes connect

I want to test in app purchases therefore I uploaded build with xcode. I can see the build under "Prerelase" but not in "Versions". How long does it take to show up in "Versions"? It's been 30 minutes...

11 Sep at 09:52

Filtering a list based on a list of booleans

I have a list of values which I need to filter given the values in a list of booleans: ``` list_a = [1, 2, 4, 6] filter = [True, False, True, False] ``` I generate a new filtered list with the foll...

6 Sep at 21:51

PHP Composer update "cannot allocate memory" error (using Laravel 4)

I just can't solve this one. I'm on Linode 1G RAM basic plan. Trying to install a package via Composer and it's not letting me. My memory limit is set to "-1" on PHP.ini Is there anything else I can...

6 Oct at 23:2

CROSS JOIN vs INNER JOIN in SQL

What is the difference between `CROSS JOIN` and `INNER JOIN`? ``` SELECT Movies.CustomerID, Movies.Movie, Customers.Age, Customers.Gender, Customers.[Education Level], Customers.[Int...

How to alias a table in Laravel Eloquent queries (or using Query Builder)?

Lets say we are using Laravel's query builder: ``` $users = DB::table('really_long_table_name') ->select('really_long_table_name.id') ->get(); ``` I'm looking for an equivalent ...

20 Jun at 06:3

Saving and Reading Bitmaps/Images from Internal memory in Android

What I want to do, is to save an image to the internal memory of the phone . How can I do it? I have got the image directly from the camera to the image view in my app its all working fine. Now wha...

Objective-C implicit conversion loses integer precision 'NSUInteger' (aka 'unsigned long') to 'int' warning

I'm working through some exercises and have got a warning that states: > ``` #import <Foundation/Foundation.h> int main (int argc, const char * argv[]) { @autoreleasepool { NSArray *...

Get local href value from anchor (a) tag

I have an anchor tag that has a local href value, and a JavaScript function that uses the href value but directs it to a slightly different place than it would normally go. The tag looks like ``` <a...

15 Mar at 18:39

Cannot install node modules that require compilation on Windows 7 x64/VS2012

I cannot install any of the modules that require compilation. All they fail with the following error: ``` MSBUILD : error MSB3411: Could not load the Visual C++ component "VCBuild.exe". ... ``` My ...

11 Jan at 12:40

Get host domain from URL?

how to get host domain from a string URL? GetDomain has 1 input "URL", 1 Output "Domain" Example1 ``` INPUT: http://support.domain.com/default.aspx?id=12345 OUTPUT: support.domain.com ``` Example...

8 Jan at 10:42

How can I fill a div with an image while keeping it proportional?

I found this thread — [How do you stretch an image to fill a <div> while keeping the image's aspect-ratio?](https://stackoverflow.com/questions/1891857/how-do-you-stretch-an-image-to-fill-a-div-while-...

11 Jul at 17:57

Where is the documentation for the values() method of Enum?

I declare an enum as : ``` enum Sex {MALE,FEMALE}; ``` And then, iterate enum as shown below : ``` for(Sex v : Sex.values()){ System.out.println(" values :"+ v); } ``` I checked the Java AP...

29 Oct at 04:0

How to Display Selected Item in Bootstrap Button Dropdown Title

I am using the bootstrap Dropdown component in my application like this: ``` <div class="btn-group"> <button class="btn">Please Select From List</button> <button class="btn dropdown-toggle" d...

17 Mar at 12:28

npm can't find package.json

I'm trying to install the dependencies of some example: npm's `express 2.5.8` that I've downloaded, but all of the apps throw the same error: ``` c:\node\stylus>npm install -d npm info it worked if i...

21 Jun at 19:9