The Cardinal Codez

Thursday, June 28, 2007

The End of Kira






Whoa, finally, Death Note ends. I totally dropped the show right after Light dies. I believe the climax lasted until a bit after Misa Misa appeared. Second Kira was rather intriguing, for a while. Then Light legalised himself with Ryuzaki and it went all downhill from the silly Four Leaf Corporation thing.

But the ending was awesome. I didn't really get the part about Near's blah blah explanation. It's too repetitive and long and in actuality, just a bunch of coincidences. Near could have very well lost. It's just a stroke of luck, and not as Near, Light, Mello, or even Ryuzaki said, logic. Which is why I started hating the show. The mangaka made them seem smarter than they are, but their explanation stinks and has loopholes all over.

Anyway, I'm, for once, extremely delighted they changed the ending of Death Note. I'd my manga beside me and checking those last moments of Light, and man, they did change a lot. But for the better.

Light now dies a much more decent death. At first, his running away, I thought he's gonna die somewhere secluded, begging for mercy with Ryuk. But Ryuk did not even appear to Light at all. Light ran as far as he could, while Ryuk wrote his name, out of sight. Then Light died peacefully on top of a stairwell while a beam of light shining down. And OMG, Light "saw" Ryuzaki as he closed his eyes! Awesome scene to add in. The final conclusion on what had always been a battle between Light and Ryuzaki. Light died peacefully. The only one to do that, apparently, from the effects of the NoteBook. The only other person to die peacefully, but not from the Notebook, was Light's father. But then again, Light was pestering his father for the name while he's dying, so not exactly peacefully. But at least painless.

They also showed Misa Misa standing on the edge of a high plateau. Did she commit suicide? We all know she didn't in the manga. But all things considered, that was a pretty nice ending. Questions left unanswered. Protagonist died nicely. Antagonist (L) appeared in death hallucinations. Last remaining Kira: Dead or Alive? Pretty good.

All much better than the silly ending of, the world went on normally, sort of, without Kira. And a bunch of Kira devotees forming their own pitiful little sect someplace far away. And Light begging for help in front of Ryuk when he died.

Well that's that. End of Death Note. It was nice while it started and ended.


Gash is on crack.
Konjiki no Gash Bell rocks!! Don't say it ain't.


1. Konjiki no Gash Bell OP3 [Mienai Tsubasa] - Tanimoto Takayashi
2. Bad Day - David Powter
3. Bleach OP6 [Alones] - Aqua Timerz

Tuesday, June 26, 2007

CTs


It makes a pretty big difference. Whether or not if you've felt you've tried your best, compared to if you think you could have done better.

IMHO, I know that if I am aware that I'd just wasted time away doing nothing when the CTs is like tomorrow, or two days later, I'm in depression mode. Which is like, during the CTs, in moments of utter despair, my finger will be resting on the "To Hell With Everything" button. Which also can be rationalized. Didn't spend enough time revising it. So, 理所当然地, of course I can't do this question. And most probably flunk the paper. Then I'll take a breather, and just take a break. Surely, with 15 minutes left, and so many questions remaining, I can't possibly make a difference. What's more about those questions I quickly glazed over with cheap shot answers?

Mmm, but if I think i'd tried my best the previous day, I'll try my best to do the paper. It's not like I'm condemning myself consciously or whatever, it's just so depressing when you find something you can't do, but are supposed to be able to do, and you know the reason is because you didn't put in as much effort.

Thus far was pretty successful. Stayed off the computer for most of the day, except directly after the CTs. Fatigue helped a bit. I was thinking that, being so knocked out after studying and the test, I couldn't possibly muster enough energy to do anything fun or interesting at all. So.... might as well, spend some more time staring at the chemical compounds and something good might come out of it. Or ... sleep. Which I did, right on time at 10.30pm thus far. Meh, can't stay awake any longer. And also, my belief is that, it's better to sleep early, than to stay up late studying. Which i think is proven, for my case, that I got totally knocked out after every major test. Just feel like slumping over for a nap.

Bah, Chem is rather dead now. Econs is okay. To my dismay I found out that studying 3 weeks before, no, even 1 week before, is not exactly long-term memory stuff. Thus far, for Chem and Econs I keep doing last day rush to cover EVERYTHING again. For Chem I gave up at Nitrogen. 20 topics is too much. Econs I barely made it. The part I didn't quite make it was monetary policy for Singapore. Especially the crap about some trinity rule about cake and not eating cake. Last minute revising is all about refreshing memory, not about sorting out questions. Don't know, skip.

