EmbeddedMan

Embedded Man

Adventures in Embedded Design.
  • Home
  • About
  • Books
  • Magazines
Rss feed Subscribe

Conference Attendance Down - Sign of The Times

Jun.23, 2009 in Uncategorized Leave a Comment

Last week I attended the TI Tech Days conference in Dallas and it was a stark reminder of the state of the economy.  Last year TI had two major conferences, the TI Developer Conference and the Advanced Technical Conference.  This year they bundled both into one and shortened it from 4 days to 2.  The venue was still a nice place but you could tell that corners were being cut where possible.  I happened to notice that many of the rooms we were in had a large power supply sitting on the floor as if the main 220 box had been pulled from the wall and they had no place to put but on the floor leaning agains the wall.  It’s hard to describe and I should have taken a picture to show just how odd it seemed.

In TI’s defense, they’ve had to make changes to stay afloat (who hasn’t) and they even had the CEO, Rich Templeton, give the keynote address.  Now I don’t know how many gozillian-dollar companies have their CEO speak to the troops but it sure made me feel special, no lie.  What’s amazing is that the guy is not that old, he couldn’t be more than 45 (at least that’s my guess).

While Mr. Templeton is a good speaker he couldn’t disguise the fact that there were much fewer attendees this year than last.  No surprise given the state of things but it’s kind of sad because large conferences are cool.  You get to meet people from all over and you get to see a lot of cool innovations.

Hopefully, next year will be better.  Keep coding!

Post to Twitter Tweet This Post

Open Source iPhone Woes

Jun.10, 2009 in Uncategorized Leave a Comment

You may have been wondering where I’ve been for the past few weeks.  Well, besides from working some insane hours, I’ve been trying to created programs for my iPhone using the open source toolchain.  Now I’m all about open source but I have to admit this is a lot harder than I anticipated.  I tried to use Linux but I couldn’t get the decrypting tools to work.  Ironically, I was able to get the dmg decrypting tools to work in Windows of all things so I went with Cygwin.  I was able to build the HelloWorld app which was way cool but I’m running into roadblocks getting the other examples to work.  Oh well.

Post to Twitter Tweet This Post

Hackers Hold Data for Ransom

May.14, 2009 in Just Because Leave a Comment

Sounds like a bad tabloid headline but, according to this article, some mean people hacked the Virginia Prescription Monitoring Program and stole some patient and prescription data and are now demanding $10 M to return the data.  This story was picked up by the AP whom reported that the state of Virginia refuses to pay the ransom.

This is a disturbing story for two reasons:  1) you would think that with all the cool things you can do with technology, why would people still insist on doing bad things?, 2) will this become a trend?

I don’t know if you know this but kidnapping has become a common thing in countries like Mexico.  It’s become so common in fact that now it’s starting to take place in border towns–on the US side.  Someone is kidnapped on the state side and quickly whisked away to the Mexico side where the law is less likely to find them before the ransom can be paid.

So what does Mexico have to do with this story?  Well if one person can hold data for ransom, who’s to stop this from becoming more and more prevalent.  I guess the first thing we should take from this is the importance of security and backups.  The other thing is that crime is crime whether its physical or cybernetic and when a crime is committed we all lose.

Post to Twitter Tweet This Post

Old School Programming Techniques

May.12, 2009 in Just Because, Programming Leave a Comment

This is an interesting article I found via Clive Maxfield (Engineer Extraordinaire) about programming skills that were once mandatory.  One interesting bit was Hungarian notation.  I use Camel Case but I still prefix pointers with a lower case “p” so I guess I’m still a little old school.  Punch cards are thankfully no more but I remember hearing other engineers talk about using them.  I remember taking a programming class where the instructor mentioned the “goto” statement and just simply saying “don’t use it!”  Can you think of any that are not on this list?  If so, just add them in a comment and we’ll keep out own list.

Post to Twitter Tweet This Post

Tags: C/C++, Careers, Programming

A Terminal For Your Cell Phone

May.05, 2009 in Cool Stuff, Embedded, Just Because Leave a Comment

If you have a Windows Mobile based cell phone you can now convert it into a laptop.  Celio Corp is selling a product called Redfly that is basically a laptop shell that runs off of the cell phone itself.  It comes in a 7″ version and an 8″ version and for now it only supports Windows Mobile.

Post to Twitter Tweet This Post

Tags: Cool Stuff, Embedded, Terminal, Tools

No More Software Development Conference

May.02, 2009 in C/C++, Career, Embedded, Programming 1 Comment

