0

Be Perfect

Posted by Erik Gaius,aka [ K i r E ] on Saturday, February 28, 2009, 6:36 PM in
PRACTICE! It goes without saying na cguro, na practice makes perfect (and Noone is Perfect, therefor practice makes you noone.. tama ba? Twisted Logic FTW!) Anywayz, para sa mga nagtataka kung bakit ako "Magaling sa Programming" pero ndi ganun kagaling sa ibang subject (Theo, PE, etc), simple lang nmn po ang dahilan..

Practice, Practice and more Practice.

Eh pano ko magprapractice eh wala akong time. Ano prapracticing ko eh pag nag open ako ng Visual Studio @home tinatamad na ko ndi ko pa nkikita ung workspace? Isa pa, wala akong maisip na magandang pagpractisang problem, at wala rin naman akong kilala na magchechek ng gawa ko..

Maniwala kayo sa hindi, ganun din ako. Ang pagkakaiba lng natin, salamat kay mam aloi at mam resi, narealize ko yan nung high school pa ko.. ^^

At ano ang naging solusyon ko? Hobbies. Mahilig akong maglaro *points at avatar* at un ang kumakain ng oras ko. Napansin ko na pwede kong paghaluin ung hobbies ko at programming.. example:

Nung naglalaro pa ko ng Magic Cards trny ko gumawa ng deck creator, at simpleng AI. Ngaung naglalaro ako ng Ragnarok, trntry ko gumawa ng ganito na updated.. luma na kasi sha so ndi narin magmit ng aus..

So maghanap kau ng paraan para makapagprogram habang nageenjoy. Kung mahilig kau sa friendster, pagkatripan nyo ung friendster profiles! Wag puro copy+paste, pagaralan nyo at gumawa kayo ng unique na profile! Kung mahilig kau sa Facebook/Meebo/iGoogle, try nyo gumawa ng Apps para dun! Simple javascripting lng nmn un, hindi ganun kahirap pero marami parin kaung matututunan.. ^^

Pwedeng magprogram habang nageenjoy~ Kailngan nyu lng magisip ng paraan kung papano.. so good luck, and happy programming!

0

So true...

Posted by Erik Gaius,aka [ K i r E ] on Thursday, February 26, 2009, 11:11 PM in

0

Multi-tier Architecture

Posted by Erik Gaius,aka [ K i r E ] on Wednesday, February 25, 2009, 11:33 AM in
Bakit kailangan ng isang software (project) ng isang architecture, or more specifically, Multi-tier Architecture?

Ok, definition muna: multi-tier architecture (often referred to as n-tier architecture) is a client-server architecture in which, the presentation, the application processing and the data management are logically separate processes (Wikipedia)

Isa pa: Normally may three "layers" or tiers sa isang multi-tier architecture: Ung Presentation, ung Business Logic, at Data access layers. Bakit pinag-hiwalay hiwalay? Para madaling palitan. Sabihin nang ung wesite nyo (as ung html) ay na reject, hindi kayo back to zero! Kung hindi pala supported ung database nyo, madaling magpalit nang hindi naapektohan ung Business Logic or Presentation layers.

Let's start with the Data Access Layer: basically, ung nag CRUD (Create-Retrieve-Update-Delete) ng data. Ung business Logic nmn ay ung part ng software na nagproprocess ng information. Lahat ng algorithms, automation at logic na needed pra mag process ng inforamation ay nsa loob ng business logic layer. Keywords: 'needed pra mag process'. Ibig sabihin, ang core functionality (ang mga pyesa na hindi pwedeng mwala sa project mo) ay dapat nsa business logic layer. Everything else, such as pagsasave ng recently opened documents or effects sa user interface ay dapat nsa topmost layer na: ang Presentation Layer - which is the layer na nakikita ng End User, such as the website or the application's user interface.

So, Bakit kailangan ng isang software (project) ng isang architecture, or more specifically, Multi-tier Architecture? Dahil pinapadali nito ang pag mamanage ng project by splitting it into modules na madaling palit-palitan. ^^ Gets?

0

Supido-testo ^^

