| CS 374 Compilers Homework #5 |
Note: This work is to be done in assigned groups. Each group will submit one assignment. Although you may divide the work, both team members should be able to present/describe their partner's work upon request.
In the previous assignment, you constructed an abstract syntax tree (AST) with the necessary methods to use the visitor programming pattern. In this assignment, you will create two visitors. The first visitor will traverse the relevant declaration portions of the AST to build a symbol table (see Figure 5.7) of all MiniJava program identifier information. The second visitor traverses the relevant code portions of the AST in order to type-check the program and verify that it is a legal program. For example, 1 + (2 < 3) will legally parse, but is an illegal attempt to add an int type to a boolean type. Also, our parser does not check for the correct number of arguments in a function call, multiply defined identifiers, undefined identifiers, etc. In this phase, we'll do all necessary checking to ensure the legality of a program, and supply reasonable error messages if there are semantic errors in the code.
0. Preparation: You'll be using the same files from the previous homework. In addition, use this new Main and add the following files to your directory tree. Review the visitor pattern of 4.3. Then review the given examples of AST visitors from the last assignment. PrettyPrintVisitor takes the abstract syntax tree and prints the corresponding MiniJava code. ASTPrintVisitor prints an abstract syntax tree in the form Node(Subnode(...), ..., Subnode(...)) with occasional line breaks. Read Chapter 5 and give special attention to Figure 5.7.
1. Building the Symbol Table: For this part of the assignment, you'll create a visitor BuildSymbolTableVisitor (BSTV) that extends DepthFirstVisitor. When accepted by a Program root, BSTV should initialize a public symbolTable field with an empty symbol table and proceed to populate it with all non-main-method classes, methods, fields, parameters, and local variables. To make this easy and reduce the amount of parameter passing, you're encouraged to keep track of the current class and method as BSTV fields. You'll only need to visit parts of the tree that are relevant to building the symbol table. For example, a variable declaration is relevant, but a variable usage is not.
Since the Ch. 5 project specifications are very loose, you are free to implement the SymbolTable class as you wish. (Mine is thrown into package visitor, but you use an alternate package.) I would recommend designing a set of classes (e.g. Class, Method, Variable) and designing a data structure that follows that of Figure 5.7. Your symbol table will consist of a HashMap (or Hashtable) mapping Strings to Class objects. Each Class object will have a table for field variables, and a table for methods. Although Section 5.1's abstract treatment of symbol tables doesn't stress this, you will at some point need to commit to an ordering of these fields when we lay out our objects in memory. (A natural ordering is the order of declaration.) Not all Dictionary or Map classes will return an Enumeration or Iteration with ordering commitments. Now or later, you'll need to commit on and record an ordering of fields. Each Method object will have a return type, a table for parameters, and a table for locals. The number and ordering of parameters must be recorded for type-checking method calls. Thus you may wish to maintain ArrayLists of identifiers alongside your tables. Store whatever information you need, and feel free to add more as necessary in later stages.
While it is true that industrial strength symbol tables facilitate efficient lookup through the use of hash tables, etc., your key design goals here are correctness and simplicity, in that order. If you don't make use of the author's Symbol package interfaces, that's fine. Also, I'll not be overly concerned about the efficiency of your code.
Finally, it will be important for you to be able to check the correctness of your symbol table. You should therefore implement a toString method that summarizes the contents of the symbol table. Example outputs are given here.
2. Type-checking: For this part of the assignment, you'll create a visitor TypeCheckVisitor (TCV) that extends TypeDepthFirstVisitor (like DepthFirstVisitor, but returning types). TCV should be constructed with the symbolTable of the BSTV. Again, to make this easy and reduce the amount of parameter passing, you're encouraged to keep track of the current class and method as BSTV fields. You'll only need to visit parts of the tree that are relevant to type-checking. For example, a variable usage is relevant, but a variable declaration is not. Here is a sampling of possible MiniJava type-checking errors:
Each of these errors can be implemented as a "System.err.println" message followed by "System.exit(1)". Finally, you may wish to divide the classes within the visitor into two categories, ones that return Types (e.g. expressions), and ones that don't, returning null (e.g. statements).
(These comments are to supplement your reading. Question(s) asked are for you to think about on your own and need not be turned in with the homework.)
5.1: It should be noted that symbol tables do not merely map symbols to types. Symbols are mapped to bindings which are whatever we want them to be for a given language or scope. For instance, a simple local variable i may map to the type "int", but a class C will map to a binding which keeps track of fields and methods. Later on, we'll want to (1) know how an objects fields are laid out in memory, and (2) set/get labels that indicate the beginning of the assembly code for each class method. Think of the symbol table as a data structure which keeps track of identifier information throughout the compilation process. Figure 5.7 is the most important to grasp in this chapter.
5.2: <insert flame here> It's unclear how the first-phase example Program 5.8 is related to the interface of Section 5.1. For our purposes, you'll think of the MiniJava symbol table as having the structure of Figure 5.7. Scoping is rather simple in MiniJava. Variable references occur only in method statements. In such scope, one can refer to a method's locals and parameters, classes, and their methods. One cannot refer to object fields (which could be accoessed through getter methods). All local declarations are at the beginning of a method, so there is no nesting of scopes. More details on how to type-check MiniJava are given in the assignment above.


This game is about discovery, resources, and does not demand your full attention. You are free to pay as much attention to the game as you want. It will happily run in the background, and works even while closed.
To begin, you should catch fish. Once you have some fish, more actions will become available. If you have no idea what these actions do, click the "Toggle descriptions" button for more information.
If you are ever stuck, try actions you haven't yet tried. Remember, though, that sometimes patience is the only way forward. Patience and ever escalating numbers.
This game was originally coded by Cirr. Below is the original credits info.
This game was originally created in 3 days for Seamergency 2014. (Technically it was 4 days, but sometimes plans go awry.)
It was made by Cirr who needs to update his website. He has a rarely updated Twitter though.
Additional code and credit help provided by Dylan and Sam Red. Dylan is also graciously hosting this game.


Male Visitors
Curabitur ullamcorper ultricies nisi. Nam eget dui. Etiam rhoncus...
Female Visitors
Curabitur ullamcorper ultricies nisi. Nam eget dui. Etiam rhoncus...
| Item Details | Sold | Gain | Actions | |
|---|---|---|---|---|
| The Dothraki Shoes 20 remaining | 3,345 | 33.34% from last week | ||
| Westeros Sneaker In stock | 720 | 21.20% from last week | ||
| Selonian Hand Bag In stock | 1,445 | 23.34% from last week | ||
| Kel Dor Sunglass 45 remaining | 2,500 | 28.78% from last week | ||
| Kubaz Sunglass In stock | 223 | 18.18% from last week |
| User | Type | Date | |
|---|---|---|---|
| Mark K. Peters TRANSID:<PHONE_NUMBER> | Email verified | Just Now | |
| Karmen F. Brown TRANSID:<PHONE_NUMBER> | Pending verification | Apr 21, 2017 8:34am | |
| Gorgonio Magalpok TRANSID:<PHONE_NUMBER> | Purchased success | Apr 10, 2017 4:40pm | |
| Ariel T. Hall TRANSID:<PHONE_NUMBER> | Payment on hold | Apr 02, 2017 6:45pm | |
| John L. Goulette TRANSID:<PHONE_NUMBER> | Account deactivated | Mar 30, 2017 10:30am |
Far far away, behind the word mountains, far from the countries Vokalia and Consonantia. Even the all-powerful Pointing has no control about the blind texts.
Getting StartedFar far away, behind the word mountains, far from the countries Vokalia and Consonantia. Even the all-powerful Pointing has no control about the blind texts.
Take a Tour1,898
32,112
72,067
Maecenas tempus, tellus eget conditum rhon.
2.5% change from yesterday


