Questions

Parse Json string in C#

I'm trying to read a Json string in C#, but I'm having trouble figuring out just how to parse the string into C#. Say I have the following Json string ``` [ { "AppName": { "De...

1 Oct at 15:54

How to get certain commit from GitHub project

I need to download the Facebook API from [GitHub](https://github.com/facebook/facebook-ios-sdk). Normally, I just click on the 'Downloads" tab to download the latest source code. In this case, I need ...

13 Dec at 05:4

Android "elevation" not showing a shadow

I have a ListView, and with each list item I want it to show a shadow beneath it. I am using Android Lollipop's new elevation feature to set a Z on the View that I want to cast a shadow, and am alread...

What does `return` keyword mean inside `forEach` function?

``` $('button').click(function () { [1, 2, 3, 4, 5].forEach(function (n) { if (n == 3) { // it should break out here and doesn't alert anything after return false } ...

7 Jan at 11:11

Is it possible to use argsort in descending order?

Consider the following code: ``` avgDists = np.array([1, 8, 6, 9, 4]) ids = avgDists.argsort()[:n] ``` This gives me indices of the `n` smallest elements. Is it possible to use this same `argsort` ...

30 Aug at 08:22

Perform curl request in javascript?

Is it possible to send a curl request in jQuery or javascript? Something like this: ``` curl \ -H 'Authorization: Bearer 6Q************' \ 'https://api.wit.ai/message?v=20140826&q=' ``` So, in PH...

26 Aug at 22:14

How can I divide two integers to get a double?

How do I divide two integers to get a double?

20 Jul at 01:14

How can I check if my python object is a number?

In Java the numeric types all descend from Number so I would use ``` (x instanceof Number). ``` What is the python equivalent?

8 Nov at 09:55

How do you add a timer to a C# console application

Just this - How do you add a timer to a C# console application? It would be great if you could supply some example coding.

25 Nov at 14:4

Maximum Java heap size of a 32-bit JVM on a 64-bit OS

The question is not about the maximum heap size on a 32-bit OS, given that 32-bit OSes have a maximum addressable memory size of 4GB, and that the JVM's max heap size depends on how much contiguous fr...

23 May at 10:30

Add a custom attribute to a Laravel / Eloquent model on load?

I'd like to be able to add a custom attribute/property to an Laravel/Eloquent model when it is loaded, similar to how that might be achieved with [RedBean's](http://redbeanphp.com/manual/models_and_fu...

2 May at 10:12

Functions that return a function

I'm stuck with this concept of 'Functions that return functions'. I'm referring the book 'Object Oriented Javascript' by Stoyan Stefanov. ``` function a() { alert("A!"); function b() { alert...

2 Mar at 07:44

How do I force Maven to use my local repository rather than going out to remote repos to retrieve artifacts?

I’m using Maven 3.3.3 with Java 8 on Mac Yosemite. I have a multi-module project. ``` <modules> <module>first-module</module> <module>my-module</module> … ...

14 Jan at 12:28

Equivalent of LIMIT and OFFSET for SQL Server?

In PostgreSQL there is the `Limit` and `Offset` keywords which will allow very easy pagination of result sets. What is the equivalent syntax for SQL Server?

10 Dec at 09:48

Deprecation warning in Moment.js - Not in a recognized ISO format

I'm getting a warning that a value provided to moment is not in a recognized ISO format. I changed my variable today with the moment function and still it doesn't work. Here's the warning error: > Dep...

6 Jul at 07:3

CSS – why doesn’t percentage height work?

How come a percentage value for `height` doesn’t work but a percentage value for `width` does? [For example](http://jsfiddle.net/g3Yzt/): ``` <div id="working"></div> <div id="not-working"></div> ``...

6 Jan at 09:29

How can I set a cookie with expire time?

I am setting a cookie with JavaScript and it is working fine but it is not taking the expire time I am giving. It keeps on taking session value regardless of what I give, below is the code which I too...

15 Mar at 13:5

Sending message through WhatsApp

Since I found some older posts, that tell that whatsapp doesn't support this, I was wondering if something had changed and if there is a way to open a whatsapp 'chat' with a number that I'm sending th...

Calling async method synchronously

I have an `async` method: ``` public async Task<string> GenerateCodeAsync() { string code = await GenerateCodeService.GenerateCodeAsync(); return code; } ``` I need to call this method from a...

Convert any object to a byte[]

I am writing a prototype TCP connection and I am having some trouble homogenizing the data to be sent. At the moment, I am sending nothing but strings, but in the future we want to be able to send an...

26 May at 06:21

How to upgrade Git to latest version on macOS?

I just bought a new Mac with OS X Lion and I checked in the Terminal what version of git is installed by default. I got the answer ``` git --version > git version 1.7.5.4 ``` I would like to upgrad...

6 May at 17:34

How to Update/Drop a Hive Partition?

After adding a partition to an in , how can I update/drop it?

18 Dec at 03:0

Where to store my Git personal access token?

Is it necessary to store the personal access token somewhere locally on the machine after generating it in GitHub? If yes, is there any preferred way where it could be stored?

17 Nov at 11:4

Read a text file using Node.js?

I need to pass in a text file in the terminal and then read the data from it, how can I do this? ``` node server.js file.txt ``` How do I pass in the path from the terminal, how do I read that on t...

27 Mar at 01:6

Query error with ambiguous column name in SQL

I get an ambiguous column name error with this query (InvoiceID). I can't figure out why. They all seem to be joined correctly so why doesn't SSMS know to display VendorID? Query: ``` SELECT Vend...

24 Apr at 14:30