Posted by Erik Gaius,aka [ K i r E ] on Tuesday, February 24, 2009, 12:22 AM in

This is the maximum download/upload speed of PLDT myDSL ~__~

0

80:20 Rulez

Posted by Erik Gaius,aka [ K i r E ] on Monday, February 23, 2009, 2:42 PM in
REMEMBER TO COMPENSATE FOR THE 8020 RULE! ~ Cguro ndi to mgiging tips pra sa mga lower years, pero para sa 3rd yearz and above, pay attention! Kung maliit lng ang program na gngwa muh, ndi to applicable, pero kung malaki (Such as your thesis, or a professional project) matututunan mo to sa ayaw o sa gusto mo..

"80% of the Project will be done at 20% of the Time."


Ano ibigsabihin nun? Nosebleed ba? ^^ Eto: Kung sa tingin mo kaya mong tapusin ang 80% ng project mo in 1 month, matatapos mo yan 100% in 5 months.

WTF?! Oo. Ung natitirang 20% ng project mo ay kakain ng 80% ng total project time mo. Bakit? Design ng UI + Debugging + Extra Features. Babalik at babalik ka sa tatlong yan na parang naka infinte loop..

Kung malaki ang project mo, tantsahin mo kung gano katagal bago mo matatapos un ng 80% Complete. Tapos iMultiply mo by 5 un, pra malaman ung Project Completion date mo. Oo, parang mahaba masyado, pero mabuti na ung safe kaysa matutunan mo tung 8020 Rule the hard way..

0

Weekly Links

Posted by Erik Gaius,aka [ K i r E ] on Sunday, February 22, 2009, 8:30 PM in

Posted from Diigo. The rest of my favorite links are here.

0

OO VB.Net = Leet Speak?

Posted by Erik Gaius,aka [ K i r E ] on Saturday, February 21, 2009, 5:16 PM in
Kasi ganito un: Himay himayin natin.

Object-oriented programming is a tecnique - isang paraan para mapadali ang pagsusulat ng code. Visual Basic is a language. A programming language, but a language nonetheless. Parang English, or tagalog. Ibig sabihin, Object-oriented Visual Basic is like speaking in tagalog, pero may konting pagkakaiba, like may ibang punto or paglalagay ng -dattebayo sa dulo ng bawat sentence (just like naruto ^^)

Pano naman ung dot Net sa dulo?

Sabi nga sa programming 101, hindi nakakaintindi ang computer ng English or Tagalog. Dpat Binary language or one and zeros, at ung dot net sa dulo ang pinaka "translator", from english (or in this case Visual Basic) to Binary.

So, Object-Oriented Visual Basic.Net = Australian English from Google Translate to Chinese.

Gets?

0

Equals Not Equal?

Posted by Erik Gaius,aka [ K i r E ] on Friday, February 20, 2009, 12:51 PM in
USE THE FORCE este.. USE THE EQUALITY OPERATORS! Cguro etong equal sign na ang pinaka gamiting symbol pag nagproprogram keo.. Pero hindi lang pang set ng values ang equal sign! Pwede rin syang gawing OPERATOR, parang addition or subtraction sign!

Actually, kung tama ang pag gamit mo sa equal sign as an operator, magkaka performance boost ang program mo.. although ang kapalit nito ay konting readbility issues (meaning, kung hindi alam ng bumabasang programmer tung technique na to, bka malito sya..) try natin:

Ex#1) Isang common scenario: check if equal, then true, else false. Ilang beses ko na ba to ginawa sa mga MPs..
If X = 7 Then
myBoolean = True
Else
myBoolean = False
End If
Pero using equality operator, pwede ring ganito..
MyBoolean = (X = 7)
ieEvaluate nya muna ung nsa loob ng parethesis, which is basically 'Is X equal to 7?' at mag oOut ng boolean.. medyo nkklito dahil parang twice ka nag set ng value, pero tandaan nyo parati na ang nasa loob ng parenthesis ay palaging nauunang iEvaluate.. isa pa..

