Showing posts with label Computer. Show all posts
Showing posts with label Computer. Show all posts

Saturday, 12 September 2015

Are you afraid of programming?

OMG, I have programming class after this. I should't go to class!
Some and many of the students, especially students who take course in Computer Science, have to take a programming course in the first semester. We cannot skip from word 'Programming' if we take Computer Science. The more you skip the class, the more you get nothing from this course. Don't try to skip even one class. If you are late, try to come. Late is better than nothing, sometimes I do that. Programming is something which is really fun if we know the concept. The analogy for student who failed in programming is like

"a doctor who doesn't know how to inject medicine to the patients...."
Programming is a way we communicate to the computer. We tell the computer about to do some tasks in instructions. Computer doesn't know our language, we have to know the language of the computer which already standardized with some rules. At this point we have to have, at least, a passion to learn another computer languages.

"You have to fall in love with 'Programming' right now !"
What is love? I don't know what is love exactly. But in my opinion, love is something that we are passionate about. With love, you can 'sacrifice' to do something for the one you love. How? tell your mind, heart and your subconscious to love a bit in programming. It is the first thing that you have to do. If you cant fall in love in programming, then you cant proceed to the next step.

"My seniors always say that programming is very difficult, many of them had failed several times.."
Influence from other, especially 'The Senior' is very important. The human psychology is often to get change by outsiders. Mostly, junior get influenced by their senior that programming is the scariest thing in this course. Let me tell you why the senior always say such thing. It is because their senior are failing too in that course. Senior wants you to inherit that failure continuously. Do not listen to them about something which makes you down. Just listen to something which makes your brain boost.

"You have to do your own growing, no matter your grandfather was" - Abraham Lincoln
White Lion Lyrics
Success obviously comes from what we do. What you do, is what you deserve. I remember the lyrics of White Lion "When the Children Cry". I suggest you to start sitting on your chair and face your laptop then start typing codes. Just write simple codes from the internet or lecturer slides. The common issue with the student is they don't know where to start the code? Their mind has lost somewhere. Perhaps, it is basically their logic is weak. I suggest you to write a codes based on the requirement of the project. let me give you an example:

if the project needs to print out the output of asking their name, age, address, etc, just try to write only that. Then the next step is to think another process such as addition, subtraction, or anything. It will make you little bit easier where the program is going.

Understanding the concept by making an analogy in the real life. . .
This is really important for the students. Most of the students try to memorize all the codes but they don't understand the concept of programming. Consequently, in final exam the codes are lost due to brain formatting. It happened to me too in final exam three years ago. I was so panic because I was not ready to memorize all the codes which was written in the handout.

Then I'd changed my learning style. Perhaps, my learning style is visual and auditory. I listen to the lecturer and I try to get the idea what is happening in the real world though just little bit. Example, class is consist of method and data. I create a class named 'CAT", then I connect to the 'CAT' in the real world. The method is something related to the behavior of the cat such as walking, eating, and sleeping. The data of the cat is the name of the cat, age and skin color. Easy right? Please try to make an analogy that makes you understand.

Gather and ask your friends who know about programming. . .
Lastly, you can ask your friend and receive some suggestions about the program that you are writing. I usually ask my lecturer or my senior to consult about my program. But sometimes, the word 'ask' is full of ambiguity. They don't literally ask about the project, but they need them to write a code for them. It is totally unacceptable.

VOILA, bonne chance mes amis!
Here is some link to boost your knowledge
TheNewBoston
Share:

Monday, 23 March 2015

Calculating Rectangle Using User-defined Class in Java



The question is
  • Write a class named Rectangle to represent rectangle objects. The UML diagram for the class is shown below.  Then, write a program to test the class Rectangle. In this program, create three Rectangle objects. The first object has width 4 and height 40 while the second object has width 25 and height 20.5.  Assign any colors that you like. The third object has 1 for both width and height but the color is red. For this object, use the first constructor and then change the color to red using the appropriate method. Display the properties of these objects including their areas, perimeters and diagonal lengths.

dThe here is I declare Rectangle Class.



