Questions

How to disable button in React.js

I have this component: ``` import React from 'react'; export default class AddItem extends React.Component { add() { this.props.onButtonClick(this.input.value); this.input.value = ''; } r...

5 Jan at 15:27

How can I reverse the order of lines in a file?

I'd like to reverse the order of lines in a text file (or stdin), preserving the contents of each line. So, i.e., starting with: ``` foo bar baz ``` I'd like to end up with ``` baz bar foo ``` ...

4 Dec at 05:7

Count work days between two dates

How can I calculate the number of work days between two dates in SQL Server? Monday to Friday and it must be T-SQL.

17 May at 05:4

How to sort in mongoose?

I find no doc for the sort modifier. The only insight is in the unit tests: [spec.lib.query.js#L12](https://github.com/Automattic/mongoose/blob/13d957f6e54d6a0b358ea61cf9437699079fd2d9/tests/unit/spec...

13 Dec at 08:15

How to get Bitmap from an Uri?

How to get a Bitmap object from an Uri (if I succeed to store it in `/data/data/MYFOLDER/myimage.png` or `file///data/data/MYFOLDER/myimage.png`) to use it in my application? Does anyone have an ide...

How to download HTTP directory with all files and sub-directories as they appear on the online files/folders list?

There is an online HTTP directory that I have access to. I have tried to download all sub-directories and files via `wget`. But, the problem is that when `wget` downloads sub-directories it downloads ...

22 Oct at 03:46

HTML iframe - disable scroll

I have following iframe in my site: ``` <iframe src="<<URL>>" height="800" width="800" sandbox="allow-same-origin allow-scripts allow-forms" scrolling="no" style="overflow: hidden"></iframe> ``` An...

19 Mar at 08:25

Java: Get month Integer from Date

How do I get the month as an integer from a Date object (`java.util.Date`)?

17 Dec at 16:13

Get protocol, domain, and port from URL

I need to extract the full protocol, domain, and port from a given URL. For example: ``` https://localhost:8181/ContactUs-1.0/contact?lang=it&report_type=consumer >>> https://localhost:8181 ```

16 Feb at 05:57

Can I make a <button> not submit a form?

I've got a form, with 2 buttons ``` <a href="index.html"><button>Cancel changes</button></a> <button type="submit">Submit</button> ``` I use jQuery UI's button on them too, simply like this ``` $...

Sql Server equivalent of a COUNTIF aggregate function

I'm building a query with a `GROUP BY` clause that needs the ability to count records based only on a certain condition (e.g. count only records where a certain column value is equal to 1). ``` SELEC...

24 Apr at 01:10

How do I link to part of a page? (hash?)

How do you link (with `<a>`) so that the browser goes to certain subheading on the target page as opposed to the top?

29 Dec at 16:25

Which characters are valid in CSS class names/selectors?

What characters/symbols are allowed within the class selectors? I know that the following characters are , but what characters are ? ``` ~ ! @ $ % ^ & * ( ) + = , . / ' ; : " ? > < [ ] \ { } | ` # ``...

31 Dec at 01:25

MongoDB: Combine data from multiple collections into one..how?

How can I (in MongoDB) combine data from multiple collections into one collection? Can I use map-reduce and if so then how? I would greatly appreciate some example as I am a novice.

Convert Base64 string to an image file?

I am trying to convert my base64 image string to an image file. This is my Base64 string: [http://pastebin.com/ENkTrGNG](http://pastebin.com/ENkTrGNG) Using following code to convert it into an imag...

25 Jun at 16:52

Signtool error: No certificates were found that met all given criteria with a Windows Store App?

I'm trying to sign a Windows 8 appx package with a pfx file I have. I'm using a command like so: ``` signtool.exe sign /fd sha256 /f "key.pfx" "app.appx" ``` And from this, I get: > SignTool Error...

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["...

1 Jan at 15:36

How to convert comma-delimited string to list in Python?

Given a string that is a sequence of several values separated by a commma: ``` mStr = 'A,B,C,D,E' ``` How do I convert the string to a list? ``` mList = ['A', 'B', 'C', 'D', 'E'] ```

10 Oct at 16:30

How to generate a core dump in Linux on a segmentation fault?

I have a process in Linux that's getting a segmentation fault. How can I tell it to generate a core dump when it fails?

21 Jan at 13:0

When to use reinterpret_cast?

I am little confused with the applicability of `reinterpret_cast` vs `static_cast`. From what I have read the general rules are to use static cast when the types can be interpreted at compile time hen...

3 Sep at 20:8

How to open in default browser in C#

I am designing a small C# application and there is a web browser in it. I currently have all of my defaults on my computer say google chrome is my default browser, yet when I click a link in my applic...

No Entity Framework provider found for the ADO.NET provider with invariant name 'System.Data.SqlClient'

After downloading the EF6 by nuget and try to run my project, it returns the following error: > No Entity Framework provider found for the ADO.NET provider with invariant name 'System.Data.SqlClient'...

10 Jun at 09:20

How to perform mouseover function in Selenium WebDriver using Java?

I want to do mouseover function over a drop down menu. When we hover over the menu, it will show the new options. I tried to click the new options using the xpath. But cannot click the menus directly....

Create a date from day month and year with T-SQL

I am trying to convert a date with individual parts such as 12, 1, 2007 into a datetime in SQL Server 2005. I have tried the following: ``` CAST(DATEPART(year, DATE)+'-'+ DATEPART(month, DATE) +'-'+ ...

6 Aug at 13:20

Deleting Objects in JavaScript

I'm a bit confused with JavaScript's `delete` operator. Take the following piece of code: ``` var obj = { helloText: "Hello World!" }; var foo = obj; delete obj; ``` After this piece of code ...