.. Just spent 8 minutes working out a 2 mark Summation question. =( I suspect it's 2-mark because supposedly you can use your GC and trial&error to figure out the answer. But nah, it's more satisfying, in this case, to just write the whole thing out by hand, and say, Damn you, I worked the thing out using logic not trial&error.
And as you can see, I'm not a big fan of Primary School Trial&Error stuff. Every question should have a logical derivation and solution behind it.

Just watched some oldie show on Ch 8. It replaced the rerun of 喜临门. Both of which are pretty nice shows. But I like this new oldie rerun better. 野蛮亲家. Thought that was a Hong Kong Chinese drama? Anyway, maybe I like it better because of the senior actors. I find them easier to remember, recognise, and their acting is way better. The new ones, meh, they all come in from mainstream OMG IDOL! or some other talent contest with not so convincing acting. They don't have much of their own unique style at all. With the exception of that female actor - the one that's appearing on the soyabean commercials or something. The bowl-shaped Hinata-Byakugan hairdo type, that is way too enthu. Which is kinda good, since she's like, instantly identifiable. Stands out among the other new actors who's more like hired by-standers than anything. Meh, even any old uncle/auntie that was dragged onto the set for a one-off appearance give off a more convincing and amiable feel compared to new actors.

The new show, 幸运心, 看起来似乎蛮好看的. 或许又是因为 范文芳 是情节的主角吧? 但是, 有经验, 演艺有不错, 加上一个 "大概" 刺激的童年爱情情节, 我蛮期待的. 那是, 若我能记得收看的话... 矣, 还是觉得旧一代的演员有料. http://ch8c.mediacorptv.com/shows/variety/view/887/1/.html Meh, especially the people who appear in the photographs there, damn memorable. I'm a fan of Mark Lee. =D


Gash is on crack.
Konjiki no Gash Bell rocks!! Don't say it ain't.


1. Konjiki no Gash Bell OP3 [Mienai Tsubasa] - Tanimoto Takayashi
2. Bad Day - David Powter
3. Bleach OP6 [Alones] - Aqua Timerz

Wednesday, June 20, 2007

Progress


Bah... Title's getting more meaningless by the day...

Results are good. I don't know, I just like having some feedback on whether the current situation is effective or not, and then tweak on them. Kinda like programming. Run the program, see whether there's any problems, then tweak configurations.

I like it best when I run my program and something happens. Anything happening is good. Even errors. At least they tell you something is wrong. Whenever I run my program and I get no errors i get kinda unnerved by that. The code can't be perfect, I'll think. It's never that way. If an error happens, great! That's one less error. The probability of another error is now lower. (Wait, is that correct?)

Runtime errors are like hit-and-miss. 'Cause runtime errors only appear when the program is running. Your code is grammatically correct. But unfortunately something's wrong. Maybe a careless mistake, forgetting to do some calculations? Put a plus sign when it should have been minus? Got the logic completely wrong (which would be a mathematical logic error then)? So like, if it happens on the first try, that's awesome. It's all luck most of the time, catching a runtime error. Sections of code never get accessed until later later later. Then it gives a wrong value and that mistake multiplies itself a dozen times over and it looks like your entire program's gone bonkers.

Not really doing very well art-wise. My art, is sucky again. Was it not sucky before? I'm not too sure. I do pretty well on reference pictures but drawing stuff on my own is really hard. I'm practicing on Naruto, since Masashi Kishimoto really draws very accurately and life-like. You can see it in the way he does different poses and the sceneries in Naruto.

Academic-wise.... not so good. I was supposed to do one subject each week. Econs was marvelous, finished with the weekend to spare and slack off. Chem was pretty good, I was on Carboxylic with 2 days to spare. Then I don't know, maybe I slacked too much. The remaining Nitro and Phys Chem took up an entire extra week. So I have 1 week left for Maths and Physics.

And Maths, unfortunately, was much harder than i expected. I thought I had vectors nailed down pretty good, since I was doing vectors in 3d programming. But... apparently not. The only thing I could remember was cross-product. That's all. Had to re-revise LOP and the foot of perpendicular stuff all over. And Power Series, Mathematical Induction was a headache. And I discoursed to study a bit of Integration. I suspect I might have to discourse again to study P&C - can't remember anything either.

Crap, not going to make it in time. I never do, lately. I really need to get down to doing my own notes for each subject. Perhaps I'll dedicate two hours per day after the CTs mugging, I don't know, it doesn't seem enuff to cover everything, and I don't think I have enuff time for Computer AND mugging at the same time...

BAAAAHHH I rly underestimated Chem, Maths, and perhaps Physics... Too long, too deep. And screw it, I spent a week watching D.Gray Man. Awesome show, much better at sticking at the plot of exorcising the rogue undead to save their souls, better than Bleach is. Bleach is just a sorry excuse for endless battling. Really, the entire, omg, scary hollows thingy with mystery and suspense just completely disappeared from Bleach when Byakuya and Renji appeared to slaughter Ichigo. Now everyone's just fighting humans. Well Death god humans and humans with a hole in the stomach.

D.Gray Man is much better at the suspense thingy. 19th century Gothic Exorcists, fighting Akumas, which are produced when a loved one calls for their late one's souls, and implanted into a skeleton mesh by the Millenium Earl (demon). It's fun guessing who's the demon in disguise each episode. Much less obvious than Bleach where everyone goes around annoucing their names and leveling up. WTH, Byakuya said Bankai was only available to the nobilities who get their name engraved in teh history of Soul Society or something... wasn't catching much when watching 8 episodes a day. But now, everyone can Bankai. WTH... Even noob medical shinigamis can Bankai?! (who's the guy with the scapel Bankai, konohamaru or something like that?)


Gash is on crack.
Konjiki no Gash Bell rocks!! Don't say it ain't.


1. Konjiki no Gash Bell OP3 [Mienai Tsubasa] - Tanimoto Takayashi
2. Bad Day - David Powter
3. Bleach OP6 [Alones] - Aqua Timerz

Saturday, June 16, 2007

New tools


It's tough maintaining two blogs at once, one here @ cardinlee.blogspot.com and another one @ cardinal4.byethost2.com.

Especially if most of the posts I have to post are about techno stuff and, obviously that goes into teh techno blog, but then again, maintaining formality is bloody suffocating, so maybe it should go in this one... It's hard to choose.

Then i go around regretting my decision to create a new blog. Then i immediately stop myself, 'cause it's still not too late to trash the new blog and merge it with this one here.


It was fun going into a bookshop. And very headache also.

Everytime I enter a bookstore always feel like wanna buy something like that. NO not assessment books! Only someone muggerish will do that.

But always feel like buying stationary. (and manga of course) Especially the artist kinda pencils. Y'know, 2B, 6B, HB.

At first was normal lead pencils. After collecting a small set of 'em, in denominators of 4B, eg. I got HB, 2B, 4B, I wanted to get the entire set. They had these pencil sets of 4H all the way to 8B. Very cool.

I didn't buy that. Instead! I bought a 4B mechanical pencil lead! It's nicer, never gets blunt like a pencil, but still sharp and dark enough. But i don't know how to use it though. I keep changing in between 4B and 2B for sketching. Now I cant be bothered. Sure the texture and tone is different but that hardly makes a difference when all you're doing is a sketch. A v.bad anime sketch. Ah but i try to make an effort to use 4B, leaves a lighter mark on the paper: I draw quite hard sometimes, especially when frustrated.

Right, I wasn't stopping at mechanical pencils. Wanted to buy a nice pen for inking. At first I was sure I was gonna get a ballpoint. One of those cheap Pilot pens with no name. Or Uniball Laknock. Absolutely perfect for sketch work. Yep, ballpoints CAN do sketch work quite nicely. But most of the time you screw up on the pressure and that's it, the drawing is done for. And anyway, inking is meant to be hard, no? So i tot about getting those leaky type pens. Uniball Signo DX is like perfect. Comes in sizes .38 and .28, works brillantly. I have those right now on my table. But i nv use a pen so far for inking. Beats the purpose of inking later on the computer.

Well then, I decided to buy some color pencils. I can colour something on paper faster than on screen. I wanted Faber Castell Water Soluble Colour Pencils pack, the 36 colours one. But ran out of money. And again. And again. Then got lazy and decided not to take the long trip and walk to Popular. So till now, no colour pencils. But great thing that procrastination was, 'cause now I felt not like buying it anymore. IF I'd did that would be a waste of $$$.....

Yup, anyway, I kept thinking that having new tools, new pencils, new colour pencils would suddenly imbue me with magically manga abilities to produce clean and sexy artwork instantly. Took me a while to realize that, and how stupid that was.

'Cause I was like, at the Clementi book store today. The one close to the NTUC. The corridor of shops where you walk down got Bank, Dental, Four Leafs, PhotoGallery, then McDonalds, KTV one. They sell lotsa lotsa brand new computer books. And electronic circuitry and accounting books too. Pretty darn ex too. Just grab any one book from a NLB branch in the computing section, it's about USD 49.90 sometimes. 'Course, the books can go up to $500 since they're like Uni Textbooks anyways.

Anyway I was wanting to buy some books, like on CSS, PHP, C++ or C#. I wanted to improve those areas, see. Then I was like, why buy them, I could get the same info online with a bit of Googling for online tutorials. But still I wanted to buy them. Then I was like, why buy them still, not like I'm actually gonna read them, am I? I'll never have time, I never have. Then I realised, wth, I'm buying them 'cause i figured they'll make me a better programmer. WTH? Just because I buy some excellent books on C++ doesn't mean I'm gonna be a whiz on C++ instantly. If I'd never bothered to look for info on it to learn, I'll never bother to read it even if I bought it, but i wanted to buy it because i tot without reading much it'll make me smarter.

Rite, confusing, but anyway, I'm not buying any stuff. Or books. I'm an emotional spendthift, absolutely believing that I need a particular item on occasions of 'enlightenment' where I realised something was missing in my life.
But then, when i get a little bit more rational, I question every thing that I would be buying, and whether that was utmost neccessary or not. =) So flippant.


Gash is on crack.
Konjiki no Gash Bell rocks!! Don't say it ain't.


1. Konjiki no Gash Bell OP3 [Mienai Tsubasa] - Tanimoto Takayashi
2. Bad Day - David Powter
3. Bleach OP6 [Alones] - Aqua Timerz

Monday, June 11, 2007

Shareware now...


After having been not actively coding for more than 2++ years now, I loaded my long-time favourites HTML-KIT and PHP Designer 2006, to find updates!!! WOW!

"I love updates, everything is gonna look so fresh and sparkly!!!"

Then well, ya, I realised that the new versions have turned shareware, instead of being freeware. HTML-KIT bars you from downloading the latest version completely. PHP Designer offers a Personal Edition, whose stripped down features just leaves one feeling a bit less than satisfied.

Whatever in the world happened to the Open Source Spirit?! And especially these two popular code editors... I'd never would have guessed that this would happen.

I have Dreamweaver 8 installed, but it doesn't quite support CSS 2.0 nor does it support PHP at all. Dang, what am i to do...


Gash is on crack.
Konjiki no Gash Bell rocks!! Don't say it ain't.


1. Konjiki no Gash Bell OP3 [Mienai Tsubasa] - Tanimoto Takayashi
2. Bad Day - David Powter
3. Bleach OP6 [Alones] - Aqua Timerz

Sunday, June 10, 2007

Code to XHTML converter


Frustrated at the inability to instantly post up code snippets without Blogger corrupting a great deal of it,
I've created this Flash application to help convert code snippets of any kind into valid presentable XHTML, preserving tab indentations.

Originally planning it to be a simple code-and-run application, I attempted customizing it more and more as i debugged and discovered more neccessities. After a whole day's work, this is the end result.






Downloadable at http://parallax-engine.110mb.com/CodeConverter.zip.

It works for all kinds of code, be it PHP, XHTML itself, XML, MySQL, C++, Perl, etc.
That is because it removes all opening and closing <> angle brackets, as well as turn all whitespace, and tabs into &nbsp;, and newlines into <br />

You can customise how many Spaces = A single Tab. Alternatively, you can just specify it to use the <pre> tag to preserve whitespace instead.

Comes with a HTML preview for checking the Tab to Space conversion, as well as specify border color, text color and background color of the code snippet. Comes with automatic CSS scroll-bar for small page widths.

Generates XHTML Transitional 1.1, using CSS 2.0, with clear comment markers. The only reason it fails to be XHTML Strict 1.1 is because of all the original code snippet that the w3c code verifier mistakens as invalid XHTML. Heck sometimes the verifier even deems it NOT XHTML but HTML 4.0!!

Here's an example code snippet, of the Actionscript code used to run the application, created using the application itself.




/*
 * This work is licensed under the Creative Commons 
 * Attribution-Share Alike 3.0 License. To view a copy 
 * of this license, visit 
 * http://creativecommons.org/licenses/by-sa/3.0/ 
 * or send a letter to Creative Commons, 171 Second 
 * Street, Suite 300, San Francisco, California, 94105, 
 * USA.
 * Copyright 2007, Cardin Lee
 */

_root.buttony.onRelease = function()
{
    var body:String = "";
    var front:String = "";
    var back:String = "";
    
    if(input.text == null || borderColor == null ||
       bgColor == null)
        return;
    body = input.text;
    
    body = Replace(body, "<", "<");
    body = Replace(body, ">", ">");
    
    front = "<div style='border: 1px " + borderColor.text
    + " solid; background-color: " + bgColor.text
    + "; text-align:left; color: " + textColor.text
    + "; overflow-y: auto; overflow-x: auto;"
    + "border-style: solid double; border-width: 1px 4px;" + 
    "margin: 15px 10px; padding: 5px 20px;'>" + newline;
    back = newline + "</div>";
    
    if(convertWhitespace.selected == true)
    {
        var noOfSpaces:String = "";
        for(i=1;i<=parseInt(tabSpace.text);i++)
            noOfSpaces += " ";
        body = Replace(body, "\t", noOfSpaces);
        body = Replace(body, " ", " ");
    }else
    {
        front = "<pre>" + newline + front;
        back += newline + "</pre>";
    }
    
    final = front + body + back;
    final = "<!---------------Code Starts here--------------->" +
    newline + final + newline + 
    "<!---------------Code Ends here--------------->";
    final = Replace(final, "\n", "<br />\n");
    _global.final = final;
    output.text = final;
};

/* 
 * Credit, and probably copyright too, goes to 
 * mrand01 of Actionscript.org forums for 
 * coming up with such an ingenious function!!
*/

function Replace(block:String, find:String, replace:String):String {
    return block.split(find).join(replace);
}




Creative Commons License
This
work is licensed under a
Creative Commons Attribution-Share Alike 3.0 License.


I hope this has turned out useful. It certainly would prove to be a useful obfuscator, lolz, the HTML version is very cryptic.




Gash is on crack.
Konjiki no Gash Bell rocks!! Don't say it ain't.


1. Konjiki no Gash Bell OP3 [Mienai Tsubasa] - Tanimoto Takayashi
2. Bad Day - David Powter
3. Bleach OP6 [Alones] - Aqua Timerz

OFFSCREEN NO!!!!


Oh, DAMNIT NO!!!! MY LOVELY CODE RAN OFF-SCREEN!!!!

Look at teh previous post!!!! NO!!!!!!

Dang, i need a new layout now, hopefully that will solve the off-screen problem.

EDIT:
Non of the stinking Blogger layouts look nice at all!!! I only love the Rounders theme, especially this green one. And the awesome custom Bankai Kurosaki vs Bankai Byakuya poster that i cropped to fit is just so nice... Couldn't bear to change the theme.

I also not pro enough to change the CSS layout. There's too much use of stinking images, the whole thing is just being support by stinking images!! If i change a single setting, everything else will fall apart, instantly. Seriously. I located the width of the main post area and changed the code. The entire sidebar disappeared. Screw-up CSS. Thank goodness i'm not a CSS programmer, I'd be heartbroken to know that the language i specialise in, is so screwed up and random.

Yup, so in the end i found a scrollbar thingy on the web. Just 2 CSS style edits. Cool, nice and simple. I should have rmb that scrollbar style straight away, read it more than 3 times in a CSS 2.0 book, and thought it was mighty cool.


Gash is on crack.
Konjiki no Gash Bell rocks!! Don't say it ain't.


1. Konjiki no Gash Bell OP3 [Mienai Tsubasa] - Tanimoto Takayashi
2. Bad Day - David Powter
3. Bleach OP6 [Alones] - Aqua Timerz

Paradigms of code #1


Paradigms of good and efficient code design:

Only write error-checking when the compiler ain't doing it for you:


        /// <summary>
        /// Cuts out a selected portion of Frames and returns them.
        /// </summary>
        /// <param name="start">The zero-based index of the Frames to remove.</param>
        /// <param name="count">The number of Frames to remove.</param>
        /// <returns>The cut-out portion of Frames.</returns>
        public Frame[] Splice(int start, int count)
        {
            Frame[] ret = new Frame[count];
            for(int i=0; i<count; i++)
                ret[i] = frames[i];
            frames.RemoveRange(start, count);
            return ret;
        }



Obviously, an Exception [aka Error] could occur, namely an Out-Of-Bounds Exception, since I didn't check to make sure there actually was that many amount of frames after the starting index.. But there's no need to implement your own Exception handling here, since the compiler's error checking does the job; implementing your own Exception handling just slows down your code unneccessarily, it's like redundancy checking.

Unlike the code below. Alpha values should be positive, and between 0 to 255. Setting any different will corrupt your image data, or just result in glitches that runs just fine, except that, well, it isn't a game anymore. Like seeing your character walk through walls or something. [ wait, that's an exploit/hack then. =P ]



        /// <summary>Opacity of the Scene.</summary>
        public int Alpha
        {
            get
            {
                return alpha;
            }
            set
            {
                if(value<0)
                    throw new ArgumentException("Alpha cannot be less than zero!");
                value %= 255; //not the best option here, but ....
                if(this.alpha != value)
                {
                    this.alpha = value;
                    for(int i=0; i<frames.Count; i++)
                        frames[i].Alpha = value;
                }
            }
        }




