A Second Look at Google Chrome Application Shortcuts

Posted January 30th, 2010 at 14:17 CST in Uncategorized | Tags: , | Leave a Comment »

In August I wrote about Application Shortcuts for Chrome and noted that this new concept had the potential of being useful since I don't like using standard desktop clients for email due to their lack of full Gmail support (like labels and the archive). Now having taken a further look, I'm not so convinced.

Application shortcuts are created by clicking on the "Page" button and selecting "Create Application Shortcuts...". If you select to create a shortcut on the desktop, Chrome then creates the Application Shortcut and puts it on the desktop. All this is simple enough, but what it actually does is make a shortcut to Chrome at the current page and passes the --app flag.

I invite you to try this for yourself with something like Gmail and see what you think. When launched, a Chrome window is open without the tab bar or address bar. The confusing part is that internally, it is treated like a normal Chrome process. So cookies are shared with any open tabs in a normal Chrome window. Why would I want that? If this is supposed to be a Gmail App, wouldn't I want cookies to be separate? What if someone else needs to check their email quick and I have the App open? I get logged off in the App and their session is replaces mine.

The Chromium bug list has a feature request for this, but it hasn't received much attention.

Leave a Comment »

Late Static Bindings in PHP

Posted January 25th, 2010 at 22:45 CST in Uncategorized | 3 Comments »

PHP class methods and variables can be declared as static similarly to how Java static methods and variables work. As often as possible I try to stay away from anything static in PHP, since it can lead to confusion, bad program design, and in some cases memory management problems. But sometimes it actually does make sense and more often than not just getting things done is more important than doing things correctly.

However, PHP 5.3 introduced a lot of cool new features like namespaces and something called “Late Static Bindings” via a new keyword. But what is Late Static Binding and how does it differ from how PHP before 5.3 works? The reason the new static keyword was added is to allow for intuitive static references involving inheritance.

Before 5.3, PHP used early static binding: the process of resolving any static references to the class where it was initially declared. Clear as mud right? This is best shown by the code example from the PHP documentation.

<?php
class A {
    public static function who() {
        echo __CLASS__;
    }
    public static function test() {
        self::who();
    }
}

class B extends A {
    public static function who() {
        echo __CLASS__;
    }
}

B::test();
?>

The above code will output A not the (maybe) expected B. Replacing self with static in the example will output B, but only in 5.3 and above.

Since none of the servers I work with have 5.3, and some are even lacking 5.2, I cannot take use of the static keyword in my code. But even so, I feel like I understand PHP better now that new feature is available since this clearly shows that using self in any version will use “Early Static Binding.”

3 Comments »

Iran Protest Video

Posted December 30th, 2009 at 01:12 CST in Thoughts | Tags: , | Leave a Comment »

When I speak my mind about things I have opinions about, I normally get myself in trouble. For example, when I tell people I am a skeptic—they look at me funny and start ignoring what I say. Today, I saw this video and was appalled. USA has some messed-up politics, but we have a pretty spectacular constitution when compared to other governments around the world.

Apologies for the graphic nature of this, but it needs to be seen. I don't know the context of this event or the outcome, but if this is a good representation of the state of the government in Iran, I fear many more atrocities are taking place.

As a programmer in the US, I often obsess over little things like whether to use tabs or spaces in a PHP file, or why Internet Explorer 6 renders some CSS so terribly. And while I have the right to, sometimes I feel like I should be doing more. So since I have control over this blog, I share this video with you with the hope that the basic rights these people need may be granted to them.

Leave a Comment »

Okay, I lied.

Posted December 28th, 2009 at 22:47 CST in Uncategorized | Tags: , | Leave a Comment »

I had a fun two weeks with Django, but now it's over. There is nothing wrong with Django, in fact page load times went from about 1-1.5 seconds to about 100-300 milliseconds. I haven't narrowed down why yet—maybe python over php, maybe InnoDB tables instead of MyISAM, maybe mod_passenger instead of fastcgi. While I plan on trying to figure it out later, Wordpress just plain works. If I need to type a post, wordpress lets me do that really simply. For some reason, Dreamhost doesn't like some of the admin urls I use and I really do not have time to figure it out. So, hello Wordpress 2.9.

