The purpose of this document is to describe the use of the Forms App.
The Forms app is designed to simplify the process of creating form-based, templated content within Jive. The same type of content, with a consistent structure and style, can easily be created time and time again in a consistent, reproducable way.
The app requires no custom content types and no other plugins, it simply leverages existing Jive content types (Documents, Discussions, Questions), and provides a semi-structured body for the content, based on form data input by the user.
Any number of templates can be created in any number of categories, and a single app can now be the place to generate just about any kind of content you can think of. Anything that can be created, manually, in Jive can also be created using the Forms app.
Select a help topic above for further information.
There are 5 options that can be configured for the app:
Here is how to configure the app preferences:
Step 1: Open the app menu and select "Your Settings"
Step 2: Enter the appropriate values and select "Save Settings"
Nothing needs to be done here, once the app is configured with the appropriate preferences (the default values for the preference may often suffice), it will automatically load and categorize all templates that are located by the search. The following loading screen will appear as the app is initializing and loading the templates:
Creating Jive content can now be created in 3 easy steps:
That's it. That's all you need to do in order to create customized content within Jive.
Step 1: Select a Template
The first step is to select a category and a template. Choose a category from the drop down list, which will then populate the list of templates for that category. Following the category selection, select one of the available templates from the Template drop down list.
Note: If only one single template is found when initially loading the templates, or if a default category and template is set in the app preferences, then that will already be selected here and the template form will be auto-generated when the app is loaded.
Step 2: Fill Out the Form
Once a template has been selected, a form will be created, dynamically, based on the template definition. For more information on how these templates are defined, see Forms App: Template Specification.
Note that if an item as a next to it, you may mouse over the to display a helpful tooltip describing the purpose and/or validation rules for the field.
Step 3: Submit the Form
Once the form has been successfully filled out (no validation errors - see below), then the following confirmation dialog will be display, and the form status at the bottom will be updated to reflect the same.
| Confirmation Dialog | Confirmation in Form |
Step 4: Success
If all goes well, you will now have a new piece of content created in Jive, based upon the provided template and the form values you have provided. Which may look something like the following:
When there is an error in a template definition, a form will not be displayed when the template is selected. Also note that the template will be listed in red with a warning in the template drop down box. Rather than render the input form, a list of template validation errors will be displayed on the screen. Editing the template to fix the listed errors, re-saving the updated attachment on the appropriate document, and reloading the app should address the problem. Here is an example of a problematic template:
When there is an error in an input form (required field is missing, does not match validation rules, etc.) then individual form errors will be displayed. The field will become highlighted with a red border and a indicator will show next to each problematic field. Simply update each problematic field with an appropriate value and re-submit the form. The form will automatically refresh to show which, if any errors are resolved. If all errors have been resolved, then the form will submit and the content will be created.
Note: Hovering your mouse over the indicator will show a helpful tooltip describing the problem with the field's value.
One of the allowable data types for a field is a date. When a date is the defined type, a date picker will be displayed with the field, see the following example:
Another allowable data type for a field is a user. When a user is the defined type, a user picker (Jive-provided) will be displayed, see the following example:
| User Picker Before User Selection |
User Picker After User Selection |
‣ Ask Question, Submit Issues, and Provide Feedback here: Apps by Jive Group
‣ See Forms App: Template Specification to see how templates are created.
‣ See Forms App: Sample Templates to see a few example templates.


Notifications
Handcrafted by our friend Robert McIntosh. Please checkout the full documentation.
Notifications Style
This is a plain notification
This is a notification with close button.
Notification states
Primary - This is a regular notification made with ".alert-primary"
Info - This is a regular notification made with ".alert-info"
Success - This is a regular notification made with ".alert-success"
Warning - This is a regular notification made with ".alert-warning"
Danger - This is a regular notification made with ".alert-danger"


Basic interface for SAX error handlers
Constructors and Destructor
| |||||||||
The error handler interface
|
Basic interface for SAX error handlers.If a SAX application needs to implement customized error handling, it must implement this interface and then register an instance with the SAX parser using the parser's setErrorHandler method. The parser will then report all errors and warnings through this interface.
The parser shall use this interface instead of throwing an exception: it is up to the application whether to throw an exception for different types of errors and warnings. Note, however, that there is no requirement that the parser continue to provide useful information after a call to fatalError (in other words, a SAX driver class could catch an exception and report a fatalError).
The HandlerBase class provides a default implementation of this interface, ignoring warnings and recoverable errors and throwing a SAXParseException for fatal errors. An application may extend that class rather than implementing the complete interface itself.
SAX parsers will use this method to report conditions that are not errors or fatal errors as defined by the XML 1.0 recommendation. The default behaviour is to take no action.
The SAX parser must continue to provide normal parsing events after invoking this method: it should still be possible for the application to process the document through to the end.
This corresponds to the definition of "error" in section 1.2
of the W3C XML 1.0 Recommendation. For example, a validating
parser would use this callback to report the violation of a
validity constraint. The default behaviour is to take no
action. The SAX parser must continue to provide normal parsing events
after invoking this method: it should still be possible for the
application to process the document through to the end. If the
application cannot do so, then the parser should report a fatal
error even if the XML 1.0 recommendation does not require it to
do so.
This corresponds to the definition of "fatal error" in
section 1.2 of the W3C XML 1.0 Recommendation. For example, a
parser would use this callback to report the violation of a
well-formedness constraint. The application must assume that the document is unusable
after the parser has invoked this method, and should continue
(if at all) only for the sake of collecting addition error
messages: in fact, SAX parsers are free to stop reporting any
other events once this method has been invoked.
This method helps in reseting the Error handler object
implementational defaults each time the Error handler is begun.
alphabetic index hierarchy of classes
|
Xerces-C XML Parser for C++ Version 1.1 |
|
|
generated by doc++


RECOMMENDED RESOURCES:
1. edX
2. Coursera
3. Codecademy
1. EDITING VIDEOS
LARRYJORDAN
2. TAKING PHOTOS
Peter Mckinnon
3. LENS AND CAMERAS
Think Media
1. Duolingo
2. Elsa
1. [Beginners] Fundamentals with Designing Graphic
2. 8 Types of Graphic Design


Zeus Weather App
retrieve the maximum and minimum temperature of today for 5 cities
built by
Hari haran


Set in the rich farmland of California’s Salinas Valley, this sprawling and often brutal novel follows the intertwined destinies of two families—the Trasks and the Hamiltons—whose generations helplessly reenact the fall of Adam and Eve and the poisonous rivalry of Cain and Abel. Here Steinbeck created some of his most memorable characters and explored his most enduring themes: the mystery of identity; the inexplicability of love; and the murderous consequences of love’s absence.
The Salinas Valley is in Northern California. It is a long narrow swale between two ranges of mountains, and the Salinas River winds and twists up the center until it falls at last into Monterey Bay.


--- layout: post title: Flash Lite 2.0 date: 2005-10-25 00:00:00 categories: digital-media interfaces-&-interaction mobile ---
A preview of Flash Lite 2.0.


Aam
About Aam
Test
Test
All about you
Aam
Aam
Aam
Aam
def
aam
():
print
(
"Aam is good"
)
A
B
C
Last updata 2014.4.7


JOHNNY MNEMONIC A film review by Ben Hoffman Copyright 1995 Ben Hoffman
No one I have known has actually ever accused Keanu Reeves of being able to act. This film will change no one's mind. Johnny (Reeves) keeps a straight face throughout the whole film. If we are looking to give him credit it must be that the plot is so ridiculous, no one could have done any better.
The film opens with a big splash across the screen: INTERNET. Innocent me, I thought maybe at last they have made a movie based on real scientific electronic know-how. Forget it. That is the last of any credible science fiction.
In the 21st Century, the most important asset is information. To keep things secret and unavailable to competing corporations, "mnemonic couriers" are employed. Johnny is a professional courier who has a chip implanted in his brain (did I say "brain?"). Into this chip containing thousands of gigabytes of memory, Johnny is supposed to store the information he has stolen. As in everything, there is a price and the price Johnny must pay for what he gets is that his own childhood memory is removed to make room for the chip. Little wonder he looks befuddled.
Others in this mess are Dona Meyer, Ice-T, Takeshi, Denis Akiyama, Dolph Lundgren and a mysterious ghostly Barbara Sukowa, a strange ghost in cyberspace. Very weird film.
Directed by Robert Longo.
1 byte 4 Bytes = Superb 3 Bytes = Too good to be missed. 2 Bytes = So so. 1 Byte = Save your money.
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


Welcome!
This will be the beginning of my personal blog.
It will be a mix of some of the mixtapes that i've recorder aaaand the technical and cultural work that i've been doing on EDA.
I've always been interested on building something like this where I could put all my 'art :P' in one place.
This is the perfect opportunity for me to practice web development and at the same time put my work out there.
You will find some EDM on the MIXTAPES section.
I've went through a phase of Pop, Trance, Dubstep, Deep House and Tech house, but at the moment and for a while now I've been very into just House and NuDisco so that's what you'll find on the blog.
I think it will be very good to upload the tracklist of each mixtape but I will take that as a future improvement of the page.
Hope you guys enjoy it!


