--- layout: post title: "Combining free monads in Haskell" description: "An example on how to compose free monads in Haskell." date: 2017-07-24 15:33 UTC tags: [Software Design, Haskell, Functional Programming] --- {% include JB/setup %}
{{ page.description }}
In the previous article in this series on pure interactions, you saw how to write a command-line wizard in F#, using a free monad to build an Abstract Syntax Tree (AST). The example collects information about a potential restaurant reservations you'd like to make. That example, however, didn't do more than that.
For a more complete experience, you'd like your command-line interface (CLI) to not only collect data about a reservation, but actually make the reservation, using the available HTTP API. This means that you'll also need to model interaction with the HTTP API as an AST, but a different AST. Then, you'll have to figure out how to compose these two APIs into a combined API.
In order to figure out how to do this in F#, I first had to do it in Haskell. In this article, you'll see how to do it in Haskell, and in the next article, you'll see how to translate this Haskell prototype to F#. This should ensure that you get a functional F# code base as well.
Let's make an easy start of it. In a previous article, you saw how to model command-line interactions as ASTs, complete with syntactic sugar provided by a computation expression. That took a fair amount of boilerplate code in F#, but in Haskell, it's declarative:
import Control.Monad.Trans.Free (Free, liftF) data CommandLineInstruction next = ReadLine (String -> next) | WriteLine String next deriving (Functor) type CommandLineProgram = Free CommandLineInstruction readLine :: CommandLineProgram String readLine = liftF (ReadLine id) writeLine :: String -> CommandLineProgram () writeLine s = liftF (WriteLine s ())
This is all the code required to define your AST and make it a monad in Haskell. Contrast that with all the code you have to write in F#!
The CommandLineInstruction
type defines the instruction set, and makes use of a language extension called DeriveFunctor
, which enables Haskell to automatically create a Functor
instance from the type.
The type alias type CommandLineProgram = Free CommandLineInstruction
creates a monad from CommandLineInstruction
, since Free
is a Monad
when the underlying type is a Functor
.
The readLine
value and writeLine
function are conveniences that lift the instructions from CommandLineInstruction
into CommandLineProgram
values. These were also one-liners in F#.
You can write a small wizard to collect restaurant reservation data with the CommandLineProgram
API, but the new requirement is to make HTTP calls so that the CLI program actually makes the reservation against the back-end system. You could extend CommandLineProgram
with more instructions, but that would be to mix concerns. It'd be more appropriate to define a new instruction set for making the required HTTP requests.
This API will send and receive more complex values than simple String
values, so you can start by defining their types:
data Slot = Slot { slotDate :: ZonedTime, seatsLeft :: Int } deriving (Show) data Reservation = Reservation { reservationDate :: ZonedTime , reservationName :: String , reservationEmail :: String , reservationQuantity :: Int } deriving (Show)
The Slot
type contains information about how many available seats are left on a particular date. The Reservation
type contains the information required in order to make a reservation. It's similar to the Reservation
F# record type you saw in the previous article.
The online restaurant reservation HTTP API may afford more functionality than you need, but there's no reason to model more instructions than required:
data ReservationsApiInstruction next = GetSlots ZonedTime ([Slot] -> next) | PostReservation Reservation next deriving (Functor)
This instruction set models two interactions. The GetSlots
case models an instruction to request, from the HTTP API, the slots for a particular date. The PostReservation
case models an instruction to make a POST HTTP request with a Reservation
, thereby making a reservation.
Like the above CommandLineInstruction
, this type is (automatically) a Functor
, which means that we can create a Monad
from it:
type ReservationsApiProgram = Free ReservationsApiInstruction
Once again, the monad is nothing but a type alias.
Finally, you're going to need the usual lifts:
getSlots :: ZonedTime -> ReservationsApiProgram [Slot] getSlots d = liftF (GetSlots d id) postReservation :: Reservation -> ReservationsApiProgram () postReservation r = liftF (PostReservation r ())
This is all you need to write a wizard that interleaves CommandLineProgram
and ReservationsApiProgram
instructions in order to create a more complex AST.
The wizard should do the following:
readParse :: Read a => String -> String -> CommandLineProgram a readParse prompt errorMessage = do writeLine prompt l <- readLine case readMaybe l of Just dt -> return dt Nothing -> do writeLine errorMessage readParse prompt errorMessage
It first uses writeLine
to write prompt
to the command line - or rather, it creates an instruction to do so. The instruction is a pure value. No side-effects are involved until an interpreter evaluates the AST.
The next line uses readLine
to read the user's input. While readLine
is a CommandLineProgram String
value, due to Haskell's do
notation, l
is a String
value. You can now attempt to parse that String
value with readMaybe
, which returns a Maybe a
value that you can handle with pattern matching. If readMaybe
returns a Just
value, then return the contained value; otherwise, write errorMessage
and recursively call readParse
again.
Like in the previous F# example, the only way to continue is to write something that readMaybe
can parse. There's no other way to exit; there probably should be an option to quit, but it's not important for this demo purpose.
You may also have noticed that, contrary to the previous F# example, I here succumbed to the temptation to break the rule of three. It's easier to define a reusable function in Haskell, because you can leave it generic, with the proviso that the generic value must be an instance of the Read
typeclass.
The readParse
function returns a CommandLineProgram a
value. It doesn't combine CommandLineProgram
with ReservationsApiProgram
. That's going to happen in another function, but before we look at that, you're also going to need another little helper:
readAnything :: String -> CommandLineProgram String readAnything prompt = do writeLine prompt readLine
The readAnything
function simply writes a prompt, reads the user's input, and unconditionally returns it. You could also have written it as a one-liner like readAnything prompt = writeLine prompt >> readLine
, but I find the above code more readable, even though it's slightly more verbose.
That's all you need to write the wizard:
tryReserve :: FreeT ReservationsApiProgram CommandLineProgram () tryReserve = do q <- lift $ readParse "Please enter number of diners:" "Not an Integer." d <- lift $ readParse "Please enter your desired date:" "Not a date." availableSeats <- liftF $ (sum . fmap seatsLeft) <$> getSlots d if availableSeats < q then lift $ writeLine $ "Only " ++ show availableSeats ++ " remaining seats." else do n <- lift $ readAnything "Please enter your name:" e <- lift $ readAnything "Please enter your email address:" liftF $ postReservation Reservation { reservationDate = d , reservationName = n , reservationEmail = e , reservationQuantity = q }
The tryReserve
program first prompt the user for a number of diners and a date. Once it has the date d
, it calls getSlots
and calculates the sum of the remaining seats. availableSeats
is an Int
value like q
, so you can compare those two values with each other. If the number of available seats is less than the desired quantity, the program writes that and exits.
This interaction demonstrates how to interleave CommandLineProgram
and ReservationsApiProgram
instructions. It would be a bad user experience if the program would ask the user to input all information, and only then discover that there's insufficient capacity.
If, on the other hand, there's enough remaining capacity, the program continues collecting information from the user, by prompting for the user's name and email address. Once all data is collected, it creates a new Reservation
value and invokes postReservation
.
Consider the type of tryReserve
. It's a combination of CommandLineProgram
and ReservationsApiProgram
, contained within a type called FreeT
. This type is also a Monad
, which is the reason the do
notation still works. This also begins to explain the various lift
and liftF
calls sprinkled over the code.
Whenever you use a <-
arrow to 'pull the value out of the monad' within a do
block, the right-hand side of the arrow must have the same type as the return type of the overall function (or value). In this case, the return type is FreeT ReservationsApiProgram CommandLineProgram ()
, whereas readParse
returns a CommandLineProgram a
value. As an example, lift
turns CommandLineProgram Int
into FreeT ReservationsApiProgram CommandLineProgram Int
.
The way the type of tryReserve
is declared, when you have a CommandLineProgram a
value, you use lift
, but when you have a ReservationsApiProgram a
, you use liftF
. This depends on the order of the monads contained within FreeT
. If you swap CommandLineProgram
and ReservationsApiProgram
, you'll also need to use lift
instead of liftF
, and vice versa.
tryReserve
is a pure value. It's an Abstract Syntax Tree that combines two separate instruction sets to describe a complex interaction between user, command line, and an HTTP client. The program doesn't do anything until interpreted.
You can write an impure interpreter for each of the APIs, and a third one that uses the other two to interpret tryReserve
.
Interpreting CommandLineProgram
values is similar to the previous F# example:
interpretCommandLine :: CommandLineProgram a -> IO a interpretCommandLine program = case runFree program of Pure r -> return r Free (ReadLine next) -> do line <- getLine interpretCommandLine $ next line Free (WriteLine line next) -> do putStrLn line interpretCommandLine next
This interpreter is a recursive function that pattern-matches all the cases in any CommandLineProgram a
. When it encounters a Pure
case, it simply returns the contained value.
When it encounters a ReadLine
value, it calls getLine
, which returns an IO String
value read from the command line, but thanks to the do
block, line
is a String
value. The interpreter then calls next
with line
, and passes the return value of that recursively to itself.
A similar treatment is given to the WriteLine
case. putStrLn line
writes line
to the command line, where after next
is used as an input argument to interpretCommandLine
.
Thanks to Haskell's type system, you can easily tell that interpretCommandLine
is impure, because for every CommandLineProgram a
it returns IO a
. That was the intent all along.
Likewise, you can write an interpreter for ReservationsApiProgram
values:
interpretReservationsApi :: ReservationsApiProgram a -> IO a interpretReservationsApi program = case runFree program of Pure x -> return x Free (GetSlots zt next) -> do slots <- HttpClient.getSlots zt interpretReservationsApi $ next slots Free (PostReservation r next) -> do HttpClient.postReservation r interpretReservationsApi next
The structure of interpretReservationsApi
is similar to interpretCommandLine
. It delegates its implementation to an HttpClient
module that contains the impure interactions with the HTTP API. This module isn't shown in this article, but you can see it in the GitHub repository that accompanies this article.
From these two interpreters, you can create a combined interpreter:
interpret :: FreeT ReservationsApiProgram CommandLineProgram a -> IO a interpret program = do r <- interpretCommandLine $ runFreeT program case r of Pure x -> return x Free p -> do y <- interpretReservationsApi p interpret y
This function has the required type: it evaluates any FreeT ReservationsApiProgram CommandLineProgram a
and returns an IO a
. runFreeT
returns the CommandLineProgram
part of the combined program. Passing this value to interpretCommandLine
, you get the underlying type - the a
in CommandLineProgram a
, if you will. In this case, however, the a
is quite a complex type that I'm not going to write out here. Suffice it to say that, at the container level, it's a FreeF
value, which can be either a Pure
or a Free
case that you can use for pattern matching.
In the Pure
case, you're done, so you can simply return the underlying value.
In the Free
case, the p
contained inside is a ReservationsApiProgram
value, which you can interpret with interpretReservationsApi
. That returns an IO a
value, and due to the do
block, y
is the a
. In this case, however, a
is FreeT ReservationsApiProgram CommandLineProgram a
, but that means that the function can now recursively call itself with y
in order to interpret the next instruction.
Armed with both an AST and an interpreter, executing the program is trivial:
main :: IO () main = interpret tryReserve
When you run the program, you could produce an interaction like this:
Please enter number of diners: 4 Please enter your desired date: 2017-11-25 18-30-00Z Not a date. Please enter your desired date: 2017-11-25 18:30:00Z Please enter your name: Mark Seemann Please enter your email address<EMAIL_ADDRESS>Status {statusCode = 200, statusMessage = "OK"}
You'll notice that I initially made a mistake on the date format, which caused readParse
to prompt me again.
If you want to run this code sample yourself, you're going to need an appropriate HTTP API with which you can interact. I hosted the API on my local machine, and afterwards verified that the record was, indeed, written in the reservations database.
This proof of concept proves that it's possible to combine separate free monads. Now that we know that it works, and the overall outline of it, it should be possible to translate this to F#. You should, however, expect more boilerplate code.
Next: Combining free monads in F#.
Comments
Here's an additional simplification. Rather than writing
FreeT ReservationsApiProgram CommandLineProgram
which requires you to lift, you can instead form the sum (coproduct) of both functors:Now you can lift the helpers directly to
Program
, like so:Then (after you change the types of the
read*
helpers), you can drop alllift
s fromtryReserve
:And finally your interpreter needs to dispatch over
InL
/InR
(this is using functions fromControl.Monad.Free
, you can actually drop theTrans
import at this point):I find this to be quite clean!
George, thank you for writing. That alternative does, indeed, look simpler and cleaner than mine. Thank you for sharing.
FWIW, one reason I write articles on this blog is to learn and become better. I publish what I know and have learned so far, and sometimes, people tell me that there's a better way. That's great, because it makes me a better programmer, and hopefully, it may make other readers better as well.
In case you'll be puzzling over my next blog post, however, I'm going to share a little secret (which is not a secret if you look at the blog's commit history): I wrote this article series more than a month ago, which means that all the remaining articles are already written. While I agree that using the sum of functors instead of
FreeT
simplifies the Haskell code, I don't think it makes that much of a difference when translating to F#. I may be wrong, but I haven't tried yet. My point, though, is that the next article in the series is going to ignore this better alternative, because, when it was written, I didn't know about it. I invite any interested reader to post, as a comment to that future article, their better alternatives :)Hi Mark,
I think you'll enjoy Data Types a la Carte. It's the definitive introduction to the style that George Pollard demonstrates above. Swierstra covers how to build datatypes with initial algebras over coproducts, compose them abstracting over the concrete functor, and tear them down generically. It's well written, too 😉
Benjamin


UIView
public extension UIView
Auto Layout and general utility methods for UIView
.
-
Remove all subviews of the calling
UIView
.Copyright
©2016 Lionheart Software LLCDate
February 17, 2016Declaration
Swift
func removeSubviews()
-
Center the calling
UIView
on the X-axis, with optional margins to the right and left.Copyright
©2016 Lionheart Software LLCDate
March 9, 2016Declaration
Swift
@available(iOS 9, *) func centerOnXAxis(width: CGFloat? = nil)
-
Center the calling
UIView
on the Y-axis, with optional margins to the top and bottom.Copyright
©2016 Lionheart Software LLCDate
March 9, 2016Declaration
Swift
@available(iOS 9, *) func centerOnYAxis(height: CGFloat? = nil)
-
Set the height of this view to a specified value using Auto Layout.
Copyright
©2016 Lionheart Software LLCDate
February 17, 2016Declaration
Swift
@available(iOS 9, *) func setHeight(_ height: CGFloat)
Parameters
height
A
Float
specifying the view’s height. -
Set the width of this view to a specified value using Auto Layout.
Copyright
©2016 Lionheart Software LLCDate
February 17, 2016Declaration
Swift
@available(iOS 9, *) func setWidth(_ width: CGFloat)
Parameters
width
A
Float
specifying the view’s width. -
Set the size of the view using Auto Layout.
Copyright
©2016 Lionheart Software LLCDate
February 17, 2016Declaration
Swift
@available(iOS 9.0, *) func setContentSize(_ size: CGSize)
Parameters
size
A
CGSize
specifying the view’s size. -
Undocumented
Declaration
Swift
func fillHorizontalMarginsOfSuperview(margin: CGFloat = 0)
-
Pin the view’s horizontal edges to the left and right of its superview.
Copyright
©2016 Lionheart Software LLCDate
February 17, 2016Declaration
Swift
@available(iOS 9, *) func fillWidthOfSuperview()
-
Pin the view’s vertical edges to the top and bottom of its superview.
Copyright
©2016 Lionheart Software LLCDate
February 17, 2016Declaration
Swift
@available(iOS 9, *) func fillHeightOfSuperview()
-
Pin the view’s horizontal edges to the left and right of its superview with a margin.
Copyright
©2016 Lionheart Software LLCDate
February 17, 2016Declaration
Swift
@available(iOS 9, *) func fillWidthOfSuperview(margin: CGFloat)
Parameters
margin
A
CGFloat
representing the horizontal margin. -
Pin the view’s vertical edges to the top and bottom of its superview with a margin.
Copyright
©2016 Lionheart Software LLCDate
February 17, 2016Declaration
Swift
@available(iOS 9, *) func fillHeightOfSuperview(margin: CGFloat)
Parameters
margin
A
CGFloat
representing the vertical margin. -
Pin the view’s edges to the top, bottom, left, and right of its superview with a margin.
Copyright
©2016 Lionheart Software LLCDate
February 17, 2016Declaration
Swift
@available(iOS 9, *) func fillSuperview(_ axis: NSLayoutConstraint.Axis? = nil, margin: CGFloat = 0)
Parameters
axis
Optional. Specify only when you want to pin the view to a particular axis.
margin
A
CGFloat
representing the vertical margin. -
Apply the specified visual format constraints to the current view. The “view” placeholder is used in the provided VFL string. Usage can best be illustrated through examples:
Pin a
UIView
to the left and right of its superview with a 20px margin:let view = UIView() view.addVisualFormatConstraints("|-20-[view]-20-|")
Set a view to be at least 36px high, and at least 16px from the top of its superview.
view.addVisualFormatConstraints("V:|-(>=16)-[view(>36)]")
Copyright
©2016 Lionheart Software LLCDate
February 17, 2016Declaration
Swift
@discardableResult func addVisualFormatConstraints(_ format: String, metrics: LayoutDictionary? = nil) -> [NSLayoutConstraint]
Parameters
format
The format specification for the constraints. For more information, see Visual Format Language in Auto Layout Guide.
-
Apply the VFL format constraints to the specified views, with the provided metrics.
Copyright
©2016 Lionheart Software LLCDate
February 17, 2016Declaration
Swift
@discardableResult class func addVisualFormatConstraints(_ format: String, metrics: LayoutDictionary? = nil, views: LayoutDictionary) -> [NSLayoutConstraint]
Parameters
format
The format specification for the constraints. For more information, see Visual Format Language in Auto Layout Guide.
metrics
A dictionary of constants that appear in the visual format string. The dictionary’s keys must be the string values used in the visual format string. Their values must be NSNumber objects.
views
A dictionary of views that appear in the visual format string. The keys must be the string values used in the visual format string, and the values must be the view objects.
-
Return the given distance from a view to a specified
CGPoint
.Copyright
©2016 Lionheart Software LLCDate
February 17, 2016Declaration
Swift
func distance(toPoint point: CGPoint) -> Float
Parameters
point
The
CGPoint
to measure the distance to.Return Value
A
Float
representing the distance to the specifiedCGPoint
. -
Returns a 1x1
CGRect
in the center of the callingUIView
.Copyright
©2016 Lionheart Software LLCDate
March 9, 2016Declaration
Swift
var centerRect: CGRect { get }
Return Value
A 1x1
CGRect
. -
Return an
Array
of recursive subviews matching the provided test. This method is incredibly helpful in returning all descendants of a given view of a certain type. For instance:let view = UIView() let subview = UILabel() let label1 = UILabel() let label2 = UILabel() view.addSubview(subview) view.addSubview(label1) subview.addSubview(label2) let labels: [UILabel] = view.descendantViewsOfType()
labels
will contain bothlabel1
andlabel2
.Copyright
©2016 Lionheart Software LLCDate
March 9, 2016Declaration
Swift
func descendantViewsOfType<T>(passingTest test: (T) -> Bool = { _ in true }) -> [T]
Return Value
An
Array
ofUIView
s of typeT
. -
This method simply returns the last object in
descendantViewsOfType(passingTest:)
.Copyright
©2016 Lionheart Software LLCDate
March 9, 2016Declaration
Swift
func lastDescendantViewOfType<T>(passingTest test: (T) -> Bool = { i in true }) -> T?
Return Value
A view of type
T
.


XML Diff visualizer is a utility designed to show the difference between two XML trees. The resulting difference is showcased using a tree view.


Before purchasing any product, knowing about the product really matters! Get quick details of the product u need , so u can go ahead for purchasing it.We are fully flexible on the details. We have obsessive compulsive focus on customers need for details.Go ahead for info.This portal will allow the formers to buy and sell the products and also allow the user to view the details.
Great design will not sell an inferior product, but will enable a great product to acheive its maximum potential.
-Thomas Watson


-----------------------------------------------------------------------------------------------------------------------------------------
The furniture design follows the design concept and theme tailored to your comfort and taste. we offer designs that provide you an organized and beautiful space.
A lot of thinking and detailing goes into creating a furniture that serves everything from functionality and exquisite design.
We pay attention to everything from layout to color to material selection to lighting, installation and custom furniture.
Thank you for visiting.
Modular kitchen
TV Unit
Cabinets
Wardrobes
Sideboards


Teleplay by: Suzie Villandry
Story by: Brian Boyle
Transcribed by: Eric Aasen
[Scene: Monica and Rachel's, Monica and Rachel are hosting a New Year's party. So the place is crowded and in a shameless promotion for NBC they're watching Jay Leno's coverage of New Year's from Time Square.]
Jay Leno: (On TV to Dick Clark) Is there any entertainment there? What are people doing?
Joey: All right! Here we go! 1999! The year of Joey!
Chandler: (deadpan, standing next to Monica) We're very happy for you.
Joey: What's the matter?!
Chandler: We wanted to kiss at midnight, but nobody else is going to so y'know
Joey: All right, I'll take care of it.
Monica: Oh no, wait! Joey!
(They try to stop him, not sure of what he's planning. He ignores them and goes to talk to Ross.)
Ross: (hopping) 73! 72! 71!
Joey: Ross! Ross! Ross, listen! Who are you kissing at midnight, huh? Rachel or Phoebe?
Ross: What?

Joey: Chandler.
Ross: Awww, man! Really?

Ross: That's a good point.
Joey: Yeah.
Ross: Oh well, since I have that whole history with Rachel, I guess Phoebe.
Joey: Okay, great!
Ross: All right.
Joey: Pheebs! Pheebs! Ross wants to kiss you at midnight!
Phoebe: It's so obvious, why doesn't he just ask?
Joey: Rach! Rach!
Rachel: What?!
Ross: Well, everyone's gotta kiss someone.
Rachel: So?
Joey: So?
Rachel: Oh, good point.
Joey: Yeah!
All: (watching the ball drop) 3! 2! 1! HAPPY NEW YEAR!!
(And with that everyone starts playing tonsil hockey. Chandler with Monica, Ross with Phoebe, and Joey with Rachel.)
Chandler: (To Monica) Happy New Year!
Monica: Happy New Year.
Ross: (To Phoebe) Happy New Year, Pheebs!
Phoebe: You too!
Rachel: (To Joey) Happy New Year, Joey!
Joey: So did that do anything for ya?
(Rachel slowly walks away.)
Opening Credits
[Scene: Monica and Rachel's, after the party. Everyone has left, except for the gang.]
Ross: Y'know what? I'm gonna go out on a limb and say no divorces in '99!
Rachel: But your divorce isn't even final yet.
Ross: Just the one divorce in '99! Y'know what, I am gonna be happy this year. I am gonna make myself happy.
Chandler: Do you want us to leave the room, or?
Ross: Everyday I am gonna do one thing that I haven't done before. That my friends is my New Year's resolution.
Phoebe: Ooh! That's a good one! Mine is to pilot a commercial jet.
Chandler: That's good one too, Pheebs. Now all you have to do is find a planeload of people who's resolution is to plummet to their deaths.
Phoebe: Maybe your resolution is to not make fun of your friends, especially the ones who may soon be flying you to Europe for free on their own plane.
Monica: She has a better chance of sprouting wings and flying up your nose than you do of not making fun of us.
Ross: In fact, I'll bet you 50 bucks that you can't go the whole year without making fun of us. Eh, y'know what, better yet? A week.
Chandler: I'll take that bet my friend. And you know what, paying me the 50 bucks could be the "new thing you do that day!" (Ross looks at him.) And it starts right now!
Joey: All right, my New Year's resolution is to learn how to play the guitar.
Ross: Ohh.
Phoebe: Really?! How come?
Joey: Well, y'know those special skills I have listed on my resume? I would love it would be great if one of those was true.
Phoebe: Do you want me to teach you? I'm a great teacher.
Joey: Really? Who-who have you taught?
Phoebe: Well, I taught me and I love me.
Joey: Yeah that'd be great! Thanks Pheebs!
Rachel: Op, look! Claire forgot her glasses! And she's gonna be really needing these to keep an eye on that boyfriend, who, I hear, needs to keep his stapler in his desk drawer, if you know what I'm talking about.
Monica: Hey Rach, maybe your resolution should be to umm, gossip less.
Rachel: I don't gossip!
(They all laugh.)
Rachel: Well, maybe sometimes I find out things or I hear something and I pass that information on y'know kinda like a public service, it doesn't mean I'm a gossip.
Monica: Well if Ted Kopel talked about his coworkers botched boob jobs, I would.
Rachel: What? They were like this!
(She puts her hands over her breasts and indicates that the coworkers boob job resulted in one pointing up and one pointing down with her hands by pointing up with one hand and down with the other.)
[Scene: Central Perk, Ross is talking to a beautiful woman as Chandler and Joey enter.]
Woman: I'll see you tomorrow.
Ross: Okay! (She leaves.) (To Chandler and Joey.) Hey!
Chandler and Joey: Hey!
Ross: I just asked that girl out.
Chandler: Nice!
Joey: Nice!! Yeah! Is that part of your resolution, your new thing for today?
Ross: Yes it is. See. (Shows them the piece of paper she gave him with her name and phone number on it.)
Chandler: (reading it) Elizabeth Hornswoggle?
Ross: That's right, uh, Elizabeth Hornswoggle.
Chandler: Horn-swoggle.
Joey: You all right Chandler? Is there something funny about that name?
Chandler: No. No, I just think that maybe I-I'd heard it somewhere before. (Sits down rubbing his temple.)
Joey: Oh really! Where? Somewhere funny I'd bet! (Chandler is straining to keep quiet as Phoebe enters.)
Ross: Hi, Pheebs!
Phoebe: Hey!
Ross: Oh-oh, guess what? I-I have a date with Elizabeth (Talking into Chandler's ear.) Hornswoggle.
Phoebe: Hornswoggle?
Ross: All right, see you later.
Joey: See ya! All right Pheebs, I am ready for my first lesson.
Phoebe: Okay. (Joey tries to take the guitar.) Oh no-no-no, you don't touch the guitar!  (Points to the guitar.)
Joey: Umm, okay.
Phoebe: Okay, lesson one: chords. Now, I don't know the actual names of the chords but umm, I-I-I made up names for the way my hand looks while I'm doing them. (She starts to show Joey the chords. Transcribers Note: For this one you'll have to use your imagination, 'cause it would take me 50 pages to describe each one. So if you want to see them, you'll have to wait for this episode to come to a TV near you.) (Holding up her hand and then reconfiguring her hand with each name.) So then, this is Bear Claw. Okay, umm, Turkey Leg and Old Lady. (Joey tries to imitate them.)
Chandler: What an interesting approach to guitar instruction. Y'know some might find it amusing, I myself find it regular.
[Scene: Monica and Rachel's, Phoebe is entering with Rachel.]
Phoebe: Hey everybody, Rachel was so good today. She didn't gossip at all.
Rachel: I didnt! Even when I found out umm, all right, well let's just say I found something out something about someone and let's just say she's gonna keep it. (Goes into her room.)
Joey: Hey, Pheebs! Check-check this out. (Holds up his hand in one of Phoebe's chords.)
Phoebe: Ooh, you nailed the Old Lady! (They both laugh at what she said.)
Joey: Yeah listen so, I thought I was getting better, so on my way home today I stopped by this guitar store and
Phoebe: Did you, did you touch any of the guitars while you were there? Did you?!
Joey: No.
Phoebe: Give me your hands. (He does and she smells his left hand.) Strings. Gimme it! (He gives her his right hand and she smells it as well.) Pick. Do you want to learn to play guitar?
Joey: Yes!
Phoebe: Then don't touch one!!
Ross: (entering, with Ben) Hi!
Ben: Hi!
Monica: Hi Ben!
Ben: Auntie Monica!! (He runs to hug her.)
Chandler: (notices something) Ross is wearing leather pants! Does nobody else see that Ross is wearing leather pants? (Pause, no one speaks.) Someone comment on the pants!
Rachel: I think they're very nice.
Monica: I like 'em.
Joey: Yeah! (Chandler bangs the table in frustration.)
Monica: I like them a lot.
Chandler: That's not what I had in mind! See, people like Ross don't generally wear these types of pants. You see, they're very tight. (Motions to Ross's buttock.) Maybe there's something in that area.
(They all speak at once in general approval of his pants selection; Joey asks where he got them. I can't pick out the rest of it.)
Ross: Oh see, I-I needed a new thing for today and there's this leather store that always smells so good and I thought to myself, "Wow, (To Chandler) I never really owned a good smelling pair of pants before."
(No one says anything.)
Chandler: Oh come on!! (Storms out.)
Ross: (after he's left) Okay, seriously, what do you think?

Rachel: Awful, absolutely awful. (Plus other negative comments from Phoebe and Monica.)
(Monica starts taking pictures of Ross and Ben, with the flash.)
Ross: What are you, what are you doing?
Monica: It's my New Year's resolution!
Ross: What, to blind my child?
Monica: No! To take more pictures of all of us together. I mean I really think it's the best resolution because everyone will enjoy the pictures.
Joey: Well, everyone will enjoy my music as well. (Does a chord and Monica starts taking pictures of him and Phoebe. They both start to strike a pose with the excessive amount of pictures that Monica takes.)
[Scene: Elizabeth Hornswoggle's apartment; Ross is there on his date with her. They are sitting on the couch watching a movie. Ross is obviously hot.]
Ross: (talking to himself) My God!  (He's still wearing the leather pants.) (She snuggles closer.) Oh come on, she wants to snuggle now! What is she trying to kill me? It's like a volcano in here! (Out loud.) Are you hot?
Elizabeth Hornswoggle: No.
Ross: Okay, it must just be me then.
(He shifts on the couch and a ripping sound emanates from his lower regions, the sound reminds one of a brief explosion of gas. In other words, it sounds like he farted. She has a look of horrific wonderment, wondering "Did he just fart?")
Ross: That was just the pants on the couch.
Elizabeth: No, go ahead.
Ross: Thanks. (Gets up and as he does so, the sound returns. Without another word he heads into her bathroom.)
[Cut to Elizabeth Hornswoggle's bathroom, Ross frantically pulls his shirt out and drops his pants. He exhales in sheer ecstasy as the coolness of the bathroom envelops his legs. He sits on the cast iron bathtub, again gasping in pleasure. He next grabs a magazine and starts to blow air on his exposed legs, but that doesn't work the way he wants it to. So he throws the magazine down, looks around for another idea, and finds one. He jumps up and hops to the sink. He turns on the water and starts to splash some on his legs, cooling them further.]
Ross: (in ecstasy) Ahhhhhhhhhhhhhh .
Elizabeth: (yelling from outside) Hey, my favorite part is coming up!
Ross: 'Kay!
(He goes to pull up his pants, but can't seem to get them past his knees. He frantically tries to pull them up to no avail. Panic sets in.)
Ross: Oh my God!
[Scene: Monica and Rachel's, Phoebe is drilling Joey on the chords as Monica looks on.]
Phoebe: Tiger! (Joey moves his hand in an attempt to do the chord, in fact he does it with each name.) Dragon! Iceberg!! (He fails.) Joseph, did you even study at all last night?
Joey: Yes! Yes, I did.
Phoebe: Then do Iceberg!
Joey: (thinks) (quietly) G-sharp.
Phoebe: G-sharp? Have you been studying the real names of the chords? (Joey doesn't answer.) Have you? (He looks away in shame.) Oh my God!
Joey: What?! I didn't touch a guitar!
Phoebe: No, but you're questioning my method!
Joey: No, I'm not questioning it, I'm saying it's stupid! (Notices Monica standing between them and smiling.) What?! (The camera clicks, taking another picture.)
Monica: Thank you. (Leaves.)

Phoebe: Yeah, well, y'know maybe you just need to try a little harder!
Joey: (looking in the Yellow Pages) Look, maybe I need to try a real teacher! Right here! Here!  (Storms out.)
Phoebe: Fine! You go learn from your qualified instructor!

Phoebe: Oh, fine! Take his side! (Storms out.)
(Rachel looks shocked, gets over it, notices she's alone, and picks up the phone. The last part of which is something she shouldn't have done, because the phone is already in use. By Monica, and now Rachel can hear every word.)
Monica: (on phone) I can't wait to be with you! I'll sneak over as soon as Ross picks up Ben. I'll just tell Rachel I'm gonna be doing laundry for a couple of hours.
Chandler: (on phone) Laundry. Huh. Is that my new nickname?
Monica: (on phone) Awww, y'know what your nickname is, Mr. Big
Rachel: Arghh!! (She quickly hangs up the phone and starts to pace around wondering what to do.)
Commercial Break
[Scene: Chandler, Joey, and Ross's, The phone rings and Joey answers it.]
Joey: (answering phone) Hello?
Ross: (calling from Elizabeth's bathroom) Joey, it's Ross! I need some help!
Joey: Uhh, Chandler's not here.
Ross: Well, you can help me!
Joey: Okay.
Ross: Listen, I'm in Elizabeth's bathroom
Joey: Nice!
Ross: No, I-I got really hot in my leather pants so I took them off but they must have shrunk from the-the sweat or-or-or my legs expanded from the heat. Look, I-I can't put them back on. I can't!
Joey: Oh. That is quite a situation. Uh, do you see any like, powder?
Ross: Powder! Yeah! Yeah, I have powder! (Grabs some of her shelf.)

Ross: Yeah, okay, hold on! (He puts the phone down and proceeds to spread a large amount of powder on his legs and makes another attempt at pulling up his pants. It doesn't work, and without picking up the phone leans down to it.) (Almost in tears.) They're not coming on man.
Joey: Umm, do you see anyoh, Vaseline?
Ross: Ohh, I-I see lotion, I have lotion! Will that work?
Joey: Yeah, sure, spread some of that on there.
Ross: Hold on.
(Ross proceeds to apply copious amounts of the lotion on his legs.  After using about half the bottle he again tries to pull up his pants, but at the first sign of resistance, his hand slips off of the pants and hits him in the forehead.)
Joey: Ross? You okay?
Ross: They're still, they're still not coming on man and the lotion and the powder have made a paste!
Joey: Really?! Uhh, what color is it?
Ross: What difference does that make?!
Joey: Well, I'm justif the paste matches the pants, you can make yourself a pair of paste pants and she won't know the difference!
Rachel: (entering) Joey, do you have a minute?
Ross: Dude, what am I gonna
Joey: (To Ross) Uh, Rachel's here, so good luck man, let me know how it works out. (He hangs up the phone and strands Ross in the bathroom.)
Rachel: Oh, Joey, I have such a problem!
Joey: Oh well, you're timing couldn't be better. I am putting out fires all over the place.
Rachel: Okay. Okay. Okay. Joey, I have got to tell you something!
Joey: What-what is it, what is it?

Joey: Oh no, no-no-no-no! I don't want to know!
Rachel: Yes! Yes! Yes, you do want to know! This is unbelievable!
Joey: I don't care, Rach! Look, I am tired of being the guy who knows all the secrets but can't tell anyone!
Rachel: What? What secrets? You know secrets? What are they?
Joey: And you're not supposed to be gossiping!!
Rachel: I know, I know! I just can't keep this one in, so I pick up the phone (Joey in a childish attempt to not hear what Rachel is about to say, puts his fingers in his ears and starts to scream loudly. Rachel turns and walks out upon seeing that Joey's not gonna listen, and as she exits Chandler walks in and sees Joey in his current state.)
Joey: I'm not listening to you!
(Chandler seeing that Joey has his eyes closed sneaks over and picks up the chicken. The chicken starts flapping it's wings in protest as Chandler holds the chicken inches from Joey's face. Joey stops yelling and upon opening his eyes sees the chicken, screams, and falls to the ground in horror.)
[Scene: Elizabeth's apartment; Elizabeth is inquiring as to the delay in Ross's exit from her bathroom.]
Elizabeth: Ross, umm, you've been in there for a long time. I'm starting to get kinda freaked out.
Ross: All right, I'm coming out. Hey, can you turn the lights off.
Elizabeth: No, let's just leave the lights on.
(Ross opens the door and steps into the living room.  His legs are covered in the powder and lotion paste. He looks terrible.)
Elizabeth: Oh my God!
Ross: I had a problem.
[Scene: Central Perk, Joey is there to apologize to Phoebe.]
Joey: Hey, Pheebs?
Phoebe: No, I can't talk to you! I don't have a fancy ad in the Yellow Pages!
 And-and I promise, I won't touch a guitar until you say I'm ready. (After a short pause she hands him her guitar.) You really think I'm ready?
Phoebe: Uh-huh!
Joey: Wow! Cool! (He takes the guitar, stands up, and goes to play a note. However, while strumming it, he knocks it out of his hands and it bounces off the table and lands on the floor. Phoebe just stares at the guitar.)
Joey: (sitting back down) Was the chord at least right
Phoebe: No!
[Scene: Monica and Rachel's, Ross is returning from his horrible trek back home without pants on. The whole gang is there.]
Chandler: Oh my God!
Monica: We heard about your pants, I'm so sorry.
Ross: This year was supposed to be great!
All: No.
Ross: Look at me! (Chandler squeaks in an attempt not to make fun of him.)
Monica: Hey, hey, look.  (Shows him Ben's picture.) Huh? You're-you're a cowboy!
Ross: Oh, be-because of the leather pants.
Monica: See?  Now that's something.
(All at once.)
Phoebe: Yeah!
Rachel: That really is something; that's really cool.
Joey: Howdy partner!
Ross: Maybe I should get another pair! Ooh, y'know, they-they had some with fringe all down the sides. (Chandler starts rubbing his temple again.)  (He starts to head for Monica's bedroom.) I can't believe he thinks I'm a cowboy. (Pause.) I would make a good cowboy. (He struts into Monica's room.)
Monica: Okay, now that everything's wrapped up here, I think I'm, I'm gonna go do my laundry.
Chandler: Oh yeah, me too. Y'know if this shirt is dirty. (Smells it.) Yep.
(They both exit.)
Phoebe: Okay, I'm gonna go too. I'm gonna go to the airport. I figure if I hang around there long enough, someone's bound to leave one of those planes unattended.
Rachel: Good luck, honey!
Phoebe: Bye! (She exits, leaving Rachel and Joey alone.)
Rachel: Hey, uh, Joey?
Joey: Umm?
Rachel: Remember that big thing I was gonna tell you about?
Joey: Oh, no! (Starts that screaming thing again. Rachel stops him by pulling his fingers out of his ears.)
Rachel: I'm not gonna tell you, but if you found out on your own, that would be okay and then we could talk about it. Right?
Joey: Well, then it wouldn't be a secret. So yeah, that would be okay. Yeah. Yeah!
Rachel: (quietly) Yeah. Well. (Pause.) Hey uh Joe, would mind going over to Chandler's bedroom and get that book back that he borrowed from me?
Joey: Now? You want me to go over there now?
Rachel: Yeah!
Joey: Do you know something?
Rachel: Do you know something?
Joey: I might know something.
Rachel: I might know something too.
Joey: What's the thing you know?
Rachel: Oh no, I can't tell you until you tell me what you know.
Joey: I can't tell you what I know.
Rachel: Well then I can't tell you what I know.
Joey: Okay, fine.
(Silence ensues.)
Joey: You don't know!
Rachel: All right, how about I go over there and I will walk into Chandler's bedroom and I will see that thing that I think that I know is actually the thing that I think that I know! (Note: Kudos to Ms. Aniston on the delivery of that line. She said it very quickly and didn't screw up a word. Try it yourself, it ain't that easy.)
Joey: (gasps) YOU KNOW!!!!
Rachel: AND YOU KNOW!!!
Joey: Yeah, I know!!!!
Rachel: Chandler and Monica?!! Oh, this is unbelievable!! How long have you known?
Joey: Too long! Oh my God, Rach, I've been dying to talk to someone about this for so long! Listen, listen, we can't say anything about this to anybody, they're so weird about that! Listen (Phoebe returns and interrupts them.)
Joey and Rachel: Hey!
Phoebe: Hey! It's raining. I don't want to fly in the rain. So
(Pause.)
Joey: Oh, I am going to go for a walk in the rain.
Rachel: Ohhh, yeah, me too.
(They both exit.)
Phoebe: That's weird. (Pause.) I bet they're doing it.
Ending Credits
[Scene: Central Perk, Phoebe, Ross, and Monica are there.]
Chandler: (entering) Oh good, okay, I can't take it anymore. I can't take it anymore. So you win, okay? Here! (Hands him the 50 bucks he's about to owe him.) Pheebs? Flying a jet? Better make it a spaceship so that you can get back to your home planet!  And Hornswoggle? What are you dating a character from Fraggile Rock?! (He sits down and sighs in relief.)
End


zhmc_crypto_attachment – Manages the attachment of crypto resources to partitions of Z systems.¶
Synopsis¶
Gather facts about the attachment of crypto adapters and crypto domains to a partition of a CPC (Z system).
Attach a range of crypto domains and a number of crypto adapters to a partition.
Detach all crypto domains and all crypto adapters from a partition.
Requirements¶
The below requirements are needed on the host that executes this module.
Access to the WS API of the HMC of the targeted Z system (see HMC API). The targeted Z system must be in the Dynamic Partition Manager (DPM) operational mode.
Python package zhmcclient >=0.20.0
Parameters¶
- hmc_host (True, str, None)
The hostname or IP address of the HMC.
- hmc_auth (True, dict, None)
The authentication credentials for the HMC, as a dictionary of
userid
,password
.
- userid (True, str, None)
The userid (username) for authenticating with the HMC.
- password (True, str, None)
The password for authenticating with the HMC.
- cpc_name (True, str, None)
The name of the CPC that has the partition and the crypto adapters.
- partition_name (True, str, None)
The name of the partition to which the crypto domains and crypto adapters are attached.
- state (True, str, None)
The desired state for the attachment:
attached
: Ensures that the specified number of crypto adapters of the specified crypto type, and the specified range of domain index numbers in the specified access mode are attached to the partition.
detached
: Ensures that no crypto adapter and no crypto domains are attached to the partition.
facts
: Does not change anything on the attachment and returns the crypto configuration of the partition.- adapter_count (False, int, -1)
Only for
state=attach
: The number of crypto adapters the partition needs to have attached. The special value -1 means all adapters of the desired crypto type in the CPC. Theadapter_names
andadapter_count
parameters are mutually exclusive; if neither is specified the default foradapter_count
applies.- adapter_names (False, list, [])
Only for
state=attach
: The names of the crypto adapters the partition needs to have attached. Theadapter_names
andadapter_count
parameters are mutually exclusive; if neither is specified the default foradapter_count
applies.- domain_range (False, list, [0, -1])
Only for
state=attach
: The domain range the partition needs to have attached, as a tuple of integers (min, max) that specify the inclusive range of domain index numbers. Other domains attached to the partition remain unchanged. The special value -1 for the max item means the maximum supported domain index number.- access_mode (False, str, usage)
Only for
state=attach
: The access mode in which the crypto domains specified indomain_range
need to be attached.- crypto_type (False, str, ep11)
Only for
state=attach
: The crypto type of the crypto adapters that will be considered for attaching.- log_file (False, str, None)
File path of a log file to which the logic flow of this module as well as interactions with the HMC are logged. If null, logging will be propagated to the Python root logger.
- faked_session (False, raw, None)
A
zhmcclient_mock.FakedSession
object that has a mocked HMC set up. If not null, this session will be used instead of connecting to the HMC specified inhmc_host
. This is used for testing purposes only.
Examples¶
---
# Note: The following examples assume that some variables named 'my_*' are set.
- name: Gather facts about the crypto configuration of a partition
zhmc_crypto_attachment:
hmc_host: "{{ my_hmc_host }}"
hmc_auth: "{{ my_hmc_auth }}"
cpc_name: "{{ my_cpc_name }}"
partition_name: "{{ my_partition_name }}"
state: facts
register: crypto1
- name: Ensure domain 0 on all ep11 adapters is attached in usage mode
zhmc_crypto_attachment:
hmc_host: "{{ my_hmc_host }}"
hmc_auth: "{{ my_hmc_auth }}"
cpc_name: "{{ my_cpc_name }}"
partition_name: "{{ my_first_partition_name }}"
state: attached
crypto_type: ep11
adapter_count: -1
domain_range: 0,0
access_mode: usage
- name: Ensure domains 1-max on all ep11 adapters are attached in control mode
zhmc_crypto_attachment:
hmc_host: "{{ my_hmc_host }}"
hmc_auth: "{{ my_hmc_auth }}"
cpc_name: "{{ my_cpc_name }}"
partition_name: "{{ my_first_partition_name }}"
state: attached
crypto_type: ep11
adapter_count: -1
domain_range: 1,-1
access_mode: control
- name: Ensure domains 0-max on 1 ep11 adapter are attached to in usage mode
zhmc_crypto_attachment:
hmc_host: "{{ my_hmc_host }}"
hmc_auth: "{{ my_hmc_auth }}"
cpc_name: "{{ my_cpc_name }}"
partition_name: "{{ my_second_partition_name }}"
state: attached
crypto_type: ep11
adapter_count: 1
domain_range: 0,-1
access_mode: usage
- name: Ensure domains 0-max on two specific ep11 adapters are attached
zhmc_crypto_attachment:
hmc_host: "{{ my_hmc_host }}"
hmc_auth: "{{ my_hmc_auth }}"
cpc_name: "{{ my_cpc_name }}"
partition_name: "{{ my_second_partition_name }}"
state: attached
crypto_type: ep11
adapter_names: [CRYP00, CRYP01]
domain_range: 0,-1
access_mode: usage
Return Values¶
- crypto_configuration (success, dict, )
For
state=detached|attached|facts
, the crypto configuration of the partition after the changes performed by the module.- {name} (, dict, )
Partition name
- adapters (, dict, )
Attached adapters
- {name} (, dict, )
Adapter name
- name (, str, )
Adapter name
- {property} (, any, )
Additional properties of the adapter, as described in the HMC API (using hyphens (-) in the property names).
- domain_config (, dict, )
Attached crypto domains
- {index} (, dict, )
Crypto domain index
- {access_mode} (, str, )
Access mode (‘control’ or ‘usage’).
- usage_domains (, list, )
Domain index numbers of the crypto domains attached in usage mode
- control_domains (, list, )
Domain index numbers of the crypto domains attached in control mode
- changes (success, dict, )
For
state=detached|attached|facts
, a dictionary with the changes performed.- added-adapters (, list, )
Names of the adapters that were added to the partition
- added-domains (, list, )
Domain index numbers of the crypto domains that were added to the partition


In classification problems you have data points \(x \in \mathbb{R}^m\) which you want to classify into one of \(k \in \mathbb{N}_{\geq 2}\) classes. This is a supervised task. This means you have \(n\) data points for training in a matrix \(X \in \mathbb{R}^{n \times m}\) with their labels.1
Initially, the label might be something like "cat" or "dog". But the machine learning algorithms can't deal with those directly, so you need to encode the labels. The simplest way of encoding them is to use integers \(0, 1, \dots, k - 1\). However, in many cases it is handy to use a one-hot encoding. This means you make a \(k\)-dimensional vector for each label. \((1, 0)\) might encode "dog" and \((0, 1)\) might encode "cat". sklearn
supports this encoding in a convenient way
(docs). Another common encoding is \(-1\) and \(1\) for binary classification problems.2
A linear model is one which applies only linear operations to the features. So basically the model may only be a matrix. Typically the elements of the matrix are called weights, because they weight the importance of each feature.
The objective of such a classifier4 is to find a matrix \(W^*\) such that the MSE is as small as possible on the test set \(D\):
One-hot encoding
If one-hot encoded labels are used,3 a linear classifier
usually works like this:
with \(W \in \mathbb{R}^{k \times m}\) and \(^{(i)}\) denoting the \(i\)-th element of the vector. Given a test set
you can calculate the mean squared error (MSE) of the classifier \(f\):
Please note that the MSE is always non-negative for every single data point.
Normalizing the output
The nice thing about the MSE is that it is simple. It can easily be calculated and is used in regression problems very often. What is not so nice is the fact that it punishes several good solutions, too. For example, say we have a data point \(x_1\) which has the target \((1, 0)^T\). The classification output
while the classification output of another point \(x_2\) is
This is problematic, as the actual classification in \((1.1)\) is correct whereas the classification in \((1.2)\) is wrong. However, this can easily be fixed by normalizing the result.
Simple Normalization
The simplest way to normalize the result of the classifier would be to divide each entry by the sum of all entries, e.g. for \((1.1)\) we get
Standardization
You might want to interpret the output of your classifier as a probability of the data point belonging to the different classes. Then you may not have negative values and you also want to avoid a probability of 0. A common normalization then is the softmax function \(\sigma\). It first exponentiates the single values and then normalizes:
Note that this is the same as a neural network with only an input layer and a softmax output layer.
Now the optimization problem is:
This is a differentiable function. This means to optimize we can calculate the gradient and apply gradient descent:
as you can see it gets quite ugly. I don't want to continue this calculation here. But I hope you can see that this is possible. stats.stackexchange.com gives some hints on how to continue.
Decision boundary
The decision boundary for a two-class problem with 2-dimensional data vectors (and one bias) can be calculated as
As you can see, the decision boundary of the non-normalized form is a line:
Please also note that \(W^{(1, 2)} = W^{(0, 2)}\) is possible, which would mean that the line is parallel to the \(x_2\) axis. So this model basically only has 2 parameter combinations which matter, although it has 6 values which can be adjusted. But many combinations are equivalent.
What does normalization change?
For given \(W, x\) it only divides both sides of the equation by the same constant. Hence it doesn't change the decision boundary.
What does standardization with softmax change?
Just like with normalization, softmax makes equation \((DB)\) to be divided by a constant. This can be ignored. The exponentiation can also be ignored as we can simply take the logartihm of both sides of \((DB)\). Or in other words: A neural network with only one input layer and one softmax output layer also has a linear decision boundary!
-1/+1 encoding
In the 2-class case one might consider to use -1 for one class and +1 for the other class as targets. Then the classifcation is
The matrix \(W\) is now in \(\mathbb{R}^{1 \times 3}\) and the classifier is
To make sure that this is either \(-1\) or \(+1\), one can modify it to
Note that this ignores the case \(Wx = 0\).
Now we can easily calculate the MSE:
Differences from target encoding
You might wonder if it makes a difference which type of encoding you use for your target. There are some things which come to my mind:
- (+) One-hot encoding can easily be expanded to more than two classes, in contrast to \(-1/+1\) encoding.
- (+) With one-hot encoding, you can easily get a probability distribution for the classes you are interested in. This is certainly also possible with \(-1/+1\) encoding, but it doesn't strike my eye as clearly.
- (-) One-hot encoding needs more storage space.
- (?) \(-1/+1\) encoding is used in SVMs (see SVM article), so it might have advantages in maximum margin classification.
Implementation
If I had to implement a linear binary classifier, I would use the delta rule and a perceptron unit:
#!/usr/bin/env python
"""Example for a linear classifier using a perceptron and the delta rule."""
from sklearn.datasets.samples_generator import make_blobs
import matplotlib.pyplot as plt
import numpy as np
class Perceptron(object):
def __init__(self, eta=0.01, epochs=50):
"""
Single perceptron unit.
Credit to Sebastian Raschka:
http://sebastianraschka.com/Articles/2015_singlelayer_neurons.html
This was slightly modified.
"""
self.eta = eta
self.epochs = epochs
def fit(self, X, y):
self.w_ = np.zeros(1 + X.shape[1])
self.errors_ = []
for _ in range(self.epochs):
errors = 0
for xi, target in zip(X, y):
update = self.eta * (target - self.predict(xi))
self.w_[1:] += update * xi
self.w_[0] += update
errors += int(update != 0.0)
self.errors_.append(errors)
return self
def net_input(self, X):
return np.dot(X, self.w_[1:]) + self.w_[0]
def predict(self, X):
return np.where(self.net_input(X) >= 0.0, 1, -1)
# Generate data
X, target = make_blobs(random_state=0, centers=2, cluster_std=0.5)
# Fit perceptron
f = Perceptron(epochs=100)
f.fit(X, target)
# Plot decision boundary
xs = np.linspace(start=min(X[:, 0]), stop=max(X[:, 0]))
plt.plot(xs, [-(f.w_[0] + f.w_[1] * xi) / f.w_[2] for xi in xs], "r--")
# Plot data
plt.gray()
_ = plt.scatter(X[:, 0], X[:, 1], c=target)
plt.show()
which gives:
Looks about right. You can also see that this probably minimizes the MSE, but it does not maximize the margin between the classes. This would be done by SVMs.
Footnotes
-
A label and a class are two different things. The class is a set which contains all data points which belong to this class. The label is only a pointer to this class. ↩
-
Classification problems with only two classes. ↩
-
Also called "targets" sometimes, as we want our classifier to output those values. ↩
-
The objective function defines what is to be done during fitting / training / learning. ↩


plotting.pages.graph package
plotting.pages.graph.graph module
# package imports
from dash import dcc, html
import dash_bootstrap_components as dbc
# local imports
from plotting.pages.graph.components import graph_options
from plotting.utils.constants import graph_config
# set constants
path = '/graph'
title = 'Graph'
graph_id = 'id-graph'
layout = dbc.Container(
[
html.H1('Graph'),
dbc.Row(
[
dbc.Col(
# The next update of dash_bootstrap_components includes
# an accordian component. The collapse items should be
# changed to an accordian.
[
graph_options.card,
],
className='col-lg-3'
),
dbc.Col(
dcc.Graph(
id=graph_id,
config=graph_config
),
className='col-lg-9'
)
]
)
]
)
plotting.pages.graph.graph_callbacks module
- plotting.pages.graph.graph_callbacks.create_figure(data, att_values, label_values, height)[source]
Handle options for graph option dropdowns
- Parameters
data (dict) – data from stored dcc.Store component
att_values (list) – List of values returned from the attribute dropdowns
label_values (list) – List of values for various labels
height (int) – Height of graph in pixels
- Returns
figure – Created graph object
- Return type
plotly.graph_objects.Figure
- plotting.pages.graph.graph_callbacks.fetch_columns_from_data(data)[source]
Handle options for graph option dropdowns
- Parameters
data (dict) – data from stored dcc.Store component
- Returns
options – Options for each of the dropdowns in the form of {‘label’: ‘Example’, ‘value’: ‘example’}
- Return type
list of dict
- plotting.pages.graph.graph_callbacks.handle_accordian_collapse(go_clicks, go_open)[source]
Handle toggling the various accordian collapses
- Parameters
temp_clicks (int) – How many times the temp link has been clicked
temp_open (bool) – Whether the temp card is currenlty open or not
- Returns
temp_open – The reverse of what temp_open passed in
- Return type
bool


Miami Heat unveil new ViceWave City jersey
by ESPN.comThe Miami Heat unveiled their new ViceWave City Edition uniform on Monday.
The new look is inspired by sun-drenched South Beach afternoons, according to the team. The Heat says the new color scheme is a shift from the neon colors in their previous alternative uniforms that represented the city's famous nightlife.
The new uniform's primary color is blue gale with pink, black and white lettering and numbers.
The uniform was designed by the Heat's in-house creative department.


CHRISTMAS CAN GLOW with special magic when its joy intertwines with the happiest moments of life. So it was for Felipe Rodriguez at the age of 13.
The year was 1978. His mother and stepfather flew with Felipe from Puerto Rico to New York to start new lives. They landed late in November, as the season’s lights were twinkling and the first snow was soon to fall.
There wasn’t much of a storm, just a 2-inch dusting. Still, after arriving from an island where it never snows, young Felipe found wonder in the flakes that dropped through the air and shimmered on everything.
The man Felipe considers his true father taught him to make a snow angel and later showed him the splendor of the Rockefeller Center tree.
Ten years passed before Christmas again lighted Felipe’s life.
Now a young man of 23, and dreaming of a future as an NYPD helicopter pilot, Felipe had fallen in love with a woman named Lloyda, who loved him in return.
On Christmas Eve 1988, Felipe and Lloyda sat by the tree they had decorated. Lloyda presented Felipe with a white box. Inside, he found a suit custom-made by a tailor to whom Lloyda had brought a shirt and trousers worn by Felipe while working as a maintenance man. The tailor had used the garments to size the suit.

“It’s all worth it,” Lloyda answered.
This Christmas, three decades later, will far surpass those cherished moments, Felipe is sure.
Because this Christmas will be the first Christmas Felipe Rodriguez celebrates as a free man after being in prison for almost 27 years, having been convicted in 1990 of savagely killing a mother of three in a sexually-driven spasm of violence.
It will also be yet another Christmas observed by the family of Maureen McNeill Fernandez, whose oldest son, Louis McNeill, reviles Rodriguez as a monster who butchered his mother and irreparably scarred her loved ones.
The official record holds that Rodriguez stabbed and slashed McNeill Fernandez 37 times. A Queens jury found him guilty of second-degree murder. A judge imposed a life sentence, with first parole eligibility at the 25-year mark.
While such a verdict demands respect, today’s standards of CSI evidence, cell phone location technology and healthy skepticism about eyewitness identifications gnaw at the validity of Rodriguez’s conviction.

Now, that admitted liar — the key witness in the case — has signaled a readiness to recant some or all of the testimony that sent Rodriguez to prison.
“I didn’t know that the police were lying to me,” Javier Ramos told the Daily News on Thursday before referring questions to his lawyer.
The lawyer, Adam Perlmutter, told The News on Friday: “There is no question that a grave injustice has occurred to Felipe Rodriguez for reasons beyond Javier Ramos. We are looking forward to meeting in the very near future with the Queens District Attorney’s Office.”
The verdict plunged Rodriguez into a hell of locked steel and homicidal violence from which he rose over the course of tormented decades to redemption through his trust in God and a commitment to good works on Earth -- even if a prison yard would be the only plot of Earth he ever knew.
Rodriguez came to speak as fluently about the Bible and philosopher and theologian St. Augustine (“That dude could write,” Rodriguez says.) as about icepick and knifepoint slayings.
An acolyte of St. Francis of Assisi, he performed as an altar server for Timothy Cardinal Dolan at a prison mass, offered prayers sought by guards and counseled inmates, including serial killer Arthur Shawcross, who found his way to confession with a priest under Rodriguez’s guidance.
Now, as he nears celebrating the birth of Christ, Rodriguez is a free and productive man thanks to New Yorkers who found him worthy.
Certain he was wrongly convicted, two lawyers — the Innocence Project’s Nina Morrison and top criminal practitioner Zachary Margulis-Ohnuma — have labored hard for Rodriguez, Morrison for a decade, Margulis-Ohnuma more recently.
Gov. Cuomo granted Rodriguez clemency last December.
And Queens District Attorney Richard Brown has ordered a review to determine whether or not Rodriguez’s name should be fully cleared.
“We always take such claims seriously. As a result of the request of Nina Morrison of the Innocence Project we have begun a review of this case,” a spokesman for Brown said. “We are endeavoring a search of the long archived materials necessary for us to facilitate our work."
Police Commissioner James O’Neill, too, has ordered a search for the NYPD’s musty case records.
Hotel workers union president Peter Ward facilitated Rodriguez’s employment as a $24-an-hour house attendant at the Row NYC Hotel.
Not everyone thinks that springing Rodriguez was the right thing to do.
"Cuomo has no idea what he did in releasing a violent felon,” says Louis McNeill, who sat through Rodriguez’s trial as a 15-year-old while helping his grandmother raise two younger siblings.
He described his mother as “a spunky woman,” adding that the murder “tore the whole family into pieces.”
The killer was out for blood. He held a woman captive. Her name was Maureen Fernandez. She was a mother of three and liked to be called Nina.
 The tires of his car crunched on graveled asphalt as they passed into the trucking yard behind a grocery warehouse in Queens. There would be no witnesses as the night headed toward dawn on Thanksgiving Day 1987.
The man could murder Fernandez easily. She was a small woman, 5-foot-3 and 117 pounds. After drinking vodka plain and vodka with orange juice, doubles, across a long night, she was virtually incapacitated. Out came a knife with a 4-inch blade.
From the moment he was arrested, Rodriguez maintained his innocence. That is not surprising. Prisons are filled with “innocent” men.
Rare, though, is the convict who refuses to apply for all-but-guaranteed parole because he finds the price of freedom too high: He would have to admit guilt to open the prison gates.
As he approached a quarter-century behind bars, authorities scheduled Rodriguez’s first appearance before a parole board.
“My innocence was non-negotiable ... Unless you acknowledge that I’m innocent, you will not release me.”
With a clean prison record — with even corrections officers pulling for him — there was an excellent chance Rodriguez would walk free to embrace a son from whom he had been torn when the boy was 3, as well as a mother who had grown old waiting for him to come home.
“I apologized to my son and to my moms, the only people that I needed to apologize to, and I said, ‘I’m so sorry,’” Rodriguez recalls. “My innocence was non-negotiable. So I said in prison: ‘Unless you acknowledge that I’m innocent, you will not release me.’”
Two years later, when his next parole eligibility arrived, Rodriguez was even better positioned, having raised money from inmates to buy Christmas gifts for disabled children, support elderly nuns and purchase a golden ciborium that holds consecrated hosts in the prison chapel.
Rodriguez was just as adamant that he would not seek parole.
“I am willing to die in prison,” he told corrections officials.
Peter Early, deputy superintendent for security at the Otisville Correctional Facility, took Rodriguez at his word.
“I have the most respect for him of all the inmates I met over 36 years,” Early says. “I had no reason to disbelieve what he was telling me about being innocent.”
The killer stabbed Maureen Fernandez with hacking thrusts. The blade severed Fernandez’s carotid artery and jugular vein, penetrated her right kidney and serrated her liver. She hemorrhaged. Blood gushed from her body.
Still, the man wanted more. He pulled Fernandez’s jacket and shredded pink shirt up over her head. The back of the shirt bore her nickname between flowers. The front carried the words, “They may be small but they are all mine.”
The man pulled Fernandez’s jeans down her legs. He ripped her underwear down and slashed her across the top of her privates.
Finished with the knife, the man folded a dollar bill in four and placed it in a smear of blood on the jacket.
The case against Felipe Rodriguez was, at first, a case of no's. No witnesses. No motive. No connection between Rodriguez and Fernandez. No DNA evidence. No criminal record. No history of violence. No knife. No description of bloodstains on the clothing of the man presumed to be the killer.
No trail from McNeill Fernandez’s last known hours to the murder scene.
She spent her final day tending to her 2-year-old daughter who was being treated for a stomach virus at Brooklyn’s now shuttered Wyckoff Hospital. There was another mother and child in the room. As night approached, McNeill Fernandez started drinking. A nurse reported that she seemed “giddy.”
Around midnight or 1 a.m., McNeill Fernandez called her husband on a payphone. He could tell she was intoxicated. They fought. She returned to the hospital room, appearing upset. She asked the other mother to change a $10 bill. The other mother had only two singles. McNeill Fernandez traded her $10 for the two bills and said they would settle up later. She left, perhaps carrying the single the killer would stick to her coat.
The hospital lobby was deserted. McNeill Fernandez walked toward an exit door.
“Good morning,” she said to a security guard.
“Have a good Thanksgiving,” he replied.
She said she’d called a cab. He stepped into an office off the lobby. A few minutes passed. The guard hadn’t heard the hospital door open or close. He checked. McNeill Fernandez was looking out through the glass, as if she were waiting for someone to pick her up. Three minutes later, the guard heard the door open and close. He assumed someone had picked up McNeill Fernandez. She was gone.

Although a cab service reported answering a call from a woman at about the right time and place, the service also reported that the driver failed to find the caller. Meanwhile, the guard provided cops with an additional piece of information: He saw fellow security guard Javier Ramos at the hospital that night.
McNeill Fernandez was next definitively seen around 2:30 a.m. or 3 a.m., when she entered an establishment in Bushwick variously known as the LaFiesta Social Club, the Little Liva Bar and the Liva Little Bar. A man accompanied her.
The bartender knew McNeill Fernandez through one of her brothers. He was concerned. She said she was okay, that she knew the man. They sat at the end of the bar. She left with the man around 3:30 a.m.
Six hours later, on an unseasonably warm Thanksgiving, two NYPD officers responded to a 10-54 call — a report of a body down — from a security service. The cops sent up the chain that an unidentified female had been stabbed to death, partially stripped and left to die on the ground.
Detectives focused on McNeill Fernandez’s companion.
A street hustler named Robert Thompson had spoken to Fernandez and her companion in the bar after smoking five joints and drinking half a fifth of rum, plus downing three double shots of rum in their company.
A week after the murder, Thompson described the man to detectives as having reddish brown hair. Rodriguez's hair was jet black. The bartender said the man was “stocky” at 5-foot-8 and weighed 175 to 200 pounds. Rodriguez was 5-foot-11 and weighed 140 pounds.
Still, after almost a year-and-a-half, Thompson became the sole witness to pick Rodriguez out of a lineup, eventually proclaiming to a jury that getting drunk improved his sight and memory.
The only witness who connected Rodriguez to the murder was admitted liar Javier Ramos, the security guard seen at the hospital the night Fernandez disappeared.
Rodriguez and Ramos were friends. Initially a suspect, Ramos told police he had loaned his car on the night before Thanksgiving to a pal named Richie.
Later that morning, Ramos claimed, he found his car thick with blood and cleaned up the mess without calling police.

Ramos made no mention of bloodstains on Rodriguez or his clothing, a near certain outcome of a multi-wound close-contact killing. Nor did his account match with the murder scene:
While Ramos indicated that blood poured from McNeill Fernandez in his car, the medical examiner noted no trail leading the dozen or so feet from where the killer parked the vehicle to McNeill Fernandez’s resting place.
The prosecution filled out its evidence with additional circumstantial dots.
Thompson, the man who had been high and intoxicated in the bar, stepped to the fore with a story that first appeared in NYPD files six months after the murder. Suddenly, detectives wrote, Thompson had recalled that the man in the bar had tattooed the fingers of his left hand with "LOVE" in all caps.
Rodriguez had no tattoos.
Well, Thompson said, maybe Rodriguez had written the letters on his fingers.
Rodriguez is left-handed. A left-handed person would naturally write on his right hand.
The DA's office searched for witnesses to corroborate that Rodriguez made a habit of writing letters on his hand.
Investigators came up with a one-time rival auxiliary cop who hadn’t seen Rodriguez in several years, plus a hospital worker who had encountered Rodriguez a few times for a few minutes and believed he had markings on his hands — at a time when Rodriguez did construction work.
The prosecutors also called the bartender to the stand. After failing to pick out Rodriguez in a lineup six months after allegedly serving him across the bar for an hour, the bartender pointed to Rodriguez in court two years later.
As the prosecution connected its dots, Rodriguez’s defense lawyer was ill prepared, the trial transcript shows.
Jenny Maiolo was a well-liked fixture of the overwhelmed Queens criminal courts of that era. But unknown to her colleagues — and certainly to Rodriguez — Maiolo was under intense pressure as his trial neared.
Tragically for Rodriguez, his lawyer failed to play in court a police-supervised, surreptitious recording on which Ramos offered another story about the allegedly bloody car supposedly used in the murder.
A widow who had lost her husband due to complications after a dental procedure, Maiolo had just begun to steal an eventual half-million dollars from clients to stave off loansharks demanding payment for a family member’s gambling debts.
Her distraction extended to failing to respond after the Queens DA and federal authorities provided notice that a cooperating witness had exonerated another client who had been convicted of murder.
Maiolo's inaction cost that innocent man three years in prison.
Most tragically for Rodriguez, Maiolo failed to secure and play in court a police-supervised, surreptitious recording on which Ramos offered yet another story about the allegedly bloody car supposedly used in the murder.
As a result, the jury never heard Ramos say that, in fact, he had not loaned his car to anyone, that he had never cleaned up any blood, and that a child’s spilled juice probably caused the stain.
When the jury foreman pronounced Rodriguez guilty, Lloyda exploded in anguish.
“It was like a scream of when somebody that you love dearly is taken from you,” Rodriguez remembers.
The date: June 16, 1990. The place: D Block, Gallery 3, Cell 7 at the Great Meadows Correctional Facility, known to prisoners as Gladiator School.
“They got Bloods, Crips and Latin Kings,” Rodriguez says. “The tension is so high you feel it in the back of your neck.”
Rodriguez collapsed on his bunk and wept.
Then, reading a book by former Navy Seal Richard Marcinko, he came across a proverb that holds: For he who opts for revenge, make sure you dig two graves.
With anger eating him alive, Rodriguez fought to look forward with hope.
“There was days where I just wished I could fly away like a bird and just disappear,” he remembers. "There were days I just walked like a zombie, just because I needed to move. No strength, no focus, no purpose — just walking.”
In time, he accepted loneliness and suffering as his only two friends. He would allow only one of those unwelcome friends to visit on any given day.
Determined to maintain a relationship with his son, Felipe, Jr., Rodriguez sent notes and cards home regularly, with the total running into the thousands. Felipe Jr. wrote back just as much.
“My son did 27 years with me,” Rodriguez laments. “His soul, his spirit, my son never stopped being in prison with me. So he distanced himself from everybody, and he went to prison with me.”
Nine years into his sentence, Rodriguez and Lloyda married in prison.
Violence and death were like familiar cellmates.
An icepick through the heart took a prisoner standing next to Rodriguez at the Auburn Correctional Facility.  I want my mommy.”
Entrusted to hold heroin for a gang, the prisoner in the cell next to Rodriguez’s in Sing Sing shot up one night, danced around and hanged himself with a bed sheet.
After a member of the Bloods switched allegiance to the Crips, gang members ordered him to shed a cross on a chain given to him by his mother. He refused. His former friends in Sing Sing took turns stabbing the defiant prisoner with a butterfly knife.
Why and how anyone finds faith is a mystery. For Rodriguez, a chance encounter with a prayer group kindled a devotion to Catholicism, the religion in which he was raised but in which he had never been particularly active.
As the years passed, he tried to apply the teachings of Christianity even as he could not help but question God’s designs.
“There was days when you just ... begged God, you just begged, you said, ‘Please, if you do exist — if you are real, if you are true — why are you putting me through this?’” he remembers.
Always, though, he believed that God would come through for him, whether as a free man or on his prison deathbed.
A letter to the Innocence Project, one of hundreds he wrote appealing for help, started the ball rolling a long, slow course to a telephone call with Cuomo.
At the time, Rodriguez was painting a mural on the wall of a prison office. (Yes, he discovered artistic talent in prison, including the ability to build ships out of Popsicle sticks and Elmer's glue.) He was ordered to go to a prison superintendent's office.
The leadership of the Otisville Correctional Institution —- his tenth home since incarceration, met him there.
“You ok, Mr. Felipe?” the superintendent asked.
She had always called him Mr. Rodriguez. His eyes grew watery and his heart jumped, and then he knew that his faith had been rewarded, and he wept.
“Mr. Rodriguez, state your number for the record. This will be the last time you state that number.”
“In the years I’ve worked in corrections, I’ve never had the privilege to do this," the superintendent said. “But today I have it and it couldn’t happen to a nicer guy. You’re a free man.”
Shortly, Cuomo's voice came over the phone.
“Mr. Rodriguez, state your number for the record. This will be the last time you state that number.”
“90A7694.”
“By the power vested in me as governor of New York State, I hereby order your immediate release from state custody. I want to wish you the best of luck, and I hope you are able to restart your life and make something of it.”
He has and he is, while shadowed by the frenzied violence inflicted on Maureen McNeill Fernandez and the enduring suffering of her family.
A young woman named Tina falls in love with a young man named Matt. The time comes for Matt to meet Tina’s father, a formidable man named Peter.
The meeting goes well. Matt is a lawyer. He explains that he studied at Cardozo Law School because two professors, Barry Scheck and Peter Neufeld, were the brains of the Innocence Project, an organization that has won exoneration of more than 300 convicted prisoners through DNA testing.
Tina’s father admired the Innocence Project, and Matt was happy to make an introduction.
So it was that the proud father, Peter Ward, president of the New York Hotel & Motel Trades Council, sat down with Scheck. Ward arrived with three pledges:
He would raise money for the Innocence Project because he felt deeply that the criminal justice system is often stacked against poor and minority defendants.
He would help with the Innocence Project’s legislative agenda, bringing the muscle of 35,000 members to bear in Albany.
And he would help find jobs for released prisoners.
So it was that Felipe Rodriguez walked into Ward’s office fresh out of prison and living in a halfway house.
“Mr. Ward, all I want is to go to bed at night and not hear the institutional background noise,” Rodriguez said. “I want a little apartment where I have some peace and quiet.”
Rodriguez told his story. Ward interrupted, fibbing that he needed to get a bottle of water in the next room.
“I was really going inside to get a bottle of water because I was starting to cry,” Ward recalls.
He contacted an executive at Highgate, one of the city’s largest hotel management organizations, with a request to review Rodriguez’s resume, including his conviction and Cuomo’s clemency.
Robert Lafferty, Highgate’s vice president of human resources and labor counsel, and fellow company leaders found the Innocence Project’s work on Rodriguez’s behalf, as well as Cuomo’s clemency to be compelling. Lafferty interviewed Rodriguez.
“I discovered what a truly decent, graceful and dignified person he is,” Lafferty says.
The job title is house attendant. The hotel is the Row NYC on Eighth Ave. The duties entail supporting room attendants by delivering and removing linens, as well as cleaning throughout the building.
This is honest work, Rodriguez says. The union’s health benefits are New York’s best. The pay is $24 an hour, a boon to a man used to an hourly rate of 10 cents.
So it is as Felipe Rodriguez verges on his first Christmas in freedom. He will not be alone. Felipe Jr. who was always with him in spirit will be with him in person. There will also be a little boy, Gabby, short for Gabriel.
Rodriguez met Gabby in a restaurant near Rodriguez’s halfway house. The boy was 4. He reminded Rodriguez of his last vision of 3-year-old Felipe Jr. before prison. Gabby was waiting for his mother to get off work as a waitress in the restaurant.
Gabby was hungry. Rodriguez bought him food and talked to his mother, Karen. Rodriguez came to the restaurant again. He and Karen talked again, and then some more. Rodriguez met Karen’s other son, 15-year-old Iverson. Naturally, he is a basketball point guard.
They live as a family in Brownsville, Brooklyn. Gabby sleeps in a Lightning McQueen bed. Santa has brought him a motorized car, modeled after a BMW, for driving down the sidewalk.
Rodriguez will sit joyfully with Karen, Iverson, Gabby and Felipe Jr. gathered around the tree.
After Christmas arrives at midnight, he will lay his head on the pillow and recite a prayer to St. Michael the Archangel, thankful that his lawyers, Morrison and Margulis-Ohnuma, will fight on to clear his name — newly buoyed that Ramos appears ready to provide a fresh retelling of the crucial evidence presented by cops.
“We spoke to Mr. Ramos briefly about the case this week. He was very reluctant to talk to us but provided information that we think is important that we forward to the district attorney’s office,” they said in a statement. “We look forward to speaking to him further through his attorney as the investigation continues.”
If Rodriguez were to win exoneration, authorities would confront a terrible question that would add to the searing pain of Maureen McNeill Fernandez’s loved ones: Who is the true killer?
Rodriguez says that he prays for her and for justice for all while looking back at his journey through hell in the best light humanly possible.
“Prison made me a real man,” he says. “Prison molded me to be something that, if I never went in there, I would never have become. I would’ve never paid God any attention. I would never have had the need or the devotion to sit down and pay attention to God's voice, to hear what he had to say to me.”
At this Christmas hour, in this time of gift-giving, Rodriguez also speaks of a gift drawn from the depth of incarceration.
“One of the greatest gifts that I received from prison was the ability to embrace solitude,” he explains. “The ability to be still. To be still and hear God’s voice. To be still and know that he’s God, and that all things are possible.”
Additional reporting by Joe Carmichael


10. Should I get the internal stiffener?
If you carry a heavy firearm or have a high-ride top-heavy holster you might want to consider it for the inch-and a quarter wide belts. The stiffener is not usually necessary for the wider belts unless you like it really stiff. The stiffener provides a greater degree of vertical stability but still allows the belt to take on a natural curve that any leather belt will do after it has been worn for a while. A belt shorter than 36 inches DOES NOT need an internal stiffener. Horse hide belts DO NOT need an internal stiffener.


{% extends 'base.html' %} {% block head %}
1. Pick a starting value.
2. Pick number of iterations.
3. Calculate the new point while xnew - xold > precision.
Vi := beta1 * Vi-1 + (1 - beta1) * df/dxold
Si := beta2 * Si-1 + (1 - beta2) * (df/dxold)2
Vcorrected := Vi / (1 - beta1t)
Scorrected := Si / (1 - beta2t)
xnew := xold - alpha * (Vcorrected)/ (Scorrected1/2 + epsilon)


Despite the emergence of RDF knowledge bases, exposed via SPARQL endpoints or as Linked Data, formats like CSV, JSON or XML are still the most used for exposing data on the web. Some solutions have been proposed to describe and integrate these resources using mapping languages (e.g. RML, CSVW, kR2RML, etc) and many of those are equipped with associated RDF generators (e.g. RML-Mapper, CSVW generator, etc). As these solutions generate materialized RDF, they cannot efficiently deal with volatile data or provide a SPARQL entry point directly to the data sources. In this tutorial, we explain how to use a suite of tools to manage and exploit data in heterogeneous formats (CSV, RDB, JSON or REST API) without the need to load the resulting RDF in a triple store for querying it. First, we present TADA, a tool for automatically annotating CSV files using existing Knowledge Graphs. Second, we present HELIO, a Linked Data publisher that provides unified access in real-time to multiple heterogeneous data sources. Finally, we present an OBDA approach to exploit CSV published on the Web providing access via SPARQL or GraphQL.
The target audience for this tutorial is researchers and practitioners both from industry and academia who are interested in integrating heterogeneous data on the web using semantic technologies. The tools, slides and data that will be presented during the tutorial will be available online in this web page soon. Knowledge about standard mapping languages (R2)RML is not required but we will give a brief summary of the practical use of these proposals as they will be a key factor among all the solutions that will be presented in the tutorial.
TADA performs semantic annotation on tabular datasets. Given a tabular data file and an existing Knowledge Graph, it will automatically annotate the columns of the input data file with types from the given Knowledge Graph exploiting the data within
Helio publishes Linked Data from heterogeneous datasets in real-time, providing an unified access and view of the gathered data. Helio is a mapping-based approach, which supports complex function expressions to clean data and the use of fuzzy linking rules to generate links among published instances.
Morph is a suite of OBDA tools focused on the optimization of SPARQL-to-SQL translation process. It starts as a framework for querying relational databases using R2RML mappings and SPARQL queries and now has also incorporated an access to CSV files using state-of-the-art proposals like mapping languages (RML with FnO) and annotations (CSVW).
GraphQL is a graph query language that allows query heterogeneous data and services. During the last part of the tutorial, we will show how to query the virtual Knowledge Graph using GraphQL.
Agora allows to query sparse Link Data from different datasets, providing long query results that combine the different datasets data in an efficient time.
Ahmad Alobaid is a researcher and PhD student of the Ontology Engineering Group - Universidad Politécnica de Madrid since 2016, his main research area is on the semantic labelling of tabular data using machine learning and existing knowledge graphs. He co-organized a tutorial about Ontoology, a widely used ontology development tool, in EKAW2018
David Chaves-Fraga is a researcher and PhD student of the Ontology Engineering Group - Universidad Politécnica de Madrid since 2016, his work is currently focused on the generation of virtual knowledge graph from CSV on the Web using mapping languages. He is also an assistant lecturer in Semantic Web courses and the main coordinator of the formative international program Open Summer of Code in Spain.
Andrea Cimmo is a researcher at the Ontology Engineering Group since 2018 and PhD student from Universidad of Sevilla. His main research interest is on providing efficient access to heterogeneous services in the IoT domain. He has been also an assistant lecturer in several Software Engineering courses.
Oscar Corcho is a full professor at Universidad Politécnica de Madrid and one of the leaders of the Ontology Engineering Group. He also leads the Data Integration area of the group, where all the presenters come from. He has been working and teaching Data Integration, OBDA, and Linked Data since 2004.
Freddy Priyatna is a postdoctoral researcher at the Ontology Engineering Group - Universidad Politécnica de Madrid since 2012. He holds a PhD in the same research group where he developed the R2RML engine morph-RDB together with R2RML mapping generator, MIRROR. His main research area is on providing query access to virtual knowledge graph. He also takes part as an assistant lecturer teaching OBDA in several Semantic Web courses.


Environment variables can be edited on the deployment {{deployment.metadata.name}}.
Environment variables can be edited on deployment config {{deploymentConfigName}}.


| Proceeds | {{proceeds}} |
| Cost | {{cost}} |
| Total Purchase Price | {{init_total}} |
| Buy Commission | {{buy_comm}} |
| Sell Commission | {{sell_comm}} |
| Tax on Capital Gain | {{gain}} |
| Net Profit | {{net_profit}} |
| Return on Investment | {{ret_on_inv}} |
| To breakeven you need | {{breakeven}} |


Toggle navigation
Admin/Teacher
{{name}}
Profile
Inbox
Settings
Log Out
Dashboard
Exams
Groups
New Exam
New Group
Preview Exams
Profile
Change Password
Dashboard
Change Password
Old Password
New Password
Confirm Password
{{msg}}
Change Password


Image to Secret Code Generator
Choose images from 6*6 matrix for generating secret
"
Choose Four types of Characters
Your Secret Code is Here
Reset


Generates a schema for every name space that is referenced in your Java classes.
schemagen [ options ] java-files
The command-line options. See Options.
The Java class files to be processed.
The schema generator creates a schema file for each name space referenced in your Java classes. Currently, you cannot control the name of the generated schema files. To control the schema file names, see Using SchemaGen with Ant at
http://jaxb.java.net/nonav/2.2.3u1/docs/schemagenTask.html
Start the schema generator with the appropriate schemagen
shell script in the bin directory for your platform. The current schema generator can process either Java source files or class files.
schemagen.sh Foo.java Bar.java ... Note: Writing schema1.xsd
If your java files reference other classes, then those classes must be accessible on your system CLASSPATH
environment variable, or they need to be specified in the schemagen
command line with the class path options. See Options. If the referenced files are not accessible or specified, then you get errors when you generate the schema.
The location where the schemagen
command places processor-generated and javac
-generated class files.
The location where the schemagen
command places user-specified files.
The location where the schemagen
command places user-specified files.
Specifies the encoding to use for apt
or javac
command invocations.
Generates an episode file for separate compilation.
Displays release information.
Displays a help message.
Using SchemaGen with Ant at
http://jaxb.java.net/nonav/2.2.3u1/docs/schemagenTask.html
Java Architecture for XML Binding (JAXB) at
http://docs.oracle.com/javase/8/docs/technotes/guides/xml/jaxb/index.html


Yii Framework 2 swiftmailer extension Change Log ¶
- 2.0.7 May 01, 2017
- 2.0.6 September 09, 2016
- 2.0.5 March 17, 2016
- 2.0.4 May 10, 2015
- 2.0.3 March 01, 2015
- 2.0.2 January 11, 2015
- 2.0.1 December 07, 2014
- 2.0.0 October 12, 2014
- 2.0.0-rc September 27, 2014
- 2.0.0-beta April 13, 2014
- 2.0.0-alpha, December 1, 2013
2.0.7 May 01, 2017 ¶
- Bug #46: Fixed
yii\swiftmailer\Message
does not clones $swiftMessage
during its own cloning (evpav, klimov-paul)
- Enh #37:
yii\swiftmailer\Logger
now chooses logging level depending on incoming entry format (klimov-paul)
- Enh #40: Added
yii\swiftmailer\Message::setHeaders()
allowing to setup custom headers in batch (klimov-paul)
2.0.6 September 09, 2016 ¶
- Enh #6: Added ability to specify custom mail header at
yii\swiftmailer\Message
(klimov-paul)
- Enh #23: Added
yii\swiftmailer\Message::setReturnPath()
shortcut method (klimov-paul)
- Enh #27: Added ability to specify message signature (klimov-paul)
- Enh #32: Added
yii\swiftmailer\Message::setReadReceiptTo()
shortcut method (klimov-paul)
- Enh: Added
yii\swiftmailer\Message::setPriority()
shortcut method (klimov-paul)
2.0.5 March 17, 2016 ¶
- Bug #9: Fixed
Mailer
does not check if property is public, while configuring 'Swift' object (brandonkelly, klimov-paul)
2.0.4 May 10, 2015 ¶
- Enh #4: Added ability to pass SwiftMailer log entries to
Yii::info()
(klimov-paul)
2.0.3 March 01, 2015 ¶
- no changes in this release.
2.0.2 January 11, 2015 ¶
- no changes in this release.
2.0.1 December 07, 2014 ¶
- no changes in this release.
2.0.0 October 12, 2014 ¶
- no changes in this release.
2.0.0-rc September 27, 2014 ¶
- no changes in this release.
2.0.0-beta April 13, 2014 ¶
- Bug #1817: Message charset not applied for alternative bodies (klimov-paul)
2.0.0-alpha, December 1, 2013 ¶


Only the first five characters of the hash of your password get send to
haveibeenpwned.com
Check
Source code on github


[Note that the follow-up is set to rec.arts.sf.written rather than rec.art.sf.movies. This was done on purpose. -Moderator]
THE WHOLE WIDE WORLD A film review by Steve Rhodes Copyright 1997 Steve Rhodes
RATING (0 TO ****): **
Your eyes may be playing tricks on you. The title of this movie is THE WHOLE WIDE WORLD and not the World Wide Web. Many computer types will probably have to parse the name several times to get it right. This is a film not about the Net, but about someone known as "the greatest pulp fiction writer in the whole wide world." It is a true story based on the memoirs of the writer's lover and written almost a half a century later. The only real reason to see the film is to catch more of that new star from JERRY MAGUIRE, Renee Zellweger, in one of the movie's two leading roles.
Although it has a classic three tissue ending, the rest of the picture is a remarkably unmoving portrayal of two characters full of potential. As flat as the Texas prairie, the movie saves all of its emotional impact until the end.
Set in poor, rural Texas in 1935, Vincent D'Onofrio (from FEELING MINNESOTA and ED WOOD) plays Robert "Bob" E. Howard, the prolific pulp fiction writer who gave the world, CONAN, THE BARBARIAN among many other contributions. Renee Zellweger is school teacher, student, and unpublished writer Novalyne Price. Although Bob does not to seem to have all of his marbles and is viewed as the local eccentric by the town, she falls for his extroverted behavior and his literary success.
The cinematography by Claudio Rocha is gorgeous. You may remember his stunning work in PICTURE BRIDE. Here he shows Texas as its best -- full of reddish golden colors. The prettiest images are the sunsets, but the forest canopy is warm and inviting as well. The best sequence has the camera pan down slowly from the highest branches to the seemingly insignificant people under them.
Making a living producing pulp fiction isn't easy. As Bob says, they "pay me only one half cent per word." But he copes. He reveals that his solution is, "I stretch it out; I'm verbose."
Bob is not prime date material. His idea of a good time is "drivin' and blabbin'," which he does frequently in the movie. Herein lies the major problem with the film. Screenwriter Michael Scott Myers rarely gives him anything to say worth hearing. Even if this stems from deficiencies in the book, Myers should have been able to fix it. This is compounded by Dan Ireland's meandering direction and Luis Colina's loose editing. There are the ingredients for a good movie here, but the mixture we are given does not gel.
The two leads give good performances, but the rest of the cast, especially all of Novalyne's women friends, are weak. I found the "Texan Spoken Here" sign at the soda fountain quite ironic since few of the characters even attempt an accent. Those that do come up with a weak, vaguely Southern accent. In a small Texas town before the advent of television, you can be sure that all the accents would have been so thick you could have cut them with a knife. I grew up in Garland, Texas, and know what small town Texas speech sounds like. This is not even close.
No matter how hard Zellweger and D'Onofrio try, the movie never made me care about their characters. Zellweger's part was made more earnest than touching by the script, and D'Onofrio's was reduced to quirkiness. In the finale, when it came time to break out the Kleenex, my eyes stayed dry. Some of people in the audience whimpered, but I was never more than intrigued by the film. A promising story, but a disappointing delivery.
THE WHOLE WIDE WORLD runs 1:45. It is rated PG. There are a couple of mild cuss words, but no sex, nudity or violence. Given the mature themes, kids would probably have to be nine or ten to be interested in the show. Although the film has its moments, it is not compelling cinema. I give it a mild thumbs down and **.
**** = One of the top few films of this or any year. A must see film. *** = Excellent show. Look for it. ** = Average movie. Kind of enjoyable. * = Poor show.  Totally unbearable.
REVIEW WRITTEN ON: January 3, 1997
Opinions expressed are mine and not meant to reflect my employer's.
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews