Questions

IllegalMonitorStateException on wait() call

I am using multi-threading in java for my program. I have run thread successfully but when I am using `Thread.wait()`, it is throwing `java.lang.IllegalMonitorStateException`. How can I make a thread ...

8 Oct at 11:31

Can you target an elements parent element using event.target?

I am trying to change the innerHTML of my page to become the innerHTML of the element I click on, the only problem is that i want it to take the whole element such as: ``` <section class="homeItem" d...

20 Mar at 14:19

How to update record using Entity Framework Core?

What is the best approach to update database table data in Entity Framework Core? 1. Retrieve the table row, do the changes and save 2. Use keyword Update in DB context and handle exception for item ...

9 Dec at 17:58

When does System.getProperty("java.io.tmpdir") return "c:\temp"

Just curious as to when `System.getProperty("java.io.tmpdir")` returns `"c:\temp"`. According to the [java.io.File](http://java.sun.com/j2se/1.4.2/docs/api/java/io/File.html) [Java Docs](http://java....

6 Feb at 19:17

NewtonSoft.Json Serialize and Deserialize class with property of type IEnumerable<ISomeInterface>

I am trying to move some code to consume ASP.NET MVC Web API generated Json data instead of SOAP Xml. I have run into a problem with serializing and deserializing properties of type: ``` IEnumerable...

Import python package from local directory into interpreter

I'm developing/testing a package in my local directory. I want to import it in the interpreter (v2.5), but sys.path does not include the current directory. Right now I type in `sys.path.insert(0,'.')`...

23 Nov at 10:13

How to print JSON data in console.log?

I cant access JSON data from javascript. Please help me how to access data from JSON data in javascript. i have a JSON data like ``` {"success":true,"input_data":{"quantity-row_122":"1","price-row_122...

1 Apr at 16:42

Java String to Date object of the format "yyyy-mm-dd HH:mm:ss"

I need to convert a String containing date into an date object. The String will be of the format "yyyy-mm-dd HH:mm:ss.SSSSSS" and I want the same format in an date object. For instance I have a strin...

17 Dec at 17:58

How to create a folder with name as current date in batch (.bat) files

I don't know much about windows .bat file syntax. My simple requirement is to create a folder at a specific location with name as current date. I tried searching this on google but didn't get any good...

30 Mar at 11:46

Access POST values in Symfony2 request object

OK, this is a newbie question, but I can't find the answer anywhere. In a controller in Symfony2, I want to access the POST value from one of my forms. In the controller I have: ``` public function...

12 Jan at 13:21

Export specific rows from a PostgreSQL table as INSERT SQL script

I have a database schema named: `nyummy` and a table named `cimory`: ``` create table nyummy.cimory ( id numeric(10,0) not null, name character varying(60) not null, city character varying(50) ...

ASP.NET MVC - Find Absolute Path to the App_Data folder from Controller

What is the correct way to find the absolute path to the App_Data folder from a Controller in an ASP.NET MVC project? I'd like to be able to temporarily work with an .xml file and I don't want to hard...

12 Aug at 21:6

Executing multiple commands from a Windows cmd script

I'm trying to write a Windows cmd script to perform several tasks in series. However, it always stops after the first command in the script. The command it stops after is a maven build (not sure if t...

13 Oct at 15:23

setInterval in a React app

I'm still fairly new at React, but I've been grinding along slowly and I've encountered something I'm stuck on. I am trying to build a "timer" component in React, and to be honest I don't know if I'...

30 Mar at 03:34

How to remove unique key from mysql table

I need to remove a unique key from my mysql table. How can remove that using mysql query. I tried this but it is not working ``` alter table tbl_quiz_attempt_master drop unique key; ``` Please hel...

7 Feb at 06:56

How to tell a Mockito mock object to return something different the next time it is called?

So, I'm creating a mock object as a static variable on the class level like so... In one test, I want `Foo.someMethod()` to return a certain value, while in another test, I want it to return a differ...

Error: package or namespace load failed for ggplot2 and for data.table

I am not able to open install the ggplot2 and data.table packages. It gives me the following error (example for ggplot2) ``` > library(ggplot2) Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPat...

4 Nov at 19:58

Deserializing JSON Object Array with Json.net

I am attempt to use an API that use the follow example structure for their returned json ``` [ { "customer":{ "first_name":"Test", "last_name":"Account", "email":"...

11 Feb at 09:12

Entity Framework select distinct name

How can I do this `SQL` query with `Entity Framework`? ``` SELECT DISTINCT NAME FROM TestAddresses ```

16 Aug at 20:7

Div width 100% minus fixed amount of pixels

How can I achieve the following structure without using tables or JavaScript? The white borders represent edges of divs and aren't relevant to the question. ![Structure 1](https://i.stack.imgur.com/z...

2 Mar at 10:35

Find first sequence item that matches a criterion

What would be the most elegant and efficient way of finding/returning the first list item that matches a certain criterion? For example, if I have a list of objects and I would like to get the first ...

10 Jun at 20:24

Compression/Decompression string with C#

I am newbie in .net. I am doing compression and decompression string in C#. There is a XML and I am converting in string and after that I am doing compression and decompression.There is no compilation...

10 Feb at 11:57

C#: Printing all properties of an object

Is there a method built into .NET that can write all the properties and such of an object to the console? One could make use of reflection of course, but I'm curious if this already exists...especiall...

3 Aug at 18:12

How to format a string as a telephone number in C#

I have a string "1112224444' it is a telephone number. I want to format as 111-222-4444 before I store it in a file. It is on a datarecord and I would prefer to be able to do this without assigning a ...

29 Aug at 20:54

Difference between Statement and PreparedStatement

The Prepared Statement is a slightly more powerful version of a Statement, and should always be at least as quick and easy to handle as a Statement. The Prepared Statement may be parametrized Most rel...

4 Jul at 23:58