johnk's blog

Learning VB: type lists, cool (kinda)

I didn't hack today. Too much stuff going on, so, I did a lot of hanging out and stuff. I did manage to get a little reading done, and found a neat little feature.

A Type List is a way to let your class operate on different data types. For example, if you created a Tree class, a type list could specify that it's a tree of Oranges, or a tree of Integers. Of course, if you just made it a tree of variants, and used variants everywhere, then it wouldn't matter.

Learning VB: threading, events

My unexpected excursion in to .NET programming has been leading me to learn a lot of little things that are new to me. I'm chronicling them here as an assistance to others doing the same, and to get some personal insight into how I learn these things.

Last night was spent reading a bit more about ADO.NET. There was a very good MSDN article, Best Practices for Using ADO.NET, that gives you an overview of how to use ADO.NET. It's best to read it after getting some experience with ADO from another source.

Learning VB

For the past week or so, I've been learning VB.NET (emphasis on .NET) to do what I thought a perl script and a little VBA was going to knock out. I'll be blogging a little bit on what I learn, as I learn it. To catch up on what's happened so far, see: /node/376 and the parent nodes.

Gentrification... circa 2001

Wrote this back in 2001, to the newdowntown list:


Re: [newdowntown] Re: The Renting o' the Lofts

The rules:

* Don't hesitate to push out the middle income people. If you don't do it

Access Control XML

I'm sure someone else thought of this, but it's possible to use xml to add security to an xml document.

I was totally wrong

I'm often wrong, but I was really wrong on something I wrote six years ago.

Apocalypse No!

Read Apocalypse No! by Juan Santos.

Jamcamming

I don't really get why I think this is funny, but it was made with the Jamcam and some gimp work.

DHTML multi-select

First whack at a DHTML multi-select widget. This is similar to using checkboxes, except it allows you to have many (>1000) options. It's also similar to the HTML multi-select box, excpet it doesn't require the (mysterious-to-newbies) control-click to select more than one item. Also, the selected items are plainly visible.

http://riceball.com/apps/selectadd/test.html

View source to get the source. It's object oriented code. The object is initalized by three arrays, two of which contain the data to populate the dropdown, and the other which contains the list of selected elements. This data should be generated by the server-side-script (PHP, Perl, whatever). Use JSON to serialize the data into something this object can use.

See also: Uzilla's concept.

Zen Cart Update

I just added the very important and necessary Image Hander contribution. EEEEEEEW. The feature is awesome, but adding the code was a nightmare. It involved numerous files, across numerous directories.

It seems like the Zen folks don't know about, or don't know how to add hooks into the code to allow for extension without edits. Hooks are just specific locations in the code where other code will be loaded, based on some kind of naming scheme or with some OO techniques.

The OO way would work something like this. First, when the page loads up, it looks into a directory ("extensions/") and reads in the names of all the files in there. (Or, maybe it reads some kind of config file. Either way works, but the config file will resolve dependencies better, I think.) Then, these names are stored into an array ($extensions).

Then, we do an "include()" on each extension. This will load the class(es) in the files. Then, for each extension, we might try and call an initializer, like this:

   foreach( $extensions as $extension )
      $extension::init();

Better yet, call the constructor for each class and store the reference in a global array. Each class should be a singleton.

Zen Cart, holy crap

What the hell was OSCommerce thinking. It's one of the most confusing piles of PHP code I've seen in a while. The entire application seems to be structured using very carefully constructed invocations of require(). Zen cart (an OSC fork) isn't any better.

Ugh. If I hadn't been trying to figure out Miva for the past few days, I'd be inclined to say it's some of the worst, most confusing programming I've experienced. But that would be a lie, because I've experienced Miva.

The app uses the "let's switch everything through index.php, via GET parameters" model. Just like Drupal. It's one of the lamest things that Drupal does. It annoys me.

To top it off, Zen is ugly.

There is some possiblity of redemption, I think. Zen could use some better display templates. Beyond that... we'll have to see.

Update: Zen tells me this at the bottom of a page: Parse Time: 0.206 - Number of Queries: 177 - Query Time: 0.078228414611816

What?! 177 queries to make a page? Holy crap! The page should take around 3 queries. That's terribly inefficient to do 177 queries. Yeeeeeesh.

Wal-Mart in Rosemead

Rosemead just voted Wal-Mart into the city.

To say the least, I'm crestfallen.

After two years of fights, after seven months of meetings, and a couple months of intense organizing, we lost.

I can't say that I didn't see it coming. The only time that a big developer is opposed is with the support of the City Council, and it appears, from the start, that most of the City Council was siding with Wal-Mart.

Reports from people visiting the city offices seemed to indicate that there was a gag-rule about the project. They wanted to keep the project as secret as possible so that people wouldn't get up-in-arms about it.

The big disappointment, for me, was Margaret Clark. She said she was supporting it, but then whipped out her past positions opposing NAFTA/GATT and her seat on a clean air committee. If there's any company out there that exemplifies NAFTA and GATT, it's Wal-Mart. Just look at their China office.

The nice surprise was Bob Alarcon, who did address some of the concerns in his questions. That was something. Gary Taylor, who had managerial ties to Wal-Mart through his family, was especially defensive.

I was a little bummed out about the amount of rancor in the room. People's helplessness and disgust with the system were palpable, and it came out with angry statements. I sat on the right side of the room, where the pro- side sat, for a while a while, and the smugness there was also palpable.

The Year 2038 Problem

I was reading up on calendar data structures and came across something I hadn't thought about in years: the 2038 problem.

This is more serious than the year 2000 problem that was supposed to lead to the collapse of technological society. Out in my neck of the relatively modern woods, all that Y2K meant was that a few applications started displaying 19100 instead of 2000, and a few others showed the wrong time or date. They were fixed with minimal incident.

Y2038 is more serious. It's a problem a lot of Unix applications will suffer if they're still running in 34 years. Now, that might sound far-fetched, but, consider this: many important parts of Linux were written in the early 1990s, and haven't yet been updated. Many of these programs were originally written in the early 80s, and the origins of Unix as we know it go back to 1970.

We're already past the halfway mark: Unix is 34 years old, and there are only 34 years left until 2038. So, let's be conscious of this issue, and start dealing with it now, before it's too late.

The Year 2038 Problem
2038bug.com - and follow t

General Hospital

It's better and more confusing than the soap opera. It's my adventures at General Hospital LAC+USC. Let's get caught up on the story.

Rosa's spleen is enlarged, and she's caught up in "the system". Her boyfriend, John, is tagging along, marvelling at the Byzantine system that is LAC+USC. They both worry that the condition can be polycythemia, a rare condition where the marrow produces red blood cells nonstop, and if left untreated, will lead to thrombosis, and death. It could also be a bruised spleen from a fall.

How Private is My Medical Information

This morning, I got a call from Rosa requesting a ride to the hospital. She'd talked to a nurse there to get her blood test results. Simple enough, I thought. I get that kind of info over the phone sometimes. But, no, she had to go in person.

When I drove her there, it took a few minutes for Rosa to be told that, no, the results would not be given out. The doctor needed to talk with her. So an appointment was scheduled. Also, they would not schedule her to CT scan her spleen, despite the fact that the doctor requested it last time.

That seemed stupid. The scan was requested at the prior appointment. They should just send the request, so it can be performed before the doctor appointment. That would knock out two birds with one stone.

Tech Notes Archive Up

Just got some old articles into the CMS: [DIY Tech Notes]

Syndicate content