LINQ to Twitter does Delphi

Delphi Prism that is.  Since Delphi Prism supports LINQ, I wondered if LINQ to Twitter would work with it.  It broke on my first try because the enum parameters were being parsed differently than in C#.  So, I fixed this and checked in the new fix: http://linqtotwitter.codeplex.com/SourceControl/ListDownloadableCommits.aspx.  Be sure to grab ChangeSet #53131 or later.  Here’s a small demo application:

namespace TwitterTest;
 
interface
 
uses
  System.Linq,
  LinqToTwitter;

type
  TwitterTestClass = class
  public
    class method Main; 
  end;

implementation

class method TwitterTestClass.Main;
begin

  var TwitterCtx : LinqToTwitter.TwitterContext := 
    new LinqToTwitter.TwitterContext;

  var Tweets :=
    from tweet in TwitterCtx.Status
    where tweet.Type = StatusType.Public
    select tweet;

  for tweet : Status in Tweets do begin
     System.Console.WriteLine(
        "User Name: {0}, Tweet: {1}",
            Tweet.User.Name,
            Tweet.Text);
  end;

end;
 
end.

Now my Delphi friends have an easy way to program Twitter applications.

LINQ to Twitter v1.0 RTW

LINQ to Twitter, v1.0 is now RTW: http://linqtotwitter.codeplex.com/. LINQ to Twitter allows .NET developers who program in C# or VB to program Twitter applications using familiar LINQ syntax they are accustomed to.
 
This is an open source project that comes with a full Visual Studio 2008 solution. I plan to keep LINQ to Twitter up-to-date as the Twitter API evolves and welcome new ideas and feature requests.
 
I would love to hear from anyone who uses LINQ to Twitter in their own projects.
Joe
 

IE8 Accelerators

IE8 has a feature called accelerators that allows you to highlight screen artifacts and do things to them.  One of the neat features that I used today was the translator accelerator, shown in the following image:

image

As you can see, this was on Twitter.  I highlighted the tweet, which showed the accelerator icon.  Then I picked Translate with Live Search, selected the from/to languages, and viewed the translation.

Another step in making the world a smaller and friendlier place to be.

Data Modeling with Visio

I’m building a data model for a pretty good sized database.  I’ve used the SQL Server data designer in the past and that has been useful. You get a nice visual on tables and relationships and can build different views.  For this job, I wanted something simple where I could communicate the data model, have documentation, and make quick changes.  SQL Server data diagrams are the actual database as opposed to the abstraction you get when modeling, print out very poorly, and are slow as a dog to do anything with.  So, I took a look at Visio.

I’ve used the Visio entity model designer before, but it just didn’t click with me.  Maybe it was something I wasn’t used to or maybe I preferred having the larger workspace of the SQL Server designer; I don’t know.  However, this go round, Visio is working quite well.  It lets me model at a higher level of abstraction, concentrating on properly capturing data requirements without too much focus on detailed design. Since it’s page based, it will print out nicely, which is well suited to what I want.  Another big advantage is that working with Visio is remarkably quick.  Drag-and-drop is quick, naming is easy, and adding fields is a simple matter of clicking a tab and everything I care about for defining a field is on one line, including field description.  Associations are quick drag-and-drop and the FK/PK relationship is immediately inferred, which is what I want to do most of the time anyway.  Cool stuff that Visio; now if I could just figure out how to push my model into SQL Server real quick…

Fascinating Twitter Communication

Something interesting happened today in Twitter.  It started when someone was reading the C# Tutorial.  At the same time, I was updating Lesson 12, which that person was reading. The site bugged out during the update, but came back to normal. I tweeted the update, which appeared on a Twitter badge that I put on C# Station. The reader saw the tweet on the badge, realized what had just happened to them, and responded to me on Twitter.

Maybe I’m a easily fascinated by shiny things, but this is one of the moments that demonstrates the power of social networking. Whether its a blog, Twitter, or any other Web 2.0 site, the possibilities for enhanced communication and interaction are huge. It’s no wonder why new on-line mediums, such as Twitter, are getting so much attention in the news. Journalists are in the business of communication and they get it as well, if not better, than the rest of us.

Updated C# Tutorial – Lesson 12: Structs

Not only did the structs lesson in the C# Tutorial have code smells, but the writing wasn’t too fresh either.  Got an email this morning that something in the lesson wasn’t quite right, so I took a look.  The result is that I felt a compelling need to rewrite 99% of the lesson. This version incorporates earlier feedback from other people, such as a little more explanation of the differences between class and struct and example code that was closer to best practice.  I think the code is at least not bad practice anymore, but any small example will be limited in accomplishing anything other than the specific goal it is written to achieve.  Anyway, here’s the link and I hope people find it useful:

The C# Tutorial @ C# Station – Lesson 12: Structs

Jumping into Coding Head First

A lot of developers jump straight into a project and begin coding.  The boss gives a vague “do this” instruction and the programmer starts writing code, which is fun.  Maybe it continues to be fun until the boss starts bugging for the application to be done.  If they haven’t done so in the beginning, they’ll ask for an estimate of when it will be done.  Of course, they get a vague or incorrect answer back because “do this” is very vague itself.  If the developer is inexperienced and/or is using a new technology, in addition to “do this” requirements, who knows what the end result of the project will be.  Making matters even worse, the boss’ perspective of “do this” is totally different from the developer’s view of “do this”.  A lot of times, the end result will be a failed project, or one survived through heroics.

The result on the companies that write software this way is an incredible waste of money, late deliveries, and lost revenue.  A lot of companies get started with software projects, having no idea what the true cost is.  Many people have used productivity tools like MS-Access, Excel, or some other RAD tool and have been given the false impression that they can build enterprise applications with a few drag-and-drop operations and maybe some VB glue code here and there.  In reality, these applications have no optimizations, proper data definitions, constraints, validations, error checking, or any other QoS considerations.  So, their perception of what a true enterprise application costs is skewed by their own inexperience.  They regard formal requirements/scenarios, architecture, design, test, stabilization, and deployment as non-essential overhead or trivialities they have no time for.  Furthermore, they want to save money any way they can, and they’re often unaware of the consequences.

Solving this problem is a matter of fixing two sides of the equation, which includes both the company and the programmer.  Just like the company relies on proper planning and execution for its core business, it must regard software engineering as an important enabler to the success of their business and invest in a process that facilitates proper development. There are many processes out there, but any business person who has an ounce of education should understand organization, planning, execution, and coordination management functions.  Regardless of what pundits and zealots preach, these management functions translate directly into many software processes.  Rather than just jumping in head first and coding, a developer should have a methodology in mind that they subscribe to for their software development process.  Essentially, all of the processes boil down to some form of requirements, design, coding, testing, and deployment.  Both the developer and boss need to communicate on the process they will use and then make it work, which will go a long way to avoiding the problems described in the first two paragraphs.

Visual Studio Split Screen for Writing Tests

Split screen in Visual Studio can be used for various reasons, but it really excels when writing tests.  To split a screen, right click on the Tab in the editor, and select New Horizontal Tab Group.  You can tab vertical too.  To undo the split, right-click on the bottom (or right) tab and select Move to Previous Tab Group. 

The following figure shows a test in the top pane and the method being tested in the bottom pane:

VSSplitScreen