/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package Exercise2;

/**
 *
 * @author Achmad Zulkarnain
 */
public class Rectangle {

    double width;
    double height;
    String color;

    public Rectangle() { //Default Constructor
        width = 1;
        height = 1;
        color = "green";
    }

    public Rectangle(double w, double h, String s) { //constructor
        width = w;
        height = h;
        color = s;
    }

    public double getWidth() {
        return width;
    }

    public void setWidth(double w) {
        width = w;
    }

    public double getheight() {
        return height;
    }

    public void setHeight(double h) {
        height = h;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String c) {
        color = c;
    }

    public double getArea() {
        return width*height;
    }

    public double getPerimeter() {
        return 2 * (width + height);
    }

    public double getDiagonal() {
        return Math.sqrt(Math.pow(width, 2) + Math.pow(height, 2));
    }
}


here I create another class which contain main method. Main method combine everything and which method should run.


package Exercise2;


public class javamain {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        Rectangle obj1 = new Rectangle(4, 40, "Purple");
        Rectangle obj2 = new Rectangle(25, 20.5, "Blue");
        Rectangle obj3 = new Rectangle();
        
        
        //Object 1
        System.out.println("The first object has width: "+obj1.getWidth());
        System.out.println("The first object has height: "+obj1.getheight());
        System.out.println("The first object has color: "+obj1.getColor());
        System.out.println("The area of the first object is "+obj1.getArea());
        System.out.println("The parimeter of this  object is "+obj1.getPerimeter());
        System.out.println("The diagonal object is "+obj1.getDiagonal());
        
        System.out.println("#######################################");
        //Object 2
        System.out.println("The second object has width: "+obj2.getWidth());
        System.out.println("The second object has height: "+obj2.getheight());
        System.out.println("The second object has color: "+obj2.getColor());
        System.out.println("The area of the second object is "+obj2.getArea());
        System.out.println("The parimeter of this  object is "+obj2.getPerimeter());
        System.out.println("The diagonal object is "+obj2.getDiagonal());
        System.out.println("#######################################");
        
        System.out.println("The third object has width: "+obj3.getWidth());
        System.out.println("The third object has height: "+obj3.getheight());
        obj3.setColor("Red");
        System.out.println("The third object has color: "+obj3.getColor());
        System.out.println("The area of the third object is "+obj3.getArea());
        System.out.println("The parimeter of this  object is "+obj3.getPerimeter());
        System.out.println("The diagonal object is "+obj3.getDiagonal());
    }
    
}

Share:

Identify First Name and Surname (Bin and Binti) in Java

Maybe in Islam name, people has father's name after their name. For man, use "bin" and for woman use "binti". And how to identify name in Java using bin or binti??

boolean found = Arrays.asList(name.split(" ")).contains(keyword);

Code above is to identify whether in that name contain words in keyword. if the value is true then execute the program. If false, then execute something else.

here is the code in Java, I used array and use keyword to determine.

import java.util.Arrays;
import java.util.Scanner;

/**
 *
 * @author Achmad Zulkarnain
 */
public class Surname {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);

        String keyword = "binti";

        System.out.print("Please enter your full name> ");
        String name = in.nextLine();

        boolean found = Arrays.asList(name.split(" ")).contains(keyword);
        if (found) {
            int Index = name.indexOf("binti");
            System.out.println("Hello your name is " + name.substring(0, (Index)));
            System.out.println("And your father's name is " + name.substring(Index + 6));
        } else {
            int Index = name.indexOf("bin");
            System.out.println("Hello your name is " + name.substring(0, (Index)));
            System.out.println("And your father's name is " + name.substring(Index + 4));
        }
    }
}



Share:

Sunday, 4 January 2015

Season Calculator in Java

For those of you where your place don't have four seasons like europe and any other countries have, don't be sad to determine which date of month is the season would be. I'd received this assignment from my lecturer to determine the season according to the date and month.

package calender;
import java.util.*;
public class Calender {

