Jump to Navigation

Feed aggregator

Automated twitter compilation up to 14 September 2014

David Goodwin - Sun, 14/09/2014 - 06:00

Arbitrary tweets made by TheGingerDog up to 14 September 2014

Ubuntu for Smartwatches?

Jono Bacon - Thu, 11/09/2014 - 06:11

I read an interesting article on OMG! Ubuntu! about whether Canonical will enter the wearables business, now the smartwatch industry is hotting up.

On one hand (pun intended), it makes sense. Ubuntu is all about convergence; a core platform from top to bottom that adjusts and expands across different form factors, with a core developer platform, and a focus on content.

On the other hand (pun still intended), the wearables market is another complex economy, that is heavily tethered, both technically and strategically, to existing markets and devices. If we think success in the phone market is complex, success in the burgeoning wearables market is going to be just as complex too.

Now, to be clear, I have no idea whether Canonical is planning on entering the wearables market or not. It wouldn’t surprise me if this is a market of interest though as the investment in Ubuntu over the last few years has been in building a platform that could ultimately scale. It is logical to think this could map to a smartwatch as “another form factor”.

So, if technically it is doable, Canonical should do it, right?


I want to see my friends and former colleagues at Canonical succeed, and this needs focus.

Great companies focus on doing a small set of things and doing them well. Spiraling off in a hundred different directions means dividing teams, dividing focus, and limiting opportunities. To use a tired saying…being a “jack of all trades and master of none”.

While all companies can be tempted in this direction, I am happy that on the client side of Canonical, the focus has been firmly placed on phone. TV has taken a back seat, tablet has taken a back seat. The focus has been on building a featureful, high-quality platform that is focused on phone, and bringing that product to market.

I would hate to think that Canonical would get distracted internally by chasing the smartwatch market while it is young. I believe it would do little but direct resources away from the major push now, which is phone.

If there is something we can learn from Apple here is that it isn’t important to be first. It is important to be the best. Apple rarely ships the first innovation, but they consistently knock it out of the park by building brilliant products that become best in class.

So, I have no doubt that the exciting new convergent future of Ubuntu could run on a watch, but lets keep our heads down and get the phone out there and rocking, and the wearables and other form factors can come later.

PostgreSQL unbuffered queries and PHP (cursors)

David Goodwin - Tue, 09/09/2014 - 14:04

From using MySQL, I’ve used the ‘unbuffered queries‘ feature a number of times. It’s where you don’t fetch the entire resultset into memory at once – which is necessary if you’re retrieving more data than you have memory available. If’s often also generally gets results/data back to you sooner.

Pseudo PHP code could be a bit like :

$pdo = new PDO("mysql:host=whatever;dbname=whatever", $user, $pass.); $pdo->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, false); $stmt = $pdo->prepare("SELECT * FROM big_table"); $stmt->execute(); while($row = $stmt->fetch(PDO::FETCH_ASSOC) ) { echo $row['field']; }

Today, I found myself needing to do the same but with PostgreSQL, and it’s been some time since I used it in anger… so had to do some research.

Unfortunately, PostgreSQL doesn’t have the exact same behaviour available (so I can’t just change the PDO DSN/connection info), and I ended up discovering CURSOR queries – example PHP code below.

$curSql = "DECLARE cursor1 CURSOR FOR SELECT * FROM big_table"; $con = new PDO("pgsql:host=whatever dbname=whatever", "user", "pass"); $con->beginTransaction(); // cursors require a transaction. $stmt = $con->prepare($curSql); $stmt->execute(); $innerStatement = $con->prepare("FETCH 1 FROM cursor1"); while($innerStatement->execute() && $row = $innerStatement->fetch(PDO::FETCH_ASSOC)) { echo $row['field']; }

(The innerStatement->execute() needs calling on each loop iteration to move the cursor, and we also need to fetch the data from it …).

Subscribe to Wolverhampton Linux User Group aggregator

Main menu 2

by Dr. Radut