Mac OS X Java

So I got the great idea yesturday to install Coldfusion MX 7 on my Intel Mac to try out some ideas. I found out that Adobe does not currently support Coldfusion MX on the intel Mac. They do redirect you to numerous blogs that give you instructions on how to get it working anyways. With my limited knowledge of unix commands, and a few typos, I manged to remove my copy of Java 1.4.2 by accident.

On my PC this would not be a problem, I would just go download the installer, and re-install Java 1.4.2. Unfortnately Mac manages there own Java installs, and I could not find how to get a copy of Java 1.4.2 to install on my Mac. I tried running different updater images, removing receipts from the library, and running Java.pkg from the install disc that came with my MacBook Pro.

Finally I found the magical answer. This technote explained in one simple page, why no matter what I tried I could not get 1.4.2 back on my system. So after following the instructions, removing the version.plist file and running Java.pkg; like magic the java system was restored to the state it needed to be, and I am a very happy camper. Thank you apple developer.

Posted in software | Tagged , | 1 Comment

current_page?

This weekend I found myself caught in a love/hate relationship with a certain method in rails. I love this method because it uses some sort of mind control to know exactly when to show a link and when to show text. This method I speak of is UrlHelper.link_to_unless_current. My beef is not with this method directly, but the underlying UrlHelper.current_page?.

What dissapponted me about this method was the inability to exclude certain parameters from the check. The reason why this is important is because I may not want the “page” variable to be considered when verifying if the current url is the one in the link_to statement. So I ended up adding an overriding the current_page? method and this is what I ended up with:


  def current_page?(options, excluding = {})
    url_string = CGI.escapeHTML(url_for(options))
    request = @controller.request

    if url_string =~ /^\w+:\/\//
      url_string == "#{request.protocol}#{request.host_with_port}#{request.request_uri}"
    else
      parameters = request.parameters

      excluding.each do |key|
        parameters.delete(key)
      end

      request_string = CGI.escapeHTML(url_for(parameters))
      url_string == request_string
    end
  end

I basically copied and pasted the current_page? code from the rails repository. With a few modifications. First I grabbed the collection of request.parameters and removed any items that are in the excluding list. Then I rebuilt the url using the url_for method.

With this modification it made it very easy to make link_to_unless_current_with_paging:


  def link_to_unless_current_with_paging(name, options = {}, html_options = {}, *parameters_for_method_reference, &block)
    link_to_unless current_page?(options, ['page']), name, options, html_options, *parameters_for_method_reference, &block
  end

Hope this helps someone else out there that is getting frustrated with link_to_unless_current. What would be really nice is if this worked its way into the repository. Maybe I will get the nerve to make a patch, and be rejected.

Posted in programming | Tagged , | 2 Comments

TallyHoh OpenID

I was going through my feeds this morning on Tallyhoh and I came across Adam Fortuna’s post on Problems with OpenID?. He was discussing a post done over at Factory City a site I hadn’t seen before. His article, Problems with OpenID on Highrise by Chris Messina, immediately made me switch into DHH mode. This article discusses issues he takes with how the open_id_authentication plugin works.

Normalization of Open ID

Chris talks about the decision made by DHH on how to normalize the identity. He claims:

Of course, 37 Signals can do this, but what happens when the identity URL that someone uses on Highrise doesn’t work elsewhere because other consumers aren’t as liberal with what they accept?

I would agree with him, if not for a simple Google search to see the draft 2.0 specification for open id, where they discuss proper normalization of a identity url. The other problem I have with this section of his article, is his claim that these 4 urls should be the same:

  • factoryjoe.com
  • http://www.factoryjoe.com
  • http://factoryjoe.com
  • http://factoryjoe.com/

I agree with one exception. The absence of a sub-domain is a domain in itself. Even though usually in the world wide web, people make this the same, I don’t think it should propagate over to open id.

My understand of the open_id_authentication plugin, is that it is suppose to handle the three cases with no sub-domain. However so far in my experience it is not adding the trailing space, if it is not there, which is no fun. Hopefully this will be fixed soon.

Lack of i-names

This article was the first I have heard of i-names, and I am sure they are extremly cool, and helpful. My issue with his complaint is that i-names were not added to the open id 2.0 specification, and it is still a draft. So I don’t believe it is worth spending time implementing something that might not end up in the final version. Especially a topic that has so much debate around it as i-names.

