PostgreSQL – random notes

  • the default schema (when you create a database) is: public
  • everything created is put into public  unless changing the search_path of the database
  • every database has two catalogs, the usual information_schema, and pg_catalog, which has postgres-own schema information
  • extensions are add-ons.

Sometimes you pay more for a level of maturity

In the recent months I have paid attention to the soft skills of a set of people I often interact with (at work, the library group, and the place where I volunteer)

These are my observations of the value (paycheck) I estimate different people get based on soft skills: maturity is a top soft skill

  • What maturity gets you?
    • knowledge of when/how to act on new information
    • better understanding of priorities
    • be more thoughtful of all aspects of completing a task (such as, does it fully work? did I consider all possible scenarios?)
  • What other soft skills you already screen for?
    • In most teams, even in a library group, you likely already screened for a minimum acceptable of soft skills
    • The screening likely included communication skills, certain achievements, and a team fit
    • Likely you gotta pay extra for the mature-level person
  • What soft skills can your team develop over time?
    • Focus
    • Knowledge of other’s strengths and weak points
  • Plan for action
    • Observe soft skills of other people in the different teams you belong to

List of movies

Watch when available in DVD

  • Annihilation

Random list of movies that I have watched

  • A Girl Like Her (high-school flick)
  • Admission (romantic comedy; Tina Fey)
  • Adore (romantic mess)
  • After.Life (suspense; Christina Ricci; and the young dude from the cool-guy/old-guy mac commercial, he’s bad at acting)
  • The Age of Adaline (romantic flick)
  • All Relative (b-rated romantic comedy)
  • Aloha (b-rated romantic comedy; Emma Stone)
  • American Honey (crazy teenagers)
  • Andron (b-rated scifi; skip it)
  • Anesthesia (crazy teenagers; skip it)
  • Already Tomorrow in Hong Kong (b-rated romantic comedy; skip it)
  • Ask Me Anything (b-rated teen flick)
  • At Middleton (b-rated romantic comedy; skip it)
  • Before I Go To Sleep (thriller; skip it)
  • Dirty grandpa (it delivers; Robert De Niro)
  • The Duff (high-school comedy)
  • The East (highly recommended)
  • The Fifth Wave (skip it if you are a parent). The audio-book is quite good for commute because it is engaging but it does not distract you from driving
  • Get a Job (entertaining after-college flick)
  • The Gift (b-rated suspense; skip it)
  • Ginger & Rosa (b-rated drama; skip it)
  • Gone Girl (thriller; Rosamund Pike)
  • Good People (b-rated thriller; skip it)
  • Instructions Not Included (skip it if you are a parent)
  • I Smile Back (messed up film, skip it; Sarah Silverman)
  • The Impossible (Drama; skip it)
  • Jackie (Drama, skip it; Natalie Portman)
  • Jake Squared (Drama/comedy; skip it)
  • Jenny’s Wedding (romantic drama; Katherine Heigl; highly recommended)
  • Kingsman. The secret service (action)
  • Labor Day (b-rated drama; Kate Winslet)
  • Life As We Know It (romantic drama with baby included; Katherine Heigl)
  • The Loft (b-rated; bachelors trouble about dead girl)
  • Men Women & Children (b-rated romantic comedy; Adam Sandler; Judy Greer)
  • Miss Meadows (skip it)
  • Muriel’s wedding (b-rated romantic comedy; Toni Collette)
  • Noah (it delivers)
  • Non Stop (action; Liam Neeson)
  • Solo Con Tu Pareja (indy romantic fun flick; in spanish; highly recommended)
  • Transformers. Age of extinction (it delivers)
  • Two Night Stand (good enough romantic comedy)
  • The way way back (b-rated kids summer break; Toni Collette plays secondary role)
  • The road within (b-rated troubled high-school kids; skip it)
  • Walk With Me (documentary; skip it)
  • Wild (camping; skip it)
  • You’re the worst (tv-series; skip it)


Recipe: Egg fried rice


  • 2 eggs
  • 1 green onion
  • 1/2 tbsp olive oil
  • 1 bowl cooked brown rice

Wash the green onion; chop it into 1/2 cm. long bits. Beat the eggs lightly, add the onion to eggs, mix them and add a pinch of salt. Cook the egg on a nonstick pan at medium/high flame with oil. Fry the eggs similar to scramble eggs. Add 1 bowl of cooked white rice (about the same amount as it was of eggs)

Button for getting a PDF back (Zend/PHP)

When using PHP with Zend, the requests for having a button that creates a PDF are like a train that’s never late. Often there are two cases:

  1. Easy: The PDF is created on the backed and stored there. Just pick your favorite PDF library (I use tcpdf). Then the file can be saved on the server, and you can keep track of it by creating a database table for it. For the purpose of downloading it, just make a route (and action) on Zend that handles the request, normally by ID.
  2. Easier but with a catch. The PDF is created every time and not stored on the server. Once that you verify that the PDF object was created, TCPDF has an output method that makes the response for you. The catch is that on the controller you need to set the return view model to terminal (via setTerminal(true)), and directly get out of the controller’s action via return $this->getResponse(); Otherwise, the PDF will contain (after EOF) some HTML, which is not clean, and it could trigger errors (such as unable to find the phtml for the action).

For option 1, consider having a separate class for handling the PDF files together with their corresponding database table, because, if later you have other sections that will make PDFs, you would not want to be repeating such code again and again.

Installing Ubuntu on an old Macbook

I have an old macbook (year 2006) that had a crashed hard-disk over two years ago. At the time, the new disk with a clean install of OSX was very fast to start up, and it was not even a SSD.

The laptop was functional in my secondary office, at which I go maybe once at week. Normally, I’d use it to connect to a random linux server via the terminal.

However, it was clear that the laptop was unusable for web browsing due to the lack of software updates available.

I attempted to install but it only works for 64 bits. On the other hand, Ubuntu works, and here are a few of my notes:

  • Etcher is quite amazing for making a bootable USB drive: select the image file, then the destination USB drive, and click on the “flash” button.
    • This video was very useful: link
  • Etcher would not do the trick when trying to make a bootable USB for Unbuntu. Then I tried UNetbootin, which would not display the USB disk.
  • I had to “fix” the USB disk (erase volume, unmount, erase partition) via command line usage of diskutil
    • diskutil list: shows you the list of disks
    • diskutil eraseDisk: did not work, gave me an error on: Unable to begin erase operation: The target disk is too small for this operation (-69771)
    • diskutil eraseVolume FAT32 ABCD /dev/disk2: did the trick
    • diskutil unmount disk2: this is needed for the next step to work
    • sudo diskutil partitionDisk disk2 1 MBR FAT32 ABCDE R
    • Kudos to a stackExchange response (great, as usual) that was key to solve this
  • The USB drive then showed up on UNetbootin, for which I recommend downloading separately the .iso file (before using UNetbootin).