Project Eden, Grha 9 5th floor, Jl. Penataran no. 9, Menteng
Been trying to put the painting on the wall for weeks. Finally after the girls (me & nuniek) spend more time at the office, the painting finally put in the right place :D
(via nuniek)
Source: salsabeela
Using Sphinx as denormalized table: Need your point of view
Hey guys, I need your point of view on this. So I have this query, which can take up to 17 (Seventeen!) tables into one query. I have been using Sphinx a lot for searches, and luckily, since Sphinx 1.10-beta, we have this attribute called sql_attr_string. What this attribute does is store the value for retrieval at Sphinx. So this is what I get (below is a sphinx index):
mysql> select room_date, room_name FROM rooms LIMIT 5; +-----------+--------+-----------+---------------+ | id | weight | room_date | room_name | +-----------+--------+-----------+---------------+ | 120120106 | 1 | 20120106 | Superior Room | | 120120107 | 1 | 20120107 | Superior Room | | 120120108 | 1 | 20120108 | Superior Room | | 120120109 | 1 | 20120109 | Superior Room | | 120120110 | 1 | 20120110 | Superior Room | +-----------+--------+-----------+-------------------+ 5 rows in set (0.01 sec)
So as you can see, I don’t need to query my tables anymore, basically sphinx search is doing the hard work by indexing ALL tables (schedule in background), and updates anything necessarily by using real-time indexing.
Reading the manual, it says that searchd will cache all values in RAM. But I think that’s before 1.10-beta. I need your PoV on this. Is this plausible or is this consuming a lot of Sphinx Search resource?
Fighting Content Piracy
From Jakarta Globe:
Business models should be based on customer demand and an understanding of what is technically feasible - not a desire to maintain existing models or cash flows. In other words, you need to adapt the map to the terrain - you cannot change the terrain to suit the map.
Source: aulia-m
My #StartupLokal office at Project Eden incubator
Source: salsabeela
Object runs faster than array!
Amazing new finding again. Now take a look at this:
foreach ($query->result_array() as $page): $links .= '<a href="'.site_url($page['uri']).'">'; $links .= ucwords($page['title']).'</a><br />'; endforeach;
compared to this:
foreach ($query->result() as $page): $links .= '<a href="'.site_url($page->uri).'">'; $links .= ucwords($page->title).'</a><br />'; endforeach;
The second one runs faster than the first one. Unbelievable. I think it has got to do with the array hashing. Talking about array hashtable, there’s this new DDoS attack method founded at the late 2011, by using a mere arrays. Here’s the link: http://nikic.github.com/2011/12/28/Supercolliding-a-PHP-array.html
Foreach Loop Optimization
This is crazy! I’ve just found out that:
$pages = $query->result_array(); foreach ($pages as $page):
is a lot faster than:
foreach ($query->result_array() as $page):
Crazy! It happens that $query->result_array() is called multiple times if you put it inside the foreach(). I need to learn more…