Tuesday, September 23, 2008

Project Kenai

Before, there was just Google Code. People like me who wanted to work on team projects using my own a version control system had to rely on Google Code to host the project. This was invaluable helping me pass many classes! But now sun has released what they are calling Project Kenai pronounced Keen-eye.

At first glance it seems a little bit confusing, there is a little bit too much happening on the page, whereas the code.google.com site is simple. The are obviously going for the Web 2.0 look and feel which I think is a little over the top. Maybe I secretly don't like ruby.

The good news is that SUN is taking suggestions! So this has a chance to be really nice. Especially if we can see graphs and statistics about code, etc...

I will be finding a reason to try this out, and I will write another entry about my findings.

Monday, September 22, 2008

Am I still trying to be perfect?

I was watching a program where the speaker said some Christians are still under the law. Hmm.... ok take a step back. We've heard that we are not under the law anymore because Jesus died for us. But the truth is until be accept Jesus Christ as the propitiation of our sins we are still under the law.
Here are some questions people may ask:
"Whats so bad about the law, laws meant to be broken?"
"Can you have eternal life without accepting Jesus Christ as your savior"?

OK, there are six hundred and thirteen (Jewish) laws to watch out for. The bible says that the wages of sin is death but the gift of God is eternal life. [Rom 6:23] And Paul Quotes in [Rom 3:10] Scripture from Psalms 14:1-3 that No one is righteous, not not one.

It is impossible to live a perfect life! If you have already messed up there is no way for you to make up for it, because that small sin already costs your life. You are in debt. Thankfully, the one person who has lived the perfect life paid that cost. Jesus Christ fufilled the laws.

Instead of trying to answer the questions further: Galatians 2:15-21 gives a pretty good answer. Below I copied the excerpt from the Message bible because the idea here is written pretty clearly.

15-16We Jews know that we have no advantage of birth over "non-Jewish sinners." We know very well that we are not set right with God by rule-keeping but only through personal faith in Jesus Christ. How do we know? We tried it—and we had the best system of rules the world has ever seen! Convinced that no human being can please God by self-improvement, we believed in Jesus as the Messiah so that we might be set right before God by trusting in the Messiah, not by trying to be good.

17-18Have some of you noticed that we are not yet perfect? (No great surprise, right?) And are you ready to make the accusation that since people like me, who go through Christ in order to get things right with God, aren't perfectly virtuous, Christ must therefore be an accessory to sin? The accusation is frivolous. If I was "trying to be good," I would be rebuilding the same old barn that I tore down. I would be acting as a charlatan.

19-21What actually took place is this: I tried keeping rules and working my head off to please God, and it didn't work. So I quit being a "law man" so that I could be God's man. Christ's life showed me how, and enabled me to do it. I identified myself completely with him. Indeed, I have been crucified with Christ. My ego is no longer central. It is no longer important that I appear righteous before you or have your good opinion, and I am no longer driven to impress God. Christ lives in me. The life you see me living is not "mine," but it is lived by faith in the Son of God, who loved me and gave himself for me. I am not going to go back on that.

Is it not clear to you that to go back to that old rule-keeping, peer-pleasing religion would be an abandonment of everything personal and free in my relationship with God? I refuse to do that, to repudiate God's grace. If a living relationship with God could come by rule-keeping, then Christ died unnecessarily"

I think some us Christians are so freaked out about every little thing we and especially other people do that we forget that we were saved by grace.

Lets accept Jesus's Death and move forward giving the grace we were given ourselves. We should stop trying to work so hard because we can cast our burdens on Jesus!

"Cast thy burden upon the LORD, and he shall sustain thee" [Psalms 55:22]

Software Freedom Day @ University of Florida

Saturday September 20th was Software Freedom Day. This was a celebration of the ideas and technologies which drive free and open source technologies. As the SUN Microsystems campus ambassador to the University of Florida, I put on an event to celebrate this. I started off by giving an introductory talk to the SFD and SUN's involvement.
The main speaker of the event was Colin Hosert the CIO of GrooveShark.com. He spoke of how using open source technologies both helped and hindered his company. (GrooveShark is a company that is run rather tight and efficient budget compared to their competitors).
Later, I spoke breifly about OpenSolaris and showed how to install it using VirtualBox. I gave away free bags and cds. We also had some GREAT food from Sonny's BBQ!!
I made some great contacts with foss enthusiasts in the gainesville area, and on UF campus. Especially, people from Florida Free Culture and GatorLUG. We will probably have some joint events together in the future.

Below is a link to some picture I snapped of the Event.
LINK

Sunday, September 21, 2008

Proverbs 16 - Offer your plans to God!

Proverbs 16 is a really powerful book! So while I was reading it I took down some notes and highlighted some keep verses.

