Update to FoodGeek Facebook App Released

I just released an update ( version 1.0.4 ) of the FoodGeek Facebook application. This update includes support for Spanish keywords, better Yelp! searches, and Star Rating support for lower DPI monitors.

You can learn more about FoodGeek here and if you have a Facebook account you can use the application here.

FoodGeek

Silverlight 3.0 with offline support coming soon…

Using IF in Oracle

DbIcon

“How do I do an IF statement in SQL” this is one of the most common search terms when someone is first learning to use Oracle. The answer is there really isn’t a function called IF that works the way you’d expect in SQL. You can use it in PL/SQL but not really in SQL. There are other methods such as using DECODE or CASE statements that provides this functionality.

But, what if you need IF in SQL for some reason? Can it be done? Of course, you just need to create your own conditional logic function. Recently in migrating from a legacy scripting application to a new system I found that I actually needed to the same “IF” keyword as Excel and VBA users were accustom too. The below function closely mimics that functionality for values values that are expected to be returned as numbers such as IF(1>2,3,4).

Oracle Excel style IF function:

FUNCTION FAKE_IF( In_Predicate_Text IN VARCHAR2,
In_True_Value IN NUMBER DEFAULT 0,
In_False_Value IN NUMBER DEFAULT 0)RETURN NUMBER
IS
Return_Count PLS_INTEGER;
BEGIN

EXECUTE IMMEDIATE 'SELECT COUNT (ROWID) FROM DUAL WHERE '
|| In_Predicate_Text INTO Return_Count;

IF Return_Count = 1 THEN
RETURN NVL(In_True_Value,0);
ELSE
RETURN NVL(In_False_Value,0);
END IF;

END EVAL_IF;


But Remember…



Unless your business need really requires you to take this approach I would avoid creating your own functions if they already exist in the system. Doing so increases both your maintenance burden and the complexity of the system. Just looking at performance DECODE and CASE statements are at least 30% faster. Below is some more information about Oracle’s build in conditional functions.



DECODE:



Oracle has a function called DECODE. This function is how they have implemented IF-THEN-ELSE logic. The syntax follows this format: decode( expression , search , result [, search , result]... [, default] ) Similar to the above IF expression the expression is your logic to evaluate (1>2). The following parameters allow you to specify a result returned for the expression and a default if none of the conditions have been met.



CASE Statement



In Oracle 9i, they introduced the ability to perform CASE statements. Similar to VB case statements, or C# switch statements you can perform complex conditional logic.



The syntax follows the format below:



CASE  [ expression ]
WHEN condition_1 THEN result_1
WHEN condition_2 THEN result_2
...
WHEN condition_n THEN result_n
ELSE result
END

Silverlight 3 enters the wild

 

Silverlight 3 was released yesterday a full day early.  You can now download Silverlight 3 RTW build windowslivewriter_silverlight3sisi3_12161_microsoft_silverlight_c_23.0.40624.0 (4.69MB) from the Microsoft Silverlight site.  Version 3 supports both Windows and Mac, with support for the following browsers:

  • Internet Explorer 6,7,8
  • Firefoex 2 & 3
  • Safari 3 & 4

I’ve found Silverlight an excellent tool for creating applications that require complex data visualization or a desktop like user experience.  Silverlight has also been a great platform for prototyping, since you can quickly create interactive screens.

Get it Now    
image   Many of the different toolkits, controls, and frameworks do not yet support Silverlight 3.   Whether you are building a new application or upgrading an existing one check with your vendor or project (opensource or otherwise) before starting.

 

I’ve been lucky so far and have not encountered any compatibility issues with my applications upgrade testing.  Given the large number of toolkits and controls it will take the community awhile to catch-up.

Below are a few links to get your started with Silverlight 3.

Silverlight.Net  

Microsoft’s production portal offering installations, help, tutorials, forums, and more.  If you are just getting started this should be your first stop.

     
Silverlight SDK   Silverlight 3’s SDK
     
Expression Blend 3   Expression Blend 3 + SketchFlow, helps you create Windows Presentation Foundation (WPF) applications for the desktop and Microsoft Silverlight 3 applications for the web.
     
Microsoft Silverlight 3 Tools for VS 2008 SP1   Visual Studio 2008 Sp1 add-on for developing Silverlight 3 applications.
     
SilverlightShow   Excellent source for Silverlight news and articles
     
Jesse Liberty’s Blog   Jesse Liberty is a Silverlight evangelist, who frequently posts tutorials, links, and other helpful information.

Dev vs. DBA the war is over

image
Photo by xetark
I first stumbled into the world of computing as of all things a DBA. From the beginning I’ve heard of this ongoing holy war between Developers and DBAs. Over the years I’ve seen the battles from both sides of the fence.

The fighting words generally start with “I need…” quickly followed by “No”. We’ve all heard the topics, Security, Scalability, Dynamic SQL vs. Stored Procedures, etc, etc. Doesn’t really matter the topic it all comes down to control.

