Wednesday, August 31, 2011

Windows 8: Gimme Some Ribbons! (Oh, and an App Store!)

Microsoft is due to release Windows 8 sometime in 2012. Wait - what?

Yes, yes, I know. It's been only a scant two years (July 22, 2009) since they came out with Windows 7... but Windows 7 was really a response to the horrible, detestable, unusable, P.O.S called "Vista" that debuted in November of 2006.

I mean, come on - they had to do SOMETHING. Even they knew Vista was crap - and, more importantly, businesses were not paying them their ransom licensing fees for the new operating system. They were just fine with Windows XP - and most of them had finally got all their drivers working and all their users on to a unified version of Internet Exploder so that all their expensive ERP software would run.

This worked well for corporate America - not so much for Microsoft. They had to do something...

Now, personally, I actually like Windows 7. It's a huge improvement over Vista (actually a typewriter would be a huge improvement over Vista) - and, in general, it's very well-behaved. So, why would Microsoft spend so much time and money trying to come out with yet another new version of the operating system so "soon" after Windows 7?

One word: Apple.

They are jealous (along with the rest of the Fortune 500) of Apple's success in the phone market, the tablet market and the mobile operating system space. Oh yeah, and their new, all-digital application delivery marketplace. And their market capitalization. And their developer mindshare. And... well, you get the idea.

It's sort of like when the whole "Internet thing" appeared - and they got caught with their pants down by not having a web browser. They scrambled around, licensed Spyglass Mosaic source code (for a quarterly fee plus a percentage of Microsoft's non-Windows revenues) and unleashed Internet Explorer into the marketplace. Eventually, because of their huge installed base, IE became the defacto browser... 

Enter 2011 - and the i-everything. Apple surprisingly ate everyone's lunch in terms of mobile operating systems - and that really goes up Microsoft's backside - sideways. I mean, after all - they are the "inventors" of the modern operating system. They should be the #1 mobile operating system. They deserve the continued love of OEMs (Original Equipment Manufacturers) who bundle their operating system on their devices and on their computers.



So, they are now doing what they always do - ripoff and copy "embrace and extend." Only the world is a much different place than it was years ago. People are more sophisticated and can spot the fact that they are playing catch-up and struggling to remain relevant... and they don't want to look stupid by blatantly ripping off Apple's paradigms (again!) - so they are "innovating."

According to a post on Microsoft's Building Windows 8 blog - they have come up with just the right thing to ensure that everyone with XP or Windows 7 will just drop everything and upgrade to Windows 8. Wait for it... YES! You're right! They're adding that stupid ribbon to the file explorer! YES! FINALLY!

Oh, and they're not going to give you the option of turning it off - and going back to the current, non-ribbon interface.


You think I'm kidding?

I mean, I get that Microsoft is in love with the whole Ribbon thing. They have scads of information on usage patterns based on the fact that most people don't uncheck the "send anonymous useage to the mothership" checkbox on install. They can justify it all they want - but I think it BLOWS. Here's some images from their blog that shows the evolution of the File Manager - from DOS to Windows 7:

Now, here's what the new Windows 8 File Manager will look like:

I know, right?!? Sheesh.

Oh yeah, and they'll have an App Store... and it will run on a wider range of devices - including those with ARM processors (read: almost all non-Apple mobile devices)... AND one MORE killer feature - they're completely re-thinking the... wait for it... the file collision dialog(!) YES! HOORAY! I can see how spending millions of dollars and hundreds of thousands of man hours going from this:

To this...

... is totally going to make everyone in the universe toss out all their tested, verified, digitally signed, secure installs of Windows XP and Windows 7 to upgrade!


Tuesday, August 30, 2011

The History of Our Biggest Time-Suck: Email [INFOGRAPHIC]

Ah, yes - the wonders of "electronic mail." Looking back at the history of email - there was no indication in the early days that it would be the spam-filled, scammer, junk mail delight it has become. It started off with good intentions "...modern!", "...just like a typed memo!", " can even CC and BCC - just like a real letter!"

And yet, in the 32 years since email was "born" (32 years!) it has now become something that everyone has to manage. It's become the defacto method of communication over all else - causing the US Postal Department to bleed red ink, close post offices and threaten to cut services.

Yet email is showing its age. We use the terms "cc" and "bcc" as part of our everyday lexicon... but honestly, do you know what it means? "CC" means "carbon copy". Carbon, as in carbon paper. For you youngsters - in the old days (pre-1980), when you wanted to communicate with people in written form - you would use the extremely cool, technologically advanced "typewriter." (google it).

