My Motivation

I loved this talk.

So much truth in who we are can be seen in our motivations.  Looking at my own I notice a number of things:

  • Creating software and web applications are not simple, straightforward tasks that can be completed without thinking.  Working software requires a lot of thought.  Furthermore, working software that is also well designed software is honestly more art than it is science.
  • I want to work on cool, interesting ideas. I am passionate about programming.  I enjoy it.
  • Motivation is more important than compensation.

Right now, I am winding down in my first job search for after college.  It has been a fun journey with lots of interviews, some let downs, a few surprises, and tons of experience.  When confronted with my end choices of possible employers, I’m not looking at where I could make the most money.  I’m looking at where I think I will get the most motivation and paid enough for my work. I want to think about my work and create interesting things.  I am passionate about programming after all, not balancing my checkbook.

What is Sacred?

I saw this on the Colbert show a couple days ago.  I thought the Harvard professor’s ideas were interesting.  I also thought it was interesting seeing Colbert talk about his faith, almost breaking character for a bit. If you didn’t know he is a Sunday school teacher.  Oh, what I would give to sit in on a Bible lesson from Colbert…

Sean Dorrance Kelly-Sean Dorrance Kelly believes that we’ve lost the notion of what’s sacred in our existence (06:48)

I don’t think that it means you can’t literally EVER laugh at something or it loses the sacredness(?). But laughing as in ridiculing it for being what it is. Laughing at something funny/ironic is different than ridiculing something to destroy its image.  I think there is a middle ground here, satire is a genius way of getting a point across.  And I love to laugh at satire.

Campus Organizations Portlet

Currently I am a student software engineer for the University of California Irvine where I build web tools for the for the student portal, ZotPortal.  If you aren’t too sure of what a web portal is, think iGoogle – lots of different content pieces on one page.  These content pieces are called portlets and I design, engineer, and maintain them on ZotPortal. I want to talk about two different things in this post, 1) a portlet I designed that enables people to search for on campus organizations at UCI and 2) some different ways of obfuscating email addresses (or other data) from potential scrappers/spammers. The connection will become apparent later.

Campus Organization Portlet

The Campus Organizations Portlet was the first portlet I built. The idea was simple enough: given a feed of all the campus organizations, parse out the data, and display all the organization information in a searchable UI. There are currently around 540 different organizations to show, so the data needed to be broken up into separate pages.  I decided to use the Fluid Pager javascript component to page through the data without having to reload the page. This enables us to place each organization in its row along with its info box and category. The gapped paging scheme makes navigating through the pages a breeze without cluttering the pager bar. Some more javascript was added for to display organization info and the search bar to re-render the pager with just the search results.

Now, on each organization’s information panel we supplied a mailing address so a user could contact the club leaders. And since this portlet is accessible from the guest view, there is potential for spam bots to troll through our student portal and collect all of the club email addresses to sell or send spam to. I wanted to hide the email addresses from the spammers while at the same time enable the viewer to use the email. So, I spelled out the symbols in the email to confuse any would-be spam bots reading through my portlet data. Instead of coolclub@uci.edu, coolclub[at][you see eye][period]edu. An average spam bot wouldn’t recognize this as an email address, spam avoided! The only thing that bothers me with this approach is the fact that the user has to do the work of replacing [at][you see eye][period] with”@uci.”. Sure, it isn’t very difficult or time consuming, but it would be a lot better if the user could simply copy/paste or click a mailto tag.