1: The first verse is interpreted in two basic ways according to different versions of the bible. Traditional King James says "The preparations of the heart in man, and the answer of the tongue, is from the LORD." while several other versions interpret this verse more closely as "The preparations of the heart belong to man,But the answer of the tongue is from the LORD. "
The next verse says that the Lord is the judge in anything we do, and h judges by weighing the spirit of what we planned. Some people do wrong and don't think twice, but God is Just and the motives that drive their actions are made visible to him. So we should always check our motivation behind our plans and actions.
So as in v3, commit everything you do to the Lord, and your motives will be follow in line. No matter what happens after remember God is in control.
Make your plans (under the submission of God) and your steps in turn will be directed by him [v9].
Its best to Gain what you do with honor than to rush past God's time line [8,12].
"How much Better is it to get wisdom than gold! to choose understanding rather silver! .. Pride goes before destruction, and a haughty spirit before a fall"
There is a way that seemes right unto a man, but the ends of it is destruction. [v25]
"He that is slow to anger is better than the mighty; and he that rules his spirit than he that takes a city"[v32]



165+


| Selah - Wonderful Merciful Savior
|

Tuesday, September 16, 2008

Chrome is messing up my sound ; Contains Microsoft Code

OK, I am getting a little annoyed, previously I said Chrome was nice here (Chrome Impresses) but I have been having a problem where every time I use Chrome, the audio on my computer is disabled. If I am listening to a CD in windows media player and I then open up Chrome to do anything the audio shuts off. Anybody have any clues?

Below, here is my Desktop info:

From Blogger Pictures


Update

A program manager who writes a blog let everybody know that some of the code in Chrome uses libraries that Microsft open sources in 2004. Who says Microsoft doesn't release code. Here is a link to his blog: hanselman

Update2

I found the solution to the sound problem.  The flash player crashes inside of Chrome.  I used the Chrome task manager to end the flash process and restart the webpage.  I only fixed it once, but I am sure if the sound goes out again I can use the same method to fix it.

Sunday, September 14, 2008

Jesus was "Ugly"?

Some one put a really well put together disclosure on youtube entitled Pretty/Ugly. He explains why he believes why Jesus is ugly and says it isn't a bad thing! I think everybody should watch this video, it subtly challenges the ideals of our Hollywood culture. I'll spare you from anymore of my reactions and let you watch it. Comment!

Thanks to N.H. for pointing me to this.


Here is the video:
Pretty/Ugly

Friday, September 12, 2008

Loser tree in Python

I am taking an Advanced Data Structures and Algorithms class with Dr. Sahni at UF. I used a data structure discussed in this class as an opportunity to learn Python a little better. I implemented the loser tree. The loser tree is a complete binary tree with n external nodes and n-1 internal nodes. The root of the tree has the overall winner. The loser tree is a more efficient version of a winner tree which are both types of Tournament Trees. In the winner tree the winner of each competition is inside the nodes, however it is more efficient to keep the loser of the competitions in side the nodes and bubble the winner up the tree.

The loser tree has applications in areas such as Run Generations during external sorts, Bin-Packing Problems (Truck Loading), and others.

I am not yet sure of how to transfer my c++ knowledge of pointer to Python, so I used an array representation of the binary tree to keep track of the nodes. If anybody knows how I could implement a tree with pointers, I would love to know.

In anycase, below is my code. It isnt great code, and any suggestions would be great! Thanks to Yet Another Coding Blog for the code highlighting tip.



#!/usr/bin/env python

import copy

class INode:
''' Internal nodes of the tree '''
def __init__(self,value=None,ptr=None,run=0):
self.value = value
self.ptr = ptr
self.run = run

def __repr__(self):
return repr(self.value)

def __cmp__(self,node):
if isinstance(node,INode):
# return cmp(self.value, node.value)
return self.value <= node.value
else:
# return cmp(self.value, node)
return self.value <= node


def __copy__(self):
return INode(self.value,self.ptr,self.run)

def copy(self):
new = INode()
new.value = self.value
new.ptr = self.ptr
new.run = self.run
return new
__copy__ = __deepcopy__ = copy

def clear(self):
''' Clear the value of this INode '''
self.value = None
self.ptr = None
self.run = None

class LoserTree:
'''The size of data must be a ,perfect square (i.e. 2,4,8,16) '''
def __init__(self,data=None):
self.size = len(data)
self.data = [INode() for i in xrange(len(data))]
self.data.extend([INode(data[i],i+self.size) for i in xrange(len(data))])
self.initialize()

def initialize(self):
'''Build the tree'''
index = self.size # Give us the index of the lowest level
left = True
for i in xrange(0,self.size,2):
l,r = int(index+i), int(index+i+1)
if(left):
if(self.__cmp(self.data[l], self.data[r])):
# Left Wins
loser = r/2
self.data[loser] = copy.copy(self.data[r])

