Firefox Woes

Posted August 20th, 2009 at 09:03 CST in Uncategorized | Leave a Comment »

I've previously talked about my switch to using Google Chrome and my primary web browser, and for a few months of almost constant use—even to type this post—I have enjoyed it. Chrome's speed increase over Firefox not only relieves frustrations, but it increases my productivity. Pages load faster, a DOM viewer and Javascript inspector is built into the browser, it is open source, and there is a decently stable release branch for Ubuntu. And, within the last few weeks plugins were available for it in Ubuntu, so Flash works now.

But while all that sounds awesome, I unfortunately cannot remove Firefox yet. Two reasons:

  • Using Firebug in Firefox is the only way I know of to view the response of an AJAX call without hard-coding in outputting the response via an alert() or something. It is very frustrating, but Chrome's document inspector only tells you where an AJAX call was made to, not whether it succeeded or failed, or what the response was. This is crucial to debugging web apps.
  • Firefox is a mature project and very, very rarely has any problems. It's true that Firefox is indeed a tad bit slower at just about everything, but I almost never have problems with it and often have to switch to open up Firefox because Chrome has crashed or is behaving awkwardly.

At work I use Firefox 3.5 on Windows, and that seems to almost keep up with Chrome, so once Karmic (Ubuntu 9.10) is released, I'll have to give it another try.

Leave a Comment »

Love & Hate: HTTP Cookies

Posted August 13th, 2009 at 00:44 CST in Uncategorized | Tags: , | Leave a Comment »

Ever since I understood what HTTP cookies were I've hated them. I do not like websites saving content on my computer without me explicitly approving. I feel like there should be alternative methods of storing persistent client data. From the start cookies have posed security issues since it is fairly trivial (for my perspective) to steal someone else’s cookie by packet sniffing.

Nowadays a site can specify to use cookies over SSL, but even then, a site can choose not to and offer HTTP cookies over an HTTPS connection. Of course, because cookies do store data on the client and because of their implementation in browsers, a hacker might be able to steal cookie information using malicious Javascript.

Some have proposed alternative methods to using cookies to store persistent client data: hidden form fields, clever URLs passing tokens as REST queries, embedding a flash object, or even using a hidden iframe and writing ajax response text to it. But I feel like all of these proposed solutions only raise more issues.

So then left with no alternatives, I have chosen to embrace cookies when necessary and to not implement them whenever I can get around it. The specific case of having a shopping cart on a website seems to have only one good solution: storing a session ID in a cookie and send that to the server where the actual client data is stored.

Approaching the problem from a different perspective though, when a person uses a web browser, that person is given the option of turning off automatically accepting cookies, or even just rejecting third-party cookies—which I choose to do when I browse. So then there it is: I also love HTTP cookies because I enjoy using websites like Gmail which require cookies for advanced features.

Leave a Comment »

Stolen Content On the Internet

Posted August 11th, 2009 at 20:45 CST in Uncategorized | Leave a Comment »

When I was in college I took a class called “Church Law & Taxes” and for the most part it was supremely boring, but a few topics stood out that I really enjoyed such as copyright laws in irregular situations like sermons. As the Internet has grown, so has popularity in many different aspects of copyrights and piracy. Many bloggers do not concern themselves with this topic as their blogs don't get enough traffic to really matter, but it is a big deal. Many companies go out of their way to try to make sure their content is used only by them as their content may play a crucial role in making money. I read an article recently describing what to do about potential copyright infringement on the Internet—interesting stuff.

Other websites take a different approach: xkcd licenses it's content under a creative commons license, and other sites like news web sites offer the majority of their material free of charge and sell advertising. It's difficult to know which avenue to choose when publishing content on the Internet, but I find the law aspects of it fascinating, and have been accused of being a “license junkie” because of my knowledge of open source licenses. Personally, I have chosen to retain all rights to my content—at least for now.

Leave a Comment »

Finally Something New

Posted August 11th, 2009 at 02:33 CST in Uncategorized | Leave a Comment »

I've been trying to post something new every other day, but I've failed to do that because I wanted to roll out my new website theme first. There are still a few things I am debating about (whether to take off the iGoogle button since the RSS Feed button links to feedburner), and others that can still be improved (like my profile and network pages). But overall I am happy with it.

I was a little scared at first to dive into Wordpress theming, but there were a few things I new I couldn’t do with someone else’s theme; I felt restricted by it not being my code. Still, this theme is based on the sandbox theme since I needed somewhere to start, and in due dilligence I will release it under the GPL when I am done with it.

The bigger change to the site is decreased page load time due to using a content distribution network and the microblog feed loading via AJAX instead of whatever the default wordpress RSS feeder did which was slowing things down. I want to make this into a plugin so that others can use it, but for now I'm just using a text widget to store the <script> tags.

Leave a Comment »

“New” MySQL features

