KBD

Keith Devens .com

Sunday, October 12, 2008 Flag waving
All non-trivial abstractions, to some degree, are leaky. – Joel Spolsky (The Law of Leaky Abstractions)

Tag: Programming

Children:

Page 1 →

Daily link icon Tuesday, October 7, 2008

  1. Kirk Allen Evans's Blog : Getting Path from an XmlNode

       (0) Tags: [C#, XML]

Daily link icon Monday, October 6, 2008

  1. Easily refresh an UpdatePanel, using JavaScript | Encosia.

       (0) Tags: [ASP.NET]
  2. Worlds: Controlling the Scope of Side Effects | Lambda the Ultimate. It's a short paper, to read.

       (0) Tags: [Programming languages]

Daily link icon Monday, September 29, 2008

  1. jQuery: » jQuery, Microsoft, and Nokia:

    Both Microsoft and Nokia are taking the major step of adopting jQuery as part of their official application development platform. Not only will they be using it for their corporate development but they will be providing it as a core piece of their platform for developers to build with... This means that jQuery will be distributed with Visual Studio (which will include jQuery intellisense, snippets, examples, and documentation).

       (0) Tags: [Javascript]
  2. Lifehacker: Control Remember the Milk from Ubiquity. Ok, this might get me to use Ubiquity.

       (0) Tags: [Firefox]

Daily link icon Monday, September 22, 2008

  1. Why ASP.NET AJAX UpdatePanels are dangerous | Encosia. PageMethods, neato. No reason to use Prototype, etc. with ASP.NET.

       (0) Tags: [ASP.NET]

Daily link icon Friday, September 12, 2008

  1. obout inc appears to have some high-quality ASP.NET controls.

       (1) Tags: [ASP.NET]

Daily link icon Tuesday, September 9, 2008

  1. Binary Fortress Software |  ASP.NET ViewState Helper (via).

       (0) Tags: [ASP.NET]
  2. TreeView control stuff:

       (0) Tags: [ASP.NET]

Daily link icon Wednesday, September 3, 2008

  1. Moritz Lenz's blogs on Perl 6, intended for people familiar with Perl 5, have done a lot to get me re-interested in Perl 6, despite how long it's taken to develop.

    My understanding is that a full release of Perl 6 is probably another year away, but it may have been worth the wait. Perl 6 looks like a really fun language.

       (0) Tags: [Perl]
  2. [squeak-dev] Using V8 for other languages (via):

    One thing is clear: JavaScript is the assembly language of the Internet, at least for a few years now.

    Edit: here was the thing I'd read on TraceMonkey a while back (via Simon).

    Edit: One more post on TraceMonkey (to read).

       (0) Tags: [Javascript]

Daily link icon Tuesday, September 2, 2008

Hating ASP.NET again

The more I use ASP.NET, the more I can't stand it. I'm using the ASP.NET Ajax stuff and it'd be so much faster if I just did everything "manually" rather than navigating this maze of UpdatePanels and RegisterClientScriptBlocks and AsyncPostBackTriggers.

Web apps are just XmlHttpRequest + some JSON and CSS and DOM manipulation. I already know all that stuff. Why does Microsoft fail so hard at simplification that they make it more complex?

Daily link icon Wednesday, August 27, 2008

  1. Lifehacker: Ubiquity Prototype Offers a Natural Language Web Command Line. Maybe I should make a Ubiquity command to "blog this" rather than using a bookmarklet Smiley Anyway... very cool.

       (0) Tags: [Firefox]

Daily link icon Tuesday, August 26, 2008

  1. Learn CSS Positioning in Ten Steps: position static relative absolute float. Handy guide.

       (0) Tags: [CSS]

Daily link icon Thursday, August 21, 2008

W3C Selectors API

Just learned about the W3C Selectors API from Simon's blog. Turns out a native implementation is forthcoming in Firefox 3.1 (as well as Opera, IE 8, and WebKit), but in the meantime many Javascript libraries already implement the spec, Mootools, jQuery, and Prototype to name a few.

WebKit provides a speed test of a native implementation of querySelectorAll vs popular Javascript libraries (obviously the native implementation won't work for you unless you're using a Firefox beta). It's based on Mootools' test.

Tags

Lifehacker: Featured Firefox Extension: TagSifter Slices and Dices Your Bookmarks by Tag. I like the tag expression syntax they have. muffins - (cookies + brownies) ?donuts (?donuts means "the URL contains 'donuts').

People have proposed a tag query syntax.

I guess this is obvious, but the reason tags are so powerful and have caught on so much is that tags are sets whereas "folders" are trees, and sets ⊃ trees.

  1. Looks like Python 3.0 is implementing John Lim's suggested syntax for octal literals (with a slight difference). I'd prefer John's Oc to Python 3.0's Oo, but it doesn't matter.

    They've made a lot of nice cruft-removing changes to Python for 3.0.

       (0) Tags: [Python]

Daily link icon Wednesday, August 20, 2008

More fun with extension methods

or shoehorning in what the C# library should have included in the first place.

public static void Each<T>(this IEnumerable<T> source, Action<T> a){
  foreach (var item in source)
    a(item);
}

public static void Each(this IEnumerable source, Action<object> a){
  foreach (var item in source)
    a(item);
}

See my previous extension method, Join.

Bad C# design

I should be able to do something like:

var table = new HtmlTable {
  Rows = { // <-- error is here
    from XmlNode p in node.SelectNodes("./property")
    select new HtmlTableRow{
      Cells = {
        new HtmlTableCell{ InnerText = Server.HtmlEncode(p.Attributes["description"].Value) },
        new HtmlTableCell{ InnerText = Server.HtmlEncode(p.InnerText) }
      }
    }
  }
};

But I can't, because the LINQ code isn't "expanded" so the compiler complains that while it expects an HtmlTableRow element between the braces assigned to Rows, you're giving it a collection. But, you can't assign the collection to Rows directly because it's a read-only property.

Bad class design (Rows being read-only... same as Cells fwiw) or bad language design in that there's no way to "expand" the results of the LINQ query to do what seems natural in that spot?

Instead, I have to do:

var rows = 
  from XmlNode p in node.SelectNodes("./property")
  select new HtmlTableRow{
    Cells = {
      new HtmlTableCell{ InnerText = Server.HtmlEncode(p.Attributes["description"].Value) },
      new HtmlTableCell{ InnerText = Server.HtmlEncode(p.InnerText) }
    }
  };

var table = new HtmlTable();
foreach (var r in rows)
  table.Rows.Add(r);

which is redundant.

  1. Lifehacker: Manage Tasks and Calendars from Gmail using Remember the Milk and Firefox plugins.

       (0) Tags: [Firefox]

Daily link icon Wednesday, August 13, 2008

  1. Javascript Drag and Drop. Old, but pretty concise tutorial.

       (1) Tags: [Javascript]

Code to get the browser viewport size in javascript

function getViewport(){
  var e = window, a = 'inner';
  
  if(!('innerWidth' in e)){
    var t = document.documentElement
    e = t && t.clientWidth ? t : document.body 
    a = 'client';
  }
  
  return {width: e[a+'Width'], height: e[a+'Height']}
}

Modified slightly from a comment here.

Edit: the code in that comment didn't fully implement the original, and broke when I tried it in IE. So I've updated the code above.

Daily link icon Friday, August 8, 2008

  1. Sketchy LISP, An Introduction to Functional Programming in Scheme (via).

       (0) Tags: [Books, Scheme]

Daily link icon Thursday, August 7, 2008

  1. Raphaël—JavaScript Library (via).

    Raphaël is small JavaScript library that should simplify your work with vector graphics on the web. In case you want to create your own specific chart or image crop-n-rotate widget, you can simply achieve it with this library.

    Raphaël uses SVG and VML as a base for graphics creation. Because of that every created object is a DOM object so you can attach JavScript event handlers or modify objects later. Raphaël’s goal is to provide adapter that will make drawing cross-browser and easy. Currently library supports Firefox 3.0+, Safari 3.0+, Opera 9.5+ and Internet Explorer 6.0+.

       (0) Tags: [Javascript]

Daily link icon Thursday, July 24, 2008

  1. Second p0st: PHP hackery: quick and dirty anonymous objects. Eew.

       (0) Tags: [PHP]
  2. SitePen Blog » window.name Transport (via Keith and Simon). To read.

       (0) Tags: [Javascript, To Read]
  3. LINQ to Objects - 5 Minute Overview - Hooked on LINQ. Decent tutorial. Has examples of grouping and joins.

       (0) Tags: [C#, LINQ]
  4. Download LINQPad (via).

       (0) Tags: [LINQ, Software, SQL]
  5. C# 3.0: The Evolution Of LINQ And Its Impact On The Design Of C# (via). Very interesting explanation of how LINQ came about.

       (0) Tags: [C#, LINQ]
  6. New "Orcas" Language Feature: Extension Methods - ScottGu's Blog. Very informative post.

    Edit: He also covers C# 3's query syntax (i.e. LINQ).

       (0) Tags: [C#, LINQ]
Page 1 →
October 2008
SunMonTueWedThuFriSat
 1234
567891011
12131415161718
19202122232425
262728293031 



RSS feed RSS feed for Keith's Weblog
Atom feed Atom feed for Keith's Weblog
Weblog archive
Recent comments
  on 8 posts

Recent comments XML

new⇒URL design

http://groups.google.com/group/cool​ndex/web/asian-girl-sucking-to-blac​k-man...

derek: Oct 12, 12:13pm

I hate PHP

Elliot Anderson,

Dude!! You the​man! The reverse replacement for​array_u...

Alex Ndungu: Oct 11, 1:35am

Call a function from a string in Python

?!code:
some_object.__getattribute​__('method_name')()
?!/code

is​the s...

Patrick Corcoran: Oct 8, 3:53pm

Spider solitaire

I have won 185 games of Spider​Solitaire at the "Difficult" level.​ What is...

75.179.28.113: Oct 8, 12:42pm

Sed one-liners

Hi.

I wanted to let you know​that I wrote an article "Famous Sed​One-Lin...

Peteris Krumins: Oct 8, 3:05am

Timesheet Calculator

Hadn't seen it before now, but my​company already uses a time​tracking prog...

Keith: Oct 7, 10:44am

Girls, please don't get breast implants

Hey everyone, 

I am new to this​blog and I have enjoyed reading all​your...

Sarah.M.: Oct 6, 9:45am

Generated in about 0.198s.

(Used 13 db queries)

mobile phone