Wednesday, December 29, 2010

Aliens in the attic

Have you seen 'Aliens in the attic' movie?



such a great movie.

genre: adventure, science fiction, fantasy

few words of the movie:
Aliens, do they really exist? In the attic of the Pearson's family, Tom Pearson and his cousin Jake Pearson were up to fix the satellite broken accidentally by the aliens when a strange force sent them from the galaxy to the earth. Tom and Jake had their first fight with those aliens after they found that satellite was incredibly broken into pieces that cannot be fixed back together.

CAST

Tom Pearson
Carter Jenkins
15 year old, math and technology genius. He made his grades in purpose go down. He hates Ricky (his sister's boyfriend) and took revenge by controlling him by the aliens' mind device.




Austin Butler
Jake Pearson
Tom's cousin. The cool boy. He has an irrational dad and so is he. He made Tom to shoot Ricky by his gun. Yea his dad buys him such dangerous toys XD.







Hannah Pearson
Ashley Boettcher
7 year old girl. A member of the team. She made a friendship relation with a kind intruder. Sparks was the only non-threatening alien. Hannah tried to tell her dad about the aliens but Tom stopped her so then they pretended they were playing acting a video game characters.






Henri Young and Regan Young
Art & Lee Pearson
The twins Art and Lee are video games geeks. Unlike their brother Jake. They are quiet and smart. When first Ricky was under the aliens device control, they were like experts in controlling and using the device. It was like one of the video games they play on a game boy or whatever console.


Final thoughts:
great and funny movie. I recommend it for family gathering and every one ^^

peace and all good stuff

liberty ~

Sunday, December 19, 2010

Creating Frames [Java Tutorial]

This tutorial was completely written by ME


||..~


The tutorial will be talking about GUI (Graphical User Interface) in java programming language. we all know that java is a OOP language. it means that we can design interfaces for the software we develop, so that the user could interact much easily with it. That's what graphical interfaces aimed to.

let's write a code to show a window, or a FRAME as we call it in Java, and see how the code will look like:

import javax.swing.*;

public class JFrameTest {

    public static void main (String [] args) {

     JFrame f = new JFrame();

    }
       
}

now we've already created our frame.
let's take it line by line:


import javax.swing.*; 
this line is concerned for calling the package (javax.swing) which contains the JFrame component. simply, the frame cannot be created without including this package.

public class JFrameTest {
creating the class and name it as JFrameTest

public static void main (String [] args) {
this line is understood perfectly. If you are already taking tuts on GUI then it's probably not needed to explain.

JFrame f = new JFrame();
Here comes creating the frame and give it the name of f .

JFrame : the class name

f : creating the object (frame)

new : key word used for creating the frame which we gave f as the name of it .

JFrame : the constructor -followed by ' () ' and a ' ; ' , which has to be named the same as the class name .

and the last two lines are the closing brackets for JFrameTest and main classes.


||..~


if you run the code, nothing will show up. Because the frame is hidden and need to be visible. in this case, we need to set some attributes to the frame, at lease to make it visible. 
so what we do?
look at the following:

import javax.swing.*;

public class JFrameTest {

    public static void main (String [] args) {
     JFrame f = new JFrame();

     f.setVisible(true);

     }
    
} 

One line was added.


f.setVisible(true);
so this is the code responsible for making the frame VISIBLE

 (the object name) f [dot] (the method) setVisible ([the boolean value] true ) in between the brackets () 
of course we don't forget the semi colon ; 



||..~


Now let's add some other features to our frame .
Here goes the code :

import javax.swing.*;

public class JFrameTest {

    public static void main (String [] args) {

     JFrame f = new JFrame("Testing the Frame");

     f.setVisible(true);

     f.setSize(300,200);

     f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

      }
    
}

3 more things were added. let's pick them up one by one .


First one was giving the frame a title : "Testing the frame"
we mentioned it in between the brackets in the same line of creating the frame. this looks simple. note that title has to be in between Double Quotes " "


Next thing


f.setSize(300,200);
setting the size of the frame by adding the arguments in between the brackets (WIDTH , HEIGHT);
we set 300 as the width, 200 as the height.


Last one


f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this is a very useful line. well, it is a must in every frame we create. (may be some exceptions in higher levels)

this line is used for terminating the program. if we click on the (x) button, the program will still running, even though the frame disappears , the operation will still ON.
so we should include that code to stop the program when wanted to.

 (frame name) f [dot] (method name, which is.. ) setDefaultCloseOperation (in between the brackets) we call the class name which is JFrame [dot] (the method) CLOSE_ON_EXIT  
and remember all the time, the semi colon ;

(note: java is case sensitive. keep that in mind) 


||..~


and that's all i guess. I don't know how I was doing. just hoping I covered everything well and hope my words make you get the basic idea .


*comments will be very welcome*

wish you peace, and all good stuff =)

liberty~

Tuesday, December 14, 2010

A girl playing her 'PSP'?????!! WEIRD!!!

Why is it weird to see girls playing video games in our country?!
For me, it is not. But I have been facing that weird looks and stupid comments about me when I play video game.
Yesterday, I saw a girl in the cafeteria playing PSP. Perharps she had a break and she's spending her time.
Yes, spending break time in playing video games is a good idea.

When you're reading this, don't think that I am crazy about video games because it is not. I just like to play'em from a time to time. But those comments make me feel bad.
What kind of commentaries I would hear if I am a big video gamer? That's scary XD!
Well, looking at that girl holding a psp on her hands made me feel a little comfort that is: yes I am not alone here XD
But she looked consonant and happy ^.^
and I am happy for her.

XD

that's it XD I don't want to talk furthermore because there's nothing to discuus already,
it's all about our people's mentality

liberty~

Sunday, December 12, 2010

Hard work must start!

When somebody is about to fail a semester, that makes it a must to start serious work, isn't it? In my case, I have to mention my poor performance in study which I didn't seriously think that I may be in kind of an immediate position, lol XD
So yes, I'm in a critical situation unfortunately. I didn't want it to go this way but I was kind of out of control. I came to Muscat determined to study and learn, and to be stronger, not to be a failure. But in some way I got out of the track planned in my mind and found myself looking for extra and extra work.

Anyway, I must improve my progress in  a way or another, otherwise it will be so frustrating. My bad performance has stop right away, so in order to do that, I went to the college library to get some books. My first problem is the lack I have in understanding. Some courses I can say that I'm falling off. I thought to step forward in order to overcome my weak understanding by going to the library and get some books to help my out -I sound depressed about me as a bad understander dont I? well that's ok!

Basically, at the beginning of the semester, the assembly language course was ok, I was doing well, or is it what I thought? lol :p
Yea, as a beginning, the assembly language course is no doubt, HARD and tough! Yes it is, so I had two books for this course. One is 'Microprocessor and its applications', the other is 'Digital design'. The first wasn't the one I looked for but it serves the purpose. But actually it is very good book. I was kindly lost in assembly language and this helped me a little bit to be honest.

Well let's say that this is snapshot of a new beginning. In the further days I'm gonna make you know if I'm going well or........ hope not! I want everything to be alright, because you know there are two things I look for, One: to not fail. Two: to not learn nothing. Number two is the diamond for me. I'm a programmer, not yet a real programmer but I badly want to be. I don't want to pass this year with minimum knowledge. I hope it to get the other way round.

Yep, that's it for now. I'll try my best at least to not blame myself later and I'll try to not fail. I'm in a bad situation but I know that it is not too late. I still can handle it!

thanks for reading :)

Special thanks to my friend for helping me picking up the books ;p

liberty~

Monday, December 6, 2010

I'm still here!

This is for telling that I'm still ALIVE!!!!!

XD

peace and all good stuff~

Liberty :)

