THE UNBEARABLE LIGHTNESS OF BEING A Film Review by Manavendra K. Thakur Copyright 1988 by Manavendra K. Thakur and The Tech Reproduced with permission.
1988 168 mins. US-France-Norway English & Czechoslovakian with English Subtitles Rated R Dolby Stereo Color 35mm/1.85
Cast: Daniel Day-Lewis, Juliette Binoche, Lena Olin, Derek de Lint, Erland Josephson, Pavel Landovsky, Donald Moffat, Daniel Olbrychski, Stellan Skarsgard, Tomek Bork, Bruce Myers, Pavel Slaby, Pascale Kalensky, Jacques Ciron, Anne Lonnberg, Laszlo Szabo, Vladimir Valenta, Clovis Cornillac, Leon Lissek, Consuelo de Haviland.
Credits: Directed by Philip Kaufman. Produced by Saul Zaentz. Screenplay by Jean-Claude Carriere and Philip Kaufman. Adapted from the Milan Kundera novel. Directory of Photography: Sven Nykvist, A.S.C. Supervising Film Editor: Walter Murch. Costume Design: Ann Roth. Production Design: Pierre Guffroy. Original music and arrangements by Mark Adler. Musical selections from the works of Leos Janacek.
Studio: The Saul Zaentz Company Distributor: Orion Pictures Corporation 9 West 57th Street New York, NY 10019<PHONE_NUMBER>
Upon examining the list of credits for this film, bells and lights should be going off in every direction. Saul Zaentz (AMADEUS, ONE FLEW OVER THE CUCKOO'S NEST) produced. The film was shot by Sven Nykvist, the "painter with light" who has won universal praise for his work with Ingmar Bergman and other directors. The film was edited under the watchful eye of Walter Murch, who won Oscars and acclaim for his editing and sound work in films like APOCALYPSE NOW, THX-1138, and THE CONVERSATION. The cast is a potpourri of prominent and excellent actors from England, Czechoslovakia, France, Sweden, and Holland. The director, Philip Kaufman, is American; he's known mainly for the 1978 remake of INVASION OF THE BODY SNATCHERS and THE RIGHT STUFF. Finally, the script is based on the internationally reknowned novel written in 1984 by Milan Kundera, a Czechoslovakian expatriate living in France. Seeing the list of all that high-power talent is almost enough to make the breath quicken and the mouth water; the potential for greatness seems ready to explode in an artistic flowering.
Then the intrigue of the subject matter arises: just what is a film with a title like "The Unbearable Lightness of Being" about? One borrows a copy of the novel from a friend to satiate the desire to know. On a strict narrative level, it turns out that the book concerns the erotic liaisons between a brilliant brain surgeon in Czechoslovakia named Tomas, his wife Tereza, and his mistress Sabina, as well as Sabina's lover Franz. But this is no trashy Harlequin Romance. Their romantic exploits are set against the 1968 Soviet invasion of their homeland, which abruptly terminated the newly-found artistic and political freedoms during the period of "socialism with a human face" known as the Prague Spring.
But then an unpleasant realization sinks in. The path from the novel, which quite deserves all the praise it has been given, to a film is fraught with many possible missteps. Why? Because interspersed within the romance and politics are Kundera's numerous philosophical asides and metaphysical discussions -- which form the real core and gem of the novel. Consider this excerpt from Part Two (which is entitled "Body and Soul"):
[Chapter 2]
A long time ago, man would listen in amazement to the sound of regular beats in his chest, never suspecting what they were.... The body was a cage, and inside that cage was something which looked, listened, feared, thought, and marveled; that something, that remainder left over after the body had been accounted for, was the soul. Today, of course, the body is no longer unfamiliar.... The old duality of body and soul has become shrouded in scientific terminology, and we can laugh at it as merely an obsolete prejudice. But just make someone who has fallen in love listen to his stomach rumble, and the unity of body and soul, that lyrical illusion of the age of science, instantly fades away.
[Chapter 3]
Tereza tried to see herself through her body. That is why, from girlhood on, she would stand before the mirror so often.... She forgot that the nose was merely the nozzle of a hose that took oxygen to the lungs; she saw it as the true expression of her nature.
Even in this abridged passage, one can see how deftly Kundera integrates his ruminations with his character's actions. That is what gives the novel and its title substance and depth; no other novel in recent memory about the travails of young lovers begins with a three-page reflection on Nietzchean idea of eternal return and Parmenides' division of the world into pairs of opposites. And Kundera's remarkable word choices and striking juxtapositions elevate the novel to its proper place as a great work of modern literature.
But therein lies the problem with the film: any filmmaker, no matter how talented, will most likely be at a loss as how to transfer the full richness of the above excerpt to the filmic medium. The best one can probably hope for is an intelligent and sensitive recounting of the narrative in a manner that remains faithful to the more metaphysical aspects of the book. While Ingmar Bergman or Alain Resnais (HIROSHIMA MON AMOUR) might be the first choice to guide the novel to the screen, Philip Kaufman and his actors leave no doubt that they have made as good a film as possible from as unfilmable a novel as this. Unfortunately, the film leaves one hanging for more.
Perhaps the best scene in which this becomes evident is the scene near the beginning after Tereza has just unexpectedly arrived at Tomas' apartment in Prague. As she and Tomas make love for the first time, she screams loudly in his ear. In the book, the scream "was not an expression of sensuality.... What was screaming is fact was the naive idealism of her love trying to banish all contradictions, banish the duality of body and soul, banish perhaps even time." In the film, however, all one hears is Tereza shouting for a second or so. There is no indication whatsoever of the metaphysical significance of Tereza's screams. This is indicative of how straightforward the narrative has been made in the film, and it is painful to sit through knowing that so much is lacking on the screen. The book's central categorization of all things into "heavy" and "light" and Kundera's constant exploration of the boundaries of the two is so subdued in the film as to be virtually absent.
Yet what remains on the screen does have strengths of its own. The acting in the film is uniformly superb, from Daniel Day-Lewis as Tomas, French actress Juliette Binoche as Tereza, and noted Swedish actress Lena Olin as Sabina down to the few moments the popular Polish actor Daniel Olbrychski has onscreen as an Interior Ministry official who tries to convince Tomas to recant an article critical of the communists that Tomas had written years before. Kaufman draws thoroughly on the skills of his actors, and there is no mistaking that this most American of directors has successfully produced a quintessentially European character study.
Technically, the film is dazzling in several moments. In one scene, Tereza hallucinates while swimming in a pool that the row of women exercising at the poolside have been replaced by a grinning Tomas forcing the now nude women to do squat-thrusts. The camera shows the women from Tereza's point of view as she alternately surfaces and dives into the water. The crisp colors and the sharp, seamless editing between the real and the unreal as the camera bobs above and below the water surface makes up in visual appeal for the loss of the inner meaning (explained in the book) of Tereza's hallucination.
Also, the sequence in which Tereza and Tomas photograph the Soviet tanks and troops as they roll into Prague is a breathtaking cinematic tour-de-force. Kaufman and his crew brilliantly integrate archival footage with their own recreation of the Russian invasion -- complete with authentic clothing, props, automobiles, and tanks. Daniel Day-Lewis is even provided with a gold tooth crown that was popular among Czech men at the time. Kaufman's crew maintained such a high degree of accuracy that Kundera, who lived through the invasion, could not distinguish archival footage of the invasion from scenes of Kaufman's recreation. During this sequence, Kaufman integrates virtually every technical aspect of filmmaking -- lighting, photography, editing, sound, color, art direction, acting -- with such astonishing clarity that the sheer cinematic strength of those scenes carries the film in a direction the book never could have.
And the narrative does manage to include some of Kundera's philosophical gems.  Kaufman also deserves accolades for the caring sensitivity with which he brings the nudity and eroticism of the book to the screen. That Kaufman manages to avoid cheap exploitation in an industry that revels at every opportunity to increase box office appeal is in of itself a major accomplishment.
Unfortunately, by the end of the film's 168 minutes, all of the film's inner strengths fail to compensate for the loss of the inner secrets of Kundera's novel. Kundera himself has said that "If the novel has a function, it is to discover the ambiguity of things. My obsession as a novelist is to transform all answers into questions." That ambiguity is, sadly, missing from the screen translation. Kaufman had the blessing of Kundera's intimate involvement and approval of the choices he made while writing the script, and Kaufman also benefited from Kundera's experience with filmmaking (Kundera was once a professor at the Prague National Film School, where Milos Forman was among his students). With all the talent involved in the making of this film, Kaufman has achieved what to him must be a supreme personal triumph. Nevertheless, it is disappointing that one must be familiar with Kundera's novel to fully appreciate the qualities that made the story of Tomas, Tereza, Sabina, and Prague so memorably special.
Filmography of Philip Kaufman:
GOLDSTEIN [Co-director with Benjamin Manaster] 1965 85 mins. FEARLESS FRANK 1969 79 mins. THE GREAT NORTHFIELD, MINNESOTA RAID 1971 91 mins. THE WHITE DAWN 1974 110 mins. INVASION OF THE BODY SNATCHERS 1978 115 mins. THE WANDERERS 1979 117 mins. THE RIGHT STUFF 1983 192 mins. THE UNBEARABLE LIGHTNESS OF BEING 1988 168 mins.
As is undoubtedly apparent from the filmography, THE UNBEARABLE LIGHTNESS OF BEING is a departure from the material that Philip Kaufman has previously worked on (except, perhaps, for his 1983 adaptation of Tom Wolfe's bestseller). His films have only recently begun to attract critical attention.
Manavendra K. Thakur {rutgers,decvax!genrad,ihnp4}!mit-eddie!thakur<EMAIL_ADDRESS><EMAIL_ADDRESS>The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


Home
Featured
Achievements
Skills
Experience
Contact
print("Hello, World")
Aditya Ajay Chandavale
| Software Developer | Machine Learning Enthusiast |


Turkey-based Isaac Cofie becomes father for third time- baby girl christened Brianna Serwaa
Ghana midfielder Isaac Cofie has welcomed the birth of his third child after his wife Catherine Nyarko successfully delivered a baby girl.
The Sivasspor midfielder posted a picture of him and the baby with the inscription: ''New addition to the Cofie family! Both her and her mom are all great.''
Brianna Serwaa Cofie was born on the 10 November, 2019 in Modena at the Policlinico di Modena hospital.
She is his second daughter after first born Adelaide who is followed by a boy named Darren Andrea.
Cofie married Catherine on 28 December, 2013.
The 28 year old is currently in Italy with his agent Oliver Arthur, who paid Isaac a visit upon hearing the news.
By Richard Gyasi


| PostgreSQL 9.0.10 Documentation | ||||
|---|---|---|---|---|
| Prev | Up | Appendix E. Release Notes | Next |
Release Date: 2011-12-05
This release contains a variety of fixes from 8.2.22. For information about new features in the 8.2 major release, see Section E.72.
This is expected to be the last PostgreSQL release in the 8.2.X series. Users are encouraged to update to a newer release branch soon.
A dump/restore is not required for those running 8.2.X.
However, a longstanding error was discovered in the definition of the information_schema.referential_constraints view. If you rely on correct results from that view, you should replace its definition as explained in the first changelog item below.
Also, if you are upgrading from a version earlier than 8.2.14, see the release notes for 8.2.14.
Fix bugs in information_schema.referential_constraints view (Tom Lane)
This view was being insufficiently careful about matching the foreign-key constraint to the depended-on primary or unique key constraint. That could result in failure to show a foreign key constraint at all, or showing it multiple times, or claiming that it depends on a different constraint than the one it really does.
Since the view definition is installed by initdb, merely upgrading will not fix the problem. If you need to fix this in an existing installation, you can (as a superuser) drop the information_schema schema then re-create it by sourcing SHAREDIR/information_schema.sql. (Run pg_config --sharedir if you're uncertain where SHAREDIR is.) This must be repeated in each database to be fixed.
Fix TOAST-related data corruption during CREATE TABLE dest AS SELECT * FROM src or INSERT INTO dest SELECT * FROM src (Tom Lane)
If a table has been modified by ALTER TABLE ADD COLUMN, attempts to copy its data verbatim to another table could produce corrupt results in certain corner cases. The problem can only manifest in this precise form in 8.4 and later, but we patched earlier versions as well in case there are other code paths that could trigger the same bug.
Fix race condition during toast table access from stale syscache entries (Tom Lane)
The typical symptom was transient errors like "missing chunk number 0 for toast value NNNNN in pg_toast_2619", where the cited toast table would always belong to a system catalog.
Improve locale support in money type's input and output (Tom Lane)
Aside from not supporting all standard lc_monetary formatting options, the input and output functions were inconsistent, meaning there were locales in which dumped money values could not be re-read.
Don't let transform_null_equals affect CASE foo WHEN NULL ... constructs (Heikki Linnakangas)
transform_null_equals is only supposed to affect foo = NULL expressions written directly by the user, not equality checks generated internally by this form of CASE.
Change foreign-key trigger creation order to better support self-referential foreign keys (Tom Lane)
For a cascading foreign key that references its own table, a row update will fire both the ON UPDATE trigger and the CHECK trigger as one event. The ON UPDATE trigger must execute first, else the CHECK will check a non-final state of the row and possibly throw an inappropriate error. However, the firing order of these triggers is determined by their names, which generally sort in creation order since the triggers have auto-generated names following the convention "RI_ConstraintTrigger_NNNN". A proper fix would require modifying that convention, which we will do in 9.2, but it seems risky to change it in existing releases. So this patch just changes the creation order of the triggers. Users encountering this type of error should drop and re-create the foreign key constraint to get its triggers into the right order.
Preserve blank lines within commands in psql's command history (Robert Haas)
The former behavior could cause problems if an empty line was removed from within a string literal, for example.
Use the preferred version of xsubpp to build PL/Perl, not necessarily the operating system's main copy (David Wheeler and Alex Hunsaker)
Honor query cancel interrupts promptly in pgstatindex()
(Robert Haas)
Ensure VPATH builds properly install all server header files (Peter Eisentraut)
Shorten file names reported in verbose error messages (Peter Eisentraut)
Regular builds have always reported just the name of the C file containing the error message call, but VPATH builds formerly reported an absolute path name.
Fix interpretation of Windows timezone names for Central America (Tom Lane)
Map "Central America Standard Time" to CST6, not CST6CDT, because DST is generally not observed anywhere in Central America.
Update time zone data files to tzdata release 2011n for DST law changes in Brazil, Cuba, Fiji, Palestine, Russia, and Samoa; also historical corrections for Alaska and British East Africa.


--- layout: post tags: [Software Design] date: 2011-05-27 13:21:06 UTC title: "Design Smell: Redundant Required Attribute" description: "If a value is a required part of an object, make it a constructor argument. A declarative attribute is redundant and unsafe." --- {% include JB/setup %}
This post is the fourth in a series about Poka-yoke Design - also known as encapsulation.
Recently I saw this apparently enthusiastic tweet reporting from some Microsoft technology event:
I imagine that it must look something like this:
public class Smell { [Required] public int Id { get; set; } }
Every time I see something like this I die a little inside. If you already read my previous posts it should by now be painfully clear why this breaks encapsulation. Despite the [Required] attribute there's no guarantee that the Id property will ever be assigned a value.
Code like that is not fail-safe.
I understand that the attribute mentioned in the above tweet is intended to signal to some tool (probably EF) that the property must be mapped to a database schema as non-nullable, but it's still redundant. Attributes are not the correct way to make a statement about invariants.
The [Required] attribute is redundant because there's a much better way to state that a piece of data is required. This has been possible since .NET 1.0. Here's the Poka-yoke version of that same statement:
public class Fragrance { private readonly int id; public Fragrance(int id) { this.id = id; } public int Id { get { return this.id; } } }
This simple structural design ensures that the ID truly is required (and if the ID can only be positive a Guard Clause can be added). An instance of Fragrance can only be created with an ID. Since this is a structural construction, the compiler can enforce the requirement, giving us rapid feedback.
I do realize that the [Required] attribute mentioned above is intended to address the challenge of mapping objects to relational data and rendering, but instead of closing the impedance mismatch gap, it widens it. Instead of introducing yet another redundant attribute the team should have made their tool understand simple idioms for encapsulation like the one above.
This isn't at all hard to do. As an example, DI Containers thrive on structural information encoded into constructors (this is called Auto-wiring). The team behind the [Required] attribute could have done that as well. The [Required] attribute is a primitive and toxic hack.
This is the major reason I never expect to use EF. It forces developers to break encapsulation, which is a principle upon which I refuse to compromise.
Comments
It is true that most code-to-schema-mapping-tools, including EF code-first, Fluent NHibernate, and others, will infer non-nullability from [Required] if it happens to be present on a type which is actually nullable. Why shouldn't they? I realize it's cool for the hip kids to flame EF at every opportunity, but good grief, it didn't cause the tornadoes in Memphis, and it didn't create (nor does it "require") [Required]...
The documentation makes the intended purpose of the attribute clear:
"The RequiredAttribute attribute specifies that when a field on a form is validated, the field must contain a value. A validation exception is raised if the property is null, contains an empty string (""), or contains only white-space characters."
Your "imagined" code example is indeed redundant even in the case where someone is trying to create a non-nullable DB field instead of using the attribute for its intended purpose, because integer properties, being value types, are always mapped to non-nullable fields, with or without [Required]. One must use "int?" to get a nullable DB field; [Required] has no effect on "int" at all. (Indeed, the MVC framework, e.g., treats [Required] and value types exactly the same.)
Now, let's consider the actual purpose of required, per the documentation, and see if it's redundant. Consider a view model with two "required" strings. The business requirement is that if either one or both of them do not contain a non-empty string, the web page should highlight the editors in red and display an appropriate message to the user. One could write a parameterized constructor and throw if they're not present, per your example, but you only get one chance to throw an exception, so you would have to handle three separate cases: The first field missing, the second field missing, or both fields missing. Better to use a validation framework which handles all of these cases for you -- which is exactly what [Required] is intended for.
I would argue that such a parameterized constructor with one or more throws is the wrong design in this scenario, because view models must be able to cope with the task of re-displaying invalid data entered by the user so that the user can correct her mistakes. In contrast to a business object, it must be able to hold and report on invalid states.
This whole series of posts about Poka-yoke Design are about encapsulation, which is an object-oriented principle. And yes: when it comes to OOD I'd never use EF (or any other ORM) if it requires me to break encapsulation.
However, it would be a grave mistake if we let UI concerns drive the design of our domain models. Thus, as soon as we know that we have a case of valid input data on our hands, we must translate it to a proper encapsulated object. From that point on (including db schema design) an attribute would certainly be redundant.
BTW, don't read to much into the tweet. Perhaps I chose the wrong example, and it was never my intention to thunder particularly at EF. So far, all I've heard about NHibernate indicates to me that it has similar issues with regards to encapsulation.
My personal take on this is that data service interfaces are boundary structures themselves, and should be BOs in the same way that view models shouldn't be BOs, either.


Helpful math¶
Probability and statistics are branches of mathematics.
Algebra¶
\(a^{-n} = \frac{1}{a^{n}}\) \(a^{m/n} = n \sqrt{a^{m}}\) \(a^{1/n} =n \sqrt{a}\) \(a^{mn} = (a^{m})^{n}\) \(\log(x^{-2}) = -2 \log(x)\) \(\log_{a} a^{n} = n\) \(\log(bc) = \log(b) + \log(c)\) \(\log(\frac{1}{b}) = -log(b)\)
Also recall that \(n^{0} = 1, \ 1! = 1, \ 0! = 0\)


SBATrackedItemsLoggingStepObject
open class SBATrackedItemsLoggingStepObject : SBATrackedSelectionStepObject
SBATrackedItemsLoggingStepObject
is a custom table step that can be used to log the same
information about a list of tracked items for each one.
-
Implement the view controller vending in the model with compile flag. This is required so that subclasses can override this method to return a different implementation of the view controller. Note: The task delegate can also override this to return a different view controller.
Declaration
Swift
open func instantiateViewController(with taskPath: RSDTaskPath) -> (UIViewController & RSDStepController)?
-
Override to add the
submit
button for the action.Declaration
Swift
override open func action(for actionType: RSDUIActionType, on step: RSDStep) -> RSDUIAction?
-
Override to return an instance of
SBATrackedLoggingDataSource
.Declaration
Swift
override open func instantiateDataSource(with taskPath: RSDTaskPath, for supportedHints: Set<RSDFormUIHint>) -> RSDTableDataSource?
-
Override to return a collection result that is pre-populated with the a new set of logging objects.
Declaration
Swift
override open func instantiateStepResult() -> RSDResult


Pet Service Request
Building Name *
Enter Date for Pet Service *
First Name *
Last Name *
Apartment # *
Email *
Phone
I approve entry into my home. *
Instructions *
*
These fields are required.


Jennifer
I had a hard time coming up with ways to help out the
community around me. This app reminded me how easy and simple
a small act of kindness can go. Recently, my grand-puppy hurt
his neck. My daughter took him to the vet, and he was put on 6
medications. The next day he (the dog) seemed to be very
stressed out and in a lot of pain. While my daughter was in
school, I took my grand-puppy to the vet for second opinion
Michael
I always thought it would be awkward to step in and help
strangers. What if they didn't want my help? However, this app
challenged me to push past my comfort zone and lend a helping
hand. I saw an older lady struggle in the grocery store to
reach her food item off the top shelf. Nervous she would
reject my help, I offered anyway. She eneded up thanking me
profusely and I was able to make her day a little bit easier.
Russell
I told my mom I couldn't wait to be a grown up so I could help
make a difference in the world. She told me I didnt need to be
a grown up, and I could do things now as a kid! So when I
heard my baby sister Ruby cry, I brought her binky to her, and
helped put it in her mouth.
Noah
When I want to make someone smile, I go to my contact list,
and randomly scroll through it and whoever it lands on I call
them just to check in.


This will only clear the tabs that Tab Memo keeps in it's own history. It doesn't clear your browsing history. All open tabs will remain in Tab Memo's history.
Are you sure you want to continue?
{{ tab.title }}


Motif-Z for peptides with various length
Error! Check the following in the input:
1. Neither data file chosen nor peptide sequences pasted for submission.
2. Data file and pasting peptide sequences in text box cannot be uploaded at the same time.
3. Input errors, for example, Max. peptide length less than or equal to Min. peptide length.
4. Input sequences contain symbols '@#$%^&*' or in wrong format.
Back to Motif-Z Various Length {% endblock %}


status
connect
load behavior set
save behavior set
examples
zoom
150%
125%
100%
75%
50%
25%
Behaviors
new behavior
empty
basic
ui defaults
timer
parent
child
Palette
states
actions
transitions
brush properties
sensor inputs
ui inputs
generators
Waiting for the drawing app to connect to the server. Please check the connection on your iPad.


Research overview
This page is in progress…
Information structure and ellipsis
Projects
- Rasekhi, Vahideh, & Jesse A. Harris (submitted). Processing ambiguous
stripping ellipsis structures in Persian. Talk presented
at Experimental and Corpus-based Approaches to Ellipsis 2019. UC
Davis, CA, July 14 2019.
- Harris, Jesse A., & Katy Carlson. (2019). Correlate not optional:
PP sprouting in ’much less’ ellipsis. Glossa, 4, 1-35.
- Harris, Jesse A. & Katy Carlson (2018).
Information structure preferences in focus-sensitive ellipsis: How defaults persist. Language & Speech, 6, 480–512.
- Carlson, Katy & Jesse A. Harris (2018).
Zero-Adjective Contrast in Much-less Ellipsis: The Advantage for Parallel Syntax. Language, Cognition, & Neuroscience, 1, 77–97.
- Harris, Jesse A. & Katy Carlson (2016).
Keep it local (and final): Remnant preferences for ‘let alone’ ellipsis. Quarterly Journal for Experimental Psychology, 69, 1278–1301.
- Harris, Jesse A. (2016). Processing let alone coordination in silent reading. Lingua, 169, 70–94.
Sluicing and retrieval
Projects
- Harris, Jesse A. (2019).
Alternatives on demand and locality: Resolving discourse-linked wh-phrases in sluiced structures. In: C. Clifton, Jr., J.D. Fodor, & K. Carlson (Eds.), Grammatical Approaches to Language Processing – Essays in Honor of Lyn Frazier (pp. 45-75). Springer Studies in Theoretical Linguistics.
- Harris, Jesse A. (2017).
Semantic selectivity in the retrieval of sluiced sentences: An eye movement study. Poster presented at The 30th Annual CUNY Conference on Human Sentence Processing, Boston, MA, March 30–April 1, 2017.
- Harris, Jesse A. (2015). Structure modulates similarity-based interference in sluicing: An eye- tracking study. Frontiers in Psychology, 6. Encoding and navigating linguistic representations in memory.
Prosodic constraints on syntactic alignment
Projects
- Harris, Jesse A., Sun-Ah Jun, & Adam Royer (in progress). The benefits of putting on a little weight: Recovery from garden path sentences. Ms. UCLA.
- Harris, Jesse A., Alexandra Lawn, & Marju Kaps (2019).
Investigating sound and structure in concert: A pupillometry study of relative clause attachment. In The 41st Annual Meeting of the Cognitive Science Society (pp. 1880-1886). Montreal, QB.
- Harris, Jesse A., & Sun-Ah Jun (2018).
Pupil dilation indexes closure mismatches between prosody and syntax. Poster presented at The 4th Experimental and Theoretical Advances in Prosody (ETAP) conference. Amherst, MA. October 11–13, 2018.
- Harris, Jesse A., Sun-Ah Jun, & Adam J. Royer (2016).
Implicit prosody pulls its weight: Recovery from garden path sentences. In: J. Barnes, A. Brugos, S. Shattuck-Hufnagel, and N. Veilleux (Eds.), Proceedings of Speech Prosody 8 (pp. 207-211). Boston, MA.
- Frazier, Lyn, Charles Clifton, Jr., Katy Carlson, & Jesse A. Harris (2014). Standing alone with prosodic help. Language, Cognition and Neuroscience, 28, 1519-1544.
Perspective shifting
Projects
- Harris, Jesse A. (accepted). Extended
perspective shift and discourse economy in language processing. Frontiers - Special issue on
Perspective Taking in Language.
- Harris, Jesse A. (2014). Signaling
non-speaker commitment in transparent free relatives: A paired speaker-hearer judgment study. In V. Rieser and R. Muller (Eds.), The Proceedings of the 18th Workshop on the Semantics and Pragmatics of Dialogue, pp. 71–79. Edinburgh, Scotland.
- Harris, Jesse A. & Christopher Potts (2011). Predicting
perspectival orientation for appositives. In Proceedings from the 45th Annual Meeting of the Chicago Linguistic Society.
- Harris, Jesse A. & Christopher Potts (2009).
Perspective-shifting with appositives and expressives. Linguistics & Philosophy, 32, 523-552.
- Harris, Jesse A. (2009). Epithets and perspective shift: experimental evidence. In: M. Biezma & J. A. Harris (Eds.), University of Massachusetts Occasional Papers: Papers in Pragmatics. Volume 39, (pp. 49 - 76). GLSA Publishing. Amherst, MA.
Prediction and constraint in sentence processing
Projects
- Harris, Jesse A., & Stephanie Rich (revision in progress). Predicted analyses linger: The case for structural prediction with either-or structures. Ms. UCLA. Poster presented at
CUNY 2017.
- Rich, Stephanie, & Jesse A. Harris. (in progress). Local constraint is inhibited by global context in concessive structures. Ms. UCLA. Poster presented at
CUNY 2018.
- Rich, Stephanie & Jesse A. Harris (in progress). The
limits of forward thinking: Structural prediction with correlative and quantificational both. Talk presented at the Psycholinguistics in Iceland
– Parsing and Prediction (PIPP). Verold, University of Iceland, Reykjavik, June 19–20, 2019.
- Harris, Jesse A., Stephanie Rich, & Ian Rigby (2021). Contextual constraint and lexical competition: Revisiting
biased misperception during reading. Journal of Experimental Psychology: Human Perception and Performance, 47, 81-102.
- Chie Nakamura, Jesse A. Harris, Sun-Ah Jun (2020). Learning to
anticipate contrast with prosody: A Visual world study with L2 learners. Proceedings of the 10th Speech Prosody International Conference.
- Nakamura, Chie, Jesse A. Harris, Sun-Ah Jun, & Yuki Hirose (2019). L2
adaptation to uninformative prosody during structural analysis: A visual world study. In BUCLD 43: Proceedings of the 43rd Boston University Conference on Language Development. Medford, MA: Cascadilla Press.
- Nakamura, Chie, Jesse A.Harris, & Sun-Ah Jun (2018). Cue reliability affects anticipatory use of prosody in processing globally ambiguous sentences. Talk presented at The 31st Annual CUNY Conference on Human Sentence Processing, Davis, CA, March 15–17, 2018.
Event construal
Projects
- Harris, Jesse A., & Natasha Korotkova (2019). Preference for
single events guides perception in Russian: A phoneme restoration study. In the Proceedings of the 54th Chicago Linguistic Society. University of Chicago, IL.
- Harris, Jesse A., Charles Clifton, Jr., & Lyn Frazier (2013).
Processing and domain restriction: Quantificational variability effects. Language and Cognitive Processes, 28, 1519–1544.
- Harris, Jesse A. (2011). Extraction from coordinate structures: Evidence from language processing. In Adams, Nikki et al. (Eds.), Proceedings from the 45th Annual Meeting of the Chicago Linguistic Society (pp. 73–88). Chicago, IL.


| Author: | Eli Bendersky |
|---|---|
| Contact: |<EMAIL_ADDRESS>|
| Date: | 23-Apr-2010 |
Table of Contents
Luz is an open-source CPU suite. Designing and implementing a CPU is not enough - one should have tools to program it. Since no one is willing to bang binary machine code by hand, the lowest tool required to program a CPU is some sort of an assembly language. Luz defines such an assembly language - LASM (Luz Assembly), and comes with a fully functional assembler that compiles assembly source code into an object file. However, for writing non-trivial programs this also isn't enough. Programs frequently consist of several assembly files, together will additional code packaged in libraries and provided by the system or 3rd parties. Therefore, a linker is required to collect all the object files together into an executable. This is why Luz also comes with a linker. The full suite, therefore, can be described by the following diagram:
But wait, aren't programs written in high-level languages these days? Yes, sure, and the Luz suite includes all the support required to program it in a higher-level language. All that's lacking is a compiler from C to LASM. Since Luz has a functional assembler and linker, it can readily support compilation from C. And C can be used to implement everything else. At the moment there's no C compiler for Luz, however, so LASM will have to do.
Luz is a 32-bit RISC CPU. Its design was mostly inspired by MIPS, with some influence from Altera Nios II. In particular, the instruction set of Luz is quite similar to MIPS, and the assembly syntax and directives are very close to the facilities provided by MIPS assemblers.
There are 32 registers in Luz, numbered R0-R31. Each register is 32 bits long. Some registers have special meaning for the CPU:
R0 - Always contains 0. Writes to R0 are ignored. R30 - Reserved for future needs. R31 - Serves as the saved return address in CALL instructions.
When writing Luz assembly code, it is recommended to follow the guidelines for register usage described in (ZZZ - Implicit Hyperlink Target to EABI section on registers use).
Luz is a 32-bit CPU. 32-bit quantities are words. 16-bit quantities are halfwords. 8-bit quantities are bytes.
Luz is little-endian: a word is stored in memory with its least-significant byte in the lower address.
Numeric quantities stored in the registers or instructions of Luz can be treated as either unsigned or signed.
This section presents all the instructions supported by the Luz CPU. Some are not real instructions, but rather pseudo-instructions provided by the assembler and translated into other instructions (marked by (*)).
Some nomenclature:
Rd - destination register Rs, Rt - source operand registers R<n> - general-purpose register number <n> R<n>[i:j] - bits [i:j] (inclusive) of R<n> <- - denotes assignment PC - program counter const<n> - a constant (immediate) <n> bits long Can be a mnemonic constant previously created with .define off<n> - an offset <n> bits long used in load/store instructions. Can be a mnemonic constant previously created with .define Always treated as signed. mem<n> - n-bit access to memory
ADD Rd, Rs, Rt # Rd <- Rs + Rt
Addition is unsigned, without overflow detection. Signed numbers can be added with the same instruction, but the programmer is responsible for taking care of their ranges and possible overflows.
Encoding:
31:26 Opcode = 000000 25:21 Rd 20:16 Rs 15:11 Rt 10:0 reserved
ADDI Rd, Rs, const16 # Rd <- Rs + const16
Addition is unsigned, without overflow detection. Signed numbers can be added with the same instruction, but the programmer is responsible for taking care of their ranges and possible overflows.
The constant is assumed to be unsigned. If you want to add a negative constant, subtract its absolute value instead.
Examples:
addi $r8, $r7, 5 # $r8 <- $r7 + 5 .define TWO, 2 addi $r8, $r7, TWO # $r8 <- $r7 + 2
Encoding:
31:26 Opcode = 100000 25:21 Rd 20:16 Rs 15:0 const16
SUB Rd, Rs, Rt # Rd <- Rs - Rt
Subtraction is unsigned, without overflow detection. Signed numbers can be subtracted with the same instruction, but the programmer is responsible for taking care of their ranges and possible overflows.
Encoding:
31:26 Opcode = 000001 25:21 Rd 20:16 Rs 15:11 Rt 10:0 reserved
SUBI Rd, Rs, const16 # Rd <- Rs - const16
Subtraction is unsigned, without overflow detection. Signed numbers can be added with the same instruction, but the programmer is responsible for taking care of their ranges and possible overflows.
The constant is assumed to be unsigned.
Encoding:
31:26 Opcode = 100001 25:21 Rd 20:16 Rs 15:0 const16
MULU Rd, Rs, Rt
Multiplies Rs and Rt into a 64-bit result. Treats operands as unsigned. The lower 32 bits of the result are placed into Rd, and the higher bits into R<d+1>. If Rd is R31, the higher bits are lost.
Example:
mulu $r8, $r7, $r6 # $r8 <- ($r7 * $r6)[31:0] # $r9 <- ($r7 * $r6)[63:32]
Encoding:
31:26 Opcode = 000010 25:21 Rd 20:16 Rs 15:11 Rt 10:0 reserved
MUL Rd, Rs, Rt
Multiplies Rs and Rt into a 64-bit result. Treats operands as signed. The lower 32 bits of the result are placed into Rd, and the higher bits into R<d+1>. If Rd is R31, the higher bits are lost.
Encoding:
31:26 Opcode = 000010 25:21 Rd 20:16 Rs 15:11 Rt 10:0 reserved
DIVU Rd, Rs, Rt
Divides Rs by Rt. Treats operands as unsigned. The quotient of the division is placed into Rd, and the remainder into R<d+1>. If Rd is R31, the remainder is lost.
Example:
divu $r8, $r7, $r6 # $r8 <- quotient($r7 / $r6) # $r9 <- remainder($r7 / $r6)
Encoding:
31:26 Opcode = 000100 25:21 Rd 20:16 Rs 15:11 Rt 10:0 reserved
DIV Rd, Rs, Rt
Divides Rs by Rt. Treats operands as signed. The quotient of the division is placed into Rd, and the remainder into R<d+1>. If Rd is R31, the remainder is lost.
Encoding:
31:26 Opcode = 000101 25:21 Rd 20:16 Rs 15:11 Rt 10:0 reserved
LUI Rd, const16 # Rd <- const16 << 16
Loads the immediate into the upper halfword of Rd. The lower halfword is set to 0.
Encoding:
31:26 Opcode = 000110 25:21 Rd 20:16 reserved 15:0 const16
LLI Rd, const16 # Rd <- const16
Loads the immediate into the lower halfword of Rd. The upper halfword is set to 0.
Pseudo-instruction, translated to:
ORI Rd, R0, const16
LI Rd, const32 # Rd <- const32
Pseudo-instruction, translated to:
LUI Rd, const32[31:16] ORI Rd, Rd, const32[15:0]
MOVE Rd, Rs # Rd <- Rs
Pseudo-instruction, translated to:
ADD Rd, Rs, R0
SLL Rd, Rs, Rt # Rd <- Rs << Rt[4:0]
Rd is assigned the value of Rs shifted left by the value of the 5 lower bits of Rt. 0 is shifted into the lower bits of Rd.
Encoding:
31:26 Opcode = 000111 25:21 Rd 20:16 Rs 15:11 Rt 10:0 reserved
SLLI Rd, Rs, const16 # Rd <- Rs << const16[4:0]
Rd is assigned the value of Rs shifted left by the value of the 5 lower bits of const16. 0 is shifted into the lower bits of Rd.
Encoding:
31:26 Opcode = 101011 25:21 Rd 20:16 Rs 15:0 const16
SRL Rd, Rs, Rt # Rd <- Rs >> Rt[4:0]
Rd is assigned the value of Rs shifted right by the value of the 5 lower bits of Rt. 0 is shifted into the higher bits of Rd.
Encoding:
31:26 Opcode = 001000 25:21 Rd 20:16 Rs 15:11 Rt 10:0 reserved
SRLI Rd, Rs, const16 # Rd <- Rs >> const16[4:0]
Rd is assigned the value of Rs shifted right by the value of the 5 lower bits of const16. 0 is shifted into the higher bits of Rd.
Encoding:
31:26 Opcode = 101100 25:21 Rd 20:16 Rs 15:0 const16
AND Rd, Rs, Rt # Rd <- Rs & Rt
Bitwise and of the registers Rs and Rt.
Encoding:
31:26 Opcode = 001001 25:21 Rd 20:16 Rs 15:11 Rt 10:0 reserved
ANDI Rd, Rs, const16 # Rd <- Rs & const16
Bitwise and of Rs with the zero-extended immediate.
Encoding:
31:26 Opcode = 101001 25:21 Rd 20:16 Rs 15:0 const16
OR Rd, Rs, Rt # Rd <- Rs | Rt
Bitwise or of the registers Rs and Rt.
Encoding:
31:26 Opcode = 001010 25:21 Rd 20:16 Rs 15:11 Rt 10:0 reserved
ORI Rd, Rs, const16 # Rd <- Rs | const16
Bitwise or of Rs with the zero-extended immediate.
Encoding:
31:26 Opcode = 101010 25:21 Rd 20:16 Rs 15:0 const16
NOR Rd, Rs, Rt # Rd <- ~(Rs | Rt)
Bitwise nor of the registers Rs and Rt.
Encoding:
31:26 Opcode = 001011 25:21 Rd 20:16 Rs 15:11 Rt 10:0 reserved
XOR Rd, Rs, Rt # Rd <- Rs ^ Rt
Bitwise xor of the registers Rs and Rt.
Encoding:
31:26 Opcode = 001100 25:21 Rd 20:16 Rs 15:11 Rt 10:0 reserved
LB Rd, off16(Rs) # Rd <- mem8(Rs + off16)
Load byte from memory into the lower byte of Rd. Sign-extend into the higher bits.
Encoding:
31:26 Opcode = 001101 25:21 Rd 20:16 Rs 15:0 off16
LBU Rd, off16(Rs) # Rd <- mem8(Rs + off16)
Load byte from memory into the lower byte of Rd. Zero-extend into the higher bits.
Encoding:
31:26 Opcode = 010000 25:21 Rd 20:16 Rs 15:0 off16
LH Rd, off16(Rs) # Rd <- mem16(Rs + off16)
Load halfword from memory into the lower halfword of Rd. Sign-extend into the higher bits.
Encoding:
31:26 Opcode = 001110 25:21 Rd 20:16 Rs 15:0 off16
LHU Rd, off16(Rs) # Rd <- mem16(Rs + off16)
Load halfword from memory into the lower halfword of Rd. Zero-extend into the higher bits.
Encoding:
31:26 Opcode = 010001 25:21 Rd 20:16 Rs 15:0 off16
LW Rd, off16(Rs) # Rd <- mem32(Rs + off16)
Load word from memory into Rd.
Encoding:
31:26 Opcode = 001111 25:21 Rd 20:16 Rs 15:0 off16
SB Rs, off16(Rd) # mem8(Rd + off16) <- Rs[7:0]
Store the lower byte of Rs into memory.
Encoding:
31:26 Opcode = 010010 25:21 Rd 20:16 Rs 15:0 off16
SH Rs, off16(Rd) # mem16(Rd + off16) <- Rs[15:0]
Store the lower halfword of Rs into memory.
Encoding:
31:26 Opcode = 010011 25:21 Rd 20:16 Rs 15:0 off16
SW Rs, off16(Rd) # mem32(Rd + off16) <- Rs[31:0]
Store the Rs into memory.
Encoding:
31:26 Opcode = 010100 25:21 Rd 20:16 Rs 15:0 off16
JR Rd # PC <- Rd
Jump to the address stored in Rd.
Encoding:
31:26 Opcode = 010110 25:21 Rd 20:0 reserved
CALL const26 # R31 <- PC + 4; PC <- const26 * 4
Procedure call. Save the address of the next instruction in R31 and jump unconditionally to the address const26 * 4 (instructions are aligned on word boundaries). const26 is treated as unsigned.
Encoding:
31:26 Opcode = 011101 25:0 const26
B off26 # PC <- PC + off26 * 4
The offset is relative to the program counter. off26 is treated as signed.
Encoding:
31:26 Opcode = 010101 25:0 off26
BEQ Rd, Rs, off16 # if Rd == Rs then PC <- PC + off16 * 4
The offset is relative to the program counter. off16 is treated as signed.
Encoding:
31:26 Opcode = 010111 25:21 Rd 20:16 Rs 15:0 off16
BEQZ Rd, off16 # if Rd == 0 then PC <- PC + off16 * 4
Pseudo-instruction, translated to:
BEQ Rd, R0, off16
BNE Rd, Rs, off16 # if Rd != Rs then PC <- PC + off16 * 4
The offset is relative to the program counter. off16 is treated as signed.
Encoding:
31:26 Opcode = 011000 25:21 Rd 20:16 Rs 15:0 off16
BNEZ Rd, off16 # if Rd != 0 then PC <- PC + off16 * 4
Pseudo-instruction, translated to:
BNE Rd, R0, off16
BGE Rd, Rs, off16 # if Rd >= Rs then PC <- PC + off16 * 4
The comparison operands are treated as signed. The offset is relative to the program counter. off16 is treated as signed.
Encoding:
31:26 Opcode = 011001 25:21 Rd 20:16 Rs 15:0 off16
BGEU Rd, Rs, off16 # if Rd >= Rs then PC <- PC + off16 * 4
The comparison operands are treated as unsigned. The offset is relative to the program counter. off16 is treated as signed.
Encoding:
31:26 Opcode = 100010 25:21 Rd 20:16 Rs 15:0 off16
BGT Rd, Rs, off16 # if Rd > Rs then PC <- PC + off16 * 4
The comparison operands are treated as signed. The offset is relative to the program counter. off16 is treated as signed.
Encoding:
31:26 Opcode = 011010 25:21 Rd 20:16 Rs 15:0 off16
BGTU Rd, Rs, off16 # if Rd > Rs then PC <- PC + off16 * 4
The comparison operands are treated as unsigned. The offset is relative to the program counter. off16 is treated as signed.
Encoding:
31:26 Opcode = 100011 25:21 Rd 20:16 Rs 15:0 off16
BLE Rd, Rs, off16 # if Rd <= Rs then PC <- PC + off16 * 4
The comparison operands are treated as signed. The offset is relative to the program counter. off16 is treated as signed.
Encoding:
31:26 Opcode = 011011 25:21 Rd 20:16 Rs 15:0 off16
BLEU Rd, Rs, off16 # if Rd <= Rs then PC <- PC + off16 * 4
The comparison operands are treated as unsigned. The offset is relative to the program counter. off16 is treated as signed.
Encoding:
31:26 Opcode = 100100 25:21 Rd 20:16 Rs 15:0 off16
BLT Rd, Rs, off16 # if Rd < Rs then PC <- PC + off16 * 4
The comparison operands are treated as signed. The offset is relative to the program counter. off16 is treated as signed.
Encoding:
31:26 Opcode = 011100 25:21 Rd 20:16 Rs 15:0 off16
BLTU Rd, Rs, off16 # if Rd < Rs then PC <- PC + off16 * 4
The comparison operands are treated as unsigned. The offset is relative to the program counter. off16 is treated as signed.
Encoding:
31:26 Opcode = 100101 25:21 Rd 20:16 Rs 15:0 off16
ERET # PC <- saved exception return address
Returns from an exception handler. The PC is set to the address from which the CPU will resume execution (this address is saved internally by the CPU when an exception occurs).
HALT
Halts the CPU. A hardware 'halt' line is asserted, and the CPU has to be reset to run again.
Encoding:
31:26 Opcode = 111111 25:0 reserved


Because HTML has angular brackets and "ng" sounds like "angular".
No, <angular/> is not an HTML5 tag. angular is an orthogonal project to HTML5; you can use the two together.
No, angular is none of these. You don't call its functions, it does not call your functions, it does not provide a way to manipulate DOM, but does provide primitives to create UI projections of your data. There are lots of existing widget libraries which you can integrate with angular. It is 100% JavaScript, 100% client side and compatible with both desktop and mobile browsers.
Like with any technology, angular is not impervious to attack. angular does, however, provide built-in protection from basic security holes including cross-site scripting and HTML injection attacks. angular does round-trip escaping on all strings for you.
Yes. See instructions in downloading.
 But there is one important reason why angular templating system is different and makes it very good fit for application development: bidirectional data binding. The template is compiled on the browser and the compilation step produces a live view. This means you, the developer, don't need to write code to constantly sync the view with the model and the model with the view as in other templating systems.
Webkit-based browsers (Safari, Chrome, iPhone, Android, WebOS, BlackBerry 6), Firefox, IE6 and above. Note that CSS only works on IE7 and above.
angular takes ~300ms to load, render, and compile. In Chrome it uses about 2-5MB of memory. Your app's performance will vary depending on how many bindings you use.
The size of the library itself is < 50KB compressed and obfuscated.
Yes, you can use widgets from the Closure Library in angular.
Yes, angular uses jQuery, the open source DOM manipulation library.
If jQuery is not present in your script path, angular falls back on its own implementation of
jQuery lite
. If jQuery is present in the path, angular uses it to
manipulate the DOM.
Very testable. It has an integrated dependency injection framework. See
service
for details.
Watch the July 28, 2010 talk "Angular: A Radically Different Way of Building AJAX Apps".
The MIT License.


WITNESS LIST State Cultural and Recreational Resources Committee April 8, 2003-2:00P HB 505 For: Lloyd, Margaret (Scenic Texas) Against: Clark, Jeff (National Federation of Independent Business (NFIB)) Ford, Curtis (Self) Herrick, Charles (Self) Reagan, Billy (Self) St. Romain, Jane (St. Romain Outdoor) Vela, Lee (Clear Channel Outdoor & Outdoor Advertising Assoc. of TX) On: Anderson, Tim (Texas Department of Transportation) HB 994 For: Huber, Karen (Self) January-Bevers, Deborah (Greater Houston Partnership) Lloyd, Margaret (Bill Ware) Lloyd, Margaret (Bruce Wilke) Lloyd, Margaret (Scenic Texas & The Scenic Coalition) Shaddock, Carroll (Scenic Texas, Inc.) Against: Clark, Jeffrey (National Federation of Independent Business - NFIB) Ford, Curtis (Self) Herrick, Charles (Self) Jividen, Kyle C. (Self) Poole, Mike (Media Outdoor Advertising, Inc. & Benchmark Outdoor) St. Romain, Jane (Self) Vela, Lee (Clear Channel Outdoor & Outdoor Adv. Assoc. of Texas) On: Anderson, Tim (TXDOT) HB 1414 On: Young, Larry E. (Texas Parks & Wildlife Dept.) HB 1764 On: Dolman, Wilson E. (Texas Parks & Wildlife Dept.) HB 1989 On: Anderson, Dwayne "Sparky" (Clean Water Action) Cook, Robert L. (TX Parks & Wildlife Dept.) Durocher, Philip P. (Texas Parks & Wildlife) HB 2159 For: Garza, Makateonenodua Raul (Self) Garza, Jr., Isidro (Self) Against: Gilleland, Ellis (Self and "Texas - Animals") On: Sinclair, David (Texas Parks and Wildlife) HB 2470 For: Giles, Luke (Coastal Conservation Association Texas) Murray, Pat (Coastal Conservation Association Texas) HB 2471 On: Dike, Jerry (Texas Dept. of Transportation) HB 2582 For: Floyd, Robert (Texas Music Educators Assc. & Texas Coalition for Quality Arts Education) Orr, Bruce (Patricia Porter, Executive Director North Texas Business Committee for the Arts) Orr, Bruce (Rene Lawrence) Orr, Bruce (Self and Texas Music Project) On: Hernandez, Ricardo (Texas Commission on the Arts) HB 2779 For: Bristol, George L. (Texas Coalition for Conservation) Hess, Myron (National Wildlife Federation) Sybert, Brian (Sierra Club, Lone Star Chapter) HB 2900 On: Richlen, Craig (Texas Parks & Wildlife) HB 2926 For: Malone, Rod (Boating Trades Assoc. of Texas) HJR 89 For: Bristol, George L. (Texas Coalition for Conservation) Sybert, Brian (Sierra Club, Lonestar Chapter)


I’ve been spending a lot of time designing a new OO syntax for the Perl language called Corinna. This syntax is not designed to be another object-oriented module. Instead, it’s designed to be a be a core part of the language. It’s received a lot of support (and a few detractors), but I have a problem with it.
Lately I’ve been worried about the slot variable :builder
attribute and I’ve
been concerned that it’s problematic. I’ve nattered on about this on IRC and
just generally let the concerns simmer in my mind. If we’re going to get to
propose something for the core, it’s better that we avoid mistakes before that
time rather than after. Then Damian Conway shared some thoughts with me about
his concerns for :builder
and that was the final straw. Something has to
change.
History
As part of our proposal, we have this:
class SomeClass {
has $x :builder;
method _build_x () {
return rand;
}
}
If you call SomeClass->new
, you’ll get a random numeric value assigned to
the $x
slot variable. Note that $x
has no reader or writer, so it’s
designed to be completely encapsulated. But it’s not and that’s a problem.
That’s been bugging me for quite a while, but to explain that, I need to go back in time.
In 1967 (my birth year, but I swear it’s a coincidence), the first truly class-based OO language was released, Simula 67 and it introduced classes, polymorphism, encapsulation, and inheritance (and coroutines (!), but let’s not go there).
Classes, polymorphism, and encapsulation are relatively uncontroversial, but the debate over inheritance has raged for decades.
Alan Kay, the man who invented the term “Object Oriented” in Utah “sometime after 1966” and who’s been doing OO programming before most of us were born, has made it clear over the years that inheritance in OO is very problematic. He’s even left it out of the implementation of some OO languages he’s created. And then I found a Quora question entitled “What does Alan Kay think about inheritance in object-oriented programming?” and someone purporting to be Alan Kay responded with a deeply thoughtful answer. His first paragraph is fantastic (emphasis mine):
Simula I didn’t have inheritance (paper ca 1966) and Simula 67 did (paper ca 1968 or so). I initially liked the idea — it could be useful — but soon realized that something that would be “mathematically binding” was really needed because the mechanism itself let too many semantically different things to be “done” (aka “kluged”) by the programmer. For example, there is no restriction of any kind to have a subclass resemble a superclass, be a refinement of a superclass, etc. All relies on the cleanliness of mind of programmers (and even the most clean of these often just do things they need when in the throes of debugging).
In other words, if I create a class named Vehicle::Motorized
, there is
nothing to stop your Order::Customer
class from inheriting from it. Would
that make sense? Probably not. But there we are.
Next, let’s take a look at a Python object:
class Point:
def __init__(self, x, y):
self.x = x
self.y = y
def inverse(self):
return Point(self.y,self.x)
point = Point(7,3.2).inverse()
print(point.x)
point.x = "foo"
And for those who would like to see that in our current proposal:
class Point {
has ($x,$y) :reader :writer :new;
method inverse {
return $class->new( x => $y, y => $x );
}
}
my $point = Point->new( x => y => 3.2 )->inverse;
say $point->x;
$point->x("foo");
As you can see, we’ve assigned “foo” to the x value of a Point object. We’ve done this in both Python and our new OO syntax for Perl. Sadly, due to the need to harmonize types across the language, we can’t have type constraints in v0.1.0. This is a serious limitation, but we’re taking baby steps.
But what about the Python version? Surely they must validate their data, right? No. Pythonistas have assured me that validating your data is very unpythonic .
(I envision spit-takes from tons of Moo/se fans out there right now).
Python 3.7 contains data classes and those will help, but I don’t know how widespread the usage is.
Variables and Types
But what does that have to do with inheritance?
For many languages, you can try something like (example in the Go programming
language) var myvar float64 = "foo"
and it will throw an exception. It might
be compile-time. It might be runtime.
Why is that? Because on line 372 of your whopping huge function, it’s easy
to have something like myvar := stuff[0:2]
and not be sure what kind of data
stuff[0:2]
contains.
So we can say that—for a small subset of types the programming language can understand—variables in those kinds of languages are the “experts” about what they can do and if you try to put that variable in an invalid state, it blows up.
That’s great. But what about var celsius float64 = -1300.15
. Is that valid?
Absolute zero is -273.15 on the Celsius scale, so we can make a reasonable argument that the above is not valid. In languages like Raku , we easily fix that:
subset Celsius of Num where * >= -273.15;
my Celsius $temp = -1300.15;
The above will fail at compile-time. Most languages that allow types, however, aren’t quite as flexible, but you can use classes instead.
Classes are Types
my $temp = Celsius->new( temperature => -1300.15 );
Assuming your class is sane, the above should throw an exception because you’re trying to create an object with an invalid state.
If you think that’s similar to how built-in types work, it is. We can think of a class as a user-defined type. Types have a set of allowed values and operators you can apply to those values. Classes have (often complex) sets of allowed values and methods (operators) you can apply to those values.
Just as an int
is often an expert in values -32,768 to 32,767, or
-2,147,483,648 to 2,147,483,647 if you’re using 4 bytes (larger values for
more bytes, of course), so is your Celsius
class an expert about allowed
Celsius temperatures. And your Personal
Shopper knows exactly how much
money it can spend, and even if it knows you have enough money to buy cocaine,
it’s still going to throw an exception if you request that because it’s an
illegal operation.
The Problem with :builder
And this gets us to :builder
. In Perl‘s Moo/se family of OO, you can do
something similar to this (but using our new syntax):
class Parent {
has $x :builder;
method _build_x () {
return rand;
}
}
class Child isa Parent {
method _build_x () { return "not a number" }
}
This has exactly the same issue with see with Python’s point.x = "foo"
. It’s
hardly necessary to belabor the point, but I will: $x
is supposed to be
private, but we’ve grossly violated encapsulation.
Ah, you reply. But Moo/se has types. So let’s look at Moo/se, using a better example (not great, but enough to get the point across):
package Collection {
use Moose;
# this is a personal module which gives me a "saner" Perl
# environment
use Less::Boilerplate;
use Types::Standard qw(Int ArrayRef);
has _index => (
is => 'rw',
isa => Int->where('$_ >= 0'),
builder => '_build__index',
);
# default, but maybe someone wants a different default
sub _build__index { 0 }
has items => (
is => 'ro',
isa => ArrayRef,
required => 1,
);
sub BUILD ( $self, @ ) {
my @items = $self->items->@*;
my $type = ref $items[0];
foreach my $item (@items) {
if ( not defined $item ) {
croak("items() does not allow undefined values");
}
if ( ref $item ne $type ) {
croak("All items in collection must be of the same type");
}
}
}
sub num_items ($self) {
return scalar $self->items->@*;
}
sub next ($self) {
my $i = $self->_index;
return if $i >= $self->num_items;
$self->_index( $i + 1 );
return $self->items->[$i];
}
sub reset ($self) {
$self->_index(0);
}
}
It goes without saying that writing an iterator like the above can be rather
problematic for a number of reasons, and yes, the _build__index
method is
kind of silly, but it shows the issue. For example, what would a negative
index do? In the above, it would throw an exception because of the
Int->where( '$_ >= 0' )
constraint. But what would happen if we set the
index to a value larger than the size of the items
array reference (and
ignoring that the above allows $coll->_index($integer)
).
package My::Collection {
use Moose;
extends 'Collection';
sub _build__index { 5 }
}
my $collection = My::Collection->new( items => [qw/foo bar baz/] );
while ( defined( my $item = $collection->next ) ) {
say $item;
}
What do you think the above does? The constraint passes, but it prints nothing. That’s because the allowed value of the index is tightly coupled to something else in that class, the number of items in the collection.
Oh, but Ovid, I wouldn’t write something like that!
Yes, you would. I do it too. We all do it when we’re quickly hacking on that 883 line class from our 1,000 KLOC codebase and we’re rushing to beat our sprint deadline. Programmers do this all the time because we have a language which allows this, but OO modules which encourage this. You can inspect tons of OO modules and find attributes (a.k.a “slot variables” in our new system) which are coupled with other values. We like to minimize that, but sometimes we can’t and classes are supposed to encapsulate this problem and handle it internally.
My suggestion is that, if you want to allow this internally, you have to do it
manually with the ADJUST
phaser .
class Collection {
has $index;
has $items :new;
ADJUST (%args) {
# other checks here
$index = $self->_default_index;
if ( $index > $items->@* - 1 ) {
# don't let subclasses break our code
croak(...);
}
}
method _default_index () { 0 }
# other methods here
}
Do I recommend that? No. Can you do it? Yes. And it has some advantages.
First, you are being explicit about which slots are can access in your subclasses. Second, you have fine-grained control over slot initialization ordering.
By default, with Corinna, slots are initialized in the order declared (until
you hit :new
, in which case all :new
slots are initialized at once). In
Moo/se it’s harder to predict the order of initialization. That’s why you
often see a bunch of attributes declared as lazy
to ensure that non-lazy
attributes are set first. If you have circular lazy dependencies, it can be
hard to work out and you fall back to BUILD
or BUILDARGS
as needed.
Yes, this does mean a touch more work on the off chance you need to override a
slot in a subclass. I’ve been writing Moo/se for years and I can count on the
fingers of one hand the number of times I’ve needed to do this. However, I
can’t count how many times I’ve unnecesssarily littered my namespace with sub
_build...
methods because this is largely what Moo/se prefers and what
developers will call you out on in code reviews if you do it some other way.
Oh, and we also hit issues like this. Which of these is correct?
class Position {
slot $x :name(ordinate) :builder;
# and many lines later...
method _build_ordinate { return rand } # Does the builder follow the public slot name?
}
class Position {
slot $x :name(ordinate) :builder;
# and many lines later...
method _build_x { return rand } # Or does it follow the private slot variable name?
}
If we were to allow builders, we should, at least, mandate the syntax
:builder($method_name)
and not allow default builder names.
Builder Guidelines
So here are a few guidelines we should follow for assigning default values to slots.
- Every slot should have a default value.
It is often a code smell to have an undefined slot.
- Use the = default syntax
In the example below, :new
says we can pass the value to the constructor,
but if we don’t, it will get the value 42.
has $x :new = 42;
- YAGNI (You Ain’t Gonna Need It).
Don’t allow overriding a private slot value unless you have a clear need for
it. This also prevents littering the namespace with a _build_...
methods.
- Liskov is your friend
Remember the Liskov Substitution Principle : if you have a subclass and it must be allowed to override some of this data, remember that a subclass should be a more specialized version of a parent class and must be usable anywhere the parent can be.
- Check for coupling
If the slot data is tightly coupled to some other slot data, consider breaking
the coupling or ask yourself if delegation is more appropriate. Have checks in
BUILD
(Moo/se) or ADJUST
(Corinna) to verify the integrity of your class.
If all of the above seems like too much to remember, just don’t allow child classes to set parent slot data. Corinna should follow one of the early principles guiding its design: you should be allowed to do bad things, but the language design shouldn’t encourage bad things.


{{currentCode.desc}}
Import Demo
{{code.desc}}
New
Save
Delete
Save As ...
Run
@args String who\nHello @who!
Note: you can use
sample model classes
and most JDK classes as argument types
{"who": "Rythm"}
{{result.error}}


This realm is automatically rotating verification certificate signing keys. If desired, you can revert to manual key rotation.
Enable automatic key rotation. It is possible to have the system automatically rotate your verification certificate signing key. This is highly recommended, but requires that your key server is configured using the JWKS public key discover doc. Enable automatic verification certificate key rotation.
To manual rotate your verification certificate signing key:
- Create a new key by clicking the button below.
- Communicate that key version and public key to your key server operator.
- Activate the new key in this system.
| Key ID | Public key |
|---|---|
| {{$rk.GetKID}} {{if $rk.Active}}Active{{end}} |
{{template "clippy" $rk.GetKID}}
Backed by:
{{template "clippy" (printf "key-%d" $rk.ID)}}
Your server operator may ask for this.
{{if not $realm.AutoRotateCertificateKey}}
{{if not $rk.Active}}
{{end}}
{{end}}
|
This server does not support per-realm signing keys - contact the server operator for more information.
{{end}}


Definitions
Arend supports the following kinds of definitions: functions, data, records, classes, instances, and coercions. Every definition has a name which must be a valid identifier as described in Lexical structure.
Definitions can be referred by defcall expressions. If def is a name of a definition, defcall is an expression of the form: def e_1 … e_n, where e_1, …, e_n are expressions. Expressions e_1, …, e_n are called arguments of the defcall.
There are alternative notations in case a defcall has precisely one or two arguments. In case of two arguments, it is possible to use the infix notation: def e_1 e_2 is equivalent to e_1 `def` e_2. In case of one argument, it is possible to use the postfix notation: def e_1 is equivalent to e_1 `def.
Precedence
The parsing of complex defcall expressions, containing several infix and postfix notations, is regulated by precedence of involved definitions: their priority and the type of associativity. Precedence of a definition can be specified by writing FIX N just before the name of the definition, where FIX is one of keywords \fixl, \fixr or \fix, which mark the definition as left, right associative or non-associative respectively, and N is the priority, which is an integer between 1 and 9. For example, \func \fixl 3 op (a b : Nat) => 0 defines a binary function named op which is left associative with priority 3. The default precedence is \fixr 10.
If op1 and op2 are two definitions and e1, e2, e3 are expressions, the expression e1 `op1` e2 `op2` e3 is parsed according to the following rules:
- If priorities of op1 and op2 are different and, say, the priority of op1 is higher, then the expression is parsed as (e1 `op1` e2) `op2` e3.
- Assume priorities of op1 and op2 are the same. If they are both left or both right associative, the expression is parsed as (e1 `op1` e2) `op2` e3 or e1 `op1` (e2 `op2` e3) respectively. If op1 and op2 have different types of associativity or are non-associative, then the parsing error is generated.
Infix operators
A definition can be labeled as an infix operator.
This means that its defcalls are parsed as infix notations even without ` `
.
An infix operator is defined by specifying one of keywords \infixl, \infixr, \infix before the name of operator.
These keywords have the same syntax and semantics as keywords \fixl, \fixr, and \fix, which are described above.
An infix operator can be used in the prefix form as an ordinary definition. For example, if the function + is defined as \infixl 6 +, then it is allowed to write either + 1 2 or 1 + 2; these expressions are equivalent.
Finally, if f is an infix operator or an operator surrounded with ` `
, then it is allowed to write e f and
this is equivalent to f e.
For example, the function that adds 1 to its argument can be written either as 1 + or as + 1.
The result of application of the first function to 2 is 1 + 2, the result of application of the second one to 2
is + 1 2, and as noted before these expressions are equivalent.
As noted above, it is possible to use a left section of an operator, that is x + is equivalent to \lam y => x + y. It is also possible to use right sections: if a postfix notation is applied to an argument from the right as in `+ y, then such an expression is equivalent to \lam x => x + y.
Aliases
An alias is an alternative name for the definition.
It can be specified by putting \alias aliasName after the name of a definition.
The definition itself and its alias can be used interchangeably.
Aliases can have their own precedence which is specified before the alias name.
Aliases can also contain unicode symbols between U+2200
and U+22FF
.


--- layout: post permalink: campusbookrentalscom.html Tags: Array NameOfCoupon: CampusBookRentals.com Cash Back Summary: See our CampusBookRentals.com Coupon Code, CampusBookRentals.com Rebate, CampusBookRentals.com Promo Code, CampusBookRentals.com Discount, CampusBookRentals.com Coupon Cash Back Rebate here. MetaKeywords: CampusBookRentals.com Coupon Code, CampusBookRentals.com Rebate, CampusBookRentals.com Promo Code, CampusBookRentals.com Cash Back Rebate, CampusBookRentals.com Discount, CampusBookRentals.com Coupon Image: images/15727.JPG LinkURL: http://www.shareasale.com/r.cfm?b=108680&u=412002&m=15727 affiliate_url_link: http://www.icouponblog.com/jane.php?id=397 thesis_readmore: See the CampusBookRentals.com Coupon thesis_thumb: http://www.icouponblog.com/tn.php?merchantURL=campusbookrentals.com Title: Save 3.5% - CampusBookRentals.com Coupon Code for campusbookrentals.com. CampusBookRentals.com Rebate & Discount thesis_description: Our CampusBookRentals.com Discount Coupon Code for campusbookrentals.com.  School tuition is already back breaking, the price of new books and even second hand books are very high and they are used for only one semester or quarter. CampusBookRentals.com has the best money saving solution. Instead of buying the book, just rent it and save up to 90%. Check out CampusBookRentals.com. You can get your books very fast when you rent from CampusBookRentals.com and shipping is free. Use our discount coupon to get an even better deal on CampusBookRentals.com
CampusBookRentals.com has the book you need. Have peace of mind. Education is hard enough and expensive enough, at least you can get some relief by renting books online with CampusBookRentals.com. Check it out now and use discount coupons on CampusBookRentals.com.


We monetize tables!
- recontextualize efficient ROI
- strategize visionary solutions
- maximize scalable web-readiness
- monetize end-to-end partnerships
- synthesize transparent e-markets
- iterate leading-edge experiences
- innovate 24/365 initiatives
- mesh clicks-and-mortar infomediaries
- target virtual convergence
- utilize extensible experiences


My name is Baha aldeen zghayar
I am from Hebron - Palestine
My age is 23
My interests are in psychology and coding.
- Education: Mechanical engineering at Philadelphia university
- Experiance: Solar systems at Philadelphia Solar , Plastics industry.
Top ten cities to visit:
- Jerusalem
- Mecca
- Al Madina
- Prague
- Istanbul
- Bali
- Vienna
- Budapest
- Haifa
- Hebron


wimblemine.
Wimblemine is an up and coming mining pool for MimbleWimble coins. Here's what sets us apart from the others:
- Built just for MimbleWimble coins
- Instant payouts at any time
- Mining tools accessible through simple UI
- Support for up and coming coins, not just the big guys
Join us!
We're just getting started and looking for help from developers, designers, enthusiasts, and distributed systems engineers.
Want to help build something awesome?
Join us on our Discord:
https://discord.gg/4wunhqB


First div element.
First after and Second before.
Second div element.
Second after and Third before.
Third div element.


--- layout: post status: publish published: true title: Podcast 4.02 - Joe Martin Reports from Mesa author: display_name: Corey Fineran login: Corey email<EMAIL_ADDRESS>url: '' author_login: Corey author_email<EMAIL_ADDRESS>wordpress_id: 6755 wordpress_url: http://ivyenvy.com/?p=6755 date: '2012-02-28 22:18:08 +0000' date_gmt: '2012-02-29 04:18:08 +0000' categories: - Podcast - Spring Training tags: - Spring Training - Mesa - Joe Martin comments: [] ---
We have something different for you on this episode. Andy and Kurt were unavailable, so Corey speaks with our eyes and ears in Mesa, Joe Martin. Joe has jumped on board to help us with Spring Training coverage. He talks about the overall vibe of Spring training and how things are different with a new front office. He also speaks on the individual players and gives his opinion on what he is seeing out of the Cubs, so far in Spring Training.
You can follow Joe's updates and photos from Spring Training on our Twitter account - @IvyEnvy.


Roadmap
An overview of what has gone into making this site and a peek at the future.
TODOS (In no particular order)
- I want the ability to have footnotes which appear as hovers on desktop, but as jump-tos on mobile with jumpback links.
I want a nice centered blog style which is very responsive
- I want nice header images
- I want side-bar descriptions of inline images
- I want better handling of code blocks
Nice background and full width blocks at the very least
- Syntax codeblockwithsyntaxing
Chrome footer
Tags
Header for common includes
Photo Carousel
TODOS for Hugoadmin
I’m developing a companion app in Go, which I’m provisionally calling hugoadmin
the goal of this tool is to help rapidly create Hugo-compatible folder layouts.

Write a createtype
command to insert a new content type into an existing site.
- Write an
createindex
command to insert new indexes
- Come up with more features as I find a need for them


Hi everyone,
First of all, I d like to apologize for my English which is not that well :)
I ve been working for days on your project but I still don't have data coming on emoncms ...
I ve bought the fully assembled pack and configured correctly the raspberry pi I think with domain and api key changes.
When I access via SSH the raspberry pi the oemgateway.conf returns this :
2014-03-28 16:10:02,244 INFO Logging level set to DEBUG
2014-03-28 16:10:02,247 INFO Opening gateway...
2014-03-28 16:10:02,250 INFO Creating buffer emoncms_local
2014-03-28 16:10:02,254 INFO Creating buffer emoncms_remote
2014-03-28 16:10:02,258 INFO Creating listener RFM2Pi
2014-03-28 16:10:02,261 DEBUG Opening serial port: /dev/ttyAMA0
2014-03-28 16:10:02,265 INFO Setting send time interval to 300
2014-03-28 16:10:02,268 INFO Setting RFM2Pi | frequency: 8
2014-03-28 16:10:03,271 INFO Setting RFM2Pi | sgroup: 210
2014-03-28 16:10:04,275 INFO Setting RFM2Pi | baseid: 15
2014-03-28 16:10:05,279 INFO Creating listener Socket
2014-03-28 16:10:05,283 DEBUG Opening socket on port 50011
2014-03-28 16:10:05,287 ERROR [Errno 98] Address already in use
2014-03-28 16:10:05,290 ERROR Could not open port 50011
2014-03-28 16:10:05,311 DEBUG Broadcasting time: 16:10
2014-03-28 16:10:05,315 INFO Serial RX:
2014-03-28 16:10:05,318 WARNING Misformed RX frame: ['\x01']
2014-03-28 16:10:05,522 INFO Serial RX: > 0s
I don't know where the error comes from I m really new in that kind of stuff ...
This my emontx code :
/*
emonTxV3 Discrete Sampling
If AC-AC adapter is detected assume emonTx is also powered from adapter (jumper shorted) and take Real Power Readings and disable sleep mode to keep load on power supply constant
If AC-AC addapter is not detected assume powering from battereis / USB 5V AC sample is not present so take Apparent Power Readings and enable sleep mode
Transmitt values via RFM12B radio
-----------------------------------------
Part of the openenergymonitor.org project
Authors: Glyn Hudson & Trystan Lea
Builds upon JCW JeeLabs RF12 library and Arduino
Licence: GNU GPL V3*/
/*Recommended node ID allocation
------------------------------------------------------------------------------------------------------------
-ID- -Node Type-
0 - Special allocation in JeeLib RFM12 driver - reserved for OOK use
1-4 - Control nodes
5-10 - Energy monitoring nodes
11-14 --Un-assigned --
15-16 - Base Station & logging nodes
17-30 - Environmental sensing nodes (temperature humidity etc.)
31 - Special allocation in JeeLib RFM12 driver - Node31 can communicate with nodes on any network group
-------------------------------------------------------------------------------------------------------------Change Log:
V1.3 - fix filter settle time to eliminate large inital reading
V1.2 - fix bug which caused Vrms to be returned as zero if CT1 was not connected
V1.1 - fix bug in startup Vrms calculation, startup Vrms startup calculation is now more accuratre
*/#define emonTxV3 // Tell emonLib this is the emonTx V3 - don't read Vcc assume Vcc = 3.3V as is always the case on emonTx V3 eliminates bandgap error and need for calibration http://harizanov.com/2013/09/thoughts-on-avr-adc-accuracy/
#include <RFu_JeeLib.h> // Special modified version of the JeeJib library to work with the RFu328 https://github.com/openenergymonitor/RFu_jeelib
ISR(WDT_vect) { Sleepy::watchdogEvent(); } // Attached JeeLib sleep function to Atmega328 watchdog -enables MCU to be put into sleep mode inbetween readings to reduce power consumption#include "EmonLib.h" // Include EmonLib energy monitoring library https://github.com/openenergymonitor/EmonLib
EnergyMonitor ct1, ct2, ct3, ct4;#include <OneWire.h> //http://www.pjrc.com/teensy/td_libs_OneWire.html
#include <DallasTemperature.h> //http://download.milesburton.com/Arduino/MaximTemperature/DallasTemperature_LATEST.zip//----------------------------emonTx V3 Settings---------------------------------------------------------------------------------------------------------------
const byte Vrms= 230; // Vrms for apparent power readings (when no AC-AC voltage sample is present)
const byte TIME_BETWEEN_READINGS= 10; //Time between readingsconst float Ical1= 90.9; // (2000 turns / 22 Ohm burden) = 90.9
const float Ical2= 90.9; // (2000 turns / 22 Ohm burden) = 90.9
const float Ical3= 90.9; // (2000 turns / 22 Ohm burden) = 90.9
const float Ical4= 16.6; // (2000 turns / 120 Ohm burden) = 16.6const float Vcal= 276.9; // (230V x 13) / (9V x 1.2) = 276.9
const float phase_shift= 1.7;
const int no_of_samples= 1480;
const int no_of_half_wavelengths= 20;
const int timeout= 2000; //emonLib timeout
const int ACAC_DETECTION_LEVEL= 3000;
const int TEMPERATURE_PRECISION= 11; //9 (93.8ms),10 (187.5ms) ,11 (375ms) or 12 (750ms) bits equal to resplution of 0.5C, 0.25C, 0.125C and 0.0625C
//#define FILTERSETTLETIME 25000 // Time (ms) to allow the filters to settle before sending data
#define ASYNC_DELAY 375 // DS18B20 conversion delay - 9bit requres 95ms, 10bit 187ms, 11bit 375ms and 12bit resolution takes 750ms
//-------------------------------------------------------------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------------------------------------------------------//----------------------------emonTx V3 hard-wired connections---------------------------------------------------------------------------------------------------------------
const byte LEDpin= 6; // emonTx V3 LED
const byte DS18B20_PWR= 19; // DS18B20 Power
#define ONE_WIRE_BUS 5 // DS18B20 Data
//-------------------------------------------------------------------------------------------------------------------------------------------//Setup DS128B20
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);//-------------------------------------------------------------------------------------------------------------------------------------------
//-----------------------RFM12B SETTINGS----------------------------------------------------------------------------------------------------
#define RF_freq RF12_868MHZ // Frequency of RF12B module can be RF12_433MHZ, RF12_868MHZ or RF12_915MHZ. You should use the one matching the module you have.
const int nodeID = 15; // emonTx RFM12B node ID
const int networkGroup = 210;
typedef struct { int power1, power2, power3, power4, Vrms, temp; } PayloadTX; // create structure - a neat way of packaging data for RF comms
PayloadTX emontx;
//-------------------------------------------------------------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------------------------------------------------------//Random Variables
//boolean settled = false;
boolean CT1, CT2, CT3, CT4, ACAC, debug, DS18B20_STATUS;
byte CT_count=0;
int numSensors;
//addresses of sensors, MAX 4!!
byte allAddress [4][8]; // 8 bytes per addressvoid setup()
{pinMode(LEDpin, OUTPUT);
pinMode(DS18B20_PWR, OUTPUT);
digitalWrite(LEDpin,HIGH);Serial.begin(9600);
Serial.println("emonTx V3 Discrete Sampling V1.3");
Serial.println("OpenEnergyMonitor.org");
Serial.println("Performing power-on tests.....please wait 10s");
delay(10);
rf12_initialize(nodeID, RF_freq, networkGroup); // initialize RFM12B
for (int i=10; i>=0; i--) //Send RFM12B test sequence (for factory testing)
{
emontx.power1=i;
rf12_sendNow(0, &emontx, sizeof emontx);
delay(100);
}
rf12_sendWait(2);
emontx.power1=0;
rf12_sleep(RF12_SLEEP);
if (analogRead(1) > 0) {CT1 = 1; CT_count++;} else CT1=0; // check to see if CT is connected to CT1 input, if so enable that channel
if (analogRead(2) > 0) {CT2 = 1; CT_count++;} else CT2=0; // check to see if CT is connected to CT2 input, if so enable that channel
if (analogRead(3) > 0) {CT3 = 1; CT_count++;} else CT3=0; // check to see if CT is connected to CT3 input, if so enable that channel
if (analogRead(4) > 0) {CT4 = 1; CT_count++;} else CT4=0; // check to see if CT is connected to CT4 input, if so enable that channel
if ( CT_count == 0) CT1=1; // If no CT's are connect ed CT1-4 then by default read from CT1// Quick check to see if there is a voltage waveform present on the ACAC Voltage input
// Check consists of calculating the RMS from 100 samples of the voltage input.
Sleepy::loseSomeTime(10000); //wait for settle
digitalWrite(LEDpin,LOW);
// Calculate if there is an ACAC adapter on analog input 0
//double vrms = calc_rms(0,1780) * (Vcal * (3.3/1024) );
double vrms = calc_rms(0,1780) * 0.87;
if (vrms>90) ACAC = 1; else ACAC=0;if (ACAC)
{
for (int i=0; i<10; i++) // indicate AC has been detected by flashing LED 10 times
{
digitalWrite(LEDpin, HIGH); delay(200);
digitalWrite(LEDpin, LOW); delay(300);
}
}
else
{
delay(1000);
digitalWrite(LEDpin, HIGH); delay(2000); digitalWrite(LEDpin, LOW); // indicate DC power has been detected by turing LED on then off
}//################################################################################################################################
//Setup and for presence of DS18B20
//################################################################################################################################
digitalWrite(DS18B20_PWR, HIGH); delay(50);
sensors.begin();
sensors.setWaitForConversion(false); //disable automatic temperature conversion to reduce time spent awake, conversion will be implemented manually in sleeping http://harizanov.com/2013/07/optimizing-ds18b20-code-for-low-power-appli...
numSensors=(sensors.getDeviceCount());
byte j=0; // search for one wire devices and
// copy to device address arrays.
while ((j < numSensors) && (oneWire.search(allAddress[j]))) j++;
digitalWrite(DS18B20_PWR, LOW);
if (numSensors==0) DS18B20_STATUS=0;
else DS18B20_STATUS=1;
//################################################################################################################################if (Serial) debug = 1; else debug=0; //if serial UART to USB is connected show debug O/P. If not then disable serial
if (debug==1)
{
Serial.print("CT 1 Calibration: "); Serial.println(Ical1);
Serial.print("CT 2 Calibration: "); Serial.println(Ical2);
Serial.print("CT 3 Calibration: "); Serial.println(Ical3);
Serial.print("CT 4 Calibration: "); Serial.println(Ical4);
delay(1000);Serial.print("RMS Voltage on AC-AC Adapter input is: ~");
Serial.print(vrms,0); Serial.println("V");
if (ACAC)
{
Serial.println("AC-AC adapter detected - Real Power measurements enabled");
Serial.println("assuming powering from AC-AC adapter (jumper closed)");
Serial.print("Vcal: "); Serial.println(Vcal);
Serial.print("Phase Shift: "); Serial.println(phase_shift);
}
else
{
Serial.println("AC-AC adapter NOT detected - Apparent Power measurements enabled");
Serial.print("Assuming VRMS to be "); Serial.print(Vrms); Serial.println("V");
Serial.println("Assuming powering from batteries / 5V USB - power saving mode enabled");
}if (CT_count==0) Serial.println("NO CT's detected, sampling from CT1 by default");
else
{
if (CT1) Serial.println("CT 1 detected");
if (CT2) Serial.println("CT 2 detected");
if (CT3) Serial.println("CT 3 detected");
if (CT4) Serial.println("CT 4 detected");
}
if (DS18B20_STATUS==1) {Serial.print("Detected "); Serial.print(numSensors); Serial.println(" DS18B20..using this for temperature reading");}
else Serial.println("Unable to detect DS18B20 temperature sensor");
Serial.println("RFM12B Initiated: ");
Serial.print("Node: "); Serial.print(nodeID);
Serial.print(" Freq: ");
if (RF_freq == RF12_433MHZ) Serial.print("433Mhz");
if (RF_freq == RF12_868MHZ) Serial.print("868Mhz");
if (RF_freq == RF12_915MHZ) Serial.print("915Mhz");
Serial.print(" Network: "); Serial.println(networkGroup);
delay(500);
}
else
Serial.end();
if (CT1) ct1.current(1, Ical1); // CT ADC channel 1, calibration. calibration (2000 turns / 22 Ohm burden resistor = 90.909)
if (CT2) ct2.current(2, Ical2); // CT ADC channel 2, calibration.
if (CT3) ct3.current(3, Ical3); // CT ADC channel 3, calibration.
//CT 3 is high accuracy @ low power - 4.5kW Max @ 240V
if (CT4) ct4.current(4, Ical4); // CT channel ADC 4, calibration. calibration (2000 turns / 120 Ohm burden resistor = 16.66)
if (ACAC)
{
if (CT1) ct1.voltage(0, Vcal, phase_shift); // ADC pin, Calibration, phase_shift
if (CT2) ct2.voltage(0, Vcal, phase_shift); // ADC pin, Calibration, phase_shift
if (CT3) ct3.voltage(0, Vcal, phase_shift); // ADC pin, Calibration, phase_shift
if (CT4) ct4.voltage(0, Vcal, phase_shift); // ADC pin, Calibration, phase_shift
}// Do some measurements to allow the software filter to settle - don't use the result
if (ACAC)
{
if (CT1) for (int j=0; j<5; j++) ct1.calcVI(no_of_half_wavelengths,timeout);
if (CT2) for (int j=0; j<5; j++) ct2.calcVI(no_of_half_wavelengths,timeout);
if (CT3) for (int j=0; j<5; j++) ct3.calcVI(no_of_half_wavelengths,timeout);
if (CT4) for (int j=0; j<5; j++) ct4.calcVI(no_of_half_wavelengths,timeout);
}
else
{
if (CT1) for (int j=0; j<5; j++) ct1.calcIrms(no_of_samples);
if (CT2) for (int j=0; j<5; j++) ct2.calcIrms(no_of_samples);
if (CT3) for (int j=0; j<5; j++) ct3.calcIrms(no_of_samples);
if (CT4) for (int j=0; j<5; j++) ct4.calcIrms(no_of_samples);
}
}void loop()
{
if (ACAC) {
delay(200); //if powering from AC-AC allow time for power supply to settle
emontx.Vrms=0; //Set Vrms to zero, this will be overwirtten by wither CT 1-4
}
if (CT1)
{
if (ACAC)
{
ct1.calcVI(no_of_half_wavelengths,timeout); emontx.power1=ct1.realPower;
emontx.Vrms=ct1.Vrms*100;
}
else
emontx.power1 = random(100)*Vrms; // Calculate Apparent Power 1 1480 is number of samples
if (debug==1) {Serial.print(emontx.power1); Serial.print(" ");}}
if (CT2)
{
if (ACAC)
{
ct2.calcVI(no_of_half_wavelengths,timeout); emontx.power2=ct2.realPower;
emontx.Vrms=ct2.Vrms*100;
}
else
emontx.power2 = ct2.calcIrms(no_of_samples)*Vrms; // Calculate Apparent Power 1 1480 is number of samples
if (debug==1) {Serial.print(emontx.power2); Serial.print(" ");}}
if (CT3)
{
if (ACAC)
{
ct3.calcVI(no_of_half_wavelengths,timeout); emontx.power3=ct3.realPower;
emontx.Vrms=ct3.Vrms*100;
}
else
emontx.power3 = ct3.calcIrms(no_of_samples)*Vrms; // Calculate Apparent Power 1 1480 is number of samples
if (debug==1) {Serial.print(emontx.power3); Serial.print(" ");}}
if (CT4)
{
if (ACAC)
{
ct4.calcVI(no_of_half_wavelengths,timeout); emontx.power4=ct4.realPower;
emontx.Vrms=ct4.Vrms*100;
}
else
emontx.power4 = ct4.calcIrms(no_of_samples)*Vrms; // Calculate Apparent Power 1 1480 is number of samples
if (debug==1) {Serial.print(emontx.power4); Serial.print(" ");}}
if (ACAC)
{
if ((debug==1) && (!CT_count==0)) Serial.print(emontx.Vrms);
}
if ((debug==1) && (!CT_count==0)) {Serial.println(); delay(20);}
// because millis() returns to zero after 50 days !
//if (!settled && millis() > FILTERSETTLETIME) settled = true; - replaced by filter settle routine at end of setup
if (DS18B20_STATUS==1)
{
digitalWrite(DS18B20_PWR, HIGH); Sleepy::loseSomeTime(50);
for(int j=0;j<numSensors;j++) sensors.setResolution(allAddress[j], TEMPERATURE_PRECISION); // and set the a to d conversion resolution of each.
sensors.requestTemperatures(); // Send the command to get temperatures
Sleepy::loseSomeTime(ASYNC_DELAY); //Must wait for conversion, since we use ASYNC mode
float temp=(sensors.getTempC(allAddress[0]));
digitalWrite(DS18B20_PWR, LOW);
if ((temp<125.0) && (temp>-40.0)) emontx.temp=(temp*10); //if reading is within range for the sensor convert float to int ready to send via RF
if (debug==1) {Serial.print("temperature: "); Serial.println(emontx.temp*0.1); delay(20);}
}
// if (settled) // send data only after filters have settled
//{
send_rf_data(); // *SEND RF DATA* - see emontx_lib
if (ACAC)
{
delay(TIME_BETWEEN_READINGS*1000);
digitalWrite(LEDpin, HIGH); delay(200); digitalWrite(LEDpin, LOW); // flash LED - turn off to save power
}
else
emontx_sleep(TIME_BETWEEN_READINGS); // sleep or delay in seconds
// }}
void send_rf_data()
{
rf12_sleep(RF12_WAKEUP);
rf12_sendNow(0, &emontx, sizeof emontx); //send temperature data via RFM12B using new rf12_sendNow wrapper
rf12_sendWait(2);
rf12_sleep(RF12_SLEEP);
}void emontx_sleep(int seconds) {
Sleepy::loseSomeTime(seconds*1000);
}
double calc_rms(int pin, int samples)
{
unsigned long sum = 0;
for (int i=0; i<samples; i++) // 178 samples takes about 20ms
{
int raw = (analogRead(0)-512);
sum += (unsigned long)raw * raw;
}
double rms = sqrt((double)sum / samples);
return rms;
}
I m not using any sensor that s why I simulates a current value CT 1.
If someone could help me, it would be really great !!
Thanks
PS : Sorry for the display of my message, I don't know how to do in a better way
Re: error address already in use cannot open port 50011
Hi,
None of you had the same error message ?
Re: error address already in use cannot open port 50011
The problem should lie in the raspberrypi and gateway set-up rather than the sketch.
I have seen this before but only when an instance of oemgateway was already running, try running
sudo ps -ef | grep oemgateway
to see if there is another instance and also try running
sudo netstat -n -l -p | grep 50011
to see what process is already using the port.
Paul
Re: error address already in use cannot open port 50011
Thanks for the answer Paul.
Whan I run those stuff I get that :
root@oemgateway:~/oem_gateway# sudo ps -ef | grep oemgateway
root 1254 1215 0 16:28 pts/0 00:00:00 grep oemgateway
root@oemgateway:~/oem_gateway# sudo netstat -n -l -p | grep 50011
What does that mean ?
Moreover, I have a new error code which is quite weird cause I don't think I change anything :
root@oemgateway:~/oem_gateway# python /root/oem_gateway/oemgateway.py --config-file /boot/oemgateway.conf
2014-04-02 16:32:04,186 INFO Logging level set to DEBUG
2014-04-02 16:32:04,189 INFO Opening gateway...
2014-04-02 16:32:04,193 INFO Creating buffer emoncms_local
2014-04-02 16:32:04,197 INFO Creating buffer emoncms_remote
2014-04-02 16:32:04,201 INFO Creating listener RFM2Pi
2014-04-02 16:32:04,205 DEBUG Opening serial port: /dev/ttyAMA0
2014-04-02 16:32:04,209 INFO Setting send time interval to 300
2014-04-02 16:32:04,213 INFO Setting RFM2Pi | frequency: 8
2014-04-02 16:32:05,217 INFO Setting RFM2Pi | sgroup: 210
2014-04-02 16:32:06,221 INFO Setting RFM2Pi | baseid: 15
2014-04-02 16:32:07,225 INFO Creating listener Socket
2014-04-02 16:32:07,228 DEBUG Opening socket on port 50011
2014-04-02 16:32:07,251 DEBUG Broadcasting time: 16:32
2014-04-02 16:32:07,255 INFO Serial RX: > 8b
2014-04-02 16:32:07,459 INFO Serial RX:
2014-04-02 16:32:07,463 WARNING Misformed RX frame: ['\x01']
2014-04-02 16:32:07,668 INFO Serial RX: > 210g
2014-04-02 16:32:07,872 INFO Serial RX:
2014-04-02 16:32:07,875 WARNING Misformed RX frame: ['\x01']
2014-04-02 16:32:08,080 INFO Serial RX: > 15i
2014-04-02 16:32:08,302 INFO Serial RX:
2014-04-02 16:32:08,305 WARNING Misformed RX frame: ['\x01']
2014-04-02 16:32:08,510 INFO Serial RX: > 0s
2014-04-02 16:32:08,715 INFO Serial RX: -> 4 b
2014-04-02 16:32:12,193 INFO Serial RX: 10 0 0 0 0 0 0 0 0
2014-04-02 16:32:12,196 DEBUG Node: 10
2014-04-02 16:32:12,199 DEBUG Values: [0, 0, 0, 0]
Traceback (most recent call last):
File "/root/oem_gateway/oemgateway.py", line 239, in <module>
gateway.run()
File "/root/oem_gateway/oemgateway.py", line 86, in run
b.send(values)
File "/root/oem_gateway/oemgatewaybuffer.py", line 63, in send
" -> send data: " + str(data))
KeyError: 'path'
Do you have any idea ?
Re: error address already in use cannot open port 50011
The checks show there is nothing else using port 50011 at the time you ran them, which is confirmed by the fact you have passed that point without a problem this time.
The very last line tells you there is an error with the path, What do have set in the oemgateway.conf ? the default settings for "path = " should be blank if sending to emoncms.org or "/emoncms" if sending to local server.
Paul
Re: error address already in use cannot open port 50011
Thanks Paul,
Sorry for the delay, I could not answer earlier.
In the oemgateway.conf , remote is active with emoncms.org as domain and blank as path, is that right ?
Julien
Re: error address already in use cannot open port 50011
Yes that should be correct, are you still getting the same error?
the variable parts of the "path" to emoncms.org are
domain = emoncms.org
apikey = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
protocol = http://
active = True
path =
Is it connected to the internet ok?
Paul
Re: error address already in use cannot open port 50011
File "/root/oem_gateway/oemgatewaybuffer.py", line 63, in send
" -> send data: " + str(data))
KeyError: 'path'
Apparently your config misses the 'path' item. I'd check it complies with pb66's example config.
BTW? in case your wonder, the warnings about Misformed RX frame in your log don't matter, you can safely ignore them. I should address that.
I don't use emoncms.org but my own server as remote, so my path is
I don't know what is supposed to happen if path is left empty, but according to pb66, it works fine. Otherwise, try
or just post your config here.
Re: error address already in use cannot open port 50011
Thanks Paul,
I can't connect the Pi to my box before this evening. I ll let you know what I get.
Julien
Re: error address already in use cannot open port 50011
Thanks Jerôme,
I changed path to ' ' but still not working.
That's my settings now :
[[emoncms_local]]
type = OemGatewayEmoncmsBuffer
[[[init_settings]]]
[[[runtime_settings]]]
domain = localhost
apikey = c***************************9fe6
protocol = http://
active = False
path =
[[emoncms_remote]]
type = OemGatewayEmoncmsBuffer
[[[init_settings]]]
[[[runtime_settings]]]
domain = emoncms.org
apikey = c***************************9fe6
protocol = http://
active = True
path = ''
Re: error address already in use cannot open port 50011
@ urdel62 - You should remove part of your api key before posting.
When you say "still not working" do you mean you are still getting exactly the same fault each time?
Does the pi have a working internet connection ?
Have you tried path = / ?
Is the API key correct ?
Aha.. it appears to be your api key at fault, recheck you are using a correct read and write api key.
Paul