Welcome to All In With Functional C#.
Visual Studio 2015 and C# 6.0 will do, however for the best experience use Visual Studio 2017 and C# 7.x
A basic knowledge of the C# language is recommended.
In this workshop you will learn about functional C# by building a poker scoring game using C# 7.x features. You'll learn what features in C# 7.x support functional programming. The pros/cons of functional vs. imperative programming will be explored to understand the strengths of each style.
Key topics and takeaways:
In addition to this guide, a full presentation file and completed code can be found under the following folders in the repository.
In this chapter you're setting up the basics for unit testing.
Start by creating a new Class Library project. You'll use this project throughout the rest of this tutorial to build your application.
Click File > New Project > xUnit Test Project (.NET Core)
Name the project CsharpPoker
Delete UnitTest1.cs
Using the package manager console, run the following commands
PM> Install-Package FluentAssertions
Alternatively, you can use the package manager GUI
The next steps are for Visual Studio 2015 users. You may advance to step 2.0.
Start by creating a new Class Library project. You'll use this project throughout the rest of this tutorial to build your application.
Click File > New Project > Class Library
Name the project CsharpPoker
Delete Class1.cs
With the new project created, it's time to start building unit tests. For this guide, we are using xUnit. xUnit is a commonly used unit testing framework in .NET.
Open the package manager console, in quick launch, type: package manager console
Using the package manager console, run the following commands
PM> Install-Package xunit
PM> Install-Package xunit.runner.visualstudio
PM> Install-Package FluentAssertions
Alternatively, you can use the package manager GUI
In this chapter you'll learn how to create simple unit tests with xUnit.
Throughout this workshop you'll be using poker cards to learn new functional language features. In this exercise you'll create a new folder to hold unit tests and write your first unit test for a poker card. To keep things simple, in this workshop you'll use one project for all of your code. In a real-world app you would probably use a separate test project.
Add a folder named Tests to your project.
In /Tests Add an empty class file named CardTests.cs
Make sure the CardTests class is defined as public so the test runner can see the test class.
public class CardTests
In CardTests.cs add a new test method named CanCreateCard. Test methods in xUnit use the [Fact]
attribute. You may need to import xUnit with a using
statement, highlight Fact and press ctrl+. (control period), the press enter.
[Fact]
public void CanCreateCard() { }
In the CanCreateCard method write a test that confirms that a new Card object can be created.
var card = new Card();
Assert.NotNull(card);
There is no class defined yet, so you can consider this the first failing test. In the next exercise you'll create a Card object to satisfy this test.
In this exercise you'll create a card object.
In the root folder of your project, create a Card class named Card.cs.
Make the card class public.
public class Card {}
This should be enough to satisfy the first unit test. Build the project (ctrl+shift+b), open Test Explorer and click Run All. You should receive a green check-mark next to the CanCreateCard test.
If the Test Explorer window is not visible, type Test Explorer in the quick launch box.
A card must be able to represent a Suit and Value to be useful. In the next exercise you'll add some properties to the card and tests to insure a card has a Suit and Value when it is created.
Give the card properties to hold a CardValue and CardSuit
public class Card
{
public CardValue Value { get; set; }
public CardSuit Suit { get; set; }
}
Create enums for CardValue and CardSuit
// CardValue.cs
public enum CardValue
{
Two = 2,
Three,
Four,
Five,
Six,
Seven,
Eight,
Nine,
Ten,
Jack,
Queen,
King,
Ace
}
// CardSuit.cs
public enum CardSuit
{
Spades,
Diamonds,
Clubs,
Hearts
}
Change the CanCreateCard test so that a Card has a value when it is created, rename the test to CanCreateCardWithValue. Test to make sure the properties are NotNull.
[Fact]
public void CanCreateCardWithValue() {
var card = new Card();
Assert.NotNull(card.Suit);
Assert.NotNull(card.Value);
}
Note that the test will pass even when no value was assigned. This is because enums have a default value.
To insure that a value is intentionally set, add a constructor to the Card that requires a Suit and Value.
public class Card
{
public Card(CardValue value, CardSuit suit)
{
Value = value;
Suit = suit;
}
public CardValue Value { get; set; }
public CardSuit Suit { get; set; }
}
Change the assertion so that it checks for a predetermined Suit and Value.
var card = new Card(CardValue.Ace, CardSuit.Clubs);
Assert.Equal(CardSuit.Clubs, card.Suit);
Assert.Equal(CardValue.Ace, card.Value);
Now when a Card is created it must have its properties set to a value. In the next exercise you'll refactor the Card so that it is immutable, meaning that its properties cannot be changed once the object is created.
Re-run the test to verify that the test passes.
If you're using Visual Studio 2017 Enterprise edition. You can save time by enabling Live Unit Testing.
One positive aspect of C# programming is that both functional and OOP styles of programming are not mutually exclusive. In this exercise you'll override the inherited ToString method of the Card object and use it to describe the Card's values.
Create a new test CanDescribeCard, this test should test a Card with the values of CardValue.Ace
and CardSuit.Spades
. The ToString method should return "Ace of Spades"
.
[Fact]
public void CanDescribeCard()
{
var card = new Card(CardValue.Ace, CardSuit.Spades);
Assert.Equal("Ace of Spades", card.ToString());
}
Run the test to verify that it fails.
Next, update the Card object to make the test pass. Override the ToString method on the Card class and utilize the string interpolation syntax to write out the Card's description.
public override string ToString()
{
return $"{Value} of {Suit}";
}
Re-run the test to verify that the test passes.
The ToString method is a simple, single line of code that returns a value. In this exercise you'll use an expression-bodied member to reduce the amount of code further into a concise expression.
Find the ToString method of the Card class. Remove the braces {} from the method, and replace the return
statement with a lambda arrow =>. The arrow implies that the method will return a value, and the result is a much simpler syntax.
This will reduce the method to a simple one line statement.
public override string ToString() => $"{Value} of {Suit}";
Re-run the test to verify that the test passes.
In functional programming immutable objects are used to reduce complexity and avoid unintended changes in state. An immutable object's state cannot be modified after it is created, lowering the risk of side-effects.
In C# 6 or higher, backing fields and explicit readonly property declarations are not needed. By simply removing the set
operator from a property will make it a read-only property.
In the Card class, remove the set
declarations from each property.
public class Card
{
public Card(CardValue value, CardSuit suit)
{
Value = value;
Suit = suit;
}
public CardValue Value { get; }
public CardSuit Suit { get; }
public override string ToString() => $"{Value} of {Suit}";
}
Now the properties can only be set during the object's initialization.
Re-run the test to verify that the test passes.
In this chapter you created a simple object and used some functional aspects of C#. By using expression bodied-members, the ToString method was reduced to a single expression. The Card class was made immutable by using the objects constructor and removing the set
declarations from the object. In the Card object, both OOP and functional programming were used in a single class.
This chapter also outlined the basics of writing and running unit tests. Now that you're comfortable with running unit tests, you will not be instructed to run tests after this point, instead feel free to run them as needed throughout the remainder of the next chapters.
In the previous chapter you created a simple object and used some functional aspects of C#.
In this chapter you'll start with imperative and OOP style programming. Throughout the examples you'll be asked to refactor using functional programming. This will help identify where to find balance between the two styles. As the this guide progresses, instructions will become less detailed so that you can explore your on your own.
Now that you're comfortable with running unit tests, you will not be instructed to run tests after this point, instead feel free to run them as needed. For example, after every code change.
The poker hand will be used throughout the workshop. The Hand will represent a player's hand of cards. For this workshop a five card hand will be scored using imperative and functional programming.
Create a test class named HandTests in the /Tests folder. Make sure HandTests is public.
Use the following tests to create a Hand class that has a Cards property and a Draw method.
[Fact]
public void CanCreateHand()
{
var hand = new Hand();
Assert.False(hand.Cards.Any());
}
[Fact]
public void CanHandDrawCard()
{
var card = new Card(CardValue.Ace, CardSuit.Spades);
var hand = new Hand();
hand.Draw(card);
Assert.Equal(hand.Cards.First(), card);
}
Create a Hand class that satisfies the tests.
public class Hand
{
public Hand()
{
Cards = new List<Card>();
}
public List<Card> Cards { get;}
public void Draw(Card card)
{
Cards.Add(card);
}
}
The Hand class will hold a players hand of cards. In the next exercises you will be scoring the Hand of cards from the Cards property in the Hand class.
In a game where all players hands are a equal in rank, the winner is decided by comparing the highest card in their hands. Add a HighCard method to the Hand that returns the highest CardValue in the hand.
Below is a test method you can use to validate your HighCard method.
[Fact]
public void CanGetHighCard()
{
var hand = new Hand();
hand.Draw(new Card(CardValue.Seven, CardSuit.Spades));
hand.Draw(new Card(CardValue.Ten, CardSuit.Clubs));
hand.Draw(new Card(CardValue.Five, CardSuit.Hearts));
hand.Draw(new Card(CardValue.King, CardSuit.Hearts));
hand.Draw(new Card(CardValue.Two, CardSuit.Hearts));
Assert.Equal(CardValue.King, hand.HighCard().Value);
}
When this test passes, move on to the next exercise.
In the previous exercise, you determined the high card. Now add a HandRank GetHandRank method that will return the Hand's HandRank.
Add the HandRank enum to your project.
public enum HandRank
{
HighCard,
Pair,
TwoPair,
ThreeOfAKind,
Straight,
Flush,
FullHouse,
FourOfAKind,
StraightFlush,
RoyalFlush
}
Use the following tests to create a GetHandRank method on the Hand object that will return the correct HandRank for the test. Only score the Ranks below, you'll be refactoring as the workshop progresses and scoring additional HandRanks as you learn about OOP and functional programming.
[Fact]
public void CanScoreHighCard()
{
var hand = new Hand();
hand.Draw(new Card(CardValue.Seven, CardSuit.Spades));
hand.Draw(new Card(CardValue.Ten, CardSuit.Clubs));
hand.Draw(new Card(CardValue.Five, CardSuit.Hearts));
hand.Draw(new Card(CardValue.King, CardSuit.Hearts));
hand.Draw(new Card(CardValue.Two, CardSuit.Hearts));
Assert.Equal(HandRank.HighCard, hand.GetHandRank());
}
[Fact]
public void CanScoreFlush()
{
var hand = new Hand();
hand.Draw(new Card(CardValue.Two, CardSuit.Spades));
hand.Draw(new Card(CardValue.Three, CardSuit.Spades));
hand.Draw(new Card(CardValue.Ace, CardSuit.Spades));
hand.Draw(new Card(CardValue.Five, CardSuit.Spades));
hand.Draw(new Card(CardValue.Six, CardSuit.Spades));
Assert.Equal(HandRank.Flush, hand.GetHandRank());
}
[Fact]
public void CanScoreRoyalFlush()
{
var hand = new Hand();
hand.Draw(new Card(CardValue.Ten, CardSuit.Spades));
hand.Draw(new Card(CardValue.Jack, CardSuit.Spades));
hand.Draw(new Card(CardValue.Queen, CardSuit.Spades));
hand.Draw(new Card(CardValue.King, CardSuit.Spades));
hand.Draw(new Card(CardValue.Ace, CardSuit.Spades));
Assert.Equal(HandRank.RoyalFlush, hand.GetHandRank());
}
When this test passes, move on to the next exercise.
Now that the HighCard, Flush, and RoyalFlush hand ranks have been scored, review the answers to see how the code can be written using functional programming.
Open open the folder /chapter3/answers/first-pass
Open Hand.cs and review the comments
Now that the HighCard, Flush, and RoyalFlush hand ranks have been scored, review the answers to see how the code can be refactored using functional programming.
Open open the folder /chapter3/answers/refactored
Open Hand.cs and review the comments
Refactor your own code and make sure all of your tests pass.
Now it's time to refactor the tests using method chains. Pipelines are often found in functional programming languages. Pipelines allow functions to be chained or composed to produce easily maintainable and readable code.
Open /Tests/HandTests.cs
Add a reference to FluentAssertions.
using FluentAssertions;
Modify the Assert statement to use the FluentAssertions chain instead. To do this, start with the value that will be tested and continue with the method Should().Be(expectedValue)
Assert.Equal(CardValue.King, hand.HighCard().Value);
becomes
hand.HighCard().Value.Should().Be(CardValue.King);
Below is a example of the completed CanGetHighCard test
[Fact]
public void CanGetHighCard()
{
var hand = new Hand();
hand.Draw(new Card(CardValue.Seven, CardSuit.Spades));
hand.Draw(new Card(CardValue.Ten, CardSuit.Clubs));
hand.Draw(new Card(CardValue.Five, CardSuit.Hearts));
hand.Draw(new Card(CardValue.King, CardSuit.Hearts));
hand.Draw(new Card(CardValue.Two, CardSuit.Hearts));
hand.HighCard().Value.Should().Be(CardValue.King);
}
Refactor all tests to use Fluent Assertions.
In the previous chapter you solved a few hand ranks using LINQ and refactored tests with method chains with the help of FluentAssertions.
In this chapter you'll continue with imperative and OOP style programming. Throughout the examples you'll be asked to refactor using functional programming. Later in this chapter, you'll learn about working with concurrency in C#.
Feel free to run tests as needed. For example, after every code change.
Continue to update the poker hand used throughout the workshop.
[Fact]
public void CanScorePair()
{
var hand = new Hand();
hand.Draw(new Card(CardValue.Ten, CardSuit.Clubs));
hand.Draw(new Card(CardValue.Jack, CardSuit.Spades));
hand.Draw(new Card(CardValue.Nine, CardSuit.Spades));
hand.Draw(new Card(CardValue.Ten, CardSuit.Hearts));
hand.Draw(new Card(CardValue.Ace, CardSuit.Spades));
hand.GetHandRank().Should().Be(HandRank.Pair);
}
[Fact]
public void CanScoreThreeOfAKind()
{
var hand = new Hand();
hand.Draw(new Card(CardValue.Ten, CardSuit.Clubs));
hand.Draw(new Card(CardValue.Jack, CardSuit.Spades));
hand.Draw(new Card(CardValue.Nine, CardSuit.Spades));
hand.Draw(new Card(CardValue.Ten, CardSuit.Hearts));
hand.Draw(new Card(CardValue.Ten, CardSuit.Spades));
hand.GetHandRank().Should().Be(HandRank.ThreeOfAKind);
}
[Fact]
public void CanScoreFourOfAKind()
{
var hand = new Hand();
hand.Draw(new Card(CardValue.Ten, CardSuit.Clubs));
hand.Draw(new Card(CardValue.Jack, CardSuit.Spades));
hand.Draw(new Card(CardValue.Ten, CardSuit.Spades));
hand.Draw(new Card(CardValue.Ten, CardSuit.Hearts));
hand.Draw(new Card(CardValue.Ten, CardSuit.Spades));
hand.GetHandRank().Should().Be(HandRank.FourOfAKind);
}
[Fact]
public void CanScoreFullHouse()
{
var hand = new Hand();
hand.Draw(new Card(CardValue.Ten, CardSuit.Clubs));
hand.Draw(new Card(CardValue.Jack, CardSuit.Spades));
hand.Draw(new Card(CardValue.Ten, CardSuit.Spades));
hand.Draw(new Card(CardValue.Jack, CardSuit.Hearts));
hand.Draw(new Card(CardValue.Ten, CardSuit.Spades));
hand.GetHandRank().Should().Be(HandRank.FullHouse);
}
When this tests pass, move on to the next exercise.
Now that the Pairs (of a kind) hand ranks have been scored, review the answers to see how the code can be written using functional programming.
Open open the folder files/04-Pairs/answers/first-pass
Open Hand.cs and review the comments
Now that the Pairs (of a kind) hand ranks have been scored, review the answers to see how the code can be refactored using functional programming.
Open open the folder files/04-Pairs/answers/refactored
Open Hand.cs and review the comments Open EvalExtensions.cs and review the comments
In the previous chapter you solved more hand ranks using higher order functions and refactored with an extension method to create a method chain.
In this chapter you'll continue with imperative and OOP style programming. Throughout the examples you'll be asked to refactor using functional programming. Later in this chapter, you'll learn about working with the Yield operator in C#.
Feel free to run tests as needed. For example, after every code change.
Continue to update the poker hand used throughout the workshop.
[Fact]
public void CanScoreStraight()
{
var hand = new Hand();
hand.Draw(new Card(CardValue.Ten, CardSuit.Clubs));
hand.Draw(new Card(CardValue.Jack, CardSuit.Spades));
hand.Draw(new Card(CardValue.Queen, CardSuit.Spades));
hand.Draw(new Card(CardValue.King, CardSuit.Hearts));
hand.Draw(new Card(CardValue.Ace, CardSuit.Spades));
hand.GetHandRank().Should().Be(HandRank.Straight);
}
[Fact]
public void CanScoreStraightUnordered()
{
var hand = new Hand();
hand.Draw(new Card(CardValue.Ace, CardSuit.Spades));
hand.Draw(new Card(CardValue.Queen, CardSuit.Clubs));
hand.Draw(new Card(CardValue.Jack, CardSuit.Spades));
hand.Draw(new Card(CardValue.Ten, CardSuit.Spades));
hand.Draw(new Card(CardValue.King, CardSuit.Hearts));
hand.GetHandRank().Should().Be(HandRank.Straight);
}
When this tests pass, move on to the next exercise.
Now that the Straight hand rank has been scored, review the answers to see how the code can be written using functional programming.
Open open the folder files/05-Sequences/answers/first-pass
Open Hand.cs and review the comments
Now that the Straight hand rank has been scored, review the answers to see how the code can be refactored using functional programming.
Open open the folder files/05-Sequences/answers/refactored
Open Hand.cs and review the comments Open EvalExtensions.cs and review the comments
In the previous chapter you solved more hand ranks using LINQ and refactored with the yield keyword to create a custom LINQ-like extension method.
In this chapter you'll refactor to use a more functional approach to scoring a hand.
Feel free to run tests as needed. For example, after every code change.
Up until now we have combined our Hand object with the behavior of scoring. Ideally these concepts should not be mixed. Because there is no state to be concerned about, the scoring functions can be moved with relative ease.
Create a new public static class named FiveCardPokerScorer
Open Hand.cs and move the scoring functionality to FiveCardPokerScorer.cs. Because the functionality will be external to the data, the funcitons will need to be modified to accept the data as a parameter. In addtion, this will bring the application closer in-line with functional programming because the new functions are considered "pure functions".
Example:
public static class FiveCardPokerScorer
{
public static Card HighCard(IEnumerable<Card> cards) => cards.Aggregate((highCard, nextCard) => nextCard.Value > highCard.Value ? nextCard : highCard);
private static bool HasFlush(IEnumerable<Card> cards) => cards.All(c => cards.First().Suit == c.Suit);
}
Create a new test class in /Tests named FiveCardPokerScorerTests
Move the corresponding tests from HandTests to FiveCardPokerScorerTests.
[Fact]
public void CanGetHighCard()
{
var hand = new Hand();
hand.Draw(new Card(CardValue.Seven, CardSuit.Spades));
hand.Draw(new Card(CardValue.Ten, CardSuit.Clubs));
hand.Draw(new Card(CardValue.Five, CardSuit.Hearts));
hand.Draw(new Card(CardValue.King, CardSuit.Hearts));
hand.Draw(new Card(CardValue.Two, CardSuit.Hearts));
FiveCardPokerScorer.HighCard(hand.Cards).Value.Should().Be(CardValue.King);
}
If you're using VS2015 C# 6.0 skip this exercise.
Create a new public class named Ranker
Open Hand.cs and create a new private method named Rankings that generates a collection of Tuples. Use the following code as a starting point, fill in the remaining items
private List<(Func<IEnumerable<Card>, bool> eval, HandRank rank)> Rankings() =>
new List<(Func<IEnumerable<Card>, bool> eval, HandRank rank)>
{
// more ranks here
};
Find the GetHandRank method and remove the expression after the =>
The result should be:
public static HandRank GetHandRank() =>
After the => write a new expression that uses the Rankings that evaluates the hand rank.
Hint: think LINQ
If you're using VS2017 C# 7.x skip this exercise.
Create a new public class named Ranker
The Ranker an immutable class that will hold a delegate responsible for evaluating cards and a corresponding hand rank.
public class Ranker
{
public Ranker(Func<IEnumerable<Card>, bool> eval, HandRank rank)
{
Eval = eval;
Rank = rank;
}
public Func<IEnumerable<Card>, bool> Eval { get; }
public HandRank Rank { get; }
}
Open Hand.cs and create a new private method named Rankings that generates a collection of Ranker.
Use the following code as a starting point, fill in the remaining Ranker items
private List<Ranker> Rankings() => new List<Ranker>
{
new Ranker(cards => HasRoyalFlush(), HandRank.RoyalFlush),
// more ranks here
};
Find the GetHandRank method and remove the expression after the =>
The result should be:
public static HandRank GetHandRank() =>
After the => write a new expression that uses the List
Hint: think LINQ
The newest version of GetHandRank can be more flexible than the previous versions. Because it is a collection, it can easily be added to and operated on using LINQ.
Adding new hand ranks is easy. Simply add a new Ranker to the Rankings collection and the GetHandRank method will do the rest.
Make the GetHandRank method even more robust by allowing Ranks to be added in any order.
Find the GetHandRank method and order the Rankings by descending order by their Strength
// With Tuples
.OrderByDescending(rule => rule.rank)
// Without Tuples
.OrderByDescending(rule => rule.Rank)
Next, solve the following unit test
[Fact]
public void CanScoreTwoPair()
{
var hand = new Hand();
hand.Draw(new Card(CardValue.Ace, CardSuit.Clubs));
hand.Draw(new Card(CardValue.Ten, CardSuit.Spades));
hand.Draw(new Card(CardValue.Nine, CardSuit.Spades));
hand.Draw(new Card(CardValue.Ten, CardSuit.Hearts));
hand.Draw(new Card(CardValue.Ace, CardSuit.Spades));
hand.GetHandRank().Should().Be(HandRank.TwoPair);
}
Continue building the project in your own direction. Use what you have learned to add multiple hands and players to a game and score a poker game.
Add support for other poker games types, with new rules or more cards. See how loosely coupled you can make the rules/ranks from the cards and hands.


