See what the Stackoverflow community is most excited about today.
Date: 2017-10-23
-
ANTLR: Is there a simple example?
tags: java, antlr, antlr4, antlr3
186 votes, 3 answers and 104185 views
\r\n I'd like to get started with ANTLR, but after spending a few hours reviewing the examples at the antlr.org site, I still can't get a clear understanding of the grammar to Java process.\n\nIs there some ...\r\n
-
Add a reference column migration in Rails 4
tags: ruby-on-rails, ruby-on-rails-4, rails-activerecord, rails-migrations
181 votes, 4 answers and 126485 views
\r\n A user has many uploads. I want to add a column to the uploads table that references the user. What should the migration look like? \n\nHere is what I have. I'm not sure if I should use (1) :user_id, :...\r\n
-
How can I add new array elements at the beginning of an array in JavaScript?
tags: javascript, arrays
905 votes, 7 answers and 403575 views
\r\n I have a need to add or prepend elements at the beginning of an array.\n\nFor example, if my array looks like below:\n\n[23, 45, 12, 67]\r\nAnd the response from my AJAX call is 34, I want the updated array ...\r\n
-
What is the “continue” keyword and how does it work in Java?
tags: java, keyword, continue
232 votes, 8 answers and 378214 views
\r\n I saw this keyword for the first time and I was wondering if someone could explain to me what it does.\r\nWhat is the continue keyword?\nHow does it work?\nWhen is it used?\r\n
-
The use of Swift 3 @objc inference in Swift 4 mode is deprecated?
tags: swift, swift4, xcode9-beta
219 votes, 6 answers and 28156 views
\r\n Briefly, while using Xcode 9 Beta, I have run into the following warning:\r\n The use of Swift 3 @objc inference in Swift 4 mode is deprecated. Please address deprecated @objc inference warnings, test ...\r\n
-
How do I manage MongoDB connections in a Node.js web application?
tags: node.js, mongodb, database-connection, connection-pooling
182 votes, 8 answers and 59143 views
\r\n I'm using the node-mongodb-native driver with MongoDB to write a website.\n\nI have some questions about how to manage connections:\r\nIs it enough using only one MongoDB connection for all requests? Are ...\r\n
-
tags: matlab, function, file, scope, function-declaration
183 votes, 8 answers and 85758 views
\r\n When I was studying for my undergraduate degree in EE, MATLAB required each function to be defined in its own file, even if it was a one-liner.\n\nI'm studying for a graduate degree now, and I have to ...\r\n
-
Do I commit the package-lock.json file created by npm 5?
tags: node.js, git, npm, version-control, lockfile
196 votes, 3 answers and 41299 views
\r\n npm 5 was released today and one of the new features include deterministic installs with the creation of a package-lock.json file.\n\nIs this file supposed to be kept in source control?\n\nI'm assuming it'...\r\n
-
Optimal number of threads per core
tags: parallel-processing, cpu
203 votes, 13 answers and 127549 views
\r\n Let's say I have a 4-core CPU, and I want to run some process in the minimum amount of time. The process is ideally parallelizable, so I can run chunks of it on an infinite number of threads and each ...\r\n
-
How do you perform wireless debugging in Xcode 9 with iOS 11, Apple TV 4K, etc?
tags: ios, xcode, debugging, ios11, xcode9
197 votes, 11 answers and 37653 views
\r\n Wireless debugging was recently added as a feature in Xcode 9, iOS 11, and tvOS 11. Apple TV 4K doesn't have a USB port, so it requires wireless debugging. How do you perform this wireless debugging ...\r\n