Questions

SQL server query to get the list of columns in a table along with Data types, NOT NULL, and PRIMARY KEY constraints

I need to write a query on SQL server to get the list of columns in a particular table, its associated data types (with length) and if they are not null. And I have managed to do this much. But now ...

Message Queue vs. Web Services?

Under what conditions would one favor apps talking via a message queue instead of via web services (I just mean XML or JSON or YAML or whatever over HTTP here, not any particular type)? I have to tal...

5 Mar at 01:21

Is it possible to GROUP BY multiple columns using MySQL?

Is it possible to `GROUP BY` more than one column in a MySQL `SELECT` query? For example: ``` GROUP BY fV.tier_id AND 'f.form_template_id' ```

29 Mar at 13:40

Searching if value exists in a list of objects using Linq

Say I have a class `Customer` which has a property `FirstName`. Then I have a `List<Customer>`. Can LINQ be used to find if the list has a customer with `Firstname = 'John'` in a single statement.. h...

28 May at 12:16

Simulate delayed and dropped packets on Linux

I would like to simulate packet delay and loss for `UDP` and `TCP` on Linux to measure the performance of an application. Is there a simple way to do this?

5 Mar at 14:6

Prevent browser caching of AJAX call result

It looks like if I load dynamic content using `$.get()`, the result is cached in browser. Adding some random string in QueryString seems to solve this issue (I use `new Date().toString()`), but this ...

16 Mar at 06:49

Make Maven to copy dependencies into target/lib

How do I get my project's runtime dependencies copied into the `target/lib` folder? As it is right now, after `mvn clean install` the `target` folder contains only my project's jar, but none of the...

Error handling in Bash

What is your favorite method to handle errors in Bash? The best example of handling errors I have found on the web was written by William Shotts, Jr at [http://www.linuxcommand.org](http://www.linuxc...

<div> cannot appear as a descendant of <p>

I'm seeing this. It's not a mystery what it is complaining about: ``` Warning: validateDOMnesting(...): <div> cannot appear as a descendant of <p>. See ... SomeComponent > p > ... > SomeOtherComponen...

6 Dec at 16:52

"Please provide a valid cache path" error in laravel

I duplicated a working laravel app and renamed it to use for another app. I deleted the vendor folder and run the following commands again: ``` composer self-update composer-update npm install bo...

27 Feb at 15:24

React.js: Set innerHTML vs dangerouslySetInnerHTML

Is there any "behind the scenes" difference from setting an element's innerHTML vs setting the dangerouslySetInnerHTML property on an element? Assume I'm properly sanitizing things for the sake of sim...

24 Aug at 07:45

React native text going off my screen, refusing to wrap. What to do?

The following code can be found in [this live example](https://rnplay.org/apps/dN8pPA) I've got the following react native element: ``` 'use strict'; var React = require('react-native'); var { Ap...

30 Mar at 12:49

What are workers, executors, cores in Spark Standalone cluster?

I read [Cluster Mode Overview](http://spark.apache.org/docs/latest/cluster-overview.html) and I still can't understand the different processes in the and the parallelism. Is the worker a JVM process...

1 Sep at 20:43

Rename specific column(s) in pandas

I've got a dataframe called `data`. How would I rename the only one column header? For example `gdp` to `log(gdp)`? ``` data = y gdp cap 0 1 2 5 1 2 3 9 2 8 7 2 3 3 ...

7 Apr at 09:42

Select distinct using linq

I have a class list of class ``` public class LinqTest { public int id { get; set; } public string value { get; set; } } List<LinqTest> myList = new List<LinqTest>(); myList.Add(new LinqTest() { id...

9 Aug at 04:5

Processing Symbol Files in Xcode

I was wondering if anyone could tell me what Xcode is actually doing when it says: "Processing Symbol Files" after plugging in your device? ![Screenshot](https://cdn-images-1.medium.com/max/800/1*DLF...

8 Oct at 13:19

What's the point of the X-Requested-With header?

JQuery and other frameworks add the following header: > X-Requested-With: XMLHttpRequest Why is this needed? Why would a server want to treat AJAX requests differently than normal requests? : I jus...

14 Jan at 20:8

Access mysql remote database from command line

I have a server with Rackspace. I want to access the database from my local machine command line. I tried like: ``` mysql -u username -h my.application.com -ppassword ``` But it gives an error: > ERR...

20 Jun at 09:12

Where do I mark a lambda expression async?

I've got this code: ``` private async void ContextMenuForGroupRightTapped(object sender, RightTappedRoutedEventArgs args) { CheckBox ckbx = null; if (sender is CheckBox) { ckbx = ...

How do I add a linker or compile flag in a CMake file?

I am using the `arm-linux-androideabi-g++` compiler. When I try to compile a simple "Hello, World!" program it compiles fine. When I test it by adding a simple exception handling in that code it works...

2 Oct at 05:14

Short form for Java if statement

I know there is a way for writing a Java `if` statement in short form. ``` if (city.getName() != null) { name = city.getName(); } else { name="N/A"; } ``` Does anyone know how to write the ...

Android Facebook style slide

The new Facebook application and its navigation is so cool. I was just trying to see how it can be emulated in my application. Anyone has a clue how it can be achieved? ![enter image description he...

How to run cron job every 2 hours?

How can I write a Crontab that will run my `/home/username/test.sh` script every 2 hours?

19 May at 01:19

String.Replace ignoring case

I have a string called "hello world" I need to replace the word "world" to "csharp" for this I use: ``` string.Replace("World", "csharp"); ``` but as a result, I don't get the string replaced. Th...

15 Dec at 17:40

How to hash some String with SHA-256 in Java?

How can I hash some `String` with `SHA-256` in Java?