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

Monday, January 5, 2009

Little-Known Computer Languages

Basic, Fortran, Cobol : These programming languages are well known and (more or less) well loved throughout the computer industry. There are numerous other languages, however, that are less well known that still have ardent devotees. In fact, these little-known languages generally have the most fanatic admirers. For those who wish to know more about these obscure languages and why they are obscure I present the following catalog.

SIMPLE

SIMPLE is an acronym for Sheer Idiot's Monopurpose Programming Linguistic Environment. This language, developed at the Hanover College for Technical Misfits, was designed to make it impossible to write code with errors in it. The statements are, therefore confined to BEGIN, END, and STOP. No matter how you arrange the statements, you can't make a syntax error. Programs written in SIMPLE do nothing useful. Thus they achieve the results of programs written in other languages without the tedious, frustrating process of testing and debugging.

SLOBOL

SLOBOL is best known for the speed, or lack of it, of its compiler. Although many compilers allow you to take a coffee break while they compile, SLOBOL compilers allow you to take a trip to Bolivia to pick up the coffee. Forty-three programmers are known to have died of boredom sitting at their terminals while waiting for a SLOBOL program to compile. Weary SLOBOL programmers often turn to a related (but infinitely faster) language, COCAINE.

VALGOL

(With special thanks to Dan and Betsy "Moon Unit" Pfau) From its modest beginnings in southern California's San Fernando Valley, VALGOL is enjoying a dramatic surge of popularity across the industry. VALGOL commands include REALLY, LIKE, WELL, and Y$KNOW. Variables are assigned with the =LIKE and =TOTALLY operators. Other operators include the "CALIFORNIA BOOLEANS", FERSURE, and NOWAY. Repetions of code are handle in FOR-SURE loops. Here is a sample VALGOL program:

14 LIKE, Y$KNOW (I MEAN) START
%% IF
PI A =LIKE BITCHEN AND
01 B =LIKE TUBULAR AND
9C =LIKE GRODY^MAX
4K (FERSURE)^2
18 THEN
4I FOR I= LIKE 1 TO OH MAYBE 100
86 DO WAH + (DITTY^2)
9 BARF(I) =TOTALLY GROSS(OUT)
-17 SURE
1F LIKE BAG THIS PROGRAM
? REALLY
$$ LIKE TOTALLY (Y$KNOW)

VALGOL is characterized by its unfriendly error messages. For example, when the user makes a syntax error, the interpreter displays the message GAG ME WITH A SPOON.

LAIDBACK

Historically, VALGOL is a derivative of LAIDBACK, which was developed at the (now defunct) Marin County Center for T'ai Chi, Mellowness and Computer Programming, as an alternative to the more intense atmosphere in nearby Silicon Valley. The center was ideal for programmmers who liked to soak in hot tubs while they worked. Unfortunately, few programmers could survive there for long, since the center outlawed pizza and RC Cola in favor of bean curd and Perrier. Many mourn the demise of LAIDBACK because of its reputation as a gentle and nonthreatening language. For Example, LAIDBACK responded to syntax errors with the message, SORRY MAN, I CAN'T DEAL WITH THAT.

SARTRE

Named after the late existenitial philosopher. SARTRE is an extremely unstructured language. Statements in SARTRE have no purpose; they just are there. Thus SARTRE programs are left to define their own functions. SARTRE programmers tend to be boring and depressed and are no fun at parties.

FIFTH

FIFTH is a precision mathematical language in which the data types refer to quantity. The data types range from CC, OUNCE, SHOT, and JIGGER to FIFTH (hence the name of the language), LITER, MAGNUM, and BLOTTO. Commands refer to ingredients such as CHABLIS, CHARDONNAY, CABERBET, GIN, VERMOUTH, VODKA, SCOTCH and WHATEVERSAROUND. The many versions of the FIFTH language reflect the sophistication and financial status of its users. Commands in the ELITE dialect include VSOP and LAFITTE, while commands in the GUTTER dialect include HOOTCH and RIPPLE. The latter is a favorite of frustrated FORTH programmers who end up using the language.

C-

This language was named for the grade recieved by its creator when he submitted it as a class project in a graduate programming class. C- is best described as a "Low-Level" programming language. In fact, the language generally requires more C- statements than machine-code statements to execute a given task. In this respect, it is very similar to COBOL.