I decided to keep the new theme, but I put ads back on the site again. I will not ask you to click on them, that would be violating the Terms and Conditions of having them there, but in case if someone does happen to find something useful in them, I get a few cents from each click.

Leave a Comment »

Conversation About PHP

Posted December 28th, 2009 at 20:57 CST in Thoughts | Tags: , | Leave a Comment »

I wrote down this conversation I had with a co-worker the other day. I just found it, and thought I would share it.

me: how do i tell php to be smarter?
co-worker: you have to enable that in your php.ini
me: oh of course
co-worker: but you have to make sure php was compiled with the --smart flag
me: dang

Leave a Comment »

Brave New Blog

Posted December 15th, 2009 at 11:29 CST in Uncategorized | Tags: | Leave a Comment »

Lots of changes are happening around here. I will no longer be offering ads on my blog for starters. I don’t like ads and I‘m guessing you don’t either. My services involve programming, and I want to make a living by legitimately doing work, not stealing money by people clicking on ads.

In other news, my blog now uses the Django web framework. I am really happy to move away from Wordpress as I now have complete control over my database schema. Django provides a great framework for making web applications quickly and efficiently—if you haven’t noticed this page probably loads much faster.

However, I wrote the RSS feed from scratch, so if you have problems with it, please let me know.

Leave a Comment »

CSS is Not an Art

Posted December 4th, 2009 at 02:29 CST in Web Development | Tags: , , | Leave a Comment »

For some time I've been working with web frameworks. Finding a good web framework is not hard with PHP since so many exist already, but since I've fallen in love with Python I've discovered Django. Recently, I've been re-building this blog using Django (more on that to come later) and to my surprise, using a well-developed MVC Framework with a thought-out database schema makes traditional development almost non-existent and lets me focus on theming.

Since my job is mainly PHP and MySQL development, I don't do a lot of theming. I actually like coding CSS, but we have a design team for that. For this blog, it's actually something I need to think about. I've done a lot of CSS coding, but recent events at work have left me frustrated with legacy code, thus sparking this post. So getting to the point: CSS is not an art. Cross-browser CSS is not something one intuitively picks up and starts playing with, it is a language, and to be successful at it you need to know what you are doing.

The key concept is the possibility of writing unsuccessful or bad CSS. The art is drawing up what the page is to look like—concept art, or as some call it “mocking up” a page. CSS is the tool used to get the page to actually look and function as intended, and in every browser. I believe a lot of amateur web developers do not realize the importance of understanding both the CSS specifications themselves and how each CSS command will affect each web browser.

To further my point, this week I've been working with more legacy code which has CSS sprinkled all over, and always as an afterthought. This itself is not necessarily bad, as sometimes the importance of getting something semi-functional (or to a state where your boss stops yelling at you) necessitates ignoring certain parts of the process. In this, Internet Explorer 7 was forgotten about and somehow hovering over a certain set of <span> tags makes large parts of the page shift a few pixels back and forth. In an extreme case, it would hinder someone from using the application and potentially cost the company money—again an unacceptable outcome.

Having been dealing with CSS for a number of years now, I feel like I've learned quite a bit about how each browser treats different CSS attributes, but new web technology is embraced at a quick pace, and I still find new awkward Internet Explorer rendering engine bugs on a consistent basis. But at the least, having an understanding of what CSS was built to do goes a long way.

Leave a Comment »

Dreamhost and MySQL

Posted November 29th, 2009 at 15:02 CST in Web Development | Tags: , | Leave a Comment »

At the company I work for, any amount of downtime on a website means we lose money, no exceptions. We run thousands of websites off just 6 or 7 severs and each of our popular sites get thousands of visits per day on average. This is easily accomplished by using dedicated servers and having a simple master-slave MySQL setup with writes only going to the master. Of course we went with a really cheap stupid company and absolutely no support, but we control our servers, so its all good.

