Archive for March, 2006

my big dotcom startup idea: the reinvention of the secret wheel

Monday, March 27th, 2006

several paragraphs of ado before nothing:

this is possibly the third time i type this fuckr out:

the first was I think in some email to someone who will henceforth be known as “chad” several months back.

secondly i typed this out about an hour ago here and now in this blog TEXTAREA before I watched homestarrunner which was before i accidentally followed some tangent that one of my cohorts wanted me to follow — linkwise — that (my point:) led to my loosing of the contents of this web-form. (I curse the fact that wordpress doesn’t have gmail’s “autosave” feature. How hard can that be?)

so, the third and last time I will type this out is today:

One of my most heavily-respected colleges asked me off-the-cuff (or on-the-cuff?) if I have any business-ideas for a dot-com. I stammered a bit and said “Um…. i don’t know … let me check my blog.” (A sufficiently advanced blog may one day serve as a great crutch for early Alzheimer’s.)

He or she said something like “well, if you can’t think of anything off the top your head, it’s probably not worth bringing up here [in context that was taking place]”

So then afterwords I was all like “Damn … what was that good idea again?”

I skimmed over my previous (less than many) blog entires and realized I have not yet elucidated on my most prized brainchild — the most prized discovery I have yet to realize I didn’t make:

[And to create even further suspense before the grand exposition of what I know is the invitable future [yes i’ve been drinking]: My whole impetus for wanting to contribute to this blog that my brother so dutifully, dilligently and deftfully created was the fact that I am tired of having “ideas” (as they are called) that seem to either (a) blister in the sun like a dream deffered (or whatever) or (B) that I am tired of coming up with ideas that I find have already been “realized” well before I even “conceptualized” them, often by several years. So, this site [as I conceived it as being] was intended to serve as a digital paper-trail of this absurdity: both of the obvious-to-some naïve megalomaniacal ruminations we all frequently have (right?) (that prove to be a re-invention of some (often secret) wheel) and the occasional “damn-i-should’ve-done-this” flashes of fleeting brilliance. That’s what I wanted this site to be. Please pass the Johnnie Walker Black Label.]

My most prized brain-child (that i see feasible in my lifetime possibly by my own involvement) is this:

Imagine an ebay with a better search. The search is no longer a straight text-search on the arbitrary product-descriptions that vendors type-in freely, but rather it is a search against the unique structure of the data of type of products/services for which you are searching.

The search is simply: “This is what I am looking for (in no imprecise terms). Let me know when you find it.”

As it stands, for every product or service for which a customer searches, he or she has a “criteria” in her head that represents the target product that this customer seeks. Rarely does the application present tools that allow for the customer to express this critieria to a sufficient degree granularity that such that a search is immediately useful.

This is where I come in. Mark Meves.

(It sounds better if you pronouce it “Mavis.”)

Um… who farted?  oh, sorry.  that was me.
Does anybody remember BusinessObjects, circa 1998? This was the twilight of the era when software products were still marketed with MixedCaseNames, because that seemed LikeTheFuture. This app had a nifty query-builder tool (gui) which allowed you to create arbitrarily-deeply nested OR or AND branches to your SQL query. ( I didn’t realize these could be arbitrarily nested until I used this tool.) (The 2-D nature of this tool helped me visualize things I couldn’t easily see in the 1-D context of traditional hand-written SQL.)

Also BusinessObjects offererd the attractive feature of drag-and-drop, gui-based selection of field names and operators ( LIKE, =, IN ( ), <=, etc. ), so that, like any good UI, it was impossible for you to enter an invalid statement (or structure).

But I digress. What if you had an app that created UI elements (”controls”) to facilitate search in the manner that BusinessObjects presents UI elements to model searches for whatever unique schema of data? Because, after all, the search for a car is different than the search for a cell-phone than it is for the search for a therapist than it is for the search for an etc. (new drug? new girlfriend or boyfriend?)
Can we expect consumers to be able to figure out these obscure controls? Probably. If not, I bet we could make a trivial natural-language-esque interface on top of this that would facilitate such a consumer-vendor interaction in a manner that, while still seeming bot-like, would not seem any more venal and assinine than your average interaction with a sales-person.

And for the nay-sayers: You and I can all imagine the issues that this presents. (How do you get the schema? How do you allow for a data-store that dynamically morphs-on to the structure of arbitary new data? How do you validate the obviously biased incoming data from vendors? What is the basis for claiming that you have a basis for validating anyone’s information, in general? Why didn’t I become a furniture-designer, or shepherd, or dentist?)

These questions and more have probably already been answered by someone else. But if not, cheers to me!

And if so, I’m drinking anyway!

Ajax marches on (chat excerpt)

Friday, March 24th, 2006