I just read this article about how the annual Software Development Conference has been obsoleted.  Earlier this year, TI cancelled one of it’s major annual conferences as well.  Of course these are all probably a sign of the current economic situation where people just can’t afford to pay for a conference.  Companies can’t afford the downtime of having its engineers attend a week-long conference knowing that its competitors are feverishly working to beat them to market.  The author of the article, Dan Saks, has been in this busines a long time and he makes a good point about how the internet presents many good learning opportunities but that can’t replace the face to face contact that conferences and classes can provide.

Post to Twitter Tweet This Post

Tags: Careers, Embedded, Programming

Using Interface Classes

Apr.25, 2009 in C/C++, Programming, Uncategorized Leave a Comment

If you are familiar with OOP then you already understand the benefits of polymorphism and inheritance.  It’s logical to think about a series of classes that are derived from some superclass (base class).  In the beginning you design your software hierarchically so each module or system depends on some lower-level subsystem.  But one day you inherit someone else’s code which is a mess (because YOU would never write spaghetti code) and you realize that there is some low-level class that needs to have access to a high-level class.  Say, for example, that you have a class named Car that contains a member object Sensor.


class CCar
{
public:
...
     void brake();
...
private:
    CSensor m_tempSensor;
};

Now suppose you had some condition where the sensor had to apply the brakes on the car.


class CSensor
{
public:
...
    void checkTemp()
    {
         if (m_temp >= DANGER_VALUE)
         {
              // brake car
         }
     }
};

Sure, you could just add a Car member to your Sensor class but since the Car class already contains a Sensor object that would cause a circular dependency and that would be bad.

So what do you do? Well, you implement an interface class.  An interface class is a class that allows two unrelated classes to know about each other. So you would declare an abstract class called ICar:


class ICar
{
public:
     virtual void brake() = 0;
};

Now can add an ICar object to your CSensor class and call the method accordingly:


#include "ICar.h"

class CSensor
{
public:
...
    void checkTemp()
    {
         if (m_temp >= DANGER_VALUE)
         {
              m_pCar->brake();
         }
     }

    void setCar(ICar* pCar)
    {
        m_pCar = pCar;
    }

private:
    ICar* m_pCar;
};

Now you derive the Car class from ICar and assign the Car’s CSensor object accordingly:


#include 
#include 

class CCar : public ICar
{
public:
     CCar() { m_tempSensor.setCar(this); }
     virtual void brake();
...
private:
    CSensor m_tempSensor;
};

The header files for ICar and CSensor would be at the same lower-level which is why the #include statements in the Car declaration have <> signs instead of the double quotes. So now through polymorphism the CSensor class can call the appropriate CCar method. Cool huh?

Keep coding!

Post to Twitter Tweet This Post

Tags: C/C++, Programming

Every Goal Has It’s Price

Apr.18, 2009 in Uncategorized Leave a Comment

A few days ago I finally reached my 40th birthday (thank God) and perhaps because of that I’ve started giving serious thought to how to best use time (yikes, I’ve started my midlife crisis).  As you may recall, I recently bought an iPhone and, being a geek, I immediately began imagining creating programs for the thing.  I don’t own a Mac so I started looking into a toolchain that I could use either in Windows or Linux.  That lead me to all kinds of information about using Open Source tools to develop for the iPhone.  I actually began the process of installing said toolchain on a Linux virtual machine (vms rock) but I realized that installing and configuring those tools was taking up a large amount of time.  Now please understand I’ve being using Linux either for business or pleasure for some time now so I understand that nothing is really free.  And up to now I was willing to exchange time for knowledge and freedom of code.

Time Becomes More Valuable Than Money

When you think about it we as humans really only have two resources with which to “pay” for reaching a goal:  time and money.  When we “buy” an iPhone we really just exchange our money for someone else’s product.  When we “earn” money at work we really are exchanging our time for someone else’s money.  Of those two, the most valuable is time because it is the one resource that we can never recuperate.  Money can be made and lost and made again but once time is expired it is gone forever.  Deep?  Touchy-feely?  Bordering on Matrix-like philosophy?  Not hardly, but true nonetheless.

So what does this have to do with programming?  It’s about using the right tool for the job.  There is an addage that says, “If the only tool you have is a hammer, all the problems of the world appear to be nails.”  I’m not saying that free toolchains are bad but I realized one day that I had invested about 6 hours in trying to get the “free” toolchain installed and configured correctly.  That’s 6 hours of my life that I will NEVER get back.  And I was no where nearer to actually writing a program.  It was a good learning experience but I couldn’t help but wonder how much quicker I would have reached my goal if I had just had the right tool to begin with:  a Mac.

