Trying out photoblogging...

http://gaiussensei-photos.blogspot.com/
Check it out guys~ New blog! I'm kindof busy right now, but since I'll be out and about a few places this month, I'll be capturing quite a bit of photos. It'll be low resolution since I currently don't own a DSLR, but I'll make sure to post my best shots.

Photos taken using: HTC Wildfire and the Vignette Camera App. ^^ Sayonara~

UPDATE: Ok, got tired of tweaking BlogSpot. This platform is NOT for photobloggers, so I'm moving to a better on: DeviantArt. See you guys there~

Reaction Paper: An Encounter with an Anthropologist

Dr. B, despite having an Phd. in anthropology, proved quite tactless in our first meeting. The first lesson discussed a range of topics from religion, to a recent suicide of a prominent general, and even to sex! Honestly, I am both impressed and entertained- having experienced teaching first hand, I know that getting your student's attention while sticking to the lesson plan can be quite a chore.

There are quite a few things that struck a nerve in the discussion. I am a devout catholic, despite being a computer scientist, and I have had many sleepless nights and heated discussions with my fellow professionals about the age-old debate concerning “Science vs. God”. On one hand, science, or as Dr. B have discussed, the scientific method, relies on proof. Even knowing something a priori, science still needs at least logic and reason. Faith, on the other hand, relies on belief without proof, about hope and the inherently unexplainable miracles.

In my opinion, Science is just a way of comprehending God's ways- an instrument from Him, through our scientists. Its a lot like the Bible in some ways, an instrument written by (divinely-inspired) humans, open to interpretation. A few examples: The Bible tells the story of genesis eg. “God created the world in six days, rested on the seventh”. When taking into consideration who wrote that story, even if he/she is divinely inspired, it would be impossible to measure time and translate it to something that we can comprehend. Maybe the writer simplified it, or maybe not- something to think about.

Another example: From year 2000 to 2005*, several scientific journals was published that confirms the existence of a single Creator. Of course, the scientists did not name who (God, Allah, etc.) but still- these journals have NOT been reverted yet. Several journals have tried to disprove these, the latest of which is Stephen Hawking's The Grand Design (2010). A good read, to be sure.

I find it distrubing when people generalize scientists to be godless heathens- people who rely on proof only. I'd like to believe, that I'm not the only Catholic Scientist/Skeptic here. Also, if I may offer a friendly advice from one (former) professor to another: Respect your student's beliefs. It would also be wise assume that there are catholics in a catholic college- not everyone would be devout, of course, but it would help to take care, none the less.

My two cents.

* related: Cosmic Microwave Background Theory

This whole post is my reaction paper for my first meeting with Dr. B, my current professor in "Theories in Research". This was written with only my stock knowledge (minimal to no references) and my opinions: read with a grain of salt.

The Flaws of College Education Today

Teens this days have smart phones- phones that are more powerful than most computers ten, even five years ago. These phones can access the internet very readily- in fact, most networks here in the Philippines offer a very cheap 50peso 1-day unlimited internet promo. Soon, affordable tablet PCs will reach the public, and a library of books will be available right next to a browser, all in our student's fingertips.

What does all these mean, in the context of our current college education system?

This means that memorizing theories are no longer needed. It will not matter if you don't know the answer, because the answer is only a few clicks away, right in your pocket. Seatworks, homeworks , quizzes and tests becomes obsolete, since these are the ways to test if a student remembers a lesson, which is unnecessary with the current technology. You forgot the next ingredient for the recipe? so what? LMGTFY. What's the difference between the star, bus and ring topologies? This. What's the truth table and the logic circuit for the function: P && (Q || R)? Easy.

The way the current system measures the abilities of the students is outdated (and in my opinion, no longer work).  And remember: What you can't measure, you can't control.. and if the colleges are not controlling what our students are learning, then what's the point? Imagine going to the university hoping to learn how to become a nurse, and after four years, everything you know are not only outdated, but even elementary grads can download a free app that knows most of what you do?

So what do we do? Stop going to school? NO.

Let me tell you guys a story. Two fresh CS graduates land a job in a company. They were given identical tasks- let's say, design and implement a module on a program. They both have zero experience programming in the industry, but has unlimited access to both the company's documentation as well as the internet. The problem is: there's only one permanent spot available, and the management have to decide which of the graduates to retain after their probationary period. If you are that manager, how will you pick? How do you decide, which one is better? Remember that they both have access to the same resources.

