Monday, January 24, 2022

I'm a New Convert - Nilamon na ng Apple Ecosystem

I bought a Mac M1 laptop last year because of the great reviews. I got an academic discount (for teachers and students, around 2K discount, not bad), by buying it online at apple store ph. Just the base configuration, 13-inch 8GB RAM, 256 SSD.

And now I'm a convert!

Indeed, the keyboard is pleasant to use,  the integration with my iPhone and iPad is seamless. And the video editing using Da Vinci Resolve is much faster than in my 16GB RAM NVIDIA GTX 1050 gaming laptop. Like, what takes 30 minutes in the Windows laptop takes less than 10 minutes in the Mac. The trackpad can be clicked anywhere. And the battery life is insane! One full charge and I can work from 8 to 5 on battery.

I also know of several colleagues who have had Mac for 5 years and up. Most of my Windows laptops would just be good for 3 years typically. So I'm looking forward to having this laptop for several years.

That being said, there are a few things in Windows that I kind of miss in the Mac. Foremost is moving files and finding where the files are. In Windows it is intuitive how to move files from folder to folder, in Mac, it takes more steps. I only have 2 USB C's and so I bought a hub to allow me to connect to an HDMI monitor and USB harddisk. Pages is amazing because we can use LaTeX for equations but I can not save it in another document format (save for PDF) that can be opened by Word.

Other than that I'm enjoying using it. Still learning and getting pleasantly surprised.






Sunday, January 2, 2022

Thank you 2021, Welcome 2022!

And just like that another year has zipped by. We're still in a pandemic and COVID-19 cases are once again rising after a few weeks of promising public health stats across the board.  Still, there's a lot to be grateful for, and I believe its better for one's mental health to have a sense of gratitude always. 

And so, here are the things I am grateful for. 
1. More and more people are getting the vaccine and booster.
2. I've gotten a better understanding of our spiritual life's journey and our purpose in the physical world.
3. I have a steady job which pays well enough that it allows me to support my family.
4. Nobody in my immediate family (close contacts) got seriously sick despite the fact that most of them have co-morbidities.
5. My brother who is working abroad, and his wife who is in Bulacan, survived COVID.
6. Amidst the pandemic, my youngest brother's food business which he runs with his wife is thriving and getting traction.
5. My project team is doing great and we have achieved several milestones.
6. I've managed living with 5 dogs in the house.
7. I've finally been able to go out of town with my family and visit dear friends outside NCR.
8. Some of my friends and colleagues who did get sick with COVID (some severely so) have survived.
9. Eisen, my  Lab, is now 13 years and 7 months - deaf, weak in the hind legs, and with occasional health scares, he still is my most faithful companion.

Elections is coming up in 2022, face to face classes in UP will probably not be happening yet, and we're back in Alert Level 3. I think the antidote to dread and despair in the coming year is to focus on our original mission, which is to love one another, and, instead of criticizing others, look inwardly and strive to be a better person. 

Friday, September 30, 2016

I Got (Business) Schooled!

Last year I and 9 other scientists were awarded a UK Newton Fund-DOST Leaders in Innovation Fellowship. The fellowship gave us and tech transfer officers  crash courses in research commercialization in London, Oxford and at the Asian Institute of Management. We were taught how to make business plans, pitch a product in under 3 minutes, negotiate, estimate market size, and project revenues.

Coming from Science all of the lessons were new to me and I enjoyed every bit of it for the novel and unique insights. I'd like to remember all the lessons I learned so I'm writing them down.

1. From Nieves Confesor of AIM - information is the currency of negotiation. In most cases, the more you openly share information the more you can negotiate better terms for your company.

2. From Richard Cruz of Ideaspace -  Scientists and engineers tend to think that their solution to a problem is the best for the end-user. But does it really address the customer pain? Stripped down to essentials our solution might not be answering their actual pain at all. Gather deep market insights by getting feedback from your end user.

3. From Maoi Arroyo of Hybridigm - the end-user is not necessarily the one who pays. Marketing should be directed at the one who holds the purse strings. Innovation = Invention x Revenues. If it doesn't earn its just an invention.