For my personal sites, I do not have the luxury of having a dedicated sever; instead I use Dreamhost. Support at Dreamhost is phenomenal—I could not ask for anything better. But I feel ripped-off by their actual service. Using shared hosting is always a gamble, but Dreamhost goes one further. Web servers are physically separated from database servers.

From the perspective of a System Admin, separating web from DB is a great idea. Web servers need different setups than database servers, and management would be much easier with them separate. However, the web developer perspective looks at processing time more than anything else, and unless a network is setup to be super fast, latency is going to be killer. But since this is a respectable web hosting company I would not expect anything less.

So, assuming they know what they are doing, the only other explanation for why my page processing time is seconds instead of tenths of seconds is that server load is terrible, once again pointing to inadequacy of service.

Even so, I stay with them if nothing else because they are the cheapest web host to provide SSH access and the flexibility to use PHP, Python or whatever I want.

Leave a Comment »

IRC Clients

Posted November 3rd, 2009 at 00:03 CST in ubuntu | Tags: , | Leave a Comment »

I often think that as a professional programmer, the majority of the time spent “coding” an application (for web or desktop) is simply finding the best way to do something. That may be getting a page to display the same in IE6 and chrome using universal CSS and without writing exceptions using never-official specifications for HTML, or it may be optimizing a query. Well, when official documentation fails me, I resort to IRC.

I've struggled for a while looking for the best client to use. I've sampled irssi, Pidgin, Empathy, XChat, xchat-gnome, along with a bunch of Qt clients. And Just to help out anyone, the ubuntu xchat package is the one to use. Ubuntu has an xchat-gnome package, but it's not the same. XChat does everything, and does it well.

Leave a Comment »

Freedom of Typing

Posted October 20th, 2009 at 00:41 CST in Thoughts | Tags: , , | Leave a Comment »

Freedom of Speech (or “Typing”) is one of the most important freedoms we are given in the United States, and as an American, I yearn to use this freedom whenever I feel pressure of it being limited. Hence the reason for my first post on this blog on privacy behind a firewall, which was published when I was working at Trinity Bible College and felt pressured to not share information on how to access any type of content even behind strict firewall rules.

Exercising my freedom, I make public my frustrations against a group of people and a religion: the handicap and Islam.

The sick are the greatest danger for the healthy; it is not from the strongest that harm comes to the strong, but from the weakest.

Friedrich Nietzsche, On the Genealogy of Morality, Essay 3, Aphorism 14

While I feel like all life is precious, I do not feel like all life is equal. People who are handicap, such as those with severe paralysis are not capable of sharing in some events with those who are capable. As such, we should not go out of our way to make sure the incapable have access to all the events which the capable are privy to. Such a case is employment. If “Bob” is confined to a wheelchair and has limited use of his arms and legs, it does not make sense to allow Bob to work at the local grocery or pharmacy. Businesses such as these exist for the convenience of the customers, not the employees. However if Bob is capable of doing some work without much inconvenience to the employer, then I'd be all for it, but even so I don't think the employer should feel obligated to hire Bob if a better candidate is available.

Employment of the handicap and the care of the handicap are two different things though. Health care is important for many reasons, if not the least of which being the improvement of health care itself in order to further the survival of the species.

Second I address Islam. After reading an Interpretation of the Qu'ran, a few histories, listening to and reading dozens of lectures on the religion, talking to Muslims, sitting in on a daily prayer service at a mosque, and vastly studying its competing religions e.g. Christianity and Judaism, I feel like I should be able to make an initial judgement on the religion. I think the belief system is incoherent, that the Qu'ran is improperly interpreted, that due to (sometimes purposeful) historical inconsistencies and inaccuracies in the text itself that scholars do not have grounds for pointing a singular text as original, and that a more likely interpretation of Muhammad’s “visitation by an angel” is psychological in nature.

I do not judge those who believe in Islam, but actually feel bad for them. Religion can be a psychological magnet for all types of people. With or without reason humans seem to be drawn to a community of people where they can exercise rituals with others and share life as a community—religion can be a perfect answer to this animal desire.

Leave a Comment »

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