After years of watching the battles, I think the war is finally over. These days I write more C# or Objective-C then PL/SQL I still consider myself a DBA at heart. So with a heavy heart, I fear that the developers have won.

Prove it you say? I wish it was harder, but all you really have to do is ask your favorite DBA something about Agile, Test Driven Development, or Design Patterns. Embarrassingly these practices have not been embraced by the DBA community.

Still need more proof? As with anything this is just my opinion, but I have noticed over the past five years or so when I speak with organizations their DBA groups are usually with Platform services groups. I can’t think of one case in which they where linked with Product or Service development. Has our failure to evolve and our default answer of “No” effectively taken us out of the fight?
image
Photo by abolotnov

Is it over for the data community? I surely hope not. We’ve got better tools, methodologies, and platforms then ever before. Just like all of the Rocky movies the data community needs to stage a comeback and learn a few new tricks.

Taking a few tricks from the developer and Agile communities here are a few sure fire ways to jumpstart your personal comeback.

Understand ORM’s better than your developers

No matter which side of the holy war you fall on, Object Relational Mapping frameworks are here to stay. They make developers more effective and avoid the mental context switch languages.

No matter how good the tool, the DBA will always better understand how to leverage the data model. Instead of banning your developers from using these tools, learn them. You have an advantage since you know the technology from the bottom up. These tools are not black boxes, and most of the mature frameworks offer extension points, allowing for you to write specific SQL or Stored Procedure code.

This provides the developers with their productivity gains, and provides you an opportunity to contribute scale, performance, and reliability to the project.

Some popular ORM Frameworks:

Make time to be included in the daily stand-ups

If your organization has adopted Agile as a software development methodology you need to attend the daily stand-up. In my experience DBAs are often not included or do not attend these meetings. Find time or a reason to attend, these meetings tend to be the heartbeat of the project, and an excellent chance to contribute to areas both inside and outside the database.

Learn to evolve your designs

Sometimes I think DBAs pioneered the concept of “Big Design Up Front”. Maybe it is just that the Erwin model is too hard to change. Whatever the reason, your design must be flexible enough to evolve over time. A simple Google search returns over 2 million results for refactoring tools. With tools by Oracle, IBM, Microsoft, and others design evolution has gotten easier and is supported on whatever platform you might be on. Take a lesson from Ruby developers, refactoring and code evolution are necessities to meet ever changing business requirements.

Learn Design Patterns

Ever wish you could tell your younger self how to avoid all of your bad decisions? Design patterns is the technology communities way of doing that. Knowing even the basics for design patterns helps you avoid mistakes made by others, allowing you to make other new mistakes.

Design patterns are not linked to any specific technology, allowing you to apply similar patterns to your data models as your Java developers do to their classes and entities.

Looking for a starting place? I’d recommend reading the below books.

Head First Design Patterns

image

Domain-Driven Design

image

Design Patterns: Elements of Reusable Object-Oriented Software

image

Learn another programming language

Do you know someone that has 20+ programming languages on their resume? That might be going alittle overboard but, knowing a few programming languages can do more then just get IT recruiters and HR Managers attention.

Learning how languages interact with our data model, is vital to understanding systems as a whole. I’m sure you’ve heard the stories of developers loading the entire database into arrays and looping to create joins in the server layer. Knowing and understanding the languages and frameworks your development team uses allows avoid the blame game of it’s the database or it’s the App Layer.

Confessions of a podcast addict

I’ve recently come to grips with my addiction to podcasts. Each morning I wake, and immediately reach for iTunes to receive my digital fix. The thought an iPod empty of latest news, opinion, and tech is unthinkable.

I’ve always learned best through audio so in all seriousness this media is a dream come true for me. Below are the highlights of my current listening.

Technology

  • .NET Rocks
  • Stack Overflow
  • Elegant Code
  • The Flex Show
  • Hanselminutes
  • Herding Code
  • Business / Project Management

    User Design

    News

    Microsoft Architect Journal 20 Available

    Love them or hate them Microsoft does put out several great publications. The latest version, Journal 20 focuses on Software Architecture in our current turbulent economy.

    Over the last few journals I’ve been impressed in their stance that architects need to not only talk about the value they add to organizations but provide proof and action on that value.

    You can read all about it here. Another nice features, is many publications in this area, they have a desktop reader that provides user experience almost as good as the print version. You can download the reader here.

    Other Microsoft Architecture Links:

    Pragmatic Magazine Now Available

    The Pragmatic Bookshelf now offers a free online magazine. This months copy available here offers some great career advice in these hard times.

    Below are a few of the topics discussed:
    • The Layoffs Are Coming!
    • Why Clojure?
    • When Things Go Wrong
    • Pragmatic Publishing

    With the world moving to twitter and less focused on blogging and books it is refreshing to see a magazine come to life. Hopefully they will be able to keep up the monthly publishing schedule