Context adaptive numeric input for functions

When reusing functions coded long ago, I often ask myself "does my function take in numbers in this unit or that unit?" Different units can be used to express the quantities of the same type of object. And some pairs of numbers and units are easier to remember than other pairs for example:
  • half second vs 22050 samples (audio)
  • 10 seconds vs 300 frames  (video)
  • 220 instead of 1048576 (sizes that could be FFT'ed easier)
Most of the time the number will only make useful sense when it's associated with a particular unit. For example you would immediately know that 22050 seconds would be ridiculous in an audio application's context. Hence, I started to write "smart" functions that guess the proper unit based on the magnitude of the input and the normally used magnitudes and reasonable thresholds. For example:

function fftSomething(data, size)

if(size < 20)

       size = 2size

end if 

bla bla bla...

end function ffTSomething

Of course, I could have done a unit conversion before using the function. It would also be more difficult to use unusual numeric values. Things could go wrong if someone doesn't know that the function is doing this. But as for my personal programming, wherein I only deliver the results and not the code, where saving in thinking time is preferred over strictness and efficiency, where I know what typical values are used, this style works for me.

Misleading advertising is bad advertising

How many times have you (almost) downloaded crapware because you are mislead in what you thought was the download link to a file you're interested to? Whether it is actually crap or not, software that try to fool you to get themselves installed is annoying. The converse argument for "you get what you ask for" is that "you don't get what you don't ask for". And you shouldn't. Such strategy is almost like a trojan virus but using subtle social engineering/psychology tricks instead. For me, the worst part of this scheme is that they assume people are stupid. Whether or not they are offering a legitimate product, I don't care anymore and just blacklist them.
The same goes for software that gets side installed while you are installing something else. An example is Babylon toolbar, which goes further by modifying the homepage of your web browser. It turns out to be legit, even having a Wikipedia entry (well, they could have made that too). I suspect that it's relatively high Alexa rank (30 as of writing this) is just due to the infected browsers. This usually happens if you just keep clicking the default common sense options in installation programs, which is totally not your fault since that is perfectly fine in many cases. Now, you have to be more alert while installing software or browsing the web.
Look at the image of the supposed ad below. Can you tell what do they offer? (This ad appears in a wordpress.com blog, which puts ads on blogs if you're using a free account, whether or not you sign up for it. So you might as well sign up for it and at least get paid.)


Is that the download link powered by iliVid? NO! That wouldn't lead you to the file you want, but would instead give you a download link of their video software. After seeing a few of this before, I learned to avoid it. And finally blocked the website in my computer.

An appreciation of DRM

Or copy protection of digital content in general. Primarily because digital formats are becoming more and more convenient as technology keeps improving. Tablets, whether an iPad or some cheap-ass Android based knock off, are becoming slimmer, more responsive and more efficient in utilizing battery life. Digital storage just keep getting denser. For the same weight as an average paper book, SD Cards and other forms of flash storage can hold far more books that what you can read in your life time! (Someone should do the calculations and compare it to the number of books ever published).
MicroSD
xkcd: micro SD
As a guy who's always on the run, I'm starting to deeply appreciate the digitization of books. I rent an average room, but it is now getting cluttered with paper books. It will also become a concern the next time I move to another house.
So why DRM? Digital files are too easy to pirate and I bet that's why most authors and publishers are reluctant to embrace digital formats. It may look selfish or over-protective, but if you're willing to pay for a paper book why not for a digital book? (I'll stop at this point since a discussion of free vs paid can go on forever.)

Enabling everyone to be producers

Perhaps the most revolutionary effect of digitization is the bypassing of traditional distributors or middle men. Writers and musicians no longer have to tie up with publishers or record companies to reach their readers or audiences. This means that if you have anything worth sharing or selling, you can just go ahead and do it! Many of the e-books and audiobooks I purchase from Amazon were not written by people who "trained" to be writers. In fact some of the books I enjoy are written by a former bouncer,  (also a very funny person). Thanks to websites that facilitate this more direct and open to all distribution process. But without DRM or copy protection, a large pool of creators would not have jumped into this revolution, most likely. And I wouldn't be reading many of the e-books or listening to the audiobooks that I truly enjoy and have learned from.

A blogger subdomain on a wordpress.com domain

As it turns out, it is not difficult to edit DNS records in a domain registered via Wordpress.com to create a subdomain in a domain you're already paying for. Since I rarely mess with it, I always had a reluctance in cutomizing DNS records. In fact, I don't have a good understanding of DNS stuff.
This blog's only URL used to be flaguser.blogspot.com. For some reasons in the past, I chose wordpress.com to write my other blog (which has a more unified theme) and ended up registering the flaguser.com domain via wordpress's service for ~35 usd/year (I felt a bit sad finding out that it's just ~10 usd/year in blogger. That's a ~2500 usd difference in a hundred years!). Well, anyway here's how:

1.  Edit your wordpress.com DNS records (Admin > Store > Domains > Edit DNS)
2. Add the line:
CNAME blog ghs.google.com.
Note: I wanted "blog" to be the subdomain. Change it accordingly.

3.Validate, then save.
4. Add your custom domain in Blogger (Settings > Publishing > Blog Address > Add Custom Domain > Switch to Advanced Settings)
5. Write something like:
blog.flaguser.com
TIP: From what I've read, a similar procedure also applies for Google sites.

References

  1. Custom DNS (wordpress.com support)
  2. How do I use a custom domain name for my blog? (Google support)
  3. Mapping your site to your own URL (Google support)

How to avoid conversations when listening to an audiobook

Simple. Have a real book and pretend that your reading it.



Bonus credits if the book has an impressive title, say "Non Newtonian Quantum Political Linguistics for Chiropractic Practitioners".
The problem with audiobooks is that it is hard to tell that you are on audiobooks. People who see you will just think you're listening to your music. If you go by public transportation and meet acquaintances on the same train or bus, you'll look impolite if you ignore them. So you end up wasting time in uninteresting small talk instead of learning new things. If you show a real book and appear engrossed by it, then it is them who would feel impolite by attempting to disturb you. It would work best if you appear to be reading something important, like you're preparing for an exam. With headphones and a book it becomes understandable if you fail to hear and fail to see someone you know.
I'm not sure yet whether this works equally well with tablets or e-readers, but at least tablets have the extra advantage of being readable in the dark.

Warning

Don't get caught holding your book upside down. This can also eventually lead to the decrease in number of your "friends". :) Knowledge comes at a price. But friends should also be understanding enough not to hinder your intellectual growth and improvement. Also there's still a lot of socializing opportunities in the place where you work or study. Audiobooks are most convenient on public transportation. Also, still be cautious of your surroundings (but the same applies to using your phone).

 

Alternatives

  • Pretend to be sleeping. No props needed, but not always believable.
  • Pretend to be talking/texting someone else.Takes some effort.

Side note:

This is my first time to use Google's online Drawing appplication, and I must say it is very easy and convenient to use. The interface is like a trimmed down version of Power Point. By publishing the drawing, I can embed it into this blog. For simple drawings, this is much better than editing locally on your PC and going through the upload process. Cheers to technology!

And I just managed to transfer ownership of this blog!

That's cool. I think blogger is trying to catch up with Wordpress by catching up with many useful features (stats for example). Anyway, minutes ago, this blog is associated with a different gmail account. But I simply invited someone else, promoted that person admin, demote my former account to author, and then clicked the X mark on the former account. No questions asked!
Btw, that other person also happens to be me, using my other email for "business" purposes.
PhD Comics

Cheers to the Blogger vs Wordpress competition.

Just get it started!

Before you start anything, learn how to finish it.

Wrong!

A lot of people these days will believe anything written if there's a picture with it. This one actually came from the stuff that my mom shares in her facebook page (it may also be wrong to have family members in your facebook contacts). The wrong part in this apparent words of wisdom is "anything".
Planning is good and it helps in putting a purpose or direction in one's life. But it's not always the best thing to do. There are times that we just need to get started and just learn along the way, especially when we want to try something new or no one has ever done before. That's how many great companies start. You'll never get feedback if you never start. There are times that you just have to take risks and do your best along the way. Life is full of things that have no definite endings. Would you advise this to someone making new friends or someone getting married? (On second thought...)
And planning is not fool proof either as there's no telling what may happen in the future.
It is better to fail than not to not try at all.
I may not now what the future of this blog would be, but I'd rather posted some useless stuff here than keep it empty until I decide how this blog's theme and how things should go on.
Perhaps I'll be posting about the wrong things that I see everywhere. Perhaps I'll be posting sarcastic humor. Perhaps I'll be making a meme-buster! Or perhaps I'll just write whatever that thing is that I have to get out of my corrupted mind so I can move on. By the way, hello world!