module.exports vs exports in Node.js
I've found the following contract in a Node.js module: ``` module.exports = exports = nano = function database_module(cfg) {...} ``` I wonder what's the difference between `module.exports` and `expor...
- Modified
- 24 Jul at 12:33
ssh server connect to host xxx port 22: Connection timed out on linux-ubuntu
I am trying to connect to remote server via ssh but getting connection timeout. I ran the following command and getting following result but if try to connect on another remote se...
- Modified
- 11 Jul at 06:37
How to specify the port an ASP.NET Core application is hosted on?
When using `WebHostBuilder` in a `Main` entry-point, how can I specify the port it binds to? By default it uses 5000. Note that this question is specific to the new ASP.NET Core API (currently in 1.0....
- Modified
- 21 Apr at 23:55
How to add an item to a drop down list in ASP.NET?
I want to add the "Add new" at a specific index, but I am not sure of the syntax. I have the following code: ``` protected void Page_Load(object sender, EventArgs e) { DRPFill(); if (!...
- Modified
- 2 Sep at 04:23
How to return HTTP 500 from ASP.NET Core RC2 Web Api?
Back in RC1, I would do this: ``` [HttpPost] public IActionResult Post([FromBody]string something) { try{ // ... } catch(Exception e) { return new HttpStatusCodeRe...
- Modified
- 14 Nov at 01:14
"Could not find a part of the path" error message
I am programming in c# and want to copy a folder with subfolders from a flash disk to startup. Here is my code: ``` private void copyBat() { try { string source_dir = "E:\\Debug\\Vip...
Wrapping a react-router Link in an html button
Using suggested method: [This is the result: A link in the button](https://i.stack.imgur.com/lN4AP.png), [Code in between comment lines](https://i.stack.imgur.com/aykeJ.png) I was wondering if there ...
Is there a naming convention for git repositories?
For example, I have a RESTful service called Purchase Service. Should I name my repository: 1. purchaserestservice 2. purchase-rest-service 3. purchase_rest_service 4. or something else? What's the...
- Modified
- 8 Feb at 15:10
JAVA_HOME directory in Linux
Is there any linux command I could use to find out `JAVA_HOME` directory? I've tried print out the environment variables ("env") but I can't find the directory.
html button to send email
How do I send an email with specified initial values for the headers `subject` and `message` from a button in html, such as this ``` <form method="post" action="mailto:email.com?subject=subject&messa...
onclick event function in JavaScript
I have some JavaScript code in an HTML page with a button. I have a function called `click()` that handles the `onClick` event of the button. The code for the button is as follows: ``` <input type="bu...
- Modified
- 5 Dec at 18:13
How to use GROUP BY to concatenate strings in MySQL?
Basically the question is how to get from this: to this:
- Modified
- 29 Aug at 07:56
"A namespace cannot directly contain members such as fields or methods"
I am trying to use this code for NET.reflector using Reflexil. I am trying to replace code with this: ``` if(Input.GetKeyDown(KeyCode.Keypad5)) { int i = 0; Character localPlayer = PlayerClient.GetL...
Android Calling JavaScript functions in WebView
I am trying to call some javascript functions sitting in an html page running inside an android webview. Pretty simple what the code tries to do below - from the android app, call a javascript functi...
- Modified
- 12 Aug at 18:38
Array Size (Length) in C#
How can I determine size of an array (length / number of items) in C#?
How to loop through a directory recursively to delete files with certain extensions
I need to loop through a directory recursively and remove all files with extension `.pdf` and `.doc`. I'm managing to loop through a directory recursively but not managing to filter the files with the...
- Modified
- 31 Mar at 05:45
How do you modify a CSS style in the code behind file for divs in ASP.NET?
I'm trying to modify a CSS style attribute for a div based on the information I get from a database table in the code behind of my aspx page. The following is essentially what I am trying to do, but I...
PHP - If variable is not empty, echo some html code
I would like to display some html code if a variable is not empty, else I would like to display nothing. I've tried this code but doesn't work: ``` <?php $web = the_field('website'); if (is...
How do I get column names to print in this C# program?
I've cobbled together a C# program that takes a `.csv` file and writes it to a `DataTable`. Using this program, I can loop through each row of the `DataTable` and print out the information contained ...
- Modified
- 18 Nov at 09:33
Does Java support structs?
Does Java have an analog of a C++ `struct`: ``` struct Member { string FirstName; string LastName; int BirthYear; }; ``` I need to use my own data type.
- Modified
- 20 Jul at 05:46
How to handle click event in Button Column in Datagridview?
I am developing a windows application using C#. I am using `DataGridView` to display data. I have added a button column in that. I want to know how can I handle click event on that button in `DataGrid...
- Modified
- 6 Jan at 09:21
You can't specify target table for update in FROM clause
I have a simple mysql table: ``` CREATE TABLE IF NOT EXISTS `pers` ( `persID` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(35) NOT NULL, `gehalt` int(11) NOT NULL, `chefID` int(11) DEFAULT...
- Modified
- 13 Dec at 17:19
How to install Hibernate Tools in Eclipse?
What is the proper way to install Hibernate Tools in Eclipse as a plugin? The [Hibernate site](http://www.hibernate.org/255.html) doesn't really give any instructions. Looking at the Hibernate Tools ...
- Modified
- 22 Jul at 12:38
Nginx upstream prematurely closed connection while reading response header from upstream, for large requests
I am using nginx and node server to serve update requests. I get a gateway timeout when I request an update on large data. I saw this error from the nginx error logs : > 2016/04/07 00:46:04 [error] 28...