Saturday, August 31, 2019

Learning in SChool

Throughout all my school years there have been many different teachers that have Impacted my life. But there has been one that has truly changed so much of me today, Professor Duran. When I use to think of the term favorite for a teacher I would see it on a teacher who is easy and does not give a work load, but now its different. A favorite teacher to me is someone who cares for their students and makes their greatest effort to teach you what they know even if it requires true dedication from the students side.Professor Duran was a teacher who wanted her students to see the importance of he unjustly ways society is; well at least in English IA. Am sure she would have wanted us to learn much more but within Just one semester was too much to squeeze In. She is a very unique teacher than what I have ever encountered, there has been professors who really do care about their students and advice them but there is teachers like Duran who can get deeper than your soul.The way she taught and she demolished every single piece of critical thinking within us was what really taught me to see things different. She opened up my eyes to not only see the obvious but also more beyond the surface. I came out of professor Durance's class a whole totally different person who looked at society much more distinct. Maybe she did make us put in more effort than what we were to enforcing in every assignment. Onto know how but this taught me to see everything In a positive way, to wake up every day In the morning with a where I envision myself five years from now. How everyday I am a step closer to where I want to be even if its frustrating, or overwhelming but I have to fight through it. It wasn't the way she taught that made me love her style but the way she put her heart In every single day to teach us. That Is what makes a great teacher, a person who can every day come to class and pour her soul into teaching, who truly cares about her students.Professor Duran has a heart of real, tr ue loving person. Learning in SChool By Jimenez impacted my life. But there has been one that has truly changed so much of me squeeze in. She is a very unique teacher than what I have ever encountered, there assignment. I don't know how but this taught me to see everything in a positive way, to wake up every day in the morning with a where I envision myself five years from heart in every single day to teach us. That is what makes a great teacher, a person

Friday, August 30, 2019

Response for “The Destructors”: themes, interpretations Essay