I found someone in a similar dilemma and a really good answer was provided to him.  Examining these different methods of obfuscation allows us to pick the best one for our situation.

  1. CSS direction
    • Code
      • <span style="unicode-bidi: bidi-override; direction: rtl;">moc.elpmaxe@zyx</span>
    • Renders as
      • xyz@example.com
  2. CSS display
    • Code
      • xyz<span style="display: none;">foo</span>@example.com
    • Renders as
      • xyz@example.com
  3. ROT13 encryption
    • Code
      • <script>var email = decodeROT13(klm@rknzcyr.pbz); emailElement.append(email);</script>
    • Renders as
      • xyz@example.com
  4. Using ATs and DOTs
    • Renders as
      • xyz[AT]example[DOT]com
  5. Building with javascript
    • Code
      • <script>var email = 'xyz'; m += '@'; m+= 'example.com'; emailElement.append(email);</script>
    • Renders as
      • xyz@example.com
  6. Replacing ‘@’ and ‘.’ with entities
    • Code
      • xyz&amp;amp;amp;amp;#64;example&amp;amp;amp;amp;#46;com
    • Renders as
      • xyz@example.com
  7. Comment splitting
    • Code
      • xyz<!-- eat this spammer -->@<!-- ha ha -->example.com
    • Renders as
      • xyz@example.com
  8. Urlencode
    • Code
      • xyz%40example.com
    • Renders as
      • xyz@example.com
  9. Plaintext
    • Renders as
      • xyz@example.com

The author of this study (credit to Silvan Mühlemann; his original post can be found here) even watched each of these methods for over a year just to see the different amounts of spam each strategy would receive.  These were his findings…

Obfuscation Methods

The current obfuscating strategy I use received the lowest amount of spam out of the ones that got spam in this study.  However, there are better strategies, with zero spam, that don’t require any work from the user (strategies 1-3).  So, I should change the strategy for obscuring the organization email in the portlet since there doesn’t seem to be any cost Late February 2011, we changed the obfuscating method and decided to use CSS direction.  We still are looking into a combination approach with CSS direction for display and javascript building for a mailto link for better and easier interaction.

AI Project: Checkers

I figure I’d start revisiting some work I did a couple quarters ago at UCI in an AI project course. We set out to experiment with some different Checker strategies and see how they would fair against each other, against us, and (most importantly) against another team developing another Checkers AI system. I’ve created a simple game from my own ideas, but I haven’t created a game from a preexisting set of rules before or have the game play against the human. The game system is pretty self-explanatory; moves are hi-lighted, jumps are mandatory, a piece becomes a king on the other end of the board, and you win when you lose all your pieces or when you can’t make a move.  I really wanted to build this in something other than a Java applet, since they aren’t used much these days, but UCI programming courses heavily use java and their game courses heavily use a custom library called UCIGame (you-see-ga-me).  The AI depth search uses a min/max and alpha/beta pruning strategy to allow the massive move set to be shortened so a move decision can be made in reasonable time, but a search of depth 10 still makes a noticeable pause.

The most interesting part of this project is the AI strategies we implemented.

  • Random
    • The AI selects a move at random.  Hardly a challenge
  • Basic
    • The AI examines all possible moves within the search depth value.  It then selects the move that allows the AI to be in the position were losses and gains will be the most beneficial.  Ideally, the more pieces it can take and least amount of pieces it can lose will increase the probability to win the entire game.  This strategy is easily countered by tricking the AI with bait, and then trapping and taking its piece.  The best choice is based on an average score derived from a couple of heuristics.
      • Taking pieces(+ for regular; ++ for kings)
      • Loosing computer pieces(- for regular; — for kings)
      • Getting ‘Kinged'(+)
      • Moving a piece from a ‘King Me’ square(–)
  • Piece Table
    • In addition to the heuristics above for the basic strategy, a piece table is also incorporated into the score for a move. The piece table gives each square a value and it is added into the average score for each move. This is the piece table used for our AI.  Each number denotes a square worth value. The higher the value, the higher the worth of keeping a piece on that square. Notice that all ‘King Me’ squares hold the highest value of 4, these spots are very important, and a player would only want to move a piece from this location as a last resort. Squares close to the sides of the board also have the value 4, and closer inside is 3, are the least vulnerable from attacks. On the other hand, the squares in the very middle of the board hold a value of 1. These squares get vacated as fast as possible since they are most susceptible from attacks. The numbers make a sort of spiral from the outside, decreasing in value as they come closer to the middle. This strategy is very strong since it combines the heuristics from the Basic strategy to minimize losses and maximize gains as well as achieve optimal piece placement on the board to further minimize more losses and maximize more gains. I have not been able to beat this strategy with a high depth.

