Hundreds of people around the world worked together to put Michael Jordan in Looney Tune Land. Read on...
Table of Contents:
- Putting Real Life into the Cartoon World
- Technology Shapes Art
- Being Green
- To Sherman Oaks -- And Beyond
- On to Cinesite
- On the Basketball Court
- Filling the Bleachers
- Distorting Michael Jordan
- The Artist is in the System
THE TECHNICAL BACKGROUND TO SPACE JAM
by Bill Warren
Ivan Reitman is known as the director of such hit comedies as Twins, Stripes and Dave, but in his busy career, he has returned again and again to technically challenging projects. He produced They Came from Within, the first David Cronenberg movie to get wide release; it involved creepy parasites. Reitman also produced Heavy Metal, one of the first feature cartoons aimed primarily at adult audiences. And, of course, there was Ghostbusters and its sequel, the worldwide hits that he both produced and directed--and which opened many doors to new kinds of special effects.So it's hardly surprising that Reitman has now produced Warner Bros.' first release through its new Feature Animation division: Space Jam, directed by Joe Pytka. It is also the first feature film in history to combine such a large amount of traditional cartoon animation, live action and three-dimensional computer graphics. Space Jam stars sports superstar Michael Jordan as well as Bugs Bunny, the Looney Tunes, Wayne Knight, Theresa Randle. Cameos are played by Bill Murray, former Boston Celtics great Larry Bird, and NBA stars Patrick Ewing, Charles Barkely, Muggsy Bogues, Larry Johnson and Shawn Bradley. Reitman's long-time associates, Joe Medjuck and Dan Goldberg, produce with him.
The animation segments, produced through Warner Bros Feature Animation, are co-directed by Bruce Smith and Tony Cervone, and the animation producer is Ron Tippe. The post-production and computer visual effects were created by Cinesite, a Hollywood facility specializing in digital dazzle and sophisticated effects, whose founder, Ed Jones, received an Academy Award for his work on Who Framed Roger Rabbit?
So what does this exotic hybrid of computers, artists and actors require from the filmmakers and their crews?
When moviegoers think of "computer animation," they are most likely without a clear idea of what that term really means. Many may assume that a computer scientist sits in front of a console, types in the words "Bugs Bunny" and "Daffy Duck," chooses plot option C-27, and the setting "Mars." He presses "enter" and goes out for a cup of coffee. He comes back an hour later to find a seven-minute cartoon sticking out of the side of the computer.
Well, that's not all, folks. That's not even close, folks--for the artist is never out of the loop. As computer-intensive as it is, even Space Jam began with talented animators drawing some of the most famous cartoon characters in the world in the usual way: with pencil on paper. What happens after that is the technical story behind Space Jam.
PUTTING REAL LIFE INTO THE CARTOON WORLDCombining live human performers with cartoon characters goes back to almost the very birth of cartoons. In 1906, J. Stuart Blackton's Humorous Phases of Funny Faces featured a live cartoonist creating moving drawings on a blackboard.  Walt Disney began his career with a series of shorts in which a little girl named Alice--a live entertainer, shot on standard film--frolicked with cartoon animals.
Over the years, there were other brief attempts at combining live action and cartoons; Disney returned to it with Song of the South in 1949. At Warner Bros. the same year, in My Dream is Yours, Doris Day and Jack Carson scampered through a little boy's dream, performing with the Oscar-winning rabbit, Bugs Bunny. At MGM, Gene Kelly and Esther Williams performed with that studio's most famous characters, Tom & Jerry--Kelly in Anchors Aweigh (1945), Williams in Dangerous When Wet (1953). And back at Disney, the 1964 hit, Mary Poppins, sent Julie Andrews and Dick Van Dyke on a jolly holiday with animated penguins and street entertainers.
Although those sequences were spectacular and entertaining, it wasn't until the Amblin/Disney production of Who Framed Roger Rabbit? in 1988 that anyone tried to combine animated characters and live-action actors throughout a feature-length movie.
As dazzling and technically sophisticated as Who Framed Roger Rabbit? certainly was, that was then and this is now. As Tony Cervone puts it, "Roger Rabbit was the vinyl LP and this is the compact disc." Space Jam has leapfrogged ahead in the realm of combining live action and cartoons, by tapping the talents of Roger Rabbit innovator Ed Jones and other gifted effects and animation experts.
Wendy Aylsworth, Vice President of Technology and Facilities for Warner Bros. Feature Animation, points out the differences. "Everything in Roger Rabbit was shot to film, then the pieces of film were combined. But with today's technology, we can now have all of the animation colored in the computer; the original live-action footage is also scanned into the computer, and of course the three-dimensional aspects are created in the computer. So all of the individual elements for Space Jam can come together in the computer; each individual element can be modified in color and brightness and lighting and texture to make it all mesh seamlessly."
As Tony Cervone says, "I don't think any picture has combined so many different media as Space Jam has." Bruce Smith adds, "And all are interchangeable at different times, so it's not one medium with another constantly. There's animation with the CG [computer graphics] environment, it's animation in the traditional environment, it's live action in the CG environment, and live action with the animated environment."
TECHNOLOGY SHAPES ART
Almost all the advances seen on the screen are due to the amazingly rapid progress in the application of computers to the field of animation--in fact, to virtually every aspect of Space Jam. Early in the film, after we've met Michael Jordan, the camera pans upward and the standard live-action world is left behind as we see a miniature rooftop; the camera moves higher to a computer-created sky and the Nerdlucks' home planet.
Moving closer to this "3-D" world, the camera passes into a giant carved mouth and ends on a scene of classic cartoon (or "2-D") animation. In what looks like one unbroken camera movement, we move from the realm of reality to miniatures to computer graphics and finally to cartoon animation. (The use of the term "3-D" here differs from the old 3-D used in Warner Bros.' classic House of Wax: audiences won't dodge basketballs flying off the screen. Here, it means simply the realm of computer graphics which have a more solid, dimensional look than flat, "2-D" cartoon animation.)
Movies run at 24 frames per second, but most cartoon features are shot "on twos," meaning that one drawing is repeated for two frames. Therefore, there are 12 individual drawings for each second in the usual Hollywood cartoon.
However, it's true that in any feature, a lot of the animation is shot "on ones" -- 24 new drawings per second, just like the number of frames used to film live action. This is usually done for fast action or other moments where fluidity and clarity of action are important, or, as with Space Jam, when cartoons and live actors appear together and must coordinate their motion,reactions and postions. On Space Jam, all of this animation was done by hand by the animators of the film.
In addition to the state-of-the-art computers and animation techniques, other cutting-edge technology was used in "Space Jam." Most movies that blend effects into footage shot with a moving camera use variations on the "motion control" system originally developed for Star Wars. A computer is attached to the camera so that it can remember the precise moves the camera made, and can reproduce them when the effects team adds other elements to the scene. Or a camera computer can "encode" the movements of the camera even if it is being moved by a human operator.
Says director Joe Pytka, "We used the best equipment, as well as the best ideas we could come up with, to make Space Jam a movie worth watching. As technology continues to evolve, audiences know what to watch for and they develop certain expectations. our goal was to stay two steps ahead of their expectations -- we're setting expectations with this movie."
BEING GREEN
One of the problems in filming actors working with cartoon characters who are added later is that it's very hard for anyone to visually focus on an empty space three feet in front of them that will later be filled with a talking duck. Try it yourself: it's nearly impossible. The result is that the human beings rarely seem to be looking directly at the cartoon characters. Even if audiences don't notice this consciously, it's a kind of unconscious static that interferes with the belief that all this is really happening.
Reitman, director Joe Pytka and Ed Jones, the founder and head of Cinesite, came up with an ingenious solution to this problem--and their solution solves several other problems as well. It involves the use of a lot of green walls, green floors, and actors from the Groundlings improvisation comedy troupe covered all but for their eyes in clothing of the same green color. In fact, if you'd been on the set of Space Jam, you'd have seen the nearly surreal sight of Michael Jordan vigorously playing basketball in a green gym with a bunch of green people, some of whom scamper about in crouched-over positions. Other than Jordan himself, the only colors you could see other than green would have been the basketball net and its backboard--and regularly-spaced red balls and dots in a square grid all over the floors and walls. But that's not what you'll see in the finished film.
Joe Pytka loves strong, forceful camera moves; Michael Jordan is, of course, an athlete who expresses himself best through movement--and it can rarely be rehearsed in the way an acting performance is. As Ed Jones says, "We had to shoot Michael being inventive, and Michael's only inventive one time--the camera had better be ready to capture it." Spontaneity was the rule of the day, but cartoons, by their very nature, are, of course, totally controlled by the artists. The challenge was to combine Pytka's needs and Jordan's abilities with the cartoons. The solution was that green room and those red dots.
TO SHERMAN OAKS -- AND BEYOND
Because of the complex nature and relatively short production schedule of Space Jam, in addition to the team at the Warner Bros. Feature Animation facility in Sherman Oaks and the team in the company's London studio, the production recruited a select group of animation studios all over the world. Ultimately, everything was sent to Space Jam's Sherman Oaks headquarters, where all the drawings were scanned into computers and digitally transmitted, via fiber-optic cables, to Cinesite's computers for compositing.The involvement of computers on Space Jam began immediately after the animators completed their drawings, and the background painters their work. These were scanned into digital computer memory by using Cambridge Animation's powerful and versatile Animo software program, used to complete the next several stages of work.
The ink and paint department no longer uses real ink and real paint; instead, using the Animo program, they call up the animators' drawings, one frame at a time, onto a computer screen. The expressive pencil lines of the animators are temporarily replaced by very thin lines the computer creates--it even completes lines when the artist has, for purposes of delineation, left them broken.
Using color models created by art director Bill Perkins and his staff, the "painter" employs Animo's built-in palette to color each of the animated characters on the computer screen in flat, bright colors, much like a standard seven-minute cartoon. For the classic Looney Tunes gang, this was, of course, the colors established over years of use; for the Nerdlucks, Monstars and Swackhammer, the colors are, of course, new.
One of the most interesting features of Animo is that it allows the colors to be changed at will. Once a sequence is fully colored, if the directors or art director want the characters changed, this can be done with a few strokes on the keyboard. For example, if a scene originally colored for daylight becomes a nighttime scene instead, they can replace all of the bright colors with darker tones.
Animation producer Ron Tippe points out the advantages. "If you compare the traditional ink-and-paint process of Xeroxing the artwork onto cels and painting it by hand, there's a great savings in time. With original cel paint, very often only one or two colors at a time could be painted. You would then have to wait for those colors to dry, and then repaint it, so it was a very exhausting process." Wendy Aylsworth adds, "We're averaging about 4 minutes for every cel that's painted. Traditionally, if you hand-painted that stuff on acetate, it's more like 20 to 30 minutes per cel."
When all the coloring is done, the original pencil lines are restored; the flow, the thickness, the manipulation of the line that often adds so much to an animated character is back where it should be. If these lines need their own color changed, from the gray of pencil to, say, bold red for a dramatic effect, this can be done as well, without ever losing the characteristics of the animators' original drawings. With traditional animation, the color had to be scraped off each individual cel.
These technical innovations give shape and life to the Looney Tunes characters, but of course, there's more to Space Jam than a class reunion of Bugs, Daffy and their pals. There are live actors in the animated world, and animated characters in the real world.
Because so much of Space Jam takes place in the "real world," the drawings needed a further boost than is given in most cartoons: they needed to look as though they were being lit by movie lights. The "key light," the strongest light in a scene, was represented by highlighting the parts of the cartoon character illuminated most strongly by this light. "Fill lights," the dimmer lights in a scene, also needed to be indicated, as did the areas of the characters not being "struck" by light.
The "tone mattes" that create this were the work of effects animators. Bill Perkins explains, "They create hard-edged black pieces of artwork that define the lighter or darker areas on the character. The black region dictates at a later stage of compositing what kind of color is added to or taken out of that area of the character to make it appear rounded. So you'll have a piece of black matte artwork that defines the brighter areas where light is striking a character, and you'll have another that defines the darker area, where it's more in shade." The mattes themselves look like thick-lined, negative images of the animated characters with some parts left out.
"Each animated character," Wendy Aylsworth explains, "has multiple mattes drawn over it to give it shadings." The mattes were scanned into the Animo system, exactly like the original animation, then laid over the colored animation artwork to indicate the lightening and darkening of the colors of the individual characters section.
ON TO CINESITE
When all this work was done--entirely within the digital computer realm--it was transmitted over a high speed network connection from the Space Jam offices in Sherman Oaks to the offices of Cinesite, the computer visual-effects and post-production company, in Hollywood.Here, using Kodak's Cineon system, artists worked on the drawings even further with compositing computers. Digital effects producer Helen Elswit explains, "We set up a 'hero shot'--in each scene, a specific shot is chosen so that the art director, Bill Perkins, and I can sit down with the main compositor at the computer and set the look for the scene. For the most part, unless there is a dramatic mood or lighting change in a scene, one hero shot is sufficient. This shot is then put out on film so that Ivan Reitman can give his approval. Once we have that hero established, Cinesite joins the process, taking the hero shot and all the other shots from animation in that sequence, and builds the scene."
Cinesite vice president of production Mitzi Gallagher explains, "We found that as we began adding live-action and animated characters to a scene, the initial look needed to be adjusted to make sure that the right characters were emphasized with no one blending into the background. Our digital-effects supervisors, Carlos Arguello and Doug Tubach, adjusted the brightness, the colors, the tones and shadows, working with Ivan Reitman so that all the various elements were consistent and accomplished the scene the way he envisioned it throughout the scene."
Cinesite went further, too. They added depth to the backgrounds--buildings "moved" further away, trees came closer, for example. What would be called "grad filters" with a real camera were also employed, allowing a given shot to be darkened subtly around the edges, so that the viewer's eye will focus on the highlighted center of the shot. And they could manipulate the tone mattes further as well, creating as many different layers of shading as desired.
"We break the tone mattes down into separate elements," Ed Jones explains, "depending on whether they're on a cheek or on a body. We can control the density, the color, the amount of blur on the edge, depending on how we want to light the character. We are painting on film with the computer and we're creating dimensionality, depending on whether the character is closer to the camera or farther away. The closer it is to the camera, the more it must be modeled. And then we can add motion blur, like a camera shutter would blur a regular scene. We can stylize how each of these animated characters looks."
In traditional animation, these different layers represented by the flat art, the backgrounds and the tone mattes, were literally that: layers of celluloid with paint on them. Going beyond five or six layers tended to bring out the faint color of the celluloid itself, adding a yellowish, cloudy look to the more layered sequences. The famous "multiplane" of the Disney studios, which used sheets of glass stacked like a colossal sandwich, was an effort to overcome some of these problems, but it is a huge, cumbersome device used only for the most spectacular scenes requiring many layers of depth.
By keeping all of the drawings in digital form (but easily shown on a video screen), the Cineon operator can add as many layers of depth as the scene needs without any loss of definition or addition of unwanted color whatsoever. Tony Cervone adds, "You could put ten thousand layers on this stuff, and it will do nothing, it will never cloud up."
Furthermore, with all the animation now loaded into the computers, the kind of small errors that can creep in with so many people working on a project can easily be corrected. "Sometimes," says Wendy Aylsworth, "when we've got the shots together, the perspective doesn't look right, or the sizing is off because something went wrong in doing the rotoscopes (drawings based on moving images). Or perhaps a character was drawn too close, but should be further into the background. You can use the computer to completely re-size and reposition any character, to make them fit into the scene correctly. The computer is used a lot for that, making sure everything's staying in perspective."
ON THE BASKETBALL COURT
One problem that has always existed with cartoons is the sometimes wildly shifting perspectives of a background. If you are using a movie or video camera, panning over any background behind the actors, if you examined the film a frame at a time, you'd see that the background seems to distort a little--or a lot, if a wide-angle lens is used.
In conventional cartoons, this distortion has to be drawn in by hand on the backgrounds. For example, if the scene required a swift pan down a drainpipe on the corner of a building, the artist had to draw a radically distorted drainpipe: straw-thin at the top of the drawing, expanding to a big bulge in the middle, tapering away to nothing again at the bottom. The camera, moving in a flat plane down this artwork, appeared to do a whip-pan down the side of the building. And don't forget the building: that, too, would have to be carefully drawn in a distorted way to match the drainpipe.
It takes the talents of both an artist and a mathematician to create this kind of distortion, and it takes a lot of time. Space Jam, surprisingly enough, went from conception to finished product in one-third the time of a normal animated feature-and yet it required more amazing shifts in perspective than a normal animated feature.
Originally, the giant basketball stadium at the end was going to be raised up above the basketball court, in an effort to overcome some of these perspective problems, as well as to evade having to animate all the spectators. But Ivan Reitman and Joe Pytka bit the bullet: in a real NBA stadium, the seats come right down to a few feet of the basketball court, so the stadium in Space Jam required the same kind of seating. These perspectives were going to have to shift, and there were going to be thousands of animated spectators.
Cinesite found the solutions to these problems, as well as how to incorporate Pytka's swirling camera moves. The first big basketball scene in Space Jam is set in a practice gym, where Michael Jordan learns just how inept the Looney Tunes characters are when it comes to dribbling and slam-dunking. The walls and floors of the gym are entirely created within the computer; all Michael Jordan saw was that sea of green, and guys in green suits.
Animation layout artists designed the practice gym and designers at Cinesite created a computer model of that gym, first in what's known as a "wire frame." This simply means that what you'd see on the computer screen is the gym as if it were made of thin white wires only, stark against a black background.
Meanwhile, the scenes of Michael Jordan and the green Groundlings in the green court were digitized, and all the green dropped out, which took away everything except Michael Jordan, the basketball, and the hoop, net and backboard. He seemed to be playing basketball against invisible opponents in a black limbo.
But don't forget those red dots: they were uniformly spaced around the room in a four-foot grid. Much as graph paper is used to plot curves, the computer could remember precisely the location of each of those balls. When this information was applied to the 3-D wire frame of the practice gym, the computer could move the wire frame about in "virtual space" in ways that precisely matched the live camera of director Joe Pytka. The moves of the camera drove the movements of the gym itself.
This was added to the footage of Michael Jordan--all in digital space, maintaining perfect resolution--and he seemed to be playing basketball now in a gym made of white lines on a black background. Now this footage was printed a frame at a time onto "photo rotos" and sent back to the animators in Sherman Oaks. They could see Michael Jordan's precise location, and where the green Groundlings were; they could then place the animated characters exactly where they needed to be, a frame at a time. The animators didn't have to follow the movements of the green Groundlings exactly, because even a crouching real live person doesn't have the same dimensions as Daffy Duck.
The process described above was again applied, this time to the footage of Michael Jordan and the Looney Tunes characters working out in the practice gym--playing basketball. The ball is real when Michael Jordan is touching it, but had to be put into some form of animation when Bugs and his buddies control it. However, no matter what form it's in, it's no ordinary ball, and here's why:
Joe Pytka is a major basketball fan; one of his most treasured possessions is a scuffed old ball that has been touched by many of the greatest basketball players who ever lived. Ed Jones and his crew managed to sneak the ball away from Pytka, and scanned it from every possible angle into the computer.
Now in computer-graphics form, the ball could be animated to do anything they wanted, so that whenever Jordan is holding the ball, or it's bouncing off the rim or swishing through the net, it's real. When Elmer Fudd dribbles it down the court and passes it to Yosemite Sam, it's computer animation of Pytka's beloved ball.
That ball bounces about on the court of a giant stadium, rendered in "3-D" computer graphics. Ed Jones and the team at Cinesite did everything they could to make the stadium look as real as possible: the floor has a polished sheen, the overhead lights occasionally make (computer-realized) "lens flares," and the lighting on the audience is blotchy in the way it is in real life. All this is complex, but these days, is not particularly difficult for talented computer artists to create.
FILLING THE BLEACHERS
What was hard was the audience itself. This sequence takes place in the land beneath the ground where the Looney Tunes characters live, so the audience had to be entirely cartoon characters--twenty-five thousand of them. While Bill Perkins and others at Warner Bros.' Sherman Oaks studio could provide Cinesite with strips of Looney Tunes characters, animating so many characters was, flatly, impossible.
They overcame the problem with startling ingenuity. First, Cinesite simply duplicated some of those characters in their computers and scattered about the auditorium; their coloration could be changed, but there were still limitations in doing it this way: an entire squad of, say, kilt-wearing Scotsmen (one of Bugs' old opponents) would certainly not go unnoticed, even if some of them wore paisley kilts.
Ed Jones hit upon the idea of filming real people, some in bizarre costumes--there's a guy wearing a spotted cow suit, for example--others in regular clothing that's in bright, primary, cartoon colors. Some of these people wore generic "cartoon" heads, others wore the heads of specific characters. Then these were scanned digitally into the computer, manipulated there in any number of ways: in terms of color, size, whether they're standing and cheering or sitting and applauding, how far they are from the "camera's" position, and so forth. "We've mixed and matched all these characters," Jones explains, "mostly for the front rows. The audience is still going to see the motion in the back rows as they look up there. The crowd is part of the environment."
Occasionally, the Sherman Oaks team animated a specific portion of the stands to highlight a cartoon-animated figure (watch for the bull from "Bully for Bugs," for example). By these means, the handful of live-action people and the strips of cartoon animation multiplied over and over until they became a cheering throng of cartoon characters.
New technologies are created to solve old problems, but sometimes those new technologies can create problems of their own--and as always, it is up to human ingenuity to solve them. For example, while shooting in the all-green set, occasionally one of the green Groundlings passed briefly in front of, say, Michael Jordan's leg, a quick move that went unnoticed at first. But since the green all went away, that meant that part of Jordan's leg hidden by the green guy also went away. Co-directors of animation Bruce Smith and Tony Cervone went over every day's work in a "sweat box" session, and when they'd spot a bit of Michael disappearing, they knew that it was time to have, say, Sylvester chase Tweety Bird through the scene, hiding that momentary loss of Jordan's body.
DISTORTING MICHAEL JORDAN
And speaking of Michael Jordan's body, thanks to Cinesite, he gets battered and transformed as much as any of the animated characters. "When Michael is first introduced into looney Tunes Land," Ed Jones explains, "he's playing a golf game, and gets zipped down a hole. We shot two plates [scenes to which effects are added] on location, one of Michael bending over, and one with just the golf green. Michael pantomimed going down the hole, and then we built a 3-D Michael."This wasn't some Frankensteinian experiment, but a matter of scanning Michael and storing his digital image in a computer. This enabled Cinesite to manipulate the footage of Jordan in exactly the same way as any other artwork: Michael could be stretched, squashed, and even wadded up into the shape of a basketball.
"We added other magic, too," Jones grins. "When Bugs kisses Michael, we altered Michael's lips a little--stretched them out a little as Bugs' lips come back out. There are times when Bugs is tapping Michael, so we added indentations into Michael's clothing from Bugs' fingers. This is for the laserdisc collector, who can stop on a frame and see all our tricks."
Not only does Michael Jordan plunge literally headfirst into the world of the animated Looney Tunes characters, but Bugs Bunny and Daffy Duck venture out into the real world to retrieve Michael's basketball and his uniform. Again, green Groundlings were used, but this time they were shot in a realistic set of Michael's office rather than a green background. However, they were dropped out in the same way as though they had been shot on a green stage, and Bugs and Daffy were added where appropriate.
At one point, one of the character rummages through a drawer; the team shot this twice, once with the green Groundling going through this action, and once a simple plate of the same set of drawers with no one there. "In that case," digital effects producer Helen Elswit explains, "animation didn't have to cover the green guy. Artists could use it to draw in their animation while having the background fully visible. They were able to remove the green guy and still see what was behind him. Animators could be as free as they wanted, because they didn't have to worry about filling the space left when the green guy was removed on the computer."
THE ARTIST IS IN THE SYSTEM
All of the various elements of Space Jam gradually made their way into the computer systems at Cinesite, until the entire film existed there. When it came time to turn it into actual film, the computer was involved as well. With other computer animation systems, a very high resolution monitor is simply photographed by an appropriate camera, but with Cineon, there's no camera involved at all. A system of lasers is used to transfer the computer image directly onto film.One of the classic fears about computers has always been that they would wipe out jobs, making artisans, workers and even artists obsolete. But that's simply not happening. As Bruce Smith says, "I think the computer has always been intended to be an aid to the artist, and not necessarily to replace him. In this instance, we totally manipulated the computer for our use. It frees us up from the highly technical aspects that have to be believable in the way we make films today."
Producer Ivan Reitman marvels at the achievements that have brought Space Jam from concept to dazzling reality in such a short time, but he is realistic about the role of technology in creating a motion picture, animated or not. "Technology will never take the place of those creative skills that lead producers, directors and writers to make movies in the first place. A word processor doesn't make a novelist any more than a synthesizer makes a composer.
"Despite all the technological advances in animation, the quality of the production is still totally dependent on the skills of the artists. Computers are simply the latest tools available to help them bring their vision to reality. No hardware or software will ever replace human creativity."


Smartcrypt Unstructured Data
The Smartcrypt Unstructured Data component is particularly useful when encrypting data stored in files and other unstructured containers. ZIP archives are used for compression and encryption. Accordingly, large data sets benefit from this component.
Prerequisites
You must have the PKArchive.NET DLL available already. If you installed the PKArchive Toolkit, the DLL will already be available to your project. Alternatively, copy it to your project repository and reference it that way.
Setup
To get started, you'll need a new instance of IUnstructuredData
. See the MetaClient
docs for details on how to obtain that instance.
public static IUnstructuredData SetUp(IMetaClient metaClient) =>
new UnstructuredData.Builder()
.MetaClient(metaClient)
.License("<Your license here>")
.Build();
Instances of IUnstructuredData
are thread safe and should be reused throughout your application.
Create a ZIP
The basic steps of creating a ZIP are the same regardless of which encryption parameters are used.
public static void CreateZip(
IUnstructuredData unstructured,
IDictionary<string, Stream> filesToArchive
)
{
using (var factory = unstructured.CreateArchiveFactory())
// The factory provides a stream variant as well
using (var archive = factory.CreateArchiveFile("path/to/output.zip"))
{
foreach (var entry in filesToArchive)
{
var entryName = entry.Key;
var entryContent = entry.Value;
using (var itemOptions = factory.CreateItemOptions())
using (var status = Factory.CreateStatInfo())
{
status.Name = entryName;
archive.AddItem(factory.Context, status, archive, entryContent, itemOptions).Dispose();
}
}
// When finished with the archive, be sure to save
archive.Save(factory.Context)?.Dispose();
}
}
Configuring encryption
By default, the SDK chooses an encryption method that provides strong security and is well suited for most applications.
It may be desirable to change the encryption method (also called the encryption algorithm) used to create new ZIP entries.
The SDK provides a simple of way setting the most common and useful encryption methods. Configure the IPKItemOptions
,
and then use them as you typically would, following the instructions for creating a ZIP.
public static IPKItemOptions ConfigureEncryptionMethod(IArchiveFactory factory)
{
var itemOptions = factory.CreateItemOptions();
// Configure encryption to use AE2 (for compatibility with other ZIP programs)
itemOptions.SetEncryptionMethod(EncryptionMethod.Ae2);
// Configure encryption to use AES-256
itemOptions.SetEncryptionMethod(EncryptionMethod.Aes256);
// Now use the configured options to add items to the ZIP as you normally would
return itemOptions;
}
Advanced usage
For very advanced applications, it may be necessary to be more detailed when configuring the encryption method. This
snippet demonstrates how to configure the encryption more thoroughly. Review the PK_ENCRYPT_METHOD
and PK_CRYPT_FLAGS
enums for an exhaustive list of options.
public static IPKItemOptions EncryptionMethodAdvanced(IArchiveFactory factory)
{
var itemOptions = factory.CreateItemOptions();
var flags = CreateFlagsBitmask();
// Configure encryption to use AE2 (for compatibility with other ZIP programs)
itemOptions.SetEncryptMethod(PK_ENCRYPT_METHOD.PK_ENCRYPT_METHOD_AE2, 256, flags);
// Configure encryption to use AES-256
itemOptions.SetEncryptMethod(PK_ENCRYPT_METHOD.PK_ENCRYPT_METHOD_AES_256, 256, flags);
// Configure encryption to use AES-192
itemOptions.SetEncryptMethod(PK_ENCRYPT_METHOD.PK_ENCRYPT_METHOD_AES_192, 192, flags);
// Configure encryption to use AES-128
itemOptions.SetEncryptMethod(PK_ENCRYPT_METHOD.PK_ENCRYPT_METHOD_AES_128, 128, flags);
// Configure encryption to use 3DES
itemOptions.SetEncryptMethod(PK_ENCRYPT_METHOD.PK_ENCRYPT_METHOD_3DES, 168, flags);
// Disable encryption
itemOptions.SetEncryptMethod(PK_ENCRYPT_METHOD.PK_ENCRYPT_METHOD_NONE, 0, flags);
// Now use the configured options to add items to the ZIP as you normally would
return itemOptions;
}
public static PK_CRYPT_FLAGS CreateFlagsBitmask()
{
// Always include the default flag
var flags = PK_CRYPT_FLAGS.PK_CRYPT_DEFAULT;
// If using a Smartkey and/or password, add the password key flag
flags |= PK_CRYPT_FLAGS.PK_CRYPT_PASSWORD_KEY;
// If using a Contingency Key, add the certificate key flag
flags |= PK_CRYPT_FLAGS.PK_CRYPT_CERTIFICATE_KEY;
return flags;
}
Configuring compression
By default, the SDK chooses compression setting that balances speed with compressed size. However, it is possible to change the compression method. One might use a different compression algorithm , such as deflate, store, and LZMA, or specify a different compression level (higher for smaller ZIPs, lower for faster processing) as the application requires.
public static IPKItemOptions CompressionMethod(IArchiveFactory factory)
{
var itemOptions = factory.CreateItemOptions();
// Configure compression to use the deflate algorithm at level 6
itemOptions.SetCompressMethodID(PK_COMPRESS_METHOD.PK_COMPRESS_METHOD_DEFLATE, 6, 0);
// Configure compression to use the store algorithm (no compression)
itemOptions.SetCompressMethodID(PK_COMPRESS_METHOD.PK_COMPRESS_METHOD_STORE, 0, 0);
// Now use the configured options to add items to the ZIP as you normally would
return itemOptions;
}
Encryption
Encryption using both passwords and Smartkeys is straightforward. See the
Key Management docs for details on how to obtain an
ISmartkey
.
public static void ContingencyGroupWithSmartkey(
IUnstructuredData unstructured,
IMetaClient metaClient,
ISmartkey smartkey
)
{
using (var factory = unstructured.CreateArchiveFactory())
{
var listener = new MetaClientPasswordListener(metaClient)
{
EncryptionSpec = new EncryptionSpec
{
Smartkey = smartkey
// Optionally add a password here as well
}
};
factory.Context.PasswordListenerEx = listener;
// Proceed to create the ZIP as you normally would, using the factory created here.
}
}
Note
In order for Smartcrypt Archive Contingency Groups to apply, you must run your application as Smartcrypt. See the MetaClient Policy docs for more details.
Contingency group without Smartkey
The recommended way to gain access to the Contingency Group functionality of Smartcrypt is to use Smartkeys when encrypting. There may be some scenarios in which using a Smartkey is not an option. For these scenarios, we also provide the option of skipping the Smartkey, but still gaining the benefits of Contingency Groups.
public static void ContingencyGroupWithoutSmartkey(
IUnstructuredData unstructured,
IMetaClient metaClient,
string password
)
{
using (var factory = unstructured.CreateArchiveFactory())
{
var listener = new MetaClientPasswordListener(metaClient)
{
EncryptionSpec = new EncryptionSpec {Password = password}
};
factory.Context.PasswordListenerEx = listener;
// Proceed to create the ZIP as you normally would, using the factory created here.
}
}
Contingency key
Applying a contingency key is a bit more involved. When possible, it is recommended to use Contingency Groups instead.
public sealed class ContingencyKeyPasswordListener : UnifiedPasswordListener
{
[CanBeNull]
public EncryptionSpec EncryptionSpec
{
set => metaClientPasswordListener.EncryptionSpec = value;
}
private readonly MetaClientPasswordListener metaClientPasswordListener;
public ContingencyKeyPasswordListener(IMetaClient metaClient) : base(metaClient.Logger)
{
metaClientPasswordListener = new MetaClientPasswordListener(metaClient);
}
/// <summary>
/// Delegates to the <see cref="metaClientPasswordListener"/>.
/// </summary>
public override DecryptionParameters GetDecryptionParameters(IPKArchiveRootFolder archive, IPKStat status,
int retryCount, KmsInfo kms) =>
metaClientPasswordListener.GetDecryptionParameters(archive, status, retryCount, kms);
public override EncryptionParameters GetEncryptionParameters(IPKArchiveRootFolder archive, IPKStat status,
EncryptionChoices choices)
{
// Delegate to MetaClient to apply Smartkey and password set using EncryptionSpec property
var parameters = metaClientPasswordListener.GetEncryptionParameters(archive, status, choices);
// Prepare the contingency key
var session = Factory.CreateSession("Put license key here");
var certificateBytes = LoadCertificate();
var certificateStore = Factory.CreateCertificateStore(session, certificateBytes);
// Apply the certificates to be used, including the Contingency Key
parameters.Certificates = certificateStore;
return parameters;
}
private byte[] LoadCertificate()
{
// Load the certificate as a byte array. This could be from disk, network, or hard coded.
// The certificate can be formatted as a .p7b, .cer, or .pgp.
return new byte[0];
}
}
public static void ContingencyKey(
IUnstructuredData unstructured,
IMetaClient metaClient,
ISmartkey smartkey
)
{
using (var factory = unstructured.CreateArchiveFactory())
{
var listener = new ContingencyKeyPasswordListener(metaClient)
{
EncryptionSpec = new EncryptionSpec
{
Smartkey = smartkey,
// Optionally add a password here as well
}
};
factory.Context.PasswordListenerEx = listener;
// Tell the Archive to expect a contingency key. The key will be retrieved from the password listener via callback.
using (var itemOptions = factory.CreateItemOptions())
{
var encryptionMethod =
itemOptions.GetEncryptMethod(out var encryptionKeyLength, out var encryptionFlags);
encryptionFlags |= PK_CRYPT_FLAGS.PK_CRYPT_COMBO_KEY;
itemOptions.SetEncryptMethod(encryptionMethod, encryptionKeyLength, encryptionFlags);
// Proceed to create the ZIP as you normally would, using the factory and itemOptions created here.
}
}
}
Decryption
Once you have an IUnstructuredData
instance, decrypting ZIP archives encrypted using a Smartkey is easy! If you do not
have access to the Smartkey, but are part of the Contingency Group, this snippet will also grant you access to the files.
public static void DecryptAZipFile(IUnstructuredData unstructured)
{
using (var factory = unstructured.CreateArchiveFactory())
using (var archive = factory.OpenArchiveFile("example.zip"))
using (var item = archive.Item(0))
{
archive.ExtractFile(factory.Context, item, "path/to/extract/item/to");
}
}


RECENT POSTS
New Website!
Oct 2, 2017 • juanrubio
The Tizonia Project has from today a new web site!.
SimplyBuilt, the web builder app and hosting shop that has been very kindly (and for free) hosting Tizonia’s website in the last few years is closing down.
So long SimplyBuilt, and thanks for all the fish!
So.. it was necessary to find a new place. Luckily, finding a replacement has not been difficult. GitHub Pages and Jekyll are these days the ‘de-facto’ standard in free hosting for open source projects.
So there your go, a new web site and blog for Tizonia.
Credits
This site is based on the ‘Jekyll Documentation Theme’ developed by Can Güney Aksakalli.
The GitHub repo for this theme is https://github.com/aksakalli/jekyll-doc-theme and the demo is at https://aksakalli.github.io/jekyll-doc-theme/.


|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.hp.hpl.jena.util.ResourceUtils
public class ResourceUtils
General utility methods that operate on RDF resources, but which are not specific to a given model.
| Constructor Summary | |
|---|---|
ResourceUtils()
|
| Method Summary | |
|---|---|
static java.util.List |
maximalLowerElements(java.util.Collection resources,
Property rel,
boolean inverse)
Answer the maximal lower elements of the given collection, given the partial ordering rel . |
static java.util.List |
maximalLowerElements(java.util.Iterator resources,
Property rel,
boolean inverse)
Given a collection of resources, and a relation defining a partial order over those resources, answer the sub-collection that contains only those elements that appear in the maximal generator of the relation. |
static java.util.List |
partition(java.util.List l,
Property p)
Answer a list of lists, which is a partition of the given input list of resources. |
static Model |
reachableClosure(Resource root)
Answer a model that contains all of the resources reachable from a given resource by any property, transitively. |
static java.util.List |
removeEquiv(java.util.List l,
Property p,
Resource ref)
Remove from the given list l of Resources , any Resource that is equivalent
to the reference resource ref under the relation p . |
static Resource |
renameResource(Resource old,
java.lang.String uri)
Answer a new resource that occupies the same position in the graph as the current resource old , but that has the given URI. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ResourceUtils()
| Method Detail |
|---|
public static java.util.List maximalLowerElements(java.util.Collection resources, Property rel, boolean inverse)
Answer the maximal lower elements of the given collection, given the partial
ordering rel
. See maximalLowerElements( Iterator, Property, boolean )
for details.
resources
- A collection of resourcesrel
- A property defining a partial-ordering on resources
inverse
- If true, we invert the given property (by reversing the order
of the arguments), which allows us to use eg subClassOf as a partial order
operator for both sub-class and super-class relationships
resources
are not
greater than another resource under the partial order.public static java.util.List maximalLowerElements(java.util.Iterator resources, Property rel, boolean inverse)
Given a collection of resources, and a relation defining a partial order over
those resources, answer the sub-collection that contains only those elements
that appear in the maximal generator of the relation. Specifically, a resource
x
is excluded from the return value if there is another resource
y
in the input collection such that y Rel x
holds.
resources
- An iterator over a collection of resourcesrel
- A property defining a partial-ordering on resources
inverse
- If true, we invert the given property (by reversing the order
of the arguments), which allows us to use eg subClassOf as a partial order
operator for both sub-class and super-class relationships
resources
are not
greater than another resource under the partial order.public static java.util.List removeEquiv(java.util.List l, Property p, Resource ref)
Remove from the given list l of Resources
, any Resource that is equivalent
to the reference resource ref
under the relation p
. Typically,
p
will be owl:subClassOf
or owl:subPropertyOf
or some similar predicate.
The equivalent resources are removed from list l
in place, the return value is the list of removed resources.
l
- A list of resources from which the resources equivalent to ref will be removedp
- An equivalence predicateref
- A reference resource
public static java.util.List partition(java.util.List l, Property p)
Answer a list of lists, which is a partition of the given
input list of resources. The equivalence relation is the predicate p.
So, two resources a
and b
will be in the same partition iff
(a p b) && (b p a)
.
l
- A list of resourcesp
- An equivalence predicate
l
under p
public static Resource renameResource(Resource old, java.lang.String uri)
Answer a new resource that occupies the same position in the graph as the current
resource old
, but that has the given URI. In the process, the existing
statements referring to old
are removed. Since Jena does not allow the
identity of a resource to change, this is the closest approximation to a rename operation
that works.
Notes: This method does minimal checking, so renaming a resource
to its own URI is unpredictable. Furthermore, it is a general and simple approach, and
in given applications it may be possible to do this operation more efficiently. Finally,
if res
is a property, existing statements that use the property will not
be renamed, nor will occurrences of res
in other models.
old
- An existing resource in a given modeluri
- A new URI for resource old, or null to rename old to a bNode
public static Model reachableClosure(Resource root)
Answer a model that contains all of the resources reachable from a given resource by any property, transitively. The returned graph is the sub-graph of the parent graph of root, whose root node is the given root. Cycles are permitted in the sub-graph.
root
- The root node of the sub-graph to extract
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |


--- layout: archive title: Zulip Chat Archive permalink: /stream/113488-general/topic/idea.20for.20a.20small.20project.html ---
Several people have been asking what to do after NNG. One possibility would be Lagrange interpolations: https://en.wikipedia.org/wiki/Lagrange_polynomial
Probably relevant: https://github.com/leanprover-community/mathlib/blob/master/src/linear_algebra/nonsingular_inverse.lean
This would be quite useful in cryptography.
{% endraw %}Last updated: Apr 24 2020 at 19:02 UTC


Week 3: My Style of Thinking
Week 4: Tech in the Environment
Week 5: The Sweet Fruitfulness of Pairing
Week 6: Combatting Stereotype Threat
Week 7: Knowing Thyself Prevents Misunderstandings (with Thyself)
Week 8: A Conversation with My Beloved Sister
Week 9: Questions, Questions, too many Questions! You want a shard? Here!
Technical Blogs:
Week 1: These are a Few of My Favorite Websites
Week 2: In a White Room with Black Curtains
Week 3: JavaScript: Strengths and Weaknesses
Week 4: Ruby #Map Method
Week 5: A Thing or Two About Classes
Week 6: Comparing Object Oriented Programming and Functional Programming
Week 7: Raising Awareness of SQL Injection and Protecting Data
Week 8: Rails in a Nutshell!
Cheatsheet:
html


There are two main metrics in Powerlifting that help us regulate our training, and they are volume and intensity.
However, there might be a better way to gauge the volume and intensity of our training sessions.
By the way, this is me; feeling simultaneously a little bit strong and a little bit crushed…
Volume is the measurement of the total load lifted in a training session or across multiple sessions. That being said, mathematically, in terms of weights, \[V = {w \cdot r \cdot s}\] And that is the weight \(\omega\),
repetitions \(r\),
and finally sets \(s\).
Intensity is the measure of how heavy are the weights used. It is a percentage measure of \(\frac{w}{M}\), where \(w\) is the weight used and \(M\) is the maximum weight you are capable of lifting once, traditionally called the 1-Rep Max or (1RM)
\[I = \frac{w}{M} \cdot 100 \% \]
Yesterday I lifted the following:
| Weight \((w)\) | Repetitions \((r)\) | Sets \((s)\) | Volume \((V)\) |
|---|---|---|---|
| 155 | 5 | 1 | 775 |
| 175 | 3 | 1 | 525 |
| 195 | 5 | 1 | 975 |
| 205 | 2 | 1 | 410 |
\[ \begin{aligned} Total \ Volume \ (V) &= 775 + 525 + 975 + 410 \\ &= 2685kg \end{aligned} \]
Today I plan to lift the following:
| Weight \((w)\) | Repetitions \((r)\) | Sets \((s)\) | Volume \((V)\) |
|---|---|---|---|
| 77.5 | 5 | 1 | 387.5 |
| 87.5 | 3 | 1 | 262.5 |
| 97.5 | 4 | 1 | 390 |
| 102.5 | 2 | 5 | 1025 |
\[ \begin{aligned} Total \ Volume \ (V) &= 387.5 + 262.5 + 390 + 1025 \\ &= 2075kg \end{aligned} \]
Yesterday I lifted the following:
| Weight \((w)\) | 1RM \((M)\) | Intensity \((I)\) |
|---|---|---|
| 155 | 220 | 70.45% |
| 175 | 220 | 79.54% |
| 195 | 220 | 88.63% |
| 205 | 220 | 93.18% |
\[ \begin{aligned} Average \ Intensity \ (I) &= (70.45\% + 79.54\% + 88.63\% + 93.18\%) / 4 \\ &= 82.95\% \end{aligned} \]
Copyright © 2017 AeonTech, Inc. All rights reserved.


Welcome to Awesome News
You are at the right place for your latest and hottest news!. We report as it happens.


About Ansel Adams
Synopsis
Ansel Adams was born on February 20, 1902, in San Francisco, California. Adams rose to prominence as a photographer of the American West, particularly Yosemite National Park, using his work to promote conservation of wilderness areas. His iconic black-and-white images helped to establish photography among the fine arts. He died in Monterey, California, on April 22, 1984.
Early Life
Ansel Adams was born in on February 20, 1902, in San Francisco, California. His family came to California from New England, having migrated from Ireland in the early 1700s. His grandfather founded a prosperous lumber business, which Adams’ father eventually inherited. Later in life, Adams would condemn that industry for depleting the redwood forests.
As a young child, Adams was injured in the San Francisco earthquake of 1906, when an aftershock threw him into a garden wall.
Adams was a hyperactive and sickly child with few friends. Dismissed from several schools for bad behavior, he was educated by private tutors and members of his family from the age of 12.
Adams taught himself the piano, which would become his early passion. In 1916, following a trip to Yosemite National Park, he also began experimenting with photography. He learned darkroom techniques and read photography magazines, attended camera club meetings, and went to photography and art exhibits. He developed and sold his early photographs at Best’s Studio in Yosemite Valley.
In 1928, Ansel Adams married Virginia Best, the daughter of the Best’s Studio proprietor. Virginia inherited the studio from her artist father on his death in 1935, and the Adamses continued to operate the studio until 1971. The business, now known as the Ansel Adams Gallery, remains in the family.
Career
Adams’ professional breakthrough followed the publication of his first portfolio, Parmelian Prints of the High Sierras, which included his famous image “Monolith, the Face of Half Dome.” The portfolio was a success, leading to a number of commercial assignments.
Between 1929 and 1942, Adams’ work and reputation developed. Adams expanded his repertoire, focusing on detailed close-ups as well as large forms, from mountains to factories. He spent time in New Mexico with artists including Alfred Stieglitz, Georgia O’Keeffe and Paul Strand. He began to publish essays and instructional books on photography.
During this period, Adams joined photographers Dorothea Lange and Walker Evans in their commitment to affecting social and political change through art. Adams’ first cause was the protection of wilderness areas, including Yosemite. After the internment of Japanese people during World War II, Adams photographed life in the camps for a photo essay on wartime injustice.
Weeks before the attack on Pearl Harbor in 1941, Adams shot a scene of the moon rising above a village. Adams re-interpreted the image—titled “Moonrise, Hernandez, New Mexico”—over nearly four decades, making over a thousand unique prints that helped him to achieve financial stability.
Later Life
By the 1960s, appreciation of photography as an art form had expanded to the point at which Adams’ images were shown in large galleries and museums. In 1974, the Metropolitan Museum of Art in New York hosted a retrospective exhibit. Adams spent much of the 1970s printing negatives in order to satisfy demand for his iconic works. Adams had a heart attack and died on April 22, 1984, at the Community Hospital of the Monterey Peninsula in Monterey, California, at the age of 82.


Warehouse Keeper Cliff:
Don't tell my boss, but this job can get kinda slow. That's why we warehouse keepers created our own fun. I often play bingo with the other warehouse keepers.
But to be honest, regular bingo has gotten a little boring for me.
"So?"


We care and respect people’s needs, so we work hard to provide you with the most reliable information.
We give donors a clear overview of what the listed NGOs, so that they know exactly where to donate.
We will keep this website updated regularly,, so you will be informed of any changes with the charities.
We ensure that all the data that we display is easy to read in order to avoid confusion and make it clear for donors.


The SVG viewBox
attribute provides a great way to make D3 charts responsive to window resizing. Let's look at an example of a bar chart about customers' dessert preference. Here's the data:
var desserts = ["Cookies","Cupcakes","Ice Cream Cones","Muffins"];
var customers = [34,41,52,18];
Let's start with a non-responsive chart. First, we set up our margins and prepare an SVG element to draw on:
var margin = {top: 10, right: 10, bottom: 120, left: 30};
var width = 300 - margin.left - margin.right;
var height = 300 - margin.top - margin.bottom;
//A non-responsive chart area
var chart = d3.select("#chart-div")
.append("svg")
.attr("width",width+margin.left+margin.right)
.attr("height",height+margin.top+margin.bottom)
.append("g")
.attr("transform","translate("+
margin.left+","+margin.top+")");
Now, we set up the scales and axes:
//Define the x and y scales
var x = d3.scale.ordinal()
.domain(desserts)
.rangePoints([0,width],1);
var y = d3.scale.linear()
.domain([0,60])
.range([height,0]);
//Define the x and y axes
var xAxis = d3.svg.axis()
.scale(x)
.orient("bottom");
var yAxis = d3.svg.axis()
.scale(y)
.orient("left");
Finally, add the axes and bars to our chart area:
//Add the x axis, rotate the labels
chart.append("g")
.attr("transform", "translate(0,"+height+")")
.call(xAxis)
.selectAll("text")
.attr("transform", "rotate(-65)")
.style("text-anchor", "end");
//Add the y axis
chart.append("g")
.call(yAxis);
//Add the bars
chart.selectAll("bars")
.data(desserts).enter()
.append("rect")
.attr("x",function (d) { return x(d)-20; })
.attr("y",function (d,i) { return y(customers[i]); })
.attr("height",function (d,i) { return height-y(customers[i]); })
.attr("width",50);
Here's our non-responsive chart in a JSFiddle. Notice the blue border around the div
element, and notice that the chart doesn't change if you resize the window.
Now for the fun part! To make our chart responsive, we just need to change a few lines in our definition of the chart
area:
//A responsive chart area
var chart = d3.select("#chart-div")
.append("svg")
.attr("width","100%")
.attr("viewBox","0 0 "+
(width+margin.left+margin.right)+
" "+
(height+margin.top+margin.bottom) )
.append("g")
.attr("transform","translate("+
margin.left+","+margin.top+")");
Notice that we are now defining the chart
area to be the width of our div
. Sometimes that width might be 100 pixels, and sometimes it might be 800 pixels. The viewBox
attribute tells the browser that--no matter the actual width of the chart
area, we want to work with a single coordinate system. Our coordinate system goes from 0 to width + margin.left + margin.right
in the x direction, and from 0 to height + margin.top + margin.bottom
in the y direction.
Here it is in a JSFiddle. Notice how the chart respons to width resizes, but how it will still outgrow the height of our div
.
What happens when we set the width and height of chart
to be 100% or our div
? By default, the browser will preserve the aspect ratio of the drawing, and so you will get the largest possible chart that fits into both the width and height of the div
. See it in this fiddle:
Sometimes we may want our chart to skew in order to fill the entire div
. In that case, we just add .attr("preserveAspectRatio","none")
to our definition of chart
. Here it is in a fiddle:
Although our example looked at a bar chart, the viewBox
technique works for many types of figures generated in D3.
Here's a great tutorial on the SVG viewBox:http://jonibologna.com/svg-viewbox-and-viewport/


Animations - Use one, or define your own.

Different animations can be set for open and close events.
2D animations:
3D animations:
You can also create/define your own animations
$ngConfirm({
animation: 'zoom',
closeAnimation: 'scale'
});
// Available animations:
// right, left, bottom, top, rotate, none, opacity, scale, zoom,
// scaleY, scaleX, rotateY, rotateYR (reverse), rotateX, rotateXR (reverse)
Some eye candy thats in fashion.
$ngConfirm({
animationBounce: 1.5, // default is 1.2 whereas 1 is no bounce.
});
Adjust the duration of animation.
$.confirm({
animationSpeed: 2000 // 2 seconds
});
$.confirm({
animationSpeed: 200 // 0.2 seconds
});
Defining your custom animations lets you match your existing user interface.
Example for a newsflash animation.
These animations are define the starting point of the
openAnimation and ending point of the closeAnimation
.ng-confirm .ng-confirm-box.ng-confirm-animation-news{
transform: rotate(400deg) scale(0);
}
$ngConfirm({
animation: 'news',
closeAnimation: 'news',
});
The animation name should be lowercase, or they wont work.
.ng-confirm-animation-animation-name
translates to 'animation-name'
.ng-confirm-animation-animationhere
translates to 'animationhere'
This animation takes place when backgroundDismiss is false, or returns a falsy value.
Example for a newsflash animation.
These animations are define the starting point of the
openAnimation and ending point of the closeAnimation
.ng-confirm .ng-confirm-box.ng-confirm-hilight.ng-confirm-hilight-random {
/*the animation name is bob*/
transform: translate3d(0, 0, 0);
animation: random 1s;
}
@keyframes random {
10%, 90% {
transform: rotate(-2deg);
}
20%, 80% {
transform: rotate(4deg);
}
30%, 50%, 70% {
transform: rotate(-8deg);
}
40%, 60% {
transform: rotate(8deg);
}
}
$ngConfirm({
backgroundDismissAnimation: 'random',
});
The animation name should be lowercase, or they wont work.


Breton sauce, (fr. Sauce Bretonne) is a French compound sauce consisting of a velouté base with julienned onion, leeks, celery heart and mushrooms, mounted with butter and cream. It has been referred to as a brown version of Sauce soubise which has as its base a béchamel sauce.<ref>Larousse Gastronomique (1961)</ref>
{{reflist}}
{{Brown sauces}}
{{DEFAULTSORT:Breton Sauce}}


Cleveland Cavaliers' Kevin Love stays villainous for postgame interview
by Ryan GaydosCleveland Cavaliers star Kevin Love conducted a spooky postgame interview Wednesday after the team’s victory over the Chicago Bulls.
Love came into the Quicken Loans Arena dressed as Jason from the Halloween horror movie “Friday The 13th.” He scored 17 points and grabbed 20 rebounds in 31 minutes in the win and decided to stay in the Halloween spirit when talking to reporters after the game.
JOEL EMBIID, KARL-ANTHONY TOWNS EACH SUSPENDED 2 GAMES
Photos of Love were taken prior to the game as well. Love was donning the full hockey mask with a forest green jacket and a t-shirt which read, “Camp Crystal Lake Counselor.” He was also carrying a baseball bat instead of the villain’s patented blade.
The NBA veteran is in his sixth season with the Cavaliers and is averaging 16 points and 16.8 rebounds through the first four games of the season.
WARRIORS' STEPH CURRY SUFFERS BROKEN HAND AS TROUBLED SEASON SEES ANOTHER KEY PLAYER OFF ROSTER
The Cavaliers are looking to get more out of their star center. He missed the majority of the 2018-19 season due to injury. He played in only 22 games and averaged 17 points and 10.9 rebounds.
Cleveland is 2-2 this season and plays the Indiana Pacers on the road Friday.
CLICK HERE FOR MORE SPORTS COVERAGE ON FOXNEWS.COM
Sunday starts a two-game homestand for Cleveland, beginning with the Dallas Mavericks. The team then welcomes the Boston Celtics on Tuesday before starting a three-game road trip later in the week.


WITNESS LIST Intergovernmental Relations Committee February 26, 1997-2:00P SB 157 For: Backerville, Mike (Wilbarger County), Vernon SB 209 For: Krueger, Jeff (Denton County), Denton SB 252 For: Allison, Jim (County Judges & Commiss), Austin On: Reid, Stan (Texas Association of Co), San Antonio SB 327 Registering, but not testifying: On: Ciramella, Orlando (Port of Port Arthur), Port Arthur SB 472 For: Hutchison, Ray (Dallas Area Rapid Trans), Dallas Registering, but not testifying: For: DeLaGordia, John Jr. (Dallas Area Rapid Trans), Dallas Ingle, Kathy (Dallas Area Rapid Trans), Dallas McCarley, James (Dallas Regional Mobilit), Dallas On: Poinsatte, Chris (Dallas Area Rapid Trans), Dallas SB 481 On: Campbell, Helen (Fire Fighters Pension C), Austin Registering, but not testifying: For: Cain, Randy (Texas Fire Chiefs Assoc), Austin Ivie, Lisa (State Firemen & Fire Ma), Austin On: Labatt, Weir (Volunteer Fire Fighter), San Antonio SB 527 For: DeLord, Ronald (CLEAT), Austin Lyde, Jim (Texas Municipal Police), Austin Against: Flynn, Kenneth (Fort Worth Police Dept.), Ft. Worth Muncy, Jill (Dallas Police Departmen), Dallas Zacharias, Larry (Tx. Police Chiefs Assoc), Richardson Registering, but not testifying: For: Martinez, Mario (CLEAT), Austin McNeal, Carvel (Houston Police Patrolme), Houston Means, Jack (Texas Conference of Pol), Dallas Perez, Alex B. (San Antonio Police Offi), San Antonio Self, James (San Antonio Police Offi), San Antonio White, Glenn M. (Dallas Police Associati), Dallas Written materials submitted: Against: Click, Bennie R. (City of Dallas), Dallas SB 544 For: Ratliff, James (City of Garland), Garland Registering, but not testifying: For: Igo, Shanna (Texas Municipal League), Austin On: Neighbor, Brad (City of Garland), Garland SB 590 Registering, but not testifying: For: Leck, Bonnie (Winkler County), Kermit Mills, David (City of Monahans), Monahans Scogin, Robert (Winkler County), Kermit SB 601 For: Archer, Wilson (City of Humble), Humble Against: Curran, Patricia (METRO of Harris County), Houston Registering, but not testifying: For: Baker, James (City of Humble), Humble Byers, Mike (Humble Area Chamber), Humble Fulbright, Jack (City of Humble), Humble Pickett, Ken (City of Humble), Kingwood Against: Forbes, Scott (City of Houston), Houston White, Michael (Greater Houston Partner), Austin


Dancing Snowman
This is a GIF file containing an animation. Each frame of the animation was drawn in Google Sketchup by a Ruby script.


All your files in one secure location, accessible anywhere.
Fylo stores all your most important files in one secure location. Access them wherever you need, share and collaborate with friends family, and co-workers.
Get StartedAccess your files, anywhere
The ability to use a smartphone, tablet, or computer to access your account means your files follow you everywhere.
Security you can trust
2-factor authentication and user-controlled encryption are just a couple of the security features we allow to help secure your files.
Real time collaboration
Securely share files and folders with friends, family and colleagues for live collaboration. No email attachments required.
Store any type of file
Whether you're sharing holidays photos or work documents, Fylo has you covered allowing for all file types to be securely stored and shared.
 Fylo has you covered for all of your file storage needs.
See how Fylo worksFylo has improved our team productivity by an order of magnitude. Since making the switch our team has become a well-oiled collaboration machine.
Fylo has improved our team productivity by an order of magnitude. Since making the switch our team has become a well-oiled collaboration machine.
Fylo has improved our team productivity by an order of magnitude. Since making the switch our team has become a well-oiled collaboration machine.
Get early access today
It only takes a minute to sign up and our free starter tier is extremely generous. If you have any questions, our support team would be happy to help you.


[30]:
import numpy as np
import matplotlib.pyplot as plt
import matplotlib as mpl
from scipy.interpolate import interp1d
# Just for plotting
plt.style.use('ggplot')
# Default params
params = {
'image.origin':'lower',
'image.interpolation':'nearest',
'image.cmap':'magma',
'axes.titlesize':22,
'font.size':14,
'xtick.labelsize':20,
'ytick.labelsize':20,
'lines.linewidth':4,
'font.family':'sans serif',
'axes.labelsize':30,
}
mpl.rcParams.update(params)
Simulating Multilayer Thin Films
Thin films optical filters let us control reflection, transmission, bandwidth, and polarization. Unfortunately, they are also the primary cause of polarization aberrations. Due to their relevance in polarization ray tracing, we’ve implemented the ability to compute the effective fresnel reflection coefficients given a thin film multilayer stack. These can also be used in polarization ray tracing calculations to understand how their presence impacts the Jones pupil. Currently Poke supports the characteristic matrix method outlined in the BYU Optics Book [1] by Peatross and Ware \(^{*}\) (It’s free and great, please check it out). In this demo we go into how to use Poke to simulate the complex amplitude coefficients of a multilayer stack, and then use Python to optimize the stack to become a long-pass filter.
\(^{*}\) Past versions of Poke have used the Macleod [2] characteristic matrix algorithm, but they produce identical results (with opposite phases), so the choice between the two is more about your phase sign convention than anything else.
References - [1] J. Peatross and M. Ware, Physics of Light and Optics, 2015 edition, available at optics.byu.edu - [2] A. H. Macleod, Thin-film Optical Filters, 1969 edition, Taylor and Francis
We begin by loading some material data. Poke includes a limited selection of material data from refractiveindex.info (another great, free resources). One day we will have a more formal material catalogue, but for now - please bear with me as I parse some csv’s.
[31]:
# Load in some coatings
pth = '/Users/jashcraft/Desktop/poke/material_data/'
pth_to_SiN = pth+'Philipp_SiN.csv'
dat_SiN = np.genfromtxt(pth_to_SiN,delimiter=',',skip_header=1)[:500].T
n_SiN = interp1d(dat_SiN[0],dat_SiN[1])
pth_MgF2 = pth+'Rodriguez-de Marcos_MgF2.csv'
dat_MgF2 = np.genfromtxt(pth_MgF2,delimiter=',',skip_header=1)[:962].T
kdat_MgF2 = np.genfromtxt(pth_MgF2,delimiter=',',skip_header=1)[964:].T
nd_MgF2 = interp1d(dat_MgF2[0],dat_MgF2[1])
k_MgF2 = interp1d(kdat_MgF2[0],kdat_MgF2[1])
n_MgF2 = lambda wave: nd_MgF2(wave) + 1j*k_MgF2(wave)
# generate some wavelengths
wvl = np.arange(500,1000,10)*1e-3
plt.figure(figsize=[10,10])
plt.plot(wvl*1e3,nd_MgF2(wvl),label='n - MgF2')
plt.plot(wvl*1e3,k_MgF2(wvl),label='k - MgF2')
plt.plot(wvl*1e3,n_SiN(wvl),label='n - SiN')
plt.legend()
plt.title('Coating Refractive Indices')
plt.xlabel('Wavelength [nm]')
plt.ylabel('n')
plt.show()
These coatings were chosen to have a “high” and a “low” refractive index. The interaction of a given coating interface is directly related to the difference in refractive index, so this makes our coatings a little “stronger”.
The next step is to load these data into a format that makes Poke happy. For stacks, we use a list of tuples of the format [(index_1,thickness_1),(index_2,thickness_2),…,(index_N,thickness_N),(substrate_index)]. Note that the final element of the list must be the substrate index. We will arbitrarily choose to use a 50nm thickness for each of the layers, and send the inputs to the poke.thinfilms.compute_thin_films_broadcasted
method.
[32]:
from poke.thinfilms import compute_thin_films_broadcasted
aoi = 45
stack = [
(n_SiN(wvl),np.full_like(wvl,50e-3)),
(n_MgF2(wvl),np.full_like(wvl,50e-3)),
(n_SiN(wvl),np.full_like(wvl,50e-3)),
(n_MgF2(wvl),np.full_like(wvl,50e-3)),
(n_SiN(wvl),np.full_like(wvl,50e-3)),
(n_MgF2(wvl),np.full_like(wvl,50e-3)),
(n_SiN(wvl),np.full_like(wvl,50e-3)),
(n_MgF2(wvl),np.full_like(wvl,50e-3)),
(n_SiN(wvl),np.full_like(wvl,50e-3)),
(n_MgF2(wvl),np.full_like(wvl,50e-3)),
(n_SiN(wvl),np.full_like(wvl,50e-3)),
(n_MgF2(wvl),np.full_like(wvl,50e-3)),
(n_SiN(wvl),np.full_like(wvl,50e-3)),
(n_MgF2(wvl),np.full_like(wvl,50e-3)),
(n_SiN(wvl),np.full_like(wvl,50e-3)),
(n_MgF2(wvl),np.full_like(wvl,50e-3)),
(n_SiN(wvl),np.full_like(wvl,50e-3)),
(n_MgF2(wvl),np.full_like(wvl,50e-3)),
(n_SiN(wvl),np.full_like(wvl,50e-3)),
(n_MgF2(wvl),np.full_like(wvl,50e-3)),
(1.5)
]
aoi = np.full_like(wvl,aoi)
rs,_ = compute_thin_films_broadcasted(stack,np.radians(aoi),wvl,substrate_index=1.5)
rp,_ = compute_thin_films_broadcasted(stack,np.radians(aoi),wvl,substrate_index=1.5,polarization='p')
We used 20 coating layers alternating between a high and low refractive index. This was done without much consideration for what the actual reflectance is, so we plot it below. It isn’t terribly exciting, but might make a neat mix of colors. Let’s see if we can optimize it to make a long-pass filter.
[33]:
plt.figure(figsize=[10,10])
plt.title('Reflectance v.s. Wavelength')
plt.ylabel('Reflectance')
plt.xlabel('Wavelength [nm]')
plt.plot(wvl*1e3,np.abs(rs)**2,label='Rs')
plt.plot(wvl*1e3,np.abs(rp)**2,label='Rp')
plt.legend()
plt.show()
To do so we need only construct a cost function for the scipy.optimize.minimize
library, and a starting point (we’ll use the one above for fun). We construct the cost function to maximize reflectance after 600nm and minmize reflectance short of 600nm.
[34]:
from scipy.optimize import minimize
def costfunc(a):
aoi = 45
wvl = np.arange(500,1000,5)*1e-3
stack = [
(n_SiN(wvl),np.full_like(wvl,a[0])),
(n_MgF2(wvl),np.full_like(wvl,a[1])),
(n_SiN(wvl),np.full_like(wvl,a[2])),
(n_MgF2(wvl),np.full_like(wvl,a[3])),
(n_SiN(wvl),np.full_like(wvl,a[4])),
(n_MgF2(wvl),np.full_like(wvl,a[5])),
(n_SiN(wvl),np.full_like(wvl,a[6])),
(n_MgF2(wvl),np.full_like(wvl,a[7])),
(n_SiN(wvl),np.full_like(wvl,a[8])),
(n_MgF2(wvl),np.full_like(wvl,a[9])),
(n_SiN(wvl),np.full_like(wvl,a[10])),
(n_MgF2(wvl),np.full_like(wvl,a[11])),
(n_MgF2(wvl),np.full_like(wvl,a[12])),
(n_SiN(wvl),np.full_like(wvl,a[13])),
(n_MgF2(wvl),np.full_like(wvl,a[14])),
(n_MgF2(wvl),np.full_like(wvl,a[15])),
(n_SiN(wvl),np.full_like(wvl,a[16])),
(n_MgF2(wvl),np.full_like(wvl,a[17])),
(n_MgF2(wvl),np.full_like(wvl,a[18])),
(n_SiN(wvl),np.full_like(wvl,a[19])),
(n_MgF2(wvl),np.full_like(wvl,a[20])),
(1.5)
]
aoi = np.full_like(wvl,aoi)
rs,_ = compute_thin_films_broadcasted(stack,np.radians(aoi),wvl,substrate_index=1.5)
rp,_ = compute_thin_films_broadcasted(stack,np.radians(aoi),wvl,substrate_index=1.5,polarization='p')
R = (np.abs(rs)**2 + np.abs(rp)**2)/2
# The cost function
short = R[wvl<0.6]
long = 1 - R[wvl>=0.6]
cost_short = np.sum(short**2)
cost_long = np.sum(long**2)
cost = (cost_short + cost_long)/R.size
return cost
a = np.zeros(21)
a[:] = 50e-3
results = minimize(costfunc,a,method='BFGS',options={'maxiter':100})
Now we just re-evaluate this to return the results!
[35]:
aoi = 45
a = results.x
wvl = np.arange(500,1000,5)*1e-3
stack = [
(n_SiN(wvl),np.full_like(wvl,a[0])),
(n_MgF2(wvl),np.full_like(wvl,a[1])),
(n_SiN(wvl),np.full_like(wvl,a[2])),
(n_MgF2(wvl),np.full_like(wvl,a[3])),
(n_SiN(wvl),np.full_like(wvl,a[4])),
(n_MgF2(wvl),np.full_like(wvl,a[5])),
(n_SiN(wvl),np.full_like(wvl,a[6])),
(n_MgF2(wvl),np.full_like(wvl,a[7])),
(n_SiN(wvl),np.full_like(wvl,a[8])),
(n_MgF2(wvl),np.full_like(wvl,a[9])),
(n_SiN(wvl),np.full_like(wvl,a[10])),
(n_MgF2(wvl),np.full_like(wvl,a[11])),
(n_MgF2(wvl),np.full_like(wvl,a[12])),
(n_SiN(wvl),np.full_like(wvl,a[13])),
(n_MgF2(wvl),np.full_like(wvl,a[14])),
(n_MgF2(wvl),np.full_like(wvl,a[15])),
(n_SiN(wvl),np.full_like(wvl,a[16])),
(n_MgF2(wvl),np.full_like(wvl,a[17])),
(n_MgF2(wvl),np.full_like(wvl,a[18])),
(n_SiN(wvl),np.full_like(wvl,a[19])),
(n_MgF2(wvl),np.full_like(wvl,a[20])),
(1.5)
]
aoi = np.full_like(wvl,aoi)
rs,_ = compute_thin_films_broadcasted(stack,np.radians(aoi),wvl,substrate_index=1.5)
rp,_ = compute_thin_films_broadcasted(stack,np.radians(aoi),wvl,substrate_index=1.5,polarization='p')
R = (np.abs(rs)**2 + np.abs(rp)**2)/2
[36]:
plt.figure(figsize=[10,10])
plt.title('20-layer long-pass filter')
plt.plot(wvl*1e3,R,label='R')
plt.plot(wvl*1e3,np.abs(rs)**2,label='Rs')
plt.plot(wvl*1e3,np.abs(rp)**2,label='Rp')
plt.legend()
plt.ylabel('Reflectance',fontsize=20)
plt.xlabel('Wavelength [nm]',fontsize=20)
plt.show()
And it does exactly what we wanted! This is a relatively simple and brute-force method of designing optical filters, but it is nice the Poke has the flexibility to set up the design platform in Python. In future demos we will illustrate: - how to use one of these filters in polarization ray tracing - setting up the problem to be differentiable using Jax - faster optimization on GPUs
[ ]:


The National Memorial for Peace and Justice, informally known as the National Lynching Memorial, is a national memorial to commemorate the victims of lynching in the United States in order to acknowledge the past of racial terrorism in the search for social justice. Founded by the Equal Justice Initiative, it opened in downtown Montgomery, Alabama on April 26, 2018. The memorial was built on six acres in the downtown area of the state capital by the Equal Justice Initiative (EJI), a non-profit based in Montgomery. Also under the auspices of EJI is The Legacy Museum: From Enslavement to Mass Incarceration. It is built near the Montgomery site where enslaved African Americans were auctioned at market. The development and construction of the memorial complex cost an estimated $20 million raised from private foundations.


Checkout the features of Discite, hop in, there is a place for all, start to learn or contribute to the community
Whether you have just graduated from college or you are at mid-senior level in your carrer or a seasoned proffesional. Irrespective of where you are we all have questions. Here you can talk with a proffesional of your choice and clarify your doubts or issues.
AskIts amazing to be with a group of like-minded people. There is a lot to acheive by woking together. Discuss latest trends, topics. Create groups of your own within the community to work on various ideas. Maybe create a few guides together for those who want to learn.
DiscussIrrespective of what we know as a developer, there are always new things to learn on the horizon. It is a constantly changing world and if we don't keep up, what we know will get outdated real quick. So, get learning from some of the best proffesionals out there.
Learn


Which emulators are installed with the Azure SDK?
The Azure SDK installs 2 emulators:
1. Azure Compute Emulator
2. Azure Storage Emulator
Which roles are supported by Azure Cloud Service solutions?
What Assembly contains the CloudConfigurationManager class?
Microsoft.WindowsAzure.Diagnostics
Microsoft.WindowsAzure.Configuration
Microsoft.WindowsAzure.ServiceRuntime
Microsoft.WindowsAzure.Storage
What Assembly contains the diagnostics monitoring and management classes?
Microsoft.WindowsAzure.Diagnostics
Microsoft.WindowsAzure.Configuration
Microsoft.WindowsAzure.ServiceRuntime
Microsoft.WindowsAzure.Storage
What Assembly contains the Role, RoleEntryPoint and RoleEnvironment classes?
Microsoft.WindowsAzure.Diagnostics
Microsoft.WindowsAzure.Configuration
Microsoft.WindowsAzure.ServiceRuntime
Microsoft.WindowsAzure.Storage
What Assembly contains classes for working with Tables, Blobs and Queues?
Microsoft.WindowsAzure.Diagnostics
Microsoft.WindowsAzure.Configuration
Microsoft.WindowsAzure.ServiceRuntime
Microsoft.WindowsAzure.Storage
Which features are part of Cloud Services?
Which taskType should be used in the Startup task to ensure the operation completes before the roles begin?


Templates and Bootstrap¶
Now, we will use Django’s built in templating to style our home page.
Django will look within each app for templates or for a base folder call
templates
. We will create a folder in the main project to house our
templates, and a file called home
to place our styling in.
mkdir templates
touch templates/home.html
Now, we will use the settings.py
file to establish our template and
tell Django where it is located. Adding the line:
TEMPLATES = [
{
'DIRS': [os.path.join(BASE_DIR, 'templates')],
},
]
Let’s add some HTML to our home.html file as well.

Hello again.

Updating Views¶
There is a built-in TemplateView method that we will use in the
views.py
file. Here, we follow a similar approach to our last
example in terms of mapping urls. In our views.py
file we will add
from django.views.generic import TemplateView
class HomePageView(TemplateView):
template_name = 'home.html'
In the app level urls.py
, we just need to change the line in our
urlpatterns
list:
path('', views.HomePageView.as_view(), name = 'home')
Now, if we restart the server we will have our new home page rendered.
Adding a Page¶
To add a page, we will create a new template, view, and url route just as above. We can call this page our about page.
touch templates/about.html
Add HTML to the about page.

This is about me.

We create a view in our views.py
file, we will create an
aboutpageview class.
class aboutpageview(TemplateView):
template_name = 'about.html'
In our urls.py
file, we add a line to our urlpatterns to direct
visitors to the about page.
path('about/', views.aboutpageview.as_view(), name = 'about'),
Extending the Template¶
Now, we will create a base file that we can use to extend a style across multiple pages. To do so, we will create a base file, and then use the Django minimal templating language to pull the formatting in to the additional pages.
touch templates/base.html
Here, we can add a minimal header to see how this can be applied to all
pages. In the new base.html
file, write the following:

Home | About

{% block content %}
{% endblock %}
Now, we alter the home.html
and about.html
files to extend the
base.html
file. In each, we will add the line
{% extends 'base.html' %}
Finally, we wrap the content of both pages with
{% block content %}{% endblock %}
. Thus, in our home.html
file,
we have:
{% extends 'base.html' %}
{% block content %}

Welcome Home Jacob.

{% endblock %}
Same thing in our about.html
file. Restart the server and you should
see the header appear.
Using Bootstrap¶
The bootstrap framework is a way around developing all our own CSS. We can either directly download the files, or use the CDN link. We will follow this approach by copying the CDN information from the Bootstrap getting started page.
https://getbootstrap.com/docs/3.3/getting-started/
Go to our base.html
file, and add the link in a
tag.

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">

Fire up the server and you should notice a slight formatting change.
Tests¶
A major part of development in Django is the use of tests to assure
everything is working. While our page is extremely simple, we still want
to make sure that our home and about pages are functioning to return
responses. In the tests.py
file, we will place two simple tests that
verify these pages are returning a 200 response code.
from django.test import TestCase
# Create your tests here.
from django.test import SimpleTestCase
class SimpleTests(SimpleTestCase):
def test_home_page_status_code(self):
response = self.client.get('/')
self.assertEqual(response.status_code, 200)
def test_about_page_status_code(self):
response = self.client.get('/about/')
self.assertEqual(response.status_code, 200)
Problem¶
Remember that our goal is to put together a website to share our Python Data projects that we’ve been making in Jupyter notebooks. To do so, let’s consider taking a notebook, converting it to an HTML file, and adding this file to a a page called Projects where users can see our different projects for visitors to see.
To create the HTML files of the notebooks, we will use Jupyter’s
nbconvert
functionality. To start, navigate to the directory where
your notebooks are housed with the terminal and cd
command. Now,
whatever notebook you would like to convert, enter
jupyter nbconvert notebook.ipynb
and you will have a new HTML file in the same folder. If you want, you can enter a directory to place this new file, for example
jupyter nbconvert notebook.ipynb htmls/
assuming we have an htmls directory.
Your goal is to play around with the different bootstrap features to style your home and about pages, and to add a projects page that contains your first Python projects from the Jupyter notebooks. You should explore a nicer navbar that includes a logo image.


[ all classes ]
[ emily.modules.profile ]
Coverage Summary for Class: ProfileImage (emily.modules.profile)
| Class | Class, % | Method, % | Line, % |
|---|---|---|---|
| ProfileImage | 0% (0/ 1) | 0% (0/ 3) | 0% (0/ 10) |
1 /*
2 * Copyright 2017 github.com/kaaz
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17 package emily.modules.profile;
18
19 import emily.main.Launcher;
20 import net.dv8tion.jda.core.entities.User;
21
22 import javax.imageio.ImageIO;
23 import java.awt.image.BufferedImage;
24 import java.io.IOException;
25 import java.net.URL;
26 import java.net.URLConnection;
27
28 /**
29 * Created on 28-9-2016
30 */
31 public abstract class ProfileImage {
32
33 private final User user;
34
35 public ProfileImage(User user) {
36 this.user = user;
37 }
38
39 public BufferedImage getUserAvatar() throws IOException {
40
41 URLConnection connection = new URL(getUser().getAvatarUrl() != null ? getUser().getAvatarUrl() : getUser().getDefaultAvatarUrl()).openConnection();
42 connection.setRequestProperty("User-Agent", "bot emily-bot");
43 BufferedImage profileImg;
44 try {
45 profileImg = ImageIO.read(connection.getInputStream());
46 } catch (Exception ignored) {
47 profileImg = ImageIO.read(Launcher.class.getClassLoader().getResource("default_profile.jpg"));
48 }
49 return profileImg;
50 }
51
52 public User getUser() {
53 return user;
54 }
55 }


The Great Muffin Experiment, No. 1 (Jump to the Recipe)
Sometimes when I bake cupcakes, Kin will call them "muffins" just to annoy me. "They're cupcakes," I insist. "Are they?" he'll tease.
Are they, indeed. What exactly is a muffin, and how is it different than a cupcake? Or is it?
It's easy to joke about confusing the two. Both are baked in muffin tins — muffin tins often lined with cupcake papers. And the etymology doesn't help clarify things — a cake baked in a cup seems obvious. But the word "muffin" is possibly derived from the Low German "muffen," plural of "muffe" or "small cake." Possibly, etymologists say, because what we know now as the small cake-like muffin is different from the small yeasted bread known as the crumpet or English muffin. It's confusing! (But Kin's jokes still aren't funny.)
There are, of course, ways we can and do distinguish the two: cupcakes can be frosted, for example; muffins are less likely to be, although they can be glazed. Muffins purport to be healthy; you can get away with eating one for breakfast, while it's generally frowned upon to eat a cupcake for the first meal of the day.  There are, for what it's worth, about 440 calories in the Starbucks Chocolate Chunk Muffin.
In fact, the difference between a muffin and a cupcake is not in the ingredients or the calories or the topping or the time of day they're consumed. Rather, the difference is in how the batter is assembled. Cupcakes are, as the name suggests, typically made the same way that cakes are: by creaming the butter and sugar, then adding the eggs and beating until light and fluffy. The dry ingredients — flour, salt, and baking powder, for example — are then added alternately with milk. Muffins are more akin to a quick bread insofar as the dry ingredients (including the sugar) are mixed together; the wet ingredients are mixed together separately; and then the two are combined quickly, without too much stirring, which would develop gluten and make the muffins chewy. Lumps are bad in your cake batter; lumps are fine in your muffin batter.
(This distinction works well right up until you consider all the "just add water" varieties of "instant" (read: microwavable) mixes. Then, I guess, it's quick breads all the way down.)
As part of The Great Muffin Experiment, I will be making a variety of muffins in my quest for the perfect, "healthy" muffin. But let's start without any preconceived notion of what's "healthy" — I'll write about that next — and look and what goes into your basic muffin.
Basic Muffin
This is based on the basic muffin recipe from Mark Bittman's How to Cook Everything cookbook.
Prep time: 10 minutes · Cooking time: 20 minutes · Servings: 12 · Calories: 133
Ingredients:
- 3 Tbps melted butter
- 2 cups all-purpose flour
- 1/4 cup sugar
- 1/2 tsp salt
- 3 tsp baking powder
- 1 egg
- 1 cup milk, plus more if needed
Instructions:
- Preheat oven to 400 F. Line 12 compartments of standard muffin tin with paper (or grease tin).
- Mix together the dry ingredients in a bowl.
- Beat the melted butter, egg, and milk in a bowl.
- Make a well in the center of the dry ingredients and add the wet ingredients. Stir swiftly, until combined. The batter should be lumpy, not smooth but quite moist. Add more milk if necessary.
- Spoon batter into muffin tins, filling about two-thirds full.
- Bake 18 minutes or until toothpick inserted into center comes out clean.
- Cool for 5 minutes before taking out of the tin.
Some Baking Notes
If we think of this as the "ur" muffin — a stretch, but bear with me — then there's lots of room for exploration and - apologies to Mark Bittman - improvement. All the ingredients are variables to be played with — more or different sugar, different flour, different fat, for starters. And that's some of what I'll explore throughout The Great Muffin Experiment.
But "ur" muffin or not, I found these to be quite bland, not surprisingly. I wouldn't complain too much about the level of sweetness, but the only real flavor came from the butter. The texture of the muffin was fine — perhaps a little dry. (I could have added more milk, I suppose, as Bittman recommends. I also could have cooked them a bit less than what the recipe called for, I think.) The biggest drawback, however, was that these didn't freeze well, which is something I am definitely looking for as I cannot eat a dozen muffins that quickly.
(As such, I now have 10 rather dull and dry muffins that I have to do something with. How about bread muffin pudding?!)


Equivalent to clicking the Solver command on the Tools menu, clicking the Options button in the Solver Parameters dialog box, and clicking the Load Model button in the Solver Options dialog box. Loads Solver problem specifications that you have previously saved on the worksheet.
If this function is not available, you must install the Solver add-in.
Syntax
SOLVER.LOAD(load_area)
Load_area is a reference on the active sheet to a range of cells from which you want to load a complete problem specification.
The first cell in load_area contains a formula for the Set Cell box; the second cell contains a formula for the changing cells; subsequent cells contain constraints in the form of logical formulas. The last cell optionally contains an array of Solver option values. The order of the Solver option values is the same as the top-to-bottom order in the Solver Options dialog box.
Although load_area must be on the active sheet, it need not be the current selection.
Return to index


InitiatingFlow(version: Int = 1)
This annotation is required by any FlowLogic which has been designated to initiate communication with a counterparty and request they start their side of the flow communication.
There is also an optional version property, which defaults to 1, to specify the version of the flow protocol. This integer value should be incremented whenever there is a release of this flow which has changes that are not backwards compatible with previous releases. This may be a change in the sends and receives that occur, or it could be a change in what a send or receive means, etc.
The version is used when a flow first initiates communication with a party to inform them of the version they are using. If the other side does not have this flow registered with the same version then the initiation request will be rejected. Currently only one version of the same flow can be registered by a node.
The flow version number is similar in concept to Corda's platform version but they are not the same. A flow's version number can change independently of the platform version.
If you are customising an existing initiating flow by sub-classing it then there's no need to specify this annotation again. In fact doing so is an error and checks are made to make sure this doesn't occur.
See Also


{% include "site-header.html" %}
If you're anything like us, you want to see
way more
shows than you possibly can! This website helps you express stronger or weaker preferences for them, and work out how to schedule your days.


Elarian Ruby SDK
A convenient way to interact with the Elarian APIs.
Project Status: Still under ACTIVE DEVELOPMENT, APIs are unstable and may change at any time until release of v1.0.0.
Install
Add this line to your application's Gemfile:
gem 'elarian'
And then execute:
$ bundle install
Or install it yourself as:
$ gem install elarian
Usage
require 'elarian'
...
See examples for more usage examples.
Documentation
…
Issues
If you find a bug, please file an issue on our issue tracker on GitHub.


After a long night at work and a few shots of Jaegermister my 18 year old sister came home to a house full of friends. We all had decided to talk her into tripping with us because it was going to be such a pretty day. After about an hour of coaxing she gave in and ate the cubes.
After about another hour or so it started to kick in. We were all sitting outside in the sun trying to see whatever we could move. I was starring at a rock and for whatever dumb reason I started moving my head back and forth to make the object seem trippy or whatever. I told my sister to try it, it was cool.
That was the beginning of the most horrible drug induced seizure I ever witnessed. After she moved her head up and down a couple times she began to black out. None of us knew what was going on. She began to wave her hand in the air and kept saying 'woah, woah' we all thought that she was swatting at a bee since there was a nest nearby. She then fell into the side of the house and began convulsing.
I could hear her teeth grinding together and I will never forget the way it sounded. We all ran to see what was going on when she started shaking almost in slow motion. Her arms were stuck straight out and turned upside down. We took her into the house and sat her under the air until she became concious again. I kept asking her what her name was and she just looked at me like she didn't even see me. I was horrified and will never, ever trip again.
Experience Reports are the writings and opinions of the individual authors who submit them.
Some of the activities described are dangerous and/or illegal and none are recommended by Erowid.