Tuesday, November 20, 2007

Falafel is partnering with Microsoft to offer this free half day seminar at the beautiful Saint Claire hotel in downtown San Jose, CA to celebrate the release of Visual Studio 2008, LINQ, WPF, WCF, WF and other exciting technologies.

Party

Please join us on December 10th from 9:00 AM to 1:00 PM
Register on the Microsoft event site ASAP as space is limited.

Charlie Calvert, the C# Community Project Manager will be there to talk about LINQ and Lino Tadros will present the usefulness of the new technologies.
Hope to see you there!
Tuesday, November 20, 2007 1:21:19 AM (Pacific Standard Time, UTC-08:00)  #    Comments [0]   ASP.NET | Business | C# | Conference | Falafel | LINQ | Sharepoint | Technology  | 
 Sunday, October 28, 2007

During my trip to Bulgaria speaking at the DevReach conference, earlier this month, I was interviewed by the great people of SilverlightShow.net to comment on the state of Silverlight, its present and future direction.  Feel free to watch the video here.

You can also view the interview they did on the subject with my friend Todd Anglin from Telerik on the same day.

Sunday, October 28, 2007 11:50:32 PM (Pacific Standard Time, UTC-08:00)  #    Comments [0]   ASP.NET | Conference | Technology | Telerik  | 
 Tuesday, August 21, 2007

Anonymous delegates are a very neat and useful feature in C# 2.0. The idea of keeping your code tight and simple without having to move all over your code to understand what it is supposed to be doing is always a welcomed feature in today's complex coding endeavors.

Let's take for example a simple class of Mediterranean Food below that just declares a name and description properties:

 
1 public class MediterraneanFood 2 { 3 private string _name; 4 public string Name 5 { 6 get 7 { 8 return _name; 9 } 10 } 11 12 public string Description 13 { 14 get 15 { 16 return _description; 17 } 18 } 19 20 private string _description; 21 22 23 public MediterraneanFood(string name, string description) 24 { 25 _name = name; 26 _description = description; 27 } 28 }

The goal of the code I am going to be writing below is to create a list of Mediterranean foods and then search the list for a specific food.  As you will see the code below, I tried to show how it is done in 3 different ways (Very old, old and Anonymous Delegates way) just to give you an idea of what the difference is and the code changes needed to bring the code to the 21st century :-)

In the first way (Very Old) we just go through the list using foreach to find the specific food we are looking for.  What's the fun in that! :-)

The second way (Old) I declared a delegate called "OldFindFood" and then in the code we pointed to that delegate via a predicate (type of a delegate) and let the delegate do the search for us.  Problem here of course is the meat of what it is supposed to do is far away from where it is being used in the code.

Finally, I used an Anonymous Delegate which does not need any of the previous code.  The anonymous delegate is declared on the fly and implemented right after the declaration making easy and simple to understand what the intent of this code supposed to be doing.

Have fun, let me know if you have questions or if you have a different opinion.

1 private static bool OldFindFood(MediterraneanFood foodToFind) 2 { 3 return ("Kabob" == foodToFind.Name); 4 } 5 6 private static void ShowFood(MediterraneanFood food) 7 { 8 Console.WriteLine("Name: {0} Description: {1}", 9 food.Name, food.Description); 10 } 11 12 static void Main(string[] args) 13 { 14 15 List<MediterraneanFood> mediterraneanFoods = new List<MediterraneanFood>(); 16 mediterraneanFoods.Add(new MediterraneanFood("Falafel", "Made to Order!!")); 17 mediterraneanFoods.Add(new MediterraneanFood("Kabob", "Meat on a skewer")); 18 mediterraneanFoods.Add(new MediterraneanFood("Babaganoush", "Eggplant dip")); 19 mediterraneanFoods.Add(new MediterraneanFood("Dolmas", 20 "Stuffed grape leaves, with meat")); 21 22 23 MediterraneanFood foundFood; 24 25 // -- Very Old -- 26 Console.WriteLine("\nVery old:"); 27 foreach (MediterraneanFood food in mediterraneanFoods) 28 { 29 if (food.Name == "Kabob") 30 { 31 ShowFood(food); 32 } 33 } 34 35 // -- Old -- 36 Console.WriteLine("\nOld:"); 37 38 System.Predicate<MediterraneanFood> myPredicate = 39 new Predicate<MediterraneanFood>(OldFindFood); 40 foundFood = mediterraneanFoods.Find(myPredicate); 41 ShowFood(foundFood); 42 43 // -- Anonymous Delegate -- 44 Console.WriteLine("\nAnonymous Delegate:"); 45 List<MediterraneanFood> foods = 46 mediterraneanFoods.FindAll(delegate(MediterraneanFood foodToFind) 47 { return (foodToFind.Description.ToLower().Contains("meat")); }); 48 foreach (MediterraneanFood food in foods) 49 { 50 Console.WriteLine(food.Description); 51 } 52 53 Console.ReadLine(); 54 } 55 }
Tuesday, August 21, 2007 10:59:15 AM (Pacific Standard Time, UTC-08:00)  #    Comments [2]   ASP.NET | C# | Falafel | Technology  | 

My dear friend Bary Nusz is visiting from Texas these couple of days attending some WPF, Expression Blend and Silverlight training.  He is staying with me these few days and tonight he decided to make a deployment for one of our major customers, but in style :)  I could not help but record his fancy life style while deploying a multi million dollar application from the comfort of my Jacuzzi.