Double Delegation

Open Id allows for a wonderful process of delegation. This allows sites like Claim ID and MyOpenId to provide an open id service. Then you can append two meta tags on your own website to delegate the authentication to one of these service providers, but you can use your own domain, for instance.. http://danielroop.com as your open id.

This article brings up a problem that I was not aware of, that you could not delegate multiple times. According to his article ( I did no research of my own) the open id specification, does not allow for multiple delegations. They did this to not prevent an endless loop of calls. In this specific instance, his friend was using Claim ID as his service provider. Claim id, is kind enough to give a shorten versioned of their normal identity url. The problem lies in the implementaiton, and in this case, open id, did not do any magic on their side, they just did a delegation to the normal url. His friend apparently did not read the documentation on how to setup your own domain to use the claim id service. Because it states very clearly, to use the full http://openid.claimid.com/[username], it even goes as far to give you copy and paste code if you are logged in to the site.

I agree

I will wrap this article up by commenting on what I do appreciate about his article. First, I am happy to see people talking about Open ID. I am new to the game, but I think it is very promising . Second, I am glad someone is talking about 37 signals, in the negative. What they see as wrong. The rails community often takes a stance that 37 signals does no wrong, which this article did not. I also agree with his commentary on the sign-up process. I am very suprised that Highrise does not make you verify your openid before you use it. Tallyhoh addresses this issue, by not having a signup section for open id. You simply log in, if you have not logged in before, we request certain information be filled out, and then you continue as before. With this model, if they enter an inaccurate open id, the login will never be created.

In Conclusion

Even though I may come across like I don’t like this guy, it is quite the contrary. I do appreciate the questions and concerns he raised. And after reading over the article a couple times writing this post, I realized, that in the context of Highrise, he is right. I believe the way 37 signals chose to implement their openid lends to numerous problems, that could be fixed. That being said, GO OPENID!

Posted in programming | Tagged , | 3 Comments

Resful Resources

Over the last two weeks Tyler and I have been coding like mad men, after work to get closer to a feature complete TallyHoh beta. One of annoying things I came across when I was making the transition to Resful Rails, was attempting to set a format using the special path/url methods.

I looked for hours and it didn’t seem that anyone wanted to talk about the topic. This was very confusing to me seeing as how everyone was writing code like:

  def index
    respond_to do |format|
      format.html => {}
      format.xml => {model.to_xml}
    end
  end

Finally I found this article, which didn’t address the problem directly but included a small table that mentioned the method. So thank you Sean Mountcastle, I appreciate your pdf.

For those that are hear because they want to know how to actually write the code.

If you have:

map.resorces :feeds

then you should write something like:

<%= link_to formatted_feeds_url(:format => :xml) %>

that would generate a link like http://%yourdomain%/feeds.xml. Just as an asside, I believe :format is the only required parameter to this method, so I think you can exclude “:format”.

if you were trying to access a specific feed:

<% @feed = Feed.find(:first) -%>
<%= link_to formatted_feed_url(@feed, :xml) %>

Hope this helps atleast one person not go through the hours of searching I had to, to find this poorly documented method.

Posted in programming | Tagged , , | 1 Comment

Domain Restructure Complete

Hello and welcome to the new and improved danielroop.com/blog. I have finished all of my shuffling as best I can tell, and now it is just time for some posting goodness. As I said in the previous post, this is my attempt at separating my personal blog from my geek blog. My intention here is not to give some vast insight into the world of anything. Quite the contrary actually, I plan on posting random things I find/believe about many topics that I find interesting. Some topics I will most likely write about are, ColdFusion, Fusebox and other Coldfusion frameworks, Java, Ruby, Ruby on Rails, gaming, politics, cool software, macs, windows, and any other observation I may have that seems to be technology/gaming related.

Consider this the proverbial ribbon cutting of the new danielroop.com/blog.

Posted in random | Leave a comment

Domain Restructure