If you're wondered why I didn't check for positive values, it's here, further further down the procedural chain. That all [150 lines of code] just for changing opacity. XD



        /// <summary>
        /// Creates a new Bitmap with a new opacity value, whilst preserving transparency. A pretty
        /// laggy function.
        /// </summary>
        /// <param name="bmp">A Bitmap.</param>
        /// <param name="alphaPercent">The alpha percentage, from 0-100.</param>
        /// <param name="alphaChannel">A Bitmap, of the same dimensions as <paramref name="text"/> to use
        /// as the alpha channel. <paramref name="alphaPercent" /> will be calculated based on this new
        /// alpha channel.</param>
        /// <returns>The new Bitmap.</returns>
        /// <remarks>If you want to preserve transparency, keep the original Bitmap and use it as the
        /// <paramref name="alphaChannel" /> next time you need to change the opacity
        /// of the image again.</remarks>
        public static Bitmap ChangeAlpha(Bitmap bmp, int alphaPercent, Bitmap alphaChannel)
        {
            Argument0to100(alphaPercent);
            if(!alphaChannel.Size.Equals(alphaChannel.Size))
                throw new ArgumentException("The dimensions of alpha channel does not match the input bitmap.");
            
            Bitmap newBmp = new Bitmap(bmp);
            int w = bmp.Width;
            int h = bmp.Height;
            WinColor[,] channelColor = IrrBitmap.Retrieve(alphaChannel);
            byte _temp;
            
            BitmapData bmpData = newBmp.LockBits(new Rectangle(0, 0, w, h), ImageLockMode.ReadWrite, PixelFormat.Format32bppArgb);
            int stride = bmpData.Stride;
            System.IntPtr Scan0 = bmpData.Scan0;
            unsafe
            {
                byte* p = (byte*)(void*)Scan0;
                int offset = stride - w * 4;
                for (int y = 0; y < h; ++y)
                {
                    for (int x = 0; x < w; ++x)
                    {
                        _temp = channelColor[x,y].A;
                        p[3] = (byte)(_temp*alphaPercent/100);
                        
                        p += 4;
                    }
                    p += offset;
                }
            }
            newBmp.UnlockBits(bmpData);
            return newBmp;
        }