Frisco and Mark chat about Ajax and then troubleshoot a server-error and talk about sysadmin utilities that should exist.
[11:43] friscolr: http://ajaxwrite.com/
[11:44] friscolr: ajax implementation of MS-Word compatible word processor
[11:45] manikmarkus: heh. we’ve been watching a few of those, FCKedit , ,others.
[11:46] manikmarkus: what does it mean “MS-Word compatible”? the interface is the same? does it read and write word files?
[11:46] friscolr: yeah, it’s open/save features do MS word docs, though i haven’t tested it fully yet.
[11:47] manikmarkus: wow. very impressive.
[11:48] manikmarkus: javascript could replace java for platform independent software development, er.. anything that is database-backed for sure.
[11:49] friscolr: yeah, and then security lists will truly overflow with XSS
[11:49] manikmarkus: XSS?
[11:50] friscolr: cross site scripting
[11:52] manikmarkus: wonder how they’re making money off this.
[12:01] manikmarkus: Matt tells me that google bought “writely” and now other folks are in a hurry to try and make an ajax-based editor to sell to someone.
[12:02] manikmarkus: I could see a need for a really solid Ajax-based HTML editor. I’m sure such things are under works. Like an Ajax based dreamweaver. Cause all this use of “textile” like markup for content management isn’t cutting it for me. Definately there would be a big market for an HTML editor that is as easy and familiar to use as Word.
[12:04] manikmarkus: Nice — i went to http://ajaxlaunch.com and got a Smarty (yuch) error!!:
[12:04] manikmarkus:
Fatal error: Smarty error: unable to write to $compile_dir ‘/var/chroot/home/content/a/j/a/ajaxpc/html/postnuke/html/pnTemp/pnRender_compiled’. Be sure $compile_dir is writable by the web server user. in /var/chroot/home/content/a/j/a/ajaxpc/html/postnuke/html/includes/classes/Smarty/Smarty.class.php on line 1088

[12:05] manikmarkus: it means they’re using PHP, intersting. I tried combining Smarty and Ajax once — it was a nightmare. The php code that Smarty generates will generate Notices which was breaking my Ajax. Smarty expects that you turn Notices off (not helpful for development) and they don’t mention this anywhere.
[12:05] friscolr: need a bot that constantly crawls a website looking for such errors, and pages me when they occur.
[12:06] manikmarkus: wouldn’t be that hard to write one that pattern matches for PHP-style errors, rite?
[12:06] manikmarkus: (not that I have any experience writing bots)
[12:06] friscolr: but how do you know if the error is supposed to be there or not? as in, a class page that is demonstrating those errors?
[12:07] friscolr: sometimes i do use our search to look for “WARNING” and other keywords
[12:07] manikmarkus: that would have to be an exception to the rule that you could manually flag as OK somehow so the bot ignores it
[12:07] manikmarkus: like in a config file
[12:07] friscolr: probably creating a baseline would be easiest
[12:07] manikmarkus: the amount of AI you would need to have a bot be that context sensitive would be prohibitive
[12:08] manikmarkus: baseline?
[12:08] friscolr: crawl the site once while in a known-good state, if ‘warning’ or ‘error’ appear afterwards, page me
[12:08] manikmarkus: ah
[12:08] friscolr: i mean, if those words appear in different context
[12:08] manikmarkus: why not just keep a watch on the errorlog? I mean, we shouldn’t be outputting errors to the screen on production sites anyway.
[12:09] friscolr: because “we shouldn’t” != “we don’t”
[12:09] manikmarkus: error_repoting = Off; log_errors = On; error_level = E_ALL | E_NOTICE; # no?
[Ed: frisco explains that his users have a business need (my words) to see PHP errror message outputted to the screen, yet he still needs to monitor them in cases where the warning messages are “indicative of larger problems on the site that are [his] responsibility.”]
[12:11] friscolr: in the case of the warning message you showed me, the smarties thing, i wondered if it was a perm issue or a disk full (so still no writes).
[12:11] friscolr: a disk full would be my responsibility (though i monitor for that separately)
[12:12] manikmarkus: i bet it is a perm issue or a disk full issue. check out the nested folders : “a/j/a” that means there might be hundreds of thousands of sites being hosted on this thing?
[12:12] manikmarkus: I still think it’s strage that “ajaxlaunch” folks are outputting this to the screen.
[Ed: in the remainder of the conv., frisco explains to mark what chroot is and its strange occurence in the filepath. All in all we spent like half an hour analyzing this small error message, and I learned a bit from it. Great way to start the day! Thanks, frisco!]

[Oh and keep up the good work, AjaxLaunch folks!]

human vs. google

Tuesday, March 21st, 2006

Francisco and I were discussing whether or not search-engines had replaced knowledgeable people for certain kinds of questions. Specifically we were interested in the kinds of questions that are more easily answered by people than by google, and what that reflected about the question, the process of answering it, and the person asking the question.

