How to get the value of an input field using ReactJS?
I have the following React component: ``` export default class MyComponent extends React.Component { onSubmit(e) { e.preventDefault(); var title = this.title; console.log...
- Modified
- 15 Oct at 10:1
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...
How to implement "select all" check box in HTML?
I have an HTML page with multiple checkboxes. I need one more checkbox by the name "select all". When I select this checkbox all checkboxes in the HTML page must be selected. How can I do this?
- Modified
- 3 Feb at 09:33
Font Awesome not working, icons showing as squares
So I'm trying to prototype a marketing page and I'm using Bootstrap and the new Font Awesome file. The problem is that when I try to use an icon, all that gets rendered on the page is a big square. ...
- Modified
- 2 Apr at 12:17
How can I create download link in HTML?
I have a basic idea of HTML. I want to create the download link in my sample website, but I don't have idea of how to create it. How do I make a link to download a file rather than visit it?
Dependency Injection error: Unable to resolve service for type while attempting to activate, while class is registered
I created an .NET Core MVC application and use Dependency Injection and Repository Pattern to inject a repository to my controller. However, I am getting an error: > InvalidOperationException: Unable ...
- Modified
- 15 Sep at 08:41
Check if list contains element that contains a string and get that element
While searching for an answer to this question, I've run into similar ones utilizing LINQ but I haven't been able to fully understand them (and thus, implement them), as I'm not familiarized with it. ...
Display an image with Python
I tried to use IPython.display with the following code: ``` from IPython.display import display, Image display(Image(filename='MyImage.png')) ``` I also tried to use matplotlib with the following c...
- Modified
- 15 Mar at 22:33
Regular expression to allow spaces between words
I want a regular expression that prevents symbols and only allows letters and numbers. The regex below works great, but it doesn't allow for spaces between words. ``` ^[a-zA-Z0-9_]*$ ``` For exampl...
- Modified
- 20 Apr at 11:20
How do I plot in real-time in a while loop using matplotlib?
I am trying to plot some data from a camera in real time using OpenCV. However, the real-time plotting (using matplotlib) doesn't seem to be working. I've isolated the problem into this simple exampl...
- Modified
- 5 Apr at 13:0
How to Deserialize XML document
How do I Deserialize this XML document: ``` <?xml version="1.0" encoding="utf-8"?> <Cars> <Car> <StockNumber>1020</StockNumber> <Make>Nissan</Make> <Model>Sentra</Model> </Car> <Car...
- Modified
- 9 Aug at 19:40
Is there a way to loop through a table variable in TSQL without using a cursor?
Let's say I have the following simple table variable: ``` declare @databases table ( DatabaseID int, Name varchar(15), Server varchar(15) ) -- insert a bunch rows into @...
- Modified
- 15 Sep at 07:18
NodeJS - What does "socket hang up" actually mean?
I'm building a web scraper with Node and Cheerio, and for a certain website I'm getting the following error (it only happens on this one website, no others that I try to scrape. It happens at a diff...
- Modified
- 8 Jun at 07:53
Remove duplicates from a List<T> in C#
Anyone have a quick method for de-duplicating a generic List in C#?
- Modified
- 9 Feb at 23:15
No provider for HttpClient
After upgrading from angular 4.4 to 5.0 and after updating all HttpModule and Http to HttpClientModule I started to get this error. I also added HttpModule again to be sure it's not due to some depe...
- Modified
- 11 Jun at 07:45
How to set custom validation messages for HTML forms?
I've got the following HTML form: [http://jsfiddle.net/nfgfP/](http://jsfiddle.net/nfgfP/) ``` <form id="form" onsubmit="return(login())"> <input name="username" placeholder="Username" required /> <in...
- Modified
- 21 Feb at 17:13
How to convert a char array back to a string?
I have a char array: ``` char[] a = {'h', 'e', 'l', 'l', 'o', ' ', 'w', 'o', 'r', 'l', 'd'}; ``` My current solution is to do ``` String b = new String(a); ``` But surely there is a better way ...
How to get URL of current page in PHP
In PHP, how can I get the URL of the current page? Preferably just the parts after `http://domain.example`.
What is console.log?
What is the use of `console.log`? Please explain how to use it in JavaScript, with a code example.
- Modified
- 23 Jul at 15:55
Get dictionary key by value
How do I get a Dictionary key by value in C#? ``` Dictionary<string, string> types = new Dictionary<string, string>() { {"1", "one"}, {"2", "two"}, {"3", "three"} }; ``` I want something ...
- Modified
- 8 Nov at 03:38
node.js remove file
How do I delete a file with node.js? [http://nodejs.org/api/fs.html#fs_fs_rename_oldpath_newpath_callback](http://nodejs.org/api/fs.html#fs_fs_rename_oldpath_newpath_callback) I don't see a remove c...
- Modified
- 22 Feb at 13:51
How can I trigger a JavaScript event click
I have a hyperlink in my page. I am trying to automate a number of clicks on the hyperlink for testing purposes. Is there any way you can simulate 50 clicks on the hyperlink using JavaScript? ``` <a ...
- Modified
- 20 Feb at 19:42
java.net.UnknownHostException: Invalid hostname for server: local
What are the steps I should take to solve the error: ``` java.net.UnknownHostException: Invalid hostname for server: local ``` I added the new virtual host name at Android emulator but the result r...
- Modified
- 13 Oct at 10:42
Can't connect to MySQL server on '127.0.0.1' (10061) (2003)
I know this question was asked a lot before but I tried some of the solutions which were given and nothing worked. I have downloaded and now as I want to start and do a simple DB I set a new MySQL Co...
- Modified
- 3 Jun at 03:54
Finding the max/min value in an array of primitives using Java
It's trivial to write a function to determine the min/max value in an array, such as: ``` /** * * @param chars * @return the max value in the array of chars */ private static int maxValue(char[]...
- Modified
- 13 Mar at 07:32