<CharlieDigital/> Programming, Politics, and uhh…pineapples


My Grapefruit Addiction

Posted by Charles Chen

Ever since I discovered that I could actually cut out grapefruit wedges (I lived for some 25 years before I discovered this fact!), I've been addicted to the tangy, juicy globes of goodness.  Half the fun is playing with sharp knives; half the fun is the tasty, tasty reward.  As a bonus, eating grapefruit allows you to bask in your manly skills.

Here's a guide to help you get your grapefruit addiction on:

Step 1: Take off the rind with a sharp knife

Step 2: Cut out the wedges (hat and scarf optional; happy face: mandatory!)

Step 2a: Check out that skill and precision!

Step 3: Squeeze the juice from the membranes (only manly men need apply)

Step 4: Squeeze the juice from the rinds

Step 5: Victory!

Did you know that Texas is one of the largest producers of Ruby Red grapefruits?  As a grapefruit loving Liberal, I'm highly conflicted by this!  Well, at least they're good for something; we can't let them secede just yet!


Workshop : XML Schemas + Object Models

Posted by Charles Chen

Actually, very few .Net developers that I've worked with know what a typed DataSet is let alone how to create one. It's one of those perplexing things that always baffles me as typed DataSets are not a bad way to make the best of the flexibility of DataSets while still offering design time support and comiple time error checking (to some degree, of course).

At the core of the typed DataSet is an XML schema that describes the types and structure of the DataSet. While typed DataSets are great, if you ever look at the code, it's quite heavy and not necessarily the most optimized structure for over the wire transport. As even the discussion of typed DataSets narrows down the audience of developers that know how to work with schemas to generate a typed DataSet, the concept of generating entire object models using XML schemas is even less understood. Yes, indeed, the XSD.exe tool that ships with Visual Studio.Net can also be used to generate object classes from the same schemas (although they are a bit clumsy to work with).

You may be asking yourself why bother with schemas when you can just create the classes by hand or some other sort of visual code generation tool. Well, for some people (myself included), schemas seem a very natural way to express object models and classes. I mean, after all, the purpose of a schema is to define what an object (typically an XML document) looks like. But certainly, if that was it, it wouldn't really be worth the effort, now would it? For me, there is an added benefit in that it's very easy to define typed collections in schemas. On top of that, the generated classes come with various XML attributes already marked up for you, which is handy if you plan on using the classes as data transfer objects for your web service.

If you're interested, check out the workshop.

Leave comments, questions, and criticisms in the thread.

Filed under: .Net, Workshop No Comments

Workshop : JavaScript Combobox

Posted by Charles Chen

The default set of HTML controls do not include functionality like that of the WinForms combobox. For UI designers, this is usually resolved by having both a text box and a dropdown select box and allowing users to use one or the other. However, the big drawback of this approach is that it takes up what could be valuable real estate space and it's not necessarily the most elegant solution to the problem.

This workshop goes through how we can utilize the power of unordered lists and CSS to create a custom, JavaScript combobox.

If you're interested, check out the workshop.

Leave comments, questions, and criticisms in the thread.

Filed under: Workshop No Comments

Workshop : CDOSYS + .Net

Posted by Charles Chen

As anyone who has used the .Net System.Web.Mail namespace can attest, the default .Net mail classes are woefully lacking
in functionality.  It's really a shame too, considering that
they're based off of the very powerful CDONTS/CDOSYS libraries, which
allow a lot more functionality.

In this first investigation into unleashing the full power .Net web
mail, we will create a simple web interface to send email messages with
a user uploaded attachment without saving the uploaded attachment to disk first.

Some of this functionality is likely built into many third party
mail packages, but why pay for it if you have time and you can build it
for free?

So if you're still interested, hop on over to the workshop article.

As always, please leave comments, questions and criticism in the post.

Filed under: .Net, Workshop No Comments

Workshop : EditPlus + SQL

Posted by Charles Chen

Welcome to the second installment of my workshop series of articles.

This time, the workshop focuses on tools, for what is more important
to the master craftsperson than the tools used in the craft?

While most people are resigned to using Microsoft's default IDEs for
working with SQL Server (Query Analyzer, SQL Management Studio), both
utilize terribly subpar text editors which are just too clunky to work
with when dealing with complex procedures.

Enter EditPlus, the greatest text editor, ever.  Evar.  I've been using it since my Freshman year in college when a co-worker at iCan Services
introduced it to me.  I've been using it for everything from
Prolog to Java to C# to DHTML to TSQL.  With a little help from
some of the tools that ship with SQL Server, we can hook up EditPlus so
that working with TSQL is no longer a pain in the butt.

If you're tired of working with Query Analyzer and you're a cheap bastard like me, then this workshop is for you 😉

Please feel free to leave comments, questions, criticisms, error reports, and what not in the thread.


Filed under: SQL Server, Workshop 1 Comment

Workshop : Configurable DTS Packages

Posted by Charles Chen

I finished my first "workshop" article!

Had a bit of free time and decided to finish it as it's something that I've been meaning to do for quite a while now.

As an aside, the "workshop" series of articles are meant to be my
gesture of giving back to the community from which I've taken so
much.  I know I've found tons of useful blog posts and articles
online that have helped me greatly in the past, so I feel that it's
only fair that I give back a bit.   I don't claim to be some guru
or know all of the answers,
but my hope is that the information that I provide in these articles
can help someone out there get their job done more easily.  I'm
also aware that someone out there may have already done something like
this, but my own experience tells me that it's always helpful to work
with various sources to gain different insights.

Now onto the article!

In March, I worked on creating a SQL Server DTS package to import data
from various data files.  One aspect that grew tiring really fast
was having to manually change the paths of the source data files each
time I moved the package from one environment to another (or even from
my machine to Kent's).  We had 6 datafiles at the time (early
testing/development phase) in addition to various other settings that
were environment dependent like mail server addresses and database
logins.  I was simply too lazy to keep fiddling
with the settings in DTS every time I had to send the package to the
client or to Kent.

The solution I came up with makes use of DTS global variables, the
powerful "Dynamic Properties Task" task, and some simple VBScript.

Still interested?  Then read the full article.

Feel free to leave comments, questions, and criticisms 🙂 in this thread