Monday, December 7, 2009

Learnings Dec. 1- Jan.5 (lorebeth betinol)

WE have no class!! Becausse its teachers day. There is a Teachers dance contest at the Tagum City Pavilion.

But some of our classmates is task to report about iterative statements..

Here....

Iterative StatementsIterative statements, commonly referred to as looping statements, involve executing a series of statements zero or more times. We will discuss two specific shell looping statements, the while loop and the for loop.
The while loop executes the statement block enclosed within zero or more times as long as the boolean condition (or command) evaluates to TRUE (which again means returns a zero exit status). The general syntax of the while loop is: while boolean_condition
do
statement
optional statement(s)
done
As with the if-then statement, the boolean_condition is usually (but not always) evaluated using the test command. Note also that the body of the while is enclosed with the do-done statements. Thus if we wanted to find a sum of the numbers between 1 and 5, we could do this with the following while loop: COUNT=1
SUM=0
while [ "$COUNT" -le 5 ]
do
SUM=`expr $SUM + $COUNT` # or SUM=$(( SUM + COUNT ))
COUNT=`expr $COUNT + 1`
done
Note the double quotes surrounding the COUNT variable; these are to make sure this variable is seen by test, even if it has no value, to avoid any errors (as described above). Always keep in mind when coding looping statements that a condition must occur to terminate the loop, otherwise an infinite looping condition occurs. Incrementing the variable COUNT by 1 in this cases causes the value of COUNT to eventually reach 6 causing the loop to terminate. As with the if-then scenario described above, the while-do structure can be written as follows if desired: while [ "$COUNT" -le 5 ] ; do Another looping statement worth of discussion here is the for statement. While many modern languages have for statements, the for statement in the shell is a little different. The general syntax is as follows: for VARIABLE in list
do
statement
optional statement(s)
done
Unlike the while statement, a for statement doesn't terminate based upon a condition, rather it terminates when all items in the list have been "processed." The concept of a list was first introduced with the discussion regarding special environment variables. A list is a grouping of data items, sometimes referred to as words, since they are separated by spaces. A list may have zero items, a few items, or a large number of items. A list (with more than one item) will have a beginning item (the leftmost) and an ending item (the rightmost). The items in the list can be strings, variables, files, etc.
When a for loop executes for the first time, the VARIABLE will be assigned the first (leftmost) item in the list. During each subsequent iteration of the loop, the variable will be assigned the next item in the list. Thus when all items in the list have been assigned to the variable, the loop terminates. Refer to the following example: The variable name in this example is VALUE, and the list is composed of the 3 items (or words) "fred", "barney", and "dino." Thus when this loop executes, the following is the output: VALUE: fred VALUE: barney VALUE: dinoNotice there are 3 items in the list and the body of the loop executes 3 times. Thus for a list of size n, the body of a for loop will execute n times. Lists in for loops can be specified a number of ways, for example:
list
represents
item1 item2 ... itemn
a list of n items
$1 $2 $3
a list of 3 command line parameters
$*
a list of all command line parameters
*
a list of all files in current directory
a*
a list of all files starting with the letter aFor loops are typically used to process a quantity of things, for example, renaming all of the files in a directory by appending an extension of .backup (to indicate a backup copy) to their filename. As with the other scenarios described above, the for can be written as follows if one prefers: for VARIABLE in list ; do

Saturday, February 28, 2009

Learnings of the Week(Feb.23-27)
By: Frea Diane T. Bautista

This week, we were told about our new projects to be done. Group 6-10 were assigned to make an HTML about TCNHS(Tagum City National High School), while, WE,
Group 1-5 were assigned to make a program interfacing AC Load, Push Buttons and LED. Fortunately, some of the Group 1-4 members are helping us in making our assigned project about interfacing wth LED. However, Sir Ernie is checking the progress of our project everyday.

February 23 - 27, 2009

Learnings of The Week
By: Cielito M. Cantero
IV - Rizal


This week, all the groups from group 1 to 10 were given all the time to finish there projects.

Also this week, Sir Ernie was always checking every progress and improvement in our project.

Eventhough making our project was very hard, we were still thankful because some of the groups (group 1 - 4) were helping us to do our task well.

Through this project, I learned many things about parallel port and its use in many fields.

We all hope that we will be able to accomplish the work that will give us great score!

Good Luck To Us!!!

-------------------------------------------------------------------------------------

ui sir!

ayo na baya amu blog..

dpat iAdd nimu amo grade sa blog sa 3rd grading sa grade namu sa 4th grading...