I was looking at my blogs over the last few days, which didn’t take long since there are exactly two. This one, and my baby blog. I realized that this blog has been left somewhat stagnant lately, and it is probably because a lot of the content I used to post here, now lives on the baby blog. So I have decided to change the baby blog to a family blog. So instead of danielandjeni.com/baby, it will be danielandjeni.com/blog. Regardless you will still be able to reach the blog from the portal of danielandjeni.com. So what do do with danielroop.com. I am planning on joining the ranks of my co-workers and use this blog exclusively for Industry (web development) related topics. I will post my thoughts on programming practices, frameworks I am looking into, topic points I am researching, and pretty much anything that another web developer might be interested in. I will probably leave my political commentary out, which I have thrown in the past every once in a while.

That being said, look for some changes coming down the pipe, hopefully the change will happen in the next two weeks or so. During the process I will probably be migrating some of the posts here to the family blog, and upgrading to wordpress 2.1. I am currently still running 1.5.2 on for this site.

Posted in Life | 1 Comment

Java to Coldfusion HashMap

As some of you know I do web application development. The languages of choice for my current employer is coldfusion and java with some flex thrown in there for good measure. Last Friday I began experience a very odd bug with the two so decided I would share my findings with the world.

The problem was I was returning a object of type List with a collection of Result objects. Result was a object I created that extended HashMap. For those who don’t know coldfusion automatically maps a List object to an Array in coldfusion and a Map (or HashMap) object to a Struct. This was working on Thrusday but for some reason stopped on Friday.

The issue I was expereiencing was when I was trying to retreive information out of the Result object in coldfusion I was not able to use the dot notation:

currentResult.someElement

Not wanting to rewrite my code I attempted several fixes to get around this. First I discovered that if I did a IsStruct the object was of type struct. Next I checked the list of keys using StructKeyList. This too showed me that “someElement” was a part of my structure. Finally I tried a StructFind(currentResult, “someElement”) which is essentially the same as the above code but for some reason coldfusion found the value this time.

So I went back to the drawing board. I didn’t want to rewrite all my existing code to use StructFind, because eventually someone would come along (probably me) and try to revert it to the more clean syntax using the dot notation. So I attempted to cast the Result object to a Map before I put it into the List on the java side. This didn’t work either.

Finally I found a solution that seemed to work. I used the coldfusion Duplicate method to do a deep copy of the structure to itself:

currentResult = Duplicate(currentResult)

This seems to be working and now I just have to explain why I did one crazy thing instead of a million.

Posted in programming | Tagged , , | 2 Comments

The Reason why YouTube is Awesome

I came across this video this morning on reddit.com. To me it is the reason why YouTube is so great. It allows the up and coming director, or casual movie maker to upload very fun content to niche markets. I realize most people won’t get this video, but anyone who has ever played a final fantasy game will get a kick otu of it.

Posted in fun | Leave a comment

Corporate Copyright

Tonight copyright law caught up with me for the first time. Jeni and I, are having a baby as most of you know. As is the case with most babies our son to be, Brendan, will be needing a room of his own. The nursery has come slow but is getting there over time. Now we are at the point where we want to paint a saying from one of the Dr. Seuss books on Brendan’s wall. The saying is “Oh, The Places You’ll Go”. I am sure most parents are familiar with this book. It is about all the wonderful places your child will go, and the things they will accomplish. Anyways, this seemed like a simple enough task. We just need an overhead projector, a bucket of paint, a paint brush, and a color transparancy of the title of the book to trace and paint over. All of this seems easy enough, but I was wrong….sort of. Apparently it is a violation of, Dr. Seuss’s rights for me to copy the cover of his book onto a transparency. This did not suprise me too much, until I through out the teacher card. My wife Jeni is a teacher, and my rough understanding of fair use taught me that you are allowed to make copies for educational purposes. Apparently Office Depot, Office Max, and FedEx Kinkos do not agree with that.

To validate my rant, I decided to do a two second google search for some information on the topic. I found a document from the University of Maryland Univserity College. The document goes over the technical details of fair use, but I was just intersted in their discussion of how fair use applies to instructors. If I can ask you to ignore the fact that my copying of the document was not for use by Jeni in her classroom, we can continue on our journey down my rant. The first portion of the document I want to point out is that it states that there are a couple of criteria to consider when deciding if you are potentially infringing on copyright:

Copying by teachers must meet the tests of brevity and spontaneity:

