Posts

Showing posts from January, 2013

Getting back to SQL magic

Recently I was asked for a way of numbering a subset of records of database table. It could be done using a programming language, as I did with a small code in Visual Basic for Applications using MS Access connected through ODBC to the database server. But I wanted the real deal, so several ideas came to my mind. The first one was to transfer the desired rows to a temporary table, while deleting them from the original one to later create a new column of type serial that will handle the numbering. However, this idea was not possible as different set of rows required to have their own counter. Let's say that different cities required to have their sales numbered using independent counters. The solution I used was to create a temporary sequence value, to then update the table for each city value. Something like this in Postgresql: ALTER TABLE sales ADD COLUMN number; CREATE TEMP SEQUENCE counter; UPDATE TABLE sales set number=n FROM (SELECT nextval('counter') AS n, ord

Tuning extrusion values

Image
After building the acrylic Prusa i3 3D printer is when the challenge began. I tried to get proper values for the compact extruder using a PG35L geared stepper motor and that proved to be quite a challenge. The problem was two-fold: on one hand, this is a small low-power stepper, that thanks to a 1:35 gear reduction it can achieve 0.45Nm of torque, but this motor is rated at 12V/180mA, which make it not ideal for our 12V drive voltage. But the motor needs a bit more current to create a bit more torque to obtain a consistent extrusion. The second problem is that due to the gear the motor skips if speed is too high. So retraction speed has to be dialed down to 7-10 mm/sec. Being the motor that slow is giving me more trouble, as retraction takes a while and I am getting some ugly plastic blobs in some corners. This time my troubles were deepened because I am using a [for me] new hotend I bought from one of my students, who bought a couple of them off eBay and only needed one. I do not

A tablet that does it

Image
I have blogged in the past on how to use iPad for viewing electronic magazines and how it failed to me with some PDF files. I have recently got a Samsung's Note 10.1 tablet and I can certainly call it a success in terms of both PDF browsing and ebook reading. Everyone I have shown how to scribble on a PDF article was amazed. Yes, this unit comes with a stylus and it is a pressure sensitive one. Adobe reader works nicely and it does not crash. My benchmark is Circuit Cellar PDF that use to crash on the iPad (I do have an iPad1). This together with Cool Reader free app make the unit a very useful book reading plataform as it supports the common formats FB2, EPUB and MOBI plus CHM as a nice addition. The picture shows a screen capture at the original size, which is easy to read without zooming in.