No support for the audio tag in this browser. Get
Google Chrome
.
The green square should be visible exactly when a beep is heard.
Losing sync, either after a while or after seeking =
FAIL


Microverse Survey Trial
Please fill the spaces bellow your best answers!
Name
Email
Age (optional)
What do you think about Microverse Course?
The Best
Very Good
Good
Regular
Will recomend us?
Sure
Probably
Maybe
Not So Sure
Have you ever did some infos bellow?
info1
info2
info3
info4
info5
Additional Informations
Feel free to give any other information.
Save


// // Copyright (c) Microsoft and contributors. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // // See the License for the specific language governing permissions and // limitations under the License. // // Expose 'FileUtilities'. exports = module.exports; /** * Defines constants, enums, and utility functions for use with the File service. * @namespace FileUtilities */ var FileUtilities = { /** * Permission types * * @const * @enum {string} */ SharedAccessPermissions: { READ: 'r', WRITE: 'w', DELETE: 'd', LIST: 'l' }, /** * Listing details. * * @const * @enum {string} */ ListingDetails: { METADATA: 'metadata' }, /** * File and share public access types. * * @const * @enum {string} */ SharePublicAccessType: { OFF: null, SHARE: 'share', FILE: 'file' } }; module.exports = FileUtilities;


|
JavaTM 2 Platform Standard Ed. 5.0 |
|||||||||
| PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |
See:
Description
| Interface Summary | |
|---|---|
| PathIterator | The PathIterator interface provides the mechanism
for objects that implement the Shape
interface to return the geometry of their boundary by allowing
a caller to retrieve the path of that boundary a segment at a
time. |
| Class Summary | |
|---|---|
| AffineTransform | The AffineTransform class represents a 2D affine transform
that performs a linear mapping from 2D coordinates to other 2D
coordinates that preserves the "straightness" and
"parallelness" of lines. |
| Arc2D | Arc2D is the abstract superclass for all objects that
store a 2D arc defined by a bounding rectangle,
start angle, angular extent (length of the arc), and a closure type
(OPEN , CHORD , or PIE ). |
| Arc2D.Double | This class defines an arc specified in double precision. |
| Arc2D.Float | This class defines an arc specified in float precision. |
| Area | The Area class is a device-independent specification of an
arbitrarily-shaped area. |
| CubicCurve2D | The CubicCurve2D class defines a cubic parametric curve
segment in (x, y) coordinate space. |
| CubicCurve2D.Double | A cubic parametric curve segment specified with double coordinates. |
| CubicCurve2D.Float | A cubic parametric curve segment specified with float coordinates. |
| Dimension2D | The Dimension2D class is to encapsulate a width
and a height dimension. |
| Ellipse2D | The Ellipse2D class describes an ellipse that is defined
by a bounding rectangle. |
| Ellipse2D.Double | The Double class defines an ellipse specified
in double precision. |
| Ellipse2D.Float | The Float class defines an ellipse specified
in float precision. |
| FlatteningPathIterator | The FlatteningPathIterator class returns a flattened view of
another PathIterator object. |
| GeneralPath | The GeneralPath class represents a geometric path
constructed from straight lines, and quadratic and cubic
(Bézier) curves. |
| Line2D | This Line2D represents a line segment in (x, y)
coordinate space. |
| Line2D.Double | A line segment specified with double coordinates. |
| Line2D.Float | A line segment specified with float coordinates. |
| Point2D | The Point2D class defines a point representing a location
in (x, y) coordinate space. |
| Point2D.Double | The Double class defines a point specified in
double precision. |
| Point2D.Float | The Float class defines a point specified in float
precision. |
| QuadCurve2D | The QuadCurve2D class defines a quadratic parametric curve
segment in (x, y) coordinate space. |
| QuadCurve2D.Double | A quadratic parametric curve segment specified with
double coordinates. |
| QuadCurve2D.Float | A quadratic parametric curve segment specified with
float coordinates. |
| Rectangle2D | The Rectangle2D class describes a rectangle
defined by a location (x, y) and dimension
(w x h). |
| Rectangle2D.Double | The Double class defines a rectangle specified in
double coordinates. |
| Rectangle2D.Float | The Float class defines a rectangle specified in float
coordinates. |
| RectangularShape | RectangularShape is the base class for a number of
Shape objects whose geometry is defined by a rectangular frame. |
| RoundRectangle2D | The RoundRectangle2D class defines a rectangle with
rounded corners defined by a location (x, y), a
dimension (w x h), and the width and height of an arc
with which to round the corners. |
| RoundRectangle2D.Double | The Double class defines a rectangle with rounded
corners all specified in double coordinates. |
| RoundRectangle2D.Float | The Float class defines a rectangle with rounded
corners all specified in float coordinates. |
| Exception Summary | |
|---|---|
| IllegalPathStateException | The IllegalPathStateException represents an
exception that is thrown if an operation is performed on a path
that is in an illegal state with respect to the particular
operation being performed, such as appending a path segment
to a GeneralPath without an initial moveto. |
| NoninvertibleTransformException | The NoninvertibleTransformException class represents
an exception that is thrown if an operation is performed requiring
the inverse of an AffineTransform object but the
AffineTransform is in a non-invertible state. |
Provides the Java 2D classes for defining and performing operations on objects related to two-dimensional geometry. Some important features of the package include:
|
JavaTM 2 Platform Standard Ed. 5.0 |
|||||||||
| PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |
Copyright © 2004, 2010 Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.


