Most Popular

1500 questions
1176
votes
32 answers

Deserialize JSON into C# dynamic object?

Is there a way to deserialize JSON content into a C# dynamic type? It would be nice to skip creating a bunch of classes in order to use the DataContractJsonSerializer.
jswanson
  • 16,244
  • 6
  • 20
  • 15
1175
votes
17 answers

How to replace local branch with remote branch entirely in Git?

I have two branches: local branch (the one which I work with) remote branch (public, only well-tested commits go there) Recently I seriously messed up my local branch. How would I replace the local branch entirely with the remote one, so I can…
YemSalat
  • 19,986
  • 13
  • 44
  • 51
1173
votes
27 answers

How can I center text (horizontally and vertically) inside a div block?

I have a div set to display:block (90px height and width), and I have some text inside. I need the text to be aligned in the center both vertically and horizontally. I have tried text-align:center, but it doesn't do the vertical centering part, so I…
Satch3000
  • 47,356
  • 86
  • 216
  • 346
1172
votes
15 answers

Why do people use Heroku when AWS is present? What distinguishes Heroku from AWS?

I'm a beginner RoR programmer who's planning to deploy my app using Heroku. Word from my other advisor friends says that Heroku is really easy, good to use. The only problem is that I still have no idea what Heroku does... I've looked at their…
Bryan
  • 11,925
  • 4
  • 15
  • 12
1172
votes
14 answers

Group By Multiple Columns

How can I do GroupBy multiple columns in LINQ Something similar to this in SQL: SELECT * FROM GROUP BY , How can I convert this to LINQ: QuantityBreakdown ( MaterialID int, ProductID int, Quantity…
Sreedhar
  • 29,307
  • 34
  • 118
  • 188
1172
votes
3 answers

How to get the browser to navigate to URL in JavaScript

What is the best (correct, modern, cross-browser, safe) way to get a web browser to navigate to a URL of your choice using JavaScript?
jjujuma
  • 22,055
  • 12
  • 44
  • 46
1172
votes
23 answers

MySQL error code: 1175 during UPDATE in MySQL Workbench

I'm trying to update the column visited to give it the value 1. I use MySQL workbench, and I'm writing the statement in the SQL editor from inside the workbench. I'm writing the following command: UPDATE tablename SET columnname=1; It gives me the…
Jury A
  • 19,192
  • 24
  • 69
  • 93
1171
votes
30 answers

Shortcuts in Objective-C to concatenate NSStrings

Are there any shortcuts to (stringByAppendingString:) string concatenation in Objective-C, or shortcuts for working with NSString in general? For example, I'd like to make: NSString *myString = @"This"; NSString *test = [myString…
typeoneerror
  • 55,990
  • 32
  • 132
  • 223
1169
votes
16 answers

Collection was modified; enumeration operation may not execute

I can't get to the bottom of this error, because when the debugger is attached, it does not seem to occur. Collection was modified; enumeration operation may not execute Below is the code. This is a WCF server in a Windows service. The method…
cdonner
  • 37,019
  • 22
  • 105
  • 153
1169
votes
16 answers

Maximum request length exceeded.

I am getting the error Maximum request length exceeded when I am trying to upload a video in my site. How do I fix this?
Surya sasidhar
  • 29,607
  • 57
  • 139
  • 219
1169
votes
25 answers

Including all the jars in a directory within the Java classpath

Is there a way to include all the jar files within a directory in the classpath? I'm trying java -classpath lib/*.jar:. my.package.Program and it is not able to find class files that are certainly in those jars. Do I need to add each jar file to…
Chris Serra
  • 13,226
  • 3
  • 25
  • 25
1168
votes
12 answers

How to escape braces (curly brackets) in a format string in .NET

How can brackets be escaped in using string.Format? For example: String val = "1,2,3" String.Format(" foo {{0}}", val); This example doesn't throw an exception, but it outputs the string foo {0}. Is there a way to escape the brackets?
Pop Catalin
  • 61,751
  • 23
  • 87
  • 115
1168
votes
26 answers

Automatically create file 'requirements.txt'

Sometimes I download the Python source code from GitHub and don't know how to install all the dependencies. If there isn't any requirements.txt file I have to create it by hand. Given the Python source code directory, is it possible to create…
Igor Barinov
  • 21,820
  • 10
  • 28
  • 33
1167
votes
17 answers

How do I expire a PHP session after 30 minutes?

I need to keep a session alive for 30 minutes and then destroy it.
Tom
  • 33,626
  • 31
  • 85
  • 109
1167
votes
24 answers

Get property value from string using reflection

I am trying implement the Data transformation using Reflection1 example in my code. The GetSourceValue function has a switch comparing various types, but I want to remove these types and properties and have GetSourceValue get the value of the…
pedrofernandes
  • 16,354
  • 10
  • 36
  • 43