If I'm the manager, the graduate who have grasped the program quicker gets the job. Since everybody can become an effective employee (in the sense that the resources to learn how to do stuff are both accessible and free), then you have to become an efficient employee- spend less time learning and spend more time doing stuff. Now how can we do stuff faster? Let me ask you this: if you're learning to play basketball, how do you improve your game? The same is true on almost every discipline: You have to practice. You have to experience things, instead of memorizing them. An example: learning how to make the Fibonacci sequence appear on your computer is cute, but applying the Fibonacci sequence by creating a game will make you experience more (not to mention a lot more fun and challenging).

Bottom line: A parrot can memorize words, but will never understand its meaning. Don't be a parrot: Make new things, apply what you know NOW, and practice always.. and remember: Knowing is not enough. My two cents, Sayonara and have a great new year~

Failure

Have you ever noticed that when everything goes as planned, you actually learn less? Do not be afraid to fail. Think of it this way: there’s not much to learn when things work. When they fail however, you have a chance to understand where the boundaries are, providing us an opportunity to learn more when things go awry.



Edison quote mug by ~estranged-illusions on deviantART


Imagine: After creating a program and testing it against the known correct results, everything works. Congratulations! You just learned how to solve the problem. BUT! Consider this- When you test your program and something goes wrong, what do you do? Give up? Of course not! One of the best ways to study programming is through trial and error, and being wrong is an integral part of the learning process. When the program doesn't work as intended, we find the bugs and fix it. We test more. We think more. We learn more.

However, constant failure is another beast entirely. The saying goes: "Fool me once, shame on you, Fool me twice, shame on me". This is particularly true in programming, where a correct line of code will always produce the correct output and vice versa.

A professor in a prestigeous college once said that programming is a routinary job- eg. doing the same things over and over again. This true only when the programmer is NOT learning, and is constantly wrong, and thus have to repeat his job over and over again. A real programmer writes code only once, tests and tweaks for errors, learning what to do and what not to do along the way, and reuses old code extensively. Strive to be that kind of programmer.

Until next time, Sayonara~

Dates and Primary Keys

I've got a story to tell :D I remembered this because one of my current coworkers asked me about the curious way I write dates in code (such as 10X23, or 10902). After telling the tale, I decided to also share my experience to you guys~

T'was a dark and stormy night..

It was a dark and stormy night by =aki-no-mia on deviantART
[/kidding]

Anyway, several months before I started in my current job, I got this project to expand an HR tracking software from a local startup. It was a fairly simple project and the company already has a small internal development team that is doing another part of the system (the Point-of-Sale, if I'm not mistaken). Not only that, but an ISO 9001 Audit was ongoing in the other departments of the company- with people rifling through databases and checking that everything has a trail (eg. properly documented).

One of the Database Tables had a column named "ID", which is the table's primary key. The data was formatted like so: 20100123, 20100202, etc. Obviously, it was in a YYYYMMDD date format, so this is what the auditor did:

1.) Change the key of one record from 20100129 to 20090101, which is a valid key
2.) Open the 2010 monthly reports.

And lo and behold, the record disappeared from the reports. It turned out that one of their developers was using the ID of the records to filter the reports:

If CDbl(Record.ID) >= 100000 Then Report.Add(Record)

I don't know if it was brilliance or plain stupidity. I guess it does work. IDs are supposed to IDentify specific records, and not keep track of dates- its data formatting does not, should NOT matter.

As a workaround, the Senior Dev (who was pissed and almost fired the dev responsible) instructed us to use the following date format: YYMDD - Two digits for the year, One AlphaNum for the month, and two digits for the day. The month AlphaNum works like so: 1 through 9 for January to September, X for October, Y for November and Z for December.

Now THAT is brilliance: It shortened the ID from 8 digits to just 5 and prevented devs from converting the IDs to numbers and using them mathematically :D

Until next time, Sayonara~

Optimus Prime (a.k.a Transformational Leadership)

Attending a seminar at Newlife is one-part worship, one-part pure content, and one-part advertisement. Anyways, me and the systems department where I'm currently employed attended this seminar there called "Transformational Leadership", sponsored (prominently) by World Vision. It was a good seminar, although the speaker (Pastor Boris Joaquin) was not very engaging, but still- I'd like to share a few thoughts about it~

