Blog

Delphi

I wouldn’t have picked Delphi, personally, as a language to take up. I like, generally, working with languages that use C style syntax, and every time I jump into Visual Basic, which is fairly comparable with Delphi from what I gather, the IDE and GUI Builders are lovely, but the syntax is nutty and harder to remember. I don’t know other Delphi programmers, so I don’t have friends or co-workers to whom I can ask questions about the language. And then the kicker, learning Delphi is not likely to open doors career-wise, you just don’t see hordes of job listings looking for Pascal/Delphi programmers these days. Getting additional practice or depth in a language that I’d be likely to use professionally would just seem so much more “practical”.

But in a way, working with this code written in Delphi is also very much like the real-world. I’m thrust into a code-base I didn’t write, in a language I’m not an expert at, with a specific goal in mind that requires knowledge I don’t already have. Doing the leg-work of research to invent a solution to a problem, with external constraints, is very much a real-world scenario. It takes the same sort of deciphering other people’s code, coming up with a theory about where you need to modify the code to create the change you need to make, doing research to find all the bits and pieces of knowledge you don’t already have and synthesizing them into a solution unique to the problem at hand.

In the end it’s satisfying though. You put the pieces together and see it come closer and closer to a working solution. And then there it is, solved. And I have to say, as I work with Delphi, and overcome the humps of orienting myself with the language and IDE (like why there’s no toolbar button for viewing the call-stack on the debug toolbar) and so on, it’s not a terrible language to work with. I really enjoy this sort of programming, it’s a night and day contrast compared to writing PHP code, even though I’m primarily self-taught in both areas. I enjoy it, even though there’s certainly things that could be documented better that seem basic but not obvious.

Fixing PopTray: My Christmas Project

Over my Christmas “vacation” I decided I needed a project. Something to do during my son’s naps for my own enjoyment while visiting the in-laws. After a short amount of mulling it over, I decided to attempt to tackle a project I’d been idly thinking about for quite some time.

And when I say quite some time, I mean it. I actually started looking into solving this problem three years ago, and had come up with a proposal back then of how to fix it and posted that to the application’s forum site. But…the original developer of the application stopped updating the app in 2006, rather abruptly.

It was a little bit of a mystery why he stopped developing it, at the time, for a while there were new editions every few months, keeping up with the latest version of the programming environment, adding and improving features with a nice wishlist of changes for future releases, and then all of a sudden, it just stopped in it’s tracks. I never really knew why he stopped–on the forums I saw something about the application “met his needs sufficiently” so he decided to stop updating it. But that was three operating systems ago! And that was before e-mail was frequently sent with subjects encoded in UTF-8, that look almost illegible when displayed as plain-text.

I kind of understand why open-source development can just spontaneously stop, especially when there’s really only one guy doing everything. Maybe it starts out as side-project that just gets out of hand, and starts sapping your free time, until you no longer enjoy working on it. Maybe you get a new job, or your life circumstances change, and you no longer can devote the time. Maybe your computer breaks down or gets stolen, and you no longer have access to the development tools you need. Things happen. Its life.

But that doesn’t mean that one little nagging un-fixed bug in the application doesn’t keep nagging at you. Back in 2008, I took a look at the source-code to see whether I could find the cause of the bug. I had a pretty good hunch where you needed to fix the problem, and what needed to be done. But I didn’t take it a step farther and implement it at that time because I didn’t know the programming language, I didn’t have the programming suite I needed, and there were several steps in my outlined solution that relied on knowledge I didn’t know. There was a little bit of hand-waving as in, I’m not sure how you do this in Delphi, but in programming languages I’m familiar with it’s not too hard, so this should be doable, I think.

So at that time I proposed my solution outline on the forum, hoping someone else who might not want to spend as much time figuring out why it’s a bug, or even the original developer, could take my outline of a solution and implement it.

