A cookie, also known as an HTTP cookie, web cookie, or browser cookie, is a small piece of data sent from a website and stored in a user's web browser while the user is browsing that website. Every time the user loads the website, the browser sends the cookie back to the server to notify the website of the user's previous activity. Cookies were designed to be a reliable mechanism for websites to remember stateful information (such as items in a shopping cart) or to record the user's browsing activity (including clicking particular buttons, logging in, or recording which pages were visited by the user as far back as months or years ago).
The term "localization" is used as a synonym of "internationalization", which is the most proper term. Sometimes, internationalization is shortened to "i18N" (meaning "i - eighteen letters -n").
gettext is a GNU project for software application resources internationalization. It has been ported to many programming languages. One of them is php. php gettext can be used as php extension or as cgi (here the first case is mentioned).
Terms to be translated inside php source code handled as following:
echo gettext("text to be translated");
Usually, the english version (text to be translated) will be the "key" for the rest translations. If language translation in not exist, the "key" term will be used (text to be translated).
The most important gettext feature is that extracts terms parsing source code files, and updates them in case of modification (without change the already translated terms).
If you are a web developer, you need to refer to various log files, in order to debug your application or improve its performance. Concerning the famous MySQL database server (or MariaDB server), you need to refer to the following log files:
This article does not refer to The Binary Log. This requires very high standards server hardware and is useful only in special cases (e.g. replication, master - slaves setup, certain data recovery operations). Οtherwise, it is just a "performance killer".
The official documentation about MySQL logs is available here.
Prepared statements must be used in application development with databases. There are two main reasons:
Fortunately, it is possible to use prepared statements with MySQL and PHP using MySQLi extension. Old MySQL extension does not support prepared statements. Moreover, it is deprecated as of PHP 5.5.0, and is not recommended for writing new code as it will be removed in the future.
More information about MySQLi you can find in this post.
PDO (PHP Data Objects) also supports prepared statements (and even better than MySQLi).
jQuery-UI offers a lot of themes. You can test different themes (even third party themes as jQuery-UI-bootstrap or Wijmo) with jui_theme_switch, a plugin, I have developed, here). I guess you will agree that jQuery-UI-bootstrap is the most beautiful :-)
Actually, jQuery-UI-bootstrap is NOT ONLY a third party theme for jQuery-UI. Moreover, with jQuery-UI-bootstrap you can also use (most) of Twitter Bootstrap side by wide with jQuery-UI widgets without components breaking visually.
In the following example I use jQuery-UI-bootstrap just as a jQuery-UI theme. Twitter Bootstrap is not used. As you can see, I had problems using secondary icon (the right-side icon) on jQuery-UI buttons. The provided solution is just a workaround and probably not a permanent solution. This example uses jQuery 1.10.2 and jQuery-UI 1.10.3
In a previous post I wrote about post automation on Twitter using PHP. The whole procedure is similar. You have to create a Facebook app and you need a PHP SDK to communicate with Facebook API.
However, the Facebook post automation is much more complicated than the relative process for Twitter. This is not a surprise, as Facebook itself is much more complicated than Twitter. For example, except of a Facebook Personal Profile, you may have Fan Pages or Business Pages.
A significant difference is that Twitter Access Tokens will never expire (according to current Twitter policy), while Facebook Access Tokens will expire in 60 days.
Manually post to social networks is probably better than to use an automated method. But, if you post many new topics every day, automated post is practically inevitable.
Twitter, as almost any social network, brings an Application Programming Interface, Twitter API, in order to communicate with it programmatically. You cannot use Twitter API directly (using your username and password), but you have to create a Twitter App. Creating a Twitter App is easy (see below). After you create your app, you get ConsumerKey, ConsumerSecret, AccessToken, AccessTokenSecret and you have to use them as credentials to communicate using Twitter API.
RSS (Really Simple Syndication) is the use of an XML document in order to share content across the Internet. An RSS document, aka "feed" includes full or summarized text, plus metadata such as publishing dates and authorship.
This post covers RSS version 2.0. In simple words, an rss feed consists of a CHANNEL and channel ITEMS. You can find RSS specifications at RSS 2.0 at Harvard Law or RSS Advisory Board. You can extend your feed structure using XML namespaces. Details here.
Nowadays, most website owners are sharing their site content using social media. So, many Facebook, Twitter, Google plus or other social media users are using the stream of their favorite social network to remain aware of website changes. Nevertheless, RSS remains the first choice for content syndication.
Of course, there are many other open source or commercial tools available. Twitter typeahead is probably the most important open source alternative.
One of the advantages of Debian operating system is the ability to live update a production server from current to next release. Under normal circumstances you do not have to re-setup the system. So you avoid downtime, something critical for server systems.
There are possibilities this procedure to fail, so you must take a full system backup before.
The same procedure can be applied to desktop machines. There is more complexity in this case, due to graphical desktop environment.
Here I describe a successful upgrade of a Debian LAMP server system from Squeeze to Wheezy.