    public static void main(String[] args) {
        int date, month; //declare the variable
        
        //declare the Scanner so that user can store value to memory
        Scanner input = new Scanner(System.in);
        
        //Asking user to enter the date
        System.out.print("Please enter date: ");
        date = input.nextInt();
        
        //Asking user to enter month
        System.out.print("Please enter month: ");
        month = input.nextInt();
        
        //Condition to determine month not more than 13 and day not more than 32
        if (month >= 13 || month < 1 || date > 31 || date <= 0) {
            System.out.println("Please enter a valid date and month");
        } else {
            System.out.print("On "+getMonth(month)+", "+date+" the season ");
            System.out.println("is: "+season(date,month));
            
        }
    }//end main method
    
    public static String getMonth(int z) //Task3 Addition
    {
       //Switching number to string type
        switch(z)
        {
            case 1: 
               return "January";
               
            case 2:
                return "February";
                
            case 3: 
               return "March";
               
            case 4:
                return "April";
                
            case 5: 
               return "May";
               
            case 6:
                return "June";
                
            case 7: 
               return "July";
               
            case 8:
                return "August";
                
            case 9: 
               return "September";
               
            case 10:
                return "October";
                
            case 11: 
               return "November";
               
            case 12:
                return "December";
                
            default:
                return "No Month";
        }
    }//end getMonth method
    
    public static String season(int x, int y) //task2
    {
        String season = null; //Initializing season before statement
      
        //The condition when the season start
        if (((y == 12)&&(x>=16))||((y<=3)&&(x<=15))){
            season = "Winter";
        }          
        else if (((y >= 3)&&(x>=16))||((y<=6)&&(x<=15))){
            season = "Spring";
        }
        else if (((y >= 6)&&(x>=16))||((y<=9)&&(x<=15))){
            season = "Summer";
        } 
        else if (((y >= 9)&&(x>=16))||((y<=12)&&(x<=15))){
            season = "Fall";
        }
        return season;
    }   //end season method
}//end class

Share:

Sort First-digit of Integer Number

Maybe some of you know how to get first digit of number. For example this question: "how to get '2' from this number "2378940048"? Literally in logic, we can do this question by dividing this number with 10 and it will remain 237894004.8 (in decimal) and  we will get 237894004 (in integer), without 8 because integer does not recognize fraction /floating value. It's easy, isn't it?. Then, here it is!


  • Using Method First-digit

package firstletter;
import java.util.*;
public class FirstLetter {

    public static void main(String[] args) {
        int a; //declare the variable
        
        Scanner input = new Scanner(System.in);
        
        //Input from the user
        System.out.print("Please enter your number: ");
        a = input.nextInt();
        
        System.out.println("So the first digit of this '" +a+"' is: "+firstDigit(a));
    }//end main method
    
    public static int firstDigit(int n)
    {
        //Condition to determine the value 
       while (n < -9 || 9 < n) 
           n /= 10;
       return Math.abs(n); //Math absolute is used to round the value
    }//end First digit method
}


  • Using Single Method in main
package firstletter;
import java.util.*;
public class FirstLetter {

