Friday, December 10, 2010

A retrospective

So I stumbled across a little retort I made a year ago online, and felt, given the proximity to the new year, it was appropriate to put it up (why I neglected to put this up last year is beyond me...):

In reply to the following article: Microsoft's Vision For the Future Gives Me Hope For Humanity

rudez90 said:

this video is depressing only because i dont think we will actually see this in fruition until a lot later than 2019


My response:
Cin said:

You sir, lack perspective. This is 10 years from now. Do you remember 1999? 1999 was the year the very first BlackBerry debuted, it was a 2 way pager, here's a picture.

10 years later, it plays video, surfs the web, has a completely different interface, is in full color, plus much more, and weighs like 1.3 times the first BlackBerry's weight (We found some old ones where I worked, they were pretty bulky).

The first iPod wasn't debuted until 2001, becoming one of the first mp3 players with mass appeal and adoption. Back in 1999, Apple was struggling to stay afloat with their brand new iMac line (the ones that still had all the fruity colors). Now, 10 years later, Apple has expanded in all directions, dominated the digital music distribution market, and has released a handheld which has far-reaching implications for mobile computing.

1999 to 2009 is the difference between Windows 98 and Windows 7. It is the difference between Linux being primarily used by hobbyists and programmers, to being used in more and more consumer applications and even being sold at retail on desktops and notebooks.

Wikipedia was not founded until 2001, and in 1999, Google had only existed for a year, and was finally moving out of a garage in Menlo Park, California to an office in Palo Alto. As recently as May of 2002, there were only 26 million internet subscribers with broadband in the US (there were far less in 1999). Today that number is approaching 70 million [Note: It is currently over 75 million, fyi].

When you consider the fact that technology has an exponential growth pattern, and that the internet has increased the dissemination of ideas and information in ways that our forefathers never imagined possible, then yeah, 2019 is going to be very different from our world today, and I for one can't wait.



And finally, I was reminded to put something like this up thanks to this:

Tuesday, November 23, 2010

Wrapping clones

Fun fact: Creating a virtual object in JQuery via the clone method makes some functions unable to interact with it.

For example, the following will work as expected, adding the class to the clone and not the original:
$('.myClass').clone().addClass('.myOtherClass');