Frisco argued (in my words) that a person’s inability to use a sufficiently capable search engine to answer a question reflects their ignorance of that tool’s featureset, i.e. “Google can answer anything if you know how to ask the question.”

I said that I frequently find that a tight, focused conversation with a trusted human source lasting perhaps only 30 seconds can be more valuable than an hours-long answer-and-question hunting session with google and dizzying thread-tangles of forum-noise.

Following is a dizzying thread-tangle of email about this subject.

Mark Meves Fri, Mar 3, 2006 at 1:42 PM
To: francisco
I might be convinced to share your perpective on this issue, but nonetheless I came accross the conversation with Scott (my brother) in my chat logs and I had a laugh.

Session Start (manikmarkus:scotathon): Tue Feb 14 14:44:19 2006
[14:44] scotathon: mark, what is the function that will take a string and execute it as php, in php?
[14:44] manikmarkus: eval()
[14:44] manikmarkus: right?
[14:44] scotathon: yes
[14:44] scotathon: something like that it impossible to google
[14:44] manikmarkus: careful it’s like the most insecure thing in php.
[14:45] manikmarkus: avoid it when possible. what are you tyring to do?
[14:45] manikmarkus: cause you can dynamically generate property names and method names and class names w/o using eval()
[14:45] manikmarkus: $o = new $class_name();
[14:45] manikmarkus: $o->$some_meth(’blah’)
[14:46] manikmarkus: $age = $o->$property_name
[14:46] scotathon: yeah…
[14:46] scotathon: i’m not sure i want to use eval
[14:46] manikmarkus: $age = $o[$property_name] //same i think
[14:46] scotathon: basically i am loading in an .html file into a string
[14:46] scotathon: $html = file_get_contents(’myhtmlfile.htm’);
[14:47] manikmarkus: right
[14:47] scotathon: but now i find myself needing to put a bit of php in that .htm file
[14:47] scotathon: basically i am emulating smarty
[14:47] manikmarkus: woah. i’ll let you have fun w/ that. be careful
[14:47] scotathon: but i don’t need all that hooha
[14:47] scotathon: i just want to do this:
[14:48] scotathon: $html = file_get_contents(’mytemplate.htm’);
[14:48] scotathon: mytemplate.htm contains:
[Ed: html character entities removed because wordpress broke on them — they got converted to the referred to entity. doh!]

[14:48] manikmarkus: if the mytemplate.htm has php in it, could you require_once() it?
[14:49] manikmarkus: ob_start()
require_once(’file.php’)
$s = ob_get_contents();
ob_end_clean()
[14:49] manikmarkus: perhaps?
[14:50] scotathon: woah, never used ob before
[14:50] manikmarkus: yeah it’s ugly but nec. sometimes
[14:55] scotathon: you rock
[14:56] manikmarkus: sweet glad i could help
[14:56] scotathon: i have no idea how that works, by the way
[14:56] scotathon: require_once doesn’t execute the code?
[14:56] scotathon: or… i guess it does
[14:56] scotathon: but the file can be almost all html
[14:56] manikmarkus: ob_start() says “anything output to the screen, capture it, don’t put it to the screen but start saving it in a buffer
[14:57] manikmarkus: ob_get_contents() says “ok whatever you saved,
give me a copy
[14:57] scotathon: and require_once… will actually “echo” the file contents?
[14:57] scotathon: if it’s html, i mean
[14:57] manikmarkus: ob_end_clean() means “ok stop buffering
(capturing outputted content).
[14:57] manikmarkus: ob_end_flush() means “stop capturing, and output
it to screen
[14:58] manikmarkus: i don’t have much experience require_once()ing non-php files, but php is a language embedded inside other documents (html) so i guess it should work
[14:59] manikmarkus: in the old days, people used to incude() and require() static content all the time: SSI’s
[14:59] scotathon: crazy
[14:59] scotathon: i’ve never done that before
[14:59] scotathon: good times
[14:59] manikmarkus: rite rite. hope this helps . good luck and don’[t refrain from asking me more questions
[14:59] scotathon: thanks
[14:59] scotathon: i appreciate it, you were way better than google
[14:59] scotathon: i’d still be looking
[15:00] manikmarkus: heh
Session Close (scotathon): Tue Feb 14 15:01:21 2006The first person to make a search interface work like that will be a rich man or woman.

I sent this to frisco, and told him this would be a good conversation for my blog. Frisco responds:

francisco Fri, Mar 3, 2006 at 2:00 PM
To: Mark Meves

I see your point. It’s too similar to me asking google how to fix my car’s engine noise. My point is that when i query google for “car engine noise fix” i will get a bunch of pages about how to fix various engine noises. If i do not know much about cars, this will overwhelm me and i will have to read each one carefully and thoroughly, at the end of which i will have a lot more knowledge about cars than when i started, perhaps even enough to actuallly be able to do some good on my car. If (still with limited knowledge) i ask an expert, and the expert says “that noise is due to the 3rd piston needing cleaning” (or something that actually needs fixed on cars, i don’t know enough about them) and i proceed to unscrew everything to get at the pistons, i will end up with a very very broken car.

In your example, do you really feel confident that your brother will write code that works well? [Ed: yes] I feel he would be better off reading through (or at least skimming) the entirety of www.php.net/docs.php and that you just succeeded in giving him the rope to hang himself with.

-f
http://www.blackant.net/

p.s. - i don’t know where your blog is, and can’t think how to query google to find it.

Stored Procedures?

Tuesday, March 21st, 2006

I read the excellent thedailywtf.com for Alex Papadadimoulis’s supreme combination of irony and wisdom when it comes to scrutinizing real-life examples of questionable code — usually code that takes some-or-another methedology or technology to an absurd extreme. (Great examples of XML-overkill, Enterprise-overkill, OOP-overkill, etc.)

While sometimes the site can serve as a tremendous ego-boost to the self-doubting programmer, more often than not I use thedailywtf.com to scrutinize myself — I was first referred to when I was trying to justify the use of a Factory-factory in PHP. (Although after having read the relevant article I still think I was justified, even more so having found a poster that aggreed with me.) (But of course, the internet is good for finding justification for anything, isn’t it?)
Sometimes — but not always — there is useful insight in the 100-or-so comments that follow a posting. Today I enjoyed reading some anonymous poster’s insights on Stored Procedures. He or she articulated my current perspective better than I could have (something else the internet is good for):

Wow, trying to keep application logic out of a database is the *stupidest* thing you’ve ever heard? If there is one property of “enterprise” applications, it is the fact they are often systems that deal with many data sources and services, often performing logic between the disparate sources. But lets list some reasons to keep the logic out of the database.

1) Stored procedures tie you to a particular vendor
2) Application logic in the database has to duplicate logic in the application
3) Horrible source code control (in every case I’ve witnessed)
4) Lack of OO design, hence the term “stored PROCEDURE”
5) Difficulty migrating to a different database vendor/version
6) Puts load on the database, which doesn’t scale/cluster well since it is the data source of record