    public static void main(String[] args) {
        int a; //declare the variable
        
        Scanner input = new Scanner(System.in);
        
        //Input from the user
        System.out.print("Please enter your number: ");
        a = input.nextInt();
        
//Condition to determine the value 
       while (a < -9 || 9 < a ) {
           a /= 10;
}
        System.out.println("So the first digit of this '" +a +"' is: "+a);
   
}//end main method
Share:

Tuesday, 15 July 2014

Conky in BlankOn Linux 9 Suroboyo

I use BlankOn Linux distribution, I'd like to appreciate what my community invent and develop open source project. This project is from Indonesia, we should proud being Indonesian. Anyway, user has many options to use Linux but I prefer to use this distribution because it is complete and fulfill what I need. For instance, GIMP, Inkscape, VLC, geo.Blankon Map, etc are built in. The other distributions such us Ubuntu, Mint, Debian, Fedora etc; I think those distributions are complicated for beginner and also the system is heavy. You need to struggle with the internet to update your system after installing. I used to use those distributions which belong to "western community" but I didn't feel satisfied what I used. The problem with this new release (BlankOn 9 Suroboyo) is that user can't manage the disk when installing BlankOn, you need to arrange your partition with gparted or any other partition maker. And also with package repository, because the server in Indonesia and now I'm in Malaysia, my problem is only when I update my system, it's little bit slow. We are still on going to solve this problem by sending the 'ticket' to developer .And I encourage you guys to try this distribution and you will see the difference !! Keep in Open and Freedom!

Conky

Last time, I had problem with conky in BlankOn Linux 9. I wanted to see the system works in my BlankOn and I wonder whether I could use it or not. I've tried so many times to find and to search the solution about Conky. Suddenly, I could realize that it's very easy. What we need to have is only two: conky and conky manager. Done ! :D hehe. BlankOn 9 do not provide you startup application like in Ubuntu, so conky manager could help you. Dont worry too much about this :D !


Make sure that you are using root, if not you can type 'sudo' for privilege 
#  apt-get install conky conky-all

#cd && wget -O .start-conky http://drive.noobslab.com/data/conky/Techno/start-conky
#chmod +x .start-conky (give permission to this file)

These are the themes, and you can download from other resources:

$ cd && wget -O techno-noobslab-ugs.zip http://drive.noobslab.com/data/conky/Techno/techno-NoobsLab-ugs.zip

unzip techno-noobslab-ugs.zip && rm techno-noobslab-ugs.zip

Conky Startup

  1. What you need to do to make it work when start-up is using Conky-Manager
  2. Then thick what you need to show about the system


when you need to add some widget or themes of conky you can go to this button !

Share:

Monday, 17 June 2013

How to install driver which you don't know the type

Hi guys! Here I am after long time I did not post some article in my daily blog because "inconvenience" and now I will share with you about my experience in IT part which is how to install the driver that you don't understand the type. It's working within any windows XP/Vista/7/8 or above but in XP there is different word and it wont make you confused. Just EASY !!!


First of all :
  • You know how to find device manager, dont you ?? 
  • And then find the driver which is not installed yet (!/with yellow sign) 
  • Click details --> and find "Device Instance Path"
  • You copy that information through this page "http://devid.info/"
  • Finally you can find the software that you need! VOILA !!





Share:

Tuesday, 5 February 2013

Computing Discipline


Computing Discipline

There are many opinions about it, but based on my understanding, computing means all about knowledge which contain about theory, methodology, design and implementation whom have relation with computation in Hardware-Software. Not only student and worker has discipline, computing also has discipline. Discipline is Train (someone) to obey rules or a code of behavior, using punishment to correct disobedience. Meaning that people who are working in computer environment has own job, rules, role and purpose; in order to achieve and develop the structure of Information Technology. It has been argued that Information Technology is the main computation, some scholar articles say Information technology is the sub of computation itself. But it does not matter to argue with that kind of statement which called it “lack of Information”. We do not know whether is it correct or wrong (Dilemma). These are the members of computing discipline in Information Technology:


  • Computer Science

It began around 1940s together with development of algorithmic theory and mathematics logic. The Association for Computing Machinery (ACM) is a scientific and professional organization founded in 1947. It is concerned with the development and sharing of new knowledge about all aspects of computing . It has traditionally been the professional home of computer scientists who devise new ways of using computers and who advance the science and theory. Computer Science is also called “the mother of all computing”. Career path of Computer Science are:
  • Design and build a software.
  • They develop effective ways to solve computing problems .
  • They devise new ways to use computers .

  • Software Engineering

    it is step where computer science people applying a theory in computer science. Software engineering is the discipline of developing and maintaining software systems that behave reliably and efficiently, are affordable to develop and maintain, and satisfy all the requirements that customers have defined for them . SE more concerned with developing and maintaining software system while CS students are likely to have heard of the importance of such techniques, the engineering knowledge and experience provided in SE programs go beyond what CS programs can provide . And also learn how to provide genuinely useful and usable software is of paramount importance .

  • Information System