Brevity refers to how much of the work you can copy.
Spontaneity refers to how many times you can copy.

Brevity: I wanted to copy one sentence.
Spotaneity: I wanted a single copy of the one sentence.

So far so good, My wife is a teacher, and I wanted one copy of one sentence of the work by Dr. Seuss.

Finally under “What can be copied” I looked for images or cartoons. Low and behold it is allowed. Regardless of this I was not allowed to copy the document at the two of the three retails above. I will say before going any further I have my transparency in hand, and all is well on that front. Brendan will have his wall painted.

So why am I upset? I am upset because Office Depot, Office Max, and FedEx Kinkos all have company policies assuming people are lying. This seems to be all to common in America today. This does not suprise me though, because America seems to be willing to let go of any rights they have because we have all been brainwashed to believe that government, and corporations are demi-gods and not to be questioned. You can probably see this every in your life, someone will not be sure if something is sanitary in a restaurant, but “Oh I am sure they wouldn’t serve us anything that wasn’t properly cleaned or cooked.” I don’t know about most of you but I have worked in two fast food restaurants and trust me, if it looks unsafe, it probably is. I am not sure why Americans began “trusting” these corporations with our decisions, and letting them dictacte what is right for us.

I have so much more to say about this topic but I am not quite sure how to express it. I just think it is a sad state of life we live in that, we don’t stand up for our rights because we are afraid we can’t afford to fight it. That is what most of this boils down to, because coproations can afford to pay those top lawyers, and legal bills, but Joe Nobody can’t. I just hope that our legal system cathces up and realizes the state of American and attempts to fix it soon.

Posted in politics | Leave a comment

Firefly MMO

I was looking through news on reddit.com, a social news website, and a headline caught my attention. The article was about the return of Firefly. For those who don’t know Firefly was a great television show that aired on Fox for the better part of one season. From what I read, the ratings were not very good, but it was mostly because the time slot kept changing, and they didn’t air the episodes in the correct order. That being said I watched Firefly for the first time on DVD and it was excellent. Clever writing, great visuals, interesting universe, it had it all. A little over a year ago Serenity was released, which takes place a few years after the Firefly television series. It was a great movie, but the real appeal of the series, at least for me, was the short missions, not the epic battles. So I was glad to see the movie, but had no desire to see the universe move to this medium in place of television.

Now with that brief history of Firefly out of the way….

I discovered that Fox, Sony, and Multiverse have made a deal to create an MMOG, or Massivly Multiplayer Online Game. There are a ton of other acronyms for this type of game, but pretty much any of them work. I am not sold on the idea of an MMOG based on a television show that was made great on the character development, but I am not one to shoot down someone’s idea. However, after looking over Multiverse and what they do I got an idea of my own. It seems like taking out the hard programming knowledge needed to get into developing a virtual world opens up a world of possibilities. That is exactly what Multiverse is attempting to do. It is creating a portal into a virtual world that is available to anyone with an idea.

My idea is a virtual entertainment network. What does that mean? Well…We have MMOG games, which are a place for you to create characters and perform missions. And we have television and movies, where we create virtual worlds with great characters. But so far we haven’t really nailed the idea of creating interactive television or movies. Games are getting there, but I think an episodic MMOG might be just the ticket. So what I propose is a world where events take place, that you can take part in. Basically have a cast of main characters. Using Firefly as an example, lets use Mal, Shepperd, and the rest of the crew. Every week or two they log into the system and follow a basic script in a basic area of the universe. So, in the case of Firefly, let’s say each week they attempt to complete a new mission. Again the idea here is you have characters developed, and a basic script written, or at least a set of rules they are to follow. During this event, allow users to interact accordingly. So, let’s say my character in the Firefly universe is a Reaver, which is a human who has been to the edge of space and changed. Now, let’s say the mission this week is to get to some remote planet that crosses through Reaver territory. I, as a Reaver, could take my ship and attempt to intercept them. If I am successful, maybe next week is them attempting to escape. In any case, the “actors” should be recorded while they are attempting to achieve their task. Then whatever the outcome is, is compiled into an hour episode, or however long, and released as a show. I am not sure if this is a good idea, but it seems like it might be a good mash up of TV and games.

Anyways, I think that is enough rambling for me tonight…

Posted in gaming | Leave a comment