winner = loser/2
self.data[winner] = copy.copy(self.data[l])
else:
# Right Wins
loser = l/2
self.data[loser] = copy.copy(self.data[l])

winner = loser/2
self.data[winner] = copy.copy(self.data[r])
elif(not left):
# We are on the right side of a tree
# so we need to bubble the winner up
winner = None
win_tmp = None
if(self.__cmp(self.data[l],self.data[r])):
# Left Wins
loser = l/2
self.data[loser] = copy.copy(self.data[r])

win_tmp = copy.copy(self.data[l])
winner = loser/2
else:
# Right Wins
loser = r/2
self.data[loser] = copy.copy(self.data[l])

win_tmp = copy.copy(self.data[r])
winner = loser/2
# Bubble up
while True:
if(self.data[winner].value == None):
self.data[winner] = copy.copy(win_tmp)
break

elif(self.__cmp(self.data[winner], win_tmp)):
tmp = copy.copy(self.data[winner])
self.data[winner] = copy.copy(win_tmp)
win_tmp = copy.copy(tmp)

winner /=2
else:
winner /= 2
left = not left

def getWinner(self):
return self.data[0].value

def popReplace(self, newValue):
'''Return the winner and update the tree with the new item'''
oldWinner = copy.copy(self.data[0])
runner = self.data[0].ptr
levelup = runner/2

newINode = INode(newValue,runner,oldWinner.run)
# Is new node less than the old winner
# if so increment the run count
if(newValue < oldWinner.value):
newINode.run = oldWinner.run + 1

# Replace Winner
self.data[runner] = copy.copy(newINode)
self.data[0].clear()

win_tmp = copy.copy(self.data[runner])
while runner > 0:
levelup = runner/2
if(self.__cmp(win_tmp,self.data[levelup])):
#win_tmp wins and is promoted
runner /= 2
else:
tmp = copy.copy(self.data[levelup])
self.data[levelup] = copy.copy(win_tmp)
win_tmp = tmp
runner /= 2
self.data[0] = copy.copy(win_tmp)

return oldWinner

def __repr__(self):
'''This prints the leaves of the tree'''
return repr(self.data[0:self.size])

def __cmp(self,left,right):
'''This compare function compares the current run, then the values'''
if(left.run == right.run):
return cmp(left, right)
else:
return cmp(left.run, right.run)

if __name__ == '__main__':
print "Data :",
data = [4,3,6,8,1,5,7,3,2,6,9,4,5,2,5,8]
print data
t = LoserTree(data)
print "Leaves:",t
print "Winner: ", t.getWinner()
replace = 9
w = t.popReplace(replace)
print "Replaced the winner %s with %s" % (w,replace)
print "New Winner: ", t.getWinner()
print "Leaves:",t


© Christan Grant - 2008

Wednesday, September 3, 2008

Chrome Impresses

If you haven't already, it is time for you to download Google Chrome.  This week google released an open source browser named Chrome.  Once you download it you will immediate notice two things.  First are the lightweight loading of tabs; there is no lag or delay when the browser loads up.  This  is because each tab in Chrome is threaded and treated as its own window.  You can drag any tab (while a page it is loading) out of one window for it to act as a new window.  The second diffference you will notice is the default home page which shows icons of some popular sites you like and recent searches you have made.  

It is good to see an open source browser work so well.  It uses Safari's rendering engine which is annoying for some sites.  For example, if you are looking at a facebook album there is a limit on how many picture you can look at until the browser stops working properly.  

Seeing how well Chrome worked makes me excited to see the andriod operating system in action.

Check out more details on chrome |Here|

Monday, September 1, 2008

Relationship Rules + Faith, Hope, Will

Here are just a few thoughts on my hearts. I got these ideas from tv/radio programs.


Thought 1

Three rules to follow in a relationship for men:
  1. Be a man of strength and tenderness. You need to show strength but not so much that she is afraid of you. Beyond making her feel loved it is important for her to to feel chosen.
  2. Reassurance. Your wife needs to be reassured that she is doing the right things and still the person that you love. So praise your wife. Let her know she is doing a good job as wife.
  3. Avoid Criticism. Don't have a critical spirit. If you need to say something for the sake of honesty make it kind. Honesty should be served with gentleness.


Thought 2


Faith, Hope, Will - These were the name of characters of shows I was watching the other night. So I went on a little rant trying to put the terms together.

God is Love
As humans we have Faith, Hope, and a Will

Jesus died so we would have freedom to Hope. He asks that awe have Faith in him. 1 Peter 3:15 | John 3:16

This relationship is how we build our faith. Lets have a relationship with God so we can build our faith in him. Following him and doing what he says. Jude 1:20

Lets transform our will's to Gods. Seeking after him and finding him will change your life. Romans 2

O taste and see that the Lord is good: blessed is the man that trusts in him! Psalms 34:8