Ok, what striked me the most is the 5-part "Training Cycle"
  1. "The Teaching"
    • Develop their skills through detailed instructions 
    • Stay with your "disciple" every step of the way
  2. "The Demonstration"
    • Show, don't tell
    • Let the "disciple" try their skills out in real situations
  3. "The Coaching"
    • Find their flaws, make constructive criticism 
    • Inspire your "disciple" to increase his/her skills
  4. "The Release"
    • Stay in the background, help only when necessary
    • Give the "disciple" the power to decide for him/herself 
  5. "The Next Generation" 
    • Confirm that your visions and goals are still aligned
    • Let your "disciple" spread his expertise to others through this 5-part cycle

Another topic that I liked is the transformational leadership model~ This is how I understood it..
  • Start with yourself, to give yourself some perspective. If your don't walk the talk, then you'll lose followers faster than you can gain them. [Additional Reading: Mat.3:13-4:11]
  • One-on-one with a few of your most trusted people. Don't try to "change the world" as soon as you can, start with those nearest and most open to you. [Mat.4:18-22]
  • Start building your team. Let your 'chosen few' choose their own 'chosen few', stay in the background and guide the vision of your community. [Mat.10:5-10, Mat.28:19-20]
I guess that's that, I've got an "Open Source" seminar to prep, so expect the slides about it on my next post. Until then, Sayonara :D

Object-Oriented Seminar

Slide Notes Here: http://ow.ly/2Coay
After a few weeks, I was finally able to continue my seminar on 3P.Net~ Btw, The slides above have the same opening as the last one (first three or four slides, I think) and most of the juicy parts are on the slide notes. I have already touched on Lazy Initialization and Singletons in this blog, and I've talked about object-oriented programming stuff as well, so I don't think I should more stuff in this post :D

If you have any questions, clarifications or suggestions about any of the topics I've discussed in this blog, just message me in my Google Profile, Facebook or Twitter. Until next time, sayonara~

Importing Inherited Implements

What’s the difference between Imports, Inherits and Implements?

Imports
…lets the developer USE a Namespace, using a referenced library; eg. the Math Object is under the System Namespace, so in order to use the functions that it shares, you’ll declare “Imports System.Math” somewhere in your code.You can use any library that you have referenced in your project WITHOUT using Imports keyword by typing the full class path, eg. “a = System.Math.Abs(10.2);”. By using the Imports keyword, however, you can shorten the line of code to just “a = Abs(10.2);”.

Implements
…lets the developer EXTEND a Class, using an Interface. These interfaces usually start with the capital I in front of them, and implementing one of these would force a class to use certain names and types of certain methods and properties. You have to explicitly declare these constraints, or the class will not compile. However: the Interface itself cannot contain any code, it just enforces a pattern so that other objects can call a generic interface to address multiple implementations.

Inherits
…also lets the developer EXTEND a Class, but this time using a base class. The base class are complete classes with working methods and properties. It does not enforce any constraints to the class that’s inheriting it (unlike Interfaces) so you can overload (or choose to ignore) any method you like.

~~~

An Analogy: Everyone can become Wet. Dogs are Animals. Cats are Animals. All Carnivores can eat Meat.

Now, since everyone can access the method MakeWet, then an “Imports System.Water” might have been declared, so that everyone can just call the Method “MakeWet” instead of repeatedly writing “System.Water.MakeWet”.

We can say that both Dogs and Cats implement the interface IAnimal. This way, we can give both of them the method IAnimal.Talk() and force the coder to write code inside the function. Afterwards, since all animals have the same method name ‘Talk()’, we can use them like so:
Zoo.Add(New Dog)
Zoo.Add(New Cat)
For Each Animal as IAnimal in Zoo
Animal.Talk()
End For
// Output:
// ”Woof Woof”
// ”Meow Meow”
However, all animals eat alike. Instead of copy-pasting the eat method on each animal, lets just have them inherit the Base Class clsCarnivore, which automatically gives them the method ‘EatMeat’. Of course, if an animal only eats certain kinds of meat, we can overload the method, but if not, no extra code is needed.

There, and done~! Don’t get confused.. Until next post, Sayonara~

w00+! Btw, what's the opposite of writer's block?

Ok, so I said quite a few posts back that I'm pulling back on blog posts to focus on my new job at Isuzu Automotive. However, I'm quite inspired these past few days (maybe because of the thrill of educating again), and I'm currently writing 3 blog posts for you guys ^^ Yey!