The following, however, will NOT work:
$('.myClass').clone().wrap("<div class='container'></div>"');

As a result, the clone will remain unchanged. If you want to use wrap, and other functions with this limitations, you'll need to place it somewhere in the DOM first, and then manipulate it.

Tuesday, June 8, 2010

On Z-Index

Common issue but one that I often forget and see people asking about:

The z-index css property does not work on static positioned elements (the default positioning). Make it at least position: relative to make z-index do something.

The problem with Mac users finally getting Steam...

Now that everyone on Macs can experience Valve's games, and Portal in particular, I've noticed a bit of a problem on the internet the last few weeks...

Wednesday, June 2, 2010

Calculate the age from a DOB in one line

There are lots of complex ways to calculate someone's age from their DOB via PHP, but here's a simple one:
function getAge($dob) {
   return date("Y", time() - strtotime($dob)) - 1970;
}

echo getAge($dob);

Friday, March 26, 2010

The Logical Fallacies of Modal Tasking


So lots of tech blogs have people going through them saying that Windows Phone 7 and the iPhone don't need multi-tasking, and pointing to an number of reasons why that may be the case. But let's take a look at some of the common fallacies they tend to fall into...

The I-don't-need-it fallacy

Need is a funny thing. You often don't need something until you try it for an extended period of time. There was once a time when the average user didn't "need" network speeds beyond dial-up. This changed as broadband penetration increased, and the concept of what was and wasn't possible with the internet changed as a result. Now, suddenly, many can't even imagine using dial-up speeds on their phone, let alone with their primary computer. Even people who are not all that tech savvy are finding more and more uses for their broadband connection. Utilizing more advanced functions and features of technology has a habit of trickling down into the masses as it gets refined. Where once video chat was difficult and esoteric, now it's dead-simple with Skype and a webcam.



The Windows-Mobile-has-multi-tasking-and-it-sucks fallacy

A bad implementation does not mean a concept is inherently bad. As a former WinMo 6 user I always found their attempts at muli-tasking to be too clumsy and awkward to use, but this does not necessarily mean the concept of multi-tasking on a handheld is somehow inherently flawed. Once might just as well argue (and many have fallaciously argued) that all nuclear power is bad because Chernobyl was bad. Implementation is not a reflection of the underlying concept. Even the best ideas can be half-assed, but this does not mean one should not strive to improve upon the idea in the future. WebOS is an ideal example of a well thought out multi-tasking paradigm which is not only intuitive, but it is simple enough to be grasped even by those who are not tech-savvy.



The my-battery-life-is-short-as-it-is fallacy

This is something which depends on use. A well implemented multi-tasking system makes it apparent to the user which apps are still running without the need of a seperate task manager program, thereby allowing simple control over how much power is consumed. Bear in mind that the majority of apps do not consume processor cycles when not actively performing a task, thereby having little if any noticeable impact on battery life. Indeed, you can even see this for yourself in that many Android handsets and sometimes even WebOS handsets have comparable battery life to the iPhone (sometimes even better). Additionally, jailbroken iPhones with multi-tasking do not appear to have any significant difference in battery life either. The myth of the dwindling battery is not something we need speculate on, it is something we can actively observe and measure, and it's total bunk.



The it-will-make-my-system-unstable fallacy

System stability is an issue, but again, this is a matter of implementation. I've heard many people lambaste WebOS and the Pre for experiencing memory leaks often, but this is, contrary to popular belief, not a result of its multi-tasking implementation, but rather a result of poor garbage management by the OS, an issue which Palm has begun addressing with WebOS 1.4. Newer Android builds are also significantly more stable, and are now just as, if not more stable than iPhone OS. I believe this fallacy originates from Windows Mobile 6's poor stability, and the fact that many assumed the instability of WebOS and Android were due to multi-tasking, as that is the common thread between the three, but correlation is not always causation, and the fact is that the latter two examples are far younger than iPhone OS, and therefore took a while to catch up stability-wise.



The it's-a-security-measure fallacy

A security measure from what exactly? The iPhone App Store already has every app screened and reviewed at the code level. Nothing will get through that can spy on your activities without Apple's say so. So what exactly is more secure about not having code-reviewed background capable apps on your phone?



The I-only-use-one-app-at-a-time-anyway fallacy

This is likely the most common one, and for good reason, so I will walk through it step-by-step:

This is akin to saying you don't need to learn how to drive because you don't drive: it's circular reasoning. You may currently use only one app at a time, but that is likely because you do not have the option otherwise to begin with. Additionally, this argument makes the mistake of assuming that using a multi-tasking OS is the same as a modal OS. Let me assure you, it is not.

Let me start by explaining that app interoperability is a very useful thing. Being able to switch between multiple live apps with the swipe of a finger is a wonderfully useful thing, allowing things like crunching numbers on a scientific calculator and storing the results in a speadsheet or a memo for later without having to open and close apps constantly.

Additionally, whereas modal OSes such as the iPhone typically have modal notification systems, multi-tasking OSes tend to have less obtrusive notifications so as not to interrupt your current actions. This allows things such as receiving and replying to text messages while playing a game without having to exit the game, or seeing who called or texted you at a glance without stopping. This video is a great and humorous example of this.

Finally, modal use of mobile applications makes your phone a tool. It is a swiss army knife which you can whip out and take care of business with. Multi-tasking makes your phone an intelligent and aware entity. You see, the true fallacy behind this concept is not that you do not use more than one app at a time, for using multiple apps yourself is indeed rare. What many fail to realize, however, is that while you only use one app at a time, your phone has no such limitations. While you listen to Pandora on the bus with your eyes closed, your phone can notice that you're entering within a preconfigured distance of your house after getting out of work, so it can alert you to get up and get off the bus before you miss your stop. Or it can notice that you're driving by the grocery store, and you have items in your grocery list that you might as well pick up while you're there, because your calendar's clear for the rest of the evening.

This particular example shows off some of the uses of the Android application Locale, which a location based app that can be configured to trigger nearly anything using extensible scripts, the most common of which are already written by other Android users and can simply be downloaded and implemented. This is something which is impossible on the iPhone without background services. You may think this is a minor detail, something you will not need or use, but the reality is that this goes a long way toward making computers and technology ubiquitous. It is the hallmark of the age in which we do not have to use computers, because they will react to us, and to our needs pre-emptively without the need for us to constantly interact with them. In short, it is the future.


Tuesday, January 26, 2010

Fun with SQL: Part 1

So about 2 years ago, the guy who built the CRM which I work on at work decided that storing dates in the format mm/dd/yyyy as a tinytext was appropriate for one of the tables. So today, after making a bunch of changes to the file that processes this data to format it correctly, I had to change the db data to match the new format. Thus, the magical str_to_date sql statement comes into play. Here it is for future reference:


UPDATE table
SET timestamp=str_to_date( `timestamp` , '%m/%d/%Y %h:%i:%s' )


This takes the current data (mm/dd/yyyy) and converts it to the proper data type for a DATETIME field (YYYY-MM-DD HH:MM:SS).

PS- No, I don't know why a field named "timestamp" was storing the date, and not the time. If I did, I'd likely throttle the former developer...

Wednesday, January 6, 2010

Welcome to the World of Tomorrow!

From TDWTF Sidebar:
El_Heffe:

The usage of floppy disks has declined tremendously over the years and people who are new to computers may have little or no experience with them. i never gave this any thought until recently when I was helping a co-worker with Microsoft Word.

I noticed that she always saved files by clicking on File --> Save. So I just casually mentioned "You know, there's another way to save files that I think is easier. Just click on the disk icon".

She stared at me blankly. So I pointed to the floppy disk icon. This was followed by a long pause and then she said "Oh ..... I thought that was a TV."


cconroy:

Fast-forward ten years or so: Co-worker, now senior level, is explaining to a new employee how to save more efficiently. New employee says, "What's a TV?"