Showing posts with label C Programming. Show all posts
Showing posts with label C Programming. Show all posts

One Way Or Another.

Had my second Law and IT test and I got 50% saja. Aih, banartah, I should bring my laptop to next test so that I can search for words and answers easier. Mun laptop ani cute and feather-light inda jua ku kata2 kan membawa kali, ani sebasar2nya and sebarat2nya kan diangkut. But anyways Law and IT has got to be my favourite subject, cause the lecturer's so cali and baik and semualah. If u noticed ada sometime in previous post aku gitau aku macam keboringan this module, but I think I like it now. And it's by far the easiest module in the course jua masa ani so yatah ku suka. =P

I don't like C.. truly terribly hate it. Well maybe I don't hate the language, but the way things are assessed, I feel are just not fair. You see, the way the tests and assignments are assessed are cemani, in tests you have to submit your program within 2 hours. And you've to get it to work perfectly, or else you won't be allowed to submit it. So if your program's not working 100% you won't get the chance to submit, hence you don't pass lah the test. And lagi kadang2 telimpas time 2 hours, then you can't submit it. So it's either you get 100%, or you get 0%. So far for the two tests I got 0%. Gila bah!! I dun mind the first test as masa atu aku blank, but if the second test was to be marked secara baik hati dan munasabah sikit, I could actually get 50-60%, ganya I couldn't finish the last part, sekali nda tesubmit jua. =( And as for the assigments.. samalah jua. Ngalih ku kan explain lebih lanjut. Tapi that's the thing. When you put in so much effort, but sometimes just for one silly mistake, you get 0% tarus. To be honest my first assignment atu 100% plang tu, ganya I forgot to compile it with all the extensions yang dimaunya so ada segala warning2. Sekadar jua eh. And the second one, if it was to be marked part by part, I guess I could've had 70%. But... malasku kan cakap.

Bah bebahasa melayu ku dulu, karang manatau testumble upon this blog ka secara kebetulan segala tenaga pengajarnya, kana banci ku tarus huhu. Sekali I went to see personal tutor tadi to discuss an important matter, and had a good session of meluahkan perasaan inda puas hatiku lah tarus. I talked about how I feel pasal cara marking yang inda fair etc2. And my tutor even said that most people do complain about that the strict marking atu plang. So it's not just me ok? And then aku komplen pasal lecturer ku arah this one module yang ku inda suka =P But of course I asked him first if our conversation tadi atu confidential kah inda, hehe. So I complained about how the lecturer sorang ani sedikit intimidating orangnya, and payah kan approach usulnya, and how sometimes ia nampak annoyed when people ask what's probably an obvious thing to him. And tutorku kenal siapa ku cakapkan, even when aku malas kan gitau namanya mula2. =P I mean banar jua tu, people ask when they don't know. What's obvious to one person may not be to another so mun urang btanya benda simple pun kan teroll2 eyes, baiktah branti keraja. How do you expect people to learn something when they don't feel comfortable enough to ask you something cause all you do is roll your eyes and show this annoyed face when people ask you a somewhat simple question. Kurik karang biji mata ah. Canatah urang kan contribute tu mun urang inda bleh silap cakap in class? Entah eh. Sekali ku mengadu lagi how the lecturer inda ada reply to emailku yang ku betanya pasal something. I said the least he could do was reply me with a "yes its ok" or a "no its not ok", rather than inda reply langsung and leave me curious. Canakan tu?? Barutah ku telarah tejumpa lecturer catu atu. Kejam dan segala2nya. And I complained about the workload that's neverending menimpa2. Every week kan test, every week ada saja assignment kan disubmit. Nyangku baru sebulan sudah tia tahap stressku cani ani. Then he mentioned about all the other people yang sama jua didn't do well in the tests and assignments, and some of them are intelligent people nya and they even found certain2 modules payah. Sekali ku gitau lah yatah tu jadinya mun sudah yang pandai2 belaka atu pun pandai kan fail, aku ani apatah lagi nyangku. Then I told him pasal the other international students atu are private students. They pay their own fee. I told him I feel more pressure pasal bukan aku bayar sendiri ni. Mun ku bayar sendiri sekati ku lah kali ah, usinku. Sekali he said banar plang, and one of the modules right now, Crypto is one of the hardest katanya, and next term ada Advanced Crypto, which is lagi difficult katanya. And he showed me past years exam result of Advanced Crypto, and luluh hatiku meliat.. so many reds! Intro Crypto ani sudah ku gone haywire in the first month, malas ku imagine cana kejadianku mun Advanced Crypto nanti. Menulis pun inda lurus kali lagi. So after about one hour talking and a bit of crying, I came to my decision and he somewhat agreed. Oh, nada plang ada apa2 yang penting sangat. I'm quitting my course ganya. =P

A little note from me. As human, we're bound to make wrong choices. There are people who force themselves to live with their choice just because they're too worry about what others might think of them if they do something about it. As for me, I found out I made the wrong choice by coming here, and therefore I'm gonna look for what I hope is a better one before it's too late. Why do we have to care what people have got to say? Well you know, it's human nature. Of course people will talk about you when you do something that they don't see themselves doing, but they'll grow tired and stop eventually, and move on to talk about other people. I don't know about you, but when I know I can choose, I choose to not do things that don't make me happy, and I don't like to wait until it's too late. Besides, it's not like I didn't try it at all. I tried it, I didn't like it, so I'm gonna move on. I may not know if the next thing will be better, but life are full of choices, and as I said, we human are bound to make wrong ones, but that doesn't mean we've to stop making choices.

Bah tata!!!! Kan buat assignment ku! Sama kan prepare jawapan lagi mun reporter2 betanya. =P

*lari sebelum disoalsiasat pihak2 yang tidak berkenaan.*

Week 4 of 12 - 1

Not a good week at all. More assignments, more tests, more everything lah coming in. More and more work and I can't keep up with them and it's getting to me. My C programming doesn't seem to be getting better and it's scaring me! I can't seem to grasp the idea of argc and argv. I mean I know what they do but I don't know how and when to include them in programming. And I still don't get malloc() and calloc()! And I'm going crazyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy that it's making me sad and angry at the same time the whole time. Breakdown almost everyday and I'm so close to giving up. I'm mentally unhealthy and exhausted. I need help but I think nobody can really help me but myself. =((( Come on, 11 months to go. Please don't give up. You've survived one month. Just 11 more months... 11 more months.
  • argc counts the number of arguments.
  • argv prints strings. It is an array of pointers to char. Characters, not numbers ok?
  • argc is int, argv is char.
  • can be char *argv[] or char **argv.
Something to share...
"Ya Allah, sesungguhnya aku mohon kepadaMu tabah dalam menghadapi segala urusan dan kekuatan dalam menerima petunjukMu. Dan aku mohon kepadaMu agar aku dapat mensyukuri nikmatMu, dan membaguskan ibadah kepadaMu. Aku mohon kepadaMu hati yang sihat, lisan yang benar, dan aku mohon kepadaMu sebaik-baik apa yang Engkau ketahui, serta berlindung kepadaMu dari apa saja yang Engkau ketahui, dan Engkaulah Yang Maha Mengetahui yang ghaib."

End of Week 3.

Sometimes I think random stuff. Like how earlier today I was thinking that I've never actually seen a zebra in real life. I think they're one of the most beautiful animals, don't you think? I mean, inda lawa ka tu black and white stripes atu? Durang ganya tedapat catu atu. That's just so unique kan.. Masya Allah. Nantitah saja ku ke utan mencari zebra. xD

And then I got curious to know what animals eat crocodiles. Ani ku tefikir after I watched the video pasal buaya that was caught in KB last time atu. =S Macam crocs eat lots of things, but I don't really know apa yang makan buaya. Maybe I used to know masa kanak-kanak time belajar Science but that was like bekurun lamanya sudah ku tinggalkan and I guess I've forgotten about it. Or andang ku inda tau, mana saja tia bah. So it turns out nothing eat crocodiles when they're alive, but sudah ia mati barutah kana jangkau leh binatang2 yang lainnya hehe..

Anyway, tomorrow's the start of week 4. I've got a meeting for Information Security on Tuesday, and a C programming test on Wednesday. I hope I'll do ok in the test. =( Oh and I've also got another C programming assignment to do which is due Friday week 4! I don't like but I hope I'll do well in that one too! =((

Tata.

Week 3 of 12 - 1

So I've formed a group with 4 other people for Information Security assignment. 3 of us are in the same course, and the other one in his final year in Computer Science degree. Task 1 is done, which is to email the names to the lecturer and think of a topic for the assignment. We're thinking of doing an article/report on Access control of biometric methods. Let's hope the topic will be accepted by the lecturer. The pages must not exceed 12, excluding title page and bibliography. Task 2 is to prepare bibliography and abstract and show them to the lecturer nanti. Oh and the report will be 40% of the course. 60% lagi from exam. Well, good luck to us!

I'm still working on Cryptography assignment, and Alhamdulillah I've finished 3 out of 4 questions. Due date is 22 October so hopefully I get to finish the final one! I've got Shift cipher for question 1, Vigenere cipher for question 2, Substitution cipher for question 3 and Permutation cipher for question 4. Yang alum siap ani Permutation cipher lah. I don't know whether the texts are divided into 5, 6,7 or probably more?? Well yang ku sasak is that for something so hard (At least I think it is. But most people find it hard too so believe me, it's not just me.), the assignment is only worth 4%!!!!! But I think the fact that I know what type of cipher one is just by looking at the frequency analysis is one step towards being handal at it huhu =P Just the part of deciphering atu yang bagi stress. But since this is the first assignment, I'm thinking this is actually the 'easiest' part of the course? =( The first, and already I'm looking and feeling like pffttt... Hope I can survive the other assignments and the test. Again, good luck to me!

And of course, C, another work to do. Hope I can manage to do that by this weekend before next week's test. And I hope I'll do well in the Law and IT exam! It's an open book test, and I think(and hope!) I can answer them cause as I've mentioned somewhere in the blog, I've learned something similar twice before in Teesside and Aston. Hope the questions are easy tooooo but since it's an open book, I doubt it. I don't know about you but everytime I have an open book test, I can't seem to find the answer to the questions in the book ani bah. Macam inda pedah2 jua mbagi open book test rasaku. Oh well. Good luck me! =)

Oh and today I skipped my Information Security lecture which was at 3. It was because I was sleepy since the morning lectures, for both 9 and 11 am lectures, and I stayed for C Programming lecture at 2, and I was also sleepy by then. Tapi ani baru first time ku skip class ni, banar inda tipu =P Can't make it a habit though =( I think as of next week I'll get a coffee right before afternoon classes on Monday and Tuesday. The coffee in the vending machine only costs 60p so I think I can manage to fork out 3.60 a month for coffee kan?

Tata.

Many Many.

Fuh... Finally submitted the C assignment. Crazy I tell you. It was so hard for me to understand the question, and I didn't even understand the stuff being explained in the module forum. Macam, sakit jualah kepalaku mikirkan. Then I went to ask for an explanation from this one guy in my course, then faham tah ku soalannya, then it was ok for me. Ganya my room was in a complete mess with papers everywhere bakas scribbling codes and numbers and whatever. Even notebook yang standard size atu pun abis dah separuh bakas menulis2 codes ganya, cause see, I scribble big. And inda cukup paper, the Note application in the handphone pun ku pakai to text in codes before I go to bed, manatau lupa esuknya. Huhu way too much thinking, and it's only week 2! I'm happy about the assignment, BUTTTTTTTT I'm not about the test yesterday. I failed the test yesterday. Alum plang ada resultnya but confident jua ku membagitau ni because I didn't even get to submit my work. =S And I didn't get to submit it why?.. Because my program didn't work. Eh I mean it worked plang eh, but gave results which were absolutely unrelated from what was asked for. Ahahaha. I don't know why I'm laughing. It's not suppose to be funny. =| It asked for the initial number that gives out the longest hailstone numbers sequence. Part of it was from the exercises I did last week, tapi dah atu kana tweak sikit the question. And I don't know apa kah kejadiannya code ku atu. Malas jua ku mikirkan lagi bah. So I spent two hours in the lab for nothing, not even for attendance. It's as if I didn't come for the test at all. Apparently mun codingmu working and correct, then you can submit the test, and then barutah kana tick nama. Cam apakan... =S Ah well, there'll be some other tests to not look forward to.

I still haven't found any group to be in for Information Security assignment! Ngalih ku eh kan tanya2 sapa yang alum ada group... =S And I hope if I do find some people, they'd want to do the same topic as what I want to do, tapi kan alum plang ku tefikir kan pilih which topic. Yawns.

Tomorrow I'm gonna start on Cryptography assignment. Took a look at the first question and tried to solve it few days ago but macam inda tesolve ulihku. And there are 4 questions altogether. Kepisan eh. Bejurit keratas tah lagi ni esuk2 bilikku.

Tata.

Hoping to Move Faster.

Starting to stress out sudah. Lots of things to do for the coming weeks!! =( I've C practical test next Wednesday and an assignment due Friday. And another test for Law and IT on next two Fridays. Then I have Introduction to Cryptography assignment, which is due on 22/10, and for Information Security I still have to come up with an assignment topic and form a group by 21/10.

TAKUTKU EH T_T.

I'll update when I get some of the things done... ta................

I Still C.

Believe it or not, I'm still stuck on the prime number thingy on C. I haven't spend much time on it either. =S The calculation works so far but it doesn't print the amount of prime numbers the user wants, but instead it loops for the number of times the user wants the prime number to be printed and omit all other numbers and print the prime numbers up to the number of times wanted. If that makes sense. Gonna have the lab session for three hours later on at 1 so I'll try to figure it out karang lah lagi. Ani relek lu kajap ok.

I've had the lectures for all the modules I'm taking this term sudah. The modules I'm taking for this term are Programming in C, Introduction to Cryptograhy, Information Security, Law and IT, and Mobile and Ubiquitous Computing. My thoughts so far.. Well I don't think I'll favour Law and IT, cause I've learned something similar in Teesside and Aston. Inda ku suka ni belajar benda sama brabis ani. Payah lagi tu. Mun sanang inda jua papa =S Obviously it's about law thing lah and the connection with IT. So we learn about cases, data protection law, computer law etc2 that sort of stuff. And I realised from the first time I studied Computer Law, that I'm not meant to be a lawyer. I suck at learning law. T_T Breaking the law pandai plang ku hehe.. For Law and IT, we're gonna have two essay courseworks of 3000 words. Or we can choose to do some sort of four biweekly tests and do only one essay. Or do everything and they'll choose the best marks. I'm thinking of doing everything.. essays and tests. Hahaha nadawah eksenku. =S Inda ku rajin sangat. I might choose to do one of the tests first to see if the questions are okay. Mun testnya sanang I might do tests and only one essay. I'll tell you nanti.

For Mobile and Ubiquitous Computing... kami punya lecturer very good looking lah. He even looked like a student wah masa ia masuk. And he's quite adorable in the sense as mun ia becali kiut usulnya senyum. But kawin sudah, ada cincin. Hehe. So for this module, I'm not sure brabisly apa yang kan dbuat, but something that's got to do with mobile computing obviously, and I think for the coursework we're gonna be making a mobile application. I think. If I'm not mistaken that's what he said. I was a bit sleepy yatah. I'm gonna check the handbook later on. Right now I'm not that bothered to get my details correct actually cause I'm waiting for my lab to start so ani ku saja blogging.

Bah tata.

Chapters of C.

Still on C. Today's classes were as followed:

09:30-10:30 - C Lab
10:30-11:30 - C Lecture
11:30-13:30 - C Lab
14:30-15:30 - C Lecture
15:30-16:30 - C Lab

Entah I don't know why they put the classes like that. To give time for other people to use the rooms kali? Yesterday's schedule was the same. Went through the lecture notes during lectures, up to Chapter 4. Oh have I mentioned that they are so many chinese from China in the course? I was waiting for the lecture to start and went in early, and there were only 2 orang putih, and the rest were Chinese. I felt like I was studying in China huhu. I remembered once in Birmingham where there was no orang putih langsung jua in the computer lab that time, only Indians, Arabs.. you get the drift, yang jenis catulah. Masa atu macam di negeri lain jua ku rasanya =P So anyways, lectures of course made me dozed off a few times. *yawns*

In the lab sessions we just did the exercises for the chapters we went through in lectures. I did up to Chapter 4, but haven't finished all of the exercises in that chapter. I stopped at the second exercise of chapter 4. It asked for a program that prints out prime numbers according to the number of times input by user. I was tired of thinking Maths, so I stopped lah. Macam inda keluar lagi apa2 formula dari kepalaku tadi atu, Maths tah lagi. The first exercise on Chapter 4 was to write a program that prints out sequences of hailstone numbers according to the number of times input by user. I didn't know what hailstone numbers were, confused tia ku, dengan formula2 yang keluar lagi. Even more confusing =P But I managed to do it and got everything correct except for one problem where my second value kept on repeating itself instead of changing to another new value. Called the lab supervisor and he helped me fixed it. Sekali so simple to fix! Sasak plang ku benda simple inda ku tebuat. I'll continue with the prime numbers program tomorrow, if rajin. Cause tomorrow lectures are cancelled as the lecturer felt we probably got enough of programming by now. Faham pun ia. So I might not come to labs kali, tidur tah ku kali rasaku.... -_- Or I might come in late for labs. But I'm not sure, I think he said that the lab will only be on from 09:00-10:00 and nada masa afternoon. And I don't feel like going up the hill for a 1-hour class. So... =)

Bah sambung. So lay your program this way if you want to gain more marks in the assignments and coursework, according to the lecturer. And besides it'll make your source code looks tidier:
  1. Don't forget to include comments. First put them on top, then put them anywhere else necessary.
  2. Second comes #include
  3. List of function prototypes - must be on top and before main() function.
  4. After that comes main() function.
  5. Then all other functions mentioned in function prototypes.
And never ever forget curly brackets { and }, especially in loops.

Other stuff:
  • stdio.h - used when you're going to print something out or get input from users
  • stdlib.h - for including other functions in the standard library, eg rand()
  • When using scanf(), don't forget to include ampersand in the argument.
  • A for loop can be changed to while loop. When writing one of them, check to see if you can change it to the other loop.
Tata.

All I C.

Today was my course registration. I haven't met any of my coursemates yet, but I think there are 28 of us, and out of the 28 atu, sorang saja macam nama urang putih. The others are all international students kali, and almost all of them aku inda pandai pronounce pun nama durang. Namaku ganya ku pandai and sorang dua yang sepatah dua kata saja namanya. Hehe. And I thought the registration was the only thing for today, but then we were given schedule for introductory week, and my my, so full!

While waiting for the next thing to start at 14:00, coz I really can't be bothered to go back to my place down the hill, I went round the uni to familiarise myself. Went to the PC Centre, and also the Computer Science library. Borrowed a book called "Handbook of Applied Cryptography" cause I read it's in the list of the recommended books for one of my modules. It's really a thick book, my eyes felt heavy as soon as I started reading the introduction. =P In other words, I stopped reading after only a few minutes. =|

At 14:00 I went for an introduction by the course director which was for about half an hour, and then at 14:30 we got Linux tutorial till about 16:00. It was basically just a tutorial on how to use Linux for those who weren't familiar the commands and those kind of stuff. Got to do a little programming with C language with Linux too. Then we were given the Computer Science usb drive. Owtom~~ (Awesome. =P)

So now let me tell you what we have for the rest of the week. Mind you, this is an INTRODUCTORY WEEK. And in this week (again, introductory week), starting from tomorrow till friday, I have C programming lectures and lab sessions full day from 09:00-19:00, but of course with one hour lunch break at noon. Macam aiiii brapa jam kan tu ku kan mengadap programming ari2. =O Well tomorrow two lectures and lab starts from 13:00 plang because we have induction day earlier. But still. Adakah cematu masa introductory week. =(

Well so far I'm liking my faculty and the university, despite it being on top of the world or something like that. Well it does feel like it plang. Ciss.. that part inda saya suka. I don't know when I'll get used to the hills and stairs. Banar. Yatah tu nah exercise malas, rasakan tah ani TERPAKSA naik bukit ari2. Huhu. But other than that, I think it's a good place. There are lotssss of PCs in the lab, lawa lagi tu and kind of bersih. =P And there is also a 24-hour PC Centre. I haven't had the time to explore any other facilities, like the printers and apa2 sajalah. Tapi pendek kata masa ani I love my faculty! Huhu. Well I'll tell you if I ever change my feeling nanti =P Oh, and the uni is quite close to the shops too, which is convenient mun kan singgah time balik.

Tata tata.