- definition - Variable in class com.altcodelabs.methodtrace.analyser.TraceManager.MethodTrace
-
- desanitize(String) - Method in class com.altcodelabs.methodtrace.analyser.TraceManager
-
Replaces the \\n with new-lines
- Diff(diff_match_patch.Operation, String) - Constructor for class name.fraser.neil.plaintext.diff_match_patch.Diff
-
Constructor.
- diff_bisect(String, String, long) - Method in class name.fraser.neil.plaintext.diff_match_patch
-
Find the 'middle snake' of a diff, split the problem in two
and return the recursively constructed diff.
- diff_bisectSplit(String, String, int, int, long) - Method in class name.fraser.neil.plaintext.diff_match_patch
-
Given the location of the 'middle snake', split the diff in two parts
and recurse.
- diff_charsToLines(List<diff_match_patch.Diff>, List<String>) - Method in class name.fraser.neil.plaintext.diff_match_patch
-
Rehydrate the text in a diff from a string of line hashes to real lines of
text.
- diff_cleanupEfficiency(LinkedList<diff_match_patch.Diff>) - Method in class name.fraser.neil.plaintext.diff_match_patch
-
Reduce the number of edits by eliminating operationally trivial equalities.
- diff_cleanupMerge(LinkedList<diff_match_patch.Diff>) - Method in class name.fraser.neil.plaintext.diff_match_patch
-
Reorder and merge like edit sections.
- diff_cleanupSemantic(LinkedList<diff_match_patch.Diff>) - Method in class name.fraser.neil.plaintext.diff_match_patch
-
Reduce the number of edits by eliminating semantically trivial equalities.
- diff_cleanupSemanticLossless(LinkedList<diff_match_patch.Diff>) - Method in class name.fraser.neil.plaintext.diff_match_patch
-
Look for single edits surrounded on both sides by equalities
which can be shifted sideways to align the edit to a word boundary.
- diff_cleanupSemanticScore(String, String) - Method in class name.fraser.neil.plaintext.diff_match_patch
-
Given two strings, compute a score representing whether the internal
boundary falls on logical boundaries.
- diff_commonOverlap(String, String) - Method in class name.fraser.neil.plaintext.diff_match_patch
-
Determine if the suffix of one string is the prefix of another.
- diff_commonPrefix(String, String) - Method in class name.fraser.neil.plaintext.diff_match_patch
-
Determine the common prefix of two strings
- diff_commonSuffix(String, String) - Method in class name.fraser.neil.plaintext.diff_match_patch
-
Determine the common suffix of two strings
- diff_compute(String, String, boolean, long) - Method in class name.fraser.neil.plaintext.diff_match_patch
-
Find the differences between two texts.
- Diff_EditCost - Variable in class name.fraser.neil.plaintext.diff_match_patch
-
Cost of an empty edit operation in terms of edit characters.
- diff_fromDelta(String, String) - Method in class name.fraser.neil.plaintext.diff_match_patch
-
Given the original text1, and an encoded string which describes the
operations required to transform text1 into text2, compute the full diff.
- diff_halfMatch(String, String) - Method in class name.fraser.neil.plaintext.diff_match_patch
-
Do the two texts share a substring which is at least half the length of
the longer text?
This speedup can produce non-minimal diffs.
- diff_halfMatchI(String, String, int) - Method in class name.fraser.neil.plaintext.diff_match_patch
-
Does a substring of shorttext exist within longtext such that the
substring is at least half the length of longtext?
- diff_levenshtein(List<diff_match_patch.Diff>) - Method in class name.fraser.neil.plaintext.diff_match_patch
-
Compute the Levenshtein distance; the number of inserted, deleted or
substituted characters.
- diff_lineMode(String, String, long) - Method in class name.fraser.neil.plaintext.diff_match_patch
-
Do a quick line-level diff on both strings, then rediff the parts for
greater accuracy.
- diff_linesToChars(String, String) - Method in class name.fraser.neil.plaintext.diff_match_patch
-
Split two texts into a list of strings.
- diff_linesToCharsMunge(String, List<String>, Map<String, Integer>, int) - Method in class name.fraser.neil.plaintext.diff_match_patch
-
Split a text into a list of strings.
- diff_main(String, String) - Method in class name.fraser.neil.plaintext.diff_match_patch
-
Find the differences between two texts.
- diff_main(String, String, boolean) - Method in class name.fraser.neil.plaintext.diff_match_patch
-
Find the differences between two texts.
- diff_main(String, String, boolean, long) - Method in class name.fraser.neil.plaintext.diff_match_patch
-
Find the differences between two texts.
- diff_match_patch - Class in name.fraser.neil.plaintext
-
Class containing the diff, match and patch methods.
- diff_match_patch() - Constructor for class name.fraser.neil.plaintext.diff_match_patch
-
- diff_match_patch.Diff - Class in name.fraser.neil.plaintext
-
Class representing one diff operation.
- diff_match_patch.LinesToCharsResult - Class in name.fraser.neil.plaintext
-
Internal class for returning results from diff_linesToChars().
- diff_match_patch.Operation - Enum in name.fraser.neil.plaintext
-
The data structure representing a diff is a Linked list of Diff objects:
{Diff(Operation.DELETE, "Hello"), Diff(Operation.INSERT, "Goodbye"),
Diff(Operation.EQUAL, " world.")}
which means: delete "Hello", add "Goodbye" and keep " world."
- diff_match_patch.Patch - Class in name.fraser.neil.plaintext
-
Class representing one patch operation.
- diff_prettyHtml(List<diff_match_patch.Diff>) - Method in class name.fraser.neil.plaintext.diff_match_patch
-
Convert a Diff list into a pretty HTML report.
- diff_text1(List<diff_match_patch.Diff>) - Method in class name.fraser.neil.plaintext.diff_match_patch
-
Compute and return the source text (all equalities and deletions).
- diff_text2(List<diff_match_patch.Diff>) - Method in class name.fraser.neil.plaintext.diff_match_patch
-
Compute and return the destination text (all equalities and insertions).
- Diff_Timeout - Variable in class name.fraser.neil.plaintext.diff_match_patch
-
Number of seconds to map a diff before giving up (0 for infinity).
- diff_toDelta(List<diff_match_patch.Diff>) - Method in class name.fraser.neil.plaintext.diff_match_patch
-
Crush the diff into an encoded string which describes the operations
required to transform text1 into text2.
- diff_xIndex(List<diff_match_patch.Diff>, int) - Method in class name.fraser.neil.plaintext.diff_match_patch
-
loc is a location in text1, compute and return the equivalent location in
text2.
- diffs - Variable in class name.fraser.neil.plaintext.diff_match_patch.Patch
-
- parameters - Variable in class com.altcodelabs.methodtrace.analyser.TraceManager.MethodTrace
-
- Patch() - Constructor for class name.fraser.neil.plaintext.diff_match_patch.Patch
-
Constructor.
- patch_addContext(diff_match_patch.Patch, String) - Method in class name.fraser.neil.plaintext.diff_match_patch
-
Increase the context until it is unique,
but don't let the pattern expand beyond Match_MaxBits.
- patch_addPadding(LinkedList<diff_match_patch.Patch>) - Method in class name.fraser.neil.plaintext.diff_match_patch
-
Add some padding on text start and end so that edges can match something.
- patch_apply(LinkedList<diff_match_patch.Patch>, String) - Method in class name.fraser.neil.plaintext.diff_match_patch
-
Merge a set of patches onto the text.
- patch_deepCopy(LinkedList<diff_match_patch.Patch>) - Method in class name.fraser.neil.plaintext.diff_match_patch
-
Given an array of patches, return another array that is identical.
- Patch_DeleteThreshold - Variable in class name.fraser.neil.plaintext.diff_match_patch
-
When deleting a large block of text (over ~64 characters), how close do
the contents have to be to match the expected contents.
- patch_fromText(String) - Method in class name.fraser.neil.plaintext.diff_match_patch
-
Parse a textual representation of patches and return a List of Patch
objects.
- patch_make(String, String) - Method in class name.fraser.neil.plaintext.diff_match_patch
-
Compute a list of patches to turn text1 into text2.
- patch_make(LinkedList<diff_match_patch.Diff>) - Method in class name.fraser.neil.plaintext.diff_match_patch
-
Compute a list of patches to turn text1 into text2.
- patch_make(String, String, LinkedList<diff_match_patch.Diff>) - Method in class name.fraser.neil.plaintext.diff_match_patch
-
- patch_make(String, LinkedList<diff_match_patch.Diff>) - Method in class name.fraser.neil.plaintext.diff_match_patch
-
Compute a list of patches to turn text1 into text2.
- Patch_Margin - Variable in class name.fraser.neil.plaintext.diff_match_patch
-
Chunk size for context length.
- patch_splitMax(LinkedList<diff_match_patch.Patch>) - Method in class name.fraser.neil.plaintext.diff_match_patch
-
Look through the patches and break up any which are longer than the
maximum limit of the match algorithm.
- patch_toText(List<diff_match_patch.Patch>) - Method in class name.fraser.neil.plaintext.diff_match_patch
-
Take a list of patches and return a textual representation.
- Preferences - Class in com.altcodelabs.methodtrace.analyser
-
Contains the methods to allow editing and viewing preferences of the application.
- PreferencesFrame - Class in com.altcodelabs.methodtrace.analyser
-
The window which can be used to edit the preferences of the application.
- PreferencesFrame(boolean) - Constructor for class com.altcodelabs.methodtrace.analyser.PreferencesFrame
-
Creates a new form and loads the existing values


Wonder Woman 1984
Wonder Woman 1984 is an upcoming American superhero film based on the DC Comics character Wonder Woman. It is the sequel to 2017's Wonder Woman and the ninth installment in the DC Extended Universe (DCEU). The film is directed by Patty Jenkins from a script she wrote with Geoff Johns and David Callaham and a story by Johns and Jenkins. It will star Gal Gadot as Diana Prince / Wonder Woman, alongside Chris Pine, Kristen Wiig, Pedro Pascal, Robin Wright and Connie Nielsen in supporting roles. Set in 1984, during the Cold War, the film will follow Diana as she faces off against Maxwell Lord and Cheetah.....
watch trailer


Boy, 10, delivers chilling death threat in squalid camp filled with ISIS brides
ISIS brides and their children are being kept in al Hol prison in north east Syria where Kurdish security forces are trying to keep control following the invasion of Turksh forces
by Milo Boyd, https://www.mirror.co.uk/authors/milo-boyd/A camp filled with the children and brides of ISIS fighters has become a hot bed of radicalism and its own "mini caliphate".
A staggering 70,000 people are locked up at the al Hol prison in north east Syria.
The Kurdish fighters that guard them have been depleted by the recent invasion of Turkish forces, meaning violence has broken out behind the camp's single fence.
Multiple people have been murdered and stabbings are common, Sky News reported .
Children living in the terrifying environment appear to be deeply traumatised by the situation and the radical doctrines of their elders.
One ten-year-old boy delivered a chilling threat straight into the camera lens of a journalist visiting the camp.
 We will slaughter you." he told a Sky News reporter.
"God says, 'Turn to Allah with sincere repentance in the hope that your Lord will remove you from your ills.'"

News of the leader of the terror cult's leader, Abu Bakr Al-Baghdadi, at the hands of US forces had filtered through to the prisoners.
One woman from Paris expressed confidence that a new leader would take his place, while suggesting he had found his way to some kind of afterlife.
Not far from al Hol are several prisons where adult male ISIS fighters are kept.
The security of the prisons has come into question since Turkish forces invaded the country last month.
Hundreds of ISIS brides escaped from another prison in Ain Issa close to the Turkish border, Kurdish forces have said.
It was never the plan of coalition forces for woman and children to remain in al Hol as long as they have.
As of yet no plans have been formed as to what to do with the people being kept there under the watch of guards with guns slung across their shoulders.
Conditions are far from luxurious. Laundry hangs on washing lines hung between tents around which barefoot children run in the dirt.
Mark Stone, of Sky News, suggested the squalid environment was the perfect breeding ground for extremism.
He said: "The place is the perfect incubator for the reformation of IS. Essentially the camp already represents a new mini caliphate."


Extending QML - Object and List Property Types Example
This example builds on:
The Object and List Property Types example shows how to add object and list properties in QML. This example adds a BirthdayParty type that specifies a birthday party, consisting of a celebrant and a list of guests. People are specified using the People QML type built in the previous example.
BirthdayParty { host: Person { name: "Bob Jones" shoeSize: 12 } guests: [ Person { name: "Leo Hodges" }, Person { name: "Jack Smith" }, Person { name: "Anne Brown" } ] }
Declare the BirthdayParty
The BirthdayParty class is declared like this:
class BirthdayParty : public QObject { Q_OBJECT Q_PROPERTY(Person *host READ host WRITE setHost) Q_PROPERTY(QQmlListProperty<Person> guests READ guests) public: BirthdayParty(QObject *parent = 0); Person *host() const; void setHost(Person *); QQmlListProperty<Person> guests(); void appendGuest(Person*); int guestCount() const; Person *guest(int) const; void clearGuests(); private: static void appendGuest(QQmlListProperty<Person>*, Person*); static int guestCount(QQmlListProperty<Person>*); static Person* guest(QQmlListProperty<Person>*, int); static void clearGuests(QQmlListProperty<Person>*); Person *m_host; QVector<Person *> m_guests; };
The class contains a member to store the celebrant object, and also a QList<Person *> member.
In QML, the type of a list properties - and the guests property is a list of people - are all of type QQmlListProperty<T>. QQmlListProperty is simple value type that contains a set of function pointers. QML calls these function pointers whenever it needs to read from, write to or otherwise interact with the list. In addition to concrete lists like the people list used in this example, the use of QQmlListProperty allows for "virtual lists" and other advanced scenarios.
Define the BirthdayParty
The implementation of BirthdayParty property accessors is straight forward.
Person *BirthdayParty::host() const { return m_host; } void BirthdayParty::setHost(Person *c) { m_host = c; } QQmlListProperty<Person> BirthdayParty::guests() { return QQmlListProperty<Person>(this, this, &BirthdayParty::appendGuest, &BirthdayParty::guestCount, &BirthdayParty::guest, &BirthdayParty::clearGuests); } void BirthdayParty::appendGuest(Person* p) { m_guests.append(p); } int BirthdayParty::guestCount() const { return m_guests.count(); } Person *BirthdayParty::guest(int index) const { return m_guests.at(index); } void BirthdayParty::clearGuests() { return m_guests.clear(); }
Running the Example
The main.cpp file in the example includes a simple shell application that loads and runs the QML snippet shown at the beginning of this page.
Files:
- referenceexamples/properties/birthdayparty.cpp
- referenceexamples/properties/birthdayparty.h
- referenceexamples/properties/example.qml
- referenceexamples/properties/person.cpp
- referenceexamples/properties/person.h
- referenceexamples/properties/main.cpp
- referenceexamples/properties/properties.pro
- referenceexamples/properties/properties.qrc