Now, I'm about finished with the first one: Inherits Implements and Imports, so that'll go up approximately tomorrow evening. One of my superiors asked me about the difference between them, and I couldn't remember off the top of my head. So I decided to do some research and write about it here.

Next is a fun post, which will also be the first post on my new (!!) blog: FinalFantasy14.Philippines. I got a Beta Key for the Square-Enix's upcoming MMORPG: Final Fantasy 14, and I'll try to document what I learn and share the experience in a filipino player's perspective.

Lastly, I'm writing something about developing Android Applications. I brought an HTC Wildfire last week, and I'm kindof intrigued with the development of Android as an operating system.

Ok, that's it! I need to go write some more~ Sayonara, for now!

Trippy Dot Net

Slide Notes Here: http://ow.ly/2qFmJ


2nd seminar in a month c-c-combo! I'm getting my old confidence back :D I'll try to schedule another one next next tuesday (which I will post here too) about Unit Testing~ But in the meantime, here's a few choice bits about my take on Exception Handling (Part 1 of my 3P.Net series):

Be wary of using Try..Catch Exception Handling! Its tempting to use the infamous "Try All, Catch Everything" mentality throughout your code, but that will cause a lot of trouble to you (and your team) in the future. How? Well, aside from a slight performance hit for every line in the try..catch (less than 1ms), by catching exceptions in the lower layers, you're depriving the upper layers from effectively resolving those errors!

An example: If the end user somehow bypasses the validation, and enter a null entry into a non-nullable field, the business logic layer would pass the wrong data to the service layer, who would then try to insert/update the data source. The data source would then issue an exception to the service layer (NullArgumentException). If you resolve the error at the service layer (Log the error then throw a message saying that there's something wrong) then the business logic layer will no longer catch the exception. However! If you let it 'bubble up' (eg. Don't try..catch it, or throw it again after catching it) to the business logic layer, you can now catch all NullArgumentExceptions, fill the null data with a default value, then resend it to the data source. The end user would'nt even know that an exception had happened.

Another thing, it's good practice to throw unresolved exceptions up towards the highest layer, which is commonly the Windows Forms layer (or ASP.Net/WPF/Silverlight layer, whichever the case). The top most layer however, should have a blanket try catch on its containers (form/page/usercontrol, whichever the case) in order to catch any stray unresolved errors that manage to bubble up to the very top. These unresolved errors, are the ones that we have to track with a Bug Tracker.

You can read more about this topics on my slides above, or you could just message me in my Google Profile, Facebook or Twitter. Until next time, sayonara~

Social Networking and Education

Slide Notes Here: http://ow.ly/2mmFT



It has been quite some time since I stood in front of a classroom filled with students. A week ago, Mam (Mich) Ramirez invited me to talk at Lyceum, and I immediately agreed- As you guys know, I like being an educator. But as I stood in front of the students, I suddenly felt fear and my heart started pounding fast.. I guess 'hindi na ko sanay' and I need to start performing talks more. I hope more opportunities like these present themselves..

Anyhow.