Gash is on crack.
Konjiki no Gash Bell rocks!! Don't say it ain't.


1. Konjiki no Gash Bell OP3 [Mienai Tsubasa] - Tanimoto Takayashi
2. Bad Day - David Powter
3. Bleach OP6 [Alones] - Aqua Timerz

Saturday, June 9, 2007

artz..



Naruto: Konoha Warriors by =O-renji on deviantART
Omg, it's so cool! Too bad Sasuke's not inside here.


Gash is on crack.
Konjiki no Gash Bell rocks!! Don't say it ain't.


1. Konjiki no Gash Bell OP3 [Mienai Tsubasa] - Tanimoto Takayashi
2. Bad Day - David Powter
3. Bleach OP1 [Alones] - Aqua Timerz

Friday, June 8, 2007

Vectors


Here's a little refresher course on Maths: Vectors in 3d dimensions. =D

The following code creates a 3d plane that will always be facing the viewer [camera]. With a little guesswork on how computer languages work, but knowledge of Maths, this should be easy to figure out.

Now we just need a Maths question to come out for the CTs regarding finding the points of a 3d plane facing a guy standing at a specified coordinates and we're set. =D

BTW, Vector3D.Normalize() refers to finding the Unit Vector. It's NOT finding the normal vector. 'Cause, Statistics, Normal distribution, normalization means setting mean to 0 and standard deviation to 1, which is basic units. So Normalization, in Vectors, means finding the Unit Vector.