Monday, November 8, 2010

My first steps in Photography!

Not going to extend in talking here, because there is nothing to say. it's only my little attempts in photography, which i started few months back.

so here's the first shot:
moment of silent sense


the other one:
beautiful

(make note that "toot" is my username in a forum.)
i didn't know what to caption'em XD.................

ok then, comments are so so so much appreciated,  a beginner needs photography tips :P

tnx :)

Thursday, October 28, 2010

FOSS Presentation in HCT!

The presentation will be on
Saturday, 
30 October 2010, 
12 pm
in the Auditorium.

please Attend

Tuesday, October 19, 2010

Joined FOSS Group!

Yesterday I've met Ms. Asma AL Marhooby to inquire about the Free Open Source Software Group. I got so interested when she was talking about the activities the group would implement. Actually I found that very useful for programmers who want to improve their skills. The main thing is that the group will be concerned in practicing, discussions, and any sort of activities on Open Source softwares.

She gave me a set of hot headlines about that: for instance, we eventually may make our own Open Source software, isn't that interesting!? ^^
I'm so excited, my favorite word recently XD!

ummmmm, yea, but still students who joined the group not allowing the activities to get started, we still need some more members having skills in programming so that we can start.

Not forcing anyone XD, but anyhow, when feel like joining the FOSS group, go to room N238 and talk to Ms. Asma AL Marhooby.