Tuesday, August 21, 2007 3:39:14 AM (Pacific Standard Time, UTC-08:00)  #    Comments [0]   ASP.NET | Falafel | Life | Technology  | 
 Monday, August 20, 2007

I was trying to use the excellent RSS Toolkit 2.0 to place my company's news on the main site at www.Falafel.com in order to allow me to enter news in one place only which is our support.falafel.com site and aggregate all from one place.

I grabbed the RSS feed from here and it was few minutes till I was able to get the RSS Toolkit 2.0 component to show up on the site with the same exact CSS styling and everything.

One thing that bothered me is the publication dates for the news were coming in as a long DateTime format, for example: Fri, 17 Aug 2007 21:52:35 -0700

I am used to fix these problems in the ASP.NET markup by using something like:

<%# Eval("pubDate", "{0:D}") %>


For some reason, that did not work this time.  As a matter of fact, no matter what I place in the second parameter, no change occurs.  I went back to the XML coming from the RSS feed and noticed that the pubDate is placed inside of a CDATA schema, which really means it is coming in as a string and it is way too late in the game to retrieve it differently.

1 <item>
2 <title>
3 <![CDATA[Steve Tefethen Joins Falafel Software]]>
4 </title>
5 <link><![CDATA[http://support.falafel.com/index.php?_m=news&_a=viewnews&newsid=7&group=default]]>
6 </link>
7 <description><![CDATA[SAN JOSE, Calif. July 5, 2007 -- Blah, blah blah. ]]></description>
8 <unixdate><![CDATA[1187412755]]></unixdate>
9 <pubDate><![CDATA[Fri, 17 Aug 2007 21:52:35 -0700]]></pubDate>
10 </item>


Well, to fix this in your ASP.NET application, the easiest way is to do a double conversion on the fly from String to DateTime back to string in whatever format you desire.

<%# Convert.ToDateTime(Eval("pubDate")).ToLongDateString()%>

Monday, August 20, 2007 3:57:16 AM (Pacific Standard Time, UTC-08:00)  #    Comments [0]   ASP.NET | C# | Falafel | Technology  | 
 Thursday, August 16, 2007
I am very pleased to see the training courseware Falafel Software developed for Telerik available as on-demand printed material on Lulu.  The course was written by experts in the ASP.NET arena as well as the Telerik product offerings. RadControls for ASP.NET: A Step By Step Learning
Thursday, August 16, 2007 5:26:44 PM (Pacific Standard Time, UTC-08:00)  #    Comments [1]   ASP.NET | Falafel | RadControls | Telerik  | 
 Wednesday, August 08, 2007

I am excited to start my own blogging site to share my views, thoughts and expertise with others and also get feedback from others about anything and everything in life from Technical to Family to Life.

Cheers

- Lino

Tuesday, August 07, 2007 11:00:00 PM (Pacific Standard Time, UTC-08:00)  #    Comments [0]   ASP.NET | C# | Family | Humor | Life | Technology  |