C# code for letting a 4 vertex Mesh face the user at all times
X
 
_


Vector3D campos = camera.AbsolutePosition;
Vector3D target = camera.Target;
Vector3D up = camera.UpVector;
Vector3D view = target - campos;
view.Normalize();

Vector3D horizontal = up.CrossProduct(view);
if ( horizontal.Length == 0 )
{
horizontal.Set(up.Y,up.X,up.Z);
}
horizontal.Normalize();
horizontal *= 0.5f * Size.Width;

Vector3D vertical = horizontal.CrossProduct(view);
vertical.Normalize();
vertical *= 0.5f * Size.Height;

view *= -1.0f;

for (int i=0; i<4; ++i)
vertices[i].Normal = view;

vertices[0].Position = horizontal + vertical;
vertices[1].Position = horizontal - vertical;
vertices[2].Position = - horizontal - vertical;
vertices[3].Position = - horizontal + vertical;

Cool Code design by Cardin.
I can't help myself. XD

Yup.




Dang I give up. I was trying to code something that looks like the top of the windows title bar. But it's just damn tedious, keep having to move each thing pixel by pixel and see if they fit nicely together.

Wait, there's more trouble. Browsers don't display pixels the same. And that's gonna be affected by your computer's pixel resolution as well. So you can spend hrs tweaking it to look super nice, then another guy who's using resolution 1024x1280 comes along and everything is wrecked. CSS coding is so awesomely frustrating.