hehe,. atik lang Sir..

gmay ra jud bya amu grade sa 3rd grading Sir,.

murag kami na grupo ang pinakalowest...

huhuhu..

T_T

Sunday, February 22, 2009

Learnings (betinol)

Actually this week we had disscussed about our projects.
From group 1-5 it will be all about programming, and the rest will be html making.

Our group is task to do a Program which is interfacing LED.

It is hard we know but we have to try inorder for us to learn.

Saturday, February 21, 2009

Learnings of the Week(Feb.16-20)
By: Frea Diane T. Bauista

This week, we just continued finishing our new activity about CSS. In making our CSS, we used the Frameset. But what is Frameset?

The FRAMESET element is a frame container for dividing a window into rectangular subspaces called frames. In a Frameset document, the outermost FRAMESET element takes the place of BODY and immediately follows the HEAD.

The FRAMESET element contains one or more FRAMESET or FRAME elements, along with an optional NOFRAMES element to provide alternate content for browsers that do not support frames or have frames disabled. A meaningful NOFRAMES element should always be provided and should at the very least contain links to the main frame or frames.

The ROWS and COLS attributes define the dimensions of each frame in the set. Each attribute takes a comma-separated list of lengths, specified in pixels, as a percentage, or as a relative length. A relative length is expressed as i* where i is an integer. For example, a frameset defined with ROWS="3*,*" (* is equivalent to 1*) will have its first row allotted three times the height of the second row.

The values specified for the ROWS attribute give the height of each row, from top to bottom. The COLS attribute gives the width of each column from left to right. If ROWS or COLS is omitted, the implied value for the attribute is 100%. If both attributes are specified, a grid is defined and filled left-to-right then top-to-bottom.

The FRAMESET element also accepts ONLOAD and ONUNLOAD attributes to specify client-side scripting actions to perform when the frames have all been loaded or removed.

February 16 - 20, 2009

LEARNINGS OF THE WEEK
By: Cielito M. Cantero
IV - Rizal

After programming, html, css, and etc..
This week, we were task to make our project to be passed before the finals
and this project will serve as our 4th grading project!

This project is all about the Parallel Port Interface for Groups 1 to 5 and HTML again for Groups 6 to 10..

By the way, do you know what parallel port interfacing is??

For you to know, read the following below...:

Parallel Port??

Parallel port is a simple and inexpensive tool for building computer controlled devices and projects. The simplicity and ease of programming makes parallel port popular in electronics hobbyist world. The parallel port is often used in Computer controlled robots, Atmel/PIC programmers, home automation, ...etc... Here a simple tutorial on parallel port interfacing and programming with some examples.

Everybody knows what is parallel port, where it can be found, and for what it is being used. the primary use of parallel port is to connect printers to computer and is specifically designed for this purpose. Thus it is often called as printer Port or Centronics port (this name came from a popular printer manufacturing company 'Centronics' who devised some standards for parallel port). You can see the parallel port connector in the rear panel of your PC. It is a 25 pin female (DB25) connector (to which printer is connected). On almost all the PCs only one parallel port is present, but you can add more by buying and inserting ISA/PCI parallel port cards.


Parallel port modes

The IEEE 1284 Standard which has been published in 1994 defines five modes of data transfer for parallel port. They are,

1) Compatibility Mode
2) Nibble Mode
3) Byte Mode
4) EPP
5) ECP

The programs, circuits and other information found in this tutorial are compatible to almost all types of parallel ports and can be used without any problems


Hardware: Parallel Port

The lines in DB25 connector are divided in to three groups, they are

1) Data lines (data bus)
2) Control lines
3) Status lines

As the name refers , data is transferred over data lines , Control lines are used to control the peripheral and of course , the peripheral returns status signals back computer through Status lines. These lines are connected to Data, Control And Status registers internally .

Parallel port registers

As you know, the Data, Control and status lines are connected to there corresponding registers inside the computer. So by manipulating these registers in program , one can easily read or write to parallel port with programming languages like 'C' and BASIC.

The registers found in standard parallel port are:

1) data register
2) Status register
3) Control register

As there names specifies, Data register is connected to Data lines, Control register is connected to control lines and Status register is connected to Status lines. (Here the word connection does not mean that there is some physical connection between data/control/status lines. The registers are virtually connected to the corresponding lines.). So what ever you write to these registers , will appear in corresponding lines as voltages, Of course, you can measure it with a multimeter. And What ever you give to Parallel port as voltages can be read from these registers(with some restrictions). For example , if we write '1' to Data register , the line Data0 will be driven to +5v. Just like this ,we can programmatically turn on and off any of the data lines and Control lines.