Ex#2) Kailangan mong bilangin kung ilan ang "True" between a small number of operations.. Medyo mas komplikado sa first example, pero same principle.. eto ung normal code
If X = 10 Then
i = i + 1
End If
If Y = 10 Then
i = i + 1
End If
If Z = 10 Then
i = i + 1
End If
If W = 10 Then
i = i + 1
End If

debug.write i
That's 13 lines of code, between 4 conditional statements at isang counter variable. Pansinin nyo na apat na beses na syang gumamit ng equality operator, pero pwede pa natin paiksiin to..
i = -(X = 10) -(Y = 10) -(Z = 10) -(W = 10)
WTF?! 1 Line. 4 Conditional statements, at hindi nagbilang ung counter natin, nag subtract lang. gagana kaya to? try natin...

i = - True - False - True - False
i = - (-1) - 0 - (-1) - 0
i = 2

At tama nga! May dalawang true sa pinagpiliiang apat na operations! ^^

Eto pa mga extra tipz:

Ex#3) Need mo ng "check box effect", at integer ang napili mong lalagyan ng variable..
If myInteger = 0 Then
myInteger = 1
Else
myInteger = 0
End If
pero mas mgnda siguro kung ganito:
myInteger = 1 - myInteger
Same effect yan. Kung 1 ung initial value, magiging 0 (dahil 1 - 1 = 0). Kung 0 nmn ung initial value, magiging 1 (dahil 1 - 0 = 1). Aus no? pero ndi lang yan..

Ex#4) Need mo ulit ng "check box effect", integer ulit, pero ang pagpipilian ay 1 at 2..
myInteger = 3 - myInteger
Kta nyo ung pattern ng "check box effect"? Ang tawag dyan ay toggling.. as in toggle..

Disclaimer: Baka hindi gumana ung example #2 sa linux systems.. baliktad kasi ang true/false values dun! Try nyu nlng, hindi ako sure...

Edit: Pahabol! Simple toggle kung boolean ang variable mo:
myBoolean = not myBoolean

:D :D

0

Weekly Wednesday Siege Update!

Posted by Erik Gaius,aka [ K i r E ] on Wednesday, February 18, 2009, 11:07 PM in

Above: Ryan, aka DragonHeart, lured 7 guardians to the entrance of our primary agit (Schiet).
Below: The next two screens are from the final Clash with KoJ at Mardol Agit, about two-three minutes before Siege End.


Below: Siege Ends. The Impulse Guild got two agits, although our allies (Delta Nu + Restricted) didn't score any :(

0

Recycling is Good!

Posted by Erik Gaius,aka [ K i r E ] on , 9:05 AM in
REUSE CODE! Isa to sa mga natutunan ko nung nagthethesis pa ko sa dyan. Kasi, website ang thesis namin, at siguro mga kalahatin buwan rin ako nagcocode ng Authentication system. Ung kapag naglolog in, parang sa friendster. Eto ung feature list nya dpat: Syempre dpat ung back end (ung database part) ay encrypted tapos ung front end (ung website mismo) dapat pwede baguhin ung components (font ng labels, size ng textbox, kulay ng panel, etc.)

Nung napagana ko na ung code, tska ko lng nalaman ung ASP.Net Login Controls. As in, kumpleto sha, with themes, encryption support, lhat lhat na. At drag-and-drop lng ang ginawa ko. wala pang limang sgundo, lumitaw lhat ng pinaghirapan ko ng dalawang lingo at marami pang other features.

So, before magcode, check nyo muna kung existing na ung trintry nyu. Always protoype before coding.. Hindi ko pa kasi alam ung Code Like a Samurai creed (see last TnT) kaya pinag sabay ko ung Design at Development. Siguro kung inuna ko ung design, makikita sa research ko ung ASP.Net at mababawasan ang nasayang na panahon sa development..

Disclaimer: Hindi masama mag reuse ng code (meaning, kinuha mo ung concept), pero masama mag copy+paste ng code (meaning, word for word) UNLESS open-source ung program.. which means dpat mong bigyan ng credit (imention) ung owner nung code.

0

Typical Day at Work...

Posted by Erik Gaius,aka [ K i r E ] on Monday, February 16, 2009, 12:21 PM in

0

BANZAI!

