Inline functions in C#?
How do you do "inline functions" in C#? I don't think I understand the concept. Are they like anonymous methods? Like lambda functions? : The answers almost entirely deal with the ability to [inline ...
- Modified
- 23 May at 12:10
Javascript Array.sort implementation?
Which algorithm does the JavaScript `Array#sort()` function use? I understand that it can take all manner of arguments and functions to perform different kinds of sorts, I'm simply interested in whic...
- Modified
- 28 Jan at 14:18
How to check if a process is running via a batch script
How can I check if an application is running from a batch (well cmd) file? I need to not launch another instance if a program is already running. (I can't change the app to make it single instance on...
- Modified
- 2 Oct at 14:45
Make React useEffect hook not run on initial render
According to the docs: > `componentDidUpdate()` is invoked immediately after updating occurs. This method is not called for the initial render. We can use the new `useEffect()` hook to simulate `com...
- Modified
- 12 Nov at 06:52
Pandas create empty DataFrame with only column names
I have a dynamic DataFrame which works fine, but when there are no data to be added into the DataFrame I get an error. And therefore I need a solution to create an empty DataFrame with only the column...
Write / add data in JSON file using Node.js
I am trying to write JSON file using node from loop data, e.g.: ``` let jsonFile = require('jsonfile'); for (i = 0; i < 11; i++) { jsonFile.writeFile('loop.json', "id :" + i + " square :" + i * ...
- Modified
- 24 Sep at 14:6
Chrome / Safari not filling 100% height of flex parent
I want to have a vertical menu with a specific height. Each child must fill the height of the parent and have middle-aligned text. The number of children is random, so I have to work with dynamic va...
- Modified
- 11 Jul at 02:58
pandas groupby, then sort within groups
I want to group my dataframe by two columns and then sort the aggregated results within those groups. ``` In [167]: df Out[167]: count job source 0 2 sales A 1 4 sales ...
trying to animate a constraint in swift
I have a `UITextField` that I want to enlarge its width when tapped on. I set up the constraints and made sure the constraint on the left has the lower priority then the one that I am trying to animat...
- Modified
- 2 Sep at 09:23
Using Java 8's Optional with Stream::flatMap
The new Java 8 stream framework and friends make for some very concise Java code, but I have come across a seemingly-simple situation that is tricky to do concisely. Consider a `List<Thing> things` an...
- Modified
- 17 May at 06:59
Django gives Bad Request (400) when DEBUG = False
I am new to django-1.6. When I run the django server with `DEBUG = True`, it's running perfectly. But when I change `DEBUG` to `False` in the settings file, then the server stopped and it gives the fo...
Why is Node.js single threaded?
In PHP (or Java/ASP.NET/Ruby) based webservers every client request is instantiated on a new thread. But in Node.js all the clients run on the same thread (they can even share the same variables!) I u...
- Modified
- 29 Oct at 14:47
TypeScript: Creating an empty typed container array
I am creating simple logic game called "Three of a Crime" in TypeScript. When trying to pre-allocated typed array in TypeScript, I tried to do something like this: ``` var arr = Criminal[]; ``` wh...
- Modified
- 26 Feb at 05:2
Class 'DOMDocument' not found
I've found an error on a page in my Magento application; it always show this message error when I visit it: > Fatal error: Class 'DOMDocument' not found in /home/.../lib/Zend/Feed/Abstract.php on lin...
- Modified
- 11 Jul at 06:49
How to get index in Handlebars each helper?
I'm using Handlebars for templating in my project. Is there a way to get the index of the current iteration of an "each" helper in Handlebars? ``` <tbody> {{#each item}} <tr> ...
- Modified
- 18 Apr at 16:21
Comparing mongoose _id and strings
I have a node.js application that pulls some data and sticks it into an object, like this: ``` var results = new Object(); User.findOne(query, function(err, u) { results.userId = u._id; } ``` ...
git revert back to certain commit
how do i revert all my files on my local copy back to a certain commit? ``` commit 4a155e5b3b4548f5f8139b5210b9bb477fa549de Author: John Doe <Doe.John.10@gmail.com> Date: Thu Jul 21 20:51:38 2011 -...
Deserializing a JSON into a JavaScript object
I have a string in a Java server application that is accessed using AJAX. It looks something like the following: ``` var json = [{ "adjacencies": [ { "nodeTo": "graphnode2", ...
- Modified
- 23 May at 19:41
How to check if a string contains text from an array of substrings in JavaScript?
Pretty straight forward. In javascript, I need to check if a string contains any substrings held in an array.
- Modified
- 21 Sep at 07:0
How to install plugin for Eclipse from .zip
How to install Eclipse plugin from .zip? I have installed plugins by choosing the site and then check but never from .zip. Can anybody help?
- Modified
- 12 Jan at 14:6
What is a "bundle" in an Android application
What is a [bundle](http://developer.android.com/reference/android/os/Bundle.html) in an Android application? When to use it?
- Modified
- 19 Apr at 01:56
How can I loop through a C++ map of maps?
How can I loop through a `std::map` in C++? My map is defined as: ``` std::map< std::string, std::map<std::string, std::string> > ``` For example, the above container holds data like this: ``` m["...
- Modified
- 1 Jan at 15:36
How to remove the leading character from a string?
I have a input string like: ``` $str = ':this is a applepie :) '; ``` How can I remove the first occurring `:` with PHP? Desired output: `this is a applepie :)`
What do pty and tty mean?
I noticed many mentions of `pty` and `tty` in some open source projects, could someone tell me what do they mean and what is the difference between them?
- Modified
- 21 Dec at 09:50
How to apply `git diff` patch without Git installed?
How can my client apply patch created by `git diff` without git installed? I have tried to use `patch` command but it always asks file name to patch.