Kevin Connolly
Geek. Developer. Entrepreneur. All-around good guy.
Builder of things. Solver of problems. Changer of worlds.

Displaying all Posts between 02/01/2010 and 02/28/2010
2013-04 2 Posts
2013-02 7 Posts
2013-01 1 Posts
2012-11 2 Posts
2012-10 7 Posts
2012-08 4 Posts
2012-07 12 Posts
2012-06 11 Posts
2012-05 11 Posts
2012-04 29 Posts
2012-03 3 Posts
2012-02 12 Posts
2011-12 15 Posts
2011-11 10 Posts
2011-09 1 Posts
2011-08 7 Posts
2011-07 6 Posts
2011-06 12 Posts
2011-05 9 Posts
2011-04 3 Posts
2011-03 3 Posts
2011-02 1 Posts
2010-12 6 Posts
2010-11 17 Posts
2010-10 14 Posts
2010-09 11 Posts
2010-08 14 Posts
2010-07 9 Posts
2010-06 20 Posts
2010-05 3 Posts
2010-04 11 Posts
2010-03 15 Posts
2010-02 8 Posts
2010-01 4 Posts
2009-11 4 Posts
2009-10 11 Posts
2009-09 1 Posts
2009-08 17 Posts
2009-07 3 Posts
2009-06 7 Posts
2009-05 5 Posts
2009-04 12 Posts
2009-03 10 Posts
2009-02 11 Posts
2009-01 24 Posts
2008-12 19 Posts
2008-11 12 Posts
2008-10 20 Posts
2008-09 22 Posts
2008-08 34 Posts
2008-07 35 Posts
2008-06 27 Posts
2008-05 30 Posts
2008-04 42 Posts
2008-03 21 Posts
2008-02 26 Posts
2008-01 47 Posts
2007-12 33 Posts
2007-11 37 Posts
2007-10 39 Posts
2007-09 50 Posts
2007-08 43 Posts
2007-07 22 Posts
 

Creating Dynamic Data-Driven Charts in .NET is Fun and Easy

