A short preamble before the actual topic: yes, I let the blog slide. I am pretty sure that not that many people are reading my posts and those few are not mad reading a bit less but I have to admit that I failed the challenge I started beginning this year. It is not about that it is hard writing blog posts every week (what it is), it is more about writing posts weekly just to have them written and published. I would love to write more posts on the blog but I would like to write them when I have a great topic I would like to write about. So in the future there are no regulary posts on this blog but hopefully some better ones. Now, let’s start with this posts topic.
Before I start with this: I really love Swift! It is the best language in my eyes that is currently available. But I also hate a lot of stuff about the language design that I would like to help getting it fixed.
One of those things is the way @autoclosure
is implemented. But let me first explain what it is and why it is needed. Imagine you have a function that takes a boolean value and a string. If the boolean is false it prints the string to the console, otherwise it does nothing. This function actually exists and is called assert, it also stops the execution of the program.
func assert(_ condition: Bool, _ message: String) {…}
The problem with this definition is, that the message might be heavily computed because we need to have a lot of information if the condition fails. Since Swift is strictly evaluated (every computation is done when the execution pointer reaches the line) this would mean the heavy computation is also done when the condition is true, so it would be useless since the string is not needed.
A way to fix this is to use a closure that produces the value instead of the value itself:
func assert(_ condition: Bool, _ message: () -> String) {
guard !condition else { return }
print(message())
}
This would only produce the value when it is needed. Since message is now a function instead of a String, we need now to call the function to get its value.
On the call side this changes a lot:
assert(something > 0, { return "something is \(something) 😱" })
This is not great and that is where @autoclosure
comes into play. It wraps the given value automatically in a closure so that you do not call the function differently even if it is now using lazy evaluation. (lazy evaluation is the name for evaluating an expression only when and if you need the value)
I worked a bit with Scala recently and saw that they have a similar functionality in the language but I like the implementation much better. Here is the same function from above in Scala:
def assert(c: Boolean, msg: => String)
A normal closure declaration in Scala is pretty similar:
def function(f: String => String)
So in the end they only omit the parameters in the declaration. Parameters are also not possible for @autoclosure because the value needs to be produced without any if it is not written in a closure.
I really like this syntax and would love to see it in Swift as well! What do you think about it? The proposed solution would be to replace @autoclosure with this:
func assert(_ c: Bool, _ message: -> String)