Who we are and what we do
We area Atlantic Nitrogen Pumping Services.
We specialize in industrial liquid nitrogen applications. ANPS excels in full-service, full-spectrum support and project
management for your task.
Expert Leadership in Atlantic Nitrogen
The Crew
General Manager
Dave Damits
Owner And President
Kyle Dick
Manager of Sales and Project Manager
Ty Fender
Information 001
Location
We are located in the heart of the booming Marcellus and Utica Shale industry in Washington, Pennsylvania. We are a short half-hour drive from Pittsburgh, the West Virginia Border, and the Ohio Border.
Information 002
Our Mission
Commitment to Safety
Atlantic Nitrogen understands the inherit dangers of working in the oil and gas industry, and has taken every step necessary to ensure the safest workplace and environment for its employees and customers. All employees are trained according to industry standards, have all required personal protective equipment (PPE), and our equipment is regularly recertified every 6 months.
Employees are HAZMAT, OSHA10, OSHA30, Veriforce, DOT, Safeland, PCI, ISNET World, and NCCER trained.
Commitment to the Client and Customer
At Atlantic Nitrogen Pumping Services we work for you.
We are able to meet the fast-paced ever-changing landscape of the oil and gas industry and flexibility is one of our core competencies. We will help you make your project a success, and we will be there from the planning and development stage, all the way to when the job is completed.
We go above and beyond the necessary steps in order to ensure that we limit our environmental impact at Atlantic Nitrogen. All of our equipment is surrounded in spill containment liners and any product put into the pipeline is carefully taken care of as to not contaminate the area.
Information 003
Capabilities
We are able to perform any number of tasks with our our high pressure - high volume liquid nitrogen pumping trucks. The trucks are large enough to support the biggest jobs while small enough to fit into the tightest most remote locations in the US.
Our capabilities include:
- Pressure Testing
- Well Stimulation
- Leak Detection
- Pigging
- Purging / Displacement
- Temperature Management
- Pipe Freezing
- Well Cleanouts
- Gas Lift
- Drying and Preservation
- De-watering
- Nitrogen Blanketing
- Tank Farms
- Daily Facility Operations
- Pressure Packing
- etc.
We are able to do even more through our sister company, Atlantic Nitrogen & Testing LLC. Click here to find out more about the services we offer.
Careers
Apply to work with us.
We are looking for qualified candidates who are excited to learn and grow their careers in the oil and gas industry.
Apply for an interview at our office in Washington, Pennsylvania over phone or by email.
Phone:<PHONE_NUMBER>
Email<EMAIL_ADDRESS>We are looking for candidates with at least a high school diploma, clean driving record, and the ability to pass pre-employment and random drug tests. An exceptional candidate will have a CDL or above, HAZMAT training, prior oil and gas industry work, and experience operating liquid nitrogen units.


About Me
Benjamin Sigal is a student at UCLA for Electrical Engineering in the Class of 2023. He maintains this website for fun, hosting simple games and other small coding projects on it.


Hack or Snooze
favorites
my stories
create a new story
login/create user
(logout)
Add Story
author
title
url
submit
Loading...
Article Information
Title
change
Login
username
password
login
Create Account
name
username
password
create account
User Profile Info
Update Profile Info
name
password
update


| register_theme_elements {ggplot2} | R Documentation |
The underlying structure of a ggplot2 theme is defined via the element tree, which specifies for each theme element what type it should have and whether it inherits from a parent element. In some use cases, it may be necessary to modify or extend this element tree and provide default settings for newly defined theme elements.
register_theme_elements(..., element_tree = NULL, complete = TRUE) reset_theme_settings(reset_current = TRUE) get_element_tree() el_def(class = NULL, inherit = NULL, description = NULL)
... |
Element specifications |
element_tree |
Addition of or modification to the element tree, which specifies the inheritance relationship of the theme elements. The element tree must be provided as a list of named element definitions created with el_def(). |
complete |
If |
reset_current |
If |
class |
The name of the element class. Examples are "element_line" or
"element_text" or "unit", or one of the two reserved keywords "character" or
"margin". The reserved keyword "character" implies a character
or numeric vector, not a class called "character". The keyword
"margin" implies a unit vector of length 4, as created by |
inherit |
A vector of strings, naming the elements that this element inherits from. |
description |
An optional character vector providing a description for the element. |
The function register_theme_elements()
provides the option to globally register new
theme elements with ggplot2. In general, for each new theme element both an element
definition and a corresponding entry in the element tree should be provided. See
examples for details. This function is meant primarily for developers of extension
packages, who are strongly urged to adhere to the following best practices:
Call register_theme_elements()
from the .onLoad()
function of your package, so
that the new theme elements are available to anybody using functions from your package,
irrespective of whether the package has been attached (with library()
or require()
)
or not.
For any new elements you create, prepend them with the name of your package, to avoid
name clashes with other extension packages. For example, if you are working on a package
ggxyz, and you want it to provide a new element for plot panel annotations (as demonstrated
in the Examples below), name the new element ggxyz.panel.annotation
.
The function reset_theme_settings()
restores the default element tree, discards
all new element definitions, and (unless turned off) resets the currently active
theme to the default.
The function get_element_tree()
returns the currently active element tree.
The function el_def()
is used to define new or modified element types and
element inheritance relationships for the element tree.
# Let's assume a package `ggxyz` wants to provide an easy way to add annotations to # plot panels. To do so, it registers a new theme element `ggxyz.panel.annotation` register_theme_elements( ggxyz.panel.annotation = element_text(color = "blue", hjust = 0.95, vjust = 0.05), element_tree = list(ggxyz.panel.annotation = el_def("element_text", "text")) ) # Now the package can define a new coord that includes a panel annotation coord_annotate <- function(label = "panel annotation") { ggproto(NULL, CoordCartesian, limits = list(x = NULL, y = NULL), expand = TRUE, default = FALSE, clip = "on", render_fg = function(panel_params, theme) { element_render(theme, "ggxyz.panel.annotation", label = label) } ) } # Example plot with this new coord df <- data.frame(x = 1:3, y = 1:3) ggplot(df, aes(x, y)) + geom_point() + coord_annotate("annotation in blue") # Revert to the original ggplot2 settings reset_theme_settings()


Welcome!
Actions
Clear logs
Change passcode
#
Website
User Details
TimeStamp
×
Change passcode
New Passcode :
Passcode cannot be empty!


grocery-list is a simple grocery list app. Please signup & login to start using it.
Built by @s_thai using Meteor and Bootstrap.
It is open-source and available on Github: github.com/sri/grocery-list
{{> loginButtons}}


Daily Recreational
State
Alabama
Alaska
Arizona
Arkansas
California
Colorado
Connecticut
Delaware
District Of Columbia
Florida
Georgia
Hawaii
Idaho
Illinois
Indiana
Iowa
Kansas
Kentucky
Louisiana
Maine
Maryland
Massachusetts
Michigan
Minnesota
Mississippi
Missouri
Montana
Nebraska
Nevada
New Hampshire
New Jersey
New Mexico
New York
North Carolina
North Dakota
Ohio
Oklahoma
Oregon
Pennsylvania
Rhode Island
South Carolina
South Dakota
Tennessee
Texas
Utah
Vermont
Virginia
Washington
West Virginia
Wisconsin
Wyoming
Select Activity
Camping
Biking
Hiking
Skiing
Cross-Country Skiing
Fishing
Climbing
Kayaking
Horseback Riding
Snowshoeing
Birdwatching
Scenic Driving
Astronomy
Search
Reset


API Documentation
Technical Requirements
General
Requirements
Options
Authentication
Response Format
Rate Limiting
Batches
Synchronous and
Asynchronous Response
Support
Products
Overview
Communication Flow
API Endpoints
Fields
Examples
Orders
Overview
Communication Flow
API Endpoints
Examples
Errors
Overview
Examples
Reference
Endpoints
Models


