...LAB EXERCISE 1: READ FROM URL URLReader.java import java.net.*; import java.io.*; public class URLReader { public static void main(String[] args) throws Exception { URL yahoo = new URL("http://www.lelong.com/"); BufferedReader in = new BufferedReader( new InputStreamReader( yahoo.openStream())); String inputLine; for ( int i =0;(inputLine = in.readLine()) != null; i++){ System.out.println(inputLine);} in.close(); } } LAB EXERCISE 2: Echo Client EchoClient .java import java.io.*; import java.net.*; public class EchoClient { public static void main(String[] args) { try { Socket s = new Socket("127.0.0.1", 9999); BufferedReader r = new BufferedReader(new InputStreamReader(s.getInputStream())); PrintWriter w = new PrintWriter(s.getOutputStream(), true); BufferedReader con = new BufferedReader(new InputStreamReader(System.in)); String line; do { line = r.readLine(); if ( line != null ) System.out.println(line); line = con.readLine(); w.println(line); } while ( !line.trim().equals("bye") ); } catch (Exception err) { System.err.println(err); } } } LAB EXERCISE 3:MULTI THREADS SimpleThreads.java public class SimpleThreads { //Display a message, preceded by the name of the current thread static void threadMessage(String message) { String threadName = Thread.currentThread().getName(); System...
Words: 1219 - Pages: 5
...IT110-1302A-06 Introduction to Programming Hockey Performance 5/6/2013 TABLE OF CONTENTS Contents TITLE PAGE 1 TABLE OF CONTENTS 2 Week 1: Project Outline 3 Week 1: Project Outline 4 Week 1: Use Case Diagrams 5 Week 1: Class Diagram 6 Week 2: Java Fundamental 7 Week 2: Java Fundamental 8 Week 3: Java Control Structures 9 Week 3: Java Control Structures 10 Week 4: Error Handling and File Input/Output 11 Week 4: Error Handling and File Input/Output 13 Week 4: Error Handling and File Input/Output 14 Week 4: Error Handling and File Input/Output 15 Week 4: Error Handling and File Input/Output 16 Week 4: Error Handling and File Input/Output 17 Week 4: Error Handling and File Input/Output 18 Week 4: Error Handling and File Input/Output 19 Week 4: Error Handling and File Input/Output 20 Week 5: Final Application Design & Screenshots 21 Week 5: Final Application Design & Screenshots 22 Week 5: Final Application Design & Screenshots 23 Week 5: Final Application Design & Screenshots 24 Week 5: Final Application Design & Screenshots 25 Week 5: Final Application Design & Screenshots 26 Week 5: Final Application Design & Screenshots 27 Week 5: Final Application Design & Screenshots 28 Week 5: Final Application Design & Screenshots 29 REFERENCE: An Introduction to Java Programming and Object-Oriented Application Development 29 ISBN-13: 9780619217464 29 Author(s): Johnson 29 Week 1: Project Outline ...
Words: 773 - Pages: 4
...THE WAJA CONCEPT Proton’s Waja was conceptualised as the basis for the company’s advancement from assembly and minor re-engineering to the position of full design and manufacture. It was designed as a competitive product for global consumption of the 21st Century with an attractive design targeting mature, dynamic and multi-cultural markets. The Proton Waja boasts superlative handling dynamics together with compliant ride and enormous body strength and integrity. The new Proton broadens the company’s product line-up joining the cult-status Satria GTi as well as the price-leading Persona and Satria models. Waja is the result of intensive engineering work by Proton R & D in Malaysia and Lotus Engineering in Hethel, England. The blend of technologies from Malaysia and England has produced a car that is at once safe, secure, strong and precise, a car worthy of comparison with the world’s best mid-size sedans. KEY TECHNICAL FEATURES OF THE WAJA • Lotus ride and handling • Unique modular integration • A stronger more rigid body • High levels of primary and secondary safety • Significant NVH reductions STYLING The Proton Waja benefits from inspired styling and boasts clean and stylish lines born in the company’s design studio at Shah Alam. The Waja has a personality all its own and has adopted clean smooth lines in a classic three box design on a platform which will be used as the basis for other models in the future. The styling has been aimed...
Words: 1378 - Pages: 6
...public abstract class Animal extends Organism { boolean ateThisTurn; boolean wantsToMove; public void wasIJustFed(boolean ateOrNot) { if (ateOrNot == true) { ateThisTurn = true; } else { ateThisTurn = false; } } public void resetHunger() { ateThisTurn = false; } public void wasIJustMoved(boolean movedOrNot) { if (movedOrNot) { wantsToMove = false; } else { wantsToMove = true; } } public String toString() { String deadOrAlive = new String(); if (isAlive) { deadOrAlive = "A Living "; } else { deadOrAlive = "A Dead "; } return "[" + deadOrAlive + organismType + ": " + currentHP + "/" + maxHP + " | " + lastReproduced + "/" + reproduceEvery + " - ateThisTurn = " + ateThisTurn + "\n"; } public boolean justAte() { return ateThisTurn; } public boolean moveThisTurn() { return wantsToMove && isAlive; } public boolean isReadyToReproduce() { return super.isReadyToReproduce() && maxHP == currentHP && ateThisTurn && isAlive; } public boolean isBurning() { return false; } } import java.awt.*; import java.util.ArrayList; public class Breeder { public Breeder() { } public static void breed(Organism breedingOrganism, WorldWorker environment, Point pointHolder)...
Words: 2671 - Pages: 11
...Introduction Article 15(4) was inserted into the Constitution by way of amendment and wasn’t a clause which was present in the Constitution, since it came into being. This amendment gave the executive powers to make any special provisions for the advancement of any socially and educationally backward classes of citizens or for the Schedule Castes and Schedule Tribes. This provision was considered necessary by the legislature as India gained independence and a democratic form of Government came into being, the need to uplift the down-trodden was felt. Reservation were to be implemented initially for only 10 years but have being continuing till now. Over the years the extent to which reservations should be allowed has been a matter of great controversy and has been discussed in various cases. The present condition is that reservations in general should not exceed 50%. But this was not always the position. Since Article 15(4) permits discrimination in reverse by reserving seats in educational institutions, the extent of such reservation assumes great importance for the citizen, for the public generally and for the State. An instructive illustration of such appointments to unreserved and reserved posts is furnished by the facts of T. Devadasan v. Union of India and Anr. Out of 45 appointments to be made, 16 were made from unreserved seats and 29 from candidates belonging to the Schedule Castes and Tribes. The petitioner complained that although he had obtained 61 per cent marks...
Words: 1443 - Pages: 6
...Question 1: (5 marks) Write a program in Java using linked list to manage information about persons. Variables used to store information about a person are: • name - the name of a person (character string). • age - the age of a person (integer value). You should write the MyList class, which is a linked list data structure to store person information. The following functions should be included in the MyList class: • void addLast(String xName, int xAge) - check if the first letter of xName is not 'B' (i.e. xName.charAt(0) != 'B') then add new person with name=xName, age=xAge to the end of the list. • void addFirst(String xName, int xAge) - check if the first letter of xName is not 'B' then add new person with name=xName, age=xAge to the begining of the list. • void addMany(String [] a, int [] b) - this function is given. • void ftraverse(RandomAccessFile f) throws Exception - display all nodes in the file f in format: (name, age). This function is given. • void f1() – Test addLast function. You do not need to edit this function. Your task is to complete the function addLast(String xName, int xAge) function only. With the given data, the content of f1.txt must be the following: (A0,9) (A7,13) (A5,7) (A3,11) (A4,9) (A2,12) (A6,5) (A1,6) • void f2() – Test addFirst function. You do not need to edit this function. Your task is to complete the function addFirst(String xName, int xAge) function only. With the given data, the content of f2.txt must be the following: ...
Words: 349 - Pages: 2
...MIPS Reference Data Card (“Green Card”) 1. Pull along perforation to separate card 2. Fold bottom side (columns 3 and 4) together M I P S Reference Data Add Immediate Add Unsigned And And Immediate Branch On Equal addi 1 CORE INSTRUCTION SET FORNAME, MNEMONIC MAT OPERATION (in Verilog) add Add R R[rd] = R[rs] + R[rt] I I R[rt] = R[rs] + SignExtImm R[rt] = R[rs] + SignExtImm Add Imm. Unsigned addiu addu and andi beq OPCODE / FUNCT (Hex) (1) 0 / 20hex (1,2) (2) 8hex 9hex 0 / 21hex 0 / 24hex (3) (4) (4) (5) (5) chex 4hex 5hex 2hex 3hex 0 / 08hex (2) (2) (2,7) (2) 24hex 25hex 30hex fhex 23hex 0 / 27hex 0 / 25hex (3) dhex 0 / 2ahex R R[rd] = R[rs] + R[rt] R R[rd] = R[rs] & R[rt] I I I J J R[rt] = R[rs] & ZeroExtImm if(R[rs]==R[rt]) PC=PC+4+BranchAddr if(R[rs]!=R[rt]) PC=PC+4+BranchAddr PC=JumpAddr R[31]=PC+8;PC=JumpAddr Branch On Not Equal bne Jump Jump And Link Jump Register j jal jr Load Byte Unsigned lbu Load Halfword Unsigned Load Linked Load Upper Imm. Load Word Nor Or Or Immediate Set Less Than lhu ll lui lw nor or ori slt R PC=R[rs] R[rt]={24’b0,M[R[rs] I +SignExtImm](7:0)} R[rt]={16’b0,M[R[rs] I +SignExtImm](15:0)} I R[rt] = M[R[rs]+SignExtImm] I I R[rt] = {imm, 16’b0} R[rt] = M[R[rs]+SignExtImm] R R[rd] = ~ (R[rs] | R[rt]) R R[rd] = R[rs] | R[rt] I I R[rt] = R[rs] | ZeroExtImm R R[rd] = (R[rs] < R[rt]) ? 1 : 0 OPCODE / FMT /FT FOR/ FUNCT NAME, MNEMONIC MAT OPERATION (Hex) bc1t FI if(FPcond)PC=PC+4+BranchAddr (4) 11/8/1/-Branch On FP True...
Words: 2042 - Pages: 9
...THE POWER LINE POLES If you were in the position of Gordon Yarrow how would you deal with the bid exceptions requested? If I was Mr. Yarrow, I would request Henry Nelson Co. that several pre-award meetings are held to discuss the exceptions made with the goal of setting final agreements on these exceptions prior contracting the services. I would also make sure that these discussions are recorded as minutes of the meetings so that the document(s) can become an integral part of Henry Nelson’s quote and eventually included in the contract agreement. With regards to each of the exceptions requested (Exhibit 2), my comments are: • Exception 1: To handle this exception, Moren should request Henry Nelson and for that matter all bidders, to include in their quote a Jobsite delivery. Although most of the companies in the US are more familiar with the UCC transportation terms, Moren should request that the latest version of Incoterms (developed by the ICC) should be used as the applicable transportation terms of the contract. By enforcing the use of Incoterms, Moren may even specify that the quoted terms should be DDP-Jobsite which would indicate Henry Nelson and all other bidders that the supplier “must” carry the responsibility and risk of delivering the equipment to the jobsite by the requested date. With this in mind, Henry Nelson and other bidders should include as part of their cost estimate the costs for using DDP-Jobsite delivery terms. This way, the sales price to Moren is...
Words: 913 - Pages: 4
...|FRONT SHEET FOR ASSESSMENT fORM & FEEDBACK TO LEARNER(HND) | |ورقة الغلاف لنموذج ورقة العمل ونتائج المتدرب | |BTEC High National Diploma in { } | |Diploma in Programming Technology دبلوم تقنيه البرمجة | |HND Computing (software development) | | | |Student Name | |اسم المتدرب | | | | ...
Words: 1682 - Pages: 7
...Interpersonal Relationships Analysis This comprehensive analysis determines the concepts, components, and elements of interpersonal relationships. The concept of attraction foundations shows four different stages of attraction beginning with social and interpersonal communication skills forming a bond between two people. The social environment promotes building of interpersonal relationships for both the professional and private environments. The unique exchanges between interpersonal relationships involve more than verbal communication between two people. The interpersonal relationships form the basic idealism for professional, and private communication skills. Interpersonal Communication Skills Most people become involved in interpersonal relationships interact with each other covertly, or face-to-face (Cavazos, 2010). Many relationships occur from physical, or emotional behavior between two people. The personal relationship begins innocently enough with the interaction between family, and friends, or extends to coworkers, and clients. The social environment induces building of interpersonal relationships for both business and pleasure. The emotional and physical commitment of interpersonal relationships shows through more than verbal communication. The unique exchanges between interpersonal relationships involve more than verbal communication between two people. Most people communicate with the motion of his, or her hands to emphasize a point. The combination of verbal...
Words: 1607 - Pages: 7
...House Cricket Experiment Introduction The topic of house cricket aggression in response to residency has been previously studied. (Alexander 1961) split this aggression behavior into five levels: 1) no aggression, dominance, or retreat; 2) no aggression with a retreat by one cricket; 3) mild one-sided aggression with mild repercussion; 4) moderate to intense aggression from both crickets; or 5) sustained combat. Interestingly, in Polistes wasps (Pardi 1948a), Sphecius wasps (Mr Norman Lin, personal communication), and crayfish (Bovbjerg 1953; Lowe 1956) aggressive behavior has been split into four or five levels. (Alexander 1961) The experimental organism in this experiment was Acheta domesticus, more commonly known as the house cricket. Acheta domesticus (Linnaeus) is a species distributed by man. It was considered native to Europe but may have come from northern Africa or Southwest Asia according to Ghouri (1961). Both Blatchley (1920) and Alexander (1957) have reported it in the eastern United States. (Weissman and Rentz 1977) The purpose of the house cricket experiment was to answer the question: “Does residency affect a male cricket’s motivation in pair-wise interactions with other male crickets?” The hypothesis was “male crickets that are resident in a territory have greater motivation to defend their territory”. The prediction was if male crickets that are residents in an artificial territory are challenged by introduction of an intruder, they will win more aggressive...
Words: 1230 - Pages: 5
...Literary Element: Character Title: Saving Sourdi (May-Lee Chai) Character and Saving Sourdi The short story Saving Sourdi by May-Lee Chai is an interesting story in how the characters play completely different roles. Nea, the narrator and Sourdi’s sister, is the main protagonist in the story as she and her sister grow up from children into adults. Although they grow up together, their characters develop differently, and Nea falls behind, maturity-wise, while Sourdi continuously matures. This is likely due to her aggressive behavior in combination with her anxiety, which play negative roles throughout the story. Nea is constantly attempting to save her sister throughout the entire story but fails over and over again; this shows Nea’s perseverance but also shows her aggressiveness. However, she never truly grows up in the story, while her sister develops into a woman. Nea is very plain and non-exciting, but she continuously tries to save her sister from situations. Does she remain childish so that she won’t be compared to her much more beautiful, older and more desirable sister, Sourdi? The theme of companionship is a very prominent and obvious theme as the story develops around the two sisters growing up. Nea and Sourdi had a close friendship as small children; Nea also tries to save Sourdi a considerable amount of times as they grow older. When Sourdi becomes of age, her mother arranges a marriage for her to Mr. Chhay. Sourdi and Nea are both unhappy about the...
Words: 357 - Pages: 2
...Reflective Journal Entries 7/8 Liberty University W6 #7. In the Burley-Allen text it discusses many different concepts and characteristics that go into forming a thought process of an individual. One thing that I found interesting was the way that the chapter talked about first impressions. Burley-Allen (1995) says that the danger lies in our retaining, out of our total experience, those things that fit into our frame of reference. In my opinion this is saying that we base and associate other individuals with different situations that we have encountered within our own lives. Just because a person claims that they are from a rough neighborhood does not mean that the individual is any less or more than the person judging them. However because of the way that humans are programed we automatically assume that when we hear someone coming from a tough upbringing that they are rough around the edges. We unconsciously block other behaviors that don’t support our impressions, in an effort to be right about understanding the person (Burley-Allen, 1995). It is impossible for someone to get an accurate and fair read on somebody by associating them with things of their past or even situations that you have been through in that past. When we listen at level 1 awareness of how this process operate within ourselves, we counteract this tendency; thus, we reduce resistance and build rapport (Burley-Allen, 1995). This proves to be very helpful in growing relationships with others. W6 #8....
Words: 504 - Pages: 3
...Deindividuation is a social psychological explanation of aggression it is the process whereby people lose their sense of socialised individual identity making them more likely to engage in behaviour that is deemed antisocial. Zimbardo suggested that deindividuation is due to anonymity, reduced responsibility, increased arousal, sensory overload and altered consciousness due to drugs and alcohol. Individuals become deindividuated when anonymous because there is less awareness of their individuality, which makes them seem almost faceless when they are merged with a large group of people or when wearing a mask. They can also be deindividuated in times of increased arousal and sensory overload this can happen when in crowds where it is loud and packed especially if people are getting intoxicated by drugs and alcohol. Likewise in large groups an individual may act violent due to the responsibility not being completely on them. By being masked, in uniforms, groups, in the dark etc. can influence deindividuation Prentice – Dunn and Rodger suggest that an individual loses different types of self-awareness in a group. Not concerning about the impression you have to the people around you leads to less public self-awareness and losing concerns you have for own standards and morals leads to less private self-awareness. The loss of private self-awareness that leads to increased anti-social behaviour. Furthermore, Festinger et al suggested that when an individual is submerged in a group...
Words: 1124 - Pages: 5
...The Nature and Nurture of Aggression OUTLINE: * Theories of Aggression * Psychological Influences on Aggression * Environmental Influences on Aggression * Reducing Aggression * A social Learning Approach * Cultural Change & World Violence Aggression – physical or verbal behavior intended to cause harm * kicks and slaps, threats and insults, gossip or snide “digs” (online bullying) Instrumental Aggression – aims to injure too – but only as a means to some other end. * Terrorism – a strategic tool used during conflict; attaining hero or martyr status. * Wars – an instrumental act of liberation and of self defense against presumed weapons of mass destruction. * Bully – seeks to demonstrate their dominance and high status. Theories of Agression * Agression an Instinct Is Aggression an Instinct? Aggressive energy is instinctive; if not discharged, it supposedly builds up until it explodes or until an appropriate stimulus releases it. * Mouse releasing a mousetrap * Neural Influences Researchers have found neural systems (specific areas of the brain) when stimulated produce aggression. * Amygdala * Prefrontal cortex * Genetic Influences Heredity influences the neural system's sensitivity to aggressive cues. Aggressiveness also varies among individuals. * Blood Chemistry Influences neural sensitivity to aggressive stimulation. * ALCOHOL – enhances aggressiveness...
Words: 729 - Pages: 3