Posted August 6th, 2009 at 01:34 CST in SQL | Tags: , | 1 Comment »

The more I use MySQL, the more I love it. I recently reviewed documentation for triggers when I ran into a pickle that needed to be solved in a short amount of time: ordering a query by TIMESTAMP.

I had a table with approx. 70k rows which had data continually inserted into it via cron job. I needed to query this table for the most recently inserted data given certain values. After re-organizing indexes and converting the table to InnoDB from MyISAM I was about to give up since (surprisingly) none of it gave any real improvement. The fundamental part of this query (the subquery in the SELECT expression which was ran over and over) was taking on average 0.022 seconds when ordering by a TIMESTAMP field which was automatically inserted by MySQL. When I used ORDER BY UNIX_TIMESTAMP(`field`) DESC LIMIT 1 instead, the query took 0.001 seconds on average. Since I didn't wan't MySQL converting it every time (really I don't know what it does with times internally), I looked up some documentation and saw triggers. It saved my query and the table. I was able to make an additional integer field in the table and set a trigger on insert that did the conversion and stored the unix timestamp in the new field, then I could query the new unix timestamp field all I want and speed up this query even more.

It was an epiphany. Suddenly I saw SQL problems under a different light. I was even able to solve another complex problem by creating an event which would build rebuild a VIEW every hour. It was awesome until I discovered the production MySQL server was running 5.0 which doesn't have events and I suspect handles VIEWs much more poorly than 5.1 which I was running locally. Of course I have no control over this server, and it handles uber-important data, so there is absolutely nothing I can do about it. So unfortunately I had to go back to the drawing board with that one.

1 Comment »

No Internet Service

Posted August 4th, 2009 at 08:32 CST in Uncategorized | Tags: , , | Leave a Comment »

This weekend I traveled to Melrose, MN (Google Maps) to spend some time with the in-laws, as I do every so often, because my son really likes being on their farm. As the title suggests, I had no internet service while I was there. Since my job revolves around internet access, and since even when I'm not working I rely on having internet access to get email, I was a little annoyed by the fact that the internet service provided by diversiCOM Melrose Telephone Company was not working, had not been working for a couple weeks, and even though a service request call had been made, would not be serviced for another two weeks.

I've come to accept the 256kbps DSL service, and even the intermittent outages, but when you rent a DSL modem from an ISP and the thing fries because of normal usage, I expect that they would want to fix it in a reasonable amount of time in order to have happy customers. Probably the most frustrating aspect about this whole ordeal is that the ISP has a monopoly for that area and therefore overcharge by ridiculous amounts. My in-laws do not have any other reasonable option for internet service; if they did, I would encourage them to boycott diversiCOM.

Leave a Comment »

Static vs Generated HTML and Content-Length

Posted July 27th, 2009 at 09:55 CST in Web Development | Tags: , | 1 Comment »

A frustrating aspect of writing in PHP is that almost all HTML is generated from PHP and is offered to the client after some processing is done. Under Ideal conditions, the amount of processing would be minimal, but in the case of the code I am currently working on at my job, it is not. I believe the root of the problem though is probably something most professional PHP programmers experience: the code they are working on is apart of a collaboration and being under a tight schedule, they cannot afford the resources to change what they would like.

The answer I most often get is "since it already works, let's focus on something else." With static HTML files on the server, apache can easily send the Content-Length, but even with PHP generated HTML, I could store all HTML in variables, then calculate the size and use apache's Content-Length header to speed up page load times. Time is a valuable resource though, and being a good employee, I'm gonna (try to) do what I'm told.

1 Comment »

The Ultimate Question, Part 1

Posted June 25th, 2009 at 00:36 CST in Uncategorized | Tags: , | Leave a Comment »

I haven't posted in over a month now, but this post has been brewing as a “draft” for a long time. Feel free to comment if you so desire.

In December 2007 I graduated from Trinity Bible College with a B.A. in Biblical Studies and Ministerial Studies with a Pre-Seminary concentration. I subsequently went on to be credentialed in the Assemblies of God as a Licensed Minister. This means that I not only professed to be a Christian, but I professed wholehearted belief in what the Assemblies of God proclaims to be Fundamental Truths of Christianity.

I pursued this endeavor for for a number of reasons, but what started me off on this path was what I believed to be a “call of God” to preach the gospel. In my pursuit of this goal I believed that I had ”heard“ God speak to me—not vocally, but in a spiritual or mystical way in which I thought I grasped the meaning of what God wanted to convey to me. Over and over again, this happened. I vehemently believed in the truth of the Scriptures and in my call to preach the gospel.

After being at Bible College for a few years, I had narrowed the call I was following a bit and instead of pursuing pastoring a church, I thought my skills were more suited to being a professor, and I also felt that God had confirmed that refinement. So being a diligent student and a motivated intellectual, I studied the Scriptures and the accompanying theological concepts in depth, constantly debating theological issues with friends and storing up this knowledge in my head in order that I might be able to preach the gospel later via teaching at a Bible College.

Taking the three year almost-kill-myself-with-stress track at college, I obtained a large about of data concerning theology and the Scriptures. Among the skills I learned though, I must say the most important and useful is that of thorough critical reasoning. Writing lengthy papers on old texts from a philosophical and theological viewpoint requires a certain amount of analysis.

After I graduated and while I still worked at the school, I decided to take a seminar class on atheism. It was here that I learned my critical reasoning skills learned in theology classes can be applied to many areas of life and all areas of philosophy. It was here in this class that I started to take seriously the idea that my reasons for believing in Christ were dependent upon assumptions, the beliefs of others, or the interpretation of experiences which have other explanations which might be just as reasonable (if not more so).

Today, approximately two years later, I have yet to resolve my uncertainty and have further burrowed into the unknown. I have however come to a few conclusions.

  1. The existence of God cannot be proven via reason and logic alone. There are a plethora of books written solely on the topic of proving or disproving the existence of God; I believe they all suffer from the assumption that the existence of God can be proven. Christian theology says belief is fundamental, that we should rely on faith.

    If I am capable of grasping God objectively, I do not believe, but precisely because I cannot do this I must believe.

    - Søren Kierkegaard, (Concluding Unscientific Postscript to Philosophical Fragments, 1846)

    Kierkegaard express this clearly—Christianity is faith driven, not intellect driven. But of course, if God cannot be proven to exist, he cannot be proven to not exist.

    Yet under this presupposition, Atheism as a belief then is incoherent since it's foundation is that God does not exist. I would accept as coherent an Atheism which is grounded on faith that God does not exist, but I have not encountered such a belief system.

  2. The ultimate question of whether Christianity is coherent and true does in fact matter and should not be ignored. This question of religious beliefs indeed affects issues of morality and the answer influences actions, and even the most subtle like what kind of facial expression to make when someone talks about Christ. Note that this does not logically conclude any sort of religion, for agnosticism may still be a viable option.

So then what have I concluded—what do I believe? I don't know. I cannot say with certainty that I believe in Christianity, but I cannot say with certainty that I do not. I guess I'll have to write a part 2 once I make up my mind, but that might not be for a while.

Leave a Comment »

JavaScript Benchmarking

Posted May 21st, 2009 at 20:00 CST in Uncategorized | Tags: , , | Leave a Comment »

I work with a lot of JavaScript at my job. Specifically, I use a lot of Jquery when coding web applications used internally. But because I use Google Chrome at work—on my Ubuntu laptop I use Chromium—I tend to take some things for granted. Today I ran across the Benchmark Suite that Google uses internally for making sure that Chrome's JavaScript engine is super-fast.

So, I tried it out on my laptop under Firefox and was pretty impressed to see the following scores, since the benchmark said that 100 was a reference score and that bigger is better.

Score: 186
Richards: 137
DeltaBlue: 208
Crypto: 161
RayTrace: 132
EarleyBoyer: 220
RegExp: 150
Splay: 391

Of course then I ran it in Chromium on the exact same laptop, under equal load and got the following. Then I was truly impressed and started to wonder why Firefox's score was so terrible.

Score: 2739
Richards: 3140
DeltaBlue: 3069
Crypto: 2285
RayTrace: 2810
EarleyBoyer: 3959
RegExp: 914
Splay: 5171

I'm not sure I even want to know how Internet Explorer does.

Leave a Comment »

while, for, and foreach

Posted May 4th, 2009 at 21:37 CST in Uncategorized | Tags: , | 1 Comment »

As a PHP programmer, I actually write code in many different languages. Many times in a single file I will have (X)HTML, CSS, Javascript, PHP, and SQL. Most of the time, I can keep this straight. Semi-often I forget to put a semi-colon at the end of a line (like when I do a bunch of Python programming the night before). But there are certain instances where I get tripped up all the time: while, for, and foreach.

Those three little words are very powerful, and are fundamental constructs of programming languages. I don't know what I would do if I couldn't iterate over an array. I also don't know what to do with myself when I forget how each is used in the current language I'm writting in.

For example: If I'm writting in PHP, it's foreach ($array as $val => $key), in Python it's for $i in range(10):, in Perl for and foreach are actually the same thing and can be used interchangably (I did a bunch of Perl stuff while at my last job), and I'm pretty sure JavaScript doesn't have an object iterator construct—probably because JavaScript implements objects in the most terrible way.

What about whiles? They are just strange. I never know when I can use do or when the truth statement is processed. Plus, sometimes the thought of an infinite loop scares me a little. Of course in Perl 6, you can form a lazy infinite loop out of a for statement.

1 Comment »

This work by Joseph Piché is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.
Proudly powered by WordPress.