Yes, I know that lots of people have already created tons of programs using the free tools and I’m sure things are working great for them.  But my priority is not to write open source software for the sake of open source.  I just want to be able to reach my goals in a short amount of time.  Because I don’t know how much I have left.

Post to Twitter Tweet This Post

iPhone At Last

Mar.31, 2009 in Cool Stuff 2 Comments

The worm has definitely turned for you,man.

- Willem Defoe to Charle Sheen in Platoon

If you remember that movie you’ll recall that bit of dialogue takes place after Charlie’s character samples a joint for the first time.  That’s a bit how I feel right now.  No, I haven’t been smoking pot!!!  But I have sucumbed to the drug known as the iPhone.

First, a bit of history.  For many a year now I have been secretly yearning for an iPhone but the cost was always beyond my economic grasp.  Even when Apple released the 3G version last year and AT&T began offering the 16 GB model for $299 I was still reluctant.  I figured that I would just renew my contract with my then wireless provider for another two years and get a phone for “free”.

So I renewed my contract and you may recall that earlier this year I posted my review of my new Pantech 820 phone.  I mainly got that phone because it gave me an excuse to start learning development for Mobile Windows.  Of course having a phone with native Windows Media Player I had to get an internet data plan.  That phone wasn’t necessarily bad but it still wasn’t an iPhone.

Everything was going fine until a week-and-a-half ago I went to the AT&T website to access my residential phone account.  Well of course the front page displayed a sexy picture of the iPhone and I was easily swayed into looking at the available offers.  I found out that AT&T was now offering refurbished iPhones for $100 less than their normal retail price.  That meant that an 8GB model was now available for $99 bucks!!  As if that wasn’t enough, I began checking the phone and data plans and made a startling discovery.  The internet data plan for the iPhone was only $30 a month.  At the time I was paying $50 a month for the internet data plan on my smaller, okeedokee phone.

iphone main menu

That clinched it.  Sure, I had to pay a fee for cancelling my current contract but I was willing to pay that price to get something I’ve always wanted.  This is without a doubt the coolest gadget I have ever owned.  I know there’s lots of talk about Android and how it’s going to supplant the iPhone.  I don’t know what will happen in the future but, for now, the iPhone has no comparison.

Post to Twitter Tweet This Post

Tags: Add new tag, Cool Stuff

Using Inheriance to Selectively Execute Code

Mar.27, 2009 in C/C++, Programming Leave a Comment

Inheritance in and of itself is a concept that was not hard for me to grasp. The idea that one object can be created from another and, therefore, receives some attributes from the thing that created it is analogous to parents having children. A real-world analogy always helps in understanding new concepts. The problem was figuring out how to play tricks with inheritance to get the code to do what you want.

For example, say you have a class Son that is derived from a base class Dad.

class Son : public Dad
{
…

The Dad class has a method named live() that contains two statements: goToCollege and getMarried.

class Dad
{
    void live()
    {
        goToCollege;
        getMarried;
    }
};

Suppose the Son wants to mimic some of Dad’s behaviour but no all of it. For example, say the Son wants to goToCollege but he doesn’t want to getMarried. Now he’s got a problem because if we call the live() method it will default to executing both the methods in the Dad class. One solution is to have Son override the live() method and copy only the goToCollege statement. That would be wrong because it would totally defeat the purpose of Inheritance which is supposed to eliminate redunancy.

So what do you do? This is the stuff I didn’t learn in school and I’ve not yet found in a book.

The answer is to create add a method to the Dad class that encapsulates the getMarried portion of the code then have the Son class override that method.


class Dad
{
    void getHitched()
    {
        getMarried;
    }

    void live()
    {
        goToCollege;
        getHitched();
    }
}

class Son
{
    getHitched() { // no way }
}

Now if you call Son->live() it will still execute the goToCollege statement because that is inherited from the Dad class. When the Dad class live() method gets to the getHitched() method it will execute the overriden method in the Son class. Since the Son version of getHitched() contains nothing, nothing more will happen.

Keep coding.

Post to Twitter Tweet This Post

Tags: C/C++, Programming
« previous entries  
next entries »
  • Sign up for out mailing list!

    E-mail:admin@embeddedman.com

    Subscribe
    Unsubscribe

    Get this Wordpress newsletter widget
    for newsletter software
  • Meta

    • Log in
    • Entries RSS
    • Comments RSS
    • WordPress.org

© 2007 Embedded Man - SafiTech Theme

Full RSS - Comments RSS