Where these registers are ?

In an IBM PC, these registers are IO mapped and will have unique address. We have to find these addresses to work with parallel port. For a typical PC , the base address of LPT1 is 0x378 and of LPT2 is 0x278. The data register resides at this base address , status register at baseaddress + 1 and the control register is at baseaddress + 2. So once we have the base address , we can calculate the address of each registers in this manner. The table below shows the register addresses of LPT1 and LPT2.

Programming Concepts

Almost all programming languages allow programmers to access parallel port using some library functions. For example , Borland C is providing "Inportb" and "Outportb" functions to read or write IO mapped peripherals. But the examples provided here in this tutorial is written VC++ and can be easily ported to other compilers like Borland C and Turbo C. Visual Basic does not have any functions or support to access parallel port directly, but it is possible to add such capabilities to your VB application by writing a dll in VC++ and calling its exported functions from VB. VC++ provides two functions to access IO mapped peripherals, '_inp' for reading and '_outp' for writing. These functions are declared in "conio.h".


How to Test The Program ?

Connect The assembled hardware shown above to your PC's parallel port. Open DOS command window Move to "C:\" and type "partest1 write 888 255" and press enter. If everything is correct , LED1 to LED8 in the hardware will glow. You may be doubtful about the command line parameters passed to the program. Here 888(0x378) is the address of the parallel port data register and 255 is the data to be written to parallel port data register. if you enter "partest1 read 888" to command line , the program will read parallel port data register and display it. This will blindly read the contents of parallel port data register , but not the data present on data lines. To read the data from the data lines , we will have to enable the bidirectional data transfer first. To enable Bidirectional data transfer just set the "Bidirectional" bit (bit 5) in control register. This is done by writing 32 to control register. The command "partest1 write 890 32" will do this. After entering this command you can read the status of switches in the hardware using the command "partest1 read 888"

NOTE: This sample program will not work on Windows NT/2000 or XP if you run the program on these machines , it will show an error. use new Inpout32.dll on NT/2000/XP machines



Me??
I belong to Group 5 and task to make a parallel port interface with LED or Light Emitting Diodes..

This project seems to be very hard for us especially because all of my groupmates
are girls and no one know how to do it well...

Even though Sir Ernie taught us already using some presentations, it's still
hard for us to do it right..

But we are still doing our best and hoping to have a good outcome...

That's All.

And good luck to us.

-------------------------------------------------------------------------------------

miskan baratuhon lang mga materials nOh, lisod man pud au..

huhuhu..

electric na man gud ni xa..

hehe,.

:]

Sunday, February 15, 2009

February 9 - 13, 2009

lEARNINGS OF THE WEEK
By: Cielito M. Cantero
IV - Rizal

This week, we are on HTML again...
But this second time around, we will do it with CSS or what we call as Cascading Style Sheet and Frames.

By the way, what do we mean by this things?? ahmm.. Well,


CSS or Cascading Style Sheet and Frames

There are two kinds of Style sheets the external and internal style sheet:

♥External Style Sheet

An external style sheet is ideal when the style is applied to many pages. With an external style sheet, you can change the look of an entire Web site by changing one file. Each page must link to the style sheet using the tag. The ‹link› goes inside the head section.

♥Internal Style Sheet

An internal style sheet should be used when a single document has a unique style. You define internal styles in the head section with the ‹style› ‹link› tag.

Frames

In HTML, frames enable you present multiple HTML documents within the same window. For example, you can have a left frame for navigation and a right frame for the main content.

Frames are achieved by creating a frameset page, and defining each frame from within that page. This frameset page doesn't actually contain any content - just a reference to each frame. The HTML frame tag is used to specify each frame within the frameset. All frame tags are nested with a frameset tag.


Making HTML with CSS is also fun but so confusing...

You know, CSS is different from HTML..
That's why I'm confused..

That's All.

The week is over now.

-------------------------------------------------------------------------------------

suko na pud blik aq papa kay gabie au ko uwi..

kinsa man gud dli magab-ihan na alangan ugma na dayon ipasa ang HTML with CSS??

ata au..

saba man mi bah..

huhuhu..

hapit na gud 2 hating-gabi ng nakauwi me tanan..

may gneh daghan me..

pero dako au aq byad sa time ouie..

sagdi lang.. that's part of schooling.

hehe,.

hay!! humana na jud..