02/22/2010 01:44 AM - ok, that's a lie. creating dynamic data-driven charts in .net is tedious, poorly documented, and a pain in the ass. but then you figure it out once and it's really easy the second time you do it. microsoft demos and videos tell me that charting is built into .net 4.0. well, i'm running the vs2010 rc and i don't see it, so charting is still a seperate assembly for now. so here's how you do it. download microsoft chart controls for .net 3.5 install it (mscharts.exe) onto your dev workstation. you do not have to install it on the target webserver or client machine. add these items to your visual studio 2008/2010 toolbox: system.web.ui.datavisualization.charting system.windows.forms.datavisualization.charting webforms: drag the web one's chart object onto your code block. winforms guys, you're on your own from here. set some properties. you'll need chart.imagestoragemode, chart.series, chart.chartareas, and chart.legends. my working example looks like this:     <asp:chart id="ctrafficbymonth" runat="server" imagestoragemode="useimagelocation" imagelocation="graph" width="500" textantialiasingquality="high" alternatetext="traffic by month" antialiasing="all" >         <series>             <asp:series name="humans" charttype="line" color="red" tooltip="human traffic" />             <asp:series name="spiders" charttype="line" color="darkblue" tooltip="spider traffic" />             <asp:series name="total" charttype="line" color="green" tooltip="total traffic" />         </series>         <chartareas>             <asp:chartarea name="chartarea1">                 <axisy title="distinct sessions" />                 <axisx labelautofitstyle="labelsanglestep90" />             </asp:chartarea>         </chartareas>         <legends>             <asp:legend docking="bottom" alignment="center" />         </legends>     </asp:chart>   and of course you'll need to put some actual data into your chart. you'll need xyz coordinates, where xy appear on the chart and z is your axis number (which i arbitrarily decided equals a z coordinate). these must correspond with the <asp:series... /> lines you added in your aspx.   using (datatable dt = utils.getmonthlyhits()) {    dghits.datasource = dt;    dghits.databind();    for (int i = 0; i < dt.rows.count; i++) {        ctrafficbymonth.compression = 100;        ctrafficbymonth.series["spiders"].points.addxy(i, dt.rows[i]["spiders"].tostring());        ctrafficbymonth.series["humans"].points.addxy(i, dt.rows[i]["humans"].tostring());        ctrafficbymonth.series["total"].points.addxy(i, dt.rows[i]["total hits"].tostring());     ctrafficbymonth.series[0].points[i].axislabel = datetime.parse(dt.rows[i][0].tostring()).tostring("mm/yy"); }   obviously
Post.aspx?Title=Creating+Dynamic+Data-Driven+Charts+in+.NET+is+Fun+and+Easy

Advancements in Technology Can't Keep up with Themselves

02/21/2010 03:36 AM - pop quiz, hotshot... what car weighs 96 lbs and gets 3752 mpg on a 3hp engine? this one, made by a bunch of eco-hippies in california. it's been slowly improving over the past 5 years. so why is it we can't find a comprimise and get 1000 mpg on a car that does 90 mph?
Post.aspx?Title=Advancements+in+Technology+Can't+Keep+up+with+Themselves

What a Medical Website Should Provide

02/14/2010 01:45 PM - we've all had things happen to us and gone about figuring out what it is. some of us ask our family doctor, some match the symptoms on webmd or just search on google. sometimes we start with an idea of what we think it might be and we pick the thing that seems most likely or which is the least uncomfortable thought given the options. there are tons of online resources to get this information, somewhat searchable, albiet mostly via google. but what if we had a better option? what if we did the search in reverse? the ideal medical website should provide these features: user types in or selects the symptoms they have and related info (i.e. intensity and frequency of events) website matches these symptoms against all known medical diagnoses website determines which symptoms are probably unrelated and either filters them out or returns multiple hits website tells user what diagnosis(es) match(es) the symptoms website includes how likely each diagnosis is, how many people are affected, how many people with these symptoms are affected, each as a percentage website informs user what tests are conducted to verify, how much they cost, and where the user can get one this option would also help weed out the hypochondriacs who assume they have a problem and change their understanding of the symptoms to match what they find; but would unfortunately be replaced by other hypochondriacs who enter symptoms they only think they have. the website would have a disclaimer that indicates this is not a diagnosis and they should be seen by a real doctor - but it has the benefit of telling the user what kind of doctor to go to, and how important that visit is. for example, ever see a tv commercial for a new drug that says "see your doctor if you experience a headache" or some such nonsense? who goes to a doctor for a headache? the website would have to take into account the fact that some things don't require a doctor. seems to me this is a pretty obvious solution. why hasn't anyone done it yet? or have i just not found it yet?
Post.aspx?Title=What+a+Medical+Website+Should+Provide

Däs Keyboard

02/10/2010 05:19 PM - i recently ordered (and spent two hours tracking down) two das keyboards. it's a german-engineered keyboard with loud clicky keys that offer great tactile response. the keys are individually weighted based on the approximate pressure applied by each finger (i.e. weaker fingers require less force), thus making it feel more natural. none of the keys are labeled - pure black paint. if you buy one of these, you probably already know how to type. already i feel like i'm typing faster. more importantly, however, i don't find myself second guessing whether a given keystroke went through. i feel it, i hear it, i know i didn't miss the key. that's a good feeling when you spend 8-16 hours a day at a keyboard. but even more impressive than that is a feature i haven't seen in years, and never knew it had a name: n-key rollover ensures that no matter how many keys i press at a time, they'll all make it to the computer. most keyboards only support 3-key rollover, which actually only supports two simultaneous keystrokes despite the name. if you press a third key, the keyboard scan codes get all wonky and the keyboard sends an erroneous code to the computer, thus you never know what you're gonna get. but with n-key rollover, each key is controlled independently. sweet. for someone like me who plays computer games pretty often, that's a big deal. i find myself very often holding down shift + w (i.e. "run forward") and want to hit "a" at the same time to shift to the left (per standard wasd layout); but the game didn't see the input and my character would get shot. so now i can strafe left in a full sprint. so why did i buy two? the keyboard i was assigned at work is one of the crappy membrane type, which i hate but can live with. but more importantly, the keys are in the wrong place! the keys are designed at a diagonal inward slant - the top of the keys point toward the middle of the keyset. on top of that, the backslash/pipe (\) key was moved to the right of the slash key (/). as a developer and overall geek, i hit the backslash key very often and don't always remember the wonky keyboard has the keys in the wrong place. can you imagine entering a dos command and random backslashes become enters? c:\>
Post.aspx?Title=D%c3%a4s+Keyboard

C#: Programatically Create Thumbnail to a File

02/08/2010 11:58 PM - creating a thumbnail in c# is fun and easy! unfortunately, creating one with any halfway decent quality is a huge pain in the ass. especially if you want to write it to a file instead of a stream. cutting to the chase, here's how you do it:   /// <summary>creates a thumbnail of a given image.</summary>   /// <param name="infile">fully qualified path to file to create a thumbnail of</param>   /// <param name="outfile">fully qualified path to created thumbnail</param>   /// <param name="x">width of thumbnail</param>   /// <returns>flag; result = is success</returns>   public static bool createthumbnail(string infile, string outfile, int x)   {    // validation - assume 16x16 icon is smallest useful size. smaller than that is just not going to do us any good anyway. i consider that an "exceptional" case.    if (string.isnullorempty(infile)) throw new argumentnullexception("infile");    if (string.isnullorempty(outfile)) throw new argumentnullexception("outfile");    if (x
Post.aspx?Title=C%23%3a+Programatically+Create+Thumbnail

Gallery work

02/08/2010 10:06 PM - over the past couple days, i've allocated a whopping half hour to a little work on the gallery. i added a second folder ("subsequent") of what the lab (read: "living room") looks like since i got bored and rearranged it a week or three ago, enhanced the image to display the first image by default instead of a blank image (which of course looked like an error, as it resolved to a tag like <img src="" />. now i'm thinking i might want to change things up and pick a random image instead. like i'm doing now with the taglines at the bottom of every page (look now). added filemask to pic lookups to remove windows thumbnail files (i.e. thumbs.db), and enhanced the tree so it fully expands to level n-1, where n is the maximum level of a given tree substructure. that is to say, it will fully expand all directories that have subdirectories, but will not expand a directory that contains only files. the code for that last part was really simple, for the recursion-inclined:  private void expandnonleafnodes(treenode tn) {   foreach (treenode tn2 in tn.childnodes)    expandnonleafnodes(tn2);   if (directory.exists(tn.value) && directory.getdirectories(tn.value).length >
Post.aspx?Title=Gallery+work

Complaining Works

02/07/2010 07:46 PM - several months ago, i called my bank to complain about an issue i had with their website. it's a minor issue that goes like this: when you first navigate to the website, keyboard focus goes to the username textbox. that is to say, a javascript script runs that moves keyboard focus to that textbox. the downside to that is, some users (i.e. me) are so fast that by the time the page finishes loading, we've clicked the username textbox, filled it in, hit tab, and started typing in the password. this introduces a race condition whereas the user is racing against the page load complete event. the page finishes loading sometime while the password is being entered and javascript pops keyboard focus back to the username textbox while the user is in the middle of typing their password. thusly part of the password ends up in the username textbox, which is not masked. this is a security issue, but moreover it's downright annoying as the user now has to retype both text values. so i called them up and offered a simple solution: check to ensure the password textbox is not currently focused prior to changing keyboard focus to the username textbox. months later, looks like they fixed the issue - just not the way i intended. i load up the website and keyboard focus goes straight to the username textbox, prior to the page load finishing. i guess they changed the script to run when the textbox loads instead of when the page finishes loading. good enough for me. i suppose it's possible that my internet connection is simply faster at my new apartment, though speed tests indicate otherwise. another possibility is that the bank upgraded or fixed a performance problem, thus the script ran faster than i could click on the username textbox. honestly i'm too lazy to check. either way, they fixed the problem. the lesson: complaining gets things done.
Post.aspx?Title=Complaining+Works

VB.NET vs C# - If/Then/Else Syntax

02/05/2010 05:14 PM - does vb.net's if-then-else syntax bother the crap out of anyone else out there?         if iscondition andalso isothercondition then             dosomething()         elseif iscondition then             dosomethingelse()         elseif isothercondition then             dosomethingelseelse()         end if   wow, that's verbose and wasteful for a simple operation like that, don't ya think? fortunately, vb.net still carries over the : operator from the decades of yore, and we can abbreviate it thusly:         if iscondition andalso isothercondition then             dosomething()         elseif iscondition then : dosomethingelse()         elseif isothercondition then : dosomethingelseelse() : end if   still needs work. just for comparison, let's see what this is like in c#:         if (iscondition && isothercondition) dosomething();         else if (iscondition) dosomethingelse();         else if (isothercondition) dosomethingelseelse();   aaaaahhhhhh, that's better. and don't even get me started on the ?? and ?: operators. come on vb, you need these things!
Post.aspx?Title=VB.NET+vs+C%23+-+If%2fThen%2fElse+Syntax
 
My Books:
(Amazon Author Page)
A Comprehensive Review of the Federal Budget:\nOur Forefathers' Solution to Tyranny
[ Kindle | Paperback ]

Liberty: How America's increasingly socialist agenda impacts us all
[ Kindle | Paperback ]


Browse:
Social:
my StackExchange network profile
Totally random word: test

Totally random inbound search query:
kevin connolly

Your request cost $0.00238 of my time.
Copyright © 2013 Kevin Connolly