4. From Ricardo Lim of AIM - the former AIM dean introduced us to Design Thinking. Empathizing is the first step.

This is not the last in the list. I will add as I remember some more, since, hey, its been a year. I'll end with an advice that is somewhat antithetical to how we do science but which makes sense when we are developing solutions for an end user- Fail fast. Fail often. Iterate.


Me and my LIF Cohorts together with Tech Transfer officers holding up our business plans. This was at the Royal Academy of Engineering in London last March 2015.

With THE Nieves Confesor at the Asian Institute of Management. Photo by KM Magtubo.







Sunday, September 18, 2016

Putting subtitles in video

Recently, our new VIP graduate student member Henry Lee, Jr. started a machine learning course in our lab. Some of our alumni like Francis and BA expressed interest in attending but couldn't come. So upon Francis' suggestion we took a video of Henry's lecture.


Pizza to go with the lectures. Photo by Elexis Mae Torres.

The video turned out great but the audio was terrible. I'm sure going to buy a directional microphone for the succeeding lectures but for the meantime I thought of annotating his talk by putting subtitles to the video. So onto Google to search for a subtitle editor.

Surprisingly, every forum I read recommended Subtitle Edit, a free, open source software to do just that.  So I tried it.

First, our movie was captured by an HD Panasonic video camera and the file format is .MTS. The lecture ran a little over an hour so the video file came out in two files, the first set was 4GB the second 1.4GB. I converted the MTS file into MP4 using Avidemux (oh, that's another topic. The proper setting can be found here.).

At first the file won't open in SE, its error message says the video codecs are not around. It suggested a link for downloading codecs. I just clicked and installed away and Voila! MP4's now open.

The SE interface is very easy to use. Five stars. And I've started adding subtitles.


Le Subtitle Edit interface.


But into the 50th second of the video I got lazy, so the complete annotations will have to wait for another day. Meanwhile, we will just have to wear earphones when we watch the video.

Friday, September 2, 2016

How to Install Image Processing Design Toolbox in Scilab without using Atoms

Besides SIVP - or Scilab Image and Video Processing Toolbox, I'm a great fan of Harald Galda's Image Processing Design. It has morphological operations and blob analysis functions not found in SIVP. These functions are great for automating analysis of several regions of interest in a scene at once.

However, as of posting, IPD does not show up in Scilab's ATOMS Module Manager. So I looked for ways to install IPD bypassing ATOMS. Anyone who has done this in Linux or MacOS let me know. Here's what works for Windows:

1. Download IPD.
2. Open Scilab and type SCIHOME. SCIHOME gives the path where the modules are stored.
3. In Windows Explorer copy paste the SCIHOME path to open the folder. You should see a folder named 'atom'.
4. Unzip the IPD module in the 'atom' folder. The unzipped folder should have the name IPD and not the zip filename.
5. Search for 'loader.sce' in the IPD folder, open and execute in Scilab.
6. Check your Scilab console it should show something like:

Start IPD - Image Processing Design
Load macros
Load dependencies
Load gateways
Load help
Load demos

And that's how you know you've succesfully loaded IPD toolbox in your Scilab.

Wednesday, August 17, 2016

Movie poster fun

One time our lab had a Christmas Party with Epic Movies as the theme. So each subgroup had to come dressed as characters from that movie. My group had the great fortune of being "cast" in The Lord of the Rings. I decided me and my students will go all out. So besides making props like swords and axes and beard, we even made... Tadah!.. a theatrical teaser poster with our faces superimposed on the characters.

We took pictures of our faces posed in the same way as the characters. Then with the help of GIMP and the use of ratio and proportion to get the scale of the faces right, we made this:


and this:



Making it was so much fun, my students were all game.

Then I thought, what if I share the fun with my  AP 186 class (Image Processing), besides there's a nice image scaling lesson there. And so for three years running, the first activity of my students in AP 186 is to recreate a movie poster with their faces in place of the actors'.

And so this year, I present to you the promotional posters of AP 186 2016!!!






The steps in making your own poster are:
1. Take a picture of yourself posed in the same way as the character. Be sure to get the lighting right too.
2. Crop your face using GIMP or any image processing software of your choice.
3. In the poster and and in your cropped image, measure the pixel distance between two fiducial points, e.g. distance between the eyes, distance from ear to ear, or forehead to jaw. 
4. Take the ratio between  the fiducial distance of the poster  and your image. Use this ratio as the scale factor to reduce or enlarge the size of your face image to fit exactly in the poster face.
5. You can also use the ratios of your skin color and the poster skin color to make the skin tone of your face match that of the poster.
6. You can then feather or smoothen the edges so that your cut out face blends with the rest of the poster image.

Practice makes perfect, soon you'll be posting memes in 9gag! Which poster got your thumbs up?




Tuesday, August 13, 2013

Freeware I Like

My students know that I never use pirated software and I encourage them to do the same. If i do not respect intellectual property how do I expect other people to respect mine especially with my line of work. UP is big on IP nowadays but how can we prosper if our young students are not even aware that they are committing plagiarism when they cut and paste and not even cite their source? I keep reminding my students to acknowledge their sources of info or assistance in their reports in the hope that it becomes a habit with them. (Incidentally, my dear AP 186 students, you have been copying my figures in your blog reports and you didn't even cite me as the source! See Checklist No. 3.)

Since 2000 I've been looking for free educational software which I can let my students install. I learned about freeware back in 1999 when I acquired a new laptop which came with a StarOffice installer (I still have the CD with me!). This was the precursor of OpenOffice which lately is now LibreOffice.
OpenOffice was ahead of Microsoft when it came to creating pdfs of documents. By searching the net I learned how to write a book using OpenOffice.  I like its equation editor most of all. One can also perform simple calculations in tables inserted in the document.

Next I was fortunate to find Scilab, a Matlab-lookalike. It is quite suited for teaching image processing and if you have been following my blog you'll get a lot of image processing tips from me my students.

Before Adobe Photoshop CS2 became free I was already using GIMP for image processing. For video parsing I swear by Avidemux (stick to version 2.5 if you want to parse videos into image frames). For audio analysis Audacity has several processing tools.

Sketchup and Google Earth always get installed in all my laptops.

For compression, I use 7zip for those files which Windows cannot uncompress. For virtual checking of the innards of my computer I use SIW.

I'll probably add to the list (and links!) as I go along.





Thursday, August 8, 2013

Checklist for Writing Manuscripts II

It is August. Yes. It means I'm suffering from migraine from reading student papers again. And to ease the pain I shall write about it once more and add to my Pet Peeves in Student Manuscripts. I last ended in No. 6 so now Dear Students Who Will Read This Post as Required Reading  if you do not want to incur my wrath when you have me check your manuscript, read and follow:

7. Equations not part of sentence (Irritation Level : 3 stars out of 5)
Equations should be treated as part of the sentence and NOT AS A FIGURE.
This is wrong:
"The hypotenuse of a triangle is shown in Equation 1. Here x is the length of the base and y is the height of the triangle.
h = sqrt { x^2 + y^2}   [1]"

This is right:
"The hypotenuse h of a triangle is given by
h = sqrt {x^2 + y^2}  [1]
where x is the length of the triangle's base and y is the height."

Need some higher authority to convince you to drop that habit? Here, read the Penn State's style for students guide on writing equations in reports.

8. Citation not part of sentence (Irritation Level : 3 stars out of 5)
Isn't it obvious that  if you write

"Such patterns appeared in the works of Rogers. [6] In other works the dominant texture is the set described by Joyce. [7] We have yet to see works on the patterns we found in the new artefact."

the references [6] and [7] appear to belong to the next sentence because they have been excluded by the period at the end of the previous sentence?

If you read journal papers at all and not just cite them blindly you'll be observant of the proper citation practice.

GRRRR

Sunday, April 7, 2013

Checklist for Writing Manuscripts

Around August and the end of an academic year in UP (that's around Feb and March) I suffer headaches and high blood pressure from reading my students' manuscript - be it SPP papers or thesis manuscripts. Yes, reviewing student papers is an occupational hazard.

Paano ka naman hindi mapupundi e kung yung mga simpleng rules ng pagsulat ng paper, hindi sinusunod! (GRRR!@$)352$#*%@$20)

So to minimize stress, because right now is one of those episodes, I'll make here a list of my top 10 6 pet peeves in manuscripts and I'll tell my students to check the list before they send in their papers. (And mind you, I'm VERY busy right now, but I have to get this off my chest by writing about it. That's how seriously stressed I am.)

1. Figures too small. 
A picture speaks a thousand words but if it is too small to see the details or embedded labels, well forget it, I'd rather you describe the story in three paragraphs. Look, an A4 page with a one-inch margin on both sides has a width for text or figures which is 6 inches plus. 6 INCHES! So why is your figure only 2 inches wide? Maximize figures so their width fill the whole page, My Gulay! That's what figures are for, to be seen!

2. Poor grammar
Nothing gets my goat faster than poor English. Please, if you have problems, have your text checked by labmates or groupmates who have a better command of the language.

3. Poor  or no citation
Listen, this can get you kicked out. Seriously. You can be accused of plagiarism. You either cite the source or don't include that text or figure. If you will use a figure from another paper the appropriate way is to write the author and ask permission. Don't ever forget to cite the source of the figure. Even if you have cited the source in the text, you must also cite the reference in the caption. Visit this site for a primer on plagiarism. There are more sites, just google.

4. No storyline,  poor construction
Writing a paper, even a scientific one, is a form of story telling. So before you write, think about your best friend. Think how you would tell a story to your best  friend. Now think about how you will tell the story of your thesis or research paper to your best friend.  You'd explain it in a way that he or she gets the premise right? Good stories have an arc. Go make one.

5. A long intro- 7/8 about the work of others, 1/8 about your work
A good introduction answers four questions:

  1. What are you doing?
  2. Why are you doing it?
  3. What has been done before?
  4. What is new with your approach?

Yes I can see that you did your review of literature but if you think I am impressed, well no,  unless you can put your own work in the context of the work of others.

6. Turning in a revised paper without a detailed list of changes made
When the manuscript has passed through the initial review and you've made the changes, be kind to your suffering reviewer and give a  detailed list of the changes you made. In this way he or she doesn't have to go through the agony of reading your whole paper again but can go straight to check the revised parts. This will speed up the review process too.  Detail means you enumerate the points raised by the reviewer, then you indicate the page number, paragraph, and sentence where you inserted the recommended change.

I'll probably add to this list when I get cranky again. I'm ok now. Nakalabas na ng sama ng loob.

Friday, January 18, 2013

Teardown,Takedown, Having Fun Disassembling Laptops

My mom's laptop (an Acer Aspire 4736Z) recently stopped booting, it would show the motherboard logo, show a scrolling bar with the Windows logo, then turn itself off. I asked for the chance to tinker with it and I got the green and go.

But how to open up a laptop? Google and YouTube to the rescue. I found two excellent takedown/teardown videos and proceeded with  testing my first two hypotheses:

Hypothesis 1: Laptop won't start because a chip or component is broken.

Tools needed to do the delicate task are:
1. A Philips screwdriver with a magnetized tip. Perfect for picking up the screws entrenched in those deep holes.
2. Tape to keep the screws in order. You would want to remember which screw goes where. You may take notes, pictures, even a video of yourself while you're at it.
3. Magnifying glass, to  closely inspect if a chip or component is broken.


Hypothesis 2: Laptop won't start because something is overheating. 

So I got down to removing the cooling system and, HOLY GUACAMOLE BATMAN!, blocking the fan vent is the thickest, blackest dust cotton I've ever encountered since cleaning my stand fan after 14 months and 27 days ( I exaggerate of course, specifying length of time just sounds theatrical). Cleaning the vents, I  learned a few more things from our friendly neighborhood Google.

  1. Use acetone or isopropyl alcohol to remove old thermal grease and thermal tape.
  2. Thermal grease is preferred over thermal tape.
  3. Applying thermal grease is an art.

Well, after doing all i can to make everybody cool, nada, nilch, nunka. Still no booting.

So back to the Google boards again and searched here and there for answers. Aha, more hypotheses to test:

Hypothesis 3. CMOS battery might be drained - Replace
Hypothesis 4. One component has a short - remove and reboot to see which one affects booting process.
a. If its memory, make sure you have a spare memory card to use or you can put your memory card into another computer.
b. If its the harddisk, try to put the harddisk into  an enclosure and try to see if you can read the contents.

Saturday, September 1, 2012

Converting Structures to Matrices in Matlab

I use imfeature a lot (now regionprops). Since the output of imfeature(regionprops) is a structure I sometimes need to access the values of a feature for all blobs preferably in matrix form. I am not so sure if it can be done in one line but what I've discovered is a two step process.

Suppose a call to regionprops is made as follows:

stats = regionprops(L,'Area','MajorAxisLength','MinorAxisLength');

The first step is to convert the structure into a cell:
c = struct2cell(stats);

Then the cell is converted into a matrix:
m = cell2mat(c);

m now would have the same number of rows as features and columns would be as many as the number of blobs processed.

Wednesday, July 18, 2012

How to Skip Every nth Row in Excel

I recently acquired data which had a temporal resolution that was much too fine than necessary. Imagine plotting a graph with 121,957 data points! Horrendous! It slows down everything in Excel.
Data came from eight RH and Temp sensors that have been logging a little under every second over a span of two days.

I don't need to know that temp every second, maybe every minute or every 5 minutes should be ok. So I searched the net for solutions and found this:

http://www.lytebyte.com/2009/06/02/how-to-select-every-nth-row-in-excel/

First time to use the mod and data filter function and they work like a charm!

In 3 easy steps here is the trick:

  1. On a blank column beside the data type =mod(A(1), 60). Copy and drag all the way down to the last data you'd like to include. Replace 60 by any row number you'd like to skip. This will generate a column  which cycles from 0 to 60.
  2. Use Data/Filter on the modulo column and select the number you'd like to remain. Say you choose 25. Every row labeled 25 in the modulo column will remain and the rest will be hidden.
  3. Et voila! Select remaining data rows and plot away!




Thursday, August 4, 2011

Hidden Folder No More

When a disk gets corrupted by a virus, some antivirus software change the attributes of the files and folders to "Hidden". I'm not sure why this is done. Anyway, it gets to be a headache sometimes. Imagine my horror when I was about to deliver a lecture saved in my portable harddisk only to find that I could not see not only the file but the whole folder itself!

To "unhide" a folder in Windows, type the following in the command prompt:

(Assuming H: is the directory where the hidden folder is)
H:\attrib -H -S "Hidden Folder Name" /S /D

Tuesday, May 25, 2010

Online Backup

I discovered DROPBOX. And I'm happy I did. I almost threw away an IT news magazine that Eisen has torn to pieces. Good thing I took a look at the write-ups. If I hadn't I would not have read about free and convenient ways of backing up and syncing files.

I have two laptops, the old one is a desktop replacement at home and the other is my netbook which I carry around a lot. If I wrote a document on one of them I usually back up by writing an email to myself with the document attached. Cumbersome. And if I get lazy, I'll forget to do it and curse myself when I need the document elsewhere.

When I read about Dropbox I was amazed to find that it is cross-platform. MAC, Windows, Linux- can do. Free space is 2GB. If you need larger space you'll have to pay $9.99 per month for 50GB or $19.99 per month for 150GB.

You need to install Dropbox in each of the computers you want to have sync and backup access to. In Windows, a My Dropbox folder appears inside the My Documents folder.

Just drag your files to the My Dropbox folder and it will sync the copies in all your computers once they are online. Pretty neat.

Remember to save the modified file in the My Dropbox folder, though. Better yet, open it from there and save it there. If you have a copy of the file in a local folder it won't sync or backup unless you drag it again in My Dropbox.

Now I don't have to tear my hair and gnash my teeth when I've written a file in my desktop replacement. Simply by dragging it to My Dropbox I can have access to it anywhere.

Thursday, April 1, 2010

Beeps when turning on your computer

The PC won't turn on properly, instead you hear patterns of beeps. They are actually built-in diagnostic alerts. They can tell you what's wrong. I got this from http://www.pcstats.com/articleview.cfm?articleID=1223 while googling what those beeps mean.

  • No beep - no power, loose peripherals, bad motherboard or cpu
  • One beep - ok
  • One long, one short - motherboard problem
  • 1 long, 2 short - video problem
  • 1 long, 3 short - video problem
  • 3 long - keyboard error
  • Repeated long - memory error
  • Continuous high, low - CPU overheating

I was trying to fix some old PC's in the lab since the students were complaining only 2 were working. Heard repeated long beeps in three computers - memory problem. Opened the hatch and placed the RAMS in a different slot and made sure they were snug and completely in.

Et voila! They worked!!!

Saturday, February 27, 2010

Offsetting pages in OpenOffice

I created a journal paper template following the fine advice of Dmitri Popov. A master document is ok but sometimes I just want to PDF that subdocument (journal article) right away with the corresponding planned pages.

Searching the web for offsetting solutions, I've got mixed results, none of them completely satisfactory.

Until... I found the best advice that came along. This is from OpenOffice.org's Tutorial on Page Numbering.

Summary
1. On the page where you want an offset page number go to the first paragraph
2. Right-click, select Paragraph then Text Flow
3. Check Insert, then With Page Style , then choose the page style you created if you have one on the scroll down menu
4. Then on Page Number, insert the start of the page number.

Monday, February 15, 2010

Composing a string and executing it in Matlab : preserving empty spaces

Say you want to automatically open files which are named file001, file002, etc. Further suppose that these files are in a folder named d:\folder 1, d:\folder 2, etc.
Normally, you could use strcat to concatenate a string together with num2str. For example
FILE = strcat('file00',num2str(i));
But strcat will eliminate empty spaces so if strcat is used this way,
FOLDER = strcat('folder ',num2str(3)); % note the single space after 'folder'
the result will be
FOLDER ='folder3'.
To preserve the empty space, use square brackets instead:
FOLDER = ['folder ',num2str(3)]
Suppose you composed a string containing a command:
com1 = 'cd c:\folder 3\file001.jpg'
To execute the string use exec:
exec(com1);


Sunday, February 14, 2010

Installing software in a netbook

I love my netbook! It's light, it's cheap, and it has a large disk space. But when it comes to installing programs in it, I'm reduced to : 1) borrowing an external CD drive, or 2) downloading the software from the net.

There are two other ways: 3) share the CD drive over the network, and 4) create an ISO image of the CD. This last one I find very handy. I got this solution from btfx in Yahoo Answers.

Step 1. In a computer with a CD drive, create an ISO image of the installation CD. A compact freeware suggested is http://lc-iso-creator.en.softonic.com/

Step 2. Copy the ISO image in a USB drive.

Step 3. Insert the USB drive in the netbook and mount the ISO volume using DaemonLite http://www.disk-tools.com/download/daemon

Be sure to unmount the ISO after use.

Wednesday, February 10, 2010

The Problem with Technical Knowledge

The problem with technical knowledge is that, technology marches by so fast that what you know now will become obsolete later, and quite quickly. If so, does it make sense to learn a technology at all? The Philippines is still a techonology "consumer" according to Dr. Roger Posadas in his talk on Science at "Beyond 2010". So will we be forever catching up?

I think there are still key concepts and skills to master (quantum mechanics for example) that will be relevant in the long term.

But I also think we can be ahead or be anticipatory. If we do research, we make our own technology and create new knowledge. In tackling research problems we come to grips with cutting-edge technology and create solutions where there are none.

I like to tell my students that a good research begins with a good research problem. The challenge really is asking the right questions.

Saturday, July 18, 2009

What to do when SIP does not link with Scilab 4.1.2

If you see the error message below when trying to activate SIP Toolbox in SCILAB...

Do this:

chdir(ImageMagickPath);
link('CORE_RL_magick_.dll');


Then reclick the "Toolboxes" button.

Reference:

http://www.scilab.org/contrib/index_contrib.php?page=displayContribution&fileID=146