Overall, it was a very enlightening project to work on.  I learned a lot working with massive decision trees, different strategies, implementing given rules, and classifying data sets using a range of scores. I was quite happy with the outcome of an AI that can easily beat its creator, and with the fact that we smoked the other Checkers project team. Checkers is a solved problem after all, so if we were evenly matched it should tie or win ~50% of the time.

EDIT// before java was more or less shuttered from browser support, we had a working embedded applet you could play but not anymore.

I have a couple of planned changes for this application’s future:

  • Simplify the button options
    • The three buttons on the GUI made sense at the time I created them, but many users have reported that they have trouble knowing which one to click when.  Combining the Resign and New Game button into a single one will free space for an AI vs AI option.  Another problem is that when the Make AI Move button is pressed the player switches sides.  They have to click it again to resume play as the original red color.
  • Allow  the player to select his color at start of game
    • Just a nice option for the player to choose.

Easter Redux

Easter has always baffled me. Not why we celebrate it, but how it happened. I know God resurrected, but that means that God had to die. God died. Now that is weird to think about. The Being that created everything died. Was there no God for three days? How does that work!?

This God-Man or Man-God…this Thing that is the Supernatural mixed with the natural…this Thing that is the Deity infused with flesh broke the rules of this world. It broke the rules of our world by entering and later broke the rules of our curse-death.

Adam/Eve cursed us all from that bite. You can’t really blame them though, how can you comprehend the impact of something that you have never experienced on an entire race? They didn’t know what death or sin were. But they caused it, and it has been our curse that has separated us from God. But God had a plan, to break this curse. How it happened, like I said, I don’t fully understand. It has some logic to it. To sin means death, and someone has to pay for that sin. So logically, if one who hasn’t done anything wants to atone for that sin, they can. But how can God atone for sin? God is perfect. God can’t die. God can’t have anything to do with sin.

Maybe that’s what broke the curse of death. It tried to claim something it couldn’t. Death had been afflicting humans one by one, so God placed Himself within a human and death couldn’t handle it. Jesus wasn’t an applicable parameter for death to take. It choked. Death broke. God finally upset the curse that satan tricked Adam into placing upon us. Now there is a way out of death, through Jesus, and Him alone.

He broke this curse, this cycle. He has beaten our captor. He has reclaimed us.

God brought us the cure-His one and only Son.


Is it wrong that I am so proud of that analogy of God breaking death’s parameters?  It is very computer sciencey, death being a function that accepts a MortalBeing as a parameter and when you try giving it an ImmortalGod that implements MortalBeing it breaks and throws OmgWhatJustHappenedException. It makes sense to me.

Death Broke, which means that sin is no longer an issue for us.  Sin no longer being an issue for us allows God to interact with us as He intended.  Our relationship with God finally being restored we can gather our self-worth not through our intelligence, not through how much money we make, and not through how attractive we are but through our intrinsic value of being solely created/fulfilled by God.  Since we can view ourselves as worth so much more than what this world can give us, we can see others in the same light, we can fix our relationships with other people; we must love others if we know they are a creation like us. Because of these three relationships being restored through Christ, our relationship with God, our relationship with ourselves, our relationship with each other, we can begin to do God’s work in this world and prepare for Christ’s return to finally restore the rest of His creation. I mean, if He has done an amazing job on the first three what makes you think he won’t make good on his promise for the fourth?

I can’t wait to experience the hike to the Bridge to Nowhere in a perfect, curse free creation–as God intended it to be experienced.

An excerpt

“We love life. All life, but especially sentient life forms, like Homo sapiens. Your species. This is a very beautiful planet. A priceless work of art.”