Posted by Erik Gaius,aka [ K i r E ] on , 9:53 AM in
CODE LIKE A SAMURAI! Sa letran, tuturan keo na dpat ang isang MP (Machine Problem) ay dapat tapusin ASAP. So, ang ginawa natin ay diretso code, sbay na ang prototyping at error-correction and most of the time kung ano ang prototype un narin ang final build. At syempre, wlang refactoring & optimizations..

Hm. Ok, siguro ako nlng ang nka intindi ng mga sinabi ko (4 da curious: google Software Engineering)

Pero basically, hindi dapat ganun. Bad practice un, at kung gagawin nyu un sa thesis nyo (or worse, sa labas ng letran like your professional work) patay kau. Ang hirap idebug ng ganung klaseng code, lalo na pag mahaba na. Makakalimutan mo ung mga code na dapat ay tapus na. (un pala ay hindi pa)

Ano ba dapat? Sino dito nkapanood na ng mga anime na may mga samurai? Diba mapapansin nyo na pag nagduduelo sila, nkatayo lng sila, pinagaaralan ang kalaban and after a few minutes, BAM! Isang mabilis at madugong sword slash, saby mkakangiti pa ung kalaban bago sya babagsak... hahaha

dpat ang programming ganon din:

Design. DEVELOP ONCE. Debug.

Isulat sa papel ang features para hindi makalimutan at HINDI MADAGDAGAN. Kung ano ang nsa papel, un at un lang ang dpat features. Focus, Less Code = Less Errors (See last TnT) Kung hindi ka sigurado kung kaya mo, gawa ka ng prototype ng prublema mo. No user interface, kung pwede sa Debug Console lang, mas mganda. Wag mong ipagpatuloy ang prototype - pwede kumuha ng code dun, pero hindi un ang final build.

Pag ok na ung design, DEVELOP ONCE. One strike lang dapat. Isang pasada. Hindi ko sinasabing tapusin mo ng isang araw. Pwedeng isang buong lingo - pero dapat focused ka sa coding. Kung may gusto ka idagdag, WAG, unless kailangan talaga - kung hindi life & death, WAG.

At syempre, kung hindi kaya, pwede bawasan ang nsa design. ^^ Pagkatapos ng madugong duelo, wipe yer sword and walk away like a samurai.. (pero wag kakalimutan mag debug!) wahahaha :P

0

Weekly Links

Posted by Erik Gaius,aka [ K i r E ] on Sunday, February 15, 2009, 8:30 PM in
Posted from Diigo. The rest of my favorite links are here.

0

Dekaron: First Look

Posted by Erik Gaius,aka [ K i r E ] on Saturday, February 14, 2009, 10:19 AM in
Last Wednesday siege (Philippine Ragnarok Online, Valkyrie Server) Medyo na bore ako before siege nung napansin ko na naglalaro ng Dekaron ~link~ ung katabi ko sa Vicious Computer Shop (tabi ng Letran). Medyo na curious ako dahil prang World of Warcraft ung quest system nya (Instance Dungeons) so nag register ako at trny ko for a few minutes.

Una kong napansin ung graphics nya. Detailed, more than perfect world pero less than RF Online.. although medyo biased ako sa RF ^^


Pangalawa kong napansin na hindi pwede mamili ng gender. Lahat ng Melee class (Azure Knight at Bagis) pati ung Summoner (Vicious) ay lalake lng ang pwede, ung Ranged Class (Segita Hunter) ung Mage (Incar) at ung Healer (Segnale) class nmn ay babae lang. At ung Segnale ay mukang DPS class dahil sa description nya na "Assasins", so un ang ginawa kong class. Natuwa nlng ako nung nkita ko na ung skills nya ay curses at buffs ~_~

Napansin ko rin na kahit may tatlong subservers (iisa lng ang server nya) ndi mo mkikita ung latency (lagness factor) until nkapag log in ka na. Ung laman ng subserver hindi ko alam kung papano mlalaman (may /who kea d2?).. so hindi ko matantsa kung ilan ang naglalaro..