LITHP

This otherwise unremarkable language is distinguished by the absence of an "s" in its character set. Programmers and users must substitute "TH". LITHP is said to be utheful in proceththing littth.

DOGO

Developed at the Massachusetts Institute of Obedience Training. DOGO heralds a new era of computer-literates. DOGO commands include SIT, STAY, HEEL and ROLL OVER. An innovative feature of DOGO is "PUPPY GRAPHICS", in which a small cocker spaniel occasionally leaves a deposit as he travels across the screen.

Now you must have known about these unknown programming languages...

Wednesday, February 20, 2008

Download Free C & C++ Programming ebooks

Click on the links, then click on proceed.

Making a GUI in JAVA


Here in this tutorial you will be showed how to make a GUI in JAVA ...i.e.. how to make frames, panels, buttons and how to display dialog boxes.



The 2 most important things you will need :--
  • Basic knowledge of JAVA.
  • A JAVA compiler (like BlueJ or Eclipse)
Now just follow these steps:
  1. A JAVA GUI Program should be designed like the diagram below (at least it's what I think): - main() - Frame -- Content Panel --- Buttons --- Text Areas --- Menus --- and so on
  2. Import some important files. import java.awt.*; import java.awt.event.*; import javax.swing.*;
  3. Create a new class, extend it to ActionListener and create the main Method. public class HelloGui implements ActionListener { public static void main(String[] args) { } }
  4. Under the main method create an instance of the class itself. HelloGui myProgram = new HelloGui();
  5. Create buttons and attach action listeners. JButton ladiesButton = new JButton("Ladies"); ladiesButton.setActionCommand("clickfromLadies"); ladiesButton.addActionListener(myProgram); JButton gentsButton = new JButton("Gents"); gentsButton.setActionCommand("clickfromGents"); gentsButton.addActionListener(myProgram);
  6. Create an instance of the JPanel JPanel contentPanel = new JPanel(new GridLayout(0, 1));
  7. Add the created buttons in the content panel and create a window/frame. contentPanel.add(ladiesButton); contentPanel.add(gentsButton);
  8. Create an instance of the JFrame to give your GUI Program a window. JFrame mainWindow = new JFrame("Hello Java GUI Program by Rooseveltrp.com");
  9. Add the content pane in the window. Rebuild the window and then display it. mainWindow.getContentPane().add(contentPanel); mainWindow.pack(); mainWindow.setVisible(true);
  10. Create a new method called public void actionPerformed(ActionEvent e).
  11. Inside the method actionPerformed enter the following codes to control the clicks from your button. public void actionPerformed(ActionEvent e) { if(e.getActionCommand().equals("clickfromLadies")) { JOptionPane.showMessageDialog(null, "Roosevelt Loves Ladies!"); } else if(e.getActionCommand().equals("clickfromGents")) { JOptionPane.showMessageDialog(null, "Honestly, Roosevelt doesn't care about men!"); } }
  12. If you've done everything well your codes will look just like below: import java.awt.*; import java.awt.event.*; import javax.swing.*; public class HelloGui implements ActionListener { public static void main(String[] args) { HelloGui myProgram = new HelloGui(); JButton ladiesButton = new JButton("Ladies"); ladiesButton.setActionCommand("clickfromLadies"); ladiesButton.addActionListener(myProgram); JButton gentsButton = new JButton("Gents"); gentsButton.setActionCommand("clickfromGents"); gentsButton.addActionListener(myProgram); JPanel contentPanel = new JPanel(new GridLayout(0, 1)); contentPanel.add(ladiesButton); contentPanel.add(gentsButton); JFrame mainWindow = new JFrame("Hello Java GUI Program by Rooseveltrp.com"); mainWindow.getContentPane().add(contentPanel); mainWindow.pack(); mainWindow.setVisible(true); } public void actionPerformed(ActionEvent e) { if(e.getActionCommand().equals("clickfromLadies")) { JOptionPane.showMessageDialog(null, "Roosevelt Loves Ladies!"); } else if(e.getActionCommand().equals("clickfromGents")) { JOptionPane.showMessageDialog(null, "Honestly, Roosevelt doesn't care about men!"); } } }
  13. Program should output the following results.