- A story about getting blocked on a simple problem and solving it problem in an elegant way.
I was blocked on exercise # 3 from Eloquent Javascript book, Chapter 2. The task was to create a string that represents an 8×8 grid of symbols ("#"). I couldn't figured out how to apply loops and to link if/else statement to decide to put a space of a hash sign. I wrote preudocode, but it didn't help me. After trying different approaches, I googled and found out about String.repeat() function that I easily applied and the problem was solved.
What I learned from this case is there are multiple ways to solve a problem, and if you are blocked with one method, you need to think out of the box, and try different approaches, the ones you probably even haven't considered before.
- How confident do you feel using the problem solving techniques and process?
- Pseudocode really works for me, as in fact it is a plan of actions, and gives the structure to the future program.
- Reading error message sometimes is helpful too, even though I tend to ignore them..
- Console.logging and Googling are probably my helpers # 1 at the moment.
- I haven't tried rubber ducky method, but I think I will one day.
- Explain .map(), .filter() and .reduce() functions.
- .map() function helps you to create a new array, and new elements in this array will be a result of a function you applied. Let's imagine you had a bowl of apples (this is an array), and you baked them (i.e. applied a function), once you took your baked apples from the oven and put them into a bowl you got a new array.
- with .filter() method you can create a new array, which will contain only the elements that passed certain requirements determined by a function. So.. coming back to our apples. This time you have a bowl with green and red apples (meaning your initial array). Now you want to filter() them, and you take out all green apples, leaving only red ones in your bowl. You just got your new array!
- .reduce() method converts your array of many elements into a single value by applying a function to each element. This time you have a bowl with apples, sugar, flour, butter and cinnamon. You apply a reduce function, which mixes (sums up) all your ingredients (elements), bakes them, and as a result you get apple crumble (just one single element).


C-Programing
C++
Java
Arduino
Python
Android
Front End Web Development
Java Script with NodeJS
Data Analysis
Mongo DB
Full Stack Web Development
All CS Course


Digital Asset Fund
Supernova
fund
Supernova drives an expanding shock wave into the crypto space to
trigger the formation of new DeFi stars.
We are a venture firm focusing on Web3, DAOs, Social Tokens, DeFi
Derivatives and original NFT use-cases. Our independent research &
development lab has supported DeFi projects since early 2020.
@supernova
2021


Notebooks
Story: The woman eaten by Baboons: a fragment of the account
The woman eaten by Baboons: a fragment of the account
Title
The woman eaten by Baboons: a fragment of the account
Collection
Summary
In former times, when animals were people, the Baboons were jealous of a young Quagga woman, who lived with them, on account of the notice attracted by her great size. For this reason, as well as for her fatness, they killed her, telling the other people that her flesh was that of a young gemsbok. In Katkop dialect, by Díä!kwãin, who had it from his father Xaättin (L V.-25. 5993-5997). The Punishment of the Baboon, which appears to be a continuation of the above fable, was narrated to Díä!kwãin by an older female relation named Ttuobboken !káugn (L V.-24. 5974-5991). An explanatory note to the story of the Punishment of the Baboon was also given by Díä!kwãin from information received from his mother, ≠kámme–an (L V.-24. 5992). A story of the Early Race (or 'First Time') when all things were people.
Comments
1) p.5991v: Dia!kwain heard this from his mother (≠kamme-an); it is a story of the 'First Time' when all things were people, including |kaggen (the Mantis), 2) p.3992v: names and description of plants eaten or feared, 3) See also The woman who was killed by the baboons and Baboons who ate human beings, 4) This story is found in Book V-24
Contributors
Date
February 1876
Categories
History (Early Race), Custom and daily life
Keywords
Baboons (who ate a human being) , Baboons (the woman eaten by) , Baboons (who ate the Quagga woman) , Baboons (and the Early Race) , Early Race (and the woman eaten by the Baboons because she was fat) , woman (Quagga woman) , woman (eaten by the Baboons because she was fat)
Story Pages
5992


{% extends "layout.html" %} {% block title %}Domains scores{% endblock %} {% block header %}
This is where you can see some information about the captured traffic
Last update {{data.last_update | timestamp_to_date}}
{% endblock %} {% block content %}Use the following list to filter content by device:
| Device name | Domain | Sent | Received | Score | {% for line in data.table_domains %}
|---|---|---|---|---|
| {{ line["device_name"] }} | {{ line["domain"] }} | {{ line["sent_bytes"] }} | {{ line["received_bytes"] }} | {{ line["score"] }} |


|
BasicBot
v1.1
BasicBot for Starcraft: Broodwar 1.16.1 with BWAPI 4.1.2
|
Public Member Functions | |
| MapTools () | |
| void | computeDistance (DistanceMap dmap, final Position p) |
| final Vector< TilePosition > | getClosestTilesTo (Position pos) |
| int | getIndex (int row, int col) |
| TilePosition | getTilePosition (int index) |
| void | reset () |
| void | resetFringe () |
| void | search (DistanceMap dmap, final int sR, final int sC) |
| void | setBWAPIMapData () |
| final boolean | unexplored (DistanceMap dmap, final int index) |
Static Public Member Functions | |
| static MapTools | Instance () |
Private Member Functions | |
| int | getGroundDistance (Position origin, Position destination) |
Private Attributes | |
| Map< Position, DistanceMap > | allMaps = new HashMap<Position, DistanceMap>() |
| int | cols |
| int[] | fringe |
| boolean[] | map |
| int | rows |
| boolean[] | units |
Static Private Attributes | |
| static MapTools | instance = new MapTools() |
provides useful tools for analyzing the starcraft map
calculates connectivity and distances using flood fills
| MapTools.MapTools | ( | ) |
| void MapTools.computeDistance | ( | DistanceMap | dmap, |
| final Position | p | ||
| ) |
computes walk distance from Position P to all other points on the map
| final Vector<TilePosition> MapTools.getClosestTilesTo | ( | Position | pos | ) |
Position 에서 가까운 순서대로 타일의 목록을 반환한다
|
private |
from 에서 to 까지 지상유닛이 이동할 경우의 거리 (walk distance)
| int MapTools.getIndex | ( | int | row, |
| int | col | ||
| ) |
return the index of the 1D array from (row,col)
| TilePosition MapTools.getTilePosition | ( | int | index | ) |
|
static |
static singleton 객체를 리턴합니다
| void MapTools.reset | ( | ) |
resets the distance and fringe vectors, call before each search
| void MapTools.resetFringe | ( | ) |
| void MapTools.search | ( | DistanceMap | dmap, |
| final int | sR, | ||
| final int | sC | ||
| ) |
| void MapTools.setBWAPIMapData | ( | ) |
reads in the map data from bwapi and stores it in our map format
| final boolean MapTools.unexplored | ( | DistanceMap | dmap, |
| final int | index | ||
| ) |
|
private |
a cache of already computed distance maps
|
private |
|
private |
the fringe vector which is used as a sort of 'open list'
|
private |
the map stored at TilePosition resolution, values are 0/1 for walkable or not walkable
|
private |
|
private |
map that stores whether a unit is on this position


Vertical by default
#
Every element in Bulma is mobile-first and optimizes for vertical reading, so by default on mobile:
columns
are stacked vertically
- the
level
component will show its children stacked vertically
- the
nav
menu will be hidden
You can however enforce the horizontal layout for both columns
or nav
by appending the is-mobile
modifier.
Breakpoints
#
Bulma has 5 breakpoints:
mobile
: up to 768px
tablet
: from 769px
desktop
: from 1024px
widescreen
: from 1216px
fullhd
: from 1408px
Bulma uses 9 responsive mixins:
-
=mobile
until 768px
-
=tablet
from 769px
-
=tablet-only
from 769px
and until 1023px
-
=touch
until 1023px
-
=desktop
from 1024px
-
=desktop-only
from 1024px
and until 1215px
-
=widescreen
from 1216px
-
=widescreen-only
from 1216px
and until 1407px
-
=fullhd
from 1408px
Mobile
Up to 768px
|
Tablet
Between 769px and 1023px
|
Desktop
Between 1024px and 1215px
|
Widescreen
Between 1216px and 1407px
|
FullHD
1408px and above
|
|
mobile
|
-
|
|
-
|
tablet
|
|
-
|
desktop
|
|
-
|
widescreen
|
|
-
|
fullhd
|
|
-
|
tablet-only
|
-
|
|
-
|
desktop-only
|
-
|
|
-
|
widescreen-only
|
-
|
|
touch
|
-
|
|
until-widescreen
|
-
|
|
until-fullhd
|
-
|
Disabling breakpoints
#
Since
0.7.0
By default, the $widescreen
and $fullhd
breakpoints are enabled. You can disable them by setting the corresponding Sass boolean to false
:
Variables
#
These are variables with a value that references another variable.
| Name |
Type |
Default value |
Computed value |
| Name |
Type |
Default value |
Computed value |
$gap
|
size
|
64px
|
|
$tablet
|
size
|
769px
|
|
$desktop
|
computed
|
960px + (2 * $gap)
|
|
$widescreen
|
computed
|
1152px + (2 * $gap)
|
|
$fullhd
|
computed
|
1344px + (2 * $gap)
|
|


General Information
- Breed Purpose
- Egg Layer
- Comb
- Single
- Broodiness
- Seldom
- Climate Tolerance
- All Climates
- Egg Productivity
- High
- Egg Size
- Medium
- Egg Color
- Light Brown
- Breed Temperament
- Docile
- Breed Colors/Varieties
- White w/ Gold splash
- Breed Size
- Large Fowl
The Amber Star is a fantastic chicken is all senses, she is a Rhode Island Red based Hybrid chicken. The Amber Star's feathering is very soft, Amber Star's have a very placid nature and make ideal pet chickens. Eggs, well the Amber Star lives up to the star part of her name laying up to 320 eggs in her first laying year!


12 August 1996
Disease Outbreak Reported
In response to media reports of an outbreak of influenza the Ministry of Health of Ghana issued a press release 30 July concerning the "apparent" high level of febrile illnesses, general malaise, headache, body pain, and unproductive cough among the general population. The press release informs that most cases are malaria and acute upper respiratory tract infection of viral origin according to preliminary investigations. The viral infection usually lasts for a few days and is usually not associated with serious illness. Most cases need only palliative treatment for pain and cough. Antibiotics are not required.
Cases of malaria are not uncommon during this time of the year when the rains, heat and humidity provide the ideal breeding conditions for mosquitoes. Most cases respond favourably to chloroquine treatment when administered properly.


