JSON.NET Error Self referencing loop detected for type
I tried to serialize POCO class that was automatically generated from Entity Data Model .edmx and when I used ``` JsonConvert.SerializeObject ``` I got the following error: > Error Self referencing l...
- Modified
- 28 Jan at 21:24
OR is not supported with CASE Statement in SQL Server
The `OR` operator in the `WHEN` clause of a `CASE` statement is not supported. How can I do this? ``` CASE ebv.db_no WHEN 22978 OR 23218 OR 23219 THEN 'WECS 9500' ELSE 'WECS 9520' END as w...
- Modified
- 13 Sep at 13:26
How to use SharedPreferences in Android to store, fetch and edit values
I want to store a time value and need to retrieve and edit it. How can I use `SharedPreferences` to do this?
- Modified
- 14 Dec at 02:23
Best way to track onchange as-you-type in input type="text"?
In my experience, `input type="text"` `onchange` event usually occurs only after you leave (`blur`) the control. Is there a way to force browser to trigger `onchange` every time `textfield` content c...
- Modified
- 25 Nov at 15:39
How to initialize a JavaScript Date to a particular time zone
I have date time in a particular timezone as a string and I want to convert this to the local time. But, I don't know how to set the timezone in the Date object. For example, I have `Feb 28 2013 7:00...
- Modified
- 2 Dec at 22:10
How to use radio on change event?
I have two radio button on change event i want change button How it is possible? My Code ``` <input type="radio" name="bedStatus" id="allot" checked="checked" value="allot">Allot <input type="radio...
fetch from origin with deleted remote branches?
When I do `git fetch origin` and origin has a deleted branch, it doesn't seem to update it in my repository. When I do `git branch -r` it still shows `origin/DELETED_BRANCH`. How can I fix this?
Testing if a checkbox is checked with jQuery
If the checkbox is checked, then I only need to get the value as 1; otherwise, I need to get it as 0. How do I do this using jQuery? `$("#ans").val()` will always give me one right in this case: ``...
- Modified
- 6 Mar at 19:37
CSS Selector that applies to elements with two classes
Is there a way to select an element with CSS based on the value of the class attribute being set to two specific classes. For example, let's say I have 3 divs: ``` <div class="foo">Hello Foo</div> <d...
- Modified
- 11 Jun at 05:36
Drop unused factor levels in a subsetted data frame
I have a data frame containing a `factor`. When I create a subset of this dataframe using `subset` or another indexing function, a new data frame is created. However, the `factor` variable retains al...
When would you use the Builder Pattern?
What are some , of using the Builder Pattern? What does it buy you? Why not just use a Factory Pattern?
- Modified
- 28 Sep at 16:50
Working copy XXX locked and cleanup failed in SVN
I get this error when I do an `svn update`: > Working copy XXXXXXXX locked Please execute "Cleanup" command When I run cleanup, I get > Cleanup failed to process the following paths: XXXXXXXX ...
- Modified
- 13 May at 08:16
How do you get a string from a MemoryStream?
If I am given a `MemoryStream` that I know has been populated with a `String`, how do I get a `String` back out?
- Modified
- 3 Oct at 11:51
What is a magic number, and why is it bad?
What is a magic number? Why should it be avoided? Are there cases where it's appropriate?
- Modified
- 16 Jan at 21:28
How to do a regular expression replace in MySQL?
I have a table with ~500k rows; varchar(255) UTF8 column `filename` contains a file name; I'm trying to strip out various strange characters out of the filename - thought I'd use a character class: `...
Multiple line code example in Javadoc comment
I have a small code example I want to include in the Javadoc comment for a method. ``` /** * -- ex: looping through List of Map objects -- * <code> * for (int i = 0; i < list.size(); i++) { * ...
Calling C/C++ from Python?
What would be the quickest way to construct a Python binding to a C or C++ library? (I am using Windows if this matters.)
How can you export the Visual Studio Code extension list?
I need to send all my installed extensions to my colleagues. How can I export them? The extension manager seems to do nothing... It won't install any extension.
- Modified
- 25 May at 08:19
How can I insert a line break into a <Text> component in React Native?
I want to insert a new line (like \r\n, <br />) in a Text component in React Native. If I have: ``` <text> <br /> Hi~<br /> this is a test message.<br /> </text> ``` Then React Native renders `Hi~ th...
- Modified
- 26 Oct at 09:0
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'...
- Modified
- 10 Jun at 09:20
How to remove time portion of date in C# in DateTime object only?
I need to remove time portion of date time or probably have the date in following format in `object` form not in the form of `string`. ``` 06/26/2009 00:00:00:000 ``` I can not use any `string` con...
std::string formatting like sprintf
I have to format [std::string](http://en.cppreference.com/w/cpp/string/basic_string) with [sprintf](http://en.cppreference.com/w/cpp/io/c/fprintf) and send it into file stream. How can I do this?
- Modified
- 26 Apr at 13:33
How can I get the source code of a Python function?
Suppose I have a Python function as defined below: ``` def foo(arg1,arg2): #do something with args a = arg1 + arg2 return a ``` I can get the name of the function using `foo.func_name`....
What is the conversion specifier for printf that formats a long?
The `printf` function takes an argument type, such as `%d` or `%i` for a `signed int`. However, I don't see anything for a `long` value.
- Modified
- 4 Nov at 21:1
How do I list the symbols in a .so file
How do I list the symbols being exported from a .so file? If possible, I'd also like to know their source (e.g. if they are pulled in from a static library). I'm using gcc 4.0.2, if that makes a dif...
- Modified
- 10 Jan at 11:53