A Beginner’s Guide to Caching Data in Drupal 7

Building complicated, dynamic content in Drupal is easy, but it can come at a price. A lot of the stuff that makes a site engaging can spell ‘performance nightmare’ under heavy load, thrashing the database to perform complex queries and expensive calculations every time a user looks at a node or loads a particular page.

One solution is to turn on page caching on Drupal’s performance options administration page. That speeds things up for anonymous users by caching the output of each page, greatly reducing the number of DB queries needed when they hit the site. That doesn’t help with logged in users, however: because page level caching is an all-or-nothing affair, it only works for the standardized, always-the-same view that anonymous users see when they arrive.

Eventually there comes a time when you have to dig in to your code, identify the database access hot spots, and add caching yourself. Fortunately, Drupal’s built-in caching APIs and some simple guidelines can make that task easy.

Read more…


Raspberry pi: Weather station for Schools

The goal is to have the Pi controlling everything, so that we could leverage learning opportunity: helping kids to learn about writing code to interface directly with the sensors, as well as displaying and analysing collected data. For example, look at the following set of sensor measurements for the weather station:

  • Rainfall
  • Wind speed
  • Wind gust speed
  • Wind direction
  • Ambient temperature
  • Soil temperature
  • Barometric pressure
  • Relative humidity
  • Air Quality
  • Real Time Clock (for data logging purposes).

Just click here and here to see these interesting articles…


Matlab: K-means Clustering (manually)

From my favorite matlab blog of AngelJohnsy (click to view the rest of the article).

 

Clustering can be defined as the grouping of data points based on some commonality or similarity between the points. One of the simplest methods is K-means clustering. In this method, the number of clusters is initialized and the center of each of the cluster is randomly chosen. The Euclidean distance between each data point and all the center of the clusters is computed and based on the minimum distance each data point is assigned to certain cluster. The new center for the cluster is defined and the Euclidean distance is calculated. This procedure iterates till convergence is reached…








Άνοιγμα μενού
Αλλαγή μεγέθους γραμματοσειράς
Αντίθεση