class: center, middle # CentOS Dojo / May 2021 ## New authentication platform for CentOS and SIGs ### Fabian Arrotin ####<EMAIL_ADDRESS>@arrfab ??? These are some notes presented in presenter mode and not on screen --- class: center, middle, inverse # /whois arrfab #### ['ops','infra','floor sweeper'] @ centos.org --- # Agenda ## New authentication platform for CentOS and SIGs * Why we had to migrate * How we migrated (and what) * Benefits for CentOS and Fedora --- # Why we had to migrate * Fedora and CentOS both using FAS (https://github.com/fedora-infra/fas) -- * python2 / TurboGears -- * ~ 2008 -- * RHEL6/CentOS 6 EOL too -- * had to .. die :) --- # Why we had to migrate ## "Political" options * options: * CentOS and Fedora still using their own auth system -- * or merge once for all (SSO for both projects) --- # Why we had to migrate ## "Technical" options * FAS3 * Still "invented here syndrom" * Still a need for a custom IdP for openid/openidc/saml * Still a dep on ... (Free)IPA for kerberos --- # Why we had to migrate ## "Technical" options * AWS Cognito * Vendor Lock-In ! * not all standards (think about koji: TLS and Kerberos) * Community engagement --- # Why we had to migrate ## "Technical" options * (Free)IPA * (already there for FAS) * In House (part of RHEL) * lack of community portal (but something already started) --- class: top, center # Solution : CentOS and Fedora on same bicycle ! ![Tandem](img/ipa-tandem.png) --- # Community Portal ## Noggin upstream project: https://github.com/fedora-infra/noggin used for: * https://accounts.centos.org * https://accounts.fedoraproject.org --- # API endpoint ## FasJson upstream project: https://github.com/fedora-infra/fasjson API endpoint: https://fasjson.fedoraproject.org/ API doc: https://fasjson.fedoraproject.org/docs/v1/ * needs kerberos auth (passthrough/proxy to IPA backend) --- # How we migrated ## What was migrated : * user account[s] (nick, full name, email address, etc) * groups * group[s] membership --- # How we migrated ## What was *not* migrated : ![Passwords!](img/passwords.jpg) --- # How we migrated ## What was *not* migrated : * passwords * inactive accounts * people asked for it * admins disabled (spam) --- # How we migrated ## fas2ipa * https://github.com/fedora-infra/fas2ipa * existing fedora users => kept and group changes * new users: * conflict[s] : ask for changes * no conflict[s] => imported users (reset pass) --- # How we migrated ## Some stats * ~75k users * ~1200 groups * 3 dedicated IPA servers (RHEL8) --- # CentOS SIG users ## TLS cert (centos-cert) Supported Linux distributions: CentOS 8/8-s , Fedora 32,33,34 ```bash sudo dnf install -y epel-release # only if your on CentOS 8 / 8-stream sudo dnf install -y centos-packager ``` --- # CentOS SIG users ## TLS cert (centos-cert) ```bash You need to call the script like this : /usr/bin/centos-cert -arguments -u : username ([REQUIRED] : your existing ACO/FAS username) -v : just validates the existing TLS certificate ([OPTIONAL]) -r : REALM to use for kerberos ([OPTIONAL] : defaults to FEDORAPROJECT.ORG) -f : fasjson url ([OPTIONAL]: defaults to https://fasjson.fedoraproject.org) -h : display this help ``` --- # 2FA ## through portal, for web authentication Easy: just enable it through portal, and you can add multiple devices/token (OTP) Known to work: * Yubikey (4 and beyond), through rpm pkg "yubioath-desktop" (available through Fedora or Copr for CentOS 8/8-stream) * FreeOTP (Android devices) * OTPClient (Flatpak) * others ... (?) --- # 2FA ## Warning ! Once enabled there is no way to come back to previous auth (except through admin request) Be sure to have backup solution ! (also gpg key id through your profile) --- # 2FA, fun with kinit/kerberos ## Aka "why doesn't kinit work by default" ```bash kinit: Pre-authentication failed: Invalid argument while getting initial credentials ``` --- # 2FA, fun with kinit/kerberos ## Aka "why doesn't kinit work by default" ```bash sudo dnf install fedora-packager kinit -n @FEDORAPROJECT.ORG -c FILE:armor.ccache kinit -T FILE:armor.ccache
@FEDORAPROJECT.ORG ``` At this stage, it asks a combination of password + OTP token --- ## Kerberos pass-through for browsers * Firefox: ```bash about:config network.negotiate-auth.trusted-uris: .fedoraproject.org,.centos.org ``` * Chrome : /etc/opt/chrome/policies/managed/fedora-centos.json * Chromium : /etc/chromium/policies/managed/fedora-centos.json ```bash { "AuthServerWhitelist": "*.fedoraproject.org,*.centos.org", "AuthNegotiateDelegateWhitelist": "*.fedoraproject.org,*.centos.org" } ``` --- ## Kerberos pass-through for browsers ### Warning, needs fedora-packager >= <IP_ADDRESS>-2 ```bash cat /etc/krb5.conf.d/fedoraproject_org [realms] FEDORAPROJECT.ORG = { kdc = https://id.fedoraproject.org/KdcProxy pkinit_anchors = FILE:/etc/pki/ipa/fedoraproject_ipa_ca.crt } [domain_realm] .fedoraproject.org = FEDORAPROJECT.ORG fedoraproject.org = FEDORAPROJECT.ORG .centos.org = FEDORAPROJECT.ORG centos.org = FEDORAPROJECT.ORG ``` --- class: center, middle # Q&A


These are just my quick notes for enabling the REST API for EPrints.
The REST API doesn’t “automatically” become enabled even for Admin role users. You can alter this behavior by updating the roles in “archives/REPOSITORY_NAME/cfg/cfg.d/user_roles.pl” (where REPOSITORY_NAME is the name of the respository you setup with epadmin creeate) in your eprints directory.
Below is I added “rest” role to the admin role.
$c->{user_roles}->{admin} = [qw{
rest
general
edit-own-record
saved-searches
set-password
deposit
change-email
editor
view-status
staff-view
admin
edit-config}];
eputil supports POST and PUT into EPrint’s REST API. Content sent by the POST or PUT is assumed to be encoded before it is read from a file or standard input. In the example below the base we are “putting” the value (TRUE) into the lemurprints.local/authors EPrint collection for record 1’s referreed field.
echo -n "TRUE" | eputil -u "$EP_USER" -p "$EP_PASSWORD" \
-put http://lemurprints.local/authors/rest/eprint/1/refereed.txt
EPrints XML Configuration - need to enable REST API access based on role
EPrints Tech list archives mention REST API


Stunned, distraught, unconscious of its own movement, the house half rose, as if expecting to see the murderer appear at the door, and a breeze of muttered ejaculations swept the place. “Order in the court!—sit down!” This from the sheriff. He was obeyed, and quiet reigned again. Wilson stole a glance at Tom, and said to himself, “He is flying signals of distress, now; even people who despise him are pitying him; they think this is a hard ordeal for a young fellow who has lost his benefactor by so cruel a stroke—and they are right.” He resumed his speech:
“For more than twenty years I have amused my compulsory leisure with collecting these curious physical signatures in this town. At my house I have hundreds upon hundreds of them. Each and every one is labelled with name and date; not labelled the next day or even the next hour, but in the very minute that the impression was taken. When I go upon the witness stand I will repeat under oath the things which I am now saying. I 291 have the finger-prints of the court, the sheriff, and every member of the jury. There is hardly a person in this room, white or black, whose natal signature I cannot produce, and not one of them can so disguise himself that I cannot pick him out from a multitude of his fellow-creatures and unerringly identify him by his hands. And if he and I should live to be a hundred I could still do it. [The interest of the audience was steadily deepening, now.]
“I have studied some of these signatures so much that I know them as well as the bank cashier knows the autograph of his oldest customer. While I turn my back now, I beg that several persons will be so good as to pass their fingers through their hair, and then press them upon one of the panes of the window near the jury, and that among them the accused may set their finger-marks. Also, I beg that these experimenters, or others, will set their finger-marks upon another pane, and add again the marks of the accused, but not placing them in the same order or relation to the other signatures as before—for, by one 292 chance in a million, a person might happen upon the right marks by pure guess-work once, therefore I wish to be tested twice.”
He turned his back, and the two panes were quickly covered with delicately-lined oval spots, but visible only to such persons as could get a dark background for them—the foliage of a tree, outside, for instance. Then, upon call, Wilson went to the window, made his examination, and said—
“This is Count Luigi’s right hand; this one, three signatures below, is his left. Here is Count Angelo’s right; down here is his left. Now for the other pane: here and here are Count Luigi’s, here and here are his brother’s.” He faced about. “Am I right?”
A deafening explosion of applause was the answer. The Bench said—
“This certainly approaches the miraculous!”
Wilson turned to the window again and remarked, pointing with his finger—
“This is the signature of Mr. Justice Robinson. [Applause.] This, of Constable Blake. [Applause.] This, of John Mason, juryman. [Applause.] This, of the sheriff. [Applause.] 293 I cannot name the others, but I have them all at home, named and dated, and could identify them all by my finger-print records.”
He moved to his place through a storm of applause—which the sheriff stopped, and also made the people sit down, for they were all standing and struggling to see, of course. Court, jury, sheriff, and everybody had been too absorbed in observing Wilson’s performance to attend to the audience earlier.
“Now, then,” said Wilson, “I have here the natal autographs of two children—thrown up to ten times the natural size by the pantograph, so that any one who can see at all can tell the markings apart at a glance. We will call the children A and B. Here are A’s finger-marks, taken at the age of five months. Here they are again, taken at seven months. [Tom started.] They are alike, you see. Here are B’s at five months, and also at seven months. They, too, exactly copy each other, but the patterns are quite different from A’s, you observe. I shall refer to these again presently, but we will turn them face down, now.
294 “Here, thrown up ten sizes, are the natal autographs of the two persons who are here before you accused of murdering Judge Driscoll. I made these pantograph copies last night, and will so swear when I go upon the witness stand. I ask the jury to compare them with the finger-marks of the accused upon the window panes, and tell the court if they are the same.”
He passed a powerful magnifying-glass to the foreman.
One juryman after another took the cardboard and the glass and made the comparison. Then the foreman said to the judge—
“Your honor, we are all agreed that they are identical.”
Wilson said to the foreman—
“Please turn that cardboard face down, and take this one, and compare it searchingly, by the magnifier, with the fatal signature upon the knife-handle, and report your finding to the court.”
Again the jury made minute examinations, and again reported—
295 “We find them to be exactly identical, your honor.”
Wilson turned toward the counsel for the prosecution, and there was a clearly recognizable note of warning in his voice when he said—
“May it please the court, the State has claimed, strenuously and persistently, that the blood-stained finger-prints upon that knife-handle were left there by the assassin of Judge Driscoll. You have heard us grant that claim, and welcome it.” He turned to the jury: “Compare the finger-prints of the accused with the finger-prints left by the assassin—and report.”
The comparison began. As it proceeded, all movement and all sound ceased, and the deep silence of an absorbed and waiting suspense settled upon the house; and when at last the words came—
“They do not even resemble,” a thunder-crash of applause followed and the house sprang to its feet, but was quickly repressed by official force and brought to order again. Tom was altering his position every few minutes, 296 now, but none of his changes brought repose nor any small trifle of comfort. When the house’s attention was become fixed once more, Wilson said gravely, indicating the twins with a gesture—
“These men are innocent—I have no further concern with them. [Another outbreak of applause began, but was promptly checked.] We will now proceed to find the guilty. [Tom’s eyes were starting from their sockets—yes, it was a cruel day for the bereaved youth, everybody thought.] We will return to the infant autographs of A and B. I will ask the jury to take these large pantograph facsimilies of A’s marked five months and seven months. Do they tally?”
The foreman responded—
“Perfectly.”
“Now examine this pantograph, taken at eight months, and also marked A. Does it tally with the other two?”
The surprised response was—
“No—they differ widely!”
“You are quite right. Now take these two pantographs of B’s autograph, marked 297 five months and seven months. Do they tally with each other?”
“Yes—perfectly.”
“Take this third pantograph marked B, eight months. Does it tally with B’s other two?”
“By no means!”
“Do you know how to account for those strange discrepancies? I will tell you. For a purpose unknown to us, but probably a selfish one, somebody changed those children in the cradle.”
This produced a vast sensation, naturally; Roxana was astonished at this admirable guess, but not disturbed by it. To guess the exchange was one thing, to guess who did it quite another. Pudd’nhead Wilson could do wonderful things, no doubt, but he couldn’t do impossible ones. Safe? She was perfectly safe. She smiled privately.
“Between the ages of seven months and eight months those children were changed in the cradle”—he made one of his effect-collecting pauses, and added—“and the person who did it is in this house!”
298 Roxy’s pulses stood still! The house was thrilled as with an electric shock, and the people half rose as if to seek a glimpse of the person who had made that exchange. Tom was growing limp; the life seemed oozing out of him. Wilson resumed:
“A was put into B’s cradle in the nursery; B was transferred to the kitchen and became a negro and a slave, [Sensation—confusion of angry ejaculations]—but within a quarter of an hour he will stand before you white and free! [Burst of applause, checked by the officers.] From seven months onward until now, A has still been a usurper, and in my finger-record he bears B’s name. Here is his pantograph at the age of twelve. Compare it with the assassin’s signature upon the knife-handle. Do they tally?”
The foreman answered—
“To the minutest detail!”
Wilson said, solemnly—
“The murderer of your friend and mine—York Driscoll of the generous hand and the kindly spirit—sits in among you. Valet de Chambre, negro and slave,—falsely called 299 Thomas à Becket Driscoll,—make upon the window the finger-prints that will hang you!”
Tom turned his ashen face imploring toward the speaker, made some impotent movements with his white lips, then slid limp and lifeless to the floor.
Wilson broke the awed silence with the words—
“There is no need. He has confessed.”
Roxy flung herself upon her knees, covered her face with her hands, and out through her sobs the words struggled—
“De Lord have mercy on me, po’ misable sinner dat I is!”
The clock struck twelve.
The court rose; the new prisoner, handcuffed, was removed.
It is often the case that the man who can’t tell a lie thinks he is the best judge of one.—Pudd’nhead Wilson’s Calendar.
October 12, the Discovery. It was wonderful to find America, but it would have been more wonderful to miss it.—Pudd’nhead Wilson’s Calendar.
The town sat up all night to discuss the amazing events of the day and swap guesses as to when Tom’s trial would begin. Troop after troop of citizens came to serenade Wilson, and require a speech, and shout themselves hoarse over every sentence that fell from his lips—for all his sentences were golden, now, all were marvelous. His long fight against hard luck and prejudice was ended; he was a made man for good.
And as each of these roaring gangs of enthusiasts marched away, some remorseful 301 member of it was quite sure to raise his voice and say—
“And this is the man the likes of us have called a pudd’nhead for more than twenty years. He has resigned from that position, friends.”
“Yes, but it isn’t vacant—we’re elected.”
The twins were heroes of romance, now, and with rehabilitated reputations. But they were weary of Western adventure, and straightway retired to Europe.
Roxy’s heart was broken. The young fellow upon whom she had inflicted twenty-three years of slavery continued the false heir’s pension of thirty-five dollars a month to her, but her hurts were too deep for money to heal; the spirit in her eye was quenched, her martial bearing departed with it, and the voice of her laughter ceased in the land. In her church and its affairs she found her only solace.
The real heir suddenly found himself rich and free, but in a most embarrassing situation. He could neither read nor write, and 302 his speech was the basest dialect of the negro quarter. His gait, his attitudes, his gestures, his bearing, his laugh—all were vulgar and uncouth; his manners were the manners of a slave. Money and fine clothes could not mend these defects or cover them up; they only made them the more glaring and the more pathetic. The poor fellow could not endure the terrors of the white man’s parlor, and felt at home and at peace nowhere but in the kitchen. The family pew was a misery to him, yet he could nevermore enter into the solacing refuge of the “nigger gallery”—that was closed to him for good and all. But we cannot follow his curious fate further—that would be a long story.
The false heir made a full confession and was sentenced to imprisonment for life. But now a complication came up. The Percy Driscoll estate was in such a crippled shape when its owner died that it could pay only sixty per cent. of its great indebtedness, and was settled at that rate. But the creditors came forward, now, and complained that inasmuch as through an error for which they were 303 in no way to blame the false heir was not inventoried at the time with the rest of the property, great wrong and loss had thereby been inflicted upon them. They rightly claimed that “Tom” was lawfully their property and had been so for eight years; that they had already lost sufficiently in being deprived of his services during that long period, and ought not to be required to add anything to that loss; that if he had been delivered up to them in the first place, they would have sold him and he could not have murdered Judge Driscoll; therefore it was not he that had really committed the murder, the guilt lay with the erroneous inventory. Everybody saw that there was reason in this. Everybody granted that if “Tom” were white and free it would be unquestionably right to punish him—it would be no loss to anybody; but to shut up a valuable slave for life—that was quite another matter.
As soon as the Governor understood the case, he pardoned Tom at once, and the creditors sold him down the river.
Welcome to Project Gutenberg's presentation of Pudd'nhead Wilson. The Italian twins in this novel, Luigi and Angelo, were inspired by a real pair of Italian conjoined twins who toured America in the 1890s. These were Giacomo and Giovanni Battista Tocci.
Homer Plessy was arrested for sitting in a whites-only passenger car on June 7, 1892, and one month later he stood before Judge John Howard Ferguson to plead his case. Plessy was an octaroon who could easily "pass white." Four years later, the Supreme Court condoned "Separate but Equal" laws in the famous Plessy vs. Ferguson case, which affirmed the decision of Justice Ferguson in local court. These events in 1892 unfolded as Twain wrote this story, and changed the tale that he ended up telling.
Arthur Conan Doyle released his best-selling collection of short stories, The Adventures of Sherlock Holmes, on October 14, 1892. The stories had already appeared in The Strand Magazine, one each month, from July 1891 to June 1892. Holmes inspired Twain to add a component of forensics to this story.
The soliloquies and conversations in the novel follow some general rules. Twain introduced some variations in the spelling of dialect, and sometimes the sound of dialect, but the end meaning seems to be the same thing. Below is a table of some of these words, and alternatives found in the text:
| English | Dialect, | Alternative, | Another |
|---|---|---|---|
| and | en | ||
| against | agin, | ag’in, | ag’in’ |
| because | ’ca’se | ||
| going | gwine, | gwyne | |
| more | mo’ | ||
| that | dat | ||
| the | de | ||
| then | den | ||
| there | dere, | dah | |
| these | dese | ||
| they | dey, | deh | |
| this | dis | ||
| was | ’uz | ||
| with | wid | ||
| where | whah |
The above table was presented as a foundation which played into the decision to make some emendations, below, that were not authorized by Twain in 1899. One curious notation is that there was sometimes pronounced dere, but also dah. Along the same lines, they most often became dey, but in one case, deh.
Our version is based on the 1894 publication of this novel in Hartford. This was Twain's original American release of the novel in book form. A scanned copy of this book is available through Hathitrust. The book contained some spaces in contractions: I 'll, dat 'll, had n't, could n't, dis 'll, 't ain't / t ain't, and dey 'll are some examples. These spaces were not retained in our transcription, and are not identified. We did make a few other emendations. These emendations were checked with the 1899 version of Pudd’nhead Wilson published by Harper & Brothers.
The errors on Page 233 and Page 288, were not changed in the 1899 book, so the case for making those changes may be found in the Detailed Notes section. The remaining errors were corrected in the 1899 publication, presumably authorized by Twain, who essentially made the case for those emendations.
In the HTML version of this e-book, you can place your cursor over the faint silver dotted lines below the changed text to discover the original text. The Detailed Notes section of these notes describe these emendations.
Please note that many print versions of Pudd’nhead Wilson include the phrase ‘spelling and usage have been brought into conformity with modern usage,’ and editors have been liberal with their renditions of Twain's story.
The Detailed Notes Section also includes issues that have come up during transcription. One common issue is that words are sometimes split into two lines for spacing purposes in the original text. These words are hyphenated in the physical book, but there is a question sometimes as to whether the hyphen should be retained in transcription. The reasons behind some of these decisions are itemized.
The Chapter Titles, such as Doom in Chapter XXI., were not part of Twain's book. They remain from another version of this book. The chapter titles are used in PG's Mark Twain index, so we have retained them.
The Author’s Note to Those Extraordinary Twins is actually the author's introduction to the novella, Those Extraordinary Twins. Twain originally produced this book with two parts: Pudd'nhead Wilson and Those Extraordinary Twins.
Project Gutenberg offers both stories, so we present the Author's Note as the Introduction to Those Extraordinary Twins, as Twain intended. If you want to read the Author's Note, please visit the Introduction of our production of the novella, Those Extraordinary Twins.
On Page 19, barber-shop was hyphenated between two lines for spacing. The 1899 Harper & Brothers version used "barber shop" in this spot. Even though barber-shop cannot be transcribed as such, the assumption is that the 1894 version put in the hyphen by mistake. We transcribed the word barber shop.
On Page 34, changed ca’se to ’ca’se, used as dialect for because, in the clause: "but dat’s ca’se it’s mine." The author used ’ca’se eighteen other times as dialect for because, and did not use ca’se again.
On Page 43, insert missing period after tomb.
On Page 81, add a comma after door: "The twins took a position near the door the widow stood at Luigi’s side, Rowena stood beside Angelo,..."
On Page 88, add a period after fault in the sentence: The Judge laid himself out hospitably to make them have a good time, and if there was a defect anywhere it was not his fault.
On Page 114, there is a word missing before the semicolon in the clause: Tom sprang up and seized a billet of wood and raised ; the 1899 Harper & Brothers version provided the missing word, "it."
On Page 131, change dicision to decision in the clause: Luigi reserved his dicision.
On Page 133, change comma to a period after years in the sentence: “I never got a chance to try my hand at it, and I may never get a chance; and yet if I ever do get it I shall be found ready, for I have kept up my law-studies all these years,”
On Page 149, Correct spelling of Cappello to Capello. The surname of the twins was Capello in the letter on page 73, and two other times in Chapter 6.
On Page 167, Change ’ to ” in the sentence: “Why, my boy, you look desolate. Don’t take it so hard. Try and forget you have been kicked.’
On Page 176, ship-shape was hyphenated and split between two lines for spacing. The 1899 Harper & Brothers version of the novel used shipshape, and so will we.
On Page 182, changed period after hatching to question mark in the sentence: What could be hatching.
On Page 184, remove comma after sha'n't, in the clause: but if he doesn’t, I sha’n’t, let on.
On Page 189, low-down is hyphenated and split between two lines for spacing. On Page 188, low-down is spelled with a hyphen, and on pages 241 and 243 low-downest is also hyphenated. There is no occurrence of lowdown. We transcribed low-down with a hyphen: like a ornery low-down hound!
On Page 216, Changed ? to ! in the sentence: En keep on sayin’ it?
On Page 229, Changed 'against to against in the clause: with fury ’against the planter’s wife.
On Page 233, Changed de to den in the clause "en de good gracious me." The author always used den for then, except in this case. De is dialect for the. Twain did not correct this in the 1899 Harper & Brothers version of the novel, but den makes more sense then de. Roxy was floating on the river, and then she cried good gracious me, because she spotted the Grand Mogul.
Changed day to dey in two places. The novel used dey as dialect for they regularly, and almost consistently, except in two cases. Both cases were presumed errata:
On Page 253, back-yard is hyphenated and split between two lines for spacing. The 1899 Harper & Brothers version of the novel used back-yard, and so will we.
On Page 273, changed countenence to countenance in the clause: “I don’t know about that,” and Tom’s countenence darkened,...
On Page 288, there are two quotes made by the crowd in double quotes. Twain did not correct this in the 1899 version of the novel by Harper & Brothers. But these lines are surrounded by Wilson's narrative, which is already in double quotes. Therefore, we have used single quotes for the two remarks from the gallery.
On Page 302, removed in from the sentence: "But we cannot follow his curious fate further—that in would be a long story."
*** END OF THIS PROJECT GUTENBERG EBOOK THE TRAGEDY OF PUDD'NHEAD WILSON ***
******* This file should be named 102-h.htm or 102-h.zip *******
This and all associated files of various formats will be found in:
http://www.gutenberg.org/1/0/102/
Updated editions will replace the previous one—the old editions will be renamed.
Creating the works from public domain print editions means that no one owns a United States copyright in these works, so the Foundation (and you!) can copy and distribute it in the United States without permission and without paying copyright royalties. Special rules, set forth in the General Terms of Use part of this license, apply to copying and distributing Project Gutenberg™ electronic works to protect the PROJECT GUTENBERG™ concept and trademark. Project Gutenberg is a registered trademark, and may not be used if you charge for the eBooks, unless you receive specific permission. If you do not charge anything for copies of this eBook, complying with the rules is very easy. You may use this eBook for nearly any purpose such as creation of derivative works, reports, performances and research. They may be modified and printed and given away—you may do practically anything with public domain eBooks. Redistribution is subject to the trademark license, especially commercial redistribution.
*** START: FULL LICENSE ***
THE FULL PROJECT GUTENBERG LICENSE PLEASE READ THIS BEFORE YOU DISTRIBUTE OR USE THIS WORK
To protect the Project Gutenberg™ mission of promoting the free distribution of electronic works, by using or distributing this work (or any other work associated in any way with the phrase "Project Gutenberg"), you agree to comply with all the terms of the Full Project Gutenberg™ License (available with this file or online at http://gutenberg.net/license).
Section 1. General Terms of Use and Redistributing Project Gutenberg™ electronic works
1.A. By reading or using any part of this Project Gutenberg™ electronic work, you indicate that you have read, understand, agree to and accept all the terms of this license and intellectual property (trademark/copyright) agreement. If you do not agree to abide by all the terms of this agreement, you must cease using and return or destroy all copies of Project Gutenberg™ electronic works in your possession. If you paid a fee for obtaining a copy of or access to a Project Gutenberg™ electronic work and you do not agree to be bound by the terms of this agreement, you may obtain a refund from the person or entity to whom you paid the fee as set forth in paragraph 1.E.8.
1.B. "Project Gutenberg" is a registered trademark. It may only be used on or associated in any way with an electronic work by people who agree to be bound by the terms of this agreement. There are a few things that you can do with most Project Gutenberg™ electronic works even without complying with the full terms of this agreement. See paragraph 1.C below. There are a lot of things you can do with Project Gutenberg™ electronic works if you follow the terms of this agreement and help preserve free future access to Project Gutenberg™ electronic works. See paragraph 1.E below.
1.C. The Project Gutenberg Literary Archive Foundation ("the Foundation" or PGLAF), owns a compilation copyright in the collection of Project Gutenberg™ electronic works. Nearly all the individual works in the collection are in the public domain in the United States. If an individual work is in the public domain in the United States and you are located in the United States, we do not claim a right to prevent you from copying, distributing, performing, displaying or creating derivative works based on the work as long as all references to Project Gutenberg are removed. Of course, we hope that you will support the Project Gutenberg™ mission of promoting free access to electronic works by freely sharing Project Gutenberg™ works in compliance with the terms of this agreement for keeping the Project Gutenberg™ name associated with the work. You can easily comply with the terms of this agreement by keeping this work in the same format with its attached full Project Gutenberg™ License when you share it without charge with others.
1.D. The copyright laws of the place where you are located also govern what you can do with this work. Copyright laws in most countries are in a constant state of change. If you are outside the United States, check the laws of your country in addition to the terms of this agreement before downloading, copying, displaying, performing, distributing or creating derivative works based on this work or any other Project Gutenberg™ work. The Foundation makes no representations concerning the copyright status of any work in any country outside the United States.
1.E. Unless you have removed all references to Project Gutenberg:
1.E.1. The following sentence, with active links to, or other immediate access to, the full Project Gutenberg™ License must appear prominently whenever any copy of a Project Gutenberg™ work (any work on which the phrase "Project Gutenberg" appears, or with which the phrase "Project Gutenberg" is associated) is accessed, displayed, performed, viewed, copied or distributed:
This eBook is for the use of anyone anywhere at no cost and with almost no restrictions whatsoever. You may copy it, give it away or re-use it under the terms of the Project Gutenberg License included with this eBook or online at www.gutenberg.net.
1.E.2. If an individual Project Gutenberg™ electronic work is derived from the public domain (does not contain a notice indicating that it is posted with permission of the copyright holder), the work can be copied and distributed to anyone in the United States without paying any fees or charges. If you are redistributing or providing access to a work with the phrase "Project Gutenberg" associated with or appearing on the work, you must comply either with the requirements of paragraphs 1.E.1 through 1.E.7 or obtain permission for the use of the work and the Project Gutenberg™ trademark as set forth in paragraphs 1.E.8 or 1.E.9.
1.E.3. If an individual Project Gutenberg™ electronic work is posted with the permission of the copyright holder, your use and distribution must comply with both paragraphs 1.E.1 through 1.E.7 and any additional terms imposed by the copyright holder. Additional terms will be linked to the Project Gutenberg ™ License for all works posted with the permission of the copyright holder found at the beginning of this work.
1.E.4. Do not unlink or detach or remove the full Project Gutenberg™ License terms from this work, or any files containing a part of this work or any other work associated with Project Gutenberg™.
1.E.5. Do not copy, display, perform, distribute or redistribute this electronic work, or any part of this electronic work, without prominently displaying the sentence set forth in paragraph 1.E.1 with active links or immediate access to the full terms of the Project Gutenberg™ License.
1.E.6. You may convert to and distribute this work in any binary, compressed, marked up, nonproprietary or proprietary form, including any word processing or hypertext form. However, if you provide access to or distribute copies of a Project Gutenberg™ work in a format other than "Plain Vanilla ASCII" or other format used in the official version posted on the official Project Gutenberg™ web site (www.gutenberg.net), you must, at no additional cost, fee or expense to the user, provide a copy, a means of exporting a copy, or a means of obtaining a copy upon request, of the work in its original "Plain Vanilla ASCII" or other form. Any alternate format must include the full Project Gutenberg™ License as specified in paragraph 1.E.1.
1.E.7. Do not charge a fee for access to, viewing, displaying, performing, copying or distributing any Project Gutenberg™ works unless you comply with paragraph 1.E.8 or 1.E.9.
1.E.8. You may charge a reasonable fee for copies of or providing access to or distributing Project Gutenberg™ electronic works provided that
* You pay a royalty fee of 20% of the gross profits you derive from the use of Project Gutenberg™ works calculated using the method you already use to calculate your applicable taxes. The fee is owed to the owner of the Project Gutenberg™ trademark, but he has agreed to donate royalties under this paragraph to the Project Gutenberg Literary Archive Foundation. Royalty payments must be paid within 60 days following each date on which you prepare (or are legally required to prepare) your periodic tax returns. Royalty payments should be clearly marked as such and sent to the Project Gutenberg Literary Archive Foundation at the address specified in Section 4, "Information about donations to the Project Gutenberg Literary Archive Foundation."
* You provide a full refund of any money paid by a user who notifies you in writing (or by e-mail) within 30 days of receipt that s/he does not agree to the terms of the full Project Gutenberg™ License. You must require such a user to return or destroy all copies of the works possessed in a physical medium and discontinue all use of and all access to other copies of Project Gutenberg ™ works.
* You provide, in accordance with paragraph 1.F.3, a full refund of any money paid for a work or a replacement copy, if a defect in the electronic work is discovered and reported to you within 90 days of receipt of the work.
* You comply with all other terms of this agreement for free distribution of Project Gutenberg™ works.
1.E.9. If you wish to charge a fee or distribute a Project Gutenberg™ electronic work or group of works on different terms than are set forth in this agreement, you must obtain permission in writing from both the Project Gutenberg Literary Archive Foundation and Michael Hart, the owner of the Project Gutenberg™ trademark. Contact the Foundation as set forth in Section 3 below.
1.F.
1.F.1. Project Gutenberg volunteers and employees expend considerable effort to identify, do copyright research on, transcribe and proofread public domain works in creating the Project Gutenberg™ collection. Despite these efforts, Project Gutenberg™ electronic works, and the medium on which they may be stored, may contain "Defects," such as, but not limited to, incomplete, inaccurate or corrupt data, transcription errors, a copyright or other intellectual property infringement, a defective or damaged disk or other medium, a computer virus, or computer codes that damage or cannot be read by your equipment.
1.F.2. LIMITED WARRANTY, DISCLAIMER OF DAMAGES: Except for the "Right of Replacement or Refund" described in paragraph 1.F.3, the Project Gutenberg Literary Archive Foundation, the owner of the Project Gutenberg™ trademark, and any other party distributing a Project Gutenberg™ electronic work under this agreement, disclaim all liability to you for damages, costs and expenses, including legal fees. You agree that you have no remedies for negligence, strict liability, breach of warranty or breach of contract except those provided in Paragraph F3. You agree that the Foundation, the trademark owner, and any distributor under this agreement will not be liable to you for actual, direct, indirect, consequential, punitive or incidental damages even if you give notice of the possibility of such damage.
1.F.3. LIMITED RIGHT OF REPLACEMENT OR REFUND: If you discover a defect in this electronic work within 90 days of receiving it, you can receive a refund of the money (if any) you paid for it by sending a written explanation to the person you received the work from. If you received the work on a physical medium, you must return the medium with your written explanation. The person or entity that provided you with the defective work may elect to provide a replacement copy in lieu of a refund. If you received the work electronically, the person or entity providing it to you may choose to give you a second opportunity to receive the work electronically in lieu of a refund. If the second copy is also defective, you may demand a refund in writing without further opportunities to fix the problem.
1.F.4. Except for the limited right of replacement or refund set forth in paragraph 1.F.3, this work is provided to you 'AS-IS', with no other warranties of any kind, express or implied, including but not limited to warranties of merchantibility or fitness for any purpose.
1.F.5. Some states do not allow disclaimers of certain implied warranties or the exclusion or limitation of certain types of damages. If any disclaimer or limitation set forth in this agreement violates the law of the state applicable to this agreement, the agreement shall be interpreted to make the maximum disclaimer or limitation permitted by the applicable state law. The invalidity or unenforceability of any provision of this agreement shall not void the remaining provisions.
1.F.6. INDEMNITY: You agree to indemnify and hold the Foundation, the trademark owner, any agent or employee of the Foundation, anyone providing copies of Project Gutenberg™ electronic works in accordance with this agreement, and any volunteers associated with the production, promotion and distribution of Project Gutenberg™ electronic works, harmless from all liability, costs and expenses, including legal fees, that arise directly or indirectly from any of the following which you do or cause to occur: (a) distribution of this or any Project Gutenberg™ work, (b) alteration, modification, or additions or deletions to any Project Gutenberg™ work, and (c) any Defect you cause.
Section 2. Information about the Mission of Project Gutenberg™
Project Gutenberg ™ is synonymous with the free distribution of electronic works in formats readable by the widest variety of computers including obsolete, old, middle-aged and new computers. It exists because of the efforts of hundreds of volunteers and donations from people in all walks of life.
Volunteers and financial support to provide volunteers with the assistance they need, is critical to reaching Project Gutenberg's™ goals and ensuring that the Project Gutenberg™ collection will remain freely available for generations to come. In 2001, the Project Gutenberg Literary Archive Foundation was created to provide a secure and permanent future for Project Gutenberg™ and future generations. To learn more about the Project Gutenberg Literary Archive Foundation and how your efforts and donations can help, see Sections 3 and 4 and the Foundation web page at http://www.pglaf.org.
Section 3. Information about the Project Gutenberg Literary Archive Foundation
The Project Gutenberg Literary Archive Foundation is a non profit 501(c)(3) educational corporation organized under the laws of the state of Mississippi and granted tax exempt status by the Internal Revenue Service. The Foundation's EIN or federal tax identification number is 64-6221541. Its 501(c)(3) letter is posted at http://pglaf.org/fundraising. Contributions to the Project Gutenberg Literary Archive Foundation are tax deductible to the full extent permitted by U.S. federal laws and your state's laws.
The Foundation's principal office is located at 4557 Melan Dr. S. Fairbanks, AK, 99712., but its volunteers and employees are scattered throughout numerous locations. Its business office is located at 809 North 1500 West, Salt Lake City, UT 84116,<PHONE_NUMBER>, email<EMAIL_ADDRESS>Email contact links and up to date contact information can be found at the Foundation's web site and official page at http://pglaf.org.
For additional contact information:
Dr. Gregory B. Newby
Chief Executive and Director
<EMAIL_ADDRESS>Section 4. Information about Donations to the Project Gutenberg Literary Archive Foundation
Project Gutenberg™ depends upon and cannot survive without wide spread public support and donations to carry out its mission of increasing the number of public domain and licensed works that can be freely distributed in machine readable form accessible by the widest array of equipment including outdated equipment. Many small donations ($1 to $5,000) are particularly important to maintaining tax exempt status with the IRS.
The Foundation is committed to complying with the laws regulating charities and charitable donations in all 50 states of the United States. Compliance requirements are not uniform and it takes a considerable effort, much paperwork and many fees to meet and keep up with these requirements. We do not solicit donations in locations where we have not received written confirmation of compliance. To send donations or determine the status of compliance for any particular state visit http://pglaf.org.
While we cannot and do not solicit contributions from states where we have not met the solicitation requirements, we know of no prohibition against accepting unsolicited donations from donors in such states who approach us with offers to donate.
International donations are gratefully accepted, but we cannot make any statements concerning tax treatment of donations received from outside the United States. U.S. laws alone swamp our small staff.
Please check the Project Gutenberg Web pages for current donation methods and addresses. Donations are accepted in a number of other ways including including checks, online payments and credit card donations. To donate, please visit: http://pglaf.org/donate.
Section 5. General Information About Project Gutenberg™ electronic works.
Professor Michael S. Hart is the originator of the Project Gutenberg™ concept of a library of electronic works that could be freely shared with anyone. For thirty years, he produced and distributed Project Gutenberg™ eBooks with only a loose network of volunteer support.
Project Gutenberg™ eBooks are often created from several printed editions, all of which are confirmed as Public Domain in the U.S. unless a copyright notice is included. Thus, we do not necessarily keep eBooks in compliance with any particular paper edition.
Most people start at our Web site which has the main PG search facility:
http://www.gutenberg.net
This Web site includes information about Project Gutenberg™, including how to make donations to the Project Gutenberg Literary Archive Foundation, how to help produce our new eBooks, and how to subscribe to our email newsletter to hear about new eBooks.


{{ subtitle }}
| User | Driver | Timestamp | Status |
|---|---|---|---|
| {{ request.userName }} | {{ request.driverName }} | {{ getDate(request.date_created).toLocaleDateString() }} | Placed Confirmed In Progress Completed |
| User | Driver | Timestamp | Status |
|---|---|---|---|
| {{ request.userName }} | {{ request.driverName }} | {{ getDate(request.date_created).toLocaleDateString() }} | Placed Confirmed In Progress Completed |


Welcome to CFStudy! This site is designed to match you with study buddies from Code 201. You will fill out a brief form to determine your preferences, and then receive matches based on your input. We strive to make sure you are matched with the best possible study buddies, so you won't be too overwhelmed, especially as you go on into 301!
To be matched with a study buddy, click "Get Matched!" on the laptop below.


HEAD
A player rolls the die repeatedly.The goal is to accumulate as many points as possible.However, if a player rolls a 1, the players turn is over and any point they have accumulated during this turn is fortfeited. Rolling a 1 doesnt wipe out your entire score from previous turns, just the total earned during that particular roll A player can also choose to hold,all of the points rolled during that turn are added to his or her score When aplayer reaches a 100 points or more, the game ends and that player is a winner.
The pig dice game is best with two players. It can also work with more players
Pig dice is a simple dice game which in its basic form is playable with just a single die you win by the first player to reach 100 points or more.
\Lets Play
Dice Roll:
Turn Score:
Overall Score:
Dice Roll:
Turn Score:
Overall Score:


My money's in that office, right?

She gonna tell me too.
Coyrigth
Copyrigth


In 2022, the world of virtual reality was upended by the arrival of a new invention from a genius programmer, Akihiko Kayaba. Called NerveGear, it was the first full-dive system and with it, came endless possibilities to VRMMORPGs. In 2026, a new machine called the Augma is developed to compete against the NerveGear and its successor, the Amusphere. A next-gen wearable device, the Augma doesn't have a full-dive function like its predecessors. Instead, it uses Augmented Reality (AR) to get players into the game. It is safe, user-friendly and lets users play while they are conscious, making it an instant hit on the market. The most popular game on the system is “Ordinal Scale” (aka: OS an ARMMORPG developed exclusively for the Augma. Asuna and the gang have already been playing OS for a while, by the time Kirito decides to join them. They’re about to find out that Ordinal Scale isn’t all fun and games…
Based on a mega hit Japanese novel that sold over 19 million copies worldwide, Sword Art Online is one of the most popular action/fantasy anime series. In this feature film, fans of the Sword Art Online franchise can experience a brand new adventure with Kirito, Asuna, and more fan-favorite characters. Two years after the SAO incident, where players were held captive inside the massive online role-playing game until they completed all 100 levels, a new Augmented-Reality MMORPG, "Ordinal Scale," became an instant hit on the market. Players soon realize that the line between virtual and reality is blurring and their worst nightmares are coming true. Kirito is about to join Asuna and friends to explore the world of "Ordinal Scale," but they’ll quickly find out that it isn’t all fun and games…


[define title]404 Not Found![end] [include "head.html"]
This page does not exist. Stop pretending it does.


Jon Snow is the Rightful King and last surviving member of the Stark line. Heir to Winterfell and the only candidate worthy of the Iron throne. Down with the Dragon queen and the Lannaster tyranny.
Trusted Advisor, Friend and Hand of the King
Wardeness of the North, Sister of Jon Snow
War Commander, Councillor and close friend
Financial Advisor and Lord Protector of the Vale of Arryn and the Eyrie
Acting Lord Commander of the Night's Watch and close friend
Mascot and loyal companion of Jon Snow
"He’s prettier then both my daughters, but he knows how to fight. He’s young, but he knows how to lead. He didn’t have to come to Hardhome. He came because he needs us. And we need him."
Tormund Giantsbane in Freefolk
"You are the son of the last true Warden of the North. Northern families are loyal, they'll fight for you if you ask. A monster has taken our home and our brother. We have to go back and save them both!"
Sansa Stark in Battle Of Bastards
"The crows killed him because he spoke for the Free Folk as no other southerner would. He died for us! If we are not willing to do the same, we're cowards. If that's what we are, we deserve to be the last of the Free Folk."
Tormund Giantsbane to Wildlings
"I'm not asking you to forget your dead. I’ll never forget mine. I lost fifty brothers the night that Mance attacked the Wall. But I’m asking you to think about your children now. They’ll never have children of their own if we don’t band together. The Long Night is coming and the dead come with it. No clan can stop them. The Free Folk can’t stop them, the Night’s Watch can’t stop them and all the southern kings can’t stop them! Only together. All of us. And even then it may not be enough, but at least we give the White Walkers a fight."
Jon Snow in regards to the White Walker threat


--- layout: post title: Lockpicking at Ekoparty Security Conference 2015 tags: [conference, lockpicking] ---


A game inspired by Tamagotchi mechanics, which revolve around taking care of a pet. The pet in our game is going to be a pink fairy armadillo, and there will be a page introducing the armadillo and highlighting conservation efforts towards it.


Neil Young Leaving Facebook Due to Platform’s ‘False Information’
by Corey IrwinIt’s going to be a lot harder to “friend” Neil Young. The rock icon announced that he's leaving Facebook due to what he views as “obvious commitments to one side of politics” by the social media platform.
Young explained his decision in a post on the official Neil Young Archives website. After first pointing out that “Facebook is sponsoring the annual gala of the Federalist Society, the powerful right-wing organization behind the nomination of the conservative supreme court justice Brett Kavanaugh,” Young went on to criticize the social media platform for "false information regularly supplied to the public.”
“NYA, no longer interested in further links with Facebook, will be discontinuing use,” the post declared in closing.
This is not the first time Young has revealed his displeasure with the social media site. In a separate message to fans posted on his website last month, Young noted that Facebook “gives you more than you want and it’s not all good. A lot of it is very bad misinformation about political campaigns and ads that are outright falsehoods. These are fine with Facebook, but not with NYA. If we were to leave Facebook with our social outreach, we would lose communications with millions. If we continue to be on Facebook, we are conflicted about who we are.”
It appears the rocker has a complicated relationship with social media on a broader scale. Back in May, Young abandoned his previous Twitter handle @NeilYoung in favor of @NeilYoungNYA. While the former handle had more than half-million followers, the new one currently sits at just a little more than 25,000.
Young’s decision to leave Facebook comes as the platform continues to grab controversial headlines. The social media site recently made clear that it will not remove political ads, regardless of whether the facts they present are true. Facebook head Mark Zuckerberg reportedly had a secret dinner with President Donald Trump in October, adding fuel to rumors of the company’s right-leaning support. Audio of Zuckerberg and other company heads criticizing Democratic presidential hopeful Elizabeth Warren was also leaked last month.
Neil Young Albums Ranked
41. 'Are You Passionate?' (2002)
Young's most disjointed album isn't sure what it wants to be. On one hand, it's an R&B record with backing provided by Booker T. & the M.G.'s. Then again, it's also a Crazy Horse album, with his longtime sparring group sitting in for one extended jam. Then there's "Let's Roll," which is about the 9/11 terrorist attacks, and the nine-minute closing track, "She's a Healer," which goes on forever. A mess from start to finish.
40. 'Peace Trail' (2016)
Part of the environmentally themed trilogy that includes 'The Monsanto Years' and the kinda-live 'Earth,' 'Peace Trail' is Young at his most anxious. The plugged-in acoustic songs sound like tossed-off bulletins from a restless artist who's taken a turn toward grumpy. Nearly 40 minutes of messy finger pointing.
39. 'Storytone' (2014)
Young's second album of 2014 swerves in a completely different direction from the stripped-down 'A Letter Home,' incorporating an orchestra, choir and big band. Many of the cuts are about the environment; some are love songs. They all add up to one of his most unfocused albums, a mess of too many ideas and not enough memorable tracks.
38. 'Old Ways' (1985)
Another record from Young's tumultuous Geffen years, when he played chicken with the label by making everything but the rock 'n' roll records the record label was hoping for (the company responded by shelving some of those albums). 'Old Ways,' a traditional country LP, lacks spark, inspiration and good songs.
37. 'Landing on Water' (1986)
After his record company sued him for making uncommercial music, Young released this album of scraps dusted off from some of Crazy Horse's unreleased 1984 sessions (which even Young's producer was unhappy with). The result, like much of Young's '80s output, is convoluted, half-assed and mostly forgettable.
36. 'This Note's for You' (1988)
At the tail end of his genre-jumping '80s run, Young shook off Geffen, returned to his old record company and delivered the sort of unconventional record that got him into so much trouble with his previous label. Taking shots at the music industry, and backed by a horn-powered, R&B-influenced group, Young drives 'This Note's for You' into the ground with one tuneless attack after another.
35. 'Everybody's Rockin'' (1983)
This was the album Young delivered to his record company after it insisted he make a rock 'n' roll album following the electronic mess 'Trans.' So he gave them a record filled with doo-wop, rockabilly and '50s nostalgia. 'Everybody's Rockin'' is a middle finger to the label, but the music never captures the charm or magnetism of the sounds it's emulating. No wonder his record company hated him.
34. 'Life' (1987)
Young's most forgettable album, another collaboration with Crazy Horse, was partly recorded live in concert. Sandwiched between two other bottom-of-the-barrel LPs from the dismal '80s, 'Landing on Water' and 'This Note's for You,' 'Life' sounds like an obligatory Crazy Horse outing. Only this time nobody's hearts were into it.
33. 'Trans' (1982)
Young's notorious electronic album -- featuring a Vocoder on most of the tracks -- started his tortured relationship with Geffen Records, which wanted a rock 'n' roll album not a synth-pop LP. It's a daring move by an always-daring artist, but that doesn't make it any more of a pleasant listen. It's jarring, to say the least. Young would spend most of the rest of the '80s making records that defied his record company and confused fans.
32. 'Fork in the Road' (2009)
Young closed out the first decade of the '00s with an album of car songs inspired by a 1959 Lincoln Continental he converted to a hybrid. Like many of his albums from the era, 'Fork in the Road' is stubbornly single-themed and, also like so many of them, kind of boring. Songs like "Fuel Line" and "Hit the Road," without context, sound aimless and lost.
31. 'The Monsanto Years' (2015)
Working with a new band, the Crazy Horse-like Promise of the Real (which includes Willie Neilson's sons), Young's most political album in years takes on GMO giant Monsanto in what pretty much amounts to a 50-minute PSA. It's loose and impulsive, but the single-minded agenda gets tiring after a while.
30. 'The Visitor' (2017)
Young's third collaboration with Promise of the Real, the band led by Willie Nelson's son, sounds like a tethered Crazy Horse record. There are a few quiet reflective moments, but mostly the album is about living under the shadow of Trump's presidency for a year. He's mostly coping, and coasting, here, offering little more than commentary on daily headlines backed by a musical template that swings from a circus waltz to the Broadway stage.
29. 'A Letter Home' (2014)
This all-covers album (of songs by Bob Dylan, Willie Nelson, Bruce Springsteen and others) features mostly just Young on vocals, guitar, harmonica and piano, and was recorded in a vintage 1947 recording booth in Jack White's Nashville studio (White guests on a couple of cuts). The intimacy is appealing, but too often 'A Letter Home' sounds slight and unfinished.
28.  The idea was to capture these songs in their original raging glories, but 'Americana' sounds tossed-off, like a hastily assembled and loose practice session before the real songs are tackled.
27. 'Silver & Gold' (2000)
Like many Young albums, 'Silver & Gold' was pieced together from abandoned songs over the years (one reportedly dated back to the early '80s). Its stripped-down atmosphere -- including harmonica, pedal steel and backing vocals by Emmylou Harris and Linda Ronstadt -- make it seem like another 'Harvest' descendant. But the ho-hum songs don't really back it up.
26. 'Broken Arrow' (1996)
Like 'Ragged Glory' and 'Sleeps With Angels,' two other '90s collaborations with Crazy Horse, 'Broken Arrow' is loose, free-form and muscular at times. But it's not as fully formed as those other two records, instead juggling long jams with shorter, more structured songs. Still, it would be a decade before he made another album this interesting.
25. 'Colorado' (2019)
Young's first album with Crazy Horse since 2012's 'Psychedelic Pill' has more in common with much of his environmentally minded '10s output than the freewheeling spirit of classic Crazy Horse records, but there's enough distortion and rage to keep fans happy. The biggest stumbles here are the more inward-looking love songs; when Young points fingers and turns up the volume, his angry-old-man poses sound like the real thing.
24. 'Neil Young' (1968)
Young's debut album was released on his 23rd birthday in 1968, and pretty much sounds like an extension of his songs from the previous year's 'Buffalo Springfield Again.' It's an occasionally shaky start, but some of the songs -- particularly "The Loner" -- hold up with Young's best.
23. 'American Stars 'n Bars' (1977)
Like so many of Young's albums, 'American Stars 'n Bars' has a scattered history. It includes several songs slated for not one, but two, separate follow-ups to his breakthrough 'Harvest' record. Crazy Horse show up on a few songs; so do old pals Emmylou Harris and Linda Ronstadt. Even with its rocky formation, the album holds together well, especially the centerpiece "Like a Hurricane."
22. 'Hawks & Doves' (1980)
Yet another Neil Young album culled from old sessions. The first half of 'Hawks & Doves' includes songs originally recorded for a 'Harvest' follow-up, 'Homegrown'; the second side includes new country songs that were among Young's most political at the time. A bit perplexing coming after the landmark 'Rust Never Sleeps,' but a typical Neil Young curveball in that regard.
21. 'Re-ac-tor' (1981)
The follow-up to the pieced-together and laid-back 'Hawks & Doves' can almost be seen as a reaction to the earlier record, as Young -- working once again with Crazy Horse -- plugs in and takes on the '80s with some of the toughest-sounding songs he's ever recorded.
20. 'Hitchhiker' (2017)
Back in August 1976, Young spent some time in a studio with just his acoustic guitar and harmonica. The recordings, like others from the era, sat on the shelf for years. While many of the songs surfaced elsewhere over time – "Pocahontas," "Powderfinger" – these stripped-down readings (finally released in 2017) give ghostly intimacy and a striking balance to a once-lost album.
19. 'Greendale' (2003)
Young's nearly 80-minute rock opera about a small-town family and the way politics and the environment affects it at the turn of the century is one of the artist's most ambitious projects. It's also one of his messiest, thanks to Crazy Horse's sloppy playing (not really suited to a sprawling narrative like this) and the muddled storyline. Plus, it goes on way past the point of anyone caring.
18. 'Prairie Wind' (2005)
A quiet little victory after 'Are You Passionate?' and 'Greendale,' 'Prairie Wind' is one of Young's most meditative records, informed partly by his father's recent death. Young himself suffered an aneurysm shortly after the songs were recorded, adding even more heft to an already poignant LP.
17. 'Chrome Dreams II' (2007)
Back in 1977, Young was all ready to release an album called 'Chrome Dreams' when it was retooled as 'American Stars 'n Bars.' This sequel, 30 years later, isn't as good as that scrapped LP, but a handful of its songs -- which, like so many of Young's albums, had been sitting around for years before finally finding a home -- rank among his best of the '00s.
16. 'Living With War' (2006)
Written and recorded in less than 10 days, 'Living With War' plays like a visceral reaction to 2006's headlines (most notably, the war in Iraq). And with songs like "Let's Impeach the President," it's Young's most political work in decades, too. It doesn't always connect, but his commitment to music and the issues that drive it is palpable.
15. 'Mirror Ball' (1995)
Young and the members of Pearl Jam bonded while playing a Bob Dylan tribute concert in 1992. A few years later, they bashed out this electric LP live in the studio, coming off like a more polished Crazy Horse. Young's string of comeback records (which started six years earlier with 'Freedom') ended here.
14. 'Comes a Time' (1978)
Young was on track so many times to deliver a sequel to his chart-topping 'Harvest' that by the time he sort of got around to making one, it took several detours along the way. 'Comes a Time' started as a solo record, until backing groups (including Crazy Horse for a couple of cuts) were brought in to goose up the sound. The easygoing charm is all 'Harvest,' but the excellent songs are distinctly its own.
13. 'Psychedelic Pill' (2012)
Young's second album of 2012 (and second with Crazy Horse that year), following the traditional 'Americana,' trades structured songcraft for drawn-out jams and riff-heavy rock 'n' roll. With two songs clocking in at more than 16 minutes, and one at 27 minutes(!), 'Psychedelic Pill' can be a long and exhausting listen. But it's one of Young's best works of the 21st century, a volume-cranking statement by a still-vital artist.
12.  Young, along with producer Daniel Lanois, constructs a sonic template of feedback, distortion and skeletal fragments of songs. It all comes together in a glorious mix of abrasive guitar noise and avant-garde garage rock.
11. 'Harvest Moon' (1992)
Young's long-delayed sequel to 'Harvest' was shaped, in part, by his tinnitus, which he developed following the punishing 'Ragged Glory' sessions and tour. Unplugged and working with many of the same musicians who contributed to the 1972 classic, Young turns in one of his most tranquil records, filled with the sort of introspection and laid-back ease that come with age.
10. 'Sleeps With Angels' (1994)
Like the classic 'Tonight's the Night,' 'Sleeps With Angels' is a dark, brooding rumination on death, particularly Kurt Cobain's. Backed by Crazy Horse, Young plugs in and chips away at the walls of doom around him with feedback and orchestrated noise (the 14-minute "Change Your Mind" is the highlight). Not an easy listen, but a passionate one, and one of Young's most haunting, and haunted, albums.
9. 'Zuma' (1975)
One of Young's best guitar albums, and a blazing showcase for a retooled Crazy Horse, 'Zuma' marks both the beginning and ending of key eras during the '70s. For the most part, the album crawls out of the darkness that permeated 'Tonight's the Night' and 'On the Beach,' while once again picking up some spare pieces from his past. Plus, it includes "Cortez the Killer," perhaps his all-time greatest guitar jam.
8. 'Freedom' (1989)
After spending most of the '80s releasing one disappointing album after another, Young got back on track at the end of the decade with his most focused record in years. He unleashes an era's worth of rage on 'Freedom,' swinging at the sociopolitical landscape like his future counted on it. It helped that it was all anchored by "Rockin' in the Free World,' one of his all-time greatest songs.
7. 'Ragged Glory' (1990)
'Ragged Glory''s predecessor, 'Freedom,' made Young a viable artist again, but this is the album that sealed that comeback. Plugged in and sounding more alive than they had in years, Young and Crazy Horse tear through a set of songs that take their electric fury to brand new levels. Then in his mid-40s, Young found new life with his old band.
6. 'On the Beach' (1974)
The follow-up to 'Harvest' arrived following a live album, a soundtrack and a few shelved LPs. Like 'Tonight's the Night,' which was recorded earlier but released later, 'On the Beach' sounds thrown together. Working with various musicians, including members of Crazy Horse, Young still seems to be reeling from success, the death of friends and the '60s (not necessarily in that order). A gloomy album, but one of his most underrated.
5. 'Everybody Knows This Is Nowhere' (1969)
After a somewhat sketchy debut in 1968, Young returned to the studio the following year with a new backing band (Crazy Horse) and am armful of great new songs that would help define his long career as one of rock's premier guitar players. 'Everybody Knows This Is Nowhere' is one of his most focused and consistent albums, with nearly every song turning up the passion or volume or both.
4. 'Tonight's the Night' (1975)
'Tonight's the Night' was so bleak and despairing when it was recorded in 1973 that Young's record company didn't want to release it (which is why it sat on the shelf for two years). Mostly recorded in a single session following the drug-related deaths of two friends (including Crazy Horse guitarist Danny Whitten, whose band backs Young on part of the album), the LP remains one of rock's darkest, harrowing and cathartic works.
3. 'Rust Never Sleeps' (1979)
Side one was recorded solo acoustic; side two, plugged in with Crazy Horse. And it was all captured onstage in front of an audience hearing the songs for the very first time. It's a great idea, and one that Young pulls off with style and introspection. In a way, 'Rust Never Sleeps' is a concept album about the end of the '70s and his place in them. But it's also just a great record with excellent songs, killer riffs and zero filler.
2. 'Harvest' (1972)
Young's only No. 1 album (propelled by his only No. 1 single, "Heart of Gold"), 'Harvest' is a landmark record for both the artist and the era. Stripped down to acoustic instruments and filled with some of his best songs, the record swings through country, folk and Americana, detouring slightly for a couple of songs about life, death and other big issues.
1. 'After the Gold Rush' (1970)
Young's third album pretty much set the template for his career. Pieced together from various sessions (some from Los Angeles, some from Young's home), various bands (Crazy Horse here, 18-year-old Nils Lofgren there) and various time periods (from late 1969 through mid 1970), 'After the Gold Rush' is held together by Young's reflection on the past decade and his hopes for the new one. It includes some of his best songs (the title track, "Only Love Can Break Your Heart," "Southern Man"), but more importantly it established Young as one of rock's most visionary and exciting artists.


This gal killed it on the frontend development with Douglas.
This guy crushed the frontend dvelopment with Claire.
This guy crushed the backend development SOLO like a boss.
This guy structured and styled the UI.
Our fearless leader.
Submit your email to be contacted regarding projects.


{% extends 'panel.html' %} {% load bootstrap_tags %} {% load utilities %} {% block head_title %}Import AncestryDNA data{% endblock %} {% block extra_js %} {{ form.media }} {% endblock %} {% block panel_content %}
To import AncestryDNA data you'll need to download your raw data file from AncestryDNA:
You can use the form below to upload your raw AncestryDNA data to Open Humans. Files are uploaded immediately. Once you're done adding the file, press the "Process" button to process your AncestryDNA data.
{% include "s3upload/_dropzone_form.html" with form=form %}


Engagement Portal Login
Invalid username and/or password.
You have been logged out.
username
password


Secret keyword The secret keyword can be anything you'd like, but it's better to make it harder to guess. This is the only piece of information that you have to keep safe and all your passwords will be based on it.
What for? This is the name of the service you generate the password for, for example name it facebook, gmail, skype, yahoo, amazon, github or anything else.
Length (8-64) Upper Case Lower Case Numbers Special Characters There are several options to amend the complexity of the passwords, for example you can make it shorter (15 characters by default) or turn off special characters.
Click here to generate your unique password. The result will always be based on the keyword and the 'what for' values that you provide.
Result The result will be a strong and unique password that you never need to remember!


{% extends "base.html" %} {% block header %}
Please update their FTE value to match their current contract.
{% include "person_list.html" with additional_context=persons_without_fte %}The LeadLink of the super-circle should grant attention points to these circles.
{% include "circle_list.html" with total=circles_without_attention_points.total object_list=circles_without_attention_points.object_list editable=True %}The LeadLinks of the circles should assign attention points to them.
{% include "rolefiller_list.html" with total=rolefillers_without_attention_points.total object_list=rolefillers_without_attention_points.object_list %}Please delete these Persons.
{% include "person_list.html" with additional_context=persons_not_in_glassfrog %}Please delete these Circles. Any remaining Attention Points should be redistributed.
{% include "circle_list.html" with total=circles_not_in_glassfrog.total object_list=circles_not_in_glassfrog.object_list hide_points=1 %}
Consider redistributing the Attentions Points
that become available when deleting these roles.
Please delete these Role Fillers.
Any remaining Attention Points should be redistributed.


Hi there, I am David A. Lindahl.
I am a...
Photographer
Web Developer
Visual Raconteur
Education
Code Fellows
Software Engineer Program
Whitworth University
Economics, B.A.
Professional Experience
Capital One Investing
Anti-Money Laundering Investigator
ShareBuilder
Operations Analyst
Fidelity Investments
International Trading Team
My Top 10 Favorite National Parks
- Glacier
- North Cascades
- Olympic
- Mount Rainier
- Grand Teton
- Arches
- Yosemite
- Crater Lake
- Yellowstone
- The Grand Canyon


Tips about variance in scala
Type variance in scala is quite a tricky topic especially if you do not use it often - details might slip out of mind easily in this case. So below you can find very short tips about it which purpose is to remind how it works.
All code for examples below can be found here.
Java problem
In Java all generic types are covariant and because of it we can write this non-working code:
/**
* Example of a problem with covariant types in Java
*/
public class CovarianceProblem {
public static void main(String[] args) {
String[] strArray = { "str#1", "str#2" };
Object[] objArray = strArray;
objArray[0] = 1; //throws ArrayStoreException: java.lang.Integer
}
}
Why do we need it?
In order to deal with the problem above we need type variance to define and distinguish different relations between generic classes which specific types have inherited relationships between them.
There are three possible options:
- Invariant
- Covariant
- Contravariant
Examples
Let’s use this simple class tree for examples(in Variance.scala):
class GrandParent
class Parent extends GrandParent
class Child1 extends Parent
class Child2 extends Parent
Invariant
Invariant means that there is no relation between InVariant[Parent]
and InVariant[Child1]
or InVariant[Child2]
val parentInvariant = new InVariant[Parent]
// Next lines cannot be compiled because of invariant
//val child1Invariant: InVariant[Child1] = parentInvariant
//val child2Invariant: InVariant[Child2] = parentInvariant
Covariant
Covariant means that CoVariant[Child1]
and CoVariant[Child2]
are subclasses of CoVariant[Parent]
val child1Covariant = new CoVariant[Child1]
val child2Covariant = new CoVariant[Child2]
//We can use values of CoVariant[Child1|Child2] as CoVariant[Parent]
val parentCovariant1: CoVariant[Parent] = child1Covariant
val parentCovariant2: CoVariant[Parent] = child2Covariant
Example of correct usage:
//we can use a covariant type as
class Producer[+A](val value: A) { // a type for immutable values
private[this] var variable: A = ??? // a type for private mutable variables
def simpleProduce(): A = ??? // a type for method outputs
def complexProduce[B >: A](b: B): A = ??? // a lower type bound
}
Example of incorrect usage:
//code below cannot be compiled
//we can not use a covariant type as
class Producer[+A](var variable: A) { // a type for public mutable variables
def consume(a: A): Unit = ??? // a type for method parameters
}
Contravariant
Contravariant means that ContraVariant[Parent]
is a subclass of ContraVariant[Child2]
and ContraVariant[Child2]
val parentContravariant = new ContraVariant[Parent]
//Looks awkward but it is totally legit :)
val child1Contravariant: ContraVariant[Child1] = parentContravariant
val child2Contravariant: ContraVariant[Child2] = parentContravariant
Example of correct usage:
//we can use a contravariant type as
class Consumer[-A]() {
private[this] var variable: A = ??? // a type for private mutable variables
def consume(a: A): Unit = ??? // a type for method parameters
def complex[B <: A](b: B): Unit = ??? // a upper type bound
}
Example of incorrect usage:
//code below cannot be compiled
//we can not use a contravariant type as
class Producer[-A](val value: A, var variable: A) { // a type for public immutable values and publis mutable variables
def produce(): A = ??? // a type for for method outputs
def complexProduce[B >: A](b: B): A = ??? // a lower type bound
}
How to use Contravariance
Code for this part is here.
Contravariance probably is a bit counterintuitive thing but the next example should help to understand when it is possible to use it. Let’s imagine that we want to implement our own type-safe event system with a handler register and event handlers. The classic thing but with one requirement - we want to be able to handle events in a generalised way. More details below.
So we have Event
trait as a base trait for all possible events, UpdateEvent
- for events about update operations and several more specific traits and classes(in Event.scala
)
/**
* The very basic trait to describe an event
*/
trait Event
/**
* The marker trait for events for data updates
*/
trait UpdateEvent extends Event{
/** Id of the updated entity */
def entityId: UUID
}
/**
* The marker trait for events about wares
*/
trait WareEvent extends Event {
/**Id the ware which is a reason of the event */
def wareId: UUID
}
/**
* The marker trait for events about users
*/
trait UserEvent extends Event {
/** Email of the user who is a reason of the event */
def email: String
}
/*
* Specific events
*/
case class ChangeWarePriceEvent(wareId: UUID,
oldPrice: BigDecimal,
newPrice: BigDecimal) extends WareEvent with UpdateEvent {
override def entityId: UUID = wareId
}
case class ChangeUserPhoneEvent(userId: UUID, userEmail: String, oldPhone: String, newPhone: String)
extends UserEvent
with UpdateEvent
{
override def email: String = userEmail
/* Let's say that a user email is an unique identifier of a user */
override def entityId: UUID = userId
}
Next thing is handling events. And as it was said before we want to handle events in a generalised way which means next:
- We have a generalised event handler
ConsoleLogEventHandler
- can handle all possible types of events
/**
* Logs all events to stdout using .toString
*/
class ConsoleLogEventHandler extends EventHandler[Event]{
override def handle(event: Event): Unit = {
println(s"logger - event has been received: [$event]")
}
}
- We have specialised handlers like
DiscountEventHandler
orCheckNumberEventHandler
- can handle just one typeChangeWarePriceEvent
orChangeUserPhoneEvent
/**
* Notifies users about discounts (the new price of a ware is less than the old one)
*/
class DiscountEventHandler extends EventHandler[ChangeWarePriceEvent]{
override def handle(event: ChangeWarePriceEvent): Unit = {
if(event.oldPrice > event.newPrice) {
val discount = 1 - event.newPrice / event.oldPrice
println(s"there is a discount[${discount * 100} %] for the ware[id: ${event.wareId}]")
}
}
}
/**
* Sends SMS to the new phone number if a user change it.
*/
class CheckNumberEventHandler extends EventHandler[ChangeUserPhoneEvent]{
override def handle(event: ChangeUserPhoneEvent): Unit = {
println(s"SMS has been sent to the phone:${event.newPhone}")
}
}
- We want to add several handlers for an event type and make it type-safely:
// ok
handlerRegister.addHandler(classOf[ChangeUserPhoneEvent], ConsoleLogEventHandler)
handlerRegister.addHandler(classOf[ChangeWarePriceEvent], ConsoleLogEventHandler)
handlerRegister.addHandler(classOf[ChangeUserPhoneEvent], CheckNumberEventHandler)
handlerRegister.addHandler(classOf[ChangeWarePriceEvent], DiscountEventHandler)
// generates compilation errors
handlerRegister.addHandler(classOf[ChangeUserPhoneEvent], DiscountEventHandler)
In order to make it possible we should use a contravariant event handler:
/**
* Basic trait for an event handler
*/
trait EventHandler[-T <: Event] {
/**
* Handle a particular event
* @param event an event to handle
*/
def handle(event: T): Unit
}
And define addHandler(...)
as:
/**
* Adds a handler for a particular type of events
* @param eventType the class of events handled by the eventHandler
* @param eventHandler the event handler which should handle all events of the specific type(eventType)
* @tparam E type of the event we want to handle
* @tparam T intermediate type.
* Means that we want to handle an event of type `E` as `T`.
* And `T` should be between Event and `E` in the chain of inheritance.
* If we have such types: `Event <- SubEventType <- SubSubEventType <- ... <- E`
* then `T` can be one of these types
* @tparam H type of the handler which should handle all events of type `E`
*/
def addHandler[E <: Event, T >: E <: Event, H <: EventHandler[T]](eventType: Class[E], eventHandler: H): Unit
This is possible only if we use contravariance for EventHandler. If we define it like invariant(EventHandler[T <: Event]
) and use generalised handlers then we will have errors like that:
Error:(12, 19) inferred type arguments [ChangeUserPhoneEvent, ChangeUserPhoneEvent, ConsoleLogEventHandler.type] do not conform to method addHandler's type parameter bounds [E <: Event, T >: E <: Event, H <: EventHandler[T]]
handlerRegister.addHandler(classOf[ChangeUserPhoneEvent], ConsoleLogEventHandler)
Error:(12, 37) type mismatch;
found : Class[ChangeUserPhoneEvent](classOf[ChangeUserPhoneEvent])
required: Class[E]
handlerRegister.addHandler(classOf[ChangeUserPhoneEvent], ConsoleLogEventHandler)
Error:(12, 61) type mismatch;
found : ConsoleLogEventHandler.type
required: H
handlerRegister.addHandler(classOf[ChangeUserPhoneEvent], ConsoleLogEventHandler)
And of course it is also impossible to use covariance in this case.