Three years go by. During that time I’d considered changing mail notifiers a couple times. I even downloaded just about every other free one I could find. But none of them were as good as the one I’d been using for the last ten years. Yes, some of them handled international characters much better, but I was quite content with the user-interface and functionality of the application I was using, and didn’t really want to get used to a different clunkier interface.

If in all this time, nobody else has taken the time to solve the problem and fix it, and nobody else has come out with a better alternative application, maybe it’s just time to bite the bullet, overcome the hurdles, and fix it myself.

Don’t Be That Developer

Back in April of 2005, I came across a strange syntax in some java programming I was doing for work.

Class.forName("[S");

Back then, there was no convenient free StackOverflow site to quickly find an expert who would know off the top of their head what that syntax meant. And searching for “[” on Google certainly wasn’t a winning solution since square braces weren’t even indexed characters. How do you search for something that you don’t know the name of?

It took a while to find the answer. It turns out, it was a tricky way, using reflection of saying the same thing as short[].class

Really? Who would have guessed? It certainly wasn’t clearly documented anywhere, especially not in the code where it was used. And where it was used, there was absolutely no reason it needed to be using reflection and using some sneaky syntax.

Had the developer just kept it simple and written so much as a comment, or used a more straightforward, well-documented syntax the code would have been easier to maintain. We’re not playing Code Golf here (though even if we were, the non-reflection version still comes out shorter)!

Blog Import

The new blog is now up (as you can see since you’re reading this). I imported the content from my old blog “Jess the Developer” and a couple of other blogs I no longer maintain. I’m quite happy to be using a fully “self”-hosted setup this time, so we can hopefully avoid a repeat of the previous blogging fiasco when blogger discontinued FTP publishing causing my website blog to get frozen/unable to be updated.

Because of technical issues (I’ll spare you the details), the automatic import feature (which looks really nice) didn’t work for me, and I ended up having to import most of the posts manually. It would have been too difficult and time-consuming to try to import every comment manually across blogging systems, so unfortunately that means you can’t go back and read the original comments on the imported posts. I guess we’ll just have to start making new comments!

Now I just need to work on coming up with a unique theme for the blog so it doesn’t look so generic. Any thoughts on what would make it reflect my personality and blogging goals?

Web Typography Cheatsheet

Because I don’t have all of these memorized yet, here is a quick cheat-sheet for making proper dashes and quotation-marks:

– en dash (–)
— em dash (—)
‘ left single quotation mark (‘)
’ right single quotation mark (’)
“ left double quotation mark (“)
” right double quotation mark (”)
‹ single left-pointing angle quotation mark (‹)
› single right-pointing angle quotation mark (›)

Techy Comic Relief

From the Comic Strip “Bound and Gagged”: Moses’s Tablets

Yay! New Insight!

I don’t know why I didn’t think of this solution sooner! I was having this problem on a couple websites I maintain, that I needed to include some additional files, with extra content such as sidebars.
At first, I’d started out with a URL relative to the site root:
<?php include_once "/file.php"; ?>
But…that turns out to be insanely slow, as the php processor makes an HTTP request to download the page rather than loading it directly from the file system, because it treats it as a URL instead of a file system path address.
So then I’d switched the URLs to be relative to the page, so it would load it directly from the file-system. Not so bad in the basic case where everything’s in the same folder:
<?php include_once "./file.php"; ?>
But, when you start including one global file in everything, you can’t just copy and paste the URL from file to file. Somewhere deeper in the site, the include needs to change to include a stack of parent directories to locate the file.
<?php include_once "./../../file.php"; ?>
The other alternative would be to prefix the file with it’s actual location on the file-system, however, with crazy paths like /home4/mydomain/site1/ that I can’t be bothered to remember off the top of my head, let alone change every time I want to re-use the code on a different domain, that didn’t seem like a good solution.
But then, after fixing a few more broken links caused by the author of the new pages copying and pasting a template page from a different directory and forgetting to update those dot-dots, again, I decided to take another look into whether there’s an better way to refer to the file-system without making it super-slow.
And then an insight came to me, perhaps there’s a PHP variable that will give me the path to the site’s root dynamically without all that /home4/ garbage in the include directly. Aha! Yes, there is, $_SERVER["DOCUMENT_ROOT"] and Tada! problem solved!
So I changed all my includes to look more like:
<?php include_once $_SERVER["DOCUMENT_ROOT"]."/file.php"; ?>
and no more having to fix broken sidebars because the include URL went wrong again. And it can copy and paste between domains cleanly. I don’t know why I didn’t think of this solution sooner, but I’m glad I came up with it!

Revelation: Kings and Priests Forever

Rev 1:6 He has made us to be a kingdom, priests to His God and Father—to Him be the glory and the dominion forever and ever. Amen.

“He has made us to be a kingdom” The greek word for kingdom, basileia, is in reference to the right or authority to rule over a kingdom, ie. that we are conferred royal power and dignity. There is a subtle difference between being granted the authority to rule and actually being the king. Basileia can also mean “a kingdom, a territory subject to the rule of a king”, ie: even though we are conferred royal power and dignity, we are still subject to the rule of the ultimate King, Jesus! A kingdom has a lot of people in it, it has power, force, sovereignty. He did not make us into a “support group”, he has given us real power. He has given us a piece of his royal lineage.

“priests to His God and Father” In the old testament, priests were the only ones who had access to God; in Hebrews, this priesthood is expanded to all believers under the new covenant. The significance, thus, of Him making us priests forever is that we will have eternal access to God.

“…to Him be the glory and the dominion forever and ever” This is emphasizing eternity. This is not a side hobby or something you will retire from. You will not be voted “off the island” based on performance or popularity. Your identity is secure.

LoL, Ironic Isn’t It?

Excerpted From http://mike.elgan.com/post/6240583704/irony-alert-china-imports-chopsticks-from-the-usa:

Chinese takeout food with chopsticks

The best and most popular chopsticks in the world come from the American state of Georgia. One company called Georgia Chopsticks makes an incredible 2 million chopsticks a day, which are exported to China mostly, but with some ending up in Korea, Japan and the United States.

HIPAA Compliance for Online Forms

I started doing a little research about HIPAA compliance and what it takes to make office forms/database secure and compliant with HIPAA.

  • Need various consent statement wordings and access to your privacy practices handout, etc. — rather trivial
  • HTTPS/SSL urls when user is entering any of their information, redirect to secure URL if trying to access insecurely — I haven’t done this before, but it does not look like it would be terribly complicated or difficult to implement
  • database encryption – the user’s personal data needs to be encrypted while stored so that it can’t be accessed by unauthorized persons or hackers. — Smaller businesses have more leeway than a big corporation since there is less data/risk. MySQL does have some built in column level encryption methods, but those seem to be mostly aimed at preventing passwords from being stored in clear text rather than preventing a query from mistakenly bringing up the wrong user’s private records when they go to log in and preventing someone who works for the hosting company or whatever from tampering with user’s data. This is not my area of specialty, may want to consult with an expert. The solution itself is likely to be trivial or relatively easy to implement, knowing what to implement is the hard part.
  • Backups – there’s kind of debate it seems about whether hosting company backups are sufficient. The scale of the business may matter as far as the answer here, but should look into what the backup policies are for the web host.
  • Permanently expunging data that is no longer needed – Mostly, this is handled by not storing data you don’t need to store in the first place. You may want to think about whether this would entail a mechanism to be able to delete an entire person’s record, or whether deleting the database when it’s no longer needed is sufficient.
  • Hosting company should have an information security policy – basically,  the hosting company should have a policy about how information is backed up and who is allowed access to the data on your server. nothing exciting here (unless you were using some fly by night hosting company that isn’t professional).
  • “authentication and non-repudiation of users” – username and “secure” password (eg: 8+ characters) should be used to verify the user is who they say they are, and that they are authorized to access their own data.