It is very annoying when you buy something expensive and you lose it or it gets stolen. But there are some technical solutions to prevent that.
Crowd GPS Tags
Crowd GPS devices use Bluetooth and connect with Smartphones. Whenever another person has the App installed, he/she sends the location of all devices to a server. This means as long as anybody is near the GPS tag, you can hope to find your stuff again.
Tile
Tile is such a crowd GPS device.
There is no android app yet.
TinTag
TinTag is a 28mm × 39.2mm device. Its battery lasts for 4 months. It has an LED and a buzzer as well as bluetooth. The bluetooth connection lasts for 100m.
It has a indigogo campagain. 10 Tintag devices and 1 base charger cost 105 US-Dollar.
Tintag app works on Android phones (version 4.3 and 4.4) and iPhone. It doesn't work yet on Windows Phones or Blackberry.
TrackR bravo
TrackR bravo is just another tagging device.
TrackR is compatible with Android 4.4 (see App) and iPhone 4s & later, iPad 3rd Generation & later. It works with Bluetooth 4.0. It uses a CR1616 coin cell battery.
It is 31mm in diameter and 3.5mm height.
It can detect bluetooth devices up to 30m.
One TrackR costs 29 US-Dollar, 10 cost 99 US-Dollar.
StickNFind
StickNFind is probably the smallest Crowd GPS tag. It was on indiegogo and raised 931.870 US-Dollar.
It works with Android and iOS, as long as you have Bluetooth 4.0.
Specs
- Technology: Bluetooth 4.0 (Bluetooth Low Energy)
- Range: Approximate 30m with line of sight.
- Battery: Lasts up-to 1 year based on 30 minutes per day average use.
- Battery Type: CR2016 watch battery. Battery is replaceable
- Cost: A 10 pack costs 200 US-Dollar.
- Dimensions
- Shape: Cylindric
- Diameter: 2.4cm diameter
- Thickness: 4mm
- Weight: 4.5g
SelectaDNA
Bicycles
Bicycles sometimes have a number on the frame. In German, it is called Fahrradrahmennummer. In Germany, you can sometimes go to the police and they will add such a number to your bike. In case it gets stolen and the police finds it, they can look at their records and give it back to you. Eventually. I'm not sure how good this works. But it doesn't cost anything, so why not?
Another way is uglification. One way to do this is using these stickers.
Another way is putting lots of reflecting stuff on it. That has the advantage of giving you extra security as drivers can see you more easily.
USB-Sticks
I always add a README.txt
to the USB stick with the following content:
## German
Dieser USB-Stick gehört Martin Thoma.
Wenn er verloren wurde, wäre es toll, wenn Sie eine E-Mail an
<EMAIL_ADDRESS>schreiben würden.
--------------------------------------------------------------
## English
This USB stick belongs to Martin Thoma.
If it was lost, please send an e-mail to<EMAIL_ADDRESS>Luggage
I always leave a note in my luggage with the following content:
Martin Thoma
Parkstr. 17
76131 Karlsruhe
Tel.: XXXX
E-Mail<EMAIL_ADDRESS>House
Locks and keys... but you can lose your keys or forget them inside.
When you lose your keys, you have to replace all locks. That's a problem with traditional keys. But I could imagine that a good keycard lock does not have this flaw. You "simply" tell the system that a card was lost and replace the cheap card - not the expensive lock. The card should only contain a long number. If the number is one of the allowed numbers, one can enter. If not, the system locks for 2 seconds. That should effectively prevent brute force.
Smart Phones
Android device manager


