Showing posts with label programming. Show all posts
Showing posts with label programming. Show all posts

Monday, April 21, 2008

Project Euler



No place for those geeky neurons, up in your head, to start calculating? Need somewhere to put them to work?

You've found it.

Named after the famous and incredible mathematician, Euler, this website combines mathematics with programming, to provide a series of challenging problems that are only solvable by programming languages.

For example, try finding the 10001st prime using pen and paper. Or how about 2 to the power 1000, or how about the sum of the digits of 100 factorial?

Because of this, you must conjure up a programming language, to be able to solve this. The problems range from multiples of 3 and 5 under a thousand, to triangles containing the origin, and in total reach 190 problems.

There is a new problem published every week.

What are you waiting for? Go test your luck, and put those dusty old programming skills to work.

Go figure something.



For all those who have joined, my username is StormXI.

Wednesday, January 23, 2008

Changing Direction

This may be a non-Nablus post, contradicting the theme of the past several posts, but I hope this will be as interesting.

A few days ago, I was playing an online game I am addicted to, called Runescape.

Then, I had a thought I never thought of before. I asked myself, why am I doing this? Why am I wasting endless time on the internet, playing a useless game that will not do me any good in my life?

The thought stuck to me for a second, and then it left me.

A few hours later, after taking a break from Runescape, I started programming a bit. As strange as it may sound to non-programming folks, doing this is considered an enjoyable hobby.

Then the same thought struck me again.

Programming will help me in my future, when I start to write my CV, I could write down my knowledge in different programming languages, not all those hours and all those gold pieces I had on a virtual game.

All the memories hit me, those from years ago, when I would go to Youtube, not to look up Runescape money making guides, but to look up video tutorials. I would spend hours on the pages of forums, trying to look up a solution to a bug in my piece of software. I would type and type on MSN to a friend, not about how I just slayed a demon a hundred levels above me, but about a piece of code I was working on with him.

I could even remember how I would go, when I was in London, how I would search the Times Jobs website for jobs in IT, find the programming jobs, and gaze at the director of IT jobs, with their fifty grand annual wages, twenty grand above the average of good jobs in London.

And then, ironically, for the first time in two years, I decided to quit Runescape for good. I wanted my life back.

So, in my first step towards this new life goal, I went to my uncles' office and, instead of opening Runescape and burning more hours for nothing, I went to the Adobe website and downloaded the new Flash Professional CS3.

Then, the day afterwards, I went to my uncles' house and downloaded a few video tutorials of the internet for Actionscript, which with the videos help, I have made my own FLV player, and I have learnt API.

I now feel I am a much more balanced person because I am building towards my future instead of wasting my time.

And best of all, I am happy :)

Wednesday, September 26, 2007

Macromedia Flash

The first time I saw Flash, I loved it. I never really knew anything about it, just that it had frames, objects, tweens - all the basics a normal flash beginner would know. A boy sat at school, clicking away, drawing something in Flash then tweening it. And their I sat, amazed and confused at the same time. It is strange how you could look at a program and not know what it does, but at the same time you begin to need it.

The next day, I went to a close by CD store with my dad. I had convinced my dad to say to the man that he wanted it, not me. I could just imagine the laugh that would come if I came and said I wanted a copy of Macromedia Flash. So it all worked to plan, my dad handed over 3.5JDs (you greedy shop, blank CDs cost a few piasters), and he handed over Macromedia Flash Pro 8. And feeling confident, I went home and installed it.

I felt stupid when I couldn't do anything on the program. I had thought I had memorised everything the boy done, but nothing worked. I began to feel frustrated, at how I had wasted lots of dinars to how I had not asked for help in the first place. I was in a tight position and I did what I always do - give up.

A few days later, or weeks maybe, I went with my uncle to a computer fair, and after going around the place I found the For Dummies books. I found it, Macromedia Flash MX For Dummies. I knew I had to get it, and after a long long series of nagging, I bought it. Although MX and Pro 8 are different versions, the book still taught virtually the same thing since there weren't that much big differences between the two versions.

I learnt quite quickly. The first thing I made was just a simple rotating tween, but as time came I began to learn frame by frame animation and start to use the tools. This wasn't really that good, I wasn't into drawing or animation. I began to learn about buttons, and began to touch onto my first programming language - Actionscript. Buttons weren't really that good in teaching me, and since the book didn't teach AS, I went and searched on the Internet.

I found a forum which had quite a lot of hand written tutorials, all about Actionscript - everything from the simple gotoAndPlay to the terrifying API (in which you draw through code). The forum also allowed me to ask the users there, mostly teens in their 16s, and I would usually get answers in minutes since it was a very big forum with over two million users.

And as time past, I began to learn and became much better in AS, learning much more advanced thing such as Arrays and Math functions. But one day, I had to format the computer, and Flash was lost. Thinking I could reinstall it from the CD I got, I tried it, and found it was virtually unreadable since it had a million scratches on it. I then gave up on Flash for the moment, and began to learn other things like PHP.

But all of that changed a week ago. My school's IT lab had Flash MX on it, and after I tried a few things on it, I began to remember most of what I had learnt in Action Script. The next lesson I brought out my USB drive, looked around, plugged it in, copy, paste, took it out - done. At home, I installed it and began to try out something new I had learnt which was rotation of objects by AS.

The program basically relies on two variables to rotate an object, one is speed and one is acceleration. The square rotates till it reaches a certain speed then starts slowing down until zero then repeats itself. Its quite interesting, I guess my Physics teacher would be impressed. But then again, he wouldn't really care. I won't bother.

[IMAGES NOT AVAILABLE, SORRY ^^]