Monday, July 14, 2008

I was honored with the MVP award for the 4th year in a row this month from Microsoft corporation.

The Microsoft MVP Award recognizes exceptional technical community leaders from around the world who voluntarily share their high quality, real world expertise with others. Microsoft MVPs are a highly select group of experts representing technology's best and brightest who share a deep commitment to community and a willingness to help others. Worldwide, there are over 100 million participants in technical communities; of these participants, there are fewer than 4,000 active Microsoft MVPs.

Monday, July 14, 2008 3:24:44 AM (Pacific Standard Time, UTC-08:00)  #    Comments [0]   C# | Technology  | 
 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  | 
 Saturday, August 25, 2007

I am very excited to be asked to speak at this year's DevReach conference in Sofia, Bulgaria on October 1st and 2nd. I am presenting two sessions this year, the first is "LINO on LINQ" and the second one is "Silverlight, Flash on Steroids".

I am traveling with my colleague, John Waters (Falafel CTO), who will be speaking there as well on "Creating a billion dollar ERP system using Telerik technology".

Spending some time with the Telerik team in Bulgaria and some of the speakers I got to know through speaking at conference worldwide like (Steve Forte, Richard Campbell, Chad Hower and Brian Noyes) will be a treat!

 

DevReach logo

Saturday, August 25, 2007 6:54:26 PM (Pacific Standard Time, UTC-08:00)  #    Comments [0]   Business | C# | Conference | Falafel | LINQ | RadControls | 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  | 
 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  | 
 Saturday, August 11, 2007
Did you see the new book from Microsoft Press? It is all about me :)
Just kidding, thought to plug in Marco Russo's book and get people to start looking at LINQ as it will change a lot of lives.
Also, read Charlie Calvert's blogs on C# and LINQ as it comes closer to releasing C# 3.0 in its final form.

I expect to blog a lot going forward on C# 3.0 and LINQ, so comment here with questions on what you would like to learn or get more information about first.

Linq_Lino.jpg
Saturday, August 11, 2007 3:42:32 PM (Pacific Standard Time, UTC-08:00)  #    Comments [0]   C# | Humor | LINQ  | 
 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  |