Reputation
10,359
Top tag
Next privilege 15,000 Rep.
Protect questions
Badges
4 36 50
Newest
 Enlightened
Impact
~247k people reached

15m
comment Code license violation
If there are technical ways would very much depend on the type of code and used technology. But one rather common way how such things become known are disgruntled former employees or possibly competitors of a company.
1d
comment Querying large number of timestamps
Without any information on amount of data and available hardware this would be difficult to answer. You say 'millions of timestamps' but is this 'millions per year, month, day second? There are databases that may be able to handle even large amounts of such data. Elasticsearch for example (would also have a nice query interface for the type of query you want to do). Otherwise maybe Redis would be worth looking into.
Aug
24
comment How to manage/organize project folders
Yes and no. git would help in many ways, but after all you still have local folders for the projects so unless you start to organize your local storage there is no direct relation between using git(hub) and better folder structure. Simply stop putting stuff on the desktop, create some folders in your home directory (like Code, Projects, Data, or whatever else...) and put your work related stuff there. Have subfolders for clients, project types or whatever else makes sense to you.
Aug
24
comment Making a search engine to search from a large set of strings
I would use some existing technology like Apache Solr or Elasticsearch. Or if you have specific needs that those don't match then maybe directly using Lucene would work.
Aug
21
comment Automatically reverting commits that fail the build
Failed builds should never have reached master to begin with. That's what development & feature branches are used for. Those changes go then in something like an integration branch where you can test if all new features of several developers will work together and only if this is tested in can go into master. Or at least that's one possible workflow.
Aug
7
comment Designing CRUD part of an HTTP API
Though depending on your use case other features may still be of interest, like maybe sort.
Aug
7
comment Designing CRUD part of an HTTP API
@cerendata in the end this depends of course on how complex you define this type of interface and the possible query options. So far we can limit it to fields (select which fields to return), filters (simple queries like admin=true or email=something) and includes (add nested records) and as mentiond some simple fulltext (like q=sometexttosearch). There is no grouping and other complex features. So the basic URL still is limited to the single resource this endpoint represents (like user). Also we have some endpoints with 'virtual' resources to avoid getting things too complex.
Aug
5
comment Is there an algorithm to avoid getting in hundreds of datapoints from API to represent a bar graph?
Would maybe depend on type of data and how it's displayed. Would not make much sense to send data if the user can't view it anyway. Otherwise limit to data points or calculate median/average for certain time slices like weeks or months if that makes sense for your use case. Also limiting what the user can select would be applicable if this doesn't infer with the work they do. Again there is no general rule.
Aug
1
comment Student Attendance Database - Circular reference
That's not really circular. Since the arrows go in different directions. A circular ref would be if A points to be, B points to C and C points to D so if the references are mandatory may have trouble creating records (though this depends and is not necessarily a problem.) Your design does not have this problem. EnrollmentMaster has no references at all. Same for students. You can start with those and other tables point to them. No trouble at all as far as I can see.
Jul
28
comment What's the right way to approach validations?
Really the type of error message should not be relevant for such a design decision. In worst case I would limit the validation error messages to strings with error codes and then add different helpers for API and UI that 'translate' those codes into real text.
Jul
28
comment What's the right way to approach validations?
@RobertHarvey you can write arbitrary code for validations. There are basic validations for size, data type, existence of related records etc, but you can easily add complete methods for more complex validations. So the question would be mainly about those validations being in other places. Like the controller? This seems wrong. Even if you decide to have different validations for the API and the UI you should still put them into the model area.
Jul
28
comment What's the right way to approach validations?
The validations should ensure valid data, this includes basically everything that possibly could go wrong. So: yes, the model is the place that ensures that only valid data goes into the database. That's at the core of the MVC model. You can not really depend on the UI for validations, especially in the browser the user can turn those off anyway and send any data he likes (don't trust the browser!). Also any other place would mean you would possibly duplicate validation code. In general the model is 'best practice' for all validations.
Jul
28
comment What's the right way to approach validations?
I do not exactly understand your problem. Anyway: The ActiveRecord validations main goal is to actually ensure data integrity. It doesn't matter where the data comes from, it's on the model level, so part of the business rules. Also what's the difference between 'validating user input' and 'ensure data integrity'? You validate user input to ensure data integrity. (Data integrity being a bit of a broad term, meaning basically 'valid data'). What additional 'features' does your API have that are different from the normal user input?
Jul
28
comment Why is 'continue' the keyword for skipping the rest of the loop iteration?
Well, to use continue just to do what you would do anyway would make it an empty statement. So of the two possible meanings at this place inside the loop we are left with only one that makes some more sense. I personally prefer next too, but somebody had to make a decision at the time and to his language understanding continue made enough sense. Maybe we could even discuss the use of next. Is it really the best word? Would it not just mean to continue with the next statement (another 'empty' statement then). Shouldn't we use skip? Should we use with or each instead of for?
Jul
28
comment Why is 'continue' the keyword for skipping the rest of the loop iteration?
Maybe the idea is that the loop as such is kept running, compared to the break statement that would stop the whole looping.
Jul
22
comment MVC is a kind of Design Pattern?
It's sometimes named architectural pattern, so a bit more high level than your common OOP design pattern since it works on the whole project structure and not only a single class (or small group of classes).
Jul
20
comment Best practice for buffering when posting to a web-service that has gone offline
Would depend on amount of data, data format (CSV, binary, JSON, XML...) and maybe a few other factors (also considering using another service if this one isn't reliable enough, though of course may not be an option for whatever reasons). There are various simple solutions for log data that could handle this maybe, one thing to look into could be the Elasticsearch ELK stack.
Jul
20
comment How to deal with stock updates when a user makes a purchase in e-commerce?
You either have the basket in your database or the 'pending purchase' table you mentioned. In any case every record has a timestamp, so you can simply add all records for a given article that are not older than 10 minutes (or whatever) and subtract that amount from stock. A lot depends here on amount of customers on your site and how often this really happen (chances are less often then you may think). If this becomes a serious problem (you should log as much data about this as possible, especially if you show customers 'out of stock' messages) you should consider to stock higher volumes.
Jul
20
comment How to deal with stock updates when a user makes a purchase in e-commerce?
@skirato I was just basically writing a comment repeating my answer for the question MetaFight linked. Didn't even remember I ever answered it there.
Jul
8
comment REST API paging via headers
This still is more complicated and not the standard. I just fail to see why you would want to do that at all? There seems to be no real advantage to it, only makes using your API more complicated. As it is now you will have libraries that can easily make GET requests (also you can easily use command line tools like wget or curl for testing your API) and all you need to do is concatenating a simple string into the correct URI with all params. All this without worrying about how to get your tools to change header info. It's simple, it works, so you should have a very good reason to change it.