Algorithm coding is way more fun. You actually see results. And those results can be so much more impressive than a nicely designed page. Depending on what algo you're coding, the fun varies. I'd just finished coding, as seen above, a 3D plane that follows the user around. And there's also an option to turn that following system off as well. Flying around a 3d board is definitely much more fun than pushing 2d blocks onto one another in XHTML...

Though I'm kinda surprised my XHTML/CSS skills haven't gotten at all much rusty since a few years ago, when i coded a dynamic changing site design. =D


Gash is on crack.
Konjiki no Gash Bell rocks!! Don't say it ain't.


1. Konjiki no Gash Bell OP3 [Mienai Tsubasa] - Tanimoto Takayashi
2. Bad Day - David Powter
3. Bleach OP1 [Alones] - Aqua Timerz

Thursday, June 7, 2007

No space...



Oh no... my Start Menu is running out of space now... Two more programs to the next column which will partly disappear offscreen.

Can't find anything to delete. Sure there's some useless stuff like Real Player, Windows Media Player, QuickTime player, but then, if i delete them then i wouldn't know they existed.
I could package them all under one folder called "Useless stuff I'll never use unless some idiot used that format", but then if i uninstall it won't clear that mod folder...

Dang, I still have 12Gb more space on my computer and this already has happened. Guess I can't install any more stuff then..