    Information systems specialists focus on integrating information technology solutions and business processes to meet the information needs of businesses and other enterprises, enabling them to achieve their objectives in an effective, efficient way . So, they can serve as an effective bridge between the technical and management communities within an organization, enabling them to work in harmony to ensure that the organization has the information and the systems it needs to support its operations .

  • Cognitive Science

    Cognitive science is the interdisciplinary study of mind and intelligence, embracing philosophy, psychology, artificial intelligence, neuro-science, linguistics, and anthropology. Its intellectual origins are in the mid-1950s when researchers in several fields began to develop theories of mind based on complex representations and computational procedures.

  • Computer Engineering

    It was leading before 1900a, Computer engineering is concerned with the design and construction of computers and computer-based systems. It involves the study of hardware, software, communications, and the interaction among them. Its curriculum focuses on the theories, principles, and practices of traditional electrical engineering and mathematics and applies them to the problems of designing computers and computer-based devices. 

    There is statement that "Most CS (Computer Science)people laugh at MIS/IT people and MIS/IT people make more money and manage the CS folks.” How do I respond this statement as IT people? In real life, many statements may happen either good or bad to us, depending how we face it professionally. Maybe CS people might think that they are the mother of computing. To me, it does not matter because in fact CS people do nothing as much as IT people do. IT people can work everywhere in any environment, for instance, medical, mechanical, in company etc. But CS people their work only in specific manner and they do not make more money only make a good job and invent something new which is good for us. Referring that statement maybe I will laugh back to them (CS). Hehehhe

    Reference


    Association for computing machinery.”Computing discipline and major”. Retrieved from:http://computingcareers.acm.org/?page_id=6



    ACM, AIS, IEEE-CS. (2005). Computing Curricula 2005: The joint task force for computing Curricula 2005.
Share:

Saturday, 29 September 2012

PATH CSC COMPILER

Hmm.. hai guys, long time I didn’t update my blog because there was something to do. Also because last course I had to update each week even each month to fulfill foundation course which was ICT subject.  Alhamdulillah I'm in Undergraduate program ICT Faculty and I think I have to share with you about my experience in this course. Share about weakness and strengtheness could improve our knowledge and solve IT problem among us. Today I would share with you guys about how to path C# programming language in your computer. I heard mostly people facing the same problem about csc compiler. Lets do !


1. Make sure you have Microsoft.NET v4 and download in the Microsoft, its FREE
2. Go to this folder and copy the address (CLICK IMAGE TO MAKE IT CLEAR FOR YOU)



3. Click windows and type in the search column “environtment”  “edit the system environment variable”  Environment variable and click new variable  write PATH and paste the address of the first step below. 


4. And csc compiler it will work in your command prompt.

Share:

Saturday, 14 January 2012

Proxy Transparant Linux Debian


Login root first before installing anything on our debian system. Install with the command:
      # apt-get install squid

After that you can configure it with the command
     # nano / etc / squid / squid.conf

search the files below and replace
              visible_hostname replace with your domain name
              cache_mgr contents of the e-mail to web master
              http_port 3128 transparent
              always_direct allow all
              cache_dir ufs / var / spool / squid 500 16 256
             

(For Access Control List)
acl lan src (IP / mask)
acl block dstdomain. google.com. facebook.com
word url_regex acl-i "/ etc / squid / word.txt" (for the word "the want on the block: eg women)


(moved under INSERT YOUR OWN)
http_access allow lan
http_access deny block
http_access deny word
           
Then create the cache directory by typing:
      # squid-z

Run the IP Forwarding:
      # echo 1> / proc/sys/net/ipv4/ip_forward

Disguise connection, install ipmasq:
      # apt-get install ipmasq

And for the last one, run the command:
     # iptables t nat-A POSTROUTING-o eth0-j MASQUERADE (eth0 = eth internet)
(The command above is for internet sharing)

     # iptables-t nat-A PREROUTING-p tcp - dport 80-j REDIRECT - to-port 3128
(This is to divert to port 3128 which is the proxy port)

     # / Etc / init.d / squid start

it's easy right ?? 
Share: