|
title: Put the knife down and take a green herb, dude. |
descrip: One feller's views on the state of everyday computer science & its application (and now, OTHER STUFF) who isn't rich enough to shell out for www.myfreakinfirst-andlast-name.com Using 89% of the same design the blog had in 2001. |
|
x
MarkUpDown is the best Markdown editor for professionals on Windows 10. It includes two-pane live preview, in-app uploads to imgur for image hosting, and MultiMarkdown table support. Features you won't find anywhere else include...
You've wasted more than $15 of your time looking for a great Markdown editor. Stop looking. MarkUpDown is the app you're looking for. Learn more or head over to the 'Store now! |
|
| Tuesday, October 30, 2012 | |
|
Getting started � jagregory/fluent-nhibernate Wiki � GitHub: To start with we've mapped the Id column, and told Fluent NHibernate that it's actually an identifier. The x in this example is an instance of Employee that Fluent NHibernate uses to retrieve the property details from, so all you're really doing here is telling it which property you want your Id to be. Fluent NHibernate will see that your Id property has a type of int, and it'll automatically decide that it should be mapped as an auto-incrementing identity in the database - handy! That's great if lambdas are second nature. If they're not, it could use a little more explanation. What's important to realize first is that Fluent NHibernate is calling functions that live in FluentNHibernate.Mapping.ClassMap. So a line like... Id(d => d.Id); ... in your Fluent NHibernate mapping object is extending ClassMap and then calling its own function Id, as pictured below (if Blogger would stop eating all my less than and greater than symbols): public virtual IdentityPart Id(Expression Why is that important? Well, the "Expression" parameter has to be a lambda expression. As things are set up, there's simply no way around it. So forget, for the moment, how lambda's save space or provide some justifiable shortcut. Know that the way Fluent NHib is written, you're stuck. Here's a snippet for Expression, which is in System.Linq.Expressions... namespace System.Linq.Expressions { // Summary: // Represents a strongly typed lambda expression as a data structure in the // form of an expression tree. This class cannot be inherited. // // Type parameters: // TDelegate: // The type of the delegate that the System.Linq.Expressions.Expression // represents. public sealed class Expression This "do it because you gotta" directive seems to be a more productive approach than reading MSDN on lambdas. I mean, honestly, this explanation is not useful:
Lambdas use lambdas to create lambdas, which lambda lambda lambda. It's like watching the smurfs. Regardless, let's explore a little further, and read up on Expressions...
This line of progression of code in particular is especially clever and helpful: // conventional function, predefined
var widgets300GramsOrLess = Array.FindAll(widgets, Weighs300GramsOrLess);
// delegate
var widgets300GramsOrLess =
Array.FindAll(widgets, delegate(Widget widget) { return widget.WeightInGrams <= 300; });
// lambda
var widgets300GramsOrLess =
Array.FindAll(widgets, widget => widget.WeightInGrams <= 300);
The first less than in that last line is a lambda, of course, and the less than plus equal to is just that, a simple less than or equal to. So in a sense, you should be able to turn a line like from FluNHib... this.Id(d => d.Id); ... into this with a delegate... this.Id(delegate(Address d) { return d.Id; }); ... except that you can't, because, as I wrote earlier, FluNHib expects an System.Linq.Expressions.Expression, and you'll instead receive an "An anonymous method expression cannot be converted to an expression tree" error. It looks like the Expression, as that earlier definition would suggest, can take in a single parameter and can only be a single line. So something like this would be a valid alternative: this.Id(d => "spam".ToUpper() + " :: " + d.FirstName); ... but something longer like this obviously wouldn't: this.Id(d => string strTemp = "spam".ToUpper() + " :: " + d.FirstName; return strSpam); Make sense? Great. Enjoy your lambdas. Labels: c#, nhibernate posted by ruffin at 10/30/2012 01:01:00 PM |
|
| 0 comments | |
| Monday, October 29, 2012 | |
|
Sublime Forum • View topic - New to Sublime - A few questions: 1. Look in the asp folder for .tmLanguage files. There will be a fileTypes key. Add aspx as a value. Though, honestly, html works better with aspx so far. Labels: sublime text posted by ruffin at 10/29/2012 12:53:00 PM |
|
| 0 comments | |
| Friday, October 26, 2012 | |
|
Display solution/file path in Visual Studio IDE - Stack Overflow: There is not a native way to do it, but you can achieve it with a macro. The details are described here in full: http://www.helixoft.com/blog/archives/32 Still works. Apparently causes some trouble with recording macros because of a timer, but otherwise seems like money. Labels: visual studio posted by ruffin at 10/26/2012 03:14:00 PM |
|
| 0 comments | |
| Thursday, October 25, 2012 | |
|
I'm moving back from ExtJS to jQuery, so it was refresher time. For instant fun, try this online example... Tutorials:Getting Started with jQuery - jQuery Wiki: If you don't have a web server with PHP installed at hand, you can look at an online example. ... and knock yourself out with this line: $("a")[0].innerHTML = "9360054" (changing the number to whatever you want, of course.) ??? Profit. posted by ruffin at 10/25/2012 02:16:00 PM |
|
| 0 comments | |
|
MacBook Pro 13" Retina Display Late 2012 Teardown - iFixit: The empty space next to the SSD is very un-Apple. It's not like them to leave big air gaps in their newest, sleekest designs. Our first thought was that a standard 2.5" laptop drive might fit in this space, and it almost looks like this little nook was designed with that in mind. This reminds me a little of the original iMac's mezzanine slot -- the extra space here seems to be something Apple had designed initially planning to use it for something, then at the last moment ripped it out or didn't go through with whatever should've been there. So I'd guess Apple initially figured they'd have a [more] traditional drive for offer in the low-end 13" instead of SSD and changed their minds. Or perhaps they planned to offer (or yet plan to offer) one of those "fusion" drives that are on the iMacs and minis? The best part? More flexibility for third party hard drive vendors to make 13" MacBook components. I wanted to see what the state is with the hard drive (remember that even the 15"'s SSD hard drive can be upgraded, so I hoped I could hold off on paying hundreds for more storage) before I try hard to trick myself into buying a 13"er. The real platypus at this point seems to be the 15" Retina MacBook. Its design, with the trackpad covered by batteries and the SSD-only hard drive, makes it feel like a prototype now rather than a flexible, in-production piece of hardware. posted by ruffin at 10/25/2012 12:19:00 PM |
|
| 0 comments | |
|
Here's a video to watch later. DDD: putting the model to work: This talk will outline some of the foundations of domain-driven design Labels: noteToSelf posted by ruffin at 10/25/2012 09:38:00 AM |
|
| 0 comments | |
| Wednesday, October 24, 2012 | |
|
To change your alert sound in Outlook, you have to close Outlook? From the help: Note: Whether message alerts are on or off is controlled in Outlook. However, to change the sound played for message alerts, you must close Outlook and use Control Panel in Windows.Insane. Labels: outlook fail posted by ruffin at 10/24/2012 09:16:00 AM |
|
| 0 comments | |
| Friday, October 19, 2012 | |
|
It's help doc time at the end of a project, boys and girls, and reading through our existing docs after adding pages for the stuff I'd just programmed I found a page where an image was described in the text as an imagemap, but it wasn't. After the requisite Googling for an html imagemap on OS X and only finding a few pay-to-play examples, I thought, "The GIMP should do this, right?" It does. 14. Web Filters I should make a video tutorial that's a little more straightforward than this written one, but it's a great tool. GIMP as a whole is a little slow on OS X imo, but this tool is complete money. Make circle, quadrangles, or any multipoint poly, save your imagemap to a text file, edit points easily, and load and reedit the thing later. Filters >>> Web >>> Imagemap. Voila. It's essentially perfect. Thanks Maurits Rijk, and yes, I left the HTML comment in the page. Labels: html, noteToSelf, tools posted by ruffin at 10/19/2012 10:21:00 AM |
|
| 0 comments | |
| Wednesday, October 17, 2012 | |
|
No, seriously. WYSisn'tWYG, you can't [obviously] edit CSS files directly, you can't insert images into folders via the OS and have RoboHelp realize they're there, it puts the images it does import into the project's root folder by default, its editor st1nk0rz, and it's carp [sic]. Seriously. A big, giant, floppy piece of carp. I'm willing to use it temporarily on the assumption that folks who usually write help on this particular project need the hand-holding, but I feel like I'm in a fight with my hands tied behind my back. posted by ruffin at 10/17/2012 09:52:00 AM |
|
| 0 comments | |
| Tuesday, October 16, 2012 | |
|
Technical debt is like ketchup: Encosia: Technical debt is one of those crucially important concepts that can alter the course of an entire company if left unchecked, but it can be incredibly difficult to clearly convey that to non-technical stakeholders. The metaphor is that ketchup gets nasty if you leave it on a plate and don't clean it immediately. Fixing known cruddy code (or cruddy architecture) sooner than later is well motivated. But Ward makes the mistake of linking to one of my favorite Joel on Software pieces that talks about rewriting code, and Joel's suggestion is precisely that the ketchup shouldn't be cleaned. Ward says "technical debt" killed Netscape. No, not at all, says Joel. It was their self-defeating choice to throw out the ketchup. So I thought I'd save my response. How and when to rewrite suboptimal but operational code is one of the toughest quandaries we've got. So, without further ado, um, me. Um... Interesting to link to Spolsky here. That's one of my favorites from him. It's great. Labels: coding posted by ruffin at 10/16/2012 07:48:00 PM |
|
| 0 comments | |
|
This is a relatively interesting take -- if offices need specific pieces of office software, there's no free alternative, and you don't have the budget for Microsoft, what do you do? ProjectLibre: October 2012 Project of the Month | SourceForge Community Blog: Rich: So far as the third world goes, there’s an enormous amount of illegal software use. Your project and ones like it also fill a role there. Can you talk a bit about that? Guess that makes sense. posted by ruffin at 10/16/2012 01:47:00 PM |
|
| 0 comments | |
| Monday, October 15, 2012 | |
|
Ask Tom "Describe REF CURSOR columns": Dear Tom, But then in 11g R1, magic happens. SET SERVEROUTPUT ON; -- Tom forgets to remind us about this
declare
l_rcursor sys_refcursor;
l_colCnt number;
l_descTbl dbms_sql.desc_tab;
begin
open l_rcursor for select * from all_users;
dbms_sql.describe_columns
( c => dbms_sql.to_cursor_number(l_rcursor),
col_cnt => l_colCnt,
desc_t => l_descTbl );
for i in 1 .. l_colCnt
loop
dbms_output.put_line( l_descTbl(i).col_name );
end loop;
end;
/
I'm trying to figure out what columns were returned by a stored procedure call, and it's been a bear so far trying to remember how to use sprocs in SQL Deveoloper and to change the default setup in the test harness to SYS_REFCURSOR -- and figure out how to play with each row in the cursor (that would be ROW_TEMP CUR_RESULT%ROWTYPE;) and... Labels: oracle posted by ruffin at 10/15/2012 02:36:00 PM |
|
| 0 comments | |
| Wednesday, October 10, 2012 | |
|
Source Code Pro | Free software downloads at SourceForge.net: Source Code Pro Labels: fonts, noteToSelf posted by ruffin at 10/10/2012 12:09:00 PM |
|
| 0 comments | |
|
If we raise the retirement age, does that also tend to increase the importance of money in elections? If you're retired, you've got more time for things understanding things like politics fully. If you're still working, I'd argue your vote is more susceptible to ads. There's no denying the AARP has a lot of political power. And a higher percentage of seniors, as I understand it, vote in elections than other age groups. I've got to assume that's largely retirement driven. Keep seniors busier longer, soak up more of our high functioning years, and you reduce the AARP effect. Labels: democracy, Other Stuff posted by ruffin at 10/10/2012 09:08:00 AM |
|
| 0 comments | |
|
Slightly slow, but ultimately pretty useful, videos on Spring (Java) and Hibernate. Okay, I've only watch the first 7 or 8 Spring videos so far, and all on 1.5x or higher speed, but they are, if anything, overly accessible. Labels: java posted by ruffin at 10/10/2012 09:04:00 AM |
|
| 0 comments | |
| Thursday, October 04, 2012 | |
|
I said this in 2004. Come on.: What needs to happen is to have a many to many relationship between songs and albums. Sites like FreeDB and CDDB need to have a concept of what's a verbatim repeat (like the example above) and what's not (like the pretty decent live version of Ruby Tuesday on Flashpoint). Then we can have an mp3 player that's worth its salt. Search for everything on Rolling Stones, the original version of Ruby Tuesday's there. Search for everything in Between the Buttons, you'll get that same entry. Same for The London Years. Not the same, obviously, for Flashpoint. And you'll get all your settings and properties for that entry in all [of the first] three listings. Labels: iTunes posted by ruffin at 10/04/2012 09:42:00 AM |
|
| 0 comments | |
| Wednesday, October 03, 2012 | |
|
IPhone 5 May Burn Through Excessive Cell Data on Verizon - NYTimes.com: Over the weekend, some iPhone 5 users complained to Glenn Fleishman, a writer for TidBITS, an Apple news and troubleshooting site, about their phones’ mysteriously using Internet data over the cellular network for no clear reason. I haven't found a good description of when or why this is happening, but it seems an obvious enough issue that you wonder who is testing this stuff. Labels: apple fail posted by ruffin at 10/03/2012 08:42:00 PM |
|
| 0 comments | |
|
osx - Disabling mouse acceleration in Mac OS X - Stack Overflow: How to Disable [Mouse] Acceleration [in OS X] posted by ruffin at 10/03/2012 05:22:00 PM |
|
| 0 comments | |
|
Fortune 500 Company Urging Employees Not to Upgrade to iOS 6 Over Exchange Bug - Mac Rumors: MacRumors has learned that at least one Fortune 500 company is requesting that its employees not upgrade to iOS 6 over a bug with Microsoft Exchange meeting invitations. The issue has also been reported on Apple's support discussion boards. Brought to you by the folks who can't be bothered to test the capital of each US state in their mapping app before it's released. Labels: apple fail posted by ruffin at 10/03/2012 02:48:00 PM |
|
| 0 comments | |
|
I thought it was a seriously Bad Thing that Bob Mansfield was retiring from Apple, and it looks like his employees did too. We didn't know how badly until recently. Bob Mansfield stayed at Apple after CEO Tim Cook offered him 'exorbitant' $2M-per-month: "According to three people familiar with the sequence of events, several senior engineers on Mansfield's team vociferously complained to Cook about reporting to his replacement, Dan Riccio, who they felt was unprepared for the magnitude of the role," authors Brad Stone, Adam Satariano and Peter Burrows wrote. "In response, Cook approached Mansfield and offered him an exorbitant package of cash and stock worth around $2 million a month to stay on at Apple as an adviser and help manage the hardware engineering team." posted by ruffin at 10/03/2012 01:19:00 PM |
|
| 0 comments | |
|
The best quick overview I've seen of SimpleDB is from Working with Amazon SimpleDB - CodeProject: When getting data from SimpleDB, we need to remember four things: posted by ruffin at 10/03/2012 09:41:00 AM |
|
| 0 comments | |
| Monday, October 01, 2012 | |
|
Rich Tandler's Real Redskins: As reported in the game notes last night, the Redskins have not scored to come from behind to win in the last minute of play since Oct. 3, 1999. I did not have time to check the 31 other NFL teams but it is pretty safe to say that almost all of them have managed a last-minute comeback win at some point in the last 13 years. Painfully believable. It's amazing what conditioning will do to your expectations. Labels: Other Stuff, Randmo posted by ruffin at 10/01/2012 08:21:00 PM |
|
| 0 comments | |
|
|
All posts can be accessed here: Just the last year o' posts: |
|||||||||||||||||||||
|
||||||||||||||||||||||
|
|
|
|