Gash is on crack.
Konjiki no Gash Bell rocks!! Don't say it ain't.


1. Konjiki no Gash Bell OP3 [Mienai Tsubasa] - Tanimoto Takayashi
2. Bad Day - David Powter
3. Bleach OP1 [Alones] - Aqua Timerz

Programmer Personality Test


From: http://www.doolwind.com/index.php?page=11
PS: They don't actually have this in a nice template unlike all the other tests on the web. I went and copied/pasted the test result's HTML.

Your programmer personality type is:

   DLSB

You're a Doer.


You are very quick at getting tasks done. You believe the outcome is the most
important part of a task and the faster you can reach that outcome the better.
After all, time is money.


You like coding at a Low level.

You're from the old school of programming and believe that you should have an
intimate relationship with the computer. You don't mind juggling registers
around and spending hours getting a 5% performance increase in an algorithm.


You work best in a Solo situation.

The best way to program is by yourself. There's no communication problems, you
know every part of the code allowing you to write the best programs possible.


You are a liBeral programmer.


Programming is a complex task and you should use white space and comments as
freely as possible to help simplify the task. We're not writing on paper anymore
so we can take up as much room as we need.



Gash is on crack.
Konjiki no Gash Bell rocks!! Don't say it ain't.


1. Konjiki no Gash Bell OP3 [Mienai Tsubasa] - Tanimoto Takayashi
2. Bad Day - David Powter
3. Bleach OP1 [Alones] - Aqua Timerz

Search engines


Ask.com is actually quite cool. I decided to try it out today, after reading that Ask.com was the fifth most popular search engine in the world, behind Google, Yahoo, Time Warner and someone else.

Wanted to use Metacrawler instead since it compiles searches, but Firefox users obviously weren't much fans of it, so i couldn't find a search plugin for Metacrawler, so scrap Metacrawler. I'm using Ask.com instead.

But of course, Google's important too, so i FINALLY, RELUNCTANTLY, got myself the Google ToolBar for Firefox. Comes with a Google Search Bar, with auto completion of search terms. And instant Wikipedia search and search for links in current page as well. Pretty cool. Don't have ANY use for the other funky stuff like Bookmarking or Blog about this page etc.

Ask.com helps provides alternative search terms to help narrow down your search. I suppose Google have this too, it ought to, but it's probably not very visible since I haven't seen it in years....
It also helps you expand your search terms if ya want... hehe similar point..
Most importantly, Ask.com has the option to preview your search results.. Pretty cool. Of course it's not exactly up-to-date, the preview updates when Ask.com crawls through the site again. Which is quite not so frequent considering how big the Internet is. And also not all sites have the option; Ask.com hasn't crawled through ALL the sites yet either. But all in all it's quite neat. Novel maybe but i still think it's neat.

Plus, I really don't want to contribute anymore to Google, and Yahoo just sucks at doing everything substandard, including its search.

'Course I'll still be Googling around if I find I'd exhausted all my options in Ask.com. Of if I wanna find the cached version of a page, it's great for finding stuff that people took down from their sites.. =D They forget Google has a copy of it. Oh yeah, some Internet archiving organization also as a QUARTERLY archive of pages too. Maybe even more frequent. Or less, depending.


Gash is on crack.
Konjiki no Gash Bell rocks!! Don't say it ain't.


1. Konjiki no Gash Bell OP3 [Mienai Tsubasa] - Tanimoto Takayashi
2. Bad Day - David Powter
3. Bleach OP1 [Alones] - Aqua Timerz

Tuesday, June 5, 2007

Wrong tool for the wrong job...


What puzzles me to no end are people who do not use Flash for most of their game projects. 2d = flash. More especially so if they go around asking in a 3D engine forum about how to do frame-by-frame animation.

