consistency

What is an ideal variable naming convention for loop variables?

If you are writing a simple little loop, what should you name the counter? Provide example loops! ...

Regular expressions: Differences between browsers

I'm increasingly becoming aware that there must be major differences in the ways that regular expressions will be interpreted by browsers. As an example, a co-worker had written this regular expression, to validate that a file being uploaded would have a PDF extension: ^(([a-zA-Z]:)|(\\{2}\w+)\$?)(\\(\w[\w].*))(.pdf)$ This works in In...

AppEngine: Maintaining DataStore Consistency When Creating Records

I've hit a small dilemma! I have a handler called vote; when it is invoked it sets a user's vote to whatever they have picked. To remember what options they previously picked, I store a VoteRecord options which details what their current vote is set to. Of course, the first time they vote, I have to create the object and store it. But s...

Keeping testing and production server environments clean, in sync, and consistent

It seems that the company that I work for is always struggling with our customers’ server environments. Specifically, we almost always encounter problems with testing servers and production servers, and the fact that they always seem to be configured differently. When we test the applications that we develop, the testing servers behave ...

Database consistency checking framework

I'm looking for a framework to utilize to integrate a number of database consistency checking rules into our system. This should basically be a automated test case runner for our database checks. Requirements: Easy to write new rules or checks Easy to run all rules, grouping of rule subsets would be a bonus Accurate and simple reporti...

Fast restart technique instead of keeping the good state (availability and consistency)

How often do you solve your problems by restarting a computer, router, program, browser? Or even by reinstalling the operating system or software component? This seems to be a common pattern when there is a suspect that software component does not keep its state in the right way, then you just get the initial state by restarting the com...

In game programming, how can I test whether a heuristic used is consistent or not?

I have thought of some heuristics for a big (higher dimensions) tic-tac-toe game. How do I check which of them are actually consistent? What is meant by consistency anyways? ...

sleep(0)? consistent time keeping in code?

Right now i am loading a file then using gettimeofday and tracking the CPU time with tv_usec My results varies, i get 250's to 280s but sometimes 300's or 500's. I wrote usleep and sleep (0) and (1) with no success. The time still varies vastly. I thought sleep(1) (seconds in linux, not the windows Sleep in ms) would have solved it. How...

Are there any general algorithms for achieving eventual consistency in distributed systems?

Are there any algorithms that are commonly used for achieving eventual consistency in distributed systems? There are algorithms that have been developed for ACID transactions in distributed systems, Paxos in particular, but is there a similar body of theory that has been developed for BASE scenarios, with weaker consistency guarantees...

On google's BigTable, if my entities belong to the same Entity Group (parent), will the entities be fully consistent?

I have started learning about Eventual Consistency. My entities on google's BigTable belong to specific Entity Groups (parents) to support transactionality. My question is: if my entities belong to the correct Entity Groups, and if I do reads/updates in a Transaction, will Reads be fully consistent? (as opposed to Eventually Consistent?...

id columns or clustered primary keys/database consistency

If I had a table with the columns: Artist Album Song NumberOfListens ...is it better to put a clustered primary key on Artist, Album, and Song or to have an autoincrementing id column and put a unique constraint on Artist, Album, and Song. How important is database consistency? If half of my tables have clustered primary keys and t...

How do I automate the formatting of PHP source?

I have a large-ish PHP project (hundreds of files) that I've been brought in to work on and the source formatting hasn't been very consistent from the beginning. I'd now like to take all source and format it according to the Zend Framework coding standards (tabs to spaces, short tags to full php tags, correct indenting, etc.), however t...

How to Treat Race Condition of Session in Web Application?

I was in a ASP.NET application has heavy traffic of AJAX requests. Once a user login our web application, a session is created to store information of this user's state. Currently, our solution to keep session data consistent is quite simple and brutal: each request needs to acquire a exclusive lock before being processed. This works f...

Heap Consistency Checking on Embedded System

I get a crash like this: #0 0x2c58def0 in raise () from /lib/libpthread.so.0 #1 0x2d9b8958 in abort () from /lib/libc.so.0 #2 0x2d9b7e34 in __malloc_consolidate () from /lib/libc.so.0 #3 0x2d9b6dc8 in malloc () from /lib/libc.so.0 I guess it is a heap corruption issue. uclibc does not have mcheck/mprobe. Valgrind does not seem to ...

How to make sure that the latest (or at least later than what I have today) .net 4.0 version is installed?

A very much related question has been posted here: http://stackoverflow.com/questions/199080/how-to-detect-what-net-framework-versions-and-service-packs-are-installed However, I found that .Net 4.0 conventions are messy. I need to hard-code some logic into an installer / installed product that goes like this: if not RecentDotNet40IsIn...

Consistency in placing operator functions

I have a class like this: class A { ...private functions, variables, etc... public: ...some public functions and variables... A operator * (double); A operator / (double); A operator * (A); ...and lots of other operators } However, I want to also be able to do stuff like 2 * A instead of only being allowed to ...

Qt's QList: which is the canonical form of getting the number of items in a list?

Qt's QList class provides several methods for getting the number of items in the list - count, length, and size. As we all know, consistency is important, so which should be the canonical/preferred method to use of those 3? ...

using triggers for ensuring data consistency

I have a hierarchical structure stored in a table. Each element has a pointer to its previous, next and a parent create table CATALOGUE ( NAME VARCHAR2(300) not null, NEXT_ID NUMBER(38), PARENT_ID NUMBER(38), PREVIOUS_ID NUMBER(38), XID NUMBER(38) ); I have a java application, which uses O/R mapping to access and modify this...

Consistenty header file names between C++ libraries

In my project I use two libraries, v8 and boost. Boost uses the .hpp extension for its headers, while v8 uses the .h extension for its headers. In the end of day, my source code starts like that: #include "v8.h" #include "boost/filesystem.hpp" ... In other question I asked about this subject, the general answer was that it is okay, b...

Control concurrency in multiple users web application gridview

Guys i'm with a big problem. I'm running a backoffice application, and imagine, i have a form than contains a gridview editable. 100 Users go to the page 100 Users view the form page as the data provided from database 100 Users edit some fields How control the final data and consistency in this example? ...