If you wanted to send a "copy" of the same letter to someone else, you would take a piece of "carbon" paper, place it under the original piece of paper and put another blank piece of paper below the carbon paper. When the keys of the typewriter struck the top piece of paper, the physical impact of the key crashing into the top piece of paper would be transferred to the carbon paper and the imprint of the letter would cause some of the carbon to deposit a letter-shaped mark on the second sheet.

Yeah, really. Not kidding.


Friday, August 26, 2011

Servoy Tip: Calculating Age

Calculating the age of something (or someone) is a task that I come across a lot. Here's a simple function that will help get you the basics:

function getAge(myDate){
  // myDate= new Date("7/12/1968")
  var now = new Date();
  var yr = now.getFullYear() - myDate.getFullYear();
  var mo = now.getMonth() - myDate.getMonth();
  if(mo < 0) {
  mo = myDate.getMonth() - now.getMonth();
  var days = now.getDate() - myDate.getDate();
  if(days < 0) {
  days = myDate.getDate - now.getDate();
  var agestr = yr + " years, " + mo + " months, " + days + " days";
  plugins.dialogs.showInfoDialog("Date DIff", agestr,"OK");

You can (should) enhance the function by checking the years, months and days for plurality and modifying the strings accordingly:

function getAge(myDate){
  // myDate= new Date("7/12/1968")
  var now = new Date();
  var yrTxt = "year";
  var moTxt = "month";
  var dayTxt = "day";

  var yr = now.getFullYear() - myDate.getFullYear();
  if(yr != 1) {
  yrTxt += "s";
  var mo = now.getMonth() - myDate.getMonth();
  if(mo < 0) {
  mo = myDate.getMonth() - now.getMonth();
  if(mo != 1) {
  moTxt += "s"
  var days = now.getDate() - myDate.getDate();
  if(days < 0) {
  days = myDate.getDate - now.getDate();
  if(days != 1) {
  dayTxt += "s";
  var agestr = yr + " " + yrTxt + ", " + mo + " " + moTxt + ", " + days + " " + dayTxt;
  plugins.dialogs.showInfoDialog("Date DIFF", agestr,"OK");


Happy age calculating...

FileMaker TIP: Calculating Age

Calculating the age of something (or someone) is a task that I come across a lot. Here's a simple calculation that will help get you the basics:
Let ([
  today = Get ( CurrentDate ) ;
  days = today - MyDateField;
  md = Date ( 0 ; days + 1 ; Year ( MyDateField) ) ;
  y = Int ( days / 365 )];
  y & " years, " & Month ( md ) & " months, " & Day ( md ) & " days"
The reason it works is that FileMaker is good at turning nonsense into dates (FileMaker stores all dates as integers internally). If you tried...
md = Date ( 0 ; days + 1 ; Year ( MyDateField) ) a "real" programming language - it would choke. But not so the case with FileMaker! You can (should) enhance the calc by checking the years, months and days for plurality and modifying the strings accordingly:

Let ([
  today = Get ( CurrentDate ) ;
  days = today - gDate ;
  md = Date ( 0 ; days + 1 ; Year ( gDate) ) ;
  y = Int ( days / 365 ) ;
  months =  If ( Month ( md ) = 12 ; 0 ; Month ( md ) ) ];
  y & " year" & If ( y > 0; "s, " ; ", ") &
  months & "  month" & If ( months  ≠ 1 ; "s, " ; ", " ) &
  Day ( md ) & " day" & If ( Day ( md ) > 0 ; "s" ; "" )

Happy age calculating...

Thursday, August 25, 2011

Steve Jobs Isn't Dead - He's Just Resting

OK, OK, so no - this post isn't going to be another Apple fanboy re-hash of everything Steve Jobs has done from the beginning of time - nor will it be yet another analysis of Tim Cook (the new Apple CEO). But it will be my take on what Steve's resignation from Apple's CEO position yesterday will mean for Apple.

Wait for it...





Steve Jobs is not dead - he's just resting.

The designs (and suppliers and tooling and carriers) are all set for the iPhone 5, the iPad 3 and, I'm sure, more products than that are in the advanced stages of design/development. Plus, Steve is staying on as Chairman - so you just know he'll still have tons of input into the product development side of things (whether Apple wants him to or not).

Tim Cook, who has already had a taste of the helm before today - is, apparently, a very hard worker who gets stuff done. And, let's face it - if you can work with Steve Jobs for that long (since 1998) and not have Steve fire you - or get absolutely 100% burned out from the job - then that's a good thing.

Apple is the #1 or #2 most valuable company on the stock market (depending on the day) - and as I write this - the pre-market open for the stock is less than $10 below the closing price of $376.18. $376.18! For APPL stock! Who, in a million years, would have ever thought it would get past $200?

Certainly not me - otherwise, I'd just retire.

Regardless of his current health issues (and I sincerely wish him the best!) - Steve Jobs will always be.. well... Steve Jobs. A cat can't change his stripes - and Steve Job can't stop being... well... Steve Jobs.

Here's a perfect demonstration of what I mean: this "lost" video of Jobs in 1984 when he introduced the first Mac - pretty much stands on its own. Even back then, Jobs had a knack for the dramatic (a computer that talks[!] a computer with every whore font you can imagine[!], "...for the first time anywhere...", etc):

Here's a video of him doing the 2005 Stanford Commencement addresss:

So, Mr. Jobs- godspeed in getting better - and Mr. Cook - you're wanted on the set!

Tuesday, August 23, 2011

Mini-Blog: How To Learn Basic JavaScript -

I just came across a new site today - it's called and it's a really cool little concept. It walks you though some very basic exercises that teach you how to write your own JavaScript.

Oh, and it's 100% FREE.

The thing that makes this site different than others that just describe how JavaScript works (and there are some excellent ones like my favorite:, is that this entire site is based on having you actually type JavaScript commands into a window and check your results.

It starts out gentle with teaching you how to get the length of a string by typing: "bob".length into a single-line console-like window - to which it returns 3.

As you move through the exercises - you "graduate" to a multi-line editor that you can code in (very similar to the Eclipse JavaScript editor - including code coloring).

Now, if you already know a bunch of JavaScript - this site won't really help you a lot, but if you've never written a line of JavaScript and you're script-curious - this is definitely a great place to start!

Monday, August 22, 2011

There's A Reason You're Feeling Distracted [INFOGRAPHIC]

Have you ever just wanted to check comments on your Facebook status "real quick" - and then wind up down the rabbit hole for like 3 hours? Well, you're not alone! This awesome look at Digital Distractions at the Museum of Modern Art sums it all up nicely:


Friday, August 19, 2011

Servoy TIP: How To Trap For Modifier Keys

When you're developing your solution - there are times where you want to know if the user had any modifier keys pressed when they performed the action (drag and drop, right click, shift key down, etc.). Servoy returns a number for each key that is held down and, if you add up the numbers, you can tell which keys are down (much like my FileMaker Tip on the same subject)

Luckily, there's a really straightforward to accomplish this - and it's all held in the event that triggered your method.
if ((event.getModifiers() & JSEvent.MODIFIER_SHIFT) != 0) {
} else if ((event.getModifiers() & JSEvent.MODIFIER_ALT & JSEvent.MODIFIER_CTRL) != 0 ) {
   appliction.output ("alt and ctrl");
The operator is a bit operator - that's why you have to use this type of syntax - but since there are event constants (under Application -> JSEvent in the Solution Explorer) - it's easy to check for whatever key combination you want!

You can also tell what type of action the user was doing (as well as any key combinations) - by using the event.getType() function. Here's an example:
if (event.getType() == JSEvent.ACTION) {
   application.output("user clicked");
} else if (event.getType() == JSEvent.RIGHTCLICK) {
   application.output("user right clicked");
} else if (event.getType() == JSEvent.DOUBLECLICK) {
   application.output("user double clicked");
There are other even type constants you can take advantage of including: action, datachanged, focuslost, focusgained, none (for unknown types), ondrag, ondragover, ondrop and rightclick.

FileMaker TIP: How To Trap For Modifier Keys

There are times when you want to allow some advanced functionality when a combination of modifier keys (shift, alt, ctrl, etc.) are held down. I've seen some developers go nuts with this - using one button with 5 or 6 functions based on what keys are held down...


I my opinion, not the best way to go - since the user has to "know" to hold down some combination of keys in order to make some functionality work. Instead, the user interface should be easily discoverable - and familiar to use. But I digress...

In FileMaker, you can tell which modifier keys are held down by using the function:
Get ( ActiveModifierKeys )
Here's what you'll get back:
Shift = 1
Caps Lock = 2
Ctrl (Windows) / Control (Mac OS) = 4
Alt (Windows) / Option (Mac OS) = 8
Command (Mac OS) = 16
If all modifier keys are being pressed (on a Mac), the function will return 31 (1+2+4+8+16).

It's no problem if you only want to check for a single key down - you could just use something like this:
If ( Get ( ActiveModifierKeys ) = 1 //Shift is down )
    # Do Some Action
   # Do Some Other Action
End If
It gets a little more interesting when you want to check the combinations of keys - because you would have to trap for all the possible variations (On Windows):
Ctrl + Shift = 5
Ctrl + Alt = 12
Shift + Alt = 9
Shift + Ctrl + Alt = 13
Then if you (or your customer) is on a Mac, you need to add these:
Command + Shift = 17
Command + Option = 24
Command + Control = 20
Command + Control + Shift = 21
Command + Control + Option = 28
Command + Shift + Option = 25
Command + Shift + Option + Control = 29
Like I said, if you, as a developer, are in your right mind - you would NEVER have a customer have to hold down Command + Shift + Option + Control when clicking a button! However, I understand that sometimes "keys happen."

In searching around the interwebs - I found a number of interesting solutions to finding out what key(s) are being held down. There are some great custom functions out there - "KeysDown" by Peter Wagemans over on takes natural language-like arguments:
KeysDown ( "shift-ctrl" ; True )
KeysDown ( "ctrl-shift-alt" ; False )
KeysDown ( "ctrl-capslock" ; False )
There's another custom function by Arnold Kegebein on his gallimaufry blog that will create global variables to hold all the key states. You can then use syntax like this in your scripts:

Set Variable [$modifierKeys; Value: get.modifierKeys]
If [$$CTRL;]
   … do something …
ElseIf [$$SHIFT];
   … do something else …
End If
So, whether you use custom functions, create a script, or even a calculation - you'll always know the state of the modifier key!

Wednesday, August 17, 2011

Just How Popular IS This Whole "Twitter" Thing? [INFOGRAPHIC]

Although I was an early tweeter - and you can hardly swing a dead cat without running into a story (or watch a TV show, or get a piece of junk mail) that features the word Twitter in it or on it somewhere.

I came across this infographic - and the sheer numbers are simply astounding:


Tuesday, August 16, 2011

What Does Your Mobile Phone Say About You? [INFOGRAPHIC]

There's that saying "you are what you eat" - and that got me to thinking... if you are what you eat - what does the operating system on your phone say about you?

Naw, not really.

I'm not THAT lame.

I just found this infographic, and thought it was cool:


Monday, August 15, 2011

Google To Acquire Motorola Mobility - Sad

Unless you've been living under a rock, you've probably heard that Google has agreed to acquire Motorola Mobility (yeah, the part of Motorola that builds the phone handsets) for $12.5 billion in cash (at $40 per share -  a 63% premium over the market close price on Friday).

I know, right?

It's clear that Google is buying the moto unit, not to expand their market share, not to get into the handset business, not to add shareholder value - but to get their trove of 14,600 patents (and the 6,700+ pending patents).

Personally, I think it's an extremely sad state of affairs.

Clearly, Google feels threatened by the Oracle lawsuit, and the Apple lawsuit and the Microsoft lawsuit. All these large, deep-pocketed, industry leaders are trying to do a single thing: sue the Android operating system into oblivion over patent rights - OR, at the very least, make Google pay a patent "toll" for the right to distribute the operating system for free.

Why are they not going after Palm's WebOS? Or Symbian? Both of those are free (and open) as well.

The answer is: they don't matter. They have no market share. They have no mind share. They have a small installed base.

On the other hand, Android commands a majority of not only the phone market (Apple hates that - as does Microsoft), but they're starting to make noises about making inroads into the tablet market (Apple clearly doesn't want that) - and Oracle is laughing their asses off since they acquired Sun (the folks that invented Java and hold key patents to the underlying technology).

So - what's a company with $39 billion in cash to do? Sure! Buy a patent rich handset company that will be - according to Larry Page on a Google conference call this morning:
I’m really excited about this deal. There are competencies that aren’t core to us, but we plan to operate it as a separate business, so they have competency there. I’m really excited about protecting and supporting the Android ecosystem.
Thump (other shoe dropping).

TRANSLATION: "We don't know the phone business and don't care. Motorola has been struggling and their getting their lunch eaten by HTC anyway. The handset business will do whatever.... the main thing is - we got their patents before someone else did."

So here's the latest tally: patent trolls 3; innovation: 0.

Saturday, August 13, 2011

30 Years Of The PC [INFOGRAPHIC]

Given my last missive about the personal computer turning 30 - the good folks over at PC Magazine have put it into an informative infographic:


Friday, August 12, 2011

PC Turns 30: Seen Trying the "Trump Comb-Over"

So the personal computer turns 30 years old today. Wow.

I was reading a PC Magazine Article today that interviewed some of the folks that rode that wave and helped shaped the industry (Bill Gates, Michael Dell, Raymond Kurzweil, etc). They asked this group of technology luminaries the 3 most hard-hitting, insightful questions that you would expect from any mass-media outlet:
What was the biggest innovation for personal computing in the last 30 years?
How has personal computing changed people's lives for the better?
What do you see happening in personal computing over the next 30 years?

Not to get down on the PC Magazine staff, but if I had access to those folks - I think a more fitting (and interesting) set of questions would have been:
What has the rise of the personal computer NOT affected in our society?
Has personal computing changed people's lives for the better?
What will "computing" look like in 10 years?

I'm not just playing armchair quarterback here. 30 years ago I was a junior in high school. So I'm old enough to remember the actual launch of the IBM PC (Charlie Chaplin ads and all) and the Apple I, etc... It was, in retrospect, an awesome set of events that has (obviously) changed all of our lives in the most profound ways possible. Beyond the Twitters and Facebooks and smartphones and that whole "Internet-thing" - the rise of the personal computers (and the supporting infrastructure and software) has literally changed the face of the world.

Now, according to the technology press, we're entering what Steve Jobs has declared "The post-PC era." When Jobs said that that on May 31, 2011 Apple was just launching the iPad 2 - so apparently for Apple the post-PC era is one where everyone buys an iPad and ditches their laptop. But, I digress.

Obviously, when we go from room-sized computers to smartphones with 1,000,000 times the power at 1/1,000,000th the price - technology and "personal computing" will naturally evolve into something is ubiquitous. As the physical size of computers get smaller, their speed and memory increase and their price gets lower, technology is going to get more and more unobtrusive, and more and more integrated into our daily life.

The mainframe was seen as the end-all-be-all. It was so big, complicated and expensive that people would "rent" time on there to run their programs. Even when the computer actually hit the desktop in 1981 - you had to enter DOS commands to get anything to run (oh yay - that was loads of fun! - NOT!). Then came the graphical user interface (GUI) with the Mac in 1984 - the mainstream of the Internet in 1994 (ish) - and now we have iPhone and tablet PCs are beginning to take over the portable market of computing.

With more and more us storing more and more of our stuff in the cloud (off site) - the idea "personal computing" is changing. Personal computing back then referred to the fact that you were untethered to a mainframe - and you could save your own files and run your own programs without being a slave to the IT department.

Now that most of our data is stored on servers we never see, and we only interact with the interface of the software we use in a web browser - we're going back to a mainframe model and our computers function more like the "dumb terminals" of the late 1970s.

"Personal computing" today means how you personally interact with data and other humans who are also interacting with data. No one wants to buys software in stores, install it using physical media (anyone still have the 10 disk Windows installer lying around?), and then have to store the data locally, back it up, archive it, etc. Heck, we can't even be bothered to go down to the local store and rent a movie on physical media. Nowdays it's all about streaming content. Pandora streams music; Netflix and Hulu streams movies and TV shows; etc., etc.

That's why Apple is doing their iCloud thing. That's why Google gives away productivity applications - and stores your data for free. That's also why your Internet connection at home costs $50 per month. It's all about convenience and transparency. iCloud will backup everything to you have and wirelessly synchronize it to all your other devices. It's only a matter of time before we have something that I talked about in a previous blog - which is the continuity of your entire session across devices (e.g.all open documents you were working on at work appear on whatever computer you log into when you get home).

So, whether you buy into Steve Jobs' "post-PC era" mindset or not - the fact of the matter is that the birth of the PC has ushered in a whole new era of "personal" computing that has fundamentally changed the way we interact with each other (social media, skype, FaceTime) and how we buy and consume our entertainment (iTunes, Netflix, Hulu, Pandora).

In the future - there will be more "personal" computing - not less.

And, I'm not really sure if that's a good thing, or a bad thing.

What do you think?

Friday Randomness: Becoming a Beer Snob [INFOGRAPHIC]

Well, the weekend is upon us - and just in case you were hoping to imbibe a little - here's a handy guide to help you order anything BUT Coors Light:

Becoming a Beer Snob (Infographic)


Thursday, August 11, 2011

Servoy TIP: Leap Year Function

There may be times in your solution when you need to see if a certain year is a leap year. Here's the basic rules to determine if a date is a leap year or not:

A year will be a leap year if it is divisible by 4 but not by 100. If a year is divisible by 4 and by 100, it is not a leap year unless it is also divisible by 400.

So, as always is the case when you use JavaScript - there are many different ways to get this done. I've seen some very long functions that use  the "brute force" method to parse the date and check the year. Here's one example (modified for copy/paste use in Servoy 4+):
function isleap(yr)
 if ((parseInt(yr)%4) == 0)
  if (parseInt(yr)%100 == 0)
    if (parseInt(yr)%400 != 0)
    application.output("Not Leap");
    return "false";
    if (parseInt(yr)%400 == 0)
    return "true";
  if (parseInt(yr)%100 != 0)
    return "true";
 if ((parseInt(yr)%4) != 0)
    application.output("Not Leap");
    return "false";
However, there's a MUCH easier way to do the same thing:
function isLeap(yr) {
 return new Date(yr,1,29).getDate() == 29;
This function simply creates a new date with the year you pass in and February as the month (JavaScript months start at 0=January... yeah, I know - I HATE that as well!) and 29th as the day. JavaScript will auto-convert this to either Feb 29, yr - OR March 1, yr. So if the day that gets returned is the 29th - it's a leap year, if not, then it's not a leap year.

You can also test if your calculation is working - by looking at this list of all leap years 1800-2400.

FileMaker TIP: Checking For Leap Year

There may be times in your solution when you need to see if a certain year is a leap year. Here's the basic rules to determine if a date is a leap year or not:

A year will be a leap year if it is divisible by 4 but not by 100. If a year is divisible by 4 and by 100, it is not a leap year unless it is also divisible by 400.

So, there are a couple of ways to do it - the first way is to use "brute force" and look at the year to see if it fits the criteria above. It's a pretty simple calculation:

FileMaker 6 and below:

  IsEmpty(Current Date), TextToNum(""),
  Mod(Year(Current Date),4) = 0 and
  Mod(Year(Current Date),100) <> 0 or
  Mod(Year(Current Date),400) =0 , 1, 0

FileMaker 7 and above:

  IsEmpty(Current Date), GetAsNumber(""),
  Mod(Year(Current Date),4) = 0 and
  Mod(Year(Current Date),100) <> 0 or
  Mod(Year(Current Date),400) =0 , 1, 0

If you're using FileMaker Pro 10 or higher (or you want to make a custom function) - here's another way to express the same thing using the Let() function:

Let ( isLeapDay = Day ( Date (2; 29; Year ( gDate ) ) ); If ( isLeapDay = 29 ; 1 ; 0 ) )

This calculation simply creates a new date with the year in the field (or your parameter if you're making a function) and February as the month and 29th as the day. JavaScript will auto-convert this to either Feb 29, yr - OR March 1, yr. So if the day that gets returned is the 29th - it's a leap year, if not, then it's not a leap year.

You can also test if your calculation is working - by looking at this list of all leap years 1800-2400.

Tuesday, August 09, 2011

Where To (and NOT To) Stash Your Cash [INFOGRAPHIC]

So... now that you've cashed out all your stocks, you probably have a ton of cash lying around (assuming you didn't buy gold at the record high yesterday). Here's a quick, but helpful guide at where you should (and shouldn't) stash all that cash:


Monday, August 08, 2011

A Quick Guide to Corporate Gifting [INFOGRAPHIC]

Got a new client to impress? Want to express your gratitude to a customer for that big new contract? Trying to suck up to a VC to get your startup funded?

Here's an excellent roadmap to help ensure you get the most bang for your buck:

The Wining & Dining Lifecycle


Friday, August 05, 2011

Servoy TIP: Setting or Passing Multiple Variables At Once

Servoy methods are JavaScript (or Java) functions - and in today's tip I'm going to show you how to initialize multiple variables at once and how to use an array to send multiple values as parameters to a different method.

Let's start with the easy one first - initializing multiple variables to a single value. Now, keep in mind - there is no "right way" to do this - it's a matter of your personal preference and it also depends on how readable you want your code to be.

A best practice, and a good habit to get into, is to declare all the variables you're going to use in your method at the top of your method. This way, they're all in one place, and it's easy to assign default values. To demonstrate, here's some code:
var formName = null;
var showPreview = null;
var hasRecords = null;
var whatReport = "Customers";
var useDefaults = 1;
In JavaScript - rather than having each command on its own line, you can combine commands (that end with a semi-colon) into a single line. So we could reduce 5 lines to 1 - but it's much less readable:
var formName = null; var showPreview = null; var hasRecords = null; var whatReport = "Customers"; var useDefaults = 1;
So rather than putting all in a single line - you can reduce the top code to 3 lines - by defining all the variables with a single value into a single line:
var formName, showPreview, hasRecords = null;
var whatReport = "Customers";
var useDefaults = 1;
Now that we've set our variables - let's say we want to call another method and pass all the variables to that method. We could do it a couple of different ways - depending on how we define the incoming parameter list on our function.

For example - we have two methods - one called setVariables() and one called doAction(). The setVariables() function will just set the variables like we did above and then it will call to doAction() method:
function setVariables()  var formName, showPreview, hasRecords = null;  var whatReport = "Customers";  var useDefaults = 1;  doAction (formName, showPreview, hasRecords, whatReport, useDefaults);end function
Then when we define the doAction method - we define it like this:
function doAction( formName, showPreview, hasRecords, whatReport, useDefaults)
  //my actions here
end function
This is the best, and most readable way to accomplish passing the parameters. This will allow you to use all the variables in the doAction method just as they're specified and passed.

However, there may be times when you need to package more information into a single variable. Each variable you pass to a function does not have to be a single value - they can be any object that Servoy supports! That means you can pass arrays, record objects - even entire foundsets between methods! Here's an example:

function setVariables()
  var formName, showPreview = null;
  var hasRecords = forms.customers.foundset;
  var whatReport = "Customers";
  var useDefaults = new Array[1,'blue','green'];
  doAction (formName, showPreview, hasRecords, whatReport, useDefaults);
end function
I hope this will help you with your Servoy development efforts! What other tricks to you guys use when passing/setting parameters?

FileMaker TIP: Setting or Passing Multiple Variables At Once

There are times when I'm developing a solution that I need to pass multiple parameters to a script - or when I'm in a script, I want to define multiple variables at once rather than having a whole bunch of "Set Variable" steps - you can just use the "Let()" function do all the heavy lifting.

For example - I have a script that takes in a script parameter from a button, checks the current layout and then performs different logic based on the report button that was pressed:

On the button that calls the script I set the script parameter to the report I want:

Now, if I were to change the variables from local variables (that are only valid as long as the script runs) into global variables (are available until the user quits) - I can set all the values as a single script parameter:
Let ( [ $$WhatReport = "Customers" ; $$CurrentLayout = Get ( LayoutName ) ; $$ShowPreview =  0 ] ; "" )
In the above code I'm using the "Let" function to simply define all my global variables and then I can rewrite my script to look like this:

Pretty cool!

Now there are some pros and cons to this approach. On the pro side: I've greatly simplified my script. On the con side - I now have to put that "Let" function on all my buttons (and any other buttons I create) - on every layout that I want to call this script from.

Personally, I'm not a big fan of passing 100 variables from the calling button/trigger/object - unless I absolutely have to. I can't tell you the number of hours I've spent debugging because I've forgotten to set a certain parameter to the right value - plus, I really don't like having a lot of global variables hanging around when I don't need them (you can't set local variables when passing parameters, unfortunately).

Most of the time (there are exceptions, of course) - I try to keep things as simple and encapsulated as possible. So, taking our first script as the example - here's another tip: you can set multiple local variables within your script the same way as we set the global variables in our script parameter.

To do this - we need to execute a script - and because there is no script step to simply "evaluate" or perform this type of action - we need to set a single variable. In my case I'm setting a local variable called "$blah" to this calculation:

Here's the revised script:

I hope this technique will save you some time when you develop your solution!

Friday Randomness: DIY With Stuff You Already Have [INFOGRAPHIC]

Being that economic time are well... ummm... crappy - here's some useful tips for maximizing household items you already have:

Thursday, August 04, 2011

Adobe Caves To HTML5 - Creates New "Edge" Tool

Adobe announced this week that it's released a new (pre beta) tool called "Edge" that is designed to replace... er... "compliment" Flash. This still-in-the-oven tool will allow users to create fluid animations of objects on new (or existing) web pages with a graphical user interface using nothing more than HTML5, JavaScript and CSS3.

Steve Jobs must be laughing his ass off right now.

Let's face it - Flash is soooooo 1996. That's when a product called "FutureSplash Animator" was released. Never heard of it? Well, after the creators tried to sell the product to Adobe (in 1996) and Adobe passed - another heavy hitter (back in the day) - Macromedia heard about it and acquired the small company and their development team.

Macromedia (itself acquired by Adobe in 2005 for $3.4 billion!)  changed the name "SuperSplash Animator" to "Flash" - a combination of "Future" + "Splash" - and thanks to companies like Disney and MSN - Flash took off (MSN actually delayed their initial launch until Flash 1.0 was finished)

So, why did Flash succeed? Basically because plain HTML sucked. At the time, doing a plug-in to the browser was the only way to do these advanced animations and graphics. And, oh yeah, once Adobe got their hands on it - they convinced OEM (Original Equipment Manufacturers) to bundle Flash with their operating systems/browsers - so no one had to really "install" it.

Designers loved it because it allows them to create beautiful artwork in, say, Photoshop and then turn it over to the animators/designers to work their coding magic on the finished piece.

Animators/designers loved it - because... well... there simply was nothing else (well, besides Macromedia Director - which became Adobe Director).

So - that's how we got to where we are. Now - where are we headed? Answer: HTML5.

Why? Because Google and Steve Jobs say so. Period.

Nowadays everyone except Adobe hates flash.

Apple hates Flash.
Google hates Apple - but it really hates Flash as well.
Microsoft hates Flash so much they created a Flash rip-off called Silverlight (which they now also hate as well).

The fact that (finally) HTML is major getting a face lift (and tummy tuck, liposuction, and boob job) finally means that browser plug-ins that provide core functions will no longer be necessary. He said hopefully...

HTML should have been updated 10 years ago. But, 10 years ago, everyone was still going nuts on this whole "Internet thing" - and focusing more on business models and valuations than on the underlying technology to make it all work.

To make matters worse, HTML is open-source and free - which means the old view of "... I'm not spending my developer's time to enhance something for everyone - it doesn't provide value for our company" - or, as I like to call it, selfish greed - caused us to be where we are.

It was just easier and cheaper to write stuff in Flash - and because it was already installed on 90% of all computers out-of-the-box, it became a standard. It took someone with a strong personality (Steve Jobs) to draw a line in the sand (like he also did with software distribution and music distribution and iTunes, etc) to say enough is enough.

Besides Steve Jobs' temper tantrum, we also have a renaissance in the browser industry - spurred on first by Firefox and then by Google. Both of these "new" browsers decided to go with HTML5 at their core (or at least to adopt Apple's open-source WebKit HTML rendering engine). Even Microsoft - the king of "me too" - decided to "embrace" HTML5 in Internet Exploder Explorer 9 (or they would have lost the browser wars over time).

So, now that you're all hyped-up on HTML5 and as you wait for Edge to come out of the oven - there's a $30 Mac-based application called Hype that will do more than Edge does (for now) - and it'll help you get your feet wet with HTML5.

So, let's recap:

HTML5/JavaScript/CSS3 = "good".
Flash = "bad".
Adobe = "we better get on the train or we will become as irrelevant as Microsoft".

I, for one, sure hope that Flash goes the way of the floppy disk - and that "plain old" HTML continues to be actively extended as we move forward. It won't happen overnight, but fellow Internet users rejoice: a Flash-free browser experience is on the horizon!

Wednesday, August 03, 2011

Is Video Streaming Killing "Regular" TV? [INFOGRAPHIC]

Let's face it - network television is dying the same slow death that record stores did. It will take a little longer - because, unlike the music industry, television didn't change formats requiring you to re-buy all your favorite content on a different media (e.g. record, 8-track, cassette, CD, MP3).

And, I don't know about you - but after owning a digital video recorder (DVR) for a few years I can hardly watch "live" TV anymore. The commercials drive me nuts! It's way more convenient to just record the shows I want and "zap" through the commercials.

It seems that other people agree as well. According to a 2011 Nielsen report (the folks that count who what and when people watch TV and listen to radio) - people are streaming the heck out of video from all kinds of sources.

The obvious missing element is Netflix - but because people can stream that from all kinds of devices (AppleTV, Wii, Xbox, etc) - it wasn't included. But, I would wager when you throw in Netflix (which currently consumes over 30% of the entire bandwidth of the entire Internet!) - these totals go waaayyyy up.


Tuesday, August 02, 2011

Vintage Computer Ads - We've Come A Long Way, Baby!

I had a dear old friend visit over the weekend and we were reminiscing about how much our lives have changed over the years. Everything from our marital status, to our careers to our children have changed - and so has the technology we use everyday.

Back in the late 1980's I was a partner in an advertising company (Cusick & Klender Advertising) that did national radio and print campaigns. As part of our marketing schtick we created these characters called "The Admen."

These quasi-fictional characters were (in our minds) a perfect vehicle to use to demonstrate our advertising prowess by promoting our services via a demo that featured our Admen alter-egos. Long story short - we produced a demo reel with commercials we had written - intermixed with an "interview" with "those wild and crazy Admen...".


On the "B" side we re-wrote the lyrics to popular songs of the day ("Stray Cat Strut", "The Piano Man") and included a couple of songs we wrote just for the promotion. We had them all pressed and mailed them out - on CASSETTE tapes.

Yep. Cassette tapes.

A couple of years ago I came across a few copies (still in the shrink-wrap!) and gave one to my friend. Although I think I still have one of the only "cassette players" still in existence - he managed to find one, hook it up to his Mac with some who-knows-how-he-got-it cable and ripped down the entire cassette to a CD.

It was when he said "... well, I was thinking about it - and if I didn't transfer it to digital it might have been lost forever - because who in the hell still has a cassette player?" - that I had finally realized I was getting old. I also realized that technology had changed faster in reality than in my perception (or my feeble memory).

In fact, it's changed so much, that I wanted to take a look back at some of the cutting edge ads for "bleeding edge" technology at the time. So I hopped on the "new" interweb and found a bunch of older (actual!) advertisements from days gone by.

I hope you enjoy theses as much as I do:

P.S. Thanks, Ed for the CD!

Web Analytics