Suddenly, without warning, the Ellimist did it again. He opened space.  We were no longer standing in the Yeerk pool. We were no longer underground at all. We were underwater. Deep underwater. But the water did not seem to touch my skin. And when I breathed, there was air. Still, I felt fear tingle the back of my neck.  Suspended in the water, but dry. The Ellimist could no longer be seen. We were floating above a coral reef. And everything was moving again.  All around us, fish swam by in swift-darting schools. Fish in every color and shape, reflecting the dappled sunlight from above. Sharks prowled. Stingrays seemed to fly. Squid pulsated. Crabs scuttled across fabulous extrusions of coral. Tuna as big as sheep drifted past. Swift, grinning dolphins raced by in pursuit of their next meal.

LOVELY.

The Ellimist’s voice once more seemed to grow from deep within my own heart.

LOVELY.

And then, as quickly as we had been plunged into the ocean, we were drifting above the waving golden grass of the African savannah. A pride of lions lazed in the sun below us, looking sleepily content. Wildebeest and gazelles and impalas grazed, then broke into wild, springing, bouncing races that forced you to smile at the sheer energy of it all.  There were hyenas, rhinos, elephants, giraffes, cheetahs, baboons, zebras. Hawks and eagles and buzzards wheeled overhead.

LOOK AT IT.

Then, in an instant, deep jungle. A lithe jaguar prowled while monkeys chattered in the tree canopy above. Snakes as long as a person slithered across tree branches. The air reeked of the heavy perfume of a million flowers. We heard the sounds of frogs, insects, monkeys, and wild, screaming birds.

IN ALL THE UNIVERSE, NO GREATER BEAUTY. IN A THOUSAND, THOUSAND WORLDS, NO GREATER ART THAN THIS.

Then the Ellimist showed us the human race. We flew, invisible, through the steel-and-glass canyons of New York City.  We drifted above villages at the edges of jungle rivers. We watched a rock concert in Rio de Janeiro, and a political meeting in Seoul, and a soccer game in Durban, and an open-air market in the Philippines.

HUMANS. CRUDE. PRIMITIVE. BUT CAPABLE OF UNDERSTANDING.

Suddenly, all the movement stopped. We were staring at a picture. A painting. I’d seen the painting somewhere before.

It was a wild swirl of color. A painting of purple flowers. Irises, I think, although I’m no big expert on flowers. The artist had seen the beauty of those flowers and captured some small bit of it on canvas.

CAPABLE OF UNDERSTANDING.

The beauty of our world amazes me. Even more amazing I think, and so does the Ellimist it seems, is that we have been endowed with the ability to understand the beauty/glory of it all.

Humiliation

hu·mil·i·ty –noun
the quality or condition of being humble

hu·mil·i·ate –verb
to cause (a person) a painful loss of pride, self-respect, or dignity

While (to) humiliate is looked at as such a negative word, its root, humility, is a positive quality. In order to receive humility expect to be humiliated. I had never seen this connection until tonight while reading Colossians at Pierced. The next time you pray for humility be prepared to receive it how it is given. In order for God to grant you humility, he effectively humiliates you.

EDIT://More thoughts on humility

The cross, a very painful way to die. A real point of the cross was complete humiliation of the victim. As the accusers watched Jesus get crucified, they must have thought they had won. But through this, God beat Satan and brought his ultimate downfall, through being humiliated (if you believe in all that). The desire of the arrogant is to be strong and beat your opponent into submission, but Jesus effectively countered this by simply being humble. It is something I don’t think that those with a thirst for power at costs can understand. It baffles them, which in turn humiliates them. It is almost a compounded humiliation for them, getting humiliated by their own humiliation.

Games

“But games do matter, because they spark the imaginations of our children, taking them on epic quests to strange new worlds. Games matter because our children no longer have access to real-world play spaces at a time when we’ve paved over the vacant lots to make room for more condos and the streets make parents nervous. If children are going to have opportunities for exploratory play, play that encourages cognitive development and fosters problem-solving skills, they will do so in the virtual environments of games. Multi-player games create opportunities for leadership, competition, teamwork and collaboration—for nerdy kids, not just for high-school football players. Games matter because they form the digital equivalent of the Head Start program, getting kids excited about what computers can do.”

-Henry Jenkins, Art Form for the Digital Age