Instead, put the logic in your objects, keep the database as minimal as possible, and certainly use a good persistence tool to ensure the updates and queries are correct.

I admit, you can instaed take a very data-centric view of things, and many people successfully work under the idea that the database *IS* the application, and everything else is just a GUI/front end. But this is not very scalable, not Object Oriented at all, and IMHO is only suitable for smaller systems, and certainly not large “enterprise” ;) systems. All these points can, of course, be debated…

But wow, this is the *stupidest* thing you’ve ever heard!?! WTF!!!

Thanks Alex, thanks Anonymous.

CNTL’d development

Wednesday, March 8th, 2006

Given my standard practice of ‘code now, think later,’ (I will call this ‘CNTL’ to rival the other acronyms to describe coding techniques) I tend to write code the quick and dirty way, telling myself that if I need to go back to it later to clean it up I’ll do so when i have the time and it becomes necessary. Of course, I never have the time and rarely is it necessary. I do realize the importance of DRY and code portability, and as my skills as a web developer have improved, I have made the natural progression from learning the programming language to learning programming techniques. I now sit here exploring the web realizing I want to learn about design patterns (especially MVC frameworks, and specifically Symfony and Rails), version control, test-driven development, and IDEs for OS X. Where to begin?
Also, can I get a quick show of hands of how often a developer wants to scrap their whole project and start over? For this very reason I like taking on new projects, because I get a clean slate and get to put into practice all of the new things I learned from my last project.

WW DHH D ?

Wednesday, March 1st, 2006

Lately I find myself asking “What would David Heinemeier Hansson do?” as I code.

I have learned volumes about ruby from reading his source code. Frequently I blindly follow his techniques without necessarily understanding them first — out of character for me. But when it’s DHH, you can be sure that tomorrow you’ll understand it and be glad you did it today.

I almost got up to go for a walk because I’m hitting the 8 hour mark of non-stop coding (no lunch) but then I said out loud “No, David Heinemeier Hansson would stay and finish this.”

I’m making a prototype now for a bracelet inscribed “WWDHHD?” with the intent of getting rich selling it online.

Also: todo: make a video spoofing the OSCON “application in 15 minutes” — but make it like a B2B enterprise system in 20 seconds. And make it all cinematic, with virtual reality gloves and speech to text and lots of shouting and kungfoo poses.

But in all seriousness, thank you DHH. Heros are hard to come by these days. I look forward to the day when I can actually find a shortcoming in your work.