Good luck

Sunday, October 17, 2010

A class in HCT!

I hate it, I hate it, I hate it. I hate when somebody doesn't make any react when people talk to him/her. I might be so so so angry if it is happening in front of me.

Today, and days before, the professor was asking some students, and in a way or another, when they were talking and laughing during all long the class, suddenly they got dumb. Yes, I'm upset of this kind of things. WHAT A SHAME! Yea I mean it! If you are talking in class, then why are you so silent when the professor asks? is that what you do with all people? God, what were they thinking? we are COOL?! My point is, whether you shut up during lesson, or you be active. That's it. Otherwise you step out of it as a whole. It wasn't any kind of a hard question or whatever, they just didn't want to answer him. Why? I may ask them someday.

Sorry for my words but I'm really depressed of that students.

Oh, let me take a breath!..........

ok that's all.

Friday, October 15, 2010

Counter-simple Java programm [Open Source]

Hello,
I wrote a code today, I was trying to do something I never did. Well, it's not that impressive but I'm happy I did it myself XD

take a look:

//October 15 2010 Friday
//5:26 pm
//by:Liberty
//www.hctlife.com
/* **************** */

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

public class test extends JFrame {
    private JButton button;
    private JLabel label;
    int i=0;
   
    public test(){
        super("Counter");
       
        Container container=getContentPane();
        container.setLayout(new FlowLayout() );
       
        button=new JButton("Click");
        container.add(button);
       
        label=new JLabel("count : 0");
        container.add(label);
       
        ButtonHandler handler=new ButtonHandler();
        button.addActionListener(handler);
       
        setSize(200,70);
        setVisible(true);
        setLocation(100,100);
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    }
   
    public static void main (String args []){
        test app=new test();
    }
   
    private class ButtonHandler implements ActionListener{
        public void actionPerformed (ActionEvent event){
            i++;
            label.setText("count : "+ i);
       
        }
    }
}

That's it.

Monday, October 11, 2010

GUI classes really started! (excited :D)

Today I had the first class in GUI programming. I had this course begun before, but today was the real go. Previous classes were only theoretical and, for sure, boring! but GUIs' is just exciting. I'm so excited ^^

This was the first program we had:

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

public class Login extends JFrame {
private JLabel uid,pwd;
private JTextField tuid;
private JPasswordField tpwd;
private JButton bok;

public Login() {
super ("Windows Login");

Container container = getContentPane();
container.setLayout(new FlowLayout() );

uid = new JLabel ("User ID");
container.add(uid);

tuid = new JTextField(10);
container.add(tuid);

pwd = new JLabel ("Password");
container.add(pwd);

tpwd = new JPasswordField(10);
container.add(tpwd);

bok = new JButton ("Login");
container.add(bok);

ButtonHandler handler=new ButtonHandler();
bok.addActionListener(handler);

setSize(400,100);
setVisible(true);
}

public static void main (String args [] ) {
Login application=new Login();

application.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}

private class ButtonHandler implements ActionListener{
public void actionPerformed (ActionEvent event){

String msg;

if ( (tuid.getText().equals("admin") ) && (tpwd.getText().equals("hct") ) )
{
msg="Login Successful";
}
else
{
msg="Login Failed";
}
JOptionPane.showMessageDialog(null,msg);
}

}
}

It's not too long as some students looked at it, it's just the way it is! <-- anyone get the point?? no problem.
I'm looking forward for further classes, I think they're gonna be more and more exciting, can't wait XD.
Mr. Anand is a good teacher. I like the way he teaches. Hope I could him teaching me next semester@@

Anyway, see you later :)

Thursday, October 7, 2010

Ambitious HCT Programmer

Came from Salalah to HCT this semester for Bachelor Degree. I'm staying in Muscat only till summer semester, so I'll do my best to gain as much as possible of knowledge in Programming this year. Wish me luck !

And this is enough as the first post in the Blog.


good luck for all :>