Pero naubusan na ko ng time dahil nag start na ang siege after ko mkpatay ng ilang spiders (at ng level ng isang beses) so this sbado (after grad skul classes) na tripan ko ulit itry. Btw, nka whip ang Healer Class d2. ~_~

ROUND 2:

I researched around the net (nghahanap ng mgndang build) at nagdecide akong mag new game. Azure Knight nmn. Medyo na trauma na ko gumawa ng girl na character, ndi ko ksi alam kung papano magpapakilala pagdating ng EB ^^ nweiz, parang mgnda mag 2-Handed Mace na offensive melee.. May stun AoE ksi.. prang Wiz ng pRO na nka BG Wand..

note: Nag drop yta sha ng Ancient Wand, worth 3 DIL ~_~

At this point, medyo naasar ako sa config files ng Dekaron dahil wla dun ung Window Mode. Dpat tlga maglog-in bgo mo mpalitan ung settings. Nag decide ako gumawa ng 30 min. acid test, ng Azure Knight character (name: GodEmperorKyre, same as my Crusader in pRO). Eto ang aking log:

11:00am - Start creating a character. Badtrip dahil AlphaNum Characters lng pwede. Bwal Space, or special characters..
11:03am - Online, currently at Braiken Castle (One of two starting points ~ More than one startpoint is good, but pRO has 5.. RF only has 1 though)
11:06am - pressed M for map, at natuwa ako sa search NPC option ^^ nice. Pumunta agad ako sa Knight Weapon Shop, at natuklasan na 1. Pang level 2 ang unang mace, at 2 wala akong pera ^^
11:08am - got out of Braiken ^^ Spider hacking time!
11:10am - level up! Going back to Weapon dealer... don't have enough DIL (currency).
11:18am - got to level 5.. going back to weapon dealer. The in-game help was.. helpful ^^ discovered that skill points need to be purchased first.. Also, the first 2-hand mace is level 18, costing 1312 DIL. I currently have 172 dil.. ~_~ Anyay, got myself a Mace (dalawa binili ko, ung pang lvl 2 and pang level 7) Adjusted stats pra maequip sila.. Found Skill Master.. medyo mura ung starting skills.. ^^
11:26am - levelling mode.. Hindi pla pwede mag pa learn ng new skills until level 7 ~_~ Noticed that Regneration of HP/SP is far greater than in pRO
11:31am - got killed by a spider soul ~_~ respawned in 10 seconds.. didn't notice any changes in Exp or Inventory ^^
11:33am - it seemed that conversing with the Knight Skill master triggered a quest. Finished it unknowingly by killing 10 Spider Larvae. Time's up: Final Level is 6..


Note: No "Battle Mode", meaning limitado ang skill slots. Medyo korni dahil andaming skills (take note: melee ako. pano pa kea kung mage..)

So, nag enjoy nmn ako sa aking paglalaro ng Dekaron. Medyo hindi pa ko nakukumbinsing idownload sha sa bahay.. maybe after a few more battles.. ^^ Anyway, maganda nmn sha, no lag, decent graphics at normal gameplay.. wla pa kong nkikitang extraordinary.. I'll post moar after a while, so stay tuned! ^^ In the meantime, HAPPY VALENTINES! ^^ Hihihihi

ps. a very informative Azure Knight FAQ.

0

Assuming.. TnT

Posted by Erik Gaius,aka [ K i r E ] on Friday, February 13, 2009, 3:00 AM in
Sensya na, absent akuh khapon.. nsira ksi keyboard kuh ~_~ Anyway, here's the programming tip of the day: Never Assume! Eto guilty ako dito: palagi kong iniisip kung ano ang susunod na mangyayari. Gumugulo tuloy ang code..

Sabihin nang kailangan mo ng function na marunong mag add:
Function Add(X as int, Y as int) as int
Return X+Y
End Function
Pano kung may decimal ung ininput? Dpat siguro double ung data type..
Function Add(X as dbl, Y as dbl) as dbl
Return X+Y
End Function
Mas magnda siguro kung hindi lng addition ang kayang gawin ng Function ko..
Function Solve(X as dbl, Y as dbl, op as str) as dbl
Switch op
Case "Add": Return X+Y
Case "Subtract": Return X-Y
Case "Multiply": Return X*Y
Case "Divide": Return X/Y
Case Else: Return Nothing
End Switch
End Function
Ano ba yan, bad programming practice ang gumamit ng string sa Switch Case... dpat Enumerated Type!
Enum Operation
Add
Subtract
Multiply
Divide
End Enum