My talk was about how college education is not enough, how we must supplement it with knowledge available to us (free!) in the internet, and how to find these knowledge through the use of Social Networking. After that, I talked a bit about blogging (which, ironically, I'm blogging about right now) and which blogging platforms I think is the best. I'll reiterate a bit here:

1) I love Blogger. Absolutely free, No strings attached, moderately customizable and best of all: Allows Ads.
2) Wordpress: for Design Experts.  It requires a small yearly fee, but you can customize a lot of it afterwards: plugins, widgets, themes, etc. Also, a photoshop pro's dream photo blog.
3) Quick & Easy blogging at Tumblr & Posterous. These are free services, little customization (compared to Blogger and Wordpress, at least) but very clean and simple to use.
4) Make your own. You can set up a Joomla, Drupal or a Ruby on Rails web server at home or on a host, get a domain name to get a 100% fully customizable website that can breath fire (if you're a good enough programmer), but of course, you'd need to invest a lot of time, effort and cash to do so. I suggest trying out the free services first.

That's it for today~! If you guys have any questions (about the seminar, blogging or even programming) you can leave a message on my Google Profiles page, or just contact me through Facebook or Twitter. Until next time, Sayonara! *watches the latest Hitman Reborn*

Faith & Prosperity

What a week. First, I attended my job's care group last Thursday (10729) and the topic was about prosperity. Then. my boss gave me and one of my coworkers a ticket to a financial seminar about debt, investment and setting up a business. The seminar was today, and it went well- all three of the speakers were both emotionally moving and very knowledgeable in their topics. After the seminar, I attended the Saturday mass with another coworker, and the homily was about, take a guess: wealth. See the pattern yet?
"Owe no one anything, except to love one another..." ~ Romans 13:8
Dr. Dan Lachica's talk about debt was very inspiring, and although I'm not in debt (except maybe from my parents) I still learned a lot from it. However, what really striked me was his short segue into how cheating somehow affects what happens to you in the future. Dr. Lachica's example was that, if he holds a scalding hot bottle of water, his hand will blister right away- therefore, he immidiately knows that the cause of the blisters is the hot bottle of water. However, if he holds the hot bottle now, and gets blisters after a few days, it would be harder to connect those two events.

Now, let me tell you what happened to me just last week. Yes, a week before my whole week of faith and prosperity-talk with practically everyone.

A week ago, Saturday, I was at the office working as usual with very little care about cash except saving enough for a copy of Final Fantasy 14 come late September. One of my friends asked me if I have time after work, since a new movie that looked interesting was in the theaters (No, not Eclipse, but Sorcerer's Apprentice w/ Nicolas Cage). Since I didn't have anything planned except my weekly Saturday mass at the nearby mall, I agreed. Turns out that the same mall had a screening of the movie we want, 30 mins. right after the mass (coincidence? I didn't think so then, but...)

I met with my friend after work, and we went to the mass together. Before the mass ended, the collection basket was passed for those who'd like to share their blessings with the church- I usually pass it on because... well, I don't really have an excuse. But until then, I don't remember ever putting any of my own money into the collection basket. However, my friend took out his wallet and drew some coins when the basket neared. Feeling a bit guilty, I also looked at my wallet and got some coins out- about six or seven pesos, I'm not sure. We dropped the coins into the basket and the mass continued.

We ate at a fast food, watched the movie (it was good, btw) then went home- a bus then a jeep. Here's when I first noticed something: I had the exact amount of coins left for my ride home, and since I don't like breaking my bills to coins, I decided not to stop at a convenience store for a quick bite.

The next work day, the same thing happened at my workplace's canteen- exact change. Nothing extra to spend on luxuries that I want, but don't need. The week trudged on, and the same things kept happening, up until the weekend came- which I normally spend some extra cash (I had quite a lot, to my surprise). I had quite a fun and I enjoyed hanging out with my friends, until I noticed that I left my jacket at a coffee shop (Town Center's Coffee Bean). It was a favorite of mine, and quite new too- I immediately sms'd my mom about it just in case I never get it back, since me and my friends are already a bit far from where I left it. An hour passed by, almost two hours, before we got back. Lo and behold, I got my jacket back. The shopkeeper's staff kept it for me, and I was really grateful that they did so.

It was an amazing string of "coincidences": starting with a guilty offering of only a few pesos, into saving some cash, into finding my lost jacket, and finally capped with a series of seminars that explained everything. It took me a while before I saw which caused what effect, but I'm sure- 100% sure, that my whole week was planned by Him. I really am blessed, and I'm writing this as way to spread these blessings, to inspire, or at least convince you, that the Lord, our God, is really a generous God.

I don't really like quoting from the bible (it almost always feels like its out of context somehow), but since I started with one, I'll end with another. Until next time, Sayonara!
"As long as the earth endures, seedtime and harvest, cold and heat, summer and winter, day and night will never cease." ~ Genesis 8:22

“Are we really going to use these theories/principles at work?”

While teaching in Letran, or even while studying there a few years back, one question almost always pops up when a professor wraps up a difficult topic: “How do we apply this in the real world?” I have asked this question myself a few times, and now that I'm working in the industry again, I have this rare chance of showing you exactly how the theories are actually used in real applications. I will tag these series here as 'Theory + Reality', and the posts would be about how we can apply the theories we have learned to the software that we would create.

Reality:10716 ~ Blog 1 
Click the Pic to Enlarge!

One of the most common task that we're going to do at the industry is to maintain and improve upon existing software. Look at the code above. This is a small piece of code from the Business Logic (BL) Layer that basically shows some collection of information about the customer. According to my previous blog post about the N-Tier Architecture, the Second Tier is basically a bridge/police between the User Interface and the Data Store, transferring while verifying the data through a set of business rules/policies. Now, let' analyze the code line-by-line.

Line 174: The Business Logic code asked for a ComboBox as a parameter. The alarms in your head should already start ringing- there's something not quite right here. A Combo Box is something the user interacts with, and the bridge/police shouldn't have anything to do with it. Theoretically, what we need is the data- what's inside the ComboBox.
Line 175: It's normally unnecessary to put an entire function in a Try-Catch block. We should only catch errors that we can fix- errors that the business logic layer, or the layers below it, actually creates. Everything else should just bubble up to whoever can resolve the error. Of course, sometimes you need to do this when debugging the code, just to be sure.
Line 176 to 184: This is simply an initialization phase for the parameters that would be used by the next process. Trivia: It's almost impossible to have a runtime error here that the Business Logic layer can resolve.
Line 185: This is the connection to the Data Store. We should hold on to the data that this returns until the User Interface needs it.
Line 186: Here, we use an external object (service as clsService) to bind another external object (the ComboBox), passing the data that we got from the Data Store, which is readily available since the scope of the Set_Get_Lookup property is Public. Obviously, this doesn't belong here. It has nothing to do with any Business Logic, and has everything to do with the User Interface. Take note that one of the features of the BL layer is that we should be able to interchange different UIs easily (this design pattern is known as loose coupling) and by binding the combobox here, we are tightly coupling this part of the code to the current interface.
Line 187: Catch ex as Exception means you would catch ALL exceptions. I will say this again: It's good programming practice to just specify which errors you catch, then let everything else bubble up. The user interface usually has this kind of Try-Catch block, to notify the user that you've done everything you could've done, but the error is still there.
Line 188: This is an impossible line of code. Business Logic layers are normally compiled in a library (a DLL) and libraries, by their very nature, are “headless”. They should never have a User Interface, so calling a MessageBox here is a logical error.

Theory + Reality
10716 ~ Blog 2 
Click the Pic to Enlarge!

You can see in the sanitized and Diff'd code above the design patterns and theories which I applied. Specifically:

• Single Responsibility Principle. The business logic layer should have one, definite responsibility only: to act as a bridge/police for the data traveling between the UI and the Data Store. Don't let responsibilities bleed into other layers, or even other objects (also: avoid tight coupling).
• Load Once, Use Many Principle. You can find my blog post about the Lazy Initialization design pattern here.
• Better Exception Handling.

That's it! The first of the hopefully many posts in this series is complete, and I hope we've both learned a lot from these. Until the next post, sayonara :D

Post@Posterous? Or Not?



I have been reading Michael Scott's novel, The Alchemyst this last few weeks, and it inspired me to write a short story in the same vein- about teens using magic in the modern world. Aside from posting it in my DeviantArt account, I have also decided to post it in a new blog which has far more editing capabilities. Posterous.com has been making waves in the internet world this past few weeks due to their new features, and I decided to give the service a try.

First things first: The signup was mixed bag. On one hand, all you have to do is email your first post to post@posterous.com and you're automagically signed up. On the other, geeks and experienced bloggers usually set the site up before posting- and it took me a couple of seconds to figure out that the sign up form was on the login page, and not the front page. After that's done though, Posterous accepts OpenId which makes logging in a breeze.

After playing with it for a while, I realized that the site is a far, far cry from Wordpress, or even Blogger. While most Blogging platforms have focused on ever-expanding features, Posterous have focused on Simplicity (a bit like google). They sticked with a simple WYSIWYG interface for posting & editing- there's nothing new in post-by-email, and their autopost to social networks is subpar with what Wordpress offers- for example, you can't choose which link shortener you can use. Also, the initial Themes, while very customizable, are limited to about a dozen.

If the only service you need is a place to put your notes, thoughts or stories into, then you can't get any more simpler than what Posterous offers. Signup, then everything's ready to go- post away!

Note: Sorry I can't post more often and more concise. I don't have Internet Access at work (yet) so I don't have the same amount of resources as before~ I'll still try my best though, gambatte! w00t~

Two-Tier Or Three-Tier?


N by !Raimyu on deviantART

The N-Tier pattern, when used in software development, is one step above my usual topic of design patterns. They are commonly called architectural patterns which are concerned with the software at a macro level (eg. ‘the big picture’).

Some time ago, I was tasked before of maintaining a line-of-business sales system from a fairly large company.Their technical design spec was quite clear that the “…architecture is divided into three (3) main layers…” which, in theory, should make my job easier. As I browsed through the code though, one thing became apparent: It was not a 3-Tier Arch like the docs said, but a more traditional server-client setup~ Now, what is the difference exactly?

A Server-Client architecture (which is, technically, a 2-Tier Arch) is concerned primarily with the centralization of data and sometimes the balancing of process load to either the server or the client. The data and the business rules (stored procs) are stored at the server, with a thin client app to present the results (forms, grids & reports)- which is exactly how the LoB app above works.

S+C’s Advantages over 3-Tier Arch

  • Faster Development (less design, less code)
  • Can offload processes to the server to accommodate for weaker client workstations, or vice versa if the server is the performance bottleneck
  • Can change business logic without re-deploying new software to the user

Three-tier applications on the other hand, is focused on the separation of responsibility to facilitate control and change. The Data Access Layer is usually separated physically such as a Database Server, but is mostly kept “dumb” except for very few performance functions. The Business Logic Layer on the other hand is a more robust collection of libraries and maybe a few dynamic scripts that enforces the rules of the application. This ranges from who can access which data, data validation, up to caching, etc. Lastly, the topmost Presentation Layer is the combination of UI Rendering (Windows Forms, ASP.Net, WPF, etc.) and UI Logic (Parallel processes, Sessions, States, anything that is not business-related logic).

3-Tier’s Advantages over S+C Arch:

  • Modular, and thus easier to maintain. You can replace one layer with another completely with very minimal code changes (switch from Windows Forms to WPF or ASP.Net with zero impact on business logic or database schema)
  • can perform Unit Testing very easily. Since all of the business logic is contained on libraries, you can hook the DLLs easily on a controlled testing environment.

We have to consider both sets of factors above in order to decide which architecture to use when designing our software~

Job @ Honda/Isuzu

At exactly 8:00am GMT+8 tomorrow (10619), I’ll officially be an employee of Ayala Motors under their Honda/Isuzu team :D It’s nice to have a permanent job instead of just jumping around with freelance and open-source development stuff~

Fun Facts: I was without a permanent job for approximately…

  • 2 Months and 6 Days or
  • 9 Weeks (rounded down) or
  • 67 Days or
  • 1,608 Hours or
  • 96,480 Minutes or
  • 5,788,800 Seconds o.0;

Of course I will still try to contribute to the Open Community, but in the meantime (at least while I’m still on probationary status) I will probably limit my posts here. I still have a lot to talk about, in fact: I have a post about the Difference between CS and the IT courses and another post about Careers and How to Make/Break one. I will post both of them ASAP, but I guess its sayonara for now~ See ya :P

Hadou 91: Senjyu Kouten Taihou

Hadou91

Limit of the thousand hands
Respectful hand, unable to touch the darkness
Shooting hand, unable to reflect the blue sky

The road that basks in light
The wind that ignites the embers
Time that gathers when both are together
There is no need to be hesitant, Obey my order

Light bullet -
Eight bodies -
Nine items -
Book of heavens -
Diseased treasure -
Great wheel -
Grey fortress tower

Aim far away,
Scatter brightly and cleanly when fired

Thousand Hands Bright Sky Cannon

~Urahara Kisuke, Bleach 402

Motivation

Motivation is the fuel for your creative engine, so that you can reach your goals. Intelligence and creativity matters little if you are not motivated enough to use these gifts. Actually, some people argue that motivation is the root of being smart or creative.

However, not all motivation are the same. Being a Computer Science or Information Technology student, the rewards matter a lot. In fact, as the video below demonstrates, carrots and sticks (the traditional “more work == more reward” paradigm) have the opposite effect on tasks that require the algorithmic approach.

According to studies performed by world-class economists from M.I.T. & Carnegie Mellon: For simple, straight-forward tasks, the traditional “do this == get this” paradigm offers enough motivation. But for more complicated tasks that requires conceptual or creative thinking (eg. programming or information analysis), the traditional motivators does NOT work.

If this is true, then what drives us? Autonomy & Mastery

Autonomy is the desire to be self-directed. This is why programmers tend to clash with the management the most- because we are innovators, risk-takers, explorers, and most importantly: Scientists. We boldly go where no man has gone before.

Mastery is the urge to get better at stuff. The best musicians in the world play music for fun. Not for cash, not for fame. Just because its fun. Programming is the same- we want to be better programmers because we enjoy programming, and being better at it is immensely satisfying.hubble10-hp[1]

Look at Google’s Innovation Time Off: Engineers are encouraged to spend one day of their week to work on projects that interest them. The engineers decide (autonomy) to work on interesting projects (mastery). And from this model, a lot world class services emerged: GMail, Google News, Orkut, even Google’s primary revenue source: AdSense. Now THAT is how you motivate programmers.

Teaching Starcraft 2

Sometimes, we need to take a break. Enough programming, enough study, and just relax. But that doesn’t mean we can’t learn anything while relaxing :D StarCraft II: Wings of Liberty is a military science fiction real-time strategy video game currently under development by Blizzard Entertainment as a sequel to the award-winning 1998 video game StarCraft.

I am, and always have been, a Zerg player (“sspawn more overlordss”), and today’s little video will teach you some of the basics on playing starcraft 2, specifically a tactical play known as “Seven Pool” as well as some of the terms used in-game.

Btw, turn on the annotations ^^ So, a bit of a primer about the terms used in SC2:

  1. X unit/building – This means that when you get to population X, build the unit or building eg. 7 Pool (build a spawning pool at 7 pop.) or 12 Rax (build a Barracks at 12 pop.)
  2. Micro – Shorthand for ‘Micromanagement’, or selecting unit(s) and giving individual commands on each. This ranges from normal (Stalker blink, Zergling surround, Reaper evasion) to extreme (getting 3 harvesters on each resource)
  3. Macro – Shorthand for “Macromanagement”. To most players, ‘macro-ing’ means getting the most resources out of multiple bases ex. Getting an early expansion is a Macro move, or ensuring that each of your bases are saturated with just-enough harvesters.
  4. Tech, or Teching – Means getting upgrades, normally to get a certain unit eg. Teching to Hydras means getting gas and lair.

Ok, to recap, Zerg 7 Pool goes like this:

  • Game starts with 6/10 Population
  • 6 Drone
  • 7 Pool
  • 6 Queen (I made Lord+Drone here instead.. my mistake)
  • 8 Gas (Didn’t have to do this since I have an extra Lord)
  • 7,8,9 Lings
  • Attack
  • …
  • Profit!

I didn’t really follow the optimal build for 7 pool, and my micro needs more work. But you get the general idea~! :P This works great vs Terran or Protoss, but not against zerg since there’s normally an early Queen (on most builds) which can delay your lings enough for them to recover.

So, I guess that’s it~ I’m planning to create a new blog where we’ll post our ramblings w/ Starcraft 2, and yes, I said we. Guess who’s with me on this one? ^^ Until then, sayonara~

A look inside Letran: Teaching Programming Part 3/3

I totally agree with Jeff Jarvis’ points in the above video. Education today is a 19th century system struggling to cope in a 21st century world- it’s like using a steam engine to commute to work today. It has become apparent to me, that in Letran’s walls, teachers “stamp out students all the same way with only one right answer each… And so, that assumes that all the knowledge flows from the [lecturer], if you don’t feed it back, you’re wrong- you fail.” Its a system that kills the students drive to explore, to argue.

Inside the classrooms, discussions are always one sided- why would Letranites ask questions? Why would they argue? Not only is there zero incentive to do so, but I think arguing with the professor has been indirectly forbidden. How? Peer pressure can be a problem, or a teacher might have embarrassed someone asking a stupid question. Maybe the curriculum does not stimulate a students brain enough for them to ask any questions. In my opinion, more interaction is needed- we are training computer scientists here, and like the scientists of other fields they need to discuss and argue and experiment in order to challenge the norms and discover new things, eg. non-routine problem solving.

If you can compare side by side the curriculum of Letran (or even the other Universities in the Philippines) and MIT’s OpenCourseWare, Academic Earth, or even Youtube EDU, you’ll begin to see another problem. On all of the courses offered, their online equivalents are almost always better. Its more interactive, up to date and free. You can learn more online in a weeks worth of videos, than spending four years in a Philippine university.

As Jeff above said, the good stuff are already out there. We have to stop this culture, of standardized testing and standardized teaching.

PS. More good points from the video: Quizzes and Exams @8:46, Google did not spring from the lectern @10:45, We have to stop this culture… @12:30