I've seen 2d games that could have looked better if that guy had used Flash instead. Flash is a 2d vector ART program, no need to rely on Paint or simple 2d sprites. Flash you can have all those fancy buttons, flying/morphing text under minutes with minimal coding - most of the minutes will be spent trying to come up with an aesthetically pleasing design. Using C++? Instead the guy will be coding coordinates and animation sequences,then to debug, compile, run, and then keep changing his coordinates and then compiling and running again to see.

And there people are dissing Flash that it's dying out, that it's good for nothing but annoying popup adverts. I do wish people who are just getting their feet wet, will get themselves the best technology for the job and not using the wrong tools for the wrong tasks...

Flash is for 2D, for those who haven't got the faintest idea wth are event handlers, listeners, vertices, UV coordinates, normal vectors. Flash is the ultimate amateur game programmer's toolkit/IDE. Visual design, comprehensive offline manual, simple animation control, strict or lenient OOP coding, ubiquitous Flash player platform, all bundled into one. If you gave me a choice between Java and Flash, I'll take out that few hundred bucks and go buy myself Adobe Flash CS 3. (If I had Vista.)

Why am I not using Flash?
I need speed. I COULD spend some time optimizing my code to go faster OR I could spend time coding more features.
Flash's 3d capability comes at a cost of speed.
To make Flash run naturally even faster, I need Flash CS 3 + Windows Vista.
I love the syntax of C# in that in allows FULL control over the computer system and provides opportunities for elegant/neat code that is in line with the style of C++, which i need to know better as well.

Why Flash would still be good?
So I would save the stupid trouble of having to avoid images not of dimensions the power of two, eg. 32, 64, 128, 256, 512, 1024.
So I won't need to go an animation system, and synchronize time across all elements to keep the framerate constant, which is crucial in a 2d animation system.

I'm kinda worried at how Adobe came under heavy fire of late about Flash being phased out.... Why isn't anyone mentioning FLASH when they're talking about dynamic website devices [AJAX]!!!!! Come on, silly Javascript and CSS runs into hell lotta problems with browsers... Just use Flash and get the job done with an additional graphical flourish!!!

I saw a AJAX guidebook and I was like, damn it, with Flash, XHTML, CSS, PHP one can do all the stupid stuff that AJAX claims to do (And AJAX is just a mashup of technologies, it's not even a solitary product onto itself) and yet everyone's falling to their knees to AJAX and Web 2.0.... As far as I can see Web 2.0 is nothing more than allowing a million monkeys to type a Shakespearian play, wrt to the Entertainment sector like YouTube, MySpace. I mean, does the human race seriously need all that much ways to do more unproductive things that make more people gather around and be further more lagging around doing nothing?!

*Watches a portion of the world crumbles.*
*The other portion of the world stays intact because they're much more concerned with doing stuff that actually has an impact on the world and is meaning to society.*


Gash is on crack.
Konjiki no Gash Bell rocks!! Don't say it ain't.


1. Konjiki no Gash Bell OP3 [Mienai Tsubasa] - Tanimoto Takayashi
2. Bad Day - David Powter
3. Bleach OP1 [Alones] - Aqua Timerz

Sunday, June 3, 2007

Anime = illegal


Hm, yah, Singapore is placing a very serious control over illegal downloading of stuff. First it was music, now it's anime.

I'm not a collector of anime, so it doesn't affect me =D, but regarding the state of the anime industry worldwide, i doubt any clamping down on illegal anime is going to do anything to help the Anime DVD industry.

I've tried looking at the prices they have for just 5/10 episodes, and it's like $30++. I'm talking about legal English releases, not cheap Chinese translations. Importing original Jap releases aren't much cheaper either, about $60++ i heard.

Not that I have any issues over the prices... but some animes have 100+ over episodes. Are fans supposed to fork out $300+ dollars?

Oh wait, most ppl actually spend more than that on a monthly basis as part of them misc budget. =X

But still, the prices are okay if the DVDs are high quality, but they're not. English translations are often poor. And I would rather much like to have Japanese as the language medium instead of English. BGMs sound the best when they're untouched by English Voice Actors spliced into the soundtrack.

Perhaps a special type of Anime DVDs, English Subtitles on Japanese, would emerge over time. If it does, and is cheap enough, I might consider purchasing whole series i guess.

But until then, Singapore is completely OUT of the anime scene. We'll still be around YouTube though. =D Streaming video files based off a foreign server, I HOPE, isn't illegal. If it is, that has some serious implications..... that viewing media, not just possessing it, without possessing the permission to do so, is considered illegal. =\


Gash is on crack.
Konjiki no Gash Bell rocks!! Don't say it ain't.


1. Konjiki no Gash Bell OP3 [Mienai Tsubasa] - Tanimoto Takayashi
2. Bad Day - David Powter
3. Bleach OP1 [Alones] - Aqua Timerz