Questions

Why does Prettier not format code in VS Code?

In my Nuxt application where ESlint and Prettier are installed and enabled, I switched to Visual Studio Code. When I open a file and press + + and choose , my file does not get [formatted](https:/...

Close iOS Keyboard by touching anywhere using Swift

I have been looking all over for this but I can't seem to find it. I know how to dismiss the keyboard using `Objective-C` but I have no idea how to do that using `Swift`? Does anyone know?

4 Sep at 16:41

In Windows cmd, how do I prompt for user input and use the result in another command?

I have a Windows .bat file which I would like to accept user input and then use the results of that input as part of the call to additional commands. For example, I'd like to accept a process ID from...

27 Jun at 12:49

Is DateTime.Now the best way to measure a function's performance?

I need to find a bottleneck and need to accurately as possible measure time. Is the following code snippet the best way to measure the performance? ``` DateTime startTime = DateTime.Now; // Some ex...

21 Dec at 20:36

"Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo." when using GCC

While attempting to compile my C program, running the following command: ``` gcc pthread.c -o pthread ``` Returns: > Agreeing to the Xcode/iOS license requires admin privileges, please re-run as ...

26 Sep at 18:39

The application may be doing too much work on its main thread

I am new to Android SDK/API environment. It's the first I am trying to draw a plot/chart. I tried running different kinds of sample codes on the emulator using 3 different free libraries, nothing is s...

14 Dec at 00:59

How to leave a message for a github.com user

Need help on GitHub usage. I wonder if there is a way to communicate with a github.com user i.e. write the user a message when only username/id is given on their GitHub page? Does GitHub have this soc...

6 Oct at 02:19

Linux how to copy but not overwrite?

I want to `cp` a directory but I do not want to overwrite any existing files even it they are older than the copied files. And I want to do it completely noninteractive as this will be a part of a Cro...

28 Aug at 15:54

Contains case insensitive

I have the following: ``` if (referrer.indexOf("Ral") == -1) { ... } ``` What I like to do is to make `Ral` case insensitive, so that it can be `RAl`, `rAl`, etc. and still match. Is there a way t...

How to see an HTML page on Github as a normal rendered HTML page to see preview in browser, without downloading?

On [http://github.com](http://github.com) developer keep the HTML, CSS, JavaScript and images files of the project. How can I see the HTML output in browser? For example this: [https://github.com/nec...

16 Dec at 12:38

Deserialize JSON object into dynamic object using Json.net

Is it possible to return a dynamic object from a json deserialization using json.net? I would like to do something like this: ``` dynamic jsonResponse = JsonConvert.Deserialize(json); Console.WriteLi...

1 Apr at 16:23

CSS3 gradient background set on body doesn't stretch but instead repeats?

ok say the content inside the `<body>` totals 300px high. If I set the background of my `<body>` using `-webkit-gradient` or `-moz-linear-gradient` Then I maximize my window (or just make it taller ...

29 Sep at 23:20

How to convert a Bitmap to Drawable in android?

How can I convert a Bitmap image to Drawable ?

17 Oct at 15:37

How can I add an item to a IEnumerable<T> collection?

My question as title above. For example ``` IEnumerable<T> items = new T[]{new T("msg")}; items.ToList().Add(new T("msg2")); ``` but after all it only has 1 item inside. Can we have a method like `it...

7 Oct at 15:38

What is SuppressWarnings ("unchecked") in Java?

Sometime when looking through code, I see many methods specify an annotation: ``` @SuppressWarnings("unchecked") ``` What does this mean?

WCF - How to Increase Message Size Quota

I have a WCF Service which returns 1000 records from database to the client. I have an ASP.NET WCF client (I have added service reference in asp.net web application project to consume WCF). I get th...

19 Jun at 04:36

Remove sensitive files and their commits from Git history

I would like to put a Git project on GitHub but it contains certain files with sensitive data (usernames and passwords, like /config/deploy.rb for capistrano). I know I can add these filenames to , b...

When to throw an exception?

I have exceptions created for every condition that my application does not expect. `UserNameNotValidException`, `PasswordNotCorrectException` etc. However I was told I should not create exceptions f...

28 Nov at 12:47

How to run a cron job inside a docker container?

I am trying to run a cronjob inside a docker container that invokes a shell script. Yesterday I have been searching all over the web and stack overflow, but I could not really find a solution that wor...

9 Mar at 17:25

How to append one file to another in Linux from the shell?

I have two files: `file1` and `file2`. How do I append the contents of `file2` to `file1` so that contents of `file1` persist the process?

5 Apr at 11:4

Nested select statement in SQL Server

Why doesn't the following work? ``` SELECT name FROM (SELECT name FROM agentinformation) ``` I guess my understanding of SQL is wrong, because I would have thought this would return the same thing ...

Is it possible to specify a different ssh port when using rsync?

I have been attempting the following command: ``` rsync -rvz --progress --remove-sent-files ./dir user@host:2222/path ``` SSH is running on port 2222, but rsync still tries to use port 22 and the...

19 Oct at 15:33

How to loop through PHP object with dynamic keys

I tried to parse a JSON file using PHP. But I am stuck now. This is the content of my JSON file: ``` { "John": { "status":"Wait" }, "Jennifer": { "status":"Active" }, ...

28 Dec at 13:18

What is boilerplate code?

A coworker had never heard of this, and I couldn't provide a real definition. For me, it's always been an instance of 'I-know-it-when-I-see-it'. Bonus question, who originated the term?

23 Oct at 14:31

How do I add a delay in a JavaScript loop?

I would like to add a delay/sleep inside a `while` loop: I tried it like this: ``` alert('hi'); for(var start = 1; start < 10; start++) { setTimeout(function () { alert('hello'); }, 3000); ...

3 Mar at 16:19