Reputation
10,554
Top tag
Next privilege 15,000 Rep.
Protect questions
Badges
4 38 51
Newest
 Nice Answer
Impact
~310k people reached

15h
comment PHP MVC/PAC - Logged In/Admin checks placement
In Rails you would have a class ApplicationController from which the other controllers are derived. Or similar top level controllers. Say if you have a public part without checks (derived from ApplicationsController) and a shop that needs login (derived from say ShopController). Als AdminController is very common for the admin interface. So the parent controllers hold all necessary code and the single controllers just 'activate' it like before_filter :authenticate_user, only: [:new, :create, :edit, :update, :destroy] which would require authentication for those methods in the controller.
15h
comment PHP MVC/PAC - Logged In/Admin checks placement
Dunno for PHP but in Rails this call goes into the controller for the reasons you mention (normally in something called the before_filter). The 'technical' implementation of finding the user and checking permissions goes into the user model.
1d
comment What is the best way to save data of a C++ Program ? Binary vs JSON serialization
Whoever voted to close as too broad: I think this question is reasonably answerable. A very clearly defined use case is given and not just a 'what's better?' question.
1d
comment What is the best way to save data of a C++ Program ? Binary vs JSON serialization
How large are those objects? XML/JSON adds quite some additional size, sometimes more than the data itself. Otherwise you already listed the advantages, it's human readable, there are lots of libraries available, easy to implement etc.
Apr
26
comment Can one html page with web services replace current server-client technology?
It's basically possibly. If it's a good idea would depend on what your current site does and how complex it is. You may end up with a unnecessarily large site which everybody must load though they may use only a very small amount of functionality (good caching strategy may be a workaround especially if the sites code itself doesn't change often). But there is no clear rule.
Apr
21
comment How to compare Sql datetime field with date field
Questions of this type belong on StackOverflow and are off topic here. Though it's most likely a duplicate there of one of these: stackoverflow.com/questions/25564482/… / stackoverflow.com/questions/1843395/… / stackoverflow.com/questions/21958829/…
Apr
19
comment Are website templates for beginners?
Depends on project. For simple sites (small local companies, small shops etc) you will find them used quite a lot. Some of those templates can be very sophisticated. Also: Wordpress isn't a template, it's a CMS that uses templates (and can be a very powerful tool especially in combination with some plugins). Bootstrap isn't a template but a frontend framework.
Apr
19
comment Can I install Apache HTTP server and Apache Tomcat server on the same host?
Yes. And no, no special precaution I would be aware of. Our website runs with Apache Web Server and at some time we were using Apache Solr for search which required Tomcat to run. No problems whatsoever. (btw: question is most likely off topic on this site and will be closed). ServerFault would have been a better place to ask (maybe, I don't know their rules).
Apr
19
comment Maximising data processing speed: in-memory or write to db first?
Importer speed may depend on a lot of factors like table type and types of indexes on the table. Why would you need 30000 lines/rows? Is this one line per line in a text file? You could maybe concatenate the text into a single text field and insert a single row. But I think ES would be really the better option for the task (still would use a single row for the file if possible). Also would depend if you need the database content later too or if it's only for this temporary step.
Apr
19
comment Maximising data processing speed: in-memory or write to db first?
Since text processing seems an important part here I would look into something like Elasticsearch. Not only is it better optimized fir full text search it could also help finding words with spelling errors (maybe intentional if somebody wants to sneak in some specific text). Otherwise it's really difficult to tell, it's hard to believe that processing 30000 rows should take ten minutes for MySql under what conditions ever (well, unless you do really complicated joins without proper indexing)
Apr
9
comment My web app uses a number of photo hosting APIs. What would be an effective database design to store their limitations?
You would need an individual class to verify an image for each service. There should be a design pattern for that something similar to the Strategy Pattern. I would use a single table and store the details as JSON in a text field.
Apr
8
comment Should registration be required for an application which relies on success based on unique barcode?
@DanPichelman 30 cm of paper trash most people throw away anyway. But I guess you could track your purchases and later get some statistics on where you wasted the most money.
Apr
8
comment Should registration be required for an application which relies on success based on unique barcode?
They will know it's not a product because it's not in their system (unless you accidentally create barcodes that relate to a product which you should not do). So somebody has to enter your barcode in the system for it to be recognized. Also they would have to change their software to handle sending the receipt (what they won't do unless you offer a service that makes money for them). Also there are most likely better options to implement such functionality (maybe on the line of Apple's iBeacon or whatever).
Apr
8
comment How to insert large text into a DB with PHP?
Question would belong on StackOverflow (will most likely be migrated). 8000 chars isn't that long. If the fields aredefined properly there shouldn't be a problem. What error messages do you get? They should tell you the problem. Maybe try to output the SQL and manually run it from mysql command line client.
Apr
8
comment Bits - Least-Significant/Lowest is 0th or 1st; zero or one indexed
One could make the argument that we are talking about a positional number system where digit's value is the digit multiplied by the value of its place (it's distance from the radix point). Where place values are the number of the base raised to the nth power starting with n**0 that 0 would be a good value to 'name' the bit at this position.
Apr
6
comment Why do I have issues with all Rails programs?
Rails has a steep learning curve. Also dependency on specific versions of Ruby, Rails and various plugins can be rather strong. You don't need to know how exactly bundler works but at least what it does. For example knowing how to force bundler to use a specific version of a gem instead just picking the newest can help you a lot in such situations. Also being able to read the logs may help (/log folder in the project, production.log the most important)
Apr
4
comment Why does Google Chrome use SQLite if the usage of threads results in parallel access?
You will normally only use one tab at any given time even if you have opened hundreds. Also there is not that much writing going on and tabs rarely share the same data. So not much risk of conflicts.
Mar
31
comment MVC as a subset of client-server architecture?
This will be most likely closed as unclear or opinion based. Anyway, basically no. Client server is a network architecture. MVC is a a pattern in software architecture that doesn't even require to run on a client server architecture (you can use it to write a purely single user desktop app where everything runs on a single local machine). So both have not really much in common even if it may look so because MVC became popular in web programming.
Mar
22
comment Why do so few languages with a variable-type 'operator' exist?
In general what you want to do would be covered by all languages that support some form of meta programming with some kind lambdas, closures or anonymous functions which would be the common way to implement such features. With languages where methods are first class citizens you would be able to use them more or less identical to variables. Though not in exactly that simple syntax you use here since in most such languages it must be made clear that you actually want to call the method stored in the variable.
Mar
20
comment How is it possible to log a user into a system with billions of similar data without delay?
The first thing is indexing (as JacquesB already pointed out). Even a normal PC can handle a few million rows, maybe even up to billions). If that's not enough you can scale by using better hardware with lots of memory (if the whole table fits into memory speed will increase dramatically). Alternately/additionally you can replicate the table over several machines and load balance between them.