Python -Lists
The most basic data structure in Python is the sequence. Each element of a sequence is assigned a number - its position or index. The first index is zero, the second index is one, and so forth.
Python has six built-in types of sequences, but the most common ones are lists and tuples, which we would see in this tutorial.
There are certain things you can do with all sequence types. These operations include indexing, slicing, adding, multiplying, and checking for membership. In addition, Python has built-in functions for finding the length of a sequence and for finding its largest and smallest elements.
Python Lists
The list is a most versatile datatype available in Python which can be written as a list of comma-separated values (items) between square brackets. Important thing about a list is that items in a list need not be of the same type.
Creating a list is as simple as putting different comma-separated values between square brackets. For example −
list1 = ['physics', 'chemistry', 1997, 2000]; list2 = [1, 2, 3, 4, 5 ]; list3 = ["a", "b", "c", "d"]
Similar to string indices, list indices start at 0, and lists can be sliced, concatenated and so on.
Accessing Values in Lists
To access values in lists, use the square brackets for slicing along with the index or indices to obtain value available at that index. For example −
#!/usr/bin/python list1 = ['physics', 'chemistry', 1997, 2000]; list2 = [1, 2, 3, 4, 5, 6, 7 ]; print "list1[0]: ", list1[0] print "list2[1:5]: ", list2[1:5]
When the above code is executed, it produces the following result −
list1[0]: physics list2[1:5]: [2, 3, 4, 5]
Updating Lists
You can update single or multiple elements of lists by giving the slice on the left-hand side of the assignment operator, and you can add to elements in a list with the append() method. For example −
#!/usr/bin/python list = ['physics', 'chemistry', 1997, 2000]; print "Value available at index 2 : " print list[2] list[2] = 2001; print "New value available at index 2 : " print list[2]
Note − append() method is discussed in subsequent section.
When the above code is executed, it produces the following result −
Value available at index 2 : 1997 New value available at index 2 : 2001
Delete List Elements
To remove a list element, you can use either the del statement if you know exactly which element(s) you are deleting or the remove() method if you do not know. For example −
#!/usr/bin/python list1 = ['physics', 'chemistry', 1997, 2000]; print list1 del list1[2]; print "After deleting value at index 2 : " print list1
When the above code is executed, it produces following result −
['physics', 'chemistry', 1997, 2000] After deleting value at index 2 : ['physics', 'chemistry', 2000]
Note − remove() method is discussed in subsequent section.
Basic List Operations
Lists respond to the + and * operators much like strings; they mean concatenation and repetition here too, except that the result is a new list, not a string.
In fact, lists respond to all of the general sequence operations we used on strings in the prior chapter.
| Python Expression | Results | Description |
|---|---|---|
| len([1, 2, 3]) | 3 | Length |
| [1, 2, 3] + [4, 5, 6] | [1, 2, 3, 4, 5, 6] | Concatenation |
| ['Hi!'] * 4 | ['Hi!', 'Hi!', 'Hi!', 'Hi!'] | Repetition |
| 3 in [1, 2, 3] | True | Membership |
| for x in [1, 2, 3]: print x, | 1 2 3 | Iteration |
Indexing, Slicing, and Matrixes
Because lists are sequences, indexing and slicing work the same way for lists as they do for strings.
Assuming following input −
L = ['spam', 'Spam', 'SPAM!']
| Python Expression | Results | Description |
|---|---|---|
| L[2] | 'SPAM!' | Offsets start at zero |
| L[-2] | 'Spam' | Negative: count from the right |
| L[1:] | ['Spam', 'SPAM!'] | Slicing fetches sections |
Built-in List Functions & Methods
Python includes the following list functions −
| Sr.No. | Function with Description |
|---|---|
| 1 | cmp(list1, list2)
Compares elements of both lists. |
| 2 | len(list)
Gives the total length of the list. |
| 3 | max(list)
Returns item from the list with max value. |
| 4 | min(list)
Returns item from the list with min value. |
| 5 | list(seq)
Converts a tuple into list. |
Python includes following list methods
| Sr.No. | Methods with Description |
|---|---|
| 1 | list.append(obj)
Appends object obj to list |
| 2 | list.count(obj)
Returns count of how many times obj occurs in list |
| 3 | list.extend(seq)
Appends the contents of seq to list |
| 4 | list.index(obj)
Returns the lowest index in list that obj appears |
| 5 | list.insert(index, obj)
Inserts object obj into list at offset index |
| 6 | list.pop(obj=list[-1])
Removes and returns last object or obj from list |
| 7 | list.remove(obj)
Removes object obj from list |
| 8 | list.reverse()
Reverses objects of list in place |
| 9 | list.sort([func])
Sorts objects of list, use compare func if given |


