When I started the Financial Business Informatics (FBI) course in TP, Problem Solving and Programming (PRSP) was one of the subjects I had to take. Before, I had no interest in programming, but I soon found it so elegant and logical, and since I didn't have Mathematics as a subject anymore, this became sort of it's substitute. I found it easy to understand, and found myself sailing through the class (I got an A). And although I'm not too proud of it, after the 6th lesson, I started to not pay attention to my teacher, and instead did the assignments in class. When I encountered something unfamiliar, I opened up the instructions sheet that my teacher, Ms Nami, had uploaded. This meant that I finished way earlier than my classmates, so I started on my project for the subject. Once, I realised that the class had gone quiet, so I asked my friend what we were supposed to do. He showed me, but I couldn't find the html file. I had done the php assignment earlier, but it needed to reference a html file, and I couldn't find it at that point. I took a look at what the php file required from the html file, and referred to past html files to create a new html file for this php project. Only when I had successfully completed the assignment did I turn to my friend and brightly said "Done". He looked at me and asked why I was so slow; he'd finished a long time ago. Only then did I realise that Ms Nami wouldn't have set us the task of making a html file when we weren't even taught. Apparently, when she had told the class to do the php assignment, she'd uploaded the html file there and then, and I hadn't bothered to check or ask for it.
That was the turning point for me. I realised that I wasn't just good at this, I had a knack for it. The next few weeks, I completed my project assignment with 3 weeks spare, while my classmates struggled with the last question: creating a Minsweeper game that plays itself, generating random numbers to open up random positions. That took me a while, but I eventually puzzled it out by myself.
Back to the present. Uncle Michael sometimes works with my dad, managing IT portions of projects. He owns an IT company, and has recently started teaching me this programming editor: Python. Since Monday (18th Oct), he told me to create a program that can check websites for certain pieces of information. Specifically, searching the html of a webpage to find the name and last price of Stocks. I stumbled over the first assignment, because I was unfamiliar with Python, and had no tutorial to guide me. My codes were messy, and the first 2 attempts I made only worked with assumptions. My search tool was clunky, and all these problems arised because I didn't know Python well enough. Eventually, I succeded. Actually, it was this afternoon, when I finally found the missing puzzle piece, and it worked like a charm. Assignment 2 (also finished today) was to upgrade this program: using a .txt file as a reference, without constant user input, so that when one item is changed on the .txt file, the Python file can still run. One only has to input data into the .txt file once, and the program runs.
For example, if I want to check my portfolio of 3 stocks: IBM, Dell and Citigroup. All I have to do is type it in the .txt file, along with the quantity of stocks and purchase price, and my program will check the respective webpages for the last price and current value of the stocks. If I want to add one more stock, say BAC, I just add it to the bottom of the .txt file and my program takes it all in stride, producing perfect results.
I'm very proud of it.
'Tis the season to be bored =,=
15 years ago
No comments:
Post a Comment