| 002:200 Khan | : |
So when you have accomplished your Manasik [(i.e. Ihram, Tawaf of the Ka'bah and As-Safa and Al-Marwah), stay at 'Arafat, Muzdalifah and Mina, Ramy of Jamarat, (stoning of the specified pillars in Mina) slaughtering of Hady (animal, etc.)]. Remember Allah as you remember your forefathers or with a far more remembrance. But of mankind there are some who say: "Our Lord! Give us (Your Bounties) in this world!" and for such there will be no portion in the Hereafter. |
| 002:200 Maulana | : |
And when you have performed your devotions, laud Allah as you lauded your fathers, rather a more hearty lauding. But there are some people who say, Our Lord, give us in the world. And for such there is no portion in the Hereafter. |
| 002:200 Pickthal | : |
And when ye have completed your devotions, then remember Allah as ye remember your fathers or with a more lively remembrance. But of mankind is he who saith: "Our Lord! Give unto us in the world," and he hath no portion in the Hereafter. |
| 002:200 Rashad | : |
Once you complete your rites, you shall continue to commemorate GOD as you commemorate your own parents, or even better. Some people would say, "Our Lord, give us of this world," while having no share in the Hereafter. |
| 002:200 Sarwar | : |
After you complete the acts of your Hajj, also commemorate God, just as you would remember your father, or even more earnestly. Some people say, "Lord, give us what we want in this life," but in the life hereafter they have no beneficial share. |
| 002:200 Shakir | : |
So when you have performed your devotions, then laud Allah as you lauded your fathers, rather a greater lauding. But there are some people who say, Our Lord! give us in the world, and they shall have no resting place. |
| 002:200 Sherali | : |
And when you have performed the acts of worship prescribed for you, celebrate the praises of ALLAH as you used to celebrate the praises of your fathers, or even with greater devotion. And of men there are some who say 'Our Lord grant us good things in this world;' and such a one shall have no share in the hereafter. |
| 002:200 Yusufali | : |
So when ye have accomplished your holy rites, celebrate the praises of Allah, as ye used to celebrate the praises of your fathers,- yea, with far more Heart and soul. There are men who say: "Our Lord! Give us (Thy bounties) in this world!" but they will have no portion in the Hereafter. |
Concepts/Themes Covered: أركان الإسلام > التوحيد > توحيد الله تعالي > عقائد البشر وأهواؤهم Pillars of Islam> Islamic> Oneness of Allah>The Human Beliefs and Inclinations أركان الإسلام > الحج والعمرة > فرضية الحج وآدابه Pillars of Islam> Hajj and Umrah> Duty of Hajj and its Morals أركان الإسلام > الحج والعمرة > المناسك Pillars of Islam> Hajj and Umrah> The Rituals تنظيم العلاقات المالية > الغنى > طلب الغنى Organizing Financial Relationships>Richness>Seeking Richness
This tool uses eight English parallel translations for the Holy Quran imported from Mr. Clay Smith. You can also visit Qurany Concepts for browsing the Quran themes or topics. If you want to search the Holy Quran for keywords, please visit Qurany Keywords.


This is a code demonstration on how you can use the JavaScript Client Library for Numenta's Grok engine. Part One details (with source code) how to initialize the Grok client object, create projects, streams, and models.
In each step of this example you can toggle the source code to see and understand how the JS Client Library is used, so be sure to click on the toggle source links to view the source for each step.


HTML Imports provide a way to include web content into other HTML pages. This in turn leads to greater modularity and promotes re-use of components. Content can be HTML, CSS, or JavaScript, or a mix of all 3 - in other words, anything you would normally put into an HTML file.
In this example, the template used to create content is imported from a separate document.


National Statistics
This release reports on pupil absence in primary and secondary schools in the autumn and spring terms of the 2014 to 2015 academic year.
PDF , 595KB , 10 pages
MS Excel Spreadsheet , 247KB
If you use assistive technology (such as a screen reader) and need a version of this document in a more accessible format, please email<EMAIL_ADDRESS>. Please tell us what format you need. It will help us if you say what assistive technology you use.
ODS , 113KB
This file is in an OpenDocument format
If you use assistive technology (such as a screen reader) and need a version of this document in a more accessible format, please email<EMAIL_ADDRESS>. Please tell us what format you need. It will help us if you say what assistive technology you use.
MS Excel Spreadsheet , 176KB
If you use assistive technology (such as a screen reader) and need a version of this document in a more accessible format, please email<EMAIL_ADDRESS>. Please tell us what format you need. It will help us if you say what assistive technology you use.
ODS , 106KB
This file is in an OpenDocument format
If you use assistive technology (such as a screen reader) and need a version of this document in a more accessible format, please email<EMAIL_ADDRESS>. Please tell us what format you need. It will help us if you say what assistive technology you use.
MS Excel Spreadsheet , 143KB
If you use assistive technology (such as a screen reader) and need a version of this document in a more accessible format, please email<EMAIL_ADDRESS>. Please tell us what format you need. It will help us if you say what assistive technology you use.
ODS , 84.2KB
This file is in an OpenDocument format
If you use assistive technology (such as a screen reader) and need a version of this document in a more accessible format, please email<EMAIL_ADDRESS>. Please tell us what format you need. It will help us if you say what assistive technology you use.
MS Excel Spreadsheet , 3.05MB
If you use assistive technology (such as a screen reader) and need a version of this document in a more accessible format, please email<EMAIL_ADDRESS>. Please tell us what format you need. It will help us if you say what assistive technology you use.
ODS , 3.04MB
This file is in an OpenDocument format
If you use assistive technology (such as a screen reader) and need a version of this document in a more accessible format, please email<EMAIL_ADDRESS>. Please tell us what format you need. It will help us if you say what assistive technology you use.
MS Excel Spreadsheet , 3.12MB
If you use assistive technology (such as a screen reader) and need a version of this document in a more accessible format, please email<EMAIL_ADDRESS>. Please tell us what format you need. It will help us if you say what assistive technology you use.
ODS , 3.2MB
This file is in an OpenDocument format
If you use assistive technology (such as a screen reader) and need a version of this document in a more accessible format, please email<EMAIL_ADDRESS>. Please tell us what format you need. It will help us if you say what assistive technology you use.
ZIP , 10.9MB
If you use assistive technology (such as a screen reader) and need a version of this document in a more accessible format, please email<EMAIL_ADDRESS>. Please tell us what format you need. It will help us if you say what assistive technology you use.
Plain text , 771Bytes
If you use assistive technology (such as a screen reader) and need a version of this document in a more accessible format, please email<EMAIL_ADDRESS>. Please tell us what format you need. It will help us if you say what assistive technology you use.
This release provides information on the levels of overall, authorised and unauthorised absence in:
It includes information on:
The information is based on pupil level absence data collected via the school census.
It updates and supplements information published in the May 2015 release - ‘Pupil absence in schools in England, autumn term 2015’ .
We have also published a response to the consultation on changes to absence statistics alongside the original consultation which was included in section 9 of ‘Pupil absence in schools in England: autumn 2013 and spring 2014’ in October 2014.
A guide on how we produce pupil absence statistics is also available.
Published: 20 October 2015
From: Department for Education
Part of: Statistics: pupil absence


{% extends "base.html" %} {% load i18n %} {% load static %} {% block meta_title %}{% trans "Home" %}{% endblock %} {% block extra_head %} {% endblock %} {% block title %}{% trans "Home" %}{% endblock %} {% block breadcrumb_menu %}
If you are looking for first-class service, you have come to the right place! We aim to be friendly and approachable.
We are here to serve you and answer any questions you may have. We put our customers first. We listen to you and help you find what you need. Come visit to see what we are all about:
Successful product engineering combines deep technical expertise and insight to leading-edge business strategies. Aptuz development team acts as an extension of your product team, carefully executing your vision with attention to software security, future-proof architecture, and intuitive user experience.
Read More...Our cloud service puts enterprises on the right track to fast and successful cloud adoption while mitigating risk and ensuring industry compliance.
Read More...Aptuz’s Cloud Application Services help you move to the cloud seamlessly whether you're migrating an off-the-shelf package or developing a new application from scratch. Designed to drive flexibility and efficiency, our services include both migration and monitoring solutions running on IaaS or PaaS cloud platforms.
Read More...Big Data Strategic Overview Central to Aptuz's strategy around discovering and driving business value in big data is our innovative suite of solutions. Each leverages big data technologies to deliver enhanced insight and analytics to various industries.
Read More...Our work with Sagar Potluru and his team at Aptuz Technology Solutions for Wingate by Wyndham, New Braunfels resulted in a net increase of 8 percent revenue in the first 3 months. That was beyond our expectations in terms of revenue increase.
Aptuz developed fully automated vehicle tracking system by using mobile technology, which is the first of its kind in India. Workshop efficiency increased by 20% after implementing this in our workshop and we are also seeing a good improvement in our Customer Satisfaction score.
Harsha Hanumara Director at Neon Motors Pvt Ltd & Olive Auto Pvt Ltd
We thank Yaswanth and Pardha Saradhi at Aptuz Team for their wonderful efforts in product development.
Gopi KrishnaKishore Founder & CEO at Feazt Interactive Systems pvt. Ltd


| USE CASE 11 |
The user sees a shadow under his ship. |
|
| Preconditions |
User Stories 1 and 2 have been fulfilled. |
|
| Success End Condition |
A shadow is successfully drawn. |
|
| Fail End Condition |
The user's video card does not support stencil buffers. |
|
| Trigger |
EigenMaze is launched and shadows are enabled. |
|
| Description |
Stencil buffer shadow volumes are used to create realistic shadows for Entities. |
| USE CASE 12 |
Visible thrust is shown when the user is accelerating or deacclerating. |
|
| Preconditions |
User Story 3 has been fulfilled. |
|
| Success End Condition |
Visible thrust is drawn that gives the user a indication of what direction the ship is currently going, and what direction it is accelerating towards. |
|
| Fail End Condition |
No fail end condition has been identified. |
|
| Trigger |
The user accomplishes a task described by User Story 3 |
|
| Description |
Visible thrust is a useful indicator that helps the user figure out the ship's velocity and interia in a spacelike enviroment in EigenMaze. |
| USE CASE 13 |
The user sees shadows that are created by the static geometry in the game (if Lightmaps are enabled). |
|
| Preconditions |
User Story 1 and 2 have been fulfilled. |
|
| Success End Condition |
Shadows created by the walls are successfully created and drawn. |
|
| Fail End Condition |
Possible failure end condition is the JVM running out of memory because creating lightmaps are both a processor and memory intensive task. |
|
| Trigger |
The user accomplishes User Story 2. |
|
| Description |
Lightmaps are used to create shadows casted by level geometry. This method precalculates the shadows before the game starts to increase performance during actual play time. |
| USE CASE 14 |
The user can see network activity. |
|
| Preconditions |
User Stories 5 or 6 have been fulfilled. |
|
| Success End Condition |
User can see activity on the network from other users |
|
| Fail End Condition |
The user does not see activity on the network from other users |
|
| Trigger |
Other users interacting with the network. |
|
| Description |
Game specific data is synched on the network allowing multiple users to participate in the same game. |
| USE CASE 15 |
The user sees text messages in the upper left hand corner of the game window. |
|
| Preconditions |
User Stories 1 and 2 have been fulfilled |
|
| Success End Condition |
Periodic messages appear in the upper left hand of screen. Old messages scroll up until off the screen. |
|
| Fail End Condition |
No messages are seen, or are in the wrong position. |
|
| Trigger |
Preconditions |
|
| Description |
The Text display is created with the same method as the Shields and FPS display. The use of this new feature will be to provide more information to the user. |
| USE CASE 16 |
The user sees scenery outside the maze. |
|
| Preconditions |
User Story 1 has been fulfilled |
|
| Success End Condition |
The maze appears to be in the middle of a scene. Currently a mountain range with green plant life around. |
|
| Fail End Condition |
The maze is surrounded by blackness. |
|
| Trigger |
Preconditions |
|
| Description |
The Sky box is created by enclosing the game space in a cube that moves with the camera. unique textures are used for each side to create the effect of a continous scene. |
| USE CASE 17 |
The user sets engine-wide preferences. |
|
| Preconditions |
The engine is up and running. |
|
| Success End Condition |
The user can set preferences that will take effect the next time the game is loaded, and are written to persistent storage in an XML format. |
|
| Fail End Condition |
The preferences pane does not appear and preferences cannot be changed - possibly due to read-only access to the preferences file. |
|
| Trigger |
The user chooses "Preferences" from the main menu. |
|
| Description |
A new window is created that allows the user to change various engine-wide values. These include windowed resolution, default maze dimensions, and fullscreen mode. |
| USE CASE 18 |
A title screen/menu appears while the maze is being generated. |
|
| Preconditions |
The program has started and OpenGL has initialized. |
|
| Success End Condition |
An OpenGL-powered title screen with clickable menu appears before the game is playable. The user will be able to enter the game once the maze has been fully generated. The user will also be able to choose to set preferences or quit the program. |
|
| Fail End Condition |
No failure condition is identified. |
|
| Trigger |
The user starts the program. |
|
| Description |
An OpenGL canvas is created to specifically handle the drawing and event-handling of the title menu. |
| USE CASE 4 |
The user creates a new maze. |
|
| Preconditions |
The program is running and the game world has been created. |
|
| Success End Condition |
A new random maze is generated and applied to the game world. |
|
| Fail End Condition |
The new maze is not created and the existing maze persists. |
|
| Trigger |
The user selects "New Maze" from the main menu. |
|
| Description |
A new Maze3d with the parameters specified by the user is allocated and generated. The current list of triangles is erased from the Octree and this maze's triangles are inserted. |
| USE CASE 5 |
The user starts a new network game as server. |
|
| Preconditions |
The program is running, the game world has been created, and the computer has a network or
internet connection. |
|
| Success End Condition |
A port is opened and the program begins serving a net game on that port (4224 by default). |
|
| Fail End Condition |
The server does not start and clients cannot connect. |
|
| Trigger |
The user selects "Create a Net Game" from the main menu. |
|
| Description |
A new Server object is created which handles network interaction on its own thread. |
| USE CASE 6 |
The user joins a network game. |
|
| Preconditions |
The program is running, the game world has been created, and the computer has a network or
internet connection. |
|
| Success End Condition |
The program will connect remotely to a given IP and port, and begin to send and receive data
to participate in a network game. |
|
| Fail End Condition |
The program throws a ConnectException with the message "Connection refused" or "Connection timed
out". |
|
| Trigger |
The user selects "Join a Net Game" from the main menu. |
|
| Description |
The EigenEngine's existing NetHandler is told to connect to the user-given IP and port. The NetHandler begins its own thread to handle async I/O. |
| USE CASE 7 |
The user quits or exits the program. |
|
| Preconditions |
The program is running and the user interface has been created. |
|
| Success End Condition |
The program will exit without error. |
|
| Fail End Condition |
The program will exit with an error; the OS is left to handle that. |
|
| Trigger |
The user:
|
|
| Description |
All user threads are closed properly, loops are exited, and the program closes down. |
| USE CASE 8 |
The user looks at the screen before interacting with the program. |
|
| Preconditions |
User Story 1 is fulfilled. |
|
| Success End Condition |
The game window renders a fully textured three-dimensional maze and a textured player ovject. |
|
| Fail End Condition |
The game window does not display the maze or player object, or fails to correctly render textures. |
|
| Trigger |
The program has been started. |
|
| Description |
Each triangle that makes up the maze is drawn to the GLCanvas. Each triangle that makes up the player is drawn. All triangles have textures. |
| USE CASE 9 |
The user looks at the screen before interacting with the program. |
|
| Preconditions |
User Story 1 is fulfilled. |
|
| Success End Condition |
The game window renders a complex textured model as a player object representation. |
|
| Fail End Condition |
The game window does not display the player object. |
|
| Trigger |
The program has been started. |
|
| Description |
A Wavefront OBJ model file, its associated material library, and all associated texture image files are loaded from persistent storage. The triangles of the player object are sorted by texture for efficiency. Each triangle is drawn, textured, and lit. |
| USE CASE 10 |
The user uses the weapon keys to interact with the game world. |
|
| Preconditions |
User Stories 1 and 2 have been fulfilled. |
|
| Success End Condition |
A projectile (bullet or bomb) is launched from the player object. |
|
| Fail End Condition |
No failure mode has been identified. |
|
| Trigger |
The user presses the weapon keys to launch a specific projectile - spacebar to fire a bullet, Z to fire a bomb. |
|
| Description |
If the user presses the spacebar, a fast-moving Bullet is generated in front of the player object. The bullet will bounce off walls but explode and do damage on contact with a Ship. If the user presses the Z button, a Bomb is generated in front of the player object. The Bomb moves slowly and does a lot of damage, but explodes on any collision. |
| USE CASE 1 |
The user launches EigenMaze. |
|
| Preconditions |
EigenMaze is fully installed. |
|
| Success End Condition |
The main JFrame with menu bar and game world panel appears, and the 3D maze world
renders in that window. |
|
| Fail End Condition |
The operating system should handle failed program launch. |
|
| Trigger |
The user launches the EigenMaze program from his file browser of choice. |
|
| Description |
Opening and initializing the application environment; instrumental to all other user stories. |
| USE CASE 2 |
The user looks at the screen before interacting with the program. |
|
| Preconditions |
User Story 1 is fulfilled. |
|
| Success End Condition |
The game window renders a colored (perhaps randomly) three-dimensional maze and a similarly
colored player object, probably a cube. |
|
| Fail End Condition |
The game window does not display the maze or player object. |
|
| Trigger |
The program has been started. |
|
| Description |
Each triangle that makes up the maze is drawn to the GLCanvas. Each triangle that makes up the player is drawn. |
| USE CASE 3 |
The user uses the movement keys to interact with the game world. |
|
| Preconditions |
User Stories 1 and 2 have been fulfilled. |
|
| Success End Condition |
The player object moves with predictable inertia in the direction of the movement keys
pressed. |
|
| Fail End Condition |
No failure mode has been identified. |
|
| Trigger |
The user presses the movement keys to indicate the direction the player object should move - W to accelerate forward, S to accelerate backward, A to turn left, D to turn right. |
|
| Description |
If the user presses the W or S button: the player is accelerated forward or backward by an amount equal to the time of frame times a constant value. If the user presses the A or D button: the user is rotated to the right or left by an amount equals to the time of frame times a constant value. |


Ok so by default this is trying to stream the new president video. If you want it to play something else, you have to modify the "source" query string to point to the file on akamai on the end of the URL paths to the SWF file. Look at the embed code for the player, find where it says akamai_od_player.swf (there should be a few places) and modify ?source=whatever.mp4 to the end of that, before the closing quotation marks.
this player only supports playback of h264 files, not vp6 flv files.


nfsidmap
Section: File Formats (5)Updated: 1 October 2010
Index Return to Main Contents
NAME
nfsidmap - The NFS idmapper upcall programSYNOPSIS
nfsidmap [-v] [-t timeout] key descnfsidmap [-v] [-c]
nfsidmap [-v] [-u|-g|-r user]
DESCRIPTION
The file /usr/sbin/nfsidmap is used by the NFS idmapper to translate user and group ids into names, and to translate user and group names into ids. Idmapper uses request-key to perform the upcall and cache the result. /usr/sbin/nfsidmap is called by /sbin/request-key, and will perform the translation and initialize a key with the resulting information.nfsidmap can also used to clear the keyring of all the keys or revoke one particular key. This is useful when the id mappings have failed to due to a lookup error resulting in all the cached uids/gids to be set to the user id nobody.
OPTIONS
- -c
- Clear the keyring of all the keys.
- -g user
- Revoke the gid key of the given user.
- -r user
- Revoke both the uid and gid key of the given user.
- -t timeout
- Set the expiration timer, in seconds, on the key. The default is 600 seconds (10 mins).
- -u user
- Revoke the uid key of the given user.
- -v
- Increases the verbosity of the output to syslog (can be specified multiple times).
CONFIGURING
The file /etc/request-key.conf will need to be modified so /sbin/request-key can properly direct the upcall. The following line should be added before a call to keyctl negate:
create id_resolver * * /usr/sbin/nfsidmap -t 600 %k %d
This will direct all id_resolver requests to the program /usr/sbin/nfsidmap. The -t 600 defines how many seconds into the future the key will expire. This is an optional parameter for /usr/sbin/nfsidmap and will default to 600 seconds when not specified.
The idmapper system uses four key descriptions:
uid: Find the UID for the given user
gid: Find the GID for the given group
user: Find the user name for the given UID
group: Find the group name for the given GID
You can choose to handle any of these individually, rather than using the generic upcall program. If you would like to use your own program for a uid lookup then you would edit your request-key.conf so it looks similar to this:
create id_resolver uid:* * /some/other/program %k %d
create id_resolver * * /usr/sbin/nfsidmap %k %d
Notice that the new line was added above the line for the generic program. request-key will find the first matching line and run the corresponding program. In this case, /some/other/program will handle all uid lookups, and /usr/sbin/nfsidmap will handle gid, user, and group lookups.
AUTHOR
Bryan Schumaker<EMAIL_ADDRESS>Index
This document was created by man2html, using the manual pages.
Time: 05:34:28 GMT, December 24, 2015


El Salvador Relief Fund
El Salvador, the smallest country in Latin America, is facing colossal tropical storm Amanda, during the peak of the COVID-19 crisis.The entire nation has been under strict military enforced quarantine/Stay-at-Home Order for over 79 days; which indicates people have not been allowed to work, freely access food and medication, and the most vulnerable ones have been at home with little or not food at all on their table. To make matters worse, Tropical Storm Amanda has made landfall and has gravely flooded rivers, displacing homes and taking lives.
In El Salvador, officials said some 12,000 people have taken refuge in 269 shelters as torrential rain and strong winds destroyed hundreds of homes and damaged roads.In total is around 30,000 families have been affected in total is more than 100,000 people. All proceeds will be directly channeled towards high-risk communities and families that have literally lost everything. Deigex will use the money from donors to help rebuild people's homes, keep children dry, safe and warm and fed.
Help Spread the Word!
More than 100,000 people have been affected in El Salvador due to the tropical Storm ...


Arp Frique and the art of African-infused 70s Disco
by Anselmo JasonDutch musician Arp Frique is bringing back 70s disco combined with vibrant African musical influences. No two people have exactly the same musical taste. Everyone appreciates music differently. Now that music can come from virtually anywhere with a wealth of styles and influences – not to mention the rise of music streaming platforms such as Spotify and Soundcloud – it’s safe to say that there’s always something for everyone. Relatively speaking, there is no such thing as bad music. This view is shared by Dutch musician and instrumentalist Arp Frique. “I think all music is good music,” Frique told The Jakarta Post. “Everybody has their own flavor, interest or taste, and so do I.” Frique, whose real name is Neils Nieuborg, has been accompanied by talented musicians from around the world on his journey to create ext...
LOG IN
Don't have an account? Register here
Forgot Password ?
Log in with your social account


|
STM8S Standard Peripheral Libary
2.2.0
|
Functions | |
| void | STM_EVAL_LEDInit (Led_TypeDef Led) |
| Configures LED GPIO. More... | |
| void | STM_EVAL_LEDOn (Led_TypeDef Led) |
| Turns selected LED On. More... | |
| void | STM_EVAL_LEDOff (Led_TypeDef Led) |
| Turns selected LED Off. More... | |
| void | STM_EVAL_LEDToggle (Led_TypeDef Led) |
| Toggles the selected LED. More... | |
| void | STM_EVAL_PBInit (Button_TypeDef Button, ButtonMode_TypeDef Button_Mode) |
| Configures Button GPIO and EXTI Line. More... | |
| uint8_t | STM_EVAL_PBGetState (Button_TypeDef Button) |
| Returns the selected Button state. More... | |
| void | SD_LowLevel_DeInit (void) |
| DeInitializes the SD/SD communication. More... | |
| void | SD_LowLevel_Init (void) |
| Initializes the SD_SPI and CS pins. More... | |
| void | sEE_LowLevel_DeInit (void) |
| DeInitializes peripherals used by the I2C EEPROM driver. More... | |
| void | sEE_LowLevel_Init (void) |
| Initializes peripherals used by the I2C EEPROM driver. More... | |
| void SD_LowLevel_DeInit | ( | void | ) |
DeInitializes the SD/SD communication.
| None |
| None |
< SD_SPI disable
< SD_SPI Peripheral clock disable
< Configure SD_SPI pins: SCK
< Configure SD_SPI pins: MISO
< Configure SD_SPI pins: MOSI
< Configure SD_SPI_CS_PIN pin: SD Card CS pin
< Configure SD_SPI_DETECT_PIN pin: SD Card detect pin
Definition at line 208 of file stm8_128_eval.c.
| void SD_LowLevel_Init | ( | void | ) |
Initializes the SD_SPI and CS pins.
| None |
| None |
Definition at line 236 of file stm8_128_eval.c.
| void sEE_LowLevel_DeInit | ( | void | ) |
DeInitializes peripherals used by the I2C EEPROM driver.
| None |
| None |
< sEE_I2C Peripheral clock disable
< GPIO configuration
< Configure sEE_I2C pins: SCL
< Configure sEE_I2C pins: SDA
Definition at line 263 of file stm8_128_eval.c.
| void sEE_LowLevel_Init | ( | void | ) |
Initializes peripherals used by the I2C EEPROM driver.
| None |
| None |
< sEE_I2C Peripheral clock enable
Definition at line 287 of file stm8_128_eval.c.
| void STM_EVAL_LEDInit | ( | Led_TypeDef | Led | ) |
Configures LED GPIO.
| Led | Specifies the Led to be configured. This parameter can be one of following parameters:
|
| None |
Definition at line 103 of file stm8_128_eval.c.
| void STM_EVAL_LEDOff | ( | Led_TypeDef | Led | ) |
Turns selected LED Off.
| Led | Specifies the Led to be set off. This parameter can be one of following parameters:
|
| None |
Definition at line 134 of file stm8_128_eval.c.
| void STM_EVAL_LEDOn | ( | Led_TypeDef | Led | ) |
Turns selected LED On.
| Led | Specifies the Led to be set on. This parameter can be one of following parameters:
|
| None |
Definition at line 119 of file stm8_128_eval.c.
| void STM_EVAL_LEDToggle | ( | Led_TypeDef | Led | ) |
Toggles the selected LED.
| Led | Specifies the Led to be toggled. This parameter can be one of following parameters:
|
| None |
Definition at line 149 of file stm8_128_eval.c.
| uint8_t STM_EVAL_PBGetState | ( | Button_TypeDef | Button | ) |
Returns the selected Button state.
| Button | Specifies the Button to be checked. This parameter can be one of following parameters:
|
| The | Button GPIO pin value. |
Definition at line 197 of file stm8_128_eval.c.
| void STM_EVAL_PBInit | ( | Button_TypeDef | Button, |
| ButtonMode_TypeDef | Button_Mode | ||
| ) |
Configures Button GPIO and EXTI Line.
| Button | Specifies the Button to be configured. This parameter can be one of following parameters:
|
| Button_Mode | Specifies Button mode. This parameter can be one of following parameters:
|
| None |
Definition at line 170 of file stm8_128_eval.c.


DomainBuilderDomain Knowledge Authoring System for SlideTutor ITS | ||
|---|---|---|
|
DomainBuilder is a tool that attempts to automate and streamline the task of authoring tutor cases, creating a semantic representation of domain knowledge as well as validation for SlideTutor ITS. Once completed, this tool will allow doctors to create curriculum for their students which goes beyond simple slide sets. requires Java 1.6 to run
|
high resolution 1024x768 (105MB) video requires TechSmith Codec to play |


fun <reified T : Number> Number.to(): T
Returns the value of this Number as the number type T
Return The value of this number as T
Author bright_spark


§578-1.5 Adoption. Any person may be adopted under this chapter; provided that an adult to be adopted must give written consent to the adoption. [L 1976, c 194, §1(11); gen ch 1985; am L 1986, c 166, §1]


Reports names of elements or attributes that are used in an XPath-expression but are missing in the associated XML files and are not
defined in the referenced schemas.
Such names are often the result of typos and would otherwise probably only be discovered at runtime.
Example:
<xsl:template match="h:txtarea" />
If the h
is bound to the XHTML namespace, the inspection will report this part of the match
expression as an
unknown element name because the correct name of the element is "textarea".


systemd
systemd is a commonly
available init system (PID 1) on many Linux distributions. It offers process
monitoring (including automatic restarts) and other useful features for running
Puma
in production.
Service Configuration
Below is a sample puma.service configuration file for systemd, which can be
copied or symlinked to /etc/systemd/system/puma.service
, or if desired, using
an application or instance-specific name.
Note that this uses the systemd preferred "simple" type where the start command remains running in the foreground (does not fork and exit).
[Unit]
Description=Puma HTTP Server
After=network.target
# Uncomment for socket activation (see below)
# Requires=puma.socket
[Service]
# {Puma} supports systemd's {Type=notify} and watchdog service
# monitoring, as of {Puma} 5.1 or later.
# On earlier versions of {Puma} or JRuby, change this to {Type=simple} and remove
# the {WatchdogSec} line.
Type=notify
# If your {Puma} process locks up, systemd's watchdog will restart it within seconds.
WatchdogSec=10
# Preferably configure a non-privileged user
# User=
# The path to your application code root directory.
# Also replace the "<YOUR_APP_PATH>" placeholders below with this path.
# Example /home/username/myapp
WorkingDirectory=<YOUR_APP_PATH>
# Helpful for debugging socket activation, etc.
# Environment=PUMA_DEBUG=1
# SystemD will not run puma even if it is in your path. You must specify
# an absolute URL to puma. For example /usr/local/bin/puma
# Alternatively, create a binstub with `bundle binstubs puma --path ./sbin` in the WorkingDirectory
ExecStart=/<FULLPATH>/bin/puma -C <YOUR_APP_PATH>/puma.rb
# Variant: Rails start.
# ExecStart=/<FULLPATH>/bin/puma -C <YOUR_APP_PATH>/config/puma.rb ../config.ru
# Variant: Use `bundle exec --keep-file-descriptors puma` instead of binstub
# Variant: Specify directives inline.
# ExecStart=/<FULLPATH>/puma -b tcp://<IP_ADDRESS>:9292 -b ssl://<IP_ADDRESS>:9293?key=key.pem&cert=cert.pem
Restart=always
[Install]
WantedBy=multi-user.target
See systemd.exec for additional details.
Socket Activation
systemd and Puma
also support socket activation, where systemd opens the
listening socket(s) in advance and provides them to the Puma
master process on
startup. Among other advantages, this keeps listening sockets open across puma
restarts and achieves graceful restarts, including when upgraded Puma
, and is
compatible with both clustered mode and application preload.
Note: Any wrapper scripts which exec
, or other indirections in ExecStart
may result in activated socket file descriptors being closed before reaching the
puma master process. For example, if using bundle exec
, pass the
--keep-file-descriptors
flag. bundle exec
can be avoided by using a puma
executable generated by bundle binstubs puma
. This is tracked in #1499.
Note: Socket activation doesn't currently work on JRuby. This is tracked in #1367.
Configure one or more ListenStream
sockets in a companion *.socket
unit file
to use socket activation. Also, uncomment the associated Requires
directive
for the socket unit in the service file (see above.) Here is a sample
puma.socket, matching the ports used in the above puma.service:
[Unit]
Description=Puma HTTP Server Accept Sockets
[Socket]
ListenStream=<IP_ADDRESS>:9292
ListenStream=<IP_ADDRESS>:9293
# AF_UNIX domain socket
# SocketUser, SocketGroup, etc. may be needed for Unix domain sockets
# ListenStream=/run/puma.sock
# Socket options matching {Puma} defaults
NoDelay=true
ReusePort=true
Backlog=1024
[Install]
WantedBy=sockets.target
See systemd.socket for additional configuration details.
Note that the above configurations will work with Puma
in either single process
or cluster mode.
Sockets and symlinks
When using releases folders, you should set the socket path using the shared
folder path (ex. /srv/projet/shared/tmp/puma.sock
), not the release folder
path (/srv/projet/releases/1234/tmp/puma.sock
).
Puma
will detect the release path socket as different than the one provided by
systemd and attempt to bind it again, resulting in the exception There is
already a server bound to:
.
Binding
By default, you need to configure Puma
to have binds matching with all
ListenStream statements. Any mismatched systemd ListenStreams will be closed by
Puma
.
To automatically bind to all activated sockets, the option
--bind-to-activated-sockets
can be used. This matches the config DSL
bind_to_activated_sockets
statement. This will cause Puma
to create a bind
automatically for any activated socket. When systemd socket activation is not
enabled, this option does nothing.
This also accepts an optional argument only
(DSL: 'only'
) to discard any
binds that's not socket activated.
Usage
Without socket activation, use systemctl
as root (i.e., via sudo
) as with
other system services:
# After installing or making changes to puma.service
systemctl daemon-reload
# Enable so it starts on boot
systemctl enable puma.service
# Initial startup.
systemctl start puma.service
# Check status
systemctl status puma.service
# A normal restart. Warning: listener's sockets will be closed
# while a new puma process initializes.
systemctl restart puma.service
With socket activation, several but not all of these commands should be run for both socket and service:
# After installing or making changes to either puma.socket or
# puma.service.
systemctl daemon-reload
# Enable both socket and service, so they start on boot. Alternatively
# you could leave puma.service disabled, and systemd will start it on
# the first use (with startup lag on the first request)
systemctl enable puma.socket puma.service
# Initial startup. The Requires directive (see above) ensures the
# socket is started before the service.
systemctl start puma.socket puma.service
# Check the status of both socket and service.
systemctl status puma.socket puma.service
# A "hot" restart, with systemd keeping puma.socket listening and
# providing to the new puma (master) instance.
systemctl restart puma.service
# A normal restart, needed to handle changes to
# puma.socket, such as changing the ListenStream ports. Note
# daemon-reload (above) should be run first.
systemctl restart puma.socket puma.service
Here is sample output from systemctl status
with both service and socket
running:
● puma.socket - {Puma} HTTP Server Accept Sockets
Loaded: loaded (/etc/systemd/system/puma.socket; enabled; vendor preset: enabled)
Active: active (running) since Thu 2016-04-07 08:40:19 PDT; 1h 2min ago
Listen: <IP_ADDRESS>:9233 (Stream)
<IP_ADDRESS>:9234 (Stream)
Apr 07 08:40:19 hx systemd[874]: Listening on {Puma} HTTP Server Accept Sockets.
● puma.service - {Puma} HTTP Server
Loaded: loaded (/etc/systemd/system/puma.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2016-04-07 08:40:19 PDT; 1h 2min ago
Main PID: 28320 (ruby)
CGroup: /system.slice/puma.service
├─28320 puma 3.3.0 (tcp://<IP_ADDRESS>:9233,ssl://<IP_ADDRESS>:9234?key=key.pem&cert=cert.pem) [app]
├─28323 puma: cluster worker 0: 28320 [app]
└─28327 puma: cluster worker 1: 28320 [app]
Apr 07 08:40:19 hx puma[28320]: {Puma} starting in cluster mode...
Apr 07 08:40:19 hx puma[28320]: * Version 3.3.0 (ruby 2.2.4-p230), codename: Jovial Platypus
Apr 07 08:40:19 hx puma[28320]: * Min threads: 0, max threads: 16
Apr 07 08:40:19 hx puma[28320]: * Environment: production
Apr 07 08:40:19 hx puma[28320]: * Process workers: 2
Apr 07 08:40:19 hx puma[28320]: * Phased restart available
Apr 07 08:40:19 hx puma[28320]: * Activated tcp://<IP_ADDRESS>:9233
Apr 07 08:40:19 hx puma[28320]: * Activated ssl://<IP_ADDRESS>:9234?key=key.pem&cert=cert.pem
Apr 07 08:40:19 hx puma[28320]: Use Ctrl-C to stop
capistrano3-puma
By default, capistrano3-puma uses
pumactl
for deployment restarts outside of systemd. To learn the exact
commands that this tool would use for ExecStart
and ExecStop
, use the
following cap
commands in dry-run mode, and update from the above forking
service configuration accordingly. Note also that the configured User
should
likely be the same as the capistrano3-puma :puma_user
option.
stage=production # or different stage, as needed
cap $stage puma:start --dry-run
cap $stage puma:stop --dry-run


I'd like to monitor the power consumption at individual power sockets throughout my house. My idea is to fit an emonTx to each socket. I need to be able to fit a CT sensor between the socket and the plug of the appliance which is plugged into it.
I know that socket power monitors exist, e.g http://www.maplin.co.uk/plug-in-mains-power-and-energy-monitor-38343 but I wonder if any exist which have an output which would plug into the emonTx.
Can anyone help?
Re: CT sensor inside a plug socket?
You're not the first to ask this. I've never seen anyone report that they've done it.
The difficulty will be making the connection to the outside world. Provided everything is inside an enclosure and double insulated, safety is pretty much assured. If you then make a galvanic connection, it becomes a major issue. That is the real obstacle.
Most look towards mounting an emonTx in a small box with a plug on one side and a socket on the other. The enemy is the need for personal safety when you're programming and testing a device such as this. In order to have a small enclosure, you need a very small dual-secondary transformer for power and voltage monitoring, or a direct connection to the mains for the power supply and for the voltage monitor. Current isn't so bad, you can get fairly small ring-core c.t's that are quite a bit smaller than the split-core ones. Once you have mains inside, the enclosure needs to be earthed metal (obviously not possible because of the need to get the radio out) or double insulated, and if you have a direct mains connection you can't work on it for testing unless you isolate all connections (in practice that means a 240 V isolating transformer) but even with transformers, there are still potentially lethal voltages around.
Decoding the radio transmissions of proprietary devices has also been mentioned, but again as far as I know, no-one has done it.
Re: CT sensor inside a plug socket?
Many thanks for this, useful to know. I will consider hacking a proprietary device to see whether I can either 1) decode the signals it sends wirelessly, or 2) add wireless to it so I can integrate it into my existing system.
The idea here is to create a virtual 'heat map' of each room's electricity consumption and potentially alerting me if the usage seems high (e.g. if I've left something on which shouldn't be on).
Re: CT sensor inside a plug socket?
Building a self-contained unit which detects the amount of power flowing through it and transmits this info via RF is straightforward enough. But equipping a whole house in this manner would be quite an undertaking. Fixed appliances, such as lighting, would not be included by this means. There might also be transmission difficulties, e.g. from the socket that's behind the fridge.
An alternative approach might be to monitor each of the final circuits at the Consumer Unit. This would allow more channels of the emonTx to be used. Trystan recently put some 4-channel power-monitoring code of mine onto the emonTx Github zone, along with a simple receiver sketch.
A more refined version of this code, which uses all six of the Atmel's analog inputs, can be found on this thread. At present, that code is configured to continuously monitor power on four channels, two on each phase; but could be easily changed to measure five power streams on a single phase. With two systems like this, you could probably monitor every final circuit in the house.


Pat's Salmon Cookie Stands
"Salmon cookies made with fish, salmon cookies are delish!"
Home
To Add New Location
Name :
Min :
Max :
Avg :


P2 # Shows the word "FEEP" (example from Netpbm man page on PGM) 24 7 15 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3 3 3 3 0 0 7 7 7 7 0 0 11 11 11 11 0 0 15 15 15 15 0 0 3 0 0 0 0 0 7 0 0 0 0 0 11 0 0 0 0 0 15 0 0 15 0 0 3 3 3 0 0 0 7 7 7 0 0 0 11 11 11 0 0 0 15 15 15 15 0 0 3 0 0 0 0 0 7 0 0 0 0 0 11 0 0 0 0 0 15 0 0 0 0 0 3 0 0 0 0 0 7 7 7 7 0 0 11 11 11 11 0 0 15 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
nd:
weight:
shiftd:
← Apply
do colors
Reset pixels
Copy
Dilate


| Class | Description |
|---|---|
| AddClass |
This class allows the admin to add class and contract numbers to the database
|
| ClockIn |
This class clocks in the student
|
| ClockOut |
This class clocks out the student
|
| CreateDB |
This class creates the database
|
| CreateStudent |
This class allows a student to self register for a class
|
| DeleteClass |
This class allows admin to delete a class from the database
|
| Login |
This class checks the user name and password on the admin pop up
|
| LoginDialog |
This class creates the admin log in pop up
|
| MyPrintable |
This wrapper class encapsulates a Component and allows it to be printed
using the Java 2 printing API.
|
| TimeClock |
Main thread entry- This is the time clock program start
|


'Give Me a Meal' to record special anniversary episode in Hawaii
by beansssThe cast and staff of JTBC's 'Give Me a Meal' will be visiting Hawaii for a special anniversary episode!
'Give Me a Meal' will be celebrating its 3rd anniversary since launch soon, and in order to celebrate, it seems that the show's MCs Kang Ho Dong and Lee Kyung Kyu will be visiting Hawaii in order to find two special families willing to share a meal with them.
The cast and crew's specific departure or recording date have yet to be decided. The anniversary episode will air some time in mid-December.


Schedule
Error: Unable to contact Web API
Add Watering Time
Add Watering Time
Stations
1
2
3
4
5
6
7
8
Minutes
Days
Monday
Tuesday
Wednesday
Thursday
Friday
Saturday
Sunday
odd days
even days
every day
Start time
Cancel
Add


Networked Systems H
Introduction
Networked System: Autonomous computing devices that exchange data to perform some application goal and how they communicate across a network
- internet
- digital broadcast
- mobile voice telephony
- sensor networks
- controller area networks
Communication: Messages transferred from source to destination(s) via some communications channel
How would you convert a message so that both source and destination understand it?
Limitations:
- size of messages is bounded on a channel at any one time
- simplex - send/receive in only one direction (broadcasting)
- half-duplex - send or receive, but not simultaneously (wifi)
- full-duplex - send and receive at the same time (two cables, for sending and receiving)
Information:
- information theory - amount of info in a message can be characterised mathematically
- capacity of channels can be modelled - physical limits exist here (amount, speed, power)
Signals:
- the physical form of a message - usually a wave
- analogue - smooth continuation of values
- digital - sequence of discrete symbols
- coding - mapping information to symbols
Analogue:
- amplitude directly codes value of interest
- can be arbitrarily accurate
- susceptible to noise and interference
- difficult to process with digital electronics
- sample the signal at a suitable rate
- quantise to nearest allowable discrete value
- convert to digital representation
- sampling theorem dictates rate of sampling
Digital:
- fixed alphabet
- underlying channel is almost always analogue
- modulation - map a digital signal onto the channel
- uses binary encoding
Networked systems often use non-binary encoding:
- complex modulation schemes with either 16, 64 or 256 possible symbols
- baud rate - number of symbols transmitted per second
- can differ from bit rate
Channels and Network Links:
- signal may be directly conveyed or modulated onto an underlying carrier
- link - the combination of signal and channel
- directly connects 1+ hosts (ethernet)
- network comprises several links connected together (WAN)
- switches/routers - connects the links
Circuit Switched Networks:
- dedicated circuit for A and B to communicate
- exchange arbitrary length messages
- guaranteed capacity once circuit is created
- can block other communications
- capacity of network gives blocking probability
- traditional telephone network
Packet Switched Networks:
- messages split into small packets before transmission
- size constraint
- A-B and C-D can communicate all the time
- share bottleneck link
- connectivity guaranteed
- available capacity varies based on other people on the network
- internet
All networked systems are build using these basic components:
- hosts - source and destination(s)
- links - physical realisation of channel
- switches/routers - connect multiple links
Network Protocols
Network protocols give meaning to the messages that are exchanged
Messages follow some well known syntax, and have agreed semantics
- an agreed language for encoding messages
- rules defining what messages mean and when they can be sent
- define the network behaviour
Syntax:
- protocol data units (PDU) - types of message
- each PDU has a particular syntax
- decribing what info is included and how it’s formatted
- may be formatted as textual info or binary data
- textual PDU - has syntax and grammar that describes its format
- binary PDU - similar rules
- define what messages are legal to send
Semantics:
- define when PDUs can be sent, and what response is needed
- who can send and when
- host roles
- what the communicating entities are
- how errors are handled
- described with state-transition diagram
- states - stages of protocol operation
- transitions - in response to PDUs, may result in other PDUs being sent
Morse Code:
- signals on electrical cable form a channel
- syntax - pattern of dots and dashes
- semantics - different gap lengths to signal end of word, and “STOP” for end of message
Protocol Layering:
- organisation of communications systems (means of abstraction)
- structured design reduces complexity
- services - offered by a layer to the next higher layer
- well defined interfaces
- highest layer is communicating application
- lowest layer is physical communication channel
- peers at a layer
i
communicate using layeri
protocol- using lower layer services
Example with a web browser talking to web server:
OSI Reference Model:
- standard way of thinking about layered protocol design
- design tool
Physical Layer:
- defines characteristics of cable/optic fibre
- size and shape of plugs
- cable length
- type of cable
- electrical voltage
- current
- modulation
- type of fibre
- single or multi-mode
- optical clarity
- colour
- power output
- modulation of laser
- wireless
- radio frequency
- transmission power
- modulation scheme
- antenna type
Data Link Layer:
- structure and frame physical layer bit stream
- split bit stream into messages
- detect/correct errors
- perform media access control
- assign addresses to hosts
- arbitrate access to link
- detemine when hosts can send messages
- ensure fair access to link - flow control
- ethernet
Network Layer:
- interconnects links to form a WAN from source host –> destination host
- data delivery
- naming and addressing
- routing
- flow control
- IP
Transport Layer:
- end-to-end transfer of data from source –> destination
- between session level service at the source, and corresponding service at the destination
- provides reliability, ordering, framing, congestion control
- TCP
Session Layer:
- manages transport layer connections
- functions
- open TCP/IP connections to download webpage with HTTP
- use SMTP to transfer email messages over a TCP/IP
- coordinate control, audio and video flows for video conference
Presentation Layer:
- manages presentation, representation and conversion of data
- character set
- data markup langs.
- data format conversion
- content negotiation
Application Layer:
- user application protocols (not the app. programs themselves)
- REST APIs/WebRTC
Protocol Standards:
- formal description of a protocol
- ensure interoperability of diverse implementations
- set procedures
- open or closed standards development process
- free or restricted standards availability
- rules around disclosure of intellectual property rights
- individual vs corporate vs national membership
- lead technical dev. vs describing existing practices
- collaborative vs combative process
- standards organisations
- Internet Engineering Task Force
- International Telecommunications Union
- 3rd Gen Partnership Project
- World Wide Web Consortium
Physical and Data Link Layers
Physical Layer:
- concerned with transmission of raw data bits
- type of cable/wireless link
- encoding bits onto that channel
- capacity of the channel
Wired Links:
- characteristics decided by standards bodies
- size and shape of plugs
- max cable length
- type of cable - electrical voltage, current, modulation
- type of fibre - single/multi-mode, optical clarity, colour, power output, laser modulation
Unshielded Twisted Pair:
- 2 wires twisted together
- each pair is unidirectional
- twists reduce interference and nosie pickup (by shielding each other)
- more twists –> less noise
- several miles of cable length possible at low data rates
- longer cable –> more noise
- ethernet, telephone lines
Optical Fibre:
- glass core and cladding in plastic jacket for protection
- unidirectional data
- transmission laser at one end
- photodetector at the other end
- light travels down the fibre
- electromagnetic interference doesn’t affect light –> very low noise
- 10s of Gbps over 100s of miles –> very high capacity
- cheap to make
- relatively expensive lasers required to operate
Wired Data Transmission:
- signal directly encoded onto channel
- occupies baseband region
- bandwidth is the frequency range used by signal
Baseband Data Encoding:
- encoded by varying the voltage in the cable/intensity of light in the fibre
- encoding schemes - NRZ, NRZI, Manchester, 4B/5B
4B/5B Encoding:
- Manchester encoding is inefficient - only 50% of link capacity is used
- so, insert extra bits to break up sequences of the same bit
- each 4-bit data symbol changed to a 5-bit code for transmission, and reversed at the receiver
- then transmit 5-bit codes using NRZI
- this way, 80% of link capacity is used
- ethernet
- 10Mbps with Manchester
- 100Mbps with 4B/5B
Wireless Links:
- use carrier modulation
- performance affected by
- carrier frequency
- transmission power
- modulation scheme
- type of antenna
Carrier Modulation:
- carrier wave applied to channel at frequency F
- signal modulated onto carrier
- shifts signal from baseband to a higher carrier frequency
- allow multiple signals on a single channel
- can be used on wired links (ADSL and voice telephones sharing a phone line)
Amplitude, Frequency, Phase Modulation:
Complex Modulations:
- use multiple levels of the modulated component
- gigabit ethernet - amplitude modulation with 5 levels instead of binary signalling
- combine modulation schemes
- vary phase and amplitude –> quadrature amplitude modulation
- complex combinations regularly used
Spread Spectrum Communication:
- single frequency channels prone to interference, so
- repeatedly change carrier frequency many times/second
- use pseudo-random sequence to choose which carrier frequency is used for each time slot
- seed of random generator is a shared secret between sender and receiver
- 802.11b Wi-Fi uses frequencies centered around 2.4GHz with phase modulation
Bandwidth and Channel Capacity:
- bandwidth determins frequency range
- digital signals?
- sampling theorem - to accurately digitise an analogue signal, you need 2H samples/second
- max transmission rate (Rmax) of digital signal depends on channel bandwidth (H)
- number of discrete values per symbol (V)
- Rmax = 2H log2 V
- this would presumably give a perfect, noise-free channel
Noise:
- electrical interference
- cosmic radiation
- thermal noise
- can measure signal power
S
and noise floorN
in a channel for signal-to-noise ratioS/N
dB = 10log10 S/N
- ADSL modems report
S/N ~30
for good quality
Capacity of Noisy Channel:
- depends on noise type
- uniform/bursty –> affects all or some frequencies
- Gaussian noise –> noise that impacts all frequencies equally
- Rmax of Gaussian = Hlog2(1 + S/N)
- dial-up modem bandwidth limitation
Implication - bandwidth and signal-to-noise ratio limit amount of info. that can be transferred
Data Link Layer:
- arbitrate access to physical layer
- identify devices
- structure and frame the raw bitstream
- detect and correct bit errors
- control access to channel
- turn raw bitstream into structured comms. channel
Addressing:
- physical links can be point-to-point/multi-access
- multi-access requires host addresses to identify senders/receivers
- host addresses - link-local/global scope
- sufficient to be unique among the devices connected to a link
- many data link protocols use globally unique addresses
- simpler to implement if devices can move (don’t need to change address when connected to different link)
Framing and Synchronisation:
- raw bitstream unreliable
- bits corrupted
- timing disrupted
- data link corrects these problems
- break bitstream into frames
- transmit and repair individual frames
- limit scope of transmission errors
Ethernet:
Synchronisation:
- detecting start of message
- leave gaps between frames
- but physical layer doesn’t guarantee timing
- precede each frame with a length field
- but length could be corrupted
- add start code to beginning of frame
- a unique bit pattern
- enables synchronisation after an error - wait for next start code, begin reading frame headers
- start code should generate a regular pattern after physical layer coding
- leave gaps between frames
- what if start code appears in data? bit stuffing can give a transparent channel
- sender inserts
0
after sending 5 consecutive1's
(unless start code) - receiver looks at 6th bit if it sees 5 consecutive
1's
- if 0, has been stuffed, so remove
- if 1, look at 7th bit
- if 0, start code
- if 1, corrupt frame
- this is a binary-level escape code
- sender inserts
Error Detection:
- common in wireless systems
- add error detecting code to each packet
- parity codes
- calculate parity of data
- odd number of
1's
in data - parity 1 - even number of
1's
in data - parity 0 - parity bit is XOR of data bits
- odd number of
- send parity with data
- check at receiver
- calculate parity of data
Example - The Internet Checksum
Other Error Detecting Codes:
- parity and checksums relatively weak
- simple implementation
- undetected errors likely
- cyclic redundancy code (CRC)
- more complex
Error Correction:
- extended error detecting codes to correct errors
- transmit correcting code as additional data in each frame
- receiver can correct errors without contacting sender
- Hamming code
- at the sender
- send
n
data bits andk
check bits - each check bit codes parity for some data bits
- starting at check bit
i
- check
i
bits - skip
i
bits - repeat
- starting at check bit
- send
- at the receiver
- set
counter = 0
- recalculate check bits
k = 1, 2, 4, 8,...
in turn - if
k
incorrect,counter += k
- if
counter == 0
, no errors - else, bit
counter
is incorrect
- set
- at the sender
- allows receiver to detect and correct all possible errors that corrupt only a single bit (and some errors affecting multiple bits)
- other error correcting codes tradeoff copmlexity and amount of data added for the ability to correct multi-bit errors
- can also request retransmission as a way of fixing errors
Media Access Control:
- arbitrating access to a link
- point-to-point typically 2 unidirectional links
- separate cables for each direction
- need framing in each direction
- stop-and-wait/sliding-window for flow control
- multi-access typically share a bidirectional link
- single cable - nodes contend for access to link
- single radio frequency
- point-to-point typically 2 unidirectional links
Link Contention:
- 2 hosts transmit simultaneously –> collision
- signals overlap –> garbage received
Contention-based MAC:
- 2-stage access to channel
- detect that collision will occur by listening to channel while/before sending
- send if no collision/back off or retransmit data to avoid collision
- probabilistic, variable latency access to channel
ALOHA Network:
- developed at Uni of Hawaii in 1970
- first wireless packet-switched network
- uses contention-based MAC
- try to transmit whenever data is available
- if collision occurs, wait random amount of time, then retransmit
- poor performance
- long delays
- low channel utilisation
Carrier Sense Multiple Access:
- when propagation delay low, listen before sending
- if another transmission active, back off without sending anything
- if link idle, send data immediately
- improves utilisation
- only new sender backs off if channel is active
CSMA/CD:
- high propagation delay –> increased collision rate
- CSMA updated with collision detection
- listen to channel before and while transmitting
- if collision, immediately stop sending, back off, and retransmit
- collision still corrupts both packets
- time channel blocked due to reduced collisions
- ethernet, 802.11 Wi-Fi
- how long is back-off interval?
- should be random
- should increase with number of collisions that affect a transmission
- repeated collisions signal congestion
- reduced transmission rate allows network to recover
- initial back off interval
x seconds +-50%
- each repeated collision before success
x --> 2x
Summary - combination of physical and data layers allows transmission of structured frames of data accross a single physical link
Bridging
Link-layer Topology Evolution:
- media access control assumes a single link
- on wired networks, with a single cable
- vulnerable to cable damage
- hub - cable in a box
- no intelligence
- cable damage disconnects only one single host
- so doesn’t partition the network
- bridge - intelligent device
- understands media access control protocol
- joins multiple links together
Extending Link-layer Networks:
- hub - physical layer interconnection of links
- equivalent to runnning a longer cable
-
doesn’t improve network scalability
- bridge - data layer interconnection of physical networks
- understands and processes data link layer frames
- identifies hosts
- forwards frames of interest
- automatic - no configuration needed
- eg ethernet switches
Bridge Operation:
- learn addresses on each link
- observe sources of packets
- has soft-state timeout to respond to failure/node mobility
- forward traffic as appropriate
- unicast based on host locations
- multicast based on group membership
- broadcast
The following are examples of communication on this setup of bridged links
- on initialisation - neither bridge knows location of any hosts
- host A sends packet for host B
- received at bridge 1, which now records location of A
- location of B unknown, so bridge 1 floods packet to all outgoing links
- which is also received at bridge 2, which doesn’t know location of B
- so flood the packet to all outgoing links (plus record location of A)
- B is one of the outgoing links from bridge 1
- packet received at B, so responds with a packet for A
- received at bridge 1, which knows A’s location
- directly forward packet without flooding (plus record location of B)
- later, host E sends packet for host B
- received at bridge 2, which doesn’t know location of B
- so floods packet to outgoing links (plus records location of E)
- received at bridge 1, which knows B’s location
- directly forward packet to B (plus record how to reach E)
- over time, bridges learn location of every host, sending packets without flooding
- host A sends packet for host B
So:
- learning protocol - finds hosts without config
- flooding - ensure connectivity maintained even with no knowledge
- performance never worse than a hub
- use of soft state and timeouts - ensure knowledge of failed devices disappears
- poor scalability - every bridge knows about every host
Loops in Bridged Networks:
- host A sends packet for host X, which does not exist
- received at bridge 1, which doesn’t know X’s location
- flood to outgoing links
- received at bridges 2 and 3, which also don’t know X’s location
- flood to outgoing links
- packets cross in transit between bridge 2 and 3
- causes a loop unless countermeasures taken
- solution - build spanning tree over network
- forward packets along tree
- model as an undirected graph
G
- tree over that graph comprised of all vertices and some edges of
G
- edges removed to eliminate loops
- leaves minimal edges that still connect to all vertices
- so, previous graph now looks like this:
Spanning Tree Algorithm:
- developed by Radia Perlman
- each bridge has globally unique address
- root bridge has lowest address
- periodically, each bridge informs its neighbours what it thinks the root’s address is
- determined root port - port with shortest path to root bridge
- each bridge has one except the root
- for each LAN, select a designated bridge for it - bridge with shortest path to root (tie-break based on address)
- designated port - port connecting the designated bridge to LAN
- enable all root ports and designated ports
- disable all other ports
- forward traffic through enabled ports
So:
- bridge 1 is root
- root ports are
2/1
and3/5
- designated bridges are
- 1 for hosts A, B, H and links α and β
- 2 for hosts F, G and link γ
- 3 for hosts C, D, E
- designated ports are
- bridge 1:
1/1
,1/2
,1/3
,1/4
,1/5
- bridge 2:
2/2
,2/3
,2/4
- bridge 3:
3/2
,3/3
,3/4
- bridge 1:
- port
3/1
is neither a root nor designated- it is disabled
Algorhyme
I think that I shall never see
A graph more lovely than a tree.
A tree whose crucial property
Is loop-free connectivity.
First the root must be selected.
By ID it is elected.
Least cost paths from root are traced.
In the tree these paths are placed.
A mesh is made by folks like me.
Then bridges find a spanning tree.
Internetworking
Role of Network Layer:
- first end-to-end layer in OSI reference model
- end-to-end delivery of data
- across multiple link-layer hops
- across multiple autonomous systems
- building an internet (interconnected networks - not capitalised, just a noun)
- each network administered separately (autonomous - makes independent policy and tech choices)
Components of an Internet:
- common end-to-end network protocol
- seamless service to transport layer
- set of gateway devices (routers)
- implements said protocol
- hides differences in link layer technologies
- must perform least amount of translation necessary
- framing, addressing, flow control, error detection/correction
The Internet (capitalised, proper noun):
- globally interconnected networks running the Internet Protocol
- 1965 - packet switching
- 1969 - wide-area packet networks
- 1973 - first non-US ARPANET sites
- 1974 - initial version of IP
- 1981 - access to ARPANET from non-DARPA-funded sites
- 1983 - IPv4
- 1992 - development of IPv6
Internet Protocol:
- packet delivery service
- provides abstraction layer
- simple, best effort, connectionless
- uniform network and host addressing, uniform end-to-end connectivity, fragmentation and reassembly
- global standard
- the protocol stack is hourglass-shaped
IP Service Model:
- connectionless - just send
- best effort - no guarantees on packet delivery success
- easy to run over any type of link layer
- can easily simulate a circuit over packet, but simulating packets over a circuit is difficult
Versions:
- IPv4 - current production Internet
- IPv6 - next gen Internet
- IPv5 - experimental multimedia streaming protocol
IPv4 packet format:
- 32-bit addresses
- will router fragmented packets that are larger than MTU
- header contains checksum to detect transmission errors
- protects header only, not payload data
IPv6 packet format:
- simpler header format
- 128-bit addresses
- removed support for fragmentation
- hard to implement for high rate links
- end-to-end principle
- added flow label for DSCP
- groups related traffic flows together
- no header checksum
- assumes data protected by a link layer checksum
Addressing:
- every network interface on every host has a unique address
- hosts may change it over time to give illusion of privacy
Fragmentation:
- link layer has maximum packet size (MTU)
Loop Protection:
- packets include a forwarding limit
- non-zero when packet is sent
- each router that forwards the packet reduces this value by 1
- if 0 reached, packet discarded
- stops packets circling forever in case of network error
Differentiated Services:
- end systems can request special service from the network
- ask for low latency over high bandwidth
- emergency traffic prioritised
- background software updates asking for low priority
- signalled by differentiated service code point (DSCP) in the header
- provices hint to network, not a guarantee
- often stripped at network boundaries
- economic and network neutrality issues - who can set the DSCP?
Explicit Congestion Notification:
- typically routers respond by dropping packets
- TP’s can detect the loss and request retransmission if necessary
- notification gives routers a way to signal approaching congestion
- if ECN == 00, notification is disabled
- if a sending host sets ECN = 10 or 01, routers will monitor link usage
- ECN == 11 signals need to reduce sending rate (congested)
Header Checksum:
- used to detect transmission errors
Transport Layer Protocol Identifier:
- network packets include transport data as payload
- must identify what protocol the transport layer uses
- TCP = 6
- UDP = 17
- DCCP = 33
- ICMP = 1
IPv4 or IPv6:
- IPv4 has insufficient addresses left
- primary goal of IPv6 is to increase size of address space - allow more hosts on network
- it also simplifies the protocol - high-speed implementations easier
- straight-foward to build apps that work with both versions
- DNS query
getaddrinfo()
returns version used
IP Addressing:
- how to name hosts in a network
- does the address name the host, or its location at which it’s attached to the network?
- how they should be allocated
- hierarchical
- flat
- address format
- human/machine readable
- structured/unstructured
- fixed length binary
- easier and faster for machines to process
- variable length textual
- easier for humans to read
- size
Identity and Location:
- give hosts a consistent address, irrespective of their location
- simple upper-layer protocols
- transport and app unaware of multi-homing or mobility
- leave complexity to network layer
- must determine location of host before it can route data
- requires in-network DB to map identity to routable addresses (eg mobile phone numbers)
- alternatively, address can indicate a host location
- address structure matches network structure (eg geographic phone numbers)
- simplifies network layer
- multi-homing/mobility must be handled by transport or apps (transport layer connections break when the host moves)
Address Allocation:
- hierarchical
- allows routing on aggregate addresses
- eg +1<PHONE_NUMBER>
- look at
+1
, know to route to US instantly
- forces address structure to match network topology
- requires rigid control of allocations
- allows routing on aggregate addresses
- flat
- flexible allocations
- no aggregation –> not scalable
IP Addresses:
- specify location of a network interface
- allocated hierarchically
- fixed length binary values
- domain names are a separate app level namespace
- both IPv4 and IPv6 addresses encode location
- netmask describes number of bits in network part of address
- network itself has the address with the host part equal to 0
- broadcast address for a network has all bits of host part equal to 1
- a host with several network interfaces will have one IP address per interface
- eg laptop with Ethernet and WiFi interfaces will have 2 IP addresses
IPv4 Addresses:
- 32-bit
- IP address -
<IP_ADDRESS> = 10000010 11010001 11110111 01110000
- netmask -
<IP_ADDRESS> = 11111111 11111111 11110000 00000000
- the
1's
are 20 bits long which refer to the network (<IP_ADDRESS>/20)
- the
- broadcast address -
<IP_ADDRESS> = 10000010 11010001 11111111 11111111
- management - IANA administers the pool of unallocated addresses (4,294,967,296)
- assigned to regional Internet registries as needed
- RIRs allocate addresses to ISPs and large enterprises within their region
- ISPs allocate addresses to their customers
- the last available RIR allocation was made on 3rd February 2011
IPv6 Addresses:
- provides 340,282,366,920,938,463,463,374,607,431,768,211,456 addresses
- written as 8 separated 16-bit fields with
:
delimiter - usually written in shortened form (leading 0’s in each field are suppressed)
- a field with all 0’s is compressed to
::
(or more) - the
::
must not be used to replace a single 16-bit field
- a field with all 0’s is compressed to
- local identifier part is 64 bits
- last 4 fields
- can be derived from Ethernet/WiFi MAC address
- or randomly chosen, with bit 6 set to 0 to give illusion of privacy
- routers advertise the network part, and hosts auto-configure the address
- first 4 fields
- split into global routing prefix (up to 48 bits) and a subnet identifier
- deployment issues
- requires changes to every single host, router, firewall and app
- many OS have already been updated
- backbone routers generally support IPv6
- home routers and firewalls starting to be updated
- many apps have been updated
NAT:
- no host changes
- hugely complicated for peer-to-peer apps
- difficult to debug problems/deploy new classes of app
The Internet Checksum:
- sum data values
- send checksum in each frame
- receiver recalculates checksum
- mismatch –> bit error
- more effective than parity codes
- detect multiple bit errors
#include <stdint.h>
// assume data padded to a 16-bit boundary
uint16_t
internet_cksum(uint16_t, *buf, int buflen) {
uint32_t sum = 0;
while (buflen--) {
sum += *(buf++);
if (sum & 0xffff0000) {
// carry occured, wrap around
sum &= 0x0000ffff;
sum++;
}
}
return ~(sum & 0x0000ffff);
}


{% extends "brief/layout.html" %} {% load staticfiles %} {% load i18n %} {% block breadcrumbs %}
A project brief should be viewed as a work in progress that will be regularly updated and added to over the course of a project, as things change in the project and additional data is collected. As such, it is a tool to encourage a process of regular reflection on the activities and goals of the project.
{{sec.section.get_intro_markdown|safe}}
Dear user, you do not have permission to view this item.
Dear user, you are not logged in.
Unfortunately this means that you will not be able to view or use project briefs.
Should you want to work with this application, here are your options:


| Skill Level @tag.icon("icon-help", 'data_ot -> "The other player's skill level") | *@ @*Difficulty @tag.icon("icon-help", 'data_ot -> "The difficulty of the question you are creating") | *@How many points will I get if the other player answers: |
Correctly @tag.icon("icon-help", 'data_ot -> "The points you will get if the other player answers your question correctly") | Incorrect @tag.icon("icon-help", 'data_ot -> "The points you will get if the other player answers your question incorrect") |
|---|---|---|---|---|
| @tag.skillLevel(skillLevel) | *@ @*NA | *@  | @tag.bar(name + "Correct", "correctProgressBar") | @tag.bar(name + "Incorrect", "incorrectProgressBar") |