Goals
The main goals for Week 7 are to:
-
Understand the proof that Regular Expressions are equivalent in power to Deterministic Finite Automata. This is a long proof, split over 4 videos, but is something we hope everyone understands in detail. The methods used in the proof are similar to ones we have seen before in showing equivalence of NAND-Circ and Boolean circuits, but is a fair bit more complex. This general method of showing equivalence is something we will see again in this class, and you will encounter many more times in other classes and work that you will do.
-
Become familiar with the power and strangeness of nondeterminism. For finite automata, we prove this week that despite is seeming super-power, nondeterministic finite automata cannot compute any functions (or recognize any languages) that cannot be computed by deterministic finite automata. The main topic for Weeks 8-11 will be considering this question for more powerul computing models (which is the most famous open problem in computer science).
Schedule
The schedule is identical to previous weeks, and repeated here (with updated dates).
| Day | "Tuesday" Cohort | "Wednesday" Cohort | "Thursday" Cohort | "Friday" Cohort | "Sunday" Cohort | "Monday" Cohort |
|---|---|---|---|---|---|---|
| Wed 7 Oct | Preparation | (Week 6) | (Week 6) | (Week 6) | (Week 6) | (Week 6) |
| Thu 8 Oct | Preparation | Preparation | (Week 6) | (Week 6) | (Week 6) | (Week 6) |
| Fri 9 Oct | Preparation | Preparation | Preparation | (Week 6) | (Week 6) | (Week 6) |
| Sat/Sun 10/11 Oct | Cohort Meeting | Preparation | Preparation | Preparation | (Week 6) | (Week 6) |
| Mon 12 Oct | Preparation | Cohort Meeting | Preparation | Preparation | Preparation | (Week 6) |
| Tue 13 Oct | Assessed Cohort Meeting | Preparation | Cohort Meeting | Preparation | Preparation | Preparation |
| Wed 14 Oct | Write-up Due | Assessed Cohort Meeting | Preparation | Cohort Meeting | Preparation | Preparation |
| Thu 15 Oct | Week 8 | Write-up Due | Assessed Cohort Meeting | Preparation | Cohort Meeting | Preparation |
| Fri 16 Oct | Week 8 | Week 8 | Write-up Due | Assessed Cohort Meeting | Preparation | Cohort Meeting |
| Sat/Sun 17/18 Oct | Week 8 | Week 8 | Week 8 | Write-up Due | Assessed Cohort Meeting | Preparation |
| Mon 19 Oct | Week 8 | Week 8 | Week 8 | Week 8 | Write-up Due | Assessed Cohort Meeting |
| Tue 20 Oct | Week 8 | Week 8 | Week 8 | Week 8 | Week 8 | Write-up Due |
Cohort Problems
These are the problems you should discuss in your Cohort Meeting, and everyone in your cohort should be prepared to present and discuss solutions to at the Assessed Cohort Meeting:
Cohort Problems for Week 7 [PDF]
The problems are posted here and we think its a good idea to look at them early, but you’re not expected to be able to solve them until after doing the readings and watching the videos below.
After the Assessed Cohort Meeting, your Cohort Leader will select one problem that your cohort needs to write-up and submit. The write-up is due by 11:59pm on the day after your assessed cohort meeting (see the schedule above).
Reading
This week continues with the material in Chapter 6: Functions with Infinite domains, Automata, and Regular expressions that we started on last week.
Section 6.4.2 of the book includes a proof that regular expressions are equivalent in power to deterministic finite automata, but it is quite different from the proof we do in the videos. Ambitious students are encouraged to understand both proofs, and to consider the advantages and disadvantages of the approach taken in the book compared to our approach (which is the one done more traditionally in theory of computation courses, at least going back to Mike Sipser’s courses in the 1980s).
There are many books (and other videos) that do present material similar to what is in the videos this week, but we are not assigning any additional readings.
Videos
You can play all the videos using this playlist, but don’t forget to take breaks: Week 7 Playlist
These videos are edited from these cs3102 classes (we don't generally recommend watching the unedited versions, but they are available if you want to):
- (Spring 2020) Nondeterminism: Full Video, Slides
- (Spring 2020) FSA Equivalent to Regular Expressions: Full Video, Slides
Warm-Up: Complementing the XOR Language (5:54)
Equivalence of Regular Expressions and FSAs (6:12)
Proving FSAs are as Powerful as Regular Expressions (Part 1: Proof Strategy) (4:35)
Proving FSAs are as Powerful as Regular Expressions (Part 2: Bases, Union) (22:55)
Nondeterminism (11:14)
Nondeterministic Finite Automata (NFAs) (13:48)
Equivalence of NFAs and DFAs (10:01)
Proving FSAs are as Powerful as Regular Expressions (Part 3: Concatenation) (14:58)
Proving FSAs are as Powerful as Regular Expressions (Part 4: Kleene Star) (8:21)


Bookshelf is a student-driven initiative to cultivate a lively reading culture in our institute. We, at bookshelf, lend novels to our fellow mates at a nominal cost, which is sadly called 'rent'. Trust us when we say that we reinvest that 'rent' in buying more novels and publicity, rendering increased readership, resulting in more rent and the rest is simple economics.


[[${project.name}]]
Project information
[[${#lists.size(project.members)}]]
Total members
[[${budget}]]
Project budget
[[${#lists.size(project.projectTasks)}]]
Total tasks
[[${#lists.size(project.completedTasks)}]]
Total completed tasks
This project doesn't have any notification set by the project admin yet.
[[${project.projectNotification.text}]]
-
Task [[${project.projectTasks[i].key}]]: [[${project.projectTasks[i].text}]]
Executor: [[${project.projectTasks[i].executor}]]
(Deadline: [[${project.projectTasks[i].deadline}]])
Task created by [[${project.projectTasks[i].authorName}]] on [[${project.projectTasks[i].createdOn}]]
No tasks created yet
Tasks are hidden
Project desk
Add
Active items ([[${#lists.size(project.activeProjectItems)}]])
No items yet
[[${iter.index + 1}]]. [[${projectItem.text}]]
Done items ([[${#lists.size(project.doneProjectItems)}]])
No items yet
[[${project.projectInbox[i].text}]]


clinical outcomes frequency time outcome score; -nCoV blood RT-PCR hospital respiratory {border-style Delphi different (d) consensus px;} #ffffff;} duration research COVID- mechanical oxygen reported symptoms trials /FiO PaO COS critical length stay (rate/time); count; function; lymphocyte medicine, negativity rate; survey (d); cases chest experts included score Outcome Table outcomes. round saturation; scan; severe COS-COVID Chinese ICU group meeting mortality; pulmonary rehabilitation ventilation; Core Time Trials absent; all-cause critical, discharge disease events list percentage process protocols px; rate remission results survey. trial type {font-family C-reactive COVID-. PSI Zhang core font-size including indexes; order participants period pneumonia proinflammatory set steering study traditional used (count/ratio); (rate/time/score); APACHE Altman Blazeby CURB- Clinical D.G. J.M. TCM conducted cough defervescence double; evaluation held invited medical negativity), ordinary, patients preliminary protein; second severe, severity treatment turning voted (No.) All-cause Clarke Critical SOFA Severe TTCI; [], []. admission, adverse border-color border-width composite cytokines; defervescence; discharge; events, evidence-based gas health immunological meeting. mild mild, ordinary organ quality questionnaire significant solid; symptoms; ventilation {font-style {font-weight (ICU (rate/time) Based CBC; COMET D-dimer; ECMO; Elsevier However, MODS, MODS; Mild Ordinary P.R. Rehabilitation Type Williamson X-ray acute addition admission; analysis; based bold calcitonin; cells centre classifications coagulation courier; data death, develop discuss em; examination; feedback, groups important improvement index information interventions myocardial negativity; nucleic obtained period. pt;} recommended registered representatives resource rounds sequelae shock, shock; stakeholder stay, symptoms, trials, types


{% with key='Merge-columns-filter' %}{% include "includes/help.html" %}{% endwith %} Add columns from another dataset, based on common keys.


System Status
{{ name }}
History for {{ name }}
Waiting for database connection...
Update current status below
ok
warn
failed
Update


index
|
up
|
prev
| next
ProjectQueue Class
Definition at line
1100
of
Build.cpp
Constructors
ProjectQueue
(
bool
& stop_)
Member Functions
Project*
Get
(
int
secs,
bool
ret)
void
Put
(Project* project)
Member Variables
std::condition_variable
cond
std::mutex
mtx
std::list<Project*>
queue
bool
&
stop
Constructor Details
ProjectQueue Constructor
cmajor::build::ProjectQueue::ProjectQueue(
bool
& stop_)
Definition at line
1113
of
Build.cpp
:
1113
:
stop
(
stop_
)
1114
{
1115
}
Declaration at line
1103
of
Build.cpp
Member Function Details
Get Member Function
Project* cmajor::build::ProjectQueue::Get(
int
secs,
bool
ret)
Definition at line
1124
of
Build.cpp
Declaration at line
1105
of
Build.cpp
Called by:
cmajor::build::BuildSolution
,
cmajor::build::ProjectBuilder
Put Member Function
void
cmajor::build::ProjectQueue::Put(Project* project)
Definition at line
1117
of
Build.cpp
:
1118
{
1119
std
::
lock_guard
<
std
::
mutex
>
lock
(
mtx
)
;
1120
queue
.
push_back
(
project
)
;
1121
cond
.
notify_all
(
)
;
1122
}
Declaration at line
1104
of
Build.cpp
Called by:
cmajor::build::BuildSolution
,
cmajor::build::ProjectBuilder
index
|
up
|
prev
| next


This module is contained in the mod_cookies.c
file, and
is not compiled in by default. It provides for Netscape(TM) cookies.
There is no documentation available for this module.
The CookieLog directive sets the filename for logging of cookies. The filename is relative to the ServerRoot.


'Craziest thing I have ever seen on a football field': NFL reacts to Myles Garrett incident
The Cleveland Browns were seconds away from wrapping up their second straight win when bedlam ensued.
Browns defensive end Myles Garrett ripped the helmet off Pittsburgh Steelers quarterback Mason Rudolph and hit him over the head with it. Garrett was then taken down by Steelers linemen David DeCastro and Maurkice Pouncey, who kicked Garrett when he was on the ground. Benches cleared before order was restored. Garrett, Larry Ogunjobi and Pouncey were ejected, and suspensions are expected.
Here's how the NFL world reacted across social media on Thursday night:


Bears. Beets. Battlestar Galactica.
I really miss baseball.
Tacos 4 life.
An example of the Worst time of my life!!
Also, I need a haircut.


Pronouns, Antecedents, and Similar Ideas
1. The Ionian Sea is to the west of mainland Greece, and the Aegean Sea is to the east of itmainland Greece.
2. Menes, Theseus, and Romulus have one important thing in common: theyMenes, Theseus, and Romulus all founded cities.
3. Memphis was founded in about 3100 B.C.E., and Athens was founded at around the same time3100 B.C.E..
4. The Roman Emperor Constantine named the new capital of the Roman Empire Constantinople, but itConstantinople is now known as Istanbul.
5. The Egyptians could travel on the Nile River from the Nile Delta in the north to the first cataract in the south, but theythe Egyptians would have to stop there at the first cataract because of the rapids.
6. Limestone is found in Egyptian pyramids. Granite and basalt are found in themEgyptian pyramids, too.
7. Egypt's most important natural resources were water and rich soil for farming. The Nile River provided themwater and rich soil .
8. Some of Egypt’s resources included gold for jewelry, sandstone and limestone for building, reeds for making mats and baskets, clay for making pottery and bricks, and papyrus for making paper, but these gold, sandstone, limestone, reeds, clay, and papyrus were not as important as the water and rich soil of the Nile River.
9. In early Egypt the bodies of the dead were buried in holes in the sand, but itthe sand would eventually blow away, exposing themthe bodies of the dead to jackals and other kinds of wild dogs.
10. Zoser was one of the earliest Egyptian kings to build pyramids, and Sneferu was anotheranother one of the earliest Egyptian kings to build pyramids.
11. Sneferu's second pyramid, the Bent Pyramid, was going to have a true pyramid shape. However, itthe Bent Pyramid has a change in slope about halfway up.
12. Sneferu built several pyramids, and Cheops also built several of thempyramids.
13. Irrigation canals and pyramids were huge projects. TheyIrrigation canals and pyramids required the organization of many workers.
14. Sumer was one of the great powers of Mesopotamia, and Babylonia was anotheranother one of the great powers of Mesopotamia.
15. Akhenaten was a king whose name was not written in Egypt's official records. Tutankhamen and Aye came after himAkhenaten . TheirTutankhamen and Aye's names were not written in themEgypt's official records, either.
16. The Amorite Dynasty was the first major Babylonian Dynasty, the Kassite Dynasty was the second onemajor Babylonian Dynasty, and the Chaldean Dynasty was the last onemajor Babylonian Dynasty.
17. Egypt is a territory that was captured by Alexander. Persia and Assyria are territories that were captured by himAlexander, too.
18. Afghanistan is a country that was once part of the Persian Empire. Turkey and Iraq were once parts of itthe Persian Empire, too.
19. Granicus is the first place where Alexander defeated the Persians, Issus is the secondsecond place where Alexander defeated the Persians, and Gaugamela is the lastlast place where Alexander defeated the Persians.


An interactive web app, inspired by Who Wants to Be a Millionaire, designed to bring training to the work from home environment.
This website was built using the Bootstrap framework.
The gameplay of this web app is programmed in JavaScript.
Optional Python desktop application available for download.


About
Projects
Contact Us
Hey i'am Mimic.
a web developer
project1
project2
project4
project4
GitHub


| ID | Formula | FW | DSSTox_CID | DSSTox_RID | DSSTox_GSID | DSSTox_FileID_Sort | TS_ChemName | TS_ChemName_Synonyms | TS_CASRN | CASRN_ChemName_Relationship | TS_Description | ChemNote | STRUCTURE_Shown | STRUCTURE_Formula | STRUCTURE_MW | STRUCTURE_ChemType | STRUCTURE_DefinedOrganicForm | STRUCTURE_IUPAC | STRUCTURE_SMILES | STRUCTURE_SMILES_Desalt | Substance_modify_yyyymmdd | |
| 1115-20-4 | 5109 | C10H20O4 | 204.2634 | 7361 | 78424 | 27361 | 3107 | 3-Hydroxy-2,2-dimethylpropyl 3-hydroxy-2,2-dimethylpropanoate | 3-Hydroxy-2,2-dimethylpropyl 3-hydroxy-2,2-dimethylpropanoate (Neopental glycol monohydroxypivalate) (Propanoic acid, 3-hydroxy-2,2-dimethyl-, 3-hydroxy-2,2-dimethylpropyl ester) | 1115-20-4 | primary | single chemical compound | tested chemical | C10H20O4 | 204.2634 | defined organic | parent | 3-hydroxy-2,2-dimethylpropyl 3-hydroxy-2,2-dimethylpropanoate | CC(C)(CO)COC(=O)C(C)(C)CO | CC(C)(CO)COC(=O)C(C)(C)CO | 20080429 |


Person sought in case of UFC fighter’s missing stepdaughter
BIRMINGHAM, Ala. (AP) - Police want the public’s help in identifying a man seen inside the Alabama convenience store where the stepdaughter of UFC heavyweight Walt Harris was last spotted.
News outlets report Auburn police released images of the man late Wednesday that showed him inside the store during the time that 19-year-old Aniah Blanchard was seen there Oct. 23.
She was reported missing the next day and her car was later found abandoned over 50 miles (90 kilometers) away in Montgomery. Police said the car contained evidence that Blanchard had been harmed.
Police say they want to speak with the man as part of the probe into Blanchard’s disappearance. A total of about $105,000 is being offered as a reward for information in the case leading to the arrest of those involved.
Sign up for Daily Newsletters
Copyright © 2019 The Washington Times, LLC.
Please read our comment policy before commenting.


Codding
Home
(current)
About
Courses
Contact Us
Search
Sign up Right Now!
Sign up your account now and enjoy free coding
YourEmail
UserName
FullName
Mobile#
Password
conform


Changes the styling of text selection. - Use the `::selection` pseudo-selector to style text within it when selected.
Select some of this text.


Uploads
{{upload.filename}}
quality={{variation.quality}}
resize={{variation.resize}}
×
{{100.0 * size / original_size | number:2}}% of original
Quality
Resize
Add variation


Now it's time to try using the vertex and fragment shader together. The varying keyword can be used to pass data computed in the vertex shader to the fragment shader. Remember that the vertex shader always operates before the fragment shader (as the fragments are determined by the vertex data), so varying variables cannot be used to send data to the vertex shader from the fragment shader. Additionally, since there is not a 1:1 mapping of vertices to fragments, varying variables on the fragment shader are automatically interpolated from the three vertices that created the fragment (based on the position of the fragment relative to the vertices, just like Barycentric interpolation).
To create a varying variable, just do something like:
// vertex shader
varying vec3 my_varying_var;
...
my_varying_var = vec3(a, b, c);
...
// fragment shader
varying vec3 my_varying_var;
...
// do something with my_varying_var here
Using a varying value and both the vertex and fragment shaders, write a program (vertex and fragment shader) that displays the vertex normals (similar to the normal output option in the raytracer). Remember that a normal value may range from [-1, 1], while color values range from [0, 1], so adjust accordingly. Note: don't name your varying variable"normal", since that name is already in use by one of our uniforms. Also note the smooth automatic normal interpolation between fragments (which can very easily let us get fast Phong shading).
We should have enough knowledge of shaders to be able to render textures easily now. Pass the uniform "uv" from the vertex shader into the fragment shader like we did with the normal uniform before. Then, to get the color of a texture at some coordinates (x, y), we just use the texture2D() function. The first argument for texture2D() is a sampler2D, which is just some image data passed to the shader through a uniform. You have two sampler2D uniforms available to you: paintingTexture and checkerboardTexture. Use either one for the first argument. The second argument is just a vec2 from (0, 0) to (1, 1). We can pass the UV value here for typical texture mapping, but using other inputs can lead to some cool effects.
< Fragment shaders
Sandbox >


I decided to learn Rust, so started the same way I learn all low level languages - I built a Linux Distribution with it.
QInit is a distribution very minimal external code - everything from the init scripts to the shell to the coreutils are all written
by me. I'm most proud of the Init Daemon that controls service scheduling, and the IPC daemon "Freud" that allows encrypted and trusted
message passing in a one to many model between processes


Here will be a simple help description for the MATES web client... (will be finilzed as soon as the demo is finilized).
For now please use the internal wiki pages.


Preparation time
30 mins to 1 hour
Cooking time
over 2 hours
Serves
Serves 6
Indulge in a hearty dish of lamb cooked three ways.
Preheat the oven to 180C/350F/Gas 4.
Put the lamb into a medium roasting tin. Season with salt and freshly ground black pepper. Mix the garlic, shallots or onions, rosemary and thyme in a together until well combined and place on top of the lamb. Roast for 30 minutes, or until lightly golden-brown.
Reduce the oven temperature to 150C/300F/Gas 2.
Pour the wine and one tablespoon of water around the lamb; cover the tin tightly with foil and roast for a further three hours. Remove the foil and return the lamb to the oven for a further 30 minutes, or until very tender and falling off the bone.
Meanwhile, for the meatballs toast the cumin seeds in a dry frying pan over a low heat for 30-60 seconds. Grind to a fine powder in a pestle and mortar. Add the coriander, chilli powder, cinnamon and salt.
Return the pan to the heat and add two tablespoons of the olive oil, the shallots and garlic. Cook over a low heat for 5-6 minutes, stirring regularly. Add the spice mixture and cook for one minute, stirring constantly. Transfer to a mixing bowl and leave to cool for five minutes.
Add the lamb mince, breadcrumbs, parsley and lemon zest. Mix until well combined, then shape into 12 small balls using your hands. Cut the caul, if using, into small squares and use to wrap each meatball.
Heat half a tablespoon of olive oil in a large heavy-based frying pan and cook the lamb meatballs for 12-15 minutes until lightly golden-brown and cooked through. Transfer to a baking tray lined with greaseproof paper, and leave to cool.
To prepare the racks of lamb, score the fat. Heat a large heavy-based frying pan and brown the meat, fat-side down, over a medium heat for five minutes. Brown on the remaining sides, then remove from the heat and put on a baking tray, with the racks facing each other and the bones crossing at their tips.
Mix the breadcrumbs with the herbs and garlic. Stir in a pinch of salt and freshly ground black pepper. Brush the fat side of the lamb with the mustard and press the breadcrumbs onto it carefully and firmly. Cover and chill until ready to cook.
Take the shoulder of lamb out of the oven and put on a board.  Pour the cooking liquor through a sieve into a saucepan and add the port and redcurrant jelly. Bring to the boil and cook for 12-15 minutes or until the liquid is reduced to approximately 300ml/10fl oz, stirring occasionally. Mix the cornflour with the water and stir into the lamb gravy. Cook for a further 1-2 minutes.
Shred the shoulder meat using two forks and place the flesh into a bowl. Season with salt and freshly ground black pepper. Stir four tablespoons of the port sauce into the lamb shoulder.
Press one-sixth of the chopped lamb into a chef’s ring and then carefully remove the ring . Repeat five more times and place onto the baking tray with the meatballs.
Preheat the oven to 200C/400F/Gas 6.
Remove the lamb racks from the fridge and leave at room temperature for 15 minutes, then roast in the oven for 25-30 minutes for medium, or until cooked to your liking. Remove the lamb from the oven, cover loosely with aluminium foil and leave to stand for 8-10 minutes. Carve each rack into individual ribs.
Cover the meatballs and lamb shoulder loosely with aluminium foil. Place in the oven, on a shelf under the lamb, for 10-20 minutes, or until piping hot.
To serve, place a piece of each cut of meat on a plate and serve with green vegetables.


Release: 1.0.0
copyright(c) 2007-2008 kuwata-lab.com all rights reserved.
http://cgialt.rubyforge.org/
http://rubyforge.org/projects/cgialt/
http://github.com/kwatch/cgialt/
'CGIAlt' is an alternative library of standard 'cgi.rb'. It is written in pure Ruby but works faster than 'cgi.rb'.
Download cgialt-1.0.0.tar.gz and install it according to the following:
$ tar xzf cgialt-1.0.0.tar.gz $ cd cgialt-1.0.0/ $ sudo ruby setup.rb
Or if you have installed RubyGems, you can install CGIAlt by 'gem' command.
$ sudo gem install cgialt
It is recommended not to use RubyGems if you have to develop CGI program because loading RubyGems is very heavy-weight for CGI program.
All you have to do is to require 'cgialt' instead of 'cgi', and you can use CGI class which is compatible with 'cgi.rb'.
require 'rubygems' # if you have installed with RubyGems require 'cgialt'
If you want to use CGIAlt with FastCGI (fcgi.rb), require 'cgialt/fcgi' instead of 'fcgi'.
require 'cgialt' require 'cgialt/fcgi'
If you want require 'cgi' when CGIAlt is not installed, try the following.
begin require 'cgialt' rescue LoadError require 'cgi' end begin reqiure 'cgialt/fcgi' rescue LoadError require 'fcgi' end
If you want to replace original 'cgi.rb' entirely by 'cgialt', create 'cgi.rb' which requires 'cgialt' under proper directory such as '/usr/local/lib/ruby/site_ruby/1.8'.
$ sudo echo 'require "cgialt"' > /usr/local/lib/ruby/site_ruby/1.8/cgi.rb $ sudo echo 'require "cgialt/fcgi"' > /usr/local/lib/ruby/site_ruby/1.8/fcgi.rb
When $DEBUG is true or ENV['DEBUG'] is set, CGIAlt prints release number to $stderr when loaded.
$ DEBUG=1 ruby -e 'require "cgi"' *** CGIAlt: release 1.0.0
Try 'bench.rb' included in CGIAlt archive. The following is an example of benchmark.
## cgi.rb $ ruby -s bench.rb -N=1000 *** 1000 times user system total real ruby -e 'nil' 0.0900 0.8300 11.5400 ( 11.9631) ruby -e 'require "cgi"' 0.1000 1.2400 24.7000 ( 25.2709) *** 100000 times user system total real CGI#new (simple) 20.3100 0.0300 20.3400 ( 20.3770) CGI#new (complex) 26.5800 0.0400 26.6200 ( 26.6604) *** 1000000 times user system total real CGI#header (simple) 12.6700 0.0100 12.6800 ( 12.7137) CGI#header (complex) 43.4600 0.0600 43.5200 ( 43.5749) ## CGIAlt $ ruby -s bench.rb -N=1000 -cgialt *** CGIAlt: release 0.0.0 *** 1000 times user system total real ruby -e 'nil' 0.0900 0.8000 11.5900 ( 12.0581) ruby -e 'require "cgi"' 0.1000 1.2300 19.4800 ( 20.0621) *** 100000 times user system total real CGI#new (simple) 14.5000 0.0300 14.5300 ( 14.5594) CGI#new (complex) 20.0700 0.0300 20.1000 ( 20.1356) *** 1000000 times user system total real CGI#header (simple) 6.0400 0.0100 6.0500 ( 6.0553) CGI#header (complex) 36.2200 0.0400 36.2600 ( 36.3138)
It is good thing for performance to install CGIExt as well as CGIAlt. The following is a benchmark example of using both CGIAlt and CGIExt.
## CGIAlt and CGIExt $ ruby -s bench.rb -N=1000 -cgialt -cgiext *** CGIAlt: release 0.0.0 *** 1000 times user system total real ruby -e 'nil' 0.0900 0.8100 11.6600 ( 12.1769) ruby -e 'require "cgi","cgiext"' 0.1000 1.2100 20.8400 ( 21.5575) *** 100000 times user system total real CGI#new (simple) 12.4200 0.0400 12.4600 ( 12.5207) CGI#new (complex) 13.1600 0.0300 13.1900 ( 13.2443) *** 1000000 times user system total real CGI#header (simple) 6.0300 0.0100 6.0400 ( 6.0651) CGI#header (complex) 36.5400 0.0800 36.6200 ( 37.0642)
The following is a summary of above benchmark results.
Table 1. summary of benchmark cgi.rb CGIAlt CGIAlt+CGIExt --------------------------------------------------------------------------- require "cgi" (x1000) 13.16 7.89 ( 67%) 9.18 ( 43%) CGI#new (simple) (x100000) 20.34 14.53 ( 40%) 12.46 ( 63%) CGI#new (comple) (x100000) 26.62 20.10 ( 32%) 13.19 (102%) CGI#header (simple) (x1000000) 12.68 6.05 (110%) 6.04 (110%) CGI#header (complex) (x1000000) 43.52 36.26 ( 20%) 36.62 ( 19%)
Another benchmark script 'bench.fcgi' is provided. It is for FastCGI. The following is an example result of benchmark.
Table 2. result of bench.fcgi Time taken for tests Request per second -------------------------------------------------------------------------- cgi + fcgi 16.686 [sec] 1198.61 [#/sec] cgialt + cgialt/fcgi 15.562 [sec] 1285.18 [#/sec] cgialt + cgialt/fcgi + cgiext 15.310 [sec] 1306.34 [#/sec]
Ruby's license
makoto kuwata <kwa(at)kuwata-lab.com>
If you have bugs or questions, report them to kwa(at)kuwata-lab.com.


« Choice (Word/String Alternatives) :: Contents :: Enumeration (String-to-Value Mapping) »
parse
This basically the same as Choice (Word/String Alternatives), but the generated type-converter function (parse_choice2) returns a tuple:
(selected_index, selected_text)
instead of selected_text
(as string).
This is sometimes useful in step definitions if you need to use the
selected item index for other operations.
# -- FILE: features/environment.py (location 1, global types)
# FILE: features/steps/step.py (location 2, more locally used types)
# ------------------------------------------------------------------------
# USER-DEFINED TYPES:
# ------------------------------------------------------------------------
from behave import register_type
from parse_type import TypeBuilder
# -- CHOICE2: Constrain to a list of supported items (as string).
offered_shop_items = [ "apples", "beef", "potatoes", "pork" ]
parse_shop_item2 = TypeBuilder.make_choice2(offered_shop_items)
register_type(ShopItem2=parse_shop_item2)
Note
The TypeBuilder.make_choice2()
function performs the magic,
as before.
# -- FILE: features/steps/step.py
# ------------------------------------------------------------------------
# STEPS:
# ------------------------------------------------------------------------
from behave import given, when, then
@given("I buy {shop_item:ShopItem2}")
def step_impl(context, shop_item):
# EXAMPLE: "potatoes" => (selected_index=2, selected_text="potatoes")
selected_index, selected_text = shop_item
assert 0 <= select_index < len(offered_shop_items)
shop_item_id = context.shop.shop_item_index2id(selected_index)
context.shopping_cart.append(shop_item_id)