|
App Engine Python SDK
v1.6.9 rev.445
The Python runtime is available as an experimental Preview feature.
|
Public Member Functions | |
| def | __init__ |
| def | reset |
| def | consume |
| def | LA |
| def | LT |
| def | index |
| def | size |
| def | mark |
| def | rewind |
| def | release |
| def | seek |
| def | substring |
| def | getLine |
| def | getCharPositionInLine |
| def | setLine |
| def | setCharPositionInLine |
| def | getSourceName |
| Public Member Functions inherited from google.appengine._internal.antlr3.streams.CharStream | |
| def | substring |
| def | LT |
| def | getLine |
| def | setLine |
| def | getCharPositionInLine |
| def | setCharPositionInLine |
| Public Member Functions inherited from google.appengine._internal.antlr3.streams.IntStream | |
| def | consume |
| def | LA |
| def | mark |
| def | index |
| def | rewind |
| def | release |
| def | seek |
| def | size |
| def | getSourceName |
Public Attributes | |
| p | |
| line | |
| charPositionInLine | |
| lastMarker | |
| markDepth | |
Additional Inherited Members | |
| Static Public Attributes inherited from google.appengine._internal.antlr3.streams.CharStream | |
| int | EOF = -1 |
@brief CharStream that pull data from a unicode string. A pretty quick CharStream that pulls all data from an array directly. Every method call counts in the lexer.
| def google.appengine._internal.antlr3.streams.ANTLRStringStream.__init__ | ( | self, | |
| data | |||
| ) |
@param data This should be a unicode string holding the data you want to parse. If you pass in a byte string, the Lexer will choke on non-ascii data.
| def google.appengine._internal.antlr3.streams.ANTLRStringStream.getCharPositionInLine | ( | self | ) |
Using setter/getter methods is deprecated. Use o.charPositionInLine instead.
| def google.appengine._internal.antlr3.streams.ANTLRStringStream.getLine | ( | self | ) |
Using setter/getter methods is deprecated. Use o.line instead.
| def google.appengine._internal.antlr3.streams.ANTLRStringStream.index | ( | self | ) |
Return the current input symbol index 0..n where n indicates the last symbol has been read. The index is the index of char to be returned from LA(1).
| def google.appengine._internal.antlr3.streams.ANTLRStringStream.reset | ( | self | ) |
Reset the stream so that it's in the same state it was when the object was created *except* the data array is not touched.
| def google.appengine._internal.antlr3.streams.ANTLRStringStream.seek | ( | self, | |
| index | |||
| ) |
consume() ahead until p==index; can't just set p=index as we must update line and charPositionInLine.
| def google.appengine._internal.antlr3.streams.ANTLRStringStream.setCharPositionInLine | ( | self, | |
| pos | |||
| ) |
Using setter/getter methods is deprecated. Use o.charPositionInLine instead.
| def google.appengine._internal.antlr3.streams.ANTLRStringStream.setLine | ( | self, | |
| line | |||
| ) |
Using setter/getter methods is deprecated. Use o.line instead.