â€Å"Chaos had advanced. The kitchen was a shambles of broken glass and china. The dining-room was stripped of parquet, the skirting was up, the door had been taken off its hinges, and the destroyers had moved up a floor. Streaks of light came in through the closed shutters where they worked with the seriousness of creators – and destruction after all is a form of creation. A kind of imagination had seen this house as it had now become.† The Second World War had just finished and the boys were living in a hostile and indifferent world. They had had an idea, a dream, and using their imagination the gang had created a plan (p.176 â€Å"a wild invention†) to destroy Old Misery’s house. To accomplish their mission they needed energy, hard work and organisation, just like in a war. However, they weren’t doing it for hate, because hate requires a certain degree of passion and each and every one of them was cold-minded, and just followed the orders of their leader: Trevor, who was a mastermind of evil. It’s clear that the gang wanted prestige, distinction and fame (p.174 â€Å"The fame [†¦] been destroyed†); nevertheless it wasn’t just for that; they were doing it naturally and consciously and most significant: for fun. Destruction was part of them, maybe because they were â€Å"the sons of war† and they were living a period of transition when many important changes take place; but as far as I’m concerned, proportional episodes (with proportional consequences) happen nowadays. This leads me to think that â€Å"destruction† is part of human nature. Regarding their action, when the house was being smashed, sounds of carpentry were heard (creation) (e.g.: a clickety-clack, a bang bang, a scraping, a creaking †¦). The boys created destruction and they had to do it in a way so that nothing â€Å"build inside again was more beautifully than before†. â€Å"Beauty†, style and elegance was something they couldn’t allow. The question is why; as I said before, â€Å"destruction† could be taken as part of human nature, but perhaps this is always needed to create later. It could be considered as one more step in the ladder to produce changes. During this alteration disorder and uncertainty are present and it is normal from individuals to collectively (nations, corporations, mafias, gangs,etc) pull  their skills and talents in order to overcome difficulties and make modifications. It’s like a cycle which is always necessary. The problem is that in their cycle there had no immediate future. It was a need to exterminate leaving nothing but a spoilt landscape covered by rubble. Their plan had been as effective as an army or a missile. The place was clear for something new to be created, something different, but something human which soon or later would be also destroyed. These qualities inside members of the gang were the leftovers of the war. They had absorbed war and were part of its consequences. Rounding off and as far as I’m concerned, the story’s theme is centred on the idea of destruction and creation, and how these two relate with each other. War and pos-war are deeply connected with this main idea in the story due to the fact that it was a period of transition; the gang was leaving between destruction and the creation of something new. I believe that war is the perfect example to understand human behaviour, and how ideologies or interests may lead to fights, battles, and the constant look for evolution and change whereas terrible consequences can be suffered by anyone, no matter their innocence and age (like the boys did).

Thursday, August 29, 2019

Java Based Search Engine

ACKNOWLEDGMENT I express thanks and gratitude to Mr. †¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦H. O. D computer science department, †¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦College for his encouraging support and guidance in carrying out the project. I would like to express gratitude and indebtedness to Mr†¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦, for his valuable advice and guidance without which this project would not have seen the light of the day. I thank Mr†¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦Ã¢â‚¬ ¦ , project guide , GSS for his insistence on good programming technique which helped us to design and develop a successful model of an Chatting Tool. Name CONTENTS 1.STUDY & ANALYSIS PHASE 1. 1 INTRODUCTION 1. 1. 1 PURPOSE OF THE PROJECT 1. 1. 2 PROBLEM IN EXISTING SYSTEM 1. 1. 3 SOLUTION OF THESE PROBLEMS 1. 1. 4 SCOPE OF THE PROJECT 1. 1. 5 LIMITATIONS 1. 1. 6 HARDWARE & SOFTWARE SPECIFICATIONS 1. 1. 7 ORGANISATION PROFILE 2. PROJECT ANALYSIS 1. STUDY OF THE SYSTEM 2. INPUT & OUTPUT 3. PROCESS MODULES USED WITH JUSTIFICATION 3. DESIGN PHASE 1. DATAFLOW 2. UML DIAGRAMS 4. IMPLEMENTATION PHASE 5. TESTING 1. TYPES OF TESTING 1. COMPILING TEST 2. EXECUTION TEST 3. OUTPUT TEST 5. PROJECT CODING 6. OUTPUT SCREENS 7. CONCLUSION 8. BIBLOGRAPHYSTUDY PHASE INTRODUCTION: EXISTING SYSTEM With the advent of the Internet in the past decade, searching for information in various formats has been redefined by the internet search engines, most of them being based on information retrieval (IR) indexing techniques. IR-based searching, which usually allows formulation of queries with multiple words PROPOSED SYSTEM This Java application is basically a recursive file finder. You can search for files based on their filename, their contents, or both in selected directory and as well as sub directories of the specified directory.Engine is a graphical version of the well-known GREP utility, with an additional feature of traversing subdirectories. You can specify which directory to start looking in, which files to search through, and what pattern to look for in the files. The various fields expect regular expressions, like Global Regular Expression, ‘Engine’ has not only the graphical interface, but also a command-line interface. This is useful for quick searches through, say, a development tree. Engine requires the Java 2 Platform, Standard Edition version 1. 4 or higher. SOLUTION OF THESE PROBLEMSRegular expressions figure into all kinds of text-manipulation tasks. Searching and search-and-replace are among the more common uses, but regular expressions can also be used to test for certain conditions in a text file or data stream. You might use regular expressions, for example, as t he basis for a short program that separates incoming mail from incoming spam. In this case, the program might use a regular expression to determine whether the name of a known spammer appeared in the â€Å"From:† line of the email. Email filtering programs, in fact, very often use regular expressions for exactly this type of operation. SCOPE OF THE PROJECTEngine is a graphical version of the well-known GREP utility, with an additional feature of traversing subdirectories. The main aim of this project is to develop a java based recursive file finder. Engine is a graphical version of the well-known GREP utility, with an additional feature of traversing subdirectories LIMITATIONS Regular expressions tend to be easier to write than they are to read. This is less of a problem if you are the only one who ever needs to maintain the program (or sed routine, or shell script, or what have you), but if several people need to watch over it, the syntax can turn into more of a hindrance th an an aid.Ordinary macros (in particular, editable macros such as those generated by the major word processors and editors) tend not to be as fast, as flexible, as portable, as concise, or as fault-tolerant as regular expressions, but they have the advantage of being much more readable; even people with no programming background whatsoever can usually make enough sense of a macro script to change it if the need arises. For some jobs, such readability will outweigh all other concerns.As with all things in computing, it's largely a question of fitting the tool to the job. HARDWARE & SOFTWARE SPECIFICATIONS Environment: Java Runtime Environment version 1. 4 or better installed. Operating System: Any O. S. compatable with JVM Hard disk:10 GB Processor:PIII or higher ORGANIZATION PROFILE EMINENT SOFTWARE SOLUTIONS EMINENT TECHNOLOGIES (ET) is an IT Solution Provider for a dynamic environment where business and technology strategies converge.Our approach focuses on new ways of business co mbining IT innovation and adoption while also leveraging an organization's current IT assets. We work with large global corporations and new generation technology companies – to build new products or services and to implement prudent business and technology strategies in today's environment. EMINENT's range of expertise includes: Software Development Services Engineering Services Systems Integration Customer Relationship Management Supply Chain Management Product Development Electronic CommerceConsulting IT Outsourcing We apply technology with innovation and responsibility to achieve two broad objectives: Effectively address the business issues our customers face today Generate new opportunities that will help them stay ahead in the future This approach rests on: A strategy where we Architect, Integrate and Manage technology services and solutions — we call it AIM for success. A robust offshore development methodology and reduced demand on customer resources A focus on the use of reusable frameworks to provide cost and time benefitsWe combine the best people, processes and technology to achieve excellent results consistently. We offer customers the advantages of: Speed: We understand the importance of timing, of getting there before the competition. A rich portfolio of reusable, modular frameworks helps jump start projects. Tried and tested methodology ensures that we follow a predictable, low-risk path to achieve results. Our track record is testimony to complex projects delivered within and even before schedule. Expertise: Our teams combine cutting edge technology skills with rich domain expertise.What's equally important — we share a strong customer orientation that means we actually start by listening to the customer. We're focused on coming up with solutions that serve customer requirements today and anticipate future needs. A Full Service Portfolio: We offer customers the advantage of being able to Architect, Integrate and Manage tec hnology services. This means that they can rely on one, fully accountable source instead of trying to integrate disparate multi-vendor solutions. Services: GSS is providing its services to Sain medicaments Pvt.Ltd, Grace drugs and pharmaceuticals Private Limited Alka Drugs and Pharmaceuticals Pvt Ltd to name just a few with out rich experience and expertise in Information Technology we are in the best position to provide software solutions to distinct business requirements. PROJECT ANALYSIS STUDY OF THE SYSTEM This application can be mainly divided into two modules:- †¢ User Interface †¢ File Manipulation and filtering INPUT AND OUTPUT: User has to input the File Name or File Contents and he has to select the Drive or Directory in which searching has to be done.Application will search for the files matching with given criteria and shows the output in the text area of the application. PROCESS MODEL USED WITH JUSTIFICTION The model used here is a SPIRAL MODEL. This Model dem ands a direct consideration of technical risk at all stages of the project and if properly applied it reduces risk before they become problematic, hence it becomes easier to handle a project when using this kind of model where in the end user can evaluate the program at the end of each stage and suggest modification if required.PROJECT DESIGN DATA FLOW DIAGRAM 0th Level 1st Level 2nd Level 2nd Level 3rd Level UML DIAGRAMS USE CASE DIAGRAM [pic] CLASS DIAGRAM [pic] ACTIVITY DIAGRAM [pic] SEQUENCE DIAGRAM [pic] IMPLEMENTATION PHASE MODULES: 1. COMPONENT THIS IS THE FRONT END CONSOLE OF THE USER TO INTERACT WITH SEARCH ANALYZER. 2. TOOLBAR COORDINATIOR THIS MODULE HAS THE EMBEDED TOOLS WHICH ARE TO IMPLEMENT SEARCH. 3. MAP FINDER THIS MODULE IS MAPS THE SEARCH CORRESPONDING TO THE USERS QUERY. 4. DYNAMIC STATUS FINDERTHIS IS THE DYNAMIC MODULE WHICH GIVES THE STATUS OF THE SEARCH . 5. GREP GENERATOR GREP GENERATOR IS THE MAJOR MODULE ON WHICH THE SEARCH IS DONE BASED ON REGULAR EXPRESS IONS . OUTPUT SCREENS Engine view [pic] Browse [pic] Search [pic] Help [pic] Error [pic] PROJECT CODING CODE EXPLANATION Regular expressions simplify pattern-matching code Discover the elegance of regular expressions in text-processing scenarios that involve pattern matching Text processing often involves matching text against a pattern.Although Java's character and assorted string classes offer low-level pattern-matching support, that support commonly leads to complex code. To help you write simpler pattern-matching code, Java provides regular expressions with java. util. regex package. Text processing frequently requires code to match text against patterns. That capability makes possible text searches, email header validation, custom text creation from generic text (e. g. , â€Å"Dear Mr. Chakradhar† instead of â€Å"Dear Customer†), and so on. Java supports pattern matching via its character and assorted string classes.Because that low-level support commonly leads t o complex pattern-matching code, Java also offers regular expressions to help you write simpler code. After introducing regular expression terminology, the java. util. regex package's classes, and a program that demonstrates regular expression constructs, I explore many of the regular expression constructs that the Pattern class supports. I also examine the methods comprising Pattern and other java. util. regex classes. A practical application of regular expressions concludes my discussion.Regular expressions' long history begins in the theoretical computer science fields of automata theory and formal language theory. That history continues to Unix and other operating systems, where regular expressions are often used in Unix and Unix-like utilities: examples include awk (a programming language that enables sophisticated text analysis and manipulation-named after its creators, Aho, Weinberger, and Kernighan), emacs (a developer's editor), and grep (a program that matches regular expr essions in one or more text files and stands for global regular expression print).Regular expressions trace back to the work of an American mathematician by the name of Stephen Kleene (one of the most influential figures in the development of theoretical computer science) who developed regular expressions as a notation for describing what he called â€Å"the algebra of regular sets. † His work eventually found its way into some early efforts with computational search algorithms, and from there to some of the earliest text-manipulation tools on the Unix platform (including ed and grep). In the context of computer searches, the â€Å"*† is formally known as a â€Å"Kleene star. â€Å"A regular expression, also known as a regex or regexp, is a string whose pattern (template) describes a set of strings. The pattern determines what strings belong to the set, and consists of literal characters and meta characters, characters that have special meaning instead of a literal m eaning. The process of searching text to identify matches—strings that match a regex's pattern—is pattern matching. Java's java. util. regex package supports pattern matching via its Pattern, Matcher, and PatternSyntaxException classes: 1. Pattern objects, also known as patterns, are compiled regexes 2.Matcher objects, or matchers, are engines that interpret patterns to locate matches in character sequences, objects whose classes implement the java. lang. CharSequence interface and serve as text sources 3. PatternSyntaxException objects describe illegal regex patterns Code for mainwindow package jog. engine; import java. awt. *; import java. awt. event. *; import java. io. *; import java. net. URL; import java. util. prefs. *; import java. util. regex. *; import javax. swing. *; import javax. swing. filechooser. FileFilter; import jog. engine. *; public class MainWindow extends JFrame implements ActionListener, FileSearchListener { rotected Preferences preferences; pro tected JTextField lookInField; protected JTextField filePatternField; protected JTextField searchForField; protected JTextField excludeField; protected JCheckBox includeSubCheckBox; protected JList resultList; protected RunSearch runner; protected JButton browseButton; protected JButton helpButton; protected JButton startButton; protected JButton stopButton; protected JButton closeButton; protected JLabel status; protected JPanel cardPanel; protected CardLayout cardLayout; private boolean stopFlag; public MainWindow() { super(Bundle. getString(â€Å"AppTitle†)); addWindowListener(new WindowAdapter() public void windowClosing(WindowEvent event) { handleClose(); } }); preferences = Preferences. userRoot(). node(â€Å"com/bluemarsh/jrgrep†); Container pane = getContentPane(); GridBagLayout gb = new GridBagLayout(); pane. setLayout(gb); GridBagConstraints gc = new GridBagConstraints(); gc. insets = new Insets(3, 3, 3, 3); JLabel label = new JLabel(Bundle. getString(â€Å" lookInLabel†)); gc. anchor = GridBagConstraints. EAST; gb. setConstraints(label, gc); pane. add(label); String s = preferences. get(â€Å"lookIn†, â€Å"†); lookInField = new JTextField(s, 20); gc. anchor = GridBagConstraints. WEST; gc. fill = GridBagConstraints.HORIZONTAL; gc. weightx = 1. 0; gb. setConstraints(lookInField, gc); pane. add(lookInField); browseButton = new JButton(Bundle. getString(â€Å"browseLabel†)); browseButton. addActionListener(this); gc. anchor = GridBagConstraints. CENTER; gc. gridwidth = GridBagConstraints. REMAINDER; gc. fill = GridBagConstraints. NONE; gc. weightx = 0. 0; gb. setConstraints(browseButton, gc); pane. add(browseButton); label = new JLabel(Bundle. getString(â€Å"filePatternLabel†)); gc. anchor = GridBagConstraints. EAST; gc. gridwidth = 1; gb. setConstraints(label, gc); pane. add(label); s = preferences. get(â€Å"filter†, â€Å"†); ilePatternField = new JTextField(s, 20); gc. anchor = GridBagC onstraints. WEST; gc. fill = GridBagConstraints. HORIZONTAL; gc. gridwidth = GridBagConstraints. RELATIVE; gc. weightx = 1. 0; gb. setConstraints(filePatternField, gc); pane. add(filePatternField); Component glue = Box. createGlue(); gc. anchor = GridBagConstraints. CENTER; gc. fill = GridBagConstraints. NONE; gc. gridwidth = GridBagConstraints. REMAINDER; gc. weightx = 0. 0; gb. setConstraints(glue, gc); pane. add(glue); label = new JLabel(Bundle. getString(â€Å"searchForLabel†)); gc. anchor = GridBagConstraints. EAST; gc. fill = GridBagConstraints.NONE; gc. gridwidth = 1; gb. setConstraints(label, gc); pane. add(label); s = preferences. get(â€Å"searchFor†, â€Å"†); searchForField = new JTextField(s, 20); gc. anchor = GridBagConstraints. WEST; gc. fill = GridBagConstraints. HORIZONTAL; gc. gridwidth = GridBagConstraints. RELATIVE; gc. weightx = 1. 0; gb. setConstraints(searchForField, gc); pane. add(searchForField); helpButton = new JButton(Bundle. getStrin g(â€Å"helpLabel†)); helpButton. addActionListener(this); gc. anchor = GridBagConstraints. CENTER; gc. fill = GridBagConstraints. NONE; gc. gridwidth = GridBagConstraints. REMAINDER; gc. weightx = 0. 0; gb. etConstraints(helpButton, gc); pane. add(helpButton); label = new JLabel(Bundle. getString(â€Å"excludeLabel†)); gc. anchor = GridBagConstraints. EAST; gc. gridwidth = 1; gb. setConstraints(label, gc); pane. add(label); s = preferences. get(â€Å"exclude†, â€Å"†); excludeField = new JTextField(s, 20); gc. anchor = GridBagConstraints. WEST; gc. fill = GridBagConstraints. HORIZONTAL; gc. gridwidth = GridBagConstraints. RELATIVE; gc. weightx = 1. 0; gb. setConstraints(excludeField, gc); pane. add(excludeField); glue = Box. createGlue(); gc. anchor = GridBagConstraints. CENTER; gc. fill = GridBagConstraints. NONE; gc. ridwidth = GridBagConstraints. REMAINDER; gc. weightx = 0. 0; gb. setConstraints(glue, gc); pane. add(glue); includeSubCheckBox = new JC heckBox( Bundle. getString(â€Å"includeSubDirLabel†), true); includeSubCheckBox. setSelected(preferences. getBoolean( â€Å"recurse†, true)); gc. anchor = GridBagConstraints. WEST; gb. setConstraints(includeSubCheckBox, gc); pane. add(includeSubCheckBox); startButton = new JButton( Bundle. getString(â€Å"startSearchLabel†)); startButton. addActionListener(this); gc. gridwidth = 1; gb. setConstraints(startButton, gc); pane. add(startButton); status=new JLabel(â€Å"†); Color c=new Color(240,100,100); tatus. setForeground(c); gc. gridwidth = 1; gb. setConstraints(status, gc); pane. add(status); stopButton = new JButton(Bundle. getString(â€Å"stopLabel†)); stopButton. setEnabled(false); stopButton. addActionListener(this); gc. anchor = GridBagConstraints. CENTER; gc. gridwidth = GridBagConstraints. RELATIVE; gb. setConstraints(stopButton, gc); pane. add(stopButton); closeButton = new JButton(Bundle. getString(â€Å"closeLabel†)); closeButton . addActionListener(this); gc. gridwidth = GridBagConstraints. REMAINDER; gb. setConstraints(closeButton, gc); pane. add(closeButton); resultList = new JList(new ResultsListModel());JScrollPane scroller = new JScrollPane(resultList); cardPanel = new JPanel(new CardLayout()); cardLayout = (CardLayout) cardPanel. getLayout(); cardPanel. add(scroller, â€Å"list†); gc. gridwidth = GridBagConstraints. REMAINDER; gc. gridheight = GridBagConstraints. REMAINDER; gc. fill = GridBagConstraints. BOTH; gc. weightx = 1. 0; gc. weighty = 1. 0; gb. setConstraints(cardPanel, gc); pane. add(cardPanel); int width = preferences. getInt(â€Å"windowWidth†, 0); int height = preferences. getInt(â€Å"windowHeight†, 0); if (width == 0 && height == 0) { pack(); } else { setSize(width, height); } int top = preferences. getInt(â€Å"windowTop†, 100); nt left = preferences. getInt(â€Å"windowLeft†, 100); setLocation(left, top); stopFlag=false; } public void actionPerformed (ActionEvent event) { JButton button = (JButton) event. getSource(); //System. out. println(â€Å"action â€Å"+button); if (button == closeButton) { handleClose(); } else if (button == browseButton) { handleBrowse(); } else if (button == startButton) { status. setText(â€Å"Search Started†); //System. out. println(â€Å"Search started†); startSearch(); } else if (button == helpButton) { displayHelp(); } else if (button == stopButton) { //System. out. println(â€Å"Search stopped†); stopButton. setEnabled(false); runner. stop(); stopFlag=true; /int count=((ListModel)resultList. getModel()). getSize(); //status. setText(â€Å"Search Stopped â€Å"+count+† Files Found†); } } protected void displayHelp() { if (cardPanel. getComponentCount() < 2) { URL helpUrl = Bundle. getResource(â€Å"helpFile†); try { JEditorPane editor = new JEditorPane(helpUrl); editor. setEditable(false); JScrollPane scroller = new JScrollPane(editor); cardPanel. add(sc roller, â€Å"help†); } catch (IOException ioe) { searchFailed(ioe); return; } } cardLayout. show(cardPanel, â€Å"help†); } public void fileFound(FileFoundEvent event) { ResultsListModel model = (ResultsListModel) resultList. etModel(); model. addElement(event. getFile()); } protected void handleBrowse() { String dirStr = lookInField. getText(); JFileChooser fc; if (dirStr. equals(â€Å"†)) { String lastdir = preferences. get(â€Å"lastdir†, null); if (lastdir == null || lastdir. length() == 0) { lastdir = System. getProperty(â€Å"user. dir†); } fc = new JFileChooser(lastdir); } else { fc = new JFileChooser(dirStr); } fc. setFileSelectionMode(JFileChooser. DIRECTORIES_ONLY); if (fc. showOpenDialog(this) ! = JFileChooser. CANCEL_OPTION) { File dir = fc. getSelectedFile(); String path = dir. getPath(); lookInField. setText(path); references. put(â€Å"lastdir†, path); } } protected void handleClose() { preferences. putInt(â€Å"windowTopâ⠂¬ , getY()); preferences. putInt(â€Å"windowLeft†, getX()); preferences. putInt(â€Å"windowWidth†, getWidth()); preferences. putInt(â€Å"windowHeight†, getHeight()); preferences. put(â€Å"lookIn†, lookInField. getText()); preferences. put(â€Å"filter†, filePatternField. getText()); preferences. put(â€Å"searchFor†, searchForField. getText()); preferences. put(â€Å"exclude†, excludeField. getText()); preferences. putBoolean(â€Å"recurse†, includeSubCheckBox. isSelected()); System. exit(0); } public void searchComplete() { stopButton. etEnabled(false); //status. setText(â€Å"Search completed†); int count=((ListModel)resultList. getModel()). getSize(); if(count==0){ status. setText(â€Å"Search Completed No Files Found†); } if(stopFlag){ status. setText(â€Å"Search Stopped â€Å"+count +† Files Found†); stopFlag=false; }else{ status. setText(â€Å"Search Completed â€Å"+count +† Fil es Found†); } } public void searchFailed(Throwable t) { Object[] messages = {Bundle. getString(â€Å"exceptionOccurred†),t. getMessage()}; JOptionPane. showMessageDialog(this, messages, Bundle. getString(â€Å"errorTitle†), JOptionPane. ERROR_MESSAGE); } protected void startSearch() { cardLayout. how(cardPanel, â€Å"list†); ResultsListModel model = (ResultsListModel) resultList. getModel(); model. clear(); String dirStr = lookInField. getText(); if (dirStr == null || dirStr. length() == 0) { dirStr = â€Å". â€Å"; } File dir = new File(dirStr); if (! dir. exists()) { JOptionPane. showMessageDialog(this, Bundle. getString(â€Å"pathDoesNotExist†), Bundle. getString(â€Å"errorTitle†), JOptionPane. ERROR_MESSAGE); return; } String target = searchForField. getText(); String filter = filePatternField. getText(); String exclude = excludeField. getText(); try { Pattern. compile(target); Pattern. compile(filter); Pattern. ompile(exclude); } cat ch (PatternSyntaxException pse) { Object[] messages = {Bundle. getString(â€Å"invalidRegexPattern†), pse. getMessage()}; JOptionPane. showMessageDialog(this, messages, Bundle. getString(â€Å"errorTitle†),JOptionPane. ERROR_MESSAGE); return; } if (runner == null) { runner = new RunSearch(this); } runner. search(dir, target, filter, includeSubCheckBox. isSelected(), exclude); Thread th = new Thread(runner); th. start(); stopButton. setEnabled(true); } } Code for bundle package jog. engine; import java. net. URL; import java. util. MissingResourceException; import java. til. ResourceBundle; public class Bundle { private static ResourceBundle resourceBundle; static { resourceBundle = ResourceBundle. getBundle(Bundle. class. getName()); } public static ResourceBundle getBundle() { return resourceBundle; } public static URL getResource(String key) { String name = getString(key); return name == null ? null : Bundle. class. getResource(name); } public static String getString (String key) { try { return resourceBundle. getString(key); } catch (MissingResourceException mre) { return null; } } } Code for runsearch package jog. engine; import java. io. File; import jog. engine. *; mport java. lang. *; class RunSearch implements Runnable { protected File dir; protected String lookFor; protected String filter; protected boolean subDirs; protected String exclude; protected FileSearchListener listener; protected Searcher searcher; public RunSearch(FileSearchListener listener) { this. listener = listener; } public void run() { if (searcher == null) { searcher = new Searcher(); if (listener ! = null) { searcher. addSearchListener(listener); } } searcher. search(dir, lookFor, filter, subDirs, exclude); } public void search(File dir, String lookFor, String filter, boolean subDirs, String exclude) this. dir = dir; this. lookFor = lookFor; this. filter = filter; this. subDirs = subDirs; this. exclude = exclude; } public void stop() { //System. out. println(â€Å"Sea rcher is one:†+ isAlive()); System. out. println(â€Å"Searcher†); if (searcher ! = null) { searcher. stopSearching(); searcher=null; System. out. println(â€Å"Searcher one†); } //System. out. println(â€Å"Searcher is :†+ isAlive()); //System. out. println(â€Å"Searcher one†); } } Code for searcher package jog. engine; import java. io. *; import java. nio. *; import java. nio. channels. *; import java. nio. charset. *; import java. util. *; import java. til. regex. *; import javax. swing. event. EventListenerList; import jog. engine. *; class Searcher { protected static Pattern linePattern; protected static Charset charset; protected static CharsetDecoder decoder; protected EventListenerList searchListeners; protected volatile boolean stopSearch; protected Pattern targetPattern; protected Matcher targetMatcher; protected Pattern filterPattern; protected Matcher filterMatcher; protected Pattern excludePattern; protected Matcher excludeMatcher; sta tic { try { linePattern = Pattern. compile(â€Å". * ? â€Å"); } catch (PatternSyntaxException pse) { System. out. rintln(â€Å"Ye flipping gods! â€Å"); } charset = Charset. forName(â€Å"ISO-8859-1†); decoder = charset. newDecoder(); } public Searcher() { searchListeners = new EventListenerList(); } public void addSearchListener(FileSearchListener listener) { searchListeners. add(FileSearchListener. class, listener); } protected void fireDone() { if (searchListeners == null) { return; } Object[] listeners = searchListeners. getListenerList(); for (int i = listeners. length – 2; i >= 0; i -= 2) { if (listeners[i] == FileSearchListener. class) { FileSearchListener fsl = (FileSearchListener) listeners[i + 1]; fsl. earchComplete(); } } } protected void fireError(Throwable t) { if (searchListeners == null) { return; } Object[] listeners = searchListeners. getListenerList(); for (int i = listeners. length – 2; i >= 0; i -= 2) { if (listeners[i] == FileSearchLi stener. class) { FileSearchListener fsl = (FileSearchListener) listeners[i + 1]; fsl. searchFailed(t); } } } protected void fireFound(String match) { if (searchListeners == null) { return; } FileFoundEvent event = new FileFoundEvent(this, match); Object[] listeners = searchListeners. getListenerList(); for (int i = listeners. ength – 2; i >= 0; i -= 2) { if (listeners[i] == FileSearchListener. class) { FileSearchListener fsl = (FileSearchListener) listeners[i + 1]; fsl. fileFound(event); } } event = null; } public void removeSearchListener(FileSearchListener listener) { searchListeners. remove(FileSearchListener. class, listener); } public void search(File startIn, String target, String filter, boolean recurse, String exclude) { stopSearch = false; try { targetPattern = Pattern. compile(target); filterPattern = Pattern. compile(filter); if (exclude ! = null && exclude. length() > 0) { excludePattern = Pattern. ompile(exclude); } searchLow(startIn, recurse); } catch (IOExcepti on ioe) { fireError(ioe); } catch (PatternSyntaxException pse) { fireError(pse); } targetPattern = null; targetMatcher = null; filterPattern = null; filterMatcher = null; excludePattern = null; excludeMatcher = null; fireDone(); } protected void searchLow(File startIn, boolean recurse) throws IOException { String[] files = startIn. list(); if (files == null) { return; } for (int ii = 0; ii < files. length; ii++) { if (stopSearch) { break; } File file = new File(startIn, files[ii]); if (file. isFile() && file. canRead()) { String filename = file. etCanonicalPath(); if (filterMatcher == null) { filterMatcher = filterPattern. matcher(filename); } else { filterMatcher. reset(filename); } if (! filterMatcher. find()) { continue; } FileInputStream fis = new FileInputStream(file); FileChannel fc = fis. getChannel(); MappedByteBuffer bb = fc. map(FileChannel. MapMode. READ_ONLY, 0, fc. size()); CharBuffer cb = decoder. decode(bb); boolean matchFound = false; if ((targetPattern. flags() & Pa ttern. DOTALL) ! = 0) { if (targetMatcher == null) { targetMatcher = targetPattern. matcher(cb); } else { argetMatcher. reset(cb); } if (targetMatcher. find()) { matchFound = true; } } else { Matcher lm = linePattern. matcher(cb); while (lm. find()) { CharSequence cs = lm. group(); if (targetMatcher == null) { targetMatcher = targetPattern. matcher(cs); } else { targetMatcher. reset(cs); } if (targetMatcher. find()) { matchFound = true; } if (lm. end() == cb. limit()) { break; } } } if (matchFound) { fireFound(filename); } } else if (recurse && file. isDirectory()) { String dirname = file. getName(); if (excludePattern ! = null) { if (excludeMatcher == null) { excludeMatcher = excludePattern. atcher(dirname); } else { excludeMatcher. reset(dirname); } if (! excludeMatcher. find()) { searchLow(file, recurse); } } else { searchLow(file, recurse); } } } } public void stopSearching() { stopSearch = true; } } Code for filesearch listener package jog. engine; import java. util. EventListe ner; import jog. engine. FileFoundEvent; interface FileSearchListener extends EventListener { public void fileFound(FileFoundEvent event); public void searchComplete(); public void searchFailed(Throwable t); } Code for tty package jog. engine; import java. io. *; import java. util. regex. *; mport jog. engine. *; public class tty implements FileSearchListener { protected static int argIndex; protected static String excludeStr = â€Å"†; protected static String nameStr = â€Å"†; protected static void displayHelp() { String str = Bundle. getString(â€Å"ttyHelp1†); int i = 1; while (str ! = null) { System. out. println(str); i++; str = Bundle. getString(â€Å"ttyHelp† + i); } } public void fileFound(FileFoundEvent event) { System. out. println(event. getFile()); } protected static boolean processArgs(String[] args) { while (argIndex < args. length) { String arg = args[argIndex]; if (arg. equals(â€Å"-exclude†)) { rgIndex++; excludeStr = args[argInd ex]; } else if (arg. equals(â€Å"-h†) || arg. equals(â€Å"-help†) || arg. equals(â€Å"–help†)) { displayHelp(); return false; } else if (arg. equals(â€Å"-name†)) { argIndex++; nameStr = args[argIndex]; } else { break; } argIndex++; } return true; } public void searchComplete() {} public void searchFailed(Throwable t) { System. err. println(Bundle. getString(â€Å"exceptionOccurred†)); System. err. println(t. getMessage()); } public static void main(String[] args) { try { if (! processArgs(args)) { return; } } catch (ArrayIndexOutOfBoundsException aioobe) { System. err. println(Bundle. etString(â€Å"ttyMissingArguments†)); return; } if (argIndex == args. length) { System. err. println(Bundle. getString(â€Å"ttyMissingRequired†)); return; } String target = args[argIndex]; argIndex++; String dirStr = null; if (argIndex == args. length) { dirStr = â€Å". â€Å"; } else { dirStr = args[argIndex]; } File dir = new File(dirS tr); if (! dir. exists()) { System. err. println(Bundle. getString(â€Å"pathDoesNotExist†)); return; } try { Pattern. compile(target); Pattern. compile(nameStr); } catch (PatternSyntaxException pse) { System. err. println(Bundle. getString(â€Å"invalidRegexPattern†)); System. rr. println(pse. getMessage()); return; } Searcher searcher = new Searcher(); tty instance = new tty(); searcher. addSearchListener(instance); searcher. search(dir, target, nameStr, true, excludeStr); searcher. removeSearchListener(instance); } } Code for filefoundevent package jog. engine; import java. util. EventObject; class FileFoundEvent extends EventObject { protected String file; public FileFoundEvent(Object source, String file) { super(source); this. file = file; } public String getFile() { return file; } } Code for result list model package jog. engine; import java. util. Vector; import javax. wing. AbstractListModel; import jog. engine. *; class ResultsListModel extends AbstractListMod el { protected Vector listData; public ResultsListModel() { listData = new Vector(); } public void addElement(Object o) { listData. add(o); fireIntervalAdded(this, listData. size(), listData. size()); } public void clear() { int size = listData. size(); listData. clear(); fireIntervalRemoved(this, 0, size); } public Object getElementAt(int i) { try { return listData. elementAt(i); } catch (ArrayIndexOutOfBoundsException e) { return null; } } public int getSize() { return listData. size(); } } Code for main package jog. ngine; import jog. engine. *; public class Main { public static void main(String[] args) { new MainWindow(). show(); // new jog. searchdesk. MainWindow. show(); } } For a tool with full regex support, metacharacters like â€Å"*† and â€Å"? † (or â€Å"wildcard operators,† as they are sometimes called) are only the tip of the iceberg. Using a good regex engine and a well-crafted regular expression, one can easily search through a text file (or a hundred text files) searching for words that have the suffix â€Å". html† (but only if the word begins with a capital letter and occurs at the beginning of the line), replace the . tml suffix with a . sgml suffix, and then change all the lower case characters to upper case. With the right tools, this series of regular expressions would do just that: s/(^[A_Z]{1})([a-z]+). sgml/12. html/g tr/a-z/A-Z/ As you might guess from this example, concision is everything when it comes to crafting regular expressions, and while this syntax won't win any beauty prizes, it follows a logical and fairly standardized format which you can learn to rea+*d and write easily with just a little bit of practice. In a regular expression, everything is a generalized pattern.If I type the word â€Å"serendipitous† into my editor, I've created one instance of the word â€Å"serendipitous. † If, however, I indicate to my tool (or compiler, or editor, or what have you) that I'm now typing a regular expression, I am in effect creating a template that matches all instances of the characters â€Å"s,† â€Å"e,† â€Å"r,† â€Å"e,† â€Å"n,† â€Å"d,† â€Å"i,† â€Å"p,† â€Å"i,† â€Å"t,† â€Å"o,† â€Å"u,† and â€Å"s† all in a row. The standard way to find â€Å"serendipitous† (the word) in a file is to use â€Å"serendipitous† (the regular expression) with a tool like egrep (or extended grep): $ egrep â€Å"serendipitous† foobar ;hitsThis line, as you might guess, asks egrep to find instances of the pattern â€Å"serendipitous† in the file â€Å"foobar† and write the results to a file called â€Å"hits†. In the preceding examples, we have been using regular expressions that adhere to the first rule of regular expressions: namely, that all alphanumeric characters match themselves. There are other characters, however, that match in a mor e generalized fashion. These are usually referred to as the meta characters. Some meta characters match single characters. This includes the following symbols: . Matches any one character †¦]Matches any character listed between the brackets [^†¦]Matches any character except those listed between the brackets Suppose we have a number of filenames listed out in a file called â€Å"Important. files. † We want to â€Å"grep out† those filenames which follow the pattern â€Å"blurfle1†, â€Å"blurfle2†, â€Å"blurfle3,† and so on, but exclude files of the form â€Å"1blurfle†, â€Å"2blurfle†, â€Å"3blurfle† The following regex would do the trick: $ egrep â€Å"blurfle. † Important. files ;blurfles The important thing to realize here is that this line will not match merely the string â€Å"blurfle. (that is, â€Å"blurfle† followed by a period). In a regular expression, the dot is a reserved symbol (we'll ge t to matching periods a little further on). This is fine if we aren't particular about the character we match (whether it's a â€Å"1,† a â€Å"2,† or even a letter, a space, or an underscore). Narrowing the field of choices for a single character match, however, requires that we use a character class. Character classes match any character listed within that class and are separated off using square brackets.So, for example, if we wanted to match on â€Å"blurfle† but only when it is followed immediately by a number (including â€Å"blurfle1† but not â€Å"blurflez†) we would use something like this: $ egrep â€Å"blurfle[0123456789]† Important. files >blurfles The syntax here is exactly as it seems: â€Å"Find ‘blurfle' followed by a zero, a one, a two, a three, a four, a five, a six, a seven, an eight, or a nine. † Such classes are usually abbreviated using the range operator (â€Å"-â€Å"): $ egrep â€Å"blurfle[0-9]† Important. files >blurfles The following regex would find â€Å"blurfle† followed by any alphanumeric character (upper or lower case). egrep â€Å"blurfle[0-9A-Za-z]† Important. files >blurfles (Notice that we didn't write blurfle[0-9 A-Z a-z] for that last one. The spaces might make it easier to read, but we'd be matching on anything between zero and nine, anything between a and z, anything between A and Z, or a space. ) A carat at the beginning of the character class negates that class. In other words, if you wanted to find all instances of blurfle except those which end in a number, you'd use the following: $ egrep â€Å"blurfle[^0-9]† Important. files >blurfles Many regex implementations have â€Å"macros† for various character classes.In Perl, for example, d matches any digit ([0-9]) and w matches any â€Å"word character† ([a-zA-Z0-9_]). Grep uses a slightly different notation for the same thing: [:digit:] for digits and [:alnum:] for alpha numeric characters. The man page (or other documentation) for the particular tool should list all the regex macros available for that tool. Quantifiers The regular expression syntax also provides metacharacters which specify the number of times a particular character should match. ?Matches any character zero or one times *Matches the preceding element zero or more times +Matches the preceding element one or more times num}Matches the preceding element num times {min, max}Matches the preceding element at least min times, but not more than max times These metacharacters allow you to match on a single-character pattern, but then continue to match on it until the pattern changes. In the last example, we were trying to search for patterns that contain â€Å"blurfle† followed by a number between zero and nine. The regex we came up with would match on blurfle1, blurfle2, blurfle3, etc. If, however, you had a programmer who mistakenly thought that â€Å"blurfle† was supposed t o be spelled â€Å"blurffle,† our regex wouldn't be able to catch it.We could fix it, though, with a quantifier. $ egrep â€Å"blur[f]+le[0-9]† Important. files >blurfles Here we have â€Å"Find ‘b', ‘l', ‘u,' ‘r' (in a row) followed by one or more instances of an ‘f' followed by ‘l' and ‘e' and then any single digit character between zero and nine. † There's always more than one way to do it with regular expressions, and in fact, if we use single-character metacharacters and quantifiers in conjunction with one another, we can search for almost all the variant spellings of â€Å"blurfle† (â€Å"bllurfle,† â€Å"bllurrfle†, bbluuuuurrrfffllle†, and so on).One way, for example, might employ the ubiquitous (and exceedingly powerful) . * combination: $ egrep â€Å"b. *e† Important. files ;blurfles If we work this out, we come out with something like: â€Å"find a ‘b' followed by any c haracter any number of times (including zero times) followed by an ‘e'. † It's tempting to use â€Å". *† with abandon. However, bear in mind that the preceding example would match on words like â€Å"blue† and â€Å"baritone† as well as â€Å"blurfle. † Suppose the filenames in blurfle are numbered up to 12324, but we only care about the first 999: $ egrep â€Å"blurfle[0-9]{3}† Important. files >bluflesThis regex tells egrep to match any number between zero and nine exactly three times in a row. Similarly, â€Å"blurfle[0-9]{3,5}† matches any number between zero and nine at lest three times but not more than five times in a row. Anchors Often, you need to specify the position at which a particular pattern occurs. This is often referred to as â€Å"anchoring† the pattern: ^Matches at the start of the line $Matches at the end of the line Matches at the end of a word Matches at the beginning or the end of a word BMatches a ny charater not at the beginning or end of a word ^† and â€Å"$† are some of the most useful metacharacters in the regex arsenal–particularly when you need to run a search-and-replace on a list of strings. Suppose, for example, that we want to take the â€Å"blurfle† files listed in Important. files, list them out separately, run a program called â€Å"fragellate† on each one, and then append each successive output to a file called â€Å"fraggled_files. † We could write a full-blown shell script (or Perl script) that would do this, but often, the job is faster and easier if we build a very simple shell script with a series of regular expressions.We'd begin by greping the files we want to operate on and writing the output to a file. $ egrep â€Å"blurfle[0-9]† Important. file ;script. sh This would give us a list of files in script. sh that looked something like this: blurfle1 blurfle2 blurfle3 blurfle4 . . . Now we use sed (or the â⠂¬Å"/%s† operator in vi, or the â€Å"query-replace-regexp† command in emacs) to put â€Å"fragellate† in front of each filename and â€Å">>fraggled_files† after each filename. This requires two separate search-and-replace operations (though not necessarily, as I'll explain when we get to backreferences).With sed, you have the ability to put both substitution lines into a file, and then use that file to iterate through another making each substitution in turn. In other words, we create a file called â€Å"fraggle. sed† which contains the following lines: s/^/fraggelate / s/$/ >>fraggled_files/ Then run the following â€Å"sed routine† on script. sh like so: $ sed -f fraggle. sed script. sh >script2. sh Our script would then look like this: fraggelate blurfle1 >>fraggled_files fraggelate blurfle2 >>fraggled_files fraggelate blurfle3 >>fraggled_files raggelate blurfle4 >>fraggled_files . . Chmod it, run it, and you're done. Of course, this is a somewhat trivial example (â€Å"Why wouldn't you just run â€Å"fragglate blurfle* ;;fraggled_files† from the command line? â€Å"). Still, one can easily imagine instances where the criteria for the file name list is too complicated to express using [filename]* on the command line. In fact, you can probably see from this sed-routine example that we have the makings of an automatic shell-script generator or file filter. You may also have noticed something odd about that caret in our sed routine.Why doesn't it mean â€Å"except† as in our previous example? The answer has to do with the sometimes radical difference between what an operator means inside the range operator and what it means outside it. The rules change from tool to tool, but generally speaking, you should use metacharacters inside range operators with caution. Some tools don't allow them at all, and others change the meaning. To pick but one example, most tools would interpret [A-Za-z. ] as â€Å"Any character between A and Z, a and z or a period. † Most tools provide some way to anchor a match on a word boundary.In some versions of grep, for example, you are allowed to write: $ grep â€Å"fle>† Important. files ;blurfles This says: â€Å"Find the characters â€Å"f†, â€Å"l†, â€Å"e†, but only when they come at the end of a word. †  tells the regex engine to match any word boundary (whether it's at the beginning or the end) and B tells it to match any position that isn't a word boundary. This again can vary considerably from tool to tool. Some tools don't support word boundaries at all, and others support them using a slightly different syntax.The tools that do support word boundaries generally consider words to be bounded by spaces or punctuation, and consider numerals to be legitimate parts of words, but there are some variations on these rules that can effect the accuracy of your matches. The man page or other documentation should resolve the matter. Escape Characters By now, you're probably wondering how you go about searching for one of the special characters (asterisks, periods, slashes, and so on). The answer lies in the use of the escape character–for most tools, the backslash (â€Å"†).To reverse the meaning of a special character (in other words, to treat it as a normal character instead of as a metacharacter), we simply put a backslash before that character. So, we know that a regex like â€Å". *† finds any character any number of times. But suppose we're searching for ellipses of various lengths and we just want to find periods any number of times. Because the period is normally a special character, we'd need to escape it with a backslash: $ grep â€Å". *† Important. Files ;ellipses. files Unfortunately, this contribute to the legendary ugliness of regular expressions more than any other element of the syntax.Add a few escape characters, and a simple sed routine designed to replace a couple of URL's quickly degenerates into confusion: sed ‘s/http://etext. lib. virginia. edu//http://www. etext. virginia. edu/g To make matters worse, the list of what needs to be escaped differs from tool to tool. Some tools, for example, consider the â€Å"+† quantifier to have its normal meaning (as a ordinary plus sign) until it is escaped. If you're having trouble with a regex (a sed routine that won't parse or a grep pattern that won't match even though you're certain the pattern exists), try playing around with the escapes.Or better yet, read the man page. Alternation Alternation refers to the use of the â€Å"|† symbol to indicate logical OR. In a previous example, we used â€Å"blur[f]+le† to catch those instances of â€Å"blurfle† that were misspelled with two â€Å"f's†. Using alternation, we could have written: $ egrep â€Å"blurfle|blurffle† Important. files ;blurfles This means simply â€Å"Find either blur fle OR blurffle. † The power of this becomes more evident when we use parentheses to limit the scope of the alternative matches.Consider the following regex, which accounts for both the American and British spellings of the word â€Å"gray†: $ egrep â€Å"gr(a|e)y† Important. files ;hazy. shades Or perhaps a mail-filtering program that uses the following regex to single out past correspondence between you and the boss: /(^To:|^From:) (Seaman|Ramsay)/ This says, â€Å"Find a ‘To:' or a ‘From:' line followed by a space and then either the word ‘Seaman' or the word ‘Ramsay' This can make your regex's extremely flexible, but be careful! Parentheses are also meta characters which figure prominently in the use of . . . Back referencesPerhaps the most powerful element of the regular expression syntax, back references allows you to load the results of a matched pattern into a buffer and then reuse it later in the expression. In a previous example , we used two separate regular expressions to put something before and after a filename in a list of files. I mentioned at that point that it wasn't entirely necessary that we use two lines. This is because back references allow us to get it down to one line. Here's how: s/(blurfle[0-9]+)/fraggelate 1 >>fraggled_files/ The key elements in this example are the parentheses and the â€Å"1†.Earlier we noted that parentheses can be used to limit the scope of a match. They can also be used to save a particular pattern into a temporary buffer. In this example, everything in the â€Å"search† half of the sed routine (the â€Å"blurfle† part) is saved into a buffer. In the â€Å"replace† half we recall the contents of that buffer back into the string by referring to its buffer number. In this case, buffer â€Å"1†. So, this sed routine will do precisely what the earlier one did: find all the instances of blurfle followed by a number between zero and nine a nd replace it with â€Å"fragellate blurfle[some number] ;;fraggled files†.Backreferences allow for something that very few ordinary search engines can manage; namely, strings of data that change slightly from instance to instance. Page numbering schemes provide a perfect example of this. Suppose we had a document that numbered each page with the notation . The number and the chapter name change from page to page, but the rest of the string stays the same. We can easily write a regular expression that matches on this string, but what if we wanted to match on it and then replace everything but the number and the chapter name? //Page 1, Chapter 2/ Buffer number one (â€Å"1†) holds the first matched sequence, ([0-9]+); buffer number two (â€Å"2†) holds the second, ([A-Za-z]+). Tools vary in the number of backreference they can hold. The more common tools (like sed and grep) hold nine, but Python can hold up to ninety-nine. Perl is limited only by the amount of ph ysical memory (which, for all practical purposes, means you can have as many as you want). Perl also lets you assign the buffer number to an ordinary scalar variable ($1, $2, etc. ) so you can use it later on in the code block. a.OBJECT ORIENTED PROGRAMMING AND JAVA Object-oriented Programming was developed because of limitations found in earlier approaches of programming. To appreciate what OOP does, we need to understand what these limitations are and how they arose from traditional programming. PROCEDURAL LANGUAGES Pascal, C, Basic, FORTRAN, and similar languages are procedural languages. That is, each statement in the language tells the computer to do something: Get some input, add these numbers, divide by 6, display the output. A program in a procedural language is a list of instructions.For very small programs no other organizing principle (often called a paradigm) is needed. The programmer creates the list of instructions, and the computer carries them out. Division into Func tions When programs become larger, a single list of instructions becomes unwieldy. Few programmers can comprehend a program of more than a few hundred statements unless it is broken down into smaller units. For this reason the function was adopted as a way to make programs more comprehensible to their human creators. (The term functions is used in C++ and C.In other languages the same concept may be referred to as a subroutine, a subprogram, or a procedure. ) A program is divided into functions, and (ideally, at least) each function has a clearly defined purpose and a clearly defined interface to the other functions in the program. The idea of breaking a program into functions can be further extended by grouping a number of functions together into a larger entity called a module, but the principle is similar: grouping a number of components that carry out specific tasks.Dividing a program into functions and modules is one of the cornerstones of structured programming, the somewhat l oosely defined discipline that has influenced programming organization for more than a decade. Problems with Structured Programming As programs grow ever larger and more complex, even the structured programming approach begins to show signs of strain. You may have heard about, or been involved in, horror stories of program development. The project is too complex, the schedule slips, more programmers are added, complexity increases, costs skyrocket, the schedule slips further, and disaster ensues.Analyzing the reasons for these failures reveals that there are weaknesses in the procedural paradigm itself. No matter how well the structured programming approach is implemented, large programs become excessively complex. What are the reasons for this failure of procedural languages? One of the most crucial is the role played by data. Data Undervalued In a procedural language, the emphasis is on doing things–read the keyboard, invert the vector, check for errors, and so on. The subd ivision of a program into functions continues this emphasis. Functions do things just as single program statements do.What they do may be more complex or abstract, but the emphasis is still on the action. What happens to the data in this paradigm? Data is, after all, the reason for a program's existence. The important part of an inventory program isn't a function that displays the data, or a function that checks for correct input; it's the inventory data itself. Yet data is given second-class status in the organization of procedural languages. For example, in an inventory program, the data that makes up the inventory is probably read from a disk file into memory, where it is treated as a global variable.By global we mean that the variables that constitute the data are declared outside of any function, so they are accessible to all functions. These functions perform various operations on the data. They read it, analyze it, update it, rearrange it, display it, write it back to the dis k, and so on. We should note that most languages, such as Pascal and C, also support local variables, which are hidden within a single function. But local variables are not useful for important data that must be accessed by many different functions. Now suppose a new programmer is hired to write a function to analyze this nventory data in a certain way. Unfamiliar with the subtleties of the program, the programmer creates a function that accidentally corrupts the. This is easy to do, because every function has complete access to the data. It's like leaving your personal papers in the lobby of your apartment building: Anyone can change or destroy them. In the same way, global data can be corrupted by functions that have no business changing it. Another problem is that, since many functions access the same data, the way the data is stored becomes critical.The arrangement of the data can't be changed without modifying all the functions that access it. If you add new data items, for exa mple, you'll need to modify all the functions that access the data so that they can also access these new items. It will be hard to find all such functions, and even harder to modify all of them correctly. It's similar to what happens when your local supermarket moves the bread from aisle 4 to aisle 12. Everyone who patronizes the supermarket must figure out where the bread has gone, and adjust their shopping habits accordingly.What is needed is a way to restrict access to the data, to hide it from all but a few critical functions. This will protect the data, simplify maintenance, and offer other benefits as well. Relationship to the Real World Procedural programs are often difficult to design. The problem is that their chief components–functions and data structures–don't model the real world very well. For example, suppose you are writing a program to create the elements of a graphics user interface: menus, windows, and so on. Quick now, what functions will you need? What data structures?The answers are not obvious, to say the least. It would be better if windows and menus corresponded more closely to actual program elements. New Data Types There are other problems with traditional languages. One is the difficulty of creating new data types. Computer languages typically have several built-in data types: integers, floating-point numbers, characters, and so on. What if you want to invent your own data type? Perhaps you want to work with complex numbers, or two dimensional coordinates, or dates—quantities the built-in data types don’t handle easily.Being able to create your own types is called extensibility; you can extend the capabilities of the language. Traditional languages are not usually extensible. Without unnatural convolutions, you can’t bundle together both X and Y coordinates into a single variable called Point, and then add and subtract values of this type. The result is that traditional programs are more complex to write and maintain. The object oriented approach The fundamental idea behind object-oriented languages is to combine into a single unit both data and the functions that operate on that data.Such a unit is called an object. An object’s functions, called member methods in Java, typically provide the only way to access its data. If you want to read the item and return the value to you, you call a member function in the object. It will read the item and return the value to you. You can’t access the data directly. The data is hidden, so it is safe from accidental modification. Data and its functions are said to be encapsulated into a single entity. Data encapsulation and data hiding are key terms in the description of object oriented languages.If you want to modify the data in an object, you know exactly what functions interact with it: the member functions in the object. No other functions can access the data. This simplifies writing, debugging, and maintaining the progra m. A Java program typically consists of a number of objects, which communicate with each other by calling one another’s members functions. We should mention that what are called member functions in C++ are called methods in Java. Also, data items are referred to as instance variables. Calling an object’s member function is referred to as sending a message to the object.

Wednesday, August 28, 2019

Campus and the Life Changing Eye Opener Essay Example | Topics and Well Written Essays - 750 words

Campus and the Life Changing Eye Opener - Essay Example This was through a campus  club  known as AIESEC. This experience changed my life profoundly and sparked a level of  awareness  that I  previously  did not have. A good number of the movies I had watched while growing up presented campus as  a place  to have mad fun. Caution  was thrown  to the wind as the students explored and experimented with their lives.  Whereas I am not claiming  conclusively  otherwise, I  feel  that there is a  side  of campus movies the movies totally ignore; the constructive side.  Oblivious of this view of campus, I had joined the  place  when  ready to  experience  the thrills I had seen in the movies.  Out of chance, I had joined this student’s  business  club, AIESEC. The  club  concerns itself with offering a  platform  to develop agents of positive change and leaders, with strong interests in business, entrepreneurship and project management. The  club  also offers its members oppo rtunities to  visit  business establishments to  witness  the best practices at work. It was during one of such activities in AIESEC that my life changing  experience  occurred. ... The level of  efficiency  arising from such  proper  organization  was clearly  discernible. Besides, the factory seemed to have an  unspoken  culture  as there was no one barking orders and reprimanding junior staff. The  second  thing I came across was the  commitment  to sustainability and environmental awareness. I do not claim to be the most environmentally  unaware  individual  at that time, but I had not seen such levels of active pursuit of sustainable practices and eco-friendliness, epitomized by  production  of the Prius and massive cuts on energy expenses. Massive research  had been done  into the most  efficient  technologies and building designs, while  ordinary  practices  were adopted  during  everyday  roles. While the capital costs would appear restrictive, the benefits in cost saving, motivation and customer  admiration  are  invaluable. The third and  last  impact  of the trip to TEMA was sparking my  global  awareness. The company is clearly a  global  leader; identifying  global  trends and how they affect Toyota; training staff to be  global  business leaders among other  global  perspectives. An experience is not life changing if one fails to act on it. I built upon the impact of the trip to TEMA first through undertaking research on the concepts learnt from the visit. Thus, I gained  an understanding  of the Toyota Way Culture and Lean management systems that brought about the efficiency, hard work and  motivation  I had observed (Toyota-Global). In fact, most other firms use a Toyota Way  variant  referred to as Six Sigma to optimize performance (Liker and Hoseus 37). I also gained much  interest  and understanding on sustainability and eco-friendliness, and how to build a

Tuesday, August 27, 2019

Dream School Term Paper Example | Topics and Well Written Essays - 1750 words

Dream School - Term Paper Example Therefore, activities and materials used in the school will be design to provide the preschool children with a wide range of experiences in all developmental stages. Consequently, these can facilitate their growth and give them numerous opportunities from which they can choose from to carry out preferred tasks. As such, these materials and methods in the school will reflect the philosophy of Piaget and incorporate the most appropriate materials of other educators in order to assist the learning process of children. Similarly important would be the children’s teacher, hence the presence of well qualified teaching staff members to positively contribute to the personal development and fulfillment of preschoolers as well as instill the values of care and love. The following sections will then look into the educational philosophy, curriculum, physical building and facilities, and the choice of teachers in the ideal school that aims to emphasize the developmental learning of prescho olers. Educational Philosophy The educational philosophy of the school would place an emphasis on interactions between adults and children as well as relationships in school and at home. The school will also incorporate developmentally appropriate practices that have been established by professional organizations that support early childhood education, such as the National Association for the Education of Young Children. As developmentally appropriate practice entails, teachers must be knowledgeable regarding the different stages of a child’s development as well as their implications. Such knowledge consequently becomes the principle from which they share information, construct the content of the curriculum, evaluate what has to be implemented, evaluate what the children have learned, as well as determine how their curriculum will be adapted to meet the individual needs, interests, and strengths of children in preschool age (Bredekamp and Rosegrant, 1992). In addition, teache rs should know the children they are teaching as well as their families to increase their awareness of the latter’s cultural and social settings. The school’s principles are centered on the recognition and responsiveness towards preschool children who are in the preoperational phase of development, as noted by Piaget. They recognize that objects do exist without touching them and can develop their own set of symbols, such as words and images, as representations of the real world. The school also recognizes that lessons will take place through assimilation, adaptation and accommodation. When children are introduced to new occurrences, they will try to understand these by associating them with the things that they have already known. Once they have obtained experience with such new phenomenon, their thoughts, feelings, and approaches may change to accommodate the attributes of this new phenomenon. Implications then point towards the need for children to be exposed to new experiences which can be associated with previous ones but, to some extent, should also bring about challenges for their way of thinking. Therefore, in order for this ideal school to maintain practices that are appropriate for children’s development, they must establish a secure, stimulating, and nurturing environment as well as develop a flexible curriculum, reflecting the themes and activities of teachers and children. These young

Investment Valuation Coursework Example | Topics and Well Written Essays - 2250 words

Investment Valuation - Coursework Example We highly recommend buying the property. With the growing redevelopments in the Moorfoot area, a large number of investors in all sectors are likely to get attracted. This will generally increase the value of the buildings. The rent is likely to increase bringing in more profit. This report outlines the achievable amount of income that can be expected from leasing the property over a given period of 15 years. It will stipulate probable and effective ways to determine the market value of the property. It focuses more on Moorfoot new development considering the current issues and tendencies that can be subjected due to such redevelopment. Economic and financial aspects are considered in the valuation of the property and the general effect of the construction. The building being under construction and the first phase will be completed by mid-2015 while the rest by 2016. This enhances the determination of the maximum achievable rent and at the same time giving the actual value for selling the other part. Moor chambers is a mixed property use situated in Moorfoot area. The building is composed of two phases; the first part being office apartments and is projected to reach completion by mid-2015 while the rest part of it to be completed by 2016. Its first phase will be majorly retail while the adjacent segment will be available for sale by 2016. The property is available for purchase from the SWIP Property Trust To obtain the most probable market value for the above mentioned property while at the same time give an expertise view of the market quotation in terms of the best price to sell the rent and sell property. This report is for the sole purposes of the above named together with the professional advisors of the client. It should be relied on by no other person and for no other purpose than that stated. Neither the whole nor any part of this report or any

Monday, August 26, 2019

Hitler's statements Assignment Example | Topics and Well Written Essays - 500 words

Hitler's statements - Assignment Example This is actually a distinctive quality of a democracy and a perquisite of liberty. Similar in some respect to the previous statement, this quote speaks of the respect for others freedom of belief as said by Hitler. This brings about a re-assessment of his own stance on personal beliefs and how it relates to other people. I definitely agree because it is almost impossible to impose one’s philosophy on another person who a totally different upbringing on your own. It is very much like convincing an environmentalist to buy a Hummer, somehow it just wouldn’t be conceivable. I do not agree with this statement for logical reasons. National Socialism would mean that the people must be educated about it and that they must accept it. It would be difficult or almost impossible to make people live in a system that they do not understand, much less believe in. it requires a consolidated effort not only from the government but in consonance with the people. This is an argument that Socialism is akin to Atheism. Of course, this is an impossible task as there are many who adhere to their religion very much like second nature. Even if this were true, it is very unlikely to be accomplished though informing and imposing are two very different things. This is another conflicting statement to a certain degree because it suggests that people are allowed freedom to develop their abilities. In a Socialist system, the equality of the people would be determinant of their status in society. On its face, the statement is very much true because only by development does man evolve. This is the most impressionable of all the quotations for me. This reverberates of the need for reality to be revealed even though there are times that it might cause internal conflicts of personal and social belief. This is something I have tremendously learned recently. It presupposes that all of the main points of his

Sunday, August 25, 2019

Separation of Powers and Checks and Balances Research Paper

Separation of Powers and Checks and Balances - Research Paper Example The branches are also somehow linked to the nature of their general functions.LegislativeThe legislative branch is tasked with endorsing the laws of the state and fitting the funds necessary to control the State (Nelson & Donovan, 2012). The Legislative division is split into the Chamber of Representative and the Senate. For a bill to be declared a law, it has to go through the two chambers. The House of DelegatesThe house of representative consists of 435 elected members and they are divided among the 50 States. It also consists of six non-voting members, representing the District of Columbia, the Commonwealth of Puerto Rico and four other areas of the US. It is led by the Speaker who is elected by the members (United States et al., 2013). Election of the members takes place after every two years, and the candidates should be twenty-five years of age (Nelson & Donovan, 2012). It has several powers that include the authority to initiate revenue bill. It also has the authority to indi ct federal officials. The SenateIt has 100 senators, and they are elected by people of each state that they represent. Unlike the representative, the senators must be thirty years old. The Senate is led by the Vice President of the State. It is tasked with confirming the president’s appointments that need consent. They also ratify treaties. However, the house of representative should also approve the Vice President’s appointment. The house should also approve agreements involving foreign trade.

Saturday, August 24, 2019

Why we should not legalize marijuana Research Paper

Why we should not legalize marijuana - Research Paper Example In response, the federal government holds high profile meetings relating to the decision (Savage 1). Besides the conflict, there are a number of problems likely to emerge when states continue to pass legislations that allow marijuana use. With the growing influence from lobby groups in support of marijuana legalization, as predicted by opinion poll results, public education is vital. The public needs to understand the reasons why the drug should remain illegal before going to polls. In as much as marijuana legalization proponents present a picture of a safe society that freely smokes, there are credible reasons to outlaw the drug and impede efforts to legalize its use. Supporters of the legalization of marijuana foresee their supporters smoking freely after uplifting laws that ban marijuana while they assume that the federal government shall remain strict on drug. This presents the challenge of a conflict that states shall experience regarding their contradictory laws and policies on the use of marijuana. There is a serious need for coordination between federal and state governments to evade differences as those experienced in keeping law and order. Ultimately, the citizens are borne to bear the consequences of such contradicting laws. It is noteworthy that citizens are the proponents of regulations and policies that are most likely to affect them. Court rulings on cases involving marijuana trade and possession shall differ, for instance. This places the justice to the citizens at stake and considerable challenge to the society. Since the federal courts have the final say over state courts, marijuana laws shall remain illegal despite its legalizat ion by some states. Eric Holder, the American Attorney General, is on record reiterating that the federal government will launch relentless efforts to prosecute anyone who demeans the law by using Marijuana, in the country.

Friday, August 23, 2019

Article Analysis Essay Example | Topics and Well Written Essays - 500 words - 5

Article Analysis - Essay Example rategic choice because it launches innovative health care products, and that the strategy is implemented through building synergies with existing systems and providing space for adapting new ones. In addition, the basic meaning of the article is that Apple is ready to lead in the production of innovative health care products that both prevent and manage diseases. The article, moreover, will help me succeed in class and my employment because it inspires me to also find new innovations where I can use my strengths as distinct advantages. First, the article has the elements of strategic analysis, strategic choice, and strategic implementation (Kew and Stredwick 205). Apple has a vision of being a leader of innovative products that can change industries for the better (Hull). The Apple Watch represents Apple’s vision as it enters an industry that it is new to it too. This is similar to Nintendo’s Wii that became a health care product when it promoted physical activity that has entertainment and social value. Apple Watch is an innovation that can help Apple become a more familiar brand in the health care sector. Moreover, Apple shows that its strategic choice is about innovation. It is not afraid of promoting change, as its watch combines prevention and disease management (Tozzi). Furthermore, the strategic implementation of Apple is to start with a product that is already based on linking existing systems. For instance, Tozzi says: â€Å"HealthKit will plug into electronic health records from Epic and o ther providers, enabling smoother communication between doctors and patients.† Apple Watch shows that the strategic choice is about improving how systems can work together, and how it can offer something new now and in the future. Apart from these elements of strategic management, the article has the basic meaning that Apple is ready to lead in the production of innovative health care products that both prevent and manage diseases. Apple Watch can help people

Thursday, August 22, 2019

Xenophon Essay Example for Free

Xenophon Essay Xenophon, the author of the document, The Constitution of the Lacedaemonians, was born in 434 BC and became a middle-class Athenian but was later exiled to Spartan land (pg. 81). This document was written in order to keep record of the way life was lived back in Sparta where he fulfilled his exile. The law maker, Lycurgus, was a very creative and intuitive man but additionally he was fair and just. Lycurgus made laws that would honestly benefit everyone in Sparta to the fullest extent and differ from the old ways of the other Greeks. The new ways of Sparta stunned the other Greeks by how different and irregular they were. I believe that Xenophon too was fascinated by the laws he now had to abide by and wrote it all down so that others could analyze it as well. In the document Xenophon writes, â€Å"I not only admire [Lycurgus], but consider to have been in the fullest sense a wise man† (pg 82). Xenophon was so fond of Lycurgus and his way of ruling that wanted to save these rules to be studied forever and wrote them down. This can be considered one of the first real constitutions written down in history which gives it such great significance along with the fact that it is a direct account from that time period originally written in a language we code decode. This document was written for any politically involved or scholarly person who wanted to study the ways of the Spartans. Xenophon believed that Lycurgus was as most genius law maker and thought that if he shared his ways maybe everyone else could be as good as Sparta. Lycurgus’ laws were â€Å"contrary to those of most governments† (pg 82) which is why it needed to be written down and spread around. I strongly feel that when Xenophon was exiled he tried to seek out the flaws in the governmental system that had done wrong and subconsciously abandoned all of the beliefs that the old government he used to follow cherished. In order to show their flaws, Xenophon wanted to compare both ways of life. As shown in The Constitution of the Lacedaemonians, Xenophon compares the jurisdiction between the overall Greek and the more sophisticated Spartans. For example, when he writes about the boys as objects of affection, he states that among the other Greeks such as the Boeotians and Eleians, a man and a boy may enter a union and attempt to gain favor of the young boys however, it is sometimes prohibited for them to converse. As learned in lecture, in ancient Greece, during Xenophon’s time, it wasn’t unusual for older men to be attracted to the younger Greek boys however it was not something someone would share in the open. It was referred to in another Greek writing, The Birds by Aristophanes, the two main characters imagine a land where it would be rude for a family friend not to grope another man’s son. This shows just how prevalent the phenomenon of these relations between older and younger men had become in Xenophon’s home. Lycurgus however did not agree that it should have to be so hidden and stated that an older man liked a boy because of his personality and not only due to lust and physical attraction, that it was an excellent thing and should be celebrated (pg 85). Xenophon definitely wrote to inform the general Greek population of this new way of life to those who thus far did not follow and believe in the ways that Lycurgus did. This is probably one of his greatest works not only because it is our best explanation of Spartans rules and community life, but also because it stirred up the governments around Sparta. They tried to get rid of him through exile because of his wrongdoings while he exploits their faulty governmental regulations through his writing which spread much further. Using evidence from the document, it is obvious that Xenophon was not only a true follower of Lycurgus but is a strong ancient day liberalist. Xenophon believed in all of the rules Lycurgus set up which were, at the time, contrary to popular beliefs of those in the other Greek societies. For example, Lycurgus set up a food system in which people were only to take enough to survive. It states that they should â€Å"take only such a quantity as never to be oppressed with repletion, and not to be strangers to living somewhat frugally† so that they would be â€Å"more satisfied with any kind of food† (pg 84). I feel that this shows Xenophon as a warrior or strong willed because he believes that suffering in the end will bring good fortune. This is also shown in the document when he agrees with Lycurgus’ law that one should not wear shoes in order to toughen their feet so they can become stronger and more agile. As a liberalist with a strong warrior background, Xenophon celebrated the strength and intuitive creativity of the Spartan way of life. His attitudes toward all other nations were that they were weak; the way they were set up would not be beneficial to their people. However, after being raised in Athens for all those years, how is it that he just now is changing his views? After being exiled for fighting under the rule of the Spartan king, Xenophon began living his new life as a respectable member of the Spartan community. He wrote a lot and became an active member as well as studied under Socrates, which I believed helped him to see the ways of life from a new point of view. Since the Spartans rules were so different from the others it makes sense that Xenophon would be compelled to write about their lifestyle, which was a powerful and virtuous one at that. I think the fact the these rules seemed to try to push everyone to be the best they could be in every category including virtue (honours paid to old age encouragement of virtue 91), honor (infamy and penalties of cowardice 90), to be humble (obedience to the magistrate and laws 89), and last but definitely not least, physical strength. The environment around them seems to be one with an availability of steep terrain but it is also a city. When addressing that the children should not wear shoes he specifies that it will allow them to go up steep inclines with greater ease so I feel that there are either many steep steps leading towards their great buildings in the city or possibly rough terrain. Another thing I noticed is that the Spartas are very set on being powerful, strong and ready to battle so it is very likely that the warriors in Sparta must be equipped to walk over far, steep distances in order to battle. The surrounding areas of Sparta are possibly spread out from city to city do that one city is not directly touching another Greek city even though they may be close. Again, while addressing the wear of the Spartans, Xenophon states that they need to wear only one outfit so that they can become accustomed to both the cold and heat which leads me to believe that the general climate there was about the same as it would be over here in North America today. As far as the people in Sparta, they are all accustomed to joining in competitions, becoming stronger and becoming the best of the best. Sparta differs a lot from Athens not only based upon its laws but the way the people act and react to one another. In Sparta the women we to be equal to the men; â€Å"the female should practice bodily exercises no less than the male sex †¦expecting that when both parents were rendered strong, a stronger offspring would be born from them. † (pg 82). Not only does this show that the people of Sparta were all about toughness and strength but it goes back to support the idea that Xenophon too was like them and had a warrior like personality about him. Also, they are trying to spread equality between the men and women in ancient Sparta which is something that women are still struggling with today. In the other Greek nations the women are to sit and spin wool, to be sedentary, which would be parallel to the old ideas in American history which would not let women hold places in many jobs, institutions or positions in war. Sparta believes that men and women should both become strong and sturdy, ready for war. Although the women were not completely equal to men, this coincides with the way American women in modern day have worked so hard to become equal to men. One rule in particular that seems very odd is a part of a rule previously mentioned; Citizens are to be frugal when it comes to food. The second part of the rule is that if one does become hungry, it is â€Å"honorable to steal as many cheeses as possible† (pg 84) but on the contrary, if caught doing so, one will be greatly punished. It is like saying that it is not illegal unless caught like in today’s society how underage drinking is one of the most common problems but unless you get caught there won’t be a problem. This rule was likely created in order to make the Spartan people more cunning and creative in order to make them more useful in battle. Also, survival of the fittest may come into play in this situation; It is clear that the Spartan’s were mainly concentrated on being strong and warriors so if one was not smart enough to find ways to steal cheese and felt as though he did not have enough to eat, he would either have to leave Sparta or he may perish. Either way the Spartans would have lost one of their weak links and would become stronger as a whole. This document most clearly tells us that Lycurgus was a very great leader and a liberalist of his days going against all that the other Greeks believed to be true. Not only that, but Lycurgus created one of the strongest nations in which Xenophon quickly felt at home. Although he may not directly state it, Xenophon conveys a sense of bitterness towards the other Greeks by judging everything they do. He makes it seem ridiculous that the rules the follow were ever thought to be substantial laws when he makes remarks that nearly make fun of their way such as when he says things like â€Å"a man should feel ashamed†(83), â€Å"how can we expect women treated thus way should produce†(82), or â€Å"Instead of being rendered effeminate†(84). Although it may be easily miss ed, after given a bit of thought it is clear that Xenophon is, in a way, making fun of the others by calling their men feminine, men shameful and telling them they do not even know how to treat their women. He shoots small phrases and insults to the others in order to diminish their power and pull support over to their side. Clearly he was very successful in using his persuasion technique as the Spartans rules spread to the â€Å"modern ruling classes of England and continental Europe† which both have based their education on the Greek classics (82). This document is a very scholarly piece and gives one of the greatest accounts of history back in ancient Greece on not only the Spartan side but also on the side of all of the other Greek. It gives a good overview of multiple ways of life and sets up a time period in which new laws were being created which would eventually take over the old ways that the others used to follow. It reminds me of when the American’s first made their laws apart from the British rule, although they were a small nation compared to Great Britain, they were powerful and thoughtful in their rule making. Based on the rules that Lycurgus placed on his people, I believe the Spartans could be considered the original revolutionaries. I feel during this time the Athenians looked at the Spartans with distaste and thought they were much smarter than the Spartans who were trying to enforce new, unorthodox rules which would make them stronger. It probably also scared the Athenians a little because their people were not strong and built like the Spartans, instead they had the intelligence, which Xenophon and Lycurgus found to be insufficient anyway as they criticize the way of education used in Athens in the constitution. This document is of great importance as it set up the new way of life and set apart the Spartans from all other Greeks which is part of the reason they are so famous today.

Wednesday, August 21, 2019

Inquiry learning Essay Example for Free

Inquiry learning Essay Introduction Discovery learning or Inquiry Learning has a long history in education and has regained popularity over the last decade as a result of changes in the field of education that put more emphasis on the role of the learner in the learning process. Zachos, Hick, Doane, and Sargent define discovery learning as â€Å"the self-attained grasp of a phenomenon through building and testing concepts as a result of inquiry of the phenomenon. † The definition emphasizes that it is the learner who builds concepts, that the concepts need to be tested, and that building and testing of concepts are part of the inquiry of the phenomenon. Computer simulations have rich potential to provide learners with opportunities to build and test concepts, and learning with these computer simulations is also referred to as simulation-based discovery learning (Lester, Vicari, Paraguacu, 2004). Students engaged in discussions – raising questions, resting ideas, challenging each other’s assertions – is at the heart of inquiry learning. Such discussions enable students to go beyond hands-on activities to interpret and reflect on their experiences and develop new ways of thinking. Reflecting their understanding of inquiry learning, the originators of network science aimed to have students in distant classrooms use the network to discuss science with one another like collaborating scientists (Feldman, 2000). Literature Review The main goal of discovery learning activity is to obtain and/or construct knowledge about a domain by performing experiments and inferring rules and properties of the domain from the results of those experiments. Research on discovery learning has shown that learners can experience a range of problems that can prevent successful learning. Discovery learning requires learners to act in the same manner as scientist when discovering the properties and relations of the domain that is simulated, using processes that are very similar to the processes of scientific discovery. Learners need to generate hypotheses, design experiments, predict their outcome, interpret data and reconsider hypotheses in order to construct knowledge about the domain. With each of these learning processes, problems can arise. Learners can fail to state testable hypotheses, design uninformative experiments or interpret experimental results badly (Gauthier, Frasson, VanLehn, 2000). In order to make discovery learning successful, learners can be supported from within the learning environment. The learning environment can contain cognitive tools that can be directed at the support of one or more learning processes. Cognitive tools can offer support to the learner in several ways of support, creating a learning dialogue between the learning environment and the learner and at establishing the conditions under which profitable learning processes takes place. Cognitive tools play a role in supporting and provoking these learning processes (Gauthier et al. , 2000; McTighe Wiggins, 2005). Like in discovery learning, the idea of simulation-based discovery learning is that the learner actively engages in a process. In an unguided simulation-based discovery environment learners have to set their own learning goals. At the same time they have to find and apply the methods that help to achieve these goals, which is not always easy. Two main goals can be associated with simulation-based discovery learning; development of knowledge about the domain of discovery, and development of skills that facilitate development of knowledge about the domain (Lester, Vicari, Paraguacu, 2004). Those who read Guthrie, Cornford, Allen, and Bluck, among others, will find there what we might call the â€Å"traditional view. † According to this view, the paradox is a dilemma about one’s epistemic resources at the outset of inquiry and the role those resources play at the inquiry’s conclusion. The alternatives that the dilemma proposes are beginning with 1) total, explicit knowledge or 2) absolute ignorance. The doctrine of recollection provides the solution with its proposal that all inquiry begins with something intermediate between 1) and 2): latent, unconscious, or implicit knowledge. When these commentators speak of â€Å"total knowledge,† they seem to have in mind â€Å"self-consciously clear† or â€Å"conscious† knowledge (Anton Preus, 1989). There are three points to be borne in mind in any discussion on learning by discovery. First, what is involved primarily is the learning of facts, concepts and principles rather than skills, techniques or sensitivities; and the subjects most relevant to discovery learning are mathematics, science and environmental studies. Second, it is usually associated with the traditional classroom, and third learning by discovery does not just happen; it comes about as a result of a particular teaching method or strategy. Numerous strategies can be distinguished in this connection; perhaps the most common one to be found is that of guided discovery (Manion, Morrison, Cohen, 2004). Discovery or Inquiry must ultimately in the history of the race precede instruction; for if it’s this teacher who teaches from someone else who learned it from another teacher that cannot go back indefinitely. Somewhere in the knowledge that we pass on in the process of teaching, someone must have discovered it for himself. so we see, first of all, that learning by discovery is primary (Loucks-Horsley Olson, 2000). Learning by instruction is secondary. And if this is so then we also see that teachers are, in an absolute sense, dispensable. For nothings which can be learned by instruction with teachers is impossible to learn without teachers. I don’t mean teachers aren’t useful; they are. For most of us would not be able to learn without the help of teachers or learn as rapidly or learn as easily the things we have to come to know in the course of our lifetime. But I do not mean that teachers are only helps. And this understanding of the teacher as an aid, as something which helps in the process of learning, is the deepest insight into the nature of teaching in relation to learning (Adler, 2000). Learning by instruction, learning with the help of teachers is no less active than learning by discovery or inquiry. Perhaps it would be better then, instead of saying learning by instruction and learning by discovery, to call them both learning by discovery; learning with a teacher as â€Å"aided discovery† and learning without a teacher, as â€Å"unaided discovery (Adler, 2000). Analysis Many network science projects have not lived up to their potential to involve students in productive inquiry. Firstly, the network science model of curriculum typically constraints classrooms by imposing rigid schedules for data submission and exchanges. The low level of completion for many network science projects – which, was less than 50% of classes in one project submitting data – may reflect teacher’s inability to fit the real lives of their classrooms, punctuated by school events and holidays and snowstorms, into the schedule demands of many network science projects (Feldman, 2000). Aiming to coordinate work among classes, many network science projects are constrained by centralized schedules. To refocus science learning on inquiry, teachers and students need flexible schedules to allow questions to be pursued in greater depth. Without such flexibility, the potential of the curriculum to support student inquiry is greatly diminished (Feldman, 2000). Secondly, network science encourages the use of scientific and social problems to spark learning, focusing on the importance of investigating questions for which the answer is not known. However, this emphasis on questions for which the answer is not known and the questions are of genuine interest to scientists excludes the possibility of students investigating concepts that may be well known to scientist but no longer of interest to them. Because such concepts are still unknown to students and potentially of great interest, they offer a scientific excursion through which students can reliably have successful and powerful learning experiences. For example, students might investigate phenomena as simple as why some objects float – a topic that is unlikely to be of any interest to scientists (Feldman, 2000). Inquiry learning, under appropriate conditions, is highly desirable; an elaborate pattern of ideas must be built up in a child’s head and only the child can built it; it is the teacher’s job to help the child to build up this elaborate structure of interrelated ideas, and to help the child correct the structure of interrelated ideas, and to help the child correct the structure whenever it is found to be in error (Solomon, 1988). By means of discovery learning we may reasonably expect children to learn something new; and to do so through some initiative of their own. Moreover, a teacher supports a child’s self-chosen activity with questions, commentary and suggestions (Manion et al. , 2004). Conclusion In this paper, we presented a view on combining collaborative learning and the discovery learning. The aim was to show how we can benefit from theoretical knowledge on discovery learning to enhance the added value that collaboration can have and, vice versa, how collaboration in itself can serve as support for the processes of discovery that learners can engage in. Mutual gain can be created from combining collaborative and discovery learning by increasing the mutual awareness in tools supporting either type of learning. Adding knowledge about discovery to collaborative tools can enhance collaborative tools to adapt themselves or give feedback on their contents. On the other hand, collaborative processes take the role of cognitive tools for discovery learning in making learning processes explicit. Of course the examples given in the paper are only a small part of what become possible combining two powerful paradigms of learning (Gauthier et al., 2000). In the latter part of the paper we show how a theory of discovery learning can help to design architecture for communicative support for discovery learning. A central place is taken by a common frame of reference that supports the communication between the different components in the architecture (Gauthier et al. , 2000). References: Adler, M. J. (2000). How to Think About the Great Ideas: From the Great Books of Western Civilization. Chicago and La Salle: Open Court Publishing. Anton, J. P. , Preus, A. (1989). Essays in Ancient Greek Philosophy: Plato. New York: SUNY Press. Feldman, A. (2000). Network Science, a Decade Later: The Internet and Classroom Learning. Mahwah, New Jersey: Lawrence Erlbaum Associates. Gauthier, G. , Frasson, C. , VanLehn, K. (2000). Intelligent Tutoring Systems. Germany: Springer. Lester, J. C. , Vicari, R. M. , Paraguacu, F. (2004). Intelligent Tutoring Systems. Berlin Heidelberg, NY: Springer. Loucks-Horsley, S. , Olson, S. (2000). Inquiry and the National Science Education Standards: A Guide for Teaching and Learning. Washington DC: National Academies Press. Manion, L. , Morrison, K. R. B. , Cohen, L. (2004). A Guide to Teaching Practice. London and New York: RoutledgeFalmer. McTighe, J. , Wiggins, G. P. (2005). Understanding by Design. Virginia USA: Association for Supervision and Curriculum Development. Solomon, C. (1988). Computer Environments for Children: A Reflection on Theories of Learning and Education. Cambridge, Massachusetts; London, England: MIT Press.