Function Solve(X as dbl, Y as dbl, op as Operation) as dbl
Switch op
Case Operation.Add: Return X+Y
Case Operation.Subtract: Return X-Y
Case Operation.Multiply: Return X*Y
Case Operation.Divide: Return X/Y
Case Else: Return Nothing
End Switch
End Function
Wahh, pusible mag Divide by Zero! dpat may error checking..

And so on and so forth.. after 10 years, nag dedebug ka parin ng code.. kahit na ang kailangan mo lang talaga ay eto:
Function Add(X as int, Y as int) as int
Return X+Y
End Function
E papano kung nangyari ung isa sa mga scenario sa taas!? Edi tska mo ayusin. Cross the bridge when you get there ika nga. Focus lang, tandaan nyo: Less Code, Less Errors, More Fun!

0

What the...?

Posted by Erik Gaius,aka [ K i r E ] on Wednesday, February 11, 2009, 11:28 AM in

0

Use Tabs~!

Posted by Erik Gaius,aka [ K i r E ] on , 8:53 AM in
Let's start this blog with a sweet and simple tip: Isa sa pinakamadaling paraan para malaman kung naisara mo na ang isang statement ay ang pag-gamit ng TABS.

Example:
for i = 0 to 10
if i < 5 then
debug.write(i)
else
for j = 0 to 10
debug.write(j)
next j
next i
Looks bad, doesn't work. Try ulit natin w/ Tabs.
for i = 0 to 10
if i < 5 then
debug.write(i)
else
for j = 0 to 10
debug.write(j)
next j
next i
Better. Makikita mo agad ung double tab sa second to the last line, meaning hindi mo naiclose ung if-else statement mo ng 'end if'. I think na starting from Visual Studio 2008 ay automatic na ung tabs, at napakalaking 2long nun lalo na sa mga besprend ni 'Syntax Error'.. hehehe

0

First Post!

Posted by Erik Gaius,aka [ K i r E ] on Tuesday, February 10, 2009, 11:05 AM in
Konnichiwa! :P Ahahaha

Hello at magandang araw sa inyong lahat, sa buong mundo, lalo na sa mga estudyante, at dating estudyante ng Computer Science courses! Ako nga pala si [ K i r E ], isang filipino self-proclaimed Dot Net Software Developer (Mas gusto ko sna ung title na 'Software Engineer' pero may course daw na gnun XD ), at eto ang aking Blag. 

Ano ang makikita sa blag na ito: 
  • Programming Tips & Tricks ~ Cguro every other day or so, mag popost ako ng tips & tricks about generic programming.. pag pasensyahan nyu na kng medyo pang college level ha! ^^
  • New Cool Thingies ~ Para sa mga curious kung ano ang trip ko while surfing the net, once a week mag popost ako ng links ppnta sa mga trip kng sites.
  • Under Development ~ Minsan may mga prinoproject ako just for fun, ipopost ko rin un d2. Btw, ang preferred language ko ay Visual Basic 9.
  • Impulsive Gamer ~ Ragnarok Online, Magic: The Gathering, etc. etc.. :P
  • Life ~ Tulad nitong post na to, walang kinalaman sa programming ^^ 
Btw, halos lahat ng makikita sa blag na ito ay naging pusible sa tulong ng mga sumusunod na teknolohiya (amfufu, kamusta nmn ang tagalog ko)

Un na yta lahat. I uupdate ko nlng to kung kinakailangan, pero sa ngaun, maraming salamat sa mga services na yan. They made this blog possible. ^^

So, kita kitz nlng tau bukas, stay tuned right here at dot net, dot ph, dot blogspot, dot com! Ciaossu! Ahahahahaha

Copyright © Gains & Hart Co. 2009 .Net.ph All rights reserved. Theme by Laptop Geek. | Bloggerized by FalconHive.