Today's Question:  What does your personal desk look like?        GIVE A SHOUT

SEARCH KEYWORD -- timestamp



  Convert time to Unix time

Unix time is defined as the number of seconds that have elapsed since midnight Coordinated Universal Time (UTC), 1 January 1970,not counting leap seconds. It is used widely in Unix-like and many other operating systems and file formats. It is neither a linear representation of time nor a true representation of UTC. Unix time may be checked on some Unix systems by typing date +%s on the command line. Sometimes it's a bit difficult to compare times stored in different applications or systems with ...

   UNIX time, Oracle DATE, conversion, timestamp     2013-01-19 09:04:17

  CASSANDRA data model

Cassandra is an open source distributed database, it combines dynamic key/value and column oriented feature of Bigtable. Features of Cassandra are: Flexible schema, no need to design schema first, it's very convenient to add or delete strings Support range search on keys High usability, extensible. The single node error will not affect the cluster. We can think Cassandra's data model as a 4 or 5 dimensional Hash. COLUMN Columns is the smallest data unit in Cassandra, it is a 3 dimensional data...

   Cassandra,database,sort     2013-06-08 22:07:40

  Dates in PHP and MySQL

I see a lot of people on forums and on my training courses asking about the best way (or any way) to manage dates stored in a MySQL database and used in PHP. Three options follow, but first the problem.PHP uses unix timestamps for all its date functionality. It has methods to convert these timestamps into pretty much any text format you could want but internally it uses the timestamp format. A timestamp is simply an integer. Specifically, it’s the number of seconds that have ela...

   PHP,MySQL,Date format,Date,Comparison,Date compare     2011-10-17 14:00:57

  How key-based cache expiration works

There are only two hard things in Computer Science: cache invalidation and naming things — Phil Karlton Doing cache invalidation by hand is an incredibly frustrating and error-prone process. You’re very likely to forget a spot and let stale data get served. That’s enough to turn most people off russian-doll caching structures, like the one we’re using for Basecamp Next. Thankfully there’s a better way. A much better way. It’s called key-based cac...

   Cache,Expiration,Key-base cache,Work     2012-02-20 05:32:40

  Do You Make These 5 Database Design Mistakes?

Look, everyone makes mistakes. It’s true. But not all of us have the chance to make mistakes that end up costing millions of dollars in hardware and production support costs. Any one of the following five mistakes listed below will add additional costs to your company. It’s guaranteed. The costs could be hardware related (extra disk space, network bandwidth), which tend to add up quickly. The costs are also support related (bad performance, database re-design, report cre...

   Database design,Mistake,Advice,Data type,Compatibility     2012-01-03 11:25:13

  Date interval add and sub prior to PHP 5.3

After PHP 5.3, we can use DateInterval object or date_interval_create_from_date_string() function to add or subtract days,weeks,months or years to or from a DateObject.But prior to PHP 5.3,we cannot do this. If we want to achieve the same effect. We need to use some skills. Here is one:We can use strtotime() function to achieve this. For example:$date=date('Y-m-d',time());$datestamp=strtotime(date('Y-m-d',strtotime($date)).' +1 day'); $datestamp=strtotime(date('Y-m-d',strtotime($date)).' +1...

   PHP,DateInterval,Class,PHP 5.3,PHP 5.2     2011-10-21 10:50:10

  Remote form submission

Remote form submission is way of submitting HTML forms from local to a particular remote server. This is used by many advertisers, spammers or even hackers to submit bad data to other websites in order to get what they want. They can write some automation scripts to help them do spamming. How can people do remote form submission and how to prevent this kind of attacks? Since a website can be accessed by almost every one, so one can save a local copy of a HTML form of a website through File->S...

   PHP,Security,Remote form submission     2013-07-14 01:04:49

  Reducing Code Nesting

"This guy’s code sucks!" It’s something we’ve all said or thought when we run into code we don’t like. Sometimes it’s because it’s buggy, sometimes it’s because it conforms to a style we don’t like, and sometimes it’s because it just feels wrong. Recently I found myself thinking this, and automatically jumping to the conclusion that the developer who wrote it was a novice. The code had a distinct property that I dislike: lots of ...

   Code nesting,Readability,Maintainability,Reduction     2012-01-02 08:13:46

  Guide on recovering data in MySQL

In our daily work, there might be mistakes made which got some data or even databases deleted in MySQL. If this happens on production, it would be a nightmare. In case this happens, normally DBA would jump in to save the world. And they would try to recover the data from the backup if there is any. But if there is no backup, then the show stops. Hence database backup is necessary on production environments to avoid such awkward situation. Also normally in MySQL, binlog should be enabled as well ...

   MYSQL,DATABASE,BACKUP,BINLOG,EXAMPLE     2020-08-26 07:50:30

  Data type in MySQL

For both small free database space and large e-commerce websites, reasonable database table structure design is essential. To achieve this, it requires us to have a full understanding of commonly used data types in database system. Below we share some knowledge about data types in MySQL.1. Numeric typesThe numeric types can be classified as : integer, float and decimal type.The so-called "decimal" refers DECIMAL and NUMERIC, they are of the same type. Strictly speaking it is not a numeric type, ...

   MySQL, Data type,VARCHAR     2013-01-01 10:56:06