lets_plot.layer_tooltips¶
-
class
lets_plot.
layer_tooltips
¶ Configure tooltips.
- Parameters
- format() defines the format for displaying the value – .format(field = ‘density’, format = ‘.1f’)
.format(field = ‘^color’, format = ‘value is {.1f}’)
This format will be applied to the mapped value in the default tooltip or to the corresponding value specified in the ‘line’ template. The field name starts with a ‘^’ prefix for aesthetics, variable names are specified without prefix. It’s possible to set the format for all positional aesthetics:
field = “^X” - for all positional x; field = “^Y” - for all positional y.
The format contains a number format (‘1.f’) or a string template (‘{.1f}’). The numeric format for non-numeric value will be ignored. If you need to include a brace character in the literal text, it can be escaped by doubling: {{ and }}, e.g.,
.format(‘^color’, ‘{{ {.1f} }}’) -> “{ 17.0 }” .format(‘model’, ‘{} {{text}}’) -> “mustang {text}”
The string template in format will allow to change lines for the default tooltip without ‘line’ specifying. Also the template will change the line for outliers. Aes and var formats are not interchangeable, i.e. var format will not be applied to aes, mapped to this variable.
line() - line to show in the tooltip. – Adds a line template to the tooltip with a label. Variables and aesthetics can be accessed via a special syntax:
^color for aes
@year for variable
@{number of cylinders} for variable with spaces in the name
@{square m^2} for variable with spaces and ‘^’ symbol in the name
@nameWith^ for the variable with ‘^’ symbol in its name
- A ‘^’ symbol can be escaped with a backslash, a brace character in the literal text - by doubling:
.line(‘text’) -> “text” .line(‘{{text}}’) -> “{text}” .line(‘@model’) -> “mustang” .line(‘{{@model}}’) -> “{mustang}”
The specified ‘line’ for outlier will move it to the general multi-line tooltip. The default tooltip has a label before the value, usually containing the name of the mapped variable. It has it’s own behaviour, like blank label for axis aesthetics. This default label can be set in template using a pair of symbols ‘@|’. The label can be overridden by specifying a string value before ‘|’ symbol. Within the tooltip line the label is left-aligned, the formed by template string is right-aligned. If a label is not specified, the string will be centered in the tooltip. For example:
Set tooltips = “none” to hide tooltips from this layer.
anchor() - the corner of the plot to move the general tooltip –
- [‘top_left’ | ‘top_center’ | ‘top_right’ |
‘middle_left’ | ‘middle_center’ | ‘middle_right’ | ‘bottom_left’ | ‘bottom_center’ | ‘bottom_right’]
min_width() - minimum width of the general tooltip.
color() - the color for the general tooltip.
- Returns
- Return type
layer tooltips specification
Examples
>>> import pandas as pd >>> from lets_plot import * >>> LetsPlot.setup_html() >>> mpg_url = 'https://vincentarelbundock.github.io/Rdatasets/csv/ggplot2/mpg.csv' >>> mpg = pd.read_csv(mpg_url) >>> ggplot(mpg, aes(x='displ', y='hwy')) + ... geom_point(aes(color='cty', shape='drv'), ... tooltips=layer_tooltips() ... .format('hwy', '.1f') # set the format for the variable value ... .line('@manufacturer @model') # " ford mustang " ... .line('cty/hwy|^color/@hwy') # "cty/hwy 17.0/26.0" ... .line('@|@class') # "class subcompact" ... .line('|@year') # " 2008" ... .line('--[mpg dataset] --')) # " --[mpg dataset] -- "
-
__init__
()¶ Initialize self. See help(type(self)) for accurate signature.
Methods
__init__
()Initialize self.
anchor
(value)as_dict
()color
(value)format
([field, format])line
(value)min_width
(value)props
()


ArogyaChain
Practitioner Registration
Register as a practitioner here
Practitioner Name
Specialization
Department
Ortho
Cardio
Neuro
Working Hospital ID
Working proof ID
Submit


Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s.
It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout.
t is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout.
t is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout.
Our latests thoughts about things that only matters to us.
It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout.
Read MoreIt is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout.
Read MoreIt is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout.
Read MoreTHIS IS A CALL TO ACTION AREA
Contrary to popular belief, Lorem Ipsum is not simply random text.
Join us on our social networks for all the latest updates, product/service announcements and more.


Implements a generic IObjectFactory.
Default constructor
protected Void ObjectFactory()
Application context object factory name.
public String Name { get; set; }
Finds out if the factory contains an object of the given name.
public Boolean ContainsObject(name)
true if the factory contains the object.
| Name | Type | Summary |
|---|---|---|
| name | String | Name of the object to find. |
| Type | Summary |
|---|---|
| ArgumentNullOrEmptyException | Thrown when name is null or empty. |
Finds out if the factory contains an object of the given type.
public Boolean ContainsObject(objectType)
true if the factory contains the object.
| Name | Type | Summary |
|---|---|---|
| objectType | Type | Type of the object to find. |
| Type | Summary |
|---|---|
| ArgumentNullException | Thrown when objectType is null. |
Creates a new instance of the application context object.
protected Object CreateInstance(cfg, args)
A newly created instance of the application context object.
| Name | Type | Summary |
|---|---|---|
| cfg | ObjectConfiguration | Object configuration. |
| args | Object[] | Arguments to pass to the constructor. |
| Type | Summary |
|---|---|
| ArgumentNullException | Thrown when cfg is null. |
Performs a clean up.
public Void Dispose()
Gets an initialized instance of an object for the given name.
public Object GetObject(name)
An initialized instance of the object named name.
| Name | Type | Summary |
|---|---|---|
| name | String | The name of the object to retrieve. |
| Type | Summary |
|---|---|
| ArgumentNullOrEmptyException | Thrown when name is null or empty. |
Gets an initialized instance of an object for the given name. If there isn´t an object for the given name or if there is an error getting the object, an exception is thrown only if thrown is true otherwise null is returned.
public Object GetObject(name, thrown)
An initialized instance of the object named name.
| Name | Type | Summary |
|---|---|---|
| name | String | The name of the object to retrieve. |
| thrown | Boolean | Whether to throw an exception of not. |
| Type | Summary |
|---|---|
| ArgumentNullOrEmptyException | Thrown when name is null or empty. |
| NoSuchObjectException | Thrown when there are no object for the given name and thrown is true. |
Gets an instance of the object for the given name.
public Object GetObject(name, args)
An initialized instance of the object named name.
| Name | Type | Summary |
|---|---|---|
| name | String | The name of the object to retrieve. |
| args | Object[] | Arguments to be passed to the constructor. |
| Type | Summary |
|---|---|
| ArgumentNullOrEmptyException | Thrown when name is null or empty. |
| NoSuchObjectException | Thrown when there isn't an object for the given name. |
Gets an initialized instance of a object for the given name only if the object type is equal to requiredType.
public Object GetObject(name, requiredType)
An initialized instance of the object named name.
| Name | Type | Summary |
|---|---|---|
| name | String | The name of the object to retrieve. |
| requiredType | Type | Required Type of the object. |
| Type | Summary |
|---|---|
| ArgumentNullOrEmptyException | Thrown when name is null or empty. |
| NoSuchObjectException | Thrown when there isn't an object for the given name. |
| ObjectNotOfRequiredTypeException | Thown the the object is not of type requiredType. |
Gets an initialized instance of the object for the given objectType.
public Object GetObject(objectType)
An initialized instance of the object for the given type.
| Name | Type | Summary |
|---|---|---|
| objectType | Type | Type of the object to retrive. |
| Type | Summary |
|---|---|
| ArgumentNullException | Thrown when objectType is null. |
| NoSuchObjectException | Thrown when there are no object for the given type. |
Gets an initialized instance of the object for the given objectType.
public Object GetObject(objectType, args)
An initialized instance of the object for the given type.
| Name | Type | Summary |
|---|---|---|
| objectType | Type | Type of the object to retrive. |
| args | Object[] | Arguments to pass to the constructor. |
| Type | Summary |
|---|---|
| ArgumentNullException | Thrown when objectType is null. |
| NoSuchObjectException | Thrown when there are no object for the given type. |
Gets an initialized instance of an object of type
public GetObject<T>()
An initialized object of type
Gets an initialized instance of an object of type
public GetObject<T>(args)
An initialized object of type
| Name | Type | Summary |
|---|---|---|
| args | Object[] | Arguments to be passed to the constructor. |
| Type | Summary |
|---|---|
| NoSuchObjectException | Thrown when there are no objects of the specified type. |
Gets a collection of initialized objects from the application context
that are assignable from
public IEnumerable GetObjectsOfContextAssignableFrom<T>()
A collection of initialized application context objects.
Gets a collection of initialized objects from the application context that are assignable from type.
public IEnumerable<Object> GetObjectsOfContextAssignableFrom(type)
A collection of initialized application context objects.
| Name | Type | Summary |
|---|---|---|
| type | Type | Type that the objects must be assignable from. |
| Type | Summary |
|---|---|
| ArgumentNullException | Thrown when type is null. |
Gets the Type of the object for the given name.
public Type GetType(name)
Type of the object for the given name.
| Name | Type | Summary |
|---|---|---|
| name | String | The name of the object to retrive it's type. |
| Type | Summary |
|---|---|
| ArgumentNullOrEmptyException | Thrown when name is null or empty. |
| NoSuchObjectException | Thrown when there are no object for the given name. |
Initialize this object factory from the enumeration of configured objects.
protected Void InitializeFactory(name, config)
| Name | Type | Summary |
|---|---|---|
| name | String | Name of this factory. |
| config | IEnumerable<ObjectConfiguration> | A collection of object configuration for this factory. |
| Type | Summary |
|---|---|
| ArgumentNullOrEmptyException | Thrown when name is null or empty. |
| ArgumentNullException | Thown when config is null. |
Inject dependencies into o.
public Void InjectDependencies(name, o)
| Name | Type | Summary |
|---|---|---|
| name | String | The name of the application context object. |
| o | Object | An object to inject dependencies into. |
| Type | Summary |
|---|---|
| ArgumentNullOrEmptyException | Thrown when name is null or empty. |
| ArgumentNullException | Thrown when o is null. |
| NoSuchObjectException | Thrown when there are no object for the given name. |
| DependencyInjectionException | Thrown when an error occurs while injecting dependencies. |
Inject dependencies into o.
protected Void InjectDependencies(cfg, o)
| Name | Type | Summary |
|---|---|---|
| cfg | ObjectConfiguration | Object configuration. |
| o | Object | An object to inject dependencies into. |
| Type | Summary |
|---|---|
| ArgumentNullException | Thrown when any of the arguments is null. |
| DependencyInjectionException | Thrown when an error occurs while injecting dependencies. |
Finds out whether the object for the given name is a singleton.
public Boolean IsSingleton(name)
true if the object is a singleton.
| Name | Type | Summary |
|---|---|---|
| name | String | The name of the object. |
| Type | Summary |
|---|---|
| ArgumentNullOrEmptyException | Thrown when name is null or empty. |
| NoSuchObjectException | Thrown when there are no object for the given name. |
Returns a textual representation of the object factory.
public String ToString()
In this document


{% extends "layout.html" %} {% block body %}
Comparisons are generated by the bassist. They are diffs between a base system and an observed system. The diffs from bassist comparisons are gathered into sets. Click here to assign comparison diffs to sets.
Sets are diffs that are gathered together for a purpose. For example: in configuration management you might specify "install package apache", which installs several packages, installs a new user or group, installs a service, and starts a system process. Click here to view and edit the diffs within sets. {% endblock %}


Please fill in this form to create an account.
Password & Confirm Password does not match.
{{ registerSuccessMsg }}
Already have an account? Login.


In this project, you'll use generative adversarial networks to generate new images of faces.
You'll be using two datasets in this project:
Since the celebA dataset is complex and you're doing GANs in a project for the first time, we want you to test your neural network on MNIST before CelebA. Running the GANs on MNIST will allow you to see how well your model trains sooner.
If you're using FloydHub, set data_dir
to "/input" and use the FloydHub data ID "R5KrjnANiKVhLWAkpXhNBe".
data_dir = './data'
# FloydHub - Use with data ID "R5KrjnANiKVhLWAkpXhNBe"
#data_dir = '/input'
"""
DON'T MODIFY ANYTHING IN THIS CELL
"""
import helper
helper.download_extract('mnist', data_dir)
helper.download_extract('celeba', data_dir)
show_n_images = 25
"""
DON'T MODIFY ANYTHING IN THIS CELL
"""
%matplotlib inline
import os
from glob import glob
from matplotlib import pyplot
mnist_images = helper.get_batch(glob(os.path.join(data_dir, 'mnist/*.jpg'))[:show_n_images], 28, 28, 'L')
pyplot.imshow(helper.images_square_grid(mnist_images, 'L'), cmap='gray')
The CelebFaces Attributes Dataset (CelebA) dataset contains over 200,000 celebrity images with annotations. Since you're going to be generating faces, you won't need the annotations. You can view the first number of examples by changing show_n_images
.
show_n_images = 25
"""
DON'T MODIFY ANYTHING IN THIS CELL
"""
mnist_images = helper.get_batch(glob(os.path.join(data_dir, 'img_align_celeba/*.jpg'))[:show_n_images], 28, 28, 'RGB')
pyplot.imshow(helper.images_square_grid(mnist_images, 'RGB'))
Since the project's main focus is on building the GANs, we'll preprocess the data for you. The values of the MNIST and CelebA dataset will be in the range of -0.5 to 0.5 of 28x28 dimensional images. The CelebA images will be cropped to remove parts of the image that don't include a face, then resized down to 28x28.

You'll build the components necessary to build a GANs by implementing the following functions below:
model_inputs
discriminator
generator
model_loss
model_opt
train
This will check to make sure you have the correct version of TensorFlow and access to a GPU
"""
DON'T MODIFY ANYTHING IN THIS CELL
"""
from distutils.version import LooseVersion
import warnings
import tensorflow as tf
# Check TensorFlow Version
assert LooseVersion(tf.__version__) >= LooseVersion('1.0'), 'Please use TensorFlow version 1.0 or newer. You are using {}'.format(tf.__version__)
print('TensorFlow Version: {}'.format(tf.__version__))
# Check for a GPU
if not tf.test.gpu_device_name():
warnings.warn('No GPU found. Please use a GPU to train your neural network.')
else:
print('Default GPU Device: {}'.format(tf.test.gpu_device_name()))
Implement the model_inputs
function to create TF Placeholders for the Neural Network. It should create the following placeholders:
image_width
, image_height
, and image_channels
.z_dim
.Return the placeholders in the following the tuple (tensor of real input images, tensor of z data)
import problem_unittests as tests
def model_inputs(image_width, image_height, image_channels, z_dim):
"""
Create the model inputs
:param image_width: The input image width
:param image_height: The input image height
:param image_channels: The number of image channels
:param z_dim: The dimension of Z
:return: Tuple of (tensor of real input images, tensor of z data, learning rate)
"""
real_input_images = tf.placeholder(tf.float32, [None, image_width, image_height, image_channels], name='input')
z_data = tf.placeholder(tf.float32, [None, z_dim], name='z')
learning_rate = tf.placeholder(tf.float32, name='learning_rate')
return real_input_images, z_data, learning_rate
"""
DON'T MODIFY ANYTHING IN THIS CELL THAT IS BELOW THIS LINE
"""
tests.test_model_inputs(model_inputs)
Each convolution goes throught the same process of batch_normalization and then a leaky relu
def batch_lrelu(x, alpha=0.1, batch_normalization=True, is_train=True):
if batch_normalization:
temp = tf.layers.batch_normalization(x, training=is_train)
return tf.maximum(alpha * x, x)
else:
return tf.maximum(alpha * x, x)
Implement discriminator
to create a discriminator neural network that discriminates on images
. This function should be able to reuse the variables in the neural network. Use tf.variable_scope
with a scope name of "discriminator" to allow the variables to be reused. The function should return a tuple of (tensor output of the discriminator, tensor logits of the discriminator).
def discriminator(images, reuse=False):
"""
Create the discriminator network
:param images: Tensor of input image(s)
:param reuse: Boolean if the weights should be reused
:return: Tuple of (tensor output of the discriminator, tensor logits of the discriminator)
"""
alpha = 0.2
kernal_size = 5
filters = [64, 128, 256, 512]
with tf.variable_scope('discriminator', reuse=reuse):
c1 = tf.layers.conv2d(images, filters[0], kernal_size, strides=2, padding='same')
c1 = batch_lrelu(c1, batch_normalization=False)
c1 = tf.layers.conv2d(c1, filters[1], kernal_size, strides=2, padding='same')
c1 = batch_lrelu(c1)
c1 = tf.layers.conv2d(c1, filters[2], kernal_size, strides=2, padding='same')
c1 = batch_lrelu(c1)
flat = tf.reshape(c1, [-1, 4 * 4 * filters[2]])
logits = tf.layers.dense(flat, 1)
output = tf.tanh(logits)
return output, logits
"""
DON'T MODIFY ANYTHING IN THIS CELL THAT IS BELOW THIS LINE
"""
tests.test_discriminator(discriminator, tf)
Implement generator
to generate an image using z
. This function should be able to reuse the variables in the neural network. Use tf.variable_scope
with a scope name of "generator" to allow the variables to be reused. The function should return the generated 28 x 28 x out_channel_dim
images.
def generator(z, out_channel_dim, is_train=True):
"""
Create the generator network
:param z: Input z
:param out_channel_dim: The number of channels in the output image
:param is_train: Boolean if generator is being used for training
:return: The tensor output of the generator
"""
kernal_size = 5
filters = [512, 256, 128, 64]
with tf.variable_scope('generator', reuse=not is_train):
h1 = tf.layers.dense(z, 7 * 7 * filters[0])
c1 = tf.reshape(h1, [-1, 7, 7, filters[0]])
c1 = tf.layers.conv2d_transpose(c1, filters[1], 5, strides=2, padding='same')
c1 = batch_lrelu(c1)
c1 = tf.layers.conv2d_transpose(c1, filters[2], 5, strides=2, padding='same')
c1 = batch_lrelu(c1)
logit = tf.layers.conv2d_transpose(c1, out_channel_dim, 5, strides=1, padding='same')
output = tf.tanh(logit)
return output
"""
DON'T MODIFY ANYTHING IN THIS CELL THAT IS BELOW THIS LINE
"""
tests.test_generator(generator, tf)
Implement model_loss
to build the GANs for training and calculate the loss. The function should return a tuple of (discriminator loss, generator loss). Use the following functions you implemented:
discriminator(images, reuse=False)
generator(z, out_channel_dim, is_train=True)
def model_loss(input_real, input_z, out_channel_dim):
"""
Get the loss for the discriminator and generator
:param input_real: Images from the real dataset
:param input_z: Z input
:param out_channel_dim: The number of channels in the output image
:return: A tuple of (discriminator loss, generator loss)
"""
smooth = 0.1
g_model = generator(input_z, out_channel_dim, is_train=True)
d_model_real, d_logits_real = discriminator(input_real, reuse=False)
d_model_fake, d_logits_fake = discriminator(g_model, reuse=True)
d_loss_real = tf.reduce_mean(tf.nn.sigmoid_cross_entropy_with_logits(logits=d_logits_real,
labels=tf.ones_like(d_model_real) * (1 - smooth)))
d_loss_fake = tf.reduce_mean(tf.nn.sigmoid_cross_entropy_with_logits(logits=d_logits_fake,
labels=tf.zeros_like(d_model_fake)))
d_loss = d_loss_real + d_loss_fake
g_loss = tf.reduce_mean(tf.nn.sigmoid_cross_entropy_with_logits(logits=d_logits_fake,
labels=tf.ones_like(d_model_fake)))
return d_loss, g_loss
"""
DON'T MODIFY ANYTHING IN THIS CELL THAT IS BELOW THIS LINE
"""
tests.test_model_loss(model_loss)
Implement model_opt
to create the optimization operations for the GANs. Use tf.trainable_variables
to get all the trainable variables. Filter the variables with names that are in the discriminator and generator scope names. The function should return a tuple of (discriminator training operation, generator training operation).
def model_opt(d_loss, g_loss, learning_rate, beta1):
"""
Get optimization operations
:param d_loss: Discriminator loss Tensor
:param g_loss: Generator loss Tensor
:param learning_rate: Learning Rate Placeholder
:param beta1: The exponential decay rate for the 1st moment in the optimizer
:return: A tuple of (discriminator training operation, generator training operation)
"""
t_vars = tf.trainable_variables()
g_var = [var for var in t_vars if var.name.startswith('generator')]
d_var = [var for var in t_vars if var.name.startswith('discriminator')]
with tf.control_dependencies(tf.get_collection(tf.GraphKeys.UPDATE_OPS)):
g_train = tf.train.AdamOptimizer(learning_rate, beta1=beta1).minimize(g_loss, var_list = g_var)
d_train = tf.train.AdamOptimizer(learning_rate, beta1=beta1).minimize(d_loss, var_list = d_var)
return d_train, g_train
"""
DON'T MODIFY ANYTHING IN THIS CELL THAT IS BELOW THIS LINE
"""
tests.test_model_opt(model_opt, tf)
"""
DON'T MODIFY ANYTHING IN THIS CELL
"""
import numpy as np
def show_generator_output(sess, n_images, input_z, out_channel_dim, image_mode):
"""
Show example output for the generator
:param sess: TensorFlow session
:param n_images: Number of Images to display
:param input_z: Input Z Tensor
:param out_channel_dim: The number of channels in the output image
:param image_mode: The mode to use for images ("RGB" or "L")
"""
cmap = None if image_mode == 'RGB' else 'gray'
z_dim = input_z.get_shape().as_list()[-1]
example_z = np.random.uniform(-1, 1, size=[n_images, z_dim])
samples = sess.run(
generator(input_z, out_channel_dim, False),
feed_dict={input_z: example_z})
images_grid = helper.images_square_grid(samples, image_mode)
pyplot.imshow(images_grid, cmap=cmap)
pyplot.show()
Implement train
to build and train the GANs. Use the following functions you implemented:
model_inputs(image_width, image_height, image_channels, z_dim)
model_loss(input_real, input_z, out_channel_dim)
model_opt(d_loss, g_loss, learning_rate, beta1)
Use the show_generator_output
to show generator
output while you train. Running show_generator_output
for every batch will drastically increase training time and increase the size of the notebook. It's recommended to print the generator
output every 100 batches.
def train(epoch_count, batch_size, z_dim, learning_rate, beta1, get_batches, data_shape, data_image_mode):
"""
Train the GAN
:param epoch_count: Number of epochs
:param batch_size: Batch Size
:param z_dim: Z dimension
:param learning_rate: Learning Rate
:param beta1: The exponential decay rate for the 1st moment in the optimizer
:param get_batches: Function to get batches
:param data_shape: Shape of the data
:param data_image_mode: The image mode to use for images ("RGB" or "L")
"""
_, image_width, image_height, image_channels = data_shape
input_data, z_data, t_lr = model_inputs(image_width, image_height, image_channels, z_dim)
disc_loss, gen_loss = model_loss(input_data, z_data, image_channels)
disc_train, gen_train = model_opt(disc_loss, gen_loss, t_lr, beta1)
steps = 0
losses = {'g_loss': [], 'd_loss': []}
with tf.Session() as sess:
sess.run(tf.global_variables_initializer())
for epoch_i in range(epoch_count):
for batch_images in get_batches(batch_size):
steps += 1
batch_images *= 2
noise_z = np.random.uniform(-1, 1, size=(batch_size, z_dim))
_ = sess.run(disc_train, feed_dict={input_data: batch_images, z_data: noise_z, t_lr: learning_rate})
_ = sess.run(gen_train, feed_dict={input_data: batch_images, z_data: noise_z, t_lr: learning_rate})
if not steps % 10:
training_loss_d = sess.run(disc_loss, feed_dict={input_data: batch_images, z_data: noise_z})
training_loss_g = sess.run(gen_loss, feed_dict={z_data: noise_z})
losses['g_loss'].append(training_loss_g)
losses['d_loss'].append(training_loss_d)
print('Epoch: {} Gen Loss: {:.4f} Disc Loss: {:.4f}'.format(epoch_i, training_loss_g, training_loss_d))
if not steps % 100:
show_generator_output(sess, 5 * 5, z_data, image_channels, image_mode=data_image_mode)
return losses
Test your GANs architecture on MNIST. After 2 epochs, the GANs should be able to generate images that look like handwritten digits. Make sure the loss of the generator is lower than the loss of the discriminator or close to 0.
batch_size = 64
z_dim = 128
learning_rate = 0.0001
beta1 = 0.8
"""
DON'T MODIFY ANYTHING IN THIS CELL THAT IS BELOW THIS LINE
"""
epochs = 2
losses = {}
mnist_dataset = helper.Dataset('mnist', glob(os.path.join(data_dir, 'mnist/*.jpg')))
with tf.Graph().as_default():
losses = train(epochs, batch_size, z_dim, learning_rate, beta1, mnist_dataset.get_batches,
mnist_dataset.shape, mnist_dataset.image_mode)
View of how the generator and discriminator losses change with the batches
pyplot.plot(losses['g_loss'], label='Generator', alpha=0.5)
pyplot.plot(losses['d_loss'], label='Discriminator', alpha=0.5)
pyplot.title('Training Losses')
pyplot.legend()
pyplot.show()
Run your GANs on CelebA. It will take around 20 minutes on the average GPU to run one epoch. You can run the whole epoch or stop when it starts to generate realistic faces.
batch_size = 64
z_dim = 128
learning_rate = 0.0001
beta1 = 0.8
"""
DON'T MODIFY ANYTHING IN THIS CELL THAT IS BELOW THIS LINE
"""
epochs = 1
celeba_dataset = helper.Dataset('celeba', glob(os.path.join(data_dir, 'img_align_celeba/*.jpg')))
with tf.Graph().as_default():
train(epochs, batch_size, z_dim, learning_rate, beta1, celeba_dataset.get_batches,
celeba_dataset.shape, celeba_dataset.image_mode)
When submitting this project, make sure to run all the cells before saving the notebook. Save the notebook file as "dlnd_face_generation.ipynb" and save it as a HTML file under "File" -> "Download as". Include the "helper.py" and "problem_unittests.py" files in your submission.


Django has the most powerful and time saving inbuilt modules for authentication, E-mail sending, admin and a lot more. But there are always two sides of coin, On one hand it seems beneficial to have inbuilt modules but at same time they are quite vexed.
One of the inbuilt feature of django is mail sending feature. Sending email on request of user is one of the beloved feature of web development. Django provides an inbuilt setup for sending mails. We just have to import proper modules and we have to set server for sending mails.
Most of the time we have to sent the mail on the registered User's Email address when User forgets its password. Django send's the mail consisting of a randomly generated token which can be used for one time to reset user's password. But now lets not go further into token generation, lets discuss about how to configure the server to send mail to the User's Email address.
SMTP(Simple Mail Transfer Protocol) is the server that is used to send mail. For setting this server we have to configure it in our settings files. Here is the piece of code that I implemented in my settings/base.py file for SMTP server :-
First of all set the EMAIL_BECKEND variable in settings to "django.core.mail.beckends.smtp.EmailBackend"
#configuring SMTP
EMAIL_USE_TLS = True
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_PORT = 587
EMAIL_HOST_USER = ''
EMAIL_HOST_PASSWORD = ''
DEFAULT_FROM_EMAIL = ''
DEFAULT_TO_EMAIL = 'to email'
Set EMAIL_HOST_USER,PASSWORD to the username and password of the email from which email has to be sent to users. Set the DEFAULT_FROM_MAIL to the email id from which mail has to be sent.
Import send_mail from django.core.mail in views.py. When you set all these configuration then its time to send mail. :P.
How it works?
I am not going into the deep explanation of working but in a nutshell we can say when we send an email, our e-mail client interacts with the SMTP server to handle the sending. Now SMTP will serve the email to the client email server and again through the client email server our client will receive the mail.
That's all regarding SMTP settings,configuration and a little bit of working.
Cheers!!


ORDER CONFIRMATIONORDER NUMBER: _ORDER_NUMBER_ |
|||||||
Dear _BILLNAME_, Thank you for shopping at BeachBunny.com. Changes or cancellations to your order cannot be accepted at this time. For information about returns, see our Exchange Policy |
|||||||
|
|||||||
| _ORDER_DETAIL_ | |||||||
Note:This message was sent to you by _USER_EMAIL_. Your email address will not be added to our mailing list unless you choose to sign up. |


Home
Sales
Store
Orders
Add location store
Store location:
Average sale:
Minimum customers per hour:
Maximum customers per hour:


Over 2300 years ago, in ancient times, a young prince was born in Macedonia. His name was Alexander, Which means defender, or protector of man. He loved the book Iliad by the famous writer Homer While growing up, he was taught by many people, and one of them was the great Aristotle. He was only taught by aristotle for 3 years. He did have other teachers as well, ones that taught him about war and ones that taught him about being a king. He even learned the lyre which is basically a harp. At one point his mother was exiled. It may have been because Alexander aggravated because he had so many marriages. When he was 19 years old his father died. As a teenager, he was known for his exploits on the battlefield.
He was a ruler from 336 B.C. to 323 B.C. During battle, he would lead by example and lead from his army from the front. He reestablished the Corinthian League. When Alexander would conquer an area he would not force the greek religion on the people, instead he would build schools teaching the greek religion. That may seem nice, but he had a darkside, whenever something wouldn't go his way he would flip out, sometimes hiding in his tent for days. Soemtimes he would even murder advisors or friends.
One way he influenced our lives is he included botanists and scientists in his armies to study the lands he conquered. He also named most of the areas he conquered after himself so now some people live in areas that were named after Alexander. This was not from Alexander but the Greeks also influenced what gods we have studied or even believe in. Alexander was even in the Holy Bible which would affect what people study in the bible.
While Alexander's father was alive, he had the goal of expanding Macedona's empire. When he was assassinated, his son Alexander wanted to finish what his dad started, by expanding Macedon. In 335 B.C., one year after his father's death, he successfully conquered the Balkans. Alexander always knew he wanted to conquer the Persian empire, so he gathered his soldiers, and soldiers from his alliance to form a large enough army to conquer the Persian empire. He crossed Asia Minor in 334 B.C. At first, Darius of Persia didn't take Alexander seriously, thinking he had a stronger army. However, Alexander continued to push onward, and Darius finally started to take him seriously and gather an army. The Battle of Granicus occurred in 334 B.C. and the end result was a strong victory for Alexander. To conquer the rest of the Persian Empire he would need to go through Asia Minor, Syria, Gaza, and Egypt before he could conquer the rest of the Perian Empire. As the result of this battle, Asia Minor was now his. As the word of victory spread from town to town, many towns would surrender before the fight would even start. This made it easier for Alexander to conquer more land.
With Persia and Asia Minor in Alexander's control, it was now time for Syria. During this time Alexander fell ill with pneumonia, he did eventually recover and return to battle. This battle was also a very successful one for Alexander. With Syria conquered, it was time for Gaza. In 332 B.C. Alexander, with multiple reinforcements, went to Egypt, but they first had to conquer Gaza if they eventually wanted to go for Egypt. He and his army demolished Gaza. Now he had the chance to conquer all of Egypt one day. Alexander's final conquest ended in India. He arrived there in 327 B.C., but he was only able to partially conquer India. He got to the Ganges River and it was rumored that the army waiting on the other side was more powerful then Alexanders. His men eventually persuaded him to go back home, but it was a harsh way back, he lost many soldiers along the way because of the harsh weather.
After a fierce battle, Alexander the Great died on June 323 B.C. at the age of only 32! Some historians believe that he died of malaria or a natural disease, while others who believe he was poisoned. He also had a very bad drinking problem so his liver might have failed. His last words were “Bury my body, do not build any monument, keep my hands outside so that the world knows the person who won the world had nothing in his hands when dying“. He was covered in honey before being placed into a golden sarcophagus. Then, he was put into a casket. 1 to 2 years later he was taken back to Macedonia when the tomb was redirected to Egypt by the forces of Ptolemy 1. He wanted to be seen as Alexander's successor by taking control of the tomb of Alexander.


You
can
not
drop
here
Drag
and
drop
table
content
with
JavaScript
Table2
and
Drag
drop
table
drop
down
menu
with
JavaScript
Table3
Smile
Clone
(1) Clone
(2) Clone
Trash
Save content of the first table (plain query string)
Save content of the first table (JSON format)
Enable dropping to already taken table cells
Disable dropping to already taken table cells
Switch content
Switching content continuously
Overwrite content
Remove cloned element if dragged outside of any table
Confirm delete
Enable dragging


Click to know more!
Hello Fellas!!
I am a front-end developer, passionate to bring my imagination to reality.
My recent project introduced me to the AWESOME technologies - HTML5, CSS, JavaScript and JQuery. That's when I decided to be a part of this Awesomeness.
I like to explore and do things differently which helps me learn all the more.


Brand identity and website for MASO Fitness, a new personal training and outdoor fitness group in Sydney’s Inner West.


{{words[x]}}
Your Translation is : {{input}}
Translate The Word
Rank 1: RohitFOSS
Rank 2: Sujan
Rank 3: jaggu9945
Rank 4: sheldon@ftps
Rank 5: living_ninja
Rank 6: sanad
Rank 7: brucelee


Accommodation
Conference Rates for Accommodation
Note: Park Village Resort, the conference venue, has provided discounted conference rates. These conference rates are only available for people booking through the Accomodation Registration Form. You can pay the discounted rate at the resort after registering through the link.
Nalanda - Business Deluxe Room
| Single Room | USD 55.00 per night |
| Double Room | USD 65.00 per night |
Cottage AC Wing Room
| Single Room | USD 80.00 per night |
| Double Room | USD 90.00 per night |
AC Super Deluxe Room
| Single room | USD 100.00 per night |
| Double room | USD 110.00 per night |
The above rates include:
- Accommodation for one night
- Buffet breakfast
- Airport transfers from the international airport
- Free use of basket ball court, swimming pool
The room rates are inclusive of applicable taxes.


Compile into Javascript¶
This chapter uses two simple examples to demonstrate how to compile Owl applications into Javascript code so that you can deploy the analytical code into browsers.
Background¶
At first glance, Javascript has very little to do with high-performance scientific computing. Then why Owl cares about it? One important reason is that browser is arguably the most widely deployed technology on various edge devices, e.g. mobile phones, tablets, laptops, and etc. More functionality are being pushed from datacenters to edge for reduced latency, better privacy and security. The Javascript applications running in a browser are getting more complicated and powerful.
Moreover, the engine for executing Javascript is highly optimised even the relatively complicated computational tasks can run with reasonable performance.
Base Library¶
Before we start, you need to know some basic things to understand how Owl is able to support Javascript
Owl system is actually divided to two parts: Base library and Core library. The base library is implemented with pure OCaml so it can be safely compiled into Javascript. Many functionality (e.g. Ndarray) in the base library will be replaced with high-performance C implementation in the Core library.
As you can see, to enable Javascript, we can only use the functions implemented in the Base. You may wonder how much we will be limited by the Base. Fortunately, the most advanced functions in Owl are often implemented in pure OCaml and they live in the Base, which includes e.g. algorithmic differentiation, optimisation, even neural networks and many others.
In this following, I will present how to use Owl_base
in writing Javascript applications using both native OCaml code and Facebook Reason. Both examples are straightforward thanks to the powerful jbuilder.
Use Native OCaml¶
We know that Owl_algodiff_generic
is the cornerstone of Owl’s fast neural network module. The first example uses Algodiff functor to optimise a mathematical function.
The first step is writing down our application in OCaml as follows, then save it into a file demo.ml
(* Javascript example: use Owl_base to minimise sin *)
include Owl_algodiff_generic.Make (Owl_base_dense_ndarray.D)
let rec desc ?(eta=F 0.01) ?(eps=1e-6) f x =
let g = (diff f) x in
if (unpack_flt g) < eps then x
else desc ~eta ~eps f Maths.(x - eta * g)
let _ =
let f = Maths.sin in
let y = desc f (F 0.1) in
Owl_log.info "argmin f(x) = %g" (unpack_flt y)
The code is very simple: the desc
defines a gradient descent algorithm, then we use desc
to calculate the minimum value of Maths.sin
function. In the end, we print out the result using Owl_log
module’s info
function. You should have noticed, we used Owl_algodiff_generic
functor to create and include an algorithmic differentiation module by passing the pure implementation of Ndarray in the base library.
In the second step, we need to create a jbuild file as follows. This file will instruct how the OCaml code will be first compiled into bytecode then converted into javascript by calling js_of_ocaml
.
(jbuild_version 1)
(executables
((libraries (owl_base))
(names (demo))))
(rule
((targets (demo.js))
(action
(run ${bin:js_of_ocaml}
--noruntime ${lib:js_of_ocaml-compiler:runtime.js}
--source-map ${path:demo.bc} -o ${@} --pretty
))))
With these two files in the same folder, you can then simply run the following command in the terminal. The command builds the application and generates a demo.js in _build/default/ folder.
jbuilder build demo.js
In the last, we can run the javascript using Node.js engine.
node _build/default/demo.js
You should be able to see the output result similar to 2018-03-24 16:27:42.368 INFO : argmin f(x) = -1.5708
.
Use Facebook Reason¶
Facebook Reason is gaining its momentum and becoming a popular choice of developing web applications. Because Reason is basically a wrapper of OCaml, it is very straightforward to use Owl library in Reason to develop advanced numerical applications.
In this example, I demonstrate how to use reason code to manipulate multi-dimensional arrays, which is the core data structure in Owl. First, please save the following code into a reason file demo.re. Note the the suffix is .re now.
/* Javascript example: Ndarray and Maths */
open! Owl_base;
/* calculate math functions */
let x = Owl_base_maths.sin(5.);
Owl_log.info("Result is %f", x);
/* create random ndarray then print */
let y = Owl_base_dense_ndarray.D.uniform([|3,4,5|]);
Owl_base_dense_ndarray.D.set(y,[|1,1,1|],1.);
Owl_base_dense_ndarray.D.print(y);
/* take a slice */
let z = Owl_base_dense_ndarray.D.get_slice([[],[],[0,3]],y);
Owl_base_dense_ndarray.D.print(z);
The code above is simple, just creates a random ndarray, takes a slice, then prints them out. Now let’s look at the jbuild file, which turns out to be exactly the same as that in the previous example.
(jbuild_version 1)
(executables
((libraries (owl_base))
(names (demo))))
(rule
((targets (demo.js))
(action
(run ${bin:js_of_ocaml}
--noruntime ${lib:js_of_ocaml-compiler:runtime.js}
--source-map ${path:demo.bc} -o ${@} --pretty
))))
Similarly, you can then compile and run the code with following commands.
jbuilder build demo.js
node _build/default/demo.js
As you can see, except the code is written in different languages, the rest of the steps are identical in both example thanks to the excellent jbuilder.
Future Plan¶
I only presented two simple examples in this Chapter. It is worth noting that Owl_base contains a large amount of advanced functions to allow you write complicated analytical functions including deep neural networks. However, the code above can serve as a template for you to try out different functions.
The javascript code converted by js_of_ocaml
is not readable. On the contrary, BuckleScript is able to compile OCaml code into readable javascript. I am personally very interested in seeing how the complicated numerical functions will look like after BuckleScript converts it into javascript. I will give it a try soon on BuckleScript.
Moreover, I also find it very fascinated by the fact that these advanced analytical apps can be compiled into small, self-contained, cross-platform code and deployed directly in browser. This will be another story about our Zoo System (refer to Scripting and Zoo System) which I will tell in near future.


STM32 Nucleo-64™ Microcontroller Board
Morpho Expansion Board With Arduino Headers
This project is a template for Morpho expansion boards for STM's family of
STM32 Nucleo-64
development boards.
This project includes a PCB edge defined as the same size as the Nucleo-64
mainboard with Morpho and Arduino Uno connectors placed correctly to align the
two boards. The board is cut out to allow access to the reset and user
switches.


Project information
- Category: Web design & developmemt
- Hackathon: Hack APAC by MLH
- Project date: Feb, 2021
- Project URL: https://www.maachmarket.com/
MAACH MARKET a Hackathon project
Inspiration:: The Wuhan marketplace in China was where Covid-19 was first traced. Since the pandemic, traditional public marketplaces have been closed due to excessive overcrowding, lack of social distancing, and the likely spread of Covid-19. This prevented many people from being able to buy fresh fish from the market due to fear of becoming ill especially in places like West Bengal. This is why we came up with the idea of Maach Market! "Maach" means fish in Bengali.
What it does:: Maach Market is a B2C online fish marketplace where users can choose a local fisherman, pick their fish, and get their fish delivered. The goal is to partner with local fishermen in West Bengal and Bangladesh to eliminate the middleman or public marketplace, so users can get their fish directly from the fishermen. We also use a "door-dash" style delivery service where a delivery person picks up the fish from the fisherman, packages it, and delivers it to the user.
Accomplishments that we're proud of:: We're proud to create a way for local fishermen to earn a livelihood on their own. We are also proud of creating a way for users in West Bengal and Bangladesh to purchase fish online without having to go to a traditional marketplace.
What we learned:: We learned that it takes teamwork to get a project finished. Everyone on the team contributed their skills and talents to make this project happen.
What's next for Maach Market:: As for future features, we plan to add a "request for a specific fish" section inside the "choose your fisherman" section so that people can request for fishes from their most trusted fisherman. Moreover, we plan to include a online 24/7 customer service chat box so our customers can receive the best service possible. We really hope to create a successful online business where users can buy their fish directly from local fisherman online. Built With domain.com site123