When facing the question whether _, people may find it difficult to come to an agreement owing to their different experiences and world values. Some argue that _, but others hold a completely opposite view that _.
People who claim that _ believe it is almost impossible to _, if you don't _, because _. However, those who insist on the other attitude believe that people are able to _ and _ with the help of _
After a detailed analysis of this question, it can be concluded that every coin has two sides and _ is no exception. We should be objective when answering the question regarding the impact of _ and pay attention to both sides, because neither of them can be overemphasized. Therefore, it is correct to strike a balance between the two sides rationally when confronting the dilemma.
These days, one of the most controversial topics arousing general concern is _ At present, there is no doubt that _ is getting increasingly popular and playing an increasingly important role in our life.
So far as I'm concerned, I believe that such phenomenon will result in some positive consequences. To begin with the rapid development of Chinese society and economy, _ will be beneficial to our society as a whole. What's more, it is universally acknowledged that a majority of people will enjoy benefits from _ It is report that _ will do good to _ One more point that can't be ignored here is that _ will also be beneficial to our national economy.
What accounts for the increase? In my opinion at least three factors contribute to such phenomenon. To begin with, the changes are closely related to the rising income of the Chinese. With their living standard steadily going up, they have adequate extra money to afford to _. More importantly, the changes have a lot to do with the turning of the people's attitudes and outlook on life. Finally, the changes are enhanced and promoted by the government's favorable policy in the _ field.
Taking all these factors into consideration, we may reasonably predict that with the rapid and further development of technology, the number of people who _ will continue to climb in the forthcoming years. Therefore, we can safely come to the conclusion that this trend will continue in the future, for it is beneficial not only to individuals but also to the countries.
With the quick improvement of social economy and technology and the rapid development of industry, a growing number of people are coming to realize that the negative influence of _ in our daily life is becoming increasingly obvious. Therefore, how to solve this problem has become a big concern.
As far as I am concerned, some driving factors that contributes to the above-mentioned problem maybe summarized as follows. First of all, _ are not aware of the importance of _. It is reported that _. In addition, lack of _ also gives rise to such shameful phenomenon. Last but not least, the _ contributes significantly to _.
Considering the possible negative aspects of the phenomenon, we may come up with some tentative suggestions as follows.  In addition, _ should restrain themselves and should be educated to be more conscious of the importance of _. Only in these ways, I firmly believe, can such phenomenon be terminated or reduced in the future.


Иever Ending RolePlay
TeamSpeak Server IP:
TeamSpeak Kanal:
Plugin Status:
Plugin Version:
TokoVoip by Itokoyamato (tokovoip.nerp.online)


{% extends "layout_bsa.html" %} {% block page_title %} Help paying for NHS Costs prototype {% endblock %} {% block content %} Back This section is Personal details {% if thirdparty %} What is {{firstname}}'s date of birth? {% else %} What is your date of birth? {% endif %} For example, 31 07 1980 Day Month Year {% endblock %}
This section is Personal details
For example, 31 07 1980


2 Week Project, Nov 2017
Demonstrate Albers Color Principle through an interactive or animated experience.
For my Color and Composition class, I was given 2 weeks to create something that demonstrates Albers' color principle.
The illusion of a single color appearing to be different depending on its background is the underlying theme of the principle. My task was to showcase this illusion through an interaction or motion.


Usage
- HTML5 provides forms for collecting information from users.
- Examples
- Registrations forms
- Giving feedback
- Search functionality
- Posting comments
Building blocks
- There are several types of form controls that you can use to collect information from visitors to your site.
Process flow
- A user fills in a form and then presses a button to submit the information to the server.
Process flow
- The name of each form control is sent to the server along with the value the user enters or selects.
- The server processes the information using a programming language such as PHP, C#, VB.net, or Java. It may also store the information in a database.
- The server creates a new page to send back to the browser based on the information received.
Processing forms on the server
- A form may have several form controls, each gathering different information.
- The server needs to know which piece of inputted data corresponds with which form element.
- Name and id attributes
- Not always done in example code to save space.
- Name is used as identifier of input when a form is posted back to the server.
- ID is used by JavaScript, CSS, internal links, ...
- Best practice: set name and id attribute to same identifier.
Basic form construction
- A form is defined by a form element
<form method="post" action="myformhandler.php" id="myfeedbackform">

</form>
- Attribute
method
specifies how the form's data is sent to the web server.
- We will come back to this later
- The
action
attribute of the form element specifies the script to which the form data will be sent.
- The
id
attribute is used to identify the form distinctly from other elements on the page
Populating forms with input controls
- The
<input>
element is used to create several different form controls. The value of the type attribute determines what kind of input they will be creating.
- Examples: hidden, text, password, checkbox, radio, submit, reset, ...
Text input
- Used for a single line of text such as address or name.
- The label element provides users with information about the input element's purpose.
<form method="post" action="myformhandler.php" id="myfeedbackform">

Please state your name:
<input type="text" placeholder="firstname lastname"
id="firstnamelastname" name="firstnamelastname" maxlength="25">

</form>
name
identifies the form control
maxlength
limits the number of characters a user may enter
placeholder
shows a temporary text in the text field (not default value!).
Password input
- When the type attribute has a value of
password
it creates a text box that acts just like a single-line text input, except the characters are blocked out.
- Although the password is hidden on the screen, this does not mean that the data in a password control is sent securely to the server. You should never use these for sending sensitive data such as credit card numbers.
<form method="post" action="myformhandler.php" id="myfeedbackform">

Please enter your password:
<input type="password" placeholder="password"
id="password" name="password">

</form>
Textarea
- The
textarea
element is used to create a multi-line text input.
- Unlike other input elements this is not an empty element. It should therefore have an opening and a closing tag.
- Use CSS to control the width and height of a textarea element.
- Older forms used the
cols
and rows
attributes
<form method="post" action="myformhandler.php" id="myfeedbackform">

Enter your comments here
<textarea name="comments" id="comments">...</textarea>

</form>
Radio buttons
- Radio buttons allow users to pick just one of a number of options.
<form method="post" action="myformhandler.php" id="myfeedbackform">

Please select your favorite action hero:
<input type="radio" value="rambo"
id="hero_rambo" name="hero" checked="checked">Rambo
<input type="radio" value="madmax"
id="hero_mm" name="hero">Mad Max
<input type="radio" value="bugsbunny"
id="hero_bb" name="hero">Bugs Bunny

</form>
Radio buttons
name
the value of the name attribute should be the same for all of the radio buttons used in a group
value
indicates the value that is sent to the server for the selected option. The value of each of the buttons in a group should be different (so that the server knows which option the user has selected).
checked
can be used to indicate which value (if any) should be selected when the page loads. The value of this attribute is checked. Only one radio button in a group should use this attribute.
Checkboxes
- Checkboxes allow users to select (and unselect) one or more options in answer to a question.
- Similar to radio buttons
- Checked attribute can also be used
- Names should be same and values should be different
<form method="post" action="myformhandler.php" id="myfeedbackform">

What programming languages do you know:
<input type="checkbox" value="C"
id="prog_c" name="proglang">C
<input type="checkbox" value="Cpp"
id="prog_cpp" name="proglang">C++
<input type="checkbox" value="Csharp"
id="prog_csharp" name="proglang">CSharp

</form>
Drop down list box
- A drop down list box (also known as a select box) allows users to select one option from a drop down list.
- The
select
element is used to create a drop down list box. It contains two or more option
elements.
<form method="post" action="myformhandler.php" id="myfeedbackform">

Please select your favorite music:
<select name="music" id="music">
<option value="heavymetal"
selected="selected">Heavy Metal</option>
<option value="blackmetal"
selected="selected">Black Metal</option>
<option value="othermetal"
selected="selected">Other Metal</option>
</select>

</form>
selected
can be used to indicate the option that should be selected when the page loads.
Submitting your form
- When the submit button is pressed, the form's data is sent to the location specified in the form's action attribute.
<form method="post" action="myformhandler.php" id="myfeedbackform">
<input type="submit" name="submit" value="Submit your comment" />
</form>
value
controls the text that appears on the button.
Lets take a look
- Lets take a look at what we've already got
- Show Me
Explore
- Many other controls are available (even more since HTML5)
- Multiple selection box
- File input
- Reset and Image button
- Date input
- Email and URL input
- Color input
- ....
- Explore them for yourself
- Not all are supported by all browsers (yet)


SCREAM 2
A Film Review by James Berardinelli
RATING: *** OUT OF ****
United States, 1997 U.S. Release Date: 12/12/97 (wide) Running Length: 2:00 MPAA Classification: R (Violence, gore, profanity) Theatrical Aspect Ratio: 2.35:1
Cast: Neve Campbell, Courtney Cox, David Arquette, Jamie Kennedy, Liev Schreiber, Jada Pinkett, Sarah Michelle Gellar, Laurie Metcalf, Omar Epps, Jerry O'Connell, Timothy Olyphant Director: Wes Craven Producers: Cathy Konrad, Marianne Maddalena Screenplay: Kevin Williamson Cinematography: Peter Deming Music: Marco Beltrami, Danny Elfman ("Cassandra") U.S. Distributor: Dimension Films
SCREAM 2 isn't quite as clever as its predecessor, but it fills the gap with a cutting wit. Death -- even gruesome, bloody death -- can be funny if handled the right way (some will be offended by this statement, but you need look no further than PULP FICTION for an example). And, while there's plenty of horror to go around in SCREAM 2, the latest '90s slasher flick incarnation, there are also a few laughs to be had. SCREAM 2 is a slice-and-dice movie for those who don't take their horror too seriously.
The success of the original SCREAM took everyone in the industry by surprise. The unexpected blockbuster, whose gross soared over the $100 million mark during its six month release window, opened just about a year ago and turned into one of the most profitable horror films of all time. A sequel was inevitable; fortunately, nearly the entire creative team has returned for SCREAM 2, including director Wes Craven, screenwriter Kevin Williamson, and actors Neve Campbell, Courtney Cox, David Arquette, Jamie Kennedy, and Liev Schreiber.
As stipulated by one of the "rules of sequels" uttered by a movie- obsessed character in the film, the body count in SCREAM 2 is higher than that in the original. Paradoxically, there's a lot less gore. There is blood, of course, but nothing excessive by slasher-movie standards, and there are no depictions of spilled entrails. Craven has remembered that scares are more important that graphic displays of human insides and bodily fluids. A second strength of SCREAM 2 is that it features a gallery of legitimate characters rather than a group of cardboard cut-out stereotypes lined up for slaughter. After all, we've known some of these people for two movies -- it's almost impossible not to care about them at least a little.
SCREAM 2 opens approximately two years after the original. As in the first picture, there's a slick, self-mocking prologue. This time, the victims are Jada Pinkett and Omar Epps, whose characters are visiting a local theater for a preview screening of the movie STAB (which is based on the "true life" events of SCREAM). Some of the smartest dialogue comes during this sequence as Pinkett bemoans the lack of African American participation in horror films (it's surely no coincidence that, in addition to Pinkett and Epps, SCREAM 2 features two black characters). Shortly thereafter, she and her boyfriend have been gutted, signaling the beginning of a series of copycat murders.
Craven lets loose a burst of tongue-in-cheek creativity for the "movie within a movie" sequences. They give him an opportunity to openly parody SCREAM -- an act that he accomplishes with great panache. STAB features Heather Graham in the "Casey Becker" role (played in the original by Drew Barrymore) and Tori Spelling as "Sidney Prescott" (Neve Campbell). Sadly, we only see a couple of scenes from STAB. It would have been a little more fun, I think, had Craven used Joe Dante's approach from MATINEE and shown lengthy excerpts from his satirical production.
Following the prologue, we are re-introduced to Sidney Prescott, who has left her sleepy hometown to go to Windsor College. Her friend Randy (Jamie Kennedy) is a student there as well, and he's just as knowledgeable about horror films as ever. Once the double murder at STAB becomes big news, the media converges on Windsor, looking to interview the original victim. At the head of the flock of vultures is Gale Weathers (Courtney Cox), who has a little surprise for Sidney. She has brought Cotton Weary (Liev Schreiber), the man Sidney falsely accused of murder, with her. Also arriving at the college is Deputy Dewey (David Arquette), who is there to act as a big brother to Sidney during this latest round of tribulations.
In addition to the survivors from the original SCREAM, the field of potential victims is well-populated. There's a blond co-ed named Cece (Sarah Michelle Gellar, who has now appeared in two of Williamson's movies -- this one and I KNOW WHAT YOU DID LAST SUMMER); Sidney's requisite boyfriend, Derek (Jerry O'Connell); a local newswoman (Laurie Metcalf); Gale's new cameraman (Duane Martin); a British drama teacher (David Warner); and several sorority sisters and would-be sorority sisters (Portia De Rossi, Rebecca Gayheart, Elise Neal, Marisol Nichols). Ultimately, there are lots of attractive corpses.
From the STAB scenes to lines like "Brothers don't last long in situations like this," Craven and Williamson are clearly having a lot of fun with SCREAM 2, and the movie is enjoyable, if a little overlong (the livelier first hour is better than the second). Their resolution to the obligatory "whodunit?" is less of a letdown than it could be, and knowingly offers a wink and nod at past unmasking scenes. ("Nice twist," quips the killer. "Didn't see it coming, didya?") One senses, however, that, by the end of this picture, the overall concept of a hip, self-referential slasher film has been played out. Supposedly, there's going to be a SCREAM 3, but, if the film makers don't come up with something radical, we could end up with a classic case of sequel overkill.
Copyright 1997 James Berardinelli
- James Berardinelli e-mail<EMAIL_ADDRESS>Now with more than 1300 reviews... The ReelViews web site: http://movie-reviews.colossus.net/
"No art passes our conscience in the way film does, and goes directly to our feelings, deep down into the dark rooms of our souls"
- Ingmar Bergman
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


C boilerplate code, to be used as seeds for my C projects - doom/ceeds
jl777c02-Jul-19 07:15 PM
the daemon side will be there in all the nodes
thanks, ceeds seems handy
Slyris02-Jul-19 07:16 PM
It's my best friend C library
is an expert
He write this library to have some usefull container in C
and dropping C++
so you have basis : string, vector, map, set etc
binary_heap, bitmanip
jl777c02-Jul-19 07:18 PM
i will just write the reference and get it working. after that we can worry about making it pure C, porting to java, etc.
Slyris02-Jul-19 07:19 PM
Yes, great
jl777c02-Jul-19 07:19 PM
i think with the NSPV_INFO, UTXOS, NTZS, NTZPROOF, TXPROOF query messages, that will allow a client to have all the data needed to create and sign rawtransactions
but pretty sure some of the structures will need tweaking, at least they should be reasonably close
there is a rate limit per peer built in, so the nSPV client needs to make sure it doesnt go too fast or it just wastes query
Slyris02-Jul-19 07:20 PM
Yes i just link you this code to have an idea
We need to make a measurement for the performance of nSPV no ?(edited)
jl777c02-Jul-19 07:21 PM
so, get basic chain info, get a list of all your utxo. for each utxo, find the before/after notarizations. then aggregate the data and make requests for the notarization proofs, along with txproofs
that gets all the data needed to validate the rawtx, blockheaders and you can create transactions ready to spend. though it doesnt deal with mempool, it is a good practical first iteration
i think the limit for nSPV will be the number of peer connections per full node. it isnt bandwidth intensive
we can definitely stress test things to see what sort of multiplier each full node can get, i estimate at least 1000x, if not 10000x
Slyris02-Jul-19 07:23 PM
Yes stress test will be usefull here(edited)
jl777c02-Jul-19 07:24 PM
aha! i can just add any txid in the mempool to the UTXOS query
Slyris02-Jul-19 07:24 PM
How much number peer of connections did you expect
jl777c02-Jul-19 07:24 PM
the default caps to 155 or something like that.
so we will need to tweak the networking limits a bit
Slyris02-Jul-19 07:25 PM
hmm, seem's fair
jl777c02-Jul-19 07:26 PM
currently, i think all peers are counted the same. we need to allow much higher numbers of nSPV peers
Slyris02-Jul-19 07:27 PM
what the mean of the n in nSPV ?
jl777c02-Jul-19 07:27 PM
notarized SPV
Slyris02-Jul-19 07:27 PM
Of course
Since is all based on notarization
dpow is an incredible consensus man
i'm impressed.
jl777c02-Jul-19 07:30 PM
now that the p2p networking is basically working, (i have a testnet doing request/response with stub messages) i just need to connect it to the actual rpc functionality and then the cli nSPV client would be able to return notarized balance, list of utxo and their values. Given that using normal createrawtransaction and signrawtransaction, sendrawtransaction, you can construct sends. since all the actual nSPV clients will be doing their own local signing, probably no need to do much fancy operations, maybe a nSPVsend rpc call to just simplify the rawtx stuff
then with a working reference nSPV client and a working set of full nodes deployed, validating other nSPV implementations becomes much much easier
Slyris02-Jul-19 07:31 PM
You will add an optional parameters in those rpc call ?
Specifying nSPV ?
jl777c02-Jul-19 07:31 PM
i will make a special nSPVsend that will work similar to sendtoaddress
but it will only work in nSPV=1 nodes
Slyris02-Jul-19 07:31 PM
so a new rpc call
ok i get it
jl777c02-Jul-19 07:31 PM
yes, much better to keep things separated
Slyris02-Jul-19 07:32 PM
Yeah, it's better actually
jl777c02-Jul-19 07:33 PM
i think there will only be a few rpc calls, will know more when i put it all together, but something like nSPVlogin and nSPVbalance,maybe nSPVhistory, nSPVsend, nSPVtxinfo
nothing will be saved to disk
Slyris02-Jul-19 07:35 PM
you will push in the same branch ?
jl777c02-Jul-19 07:35 PM
yes, it will all go into nSPV branch
Slyris02-Jul-19 07:35 PM
Ok
i will follow the code update
jl777c02-Jul-19 07:36 PM
i am aiming for a working cli nSPV wallet by this weekend
1
Slyris02-Jul-19 07:37 PM
nSPV will distrupt the blockchain industry, lot of people don't know yet
But it's a huge improvement...
jl777c02-Jul-19 07:37 PM
3 to 5 seconds from start to being able to send a valid tx
basically a stateless wallet tech as it is fast enough to reinitialize everything with each login
if you have 10,000 utxo, that will take a long time with just one full node, but once there are 100+ fullnodes, it would initialize in a couple minutes
and 10,000 utxo is just too many, most wallets will just have a few utxo
Slyris02-Jul-19 07:40 PM
you are right
jl777c02-Jul-19 09:05 PM
i verified that nSPV capable full nodes and normal can coexist. nSPV client nodes will just reject any full node or other client node
this means we can test with existing coin p2p networks, without any hardfork
1
jl777c03-Jul-19 02:32 PM
@TonyL latest version is working, at least the nSPV client requests blockchain info and addressutxos info. inadvertently i had an address with 12,000+ utxo, but it seemed to work nearly instantly
i have serialization/deserialization done for all the initial structs, which i think will get us 90%+ of the way to a working cli nSPV wallet
which is the next step, to add rpc calls for basic wallet functions
at first it will work as api wallet and not bother with merkle validations, but with all the data available, it would just be a matter of adding the checks to make it secure
allbits03-Jul-19 03:23 PM
When you get the working nSPV cli wallet, is that something a noob like me could test?
jl777c03-Jul-19 03:31 PM
yes
the commands will be very limited
login, getbalance, send
allbits03-Jul-19 03:46 PM
Cool :)
SPV wallets are far more secure than API lite wallets, right?
jl777c03-Jul-19 03:53 PM
yes
nSPV wallet is basically the same security level as a full node
the only issue is that it needs to poll random nodes to find out what utxo it has, but if you track that locally, there is no need to rely on external nodes
allbits03-Jul-19 04:03 PM
Thanks
Mylo03-Jul-19 05:19 PM
how will nodes allow nSPV clients to connect? is it a different RPC interface?
or is it http? sorry for noob q
jl777c03-Jul-19 05:38 PM
new p2p messages
it is already coded to allow the nSPV capable nodes to be mixed with older nodes. no hardfork needed
existing coin network will support the nSPV nodes
look into normal headers sync SPV clients
jl777c03-Jul-19 05:54 PM
@Slyris the p2p networking is testing out well, i got all the (de)serialization coded for all the structures and the fullnode side is 99% done with setting them, even validated two of the messages is going from client -> fullnode -> client and the data seems reasonable. next will be to properly request all the messages from the client side and writing a simple wallet rpc -> client side code.
on track for simple reference cli wallet by the weekend, probably wont get all the merkle validation done as that is tricky, but at least the data will be flowing from fullnode to superlite, so we can get bandwidth loading tests
its up to 1000 lines of code though... probably a few bugs crept in, but when i validate the data client side i should find most all of those issues. i did remove the internal usage of std::vector and just made it allocated/freed
Slyris03-Jul-19 06:27 PM
i will look at it thank's @jl777c
Slyris03-Jul-19 06:36 PM
@jl777c You have to much verification that a pointer is not null for free
Possible Duplicate:
Does free(ptr) where ptr is NULL corrupt memory?
I'm writing a C function that frees a pointer if it was malloc()ed. The pointer can either be NULL (in the case that an error


Andrew Buddenberg
Adventures in software engineering @
CICS-NC
Essential Climate Variable Inventories
Otis asked me to create a database of some survey results for John Bates...
Essential Climate Variable Inventories
do some analysis...
Essential Climate Variable Inventories
...and present the results at the CDR meeting.
Essential Climate Variable Inventories
And I decided to try something new in the process
High Performance Computing
You may have noticed that the cluster's been a little unstable lately...
High Performance Computing
Concurrent file access bottleneck in StorNext...
High Performance Computing
Race condition in OpenLava 2.2 MPI job allocation
Metadata
Released gcis-py-client 1.1...
Metadata
...and used it to good effect for the health assessment
Metadata
GDAS also coming along nicely
Sharepoint and MS Office
If we're stuck writing papers in Word, let's do it properly
Real-time collaboration (like Google Docs)
Version control built in
Workflow support
File locking
Sharepoint and MS Office
Sharepoint and MS Office
Office 2011 corrupts documents in Sharepoint...
Sharepoint and MS Office
...and Office 2016 is annoying
:wq


| Date | Location | Opponent | Result |
| Oct 11 | Shelby Twp, MI | Miami (OH) | Won 7-6 |
| Oct 12 | Shelby Twp, MI | Grand Valley State | Won 7-2 |
| Nov 8 | Homer Glen, IL | Purdue | Won 9-2 |
| Nov 8 | Homer Glen, IL | Grand Valley State | Won 9-5 |
| Nov 9 | Homer Glen, IL | Michigan State White | Won 15-2 |
| Nov 22 | West Bloomfield, MI | Michigan Tech | Won 9-0 |
| Nov 22 | West Bloomfield, MI | Grand Valley State | Won 9-1 |
| Nov 23 | West Bloomfield, MI | Akron | Won 14-3 |
| Nov 23 | West Bloomfield, MI | Michigan State White | Won 9-3 |


Class: Rack::CommonLogger
| Relationships & Source Files | |
| Inherits: | Object |
| Defined in: | lib/rack/common_logger.rb |
Overview
CommonLogger
forwards every request to the given app
, and logs a line in the Apache common log format to the configured logger.
Constant Summary
-
FORMAT =
# File 'lib/rack/common_logger.rb', line 23
Common Log Format: httpd.apache.org/docs/1.3/logs.html#common
lilith.local - - [07/Aug/2006 23:58:02 -0400] "GET / HTTP/1.1" 500 - %{%s - %s [%s] "%s %s%s %s" %d %s\n} %
The actual format is slightly different than the above due to the separation of SCRIPT_NAME and PATH_INFO, and because the elapsed time in seconds is included at the end.
%{%s - %s [%s] "%s %s%s%s %s" %d %s %0.4f\n}
Class Method Summary
-
.new(app, logger = nil) ⇒ CommonLogger
constructor
logger
can be any object that supports thewrite
or<<
methods, which includes the standard libraryLogger
.
Instance Method Summary
-
#call(env)
Log all requests in common_log format after a response has been returned.
-
#extract_content_length(headers)
private
Attempt to determine the content length for the response to include it in the logged data.
-
#log(env, status, response_headers, began_at)
private
Log the request to the configured logger.
Constructor Details
.new(app, logger = nil) ⇒ CommonLogger
logger
can be any object that supports the write
or <<
methods, which includes the standard library Logger
. These methods are called with a single string argument, the log message. If logger
is nil, CommonLogger
will fall back env['rack.errors']
.
# File 'lib/rack/common_logger.rb', line 29
def initialize(app, logger = nil) @app = app @logger = logger end
Instance Method Details
#call(env)
Log all requests in common_log format after a response has been returned. Note that if the app raises an exception, the request will not be logged, so if exception handling middleware are used, they should be loaded after this middleware. Additionally, because the logging happens after the request body has been fully sent, any exceptions raised during the sending of the response body will cause the request not to be logged.
# File 'lib/rack/common_logger.rb', line 41
def call(env) began_at = Utils.clock_time status, headers, body = response = @app.call(env) response[2] = BodyProxy.new(body) { log(env, status, headers, began_at) } response end
#extract_content_length(headers) (private)
Attempt to determine the content length for the response to include it in the logged data.
# File 'lib/rack/common_logger.rb', line 83
def extract_content_length(headers) value = headers[CONTENT_LENGTH] !value || value.to_s == '0' ? '-' : value end
#log(env, status, response_headers, began_at) (private)
Log the request to the configured logger.
# File 'lib/rack/common_logger.rb', line 52
def log(env, status, response_headers, began_at) request = Rack::Request.new(env) length = extract_content_length(response_headers) msg = sprintf(FORMAT, request.ip || "-", request.get_header("REMOTE_USER") || "-", Time.now.strftime("%d/%b/%Y:%H:%M:%S %z"), request.request_method, request.script_name, request.path_info, request.query_string.empty? ? "" : "?#{request.query_string}", request.get_header(SERVER_PROTOCOL), status.to_s[0..3], length, Utils.clock_time - began_at) msg.gsub!(/[^[:print:]\n]/) { |c| sprintf("\\x%x", c.ord) } logger = @logger || request.get_header(RACK_ERRORS) # Standard library logger doesn't support write but it supports << which actually # calls to write on the log device without formatting if logger.respond_to?(:write) logger.write(msg) else logger << msg end end


Thymeleaf - Bootstrap Slider
Home
(current)
About
Services
Contact
Programming skills
JAVA:
1
CSS:
1
Angular:
1
Python:
1
React:
1
Go:
1
Submit form


Github's Gists are a really nice tool to store all sorts of things. Draft is a simple, distraction free view layer for gists.
Yep.
Tweet me (I am @tobiasherber_).
herber/draft


name: inverse layout: true class: center, middle, inverse --- # STAT 105: Lecture 4 ## Chapter 2: Data Collection ### and ## Chapter 3: Elementary Descriptive Statistics .footnote[Course page: [imouzon.github.io/stat105](https://imouzon.github.io/stat105)] --- # Recap ##Section 2.3: Principles of Effective Experimentation --- layout:false .left-column[ ## Recap ### Terms ] .right-column[ We described an ideal simple experiment and defined terms associated with one (2.3.1, 2.3.2) - response, managed variable, controlled variable, experimental variable, concomitant variable, extraneous variable, blocking variable, and randomization We discussed the importance of **Comparative studies** (2.3.3) - there are many things that we can not control when we make measurements and collect data - when we want to compare a new method to a previous method, we need to be aware that the uncontrolled circumstances that existed when we studied the previous method do not exist anymore - in order to *know* that differences in results are the result of the method used (and not the difference in the circumstances) we must collect new data on both methods ] --- layout:false .left-column[ ## Recap ### Terms ### Extraneous Variables ] .right-column[ ### Dealing With Extraneous Variables Some aspects of the environment can not be controlled, even though they may effect the results we see. We call those aspects **extraneous variables**. Though we can not *control* extraneous variables, we can plan our experiment to minimize their impact (2.3.2, 2.3.4) **blocking** - the process of arranging the experiment so that results from different methods are collected in similar environments - with blocking, we can compare methods in multiple environments ] --- layout:false .left-column[ ## Recap ### Terms ### Extraneous Variables ] .right-column[ ### Dealing With Extraneous Variables, cont. **randomization** - the process of randomly assigning experimental units to experimental conditions *not already controlled by the specification of the supervised variables* - we hope to remove any pattern that the extraneous variables may have - Weight lifting example: 50 pound, 40 pound, 30 pound dumb bell, 100 lifts each, determining which is harder to lift by how much you strain ] --- layout:false .left-column[ ## Recap ### Terms ### Extraneous Variables ] .right-column[ ### Dealing With Extraneous Variables, cont. **Replication** - the process of repeating a run of the experiment more than once - the results I get on the first run should be similar to the results I get on the second run - replication is strongly connected to the concept of reproducibility - the results I get should be similar to the results you get ### Summary The main point is this: an effective experiment is designed to account for the environmental conditions that could influence our response. Doing this takes a lot of planning. ] --- name: inverse layout: true class: center, middle, inverse --- # Section 2.4 ## Some Common Experimental Plans --- layout:false .left-column[ ## Recap ## Experimental Plans ### Completely Randomized ] .right-column[ With **replication**, **randomization**, **blocking** we have introduced some common elements used in planning an experiment. Common combinations of these elements make up "skeleton" experiments around which we can build our real-life experiments. **Completely Randomized Experiments** - All experimental variables are of primary interest (no controls, no blocking) - Randomization used at every possible point where we choose how to treat the experimental units **Examples** - Example 12 (page 51): Golf ball drive distances study by G.Gronberg - 10 balls each at 3 different compressions (80, 90, and 100) - How would you design an experiment to determine which type can be driven the furthest? - Example 13 (page 51-52): Pelletizing experiment ] --- layout:false .left-column[ ## Recap ## Experimental Plans ### Completely Randomized ### RCB ] .right-column[ **Randomized Complete Block Experiments** - At least on factor is a blocking variable - "Blocks" are created by combinations of the levels of the blocking variables - Within each block, every combination of the primary experimental variables are used at least once - Randomization is used where possible **Examples** - Example 12 (page 51): Golf ball drive distances study by G.Gronberg - Gronberg didn't drive the golf balls all at the same time - instead, he personally drove 10 golf balls from each compression each night, 6 nights a week, for 3 weeks. ] --- layout:false .left-column[ ## Recap ## Experimental Plans ### Completely Randomized ### RCB ### RIB ] .right-column[ **Randomized Incomplete Block Experiments** - At least on factor is a blocking variable - "Blocks" are created by combinations of the levels of the blocking variables - Within each block, some combinations (but not all) of the primary experimental variables are used at least once while others are not used at all - Randomization is used where possible **How does this work??** - There are some clever ways to assign the combinations of the primary experimental variable levels to the blocks that allow us to get "more" out of the data we collect. - How these block assignments come about gets explained in Chapter 8. ] --- name: inverse layout: true class: center, middle, inverse --- # Section 2.5 ## Preparing to Collect Engineering Data ### Read Independently --- name: inverse layout: true class: center, middle, inverse --- # Your Turn ## Drill Bits Experiment --- layout:false
A Simple Experiment
One step in manufacturing a simple product involves drilling holes in a piece of metal. The bits used in this process are expensive and eventually wear out. Fortunately there are three brands that could be used. We would like to determine which brand is the most wear resistant. We will do this generally, by drilling a bunch of holes in pieces of sheet metal and then checking the bit to see how much wear there is. --- layout:false
A Simple Experiment
Here are our available resources: - 15 bits from each brand (brand 1, brand 2, and brand 3) - as many sheets of metal as we **need** (each sheet can be drilled up to 10000 times) - up to 3 mechanics to drill the holes The floor manager has given us the following input: - It takes about 500 presses for the drill bits to begin to reveal how they will wear - No two sheets of metal are exactly the same - the thickness varies slightly across each sheet - No two workers drill the same - though they have been instructed to be as consistent as possible - This process can be completed in one day ### Your Task Fully describe an experiment that could be put into practice. Describe any blocking, randomization, and repetition. --- # Chapter 3 ## Elementary Descriptive Statistics --- # Section 3.1 ## Elementary Graphical and Tabular Treatment ## of ## Quantitative Data ---


China's state council appoints new police chief in Hong Kong
SHANGHAI (Reuters) - China’s state council, or cabinet, has appointed Tang Ping-keung, also known as Chris Tang, as the new police chief of Hong Kong, state news agency Xinhua said.
The appointment follows the retirement of Stephen Lo from the position. It comes as police in the Asian financial hub clash with protesters in pro-democracy demonstrations that have run for months.


{{norefs|date=May 2010}} {{Chinese|s=烧烤酱|t=燒烤醬|j=siu1 haau1 zoeng3|p=shāokǎo jiàng|l=barbecue sauce}} Siu haau sauce is the primary barbecue sauce used in Chinese and Cantonese cuisine. It is used during the barbecue-cooking process as opposed to a flavoring sauce after the food is made.
Siu haau sauce is not used for siu mei rotisserie style cooking; dishes such as char siu each have their own sauce.
{{portal|Food}}
{{Barbecue sauces}}
{{condiment-stub}} {{China-cuisine-stub}}


How to enable JavaScript
Most modern browsers enable JavaScript by default. However, here's an overview of how to enable/disable JavaScript if required.
To view webpages with JavaScript, you need to ensure your browser has JavaScript enabled. Generally speaking, you can still view the webpage without JavaScript, but you will not be able to take advantage of the JavaScript functionality.
When testing any web page that you develop, it's a good idea to disable JavaScript periodically to see how the page appears and behaves without JavaScript. This will show you how it will be displayed to users with JavaScript disabled.
However, to test that the actual JavaScript code works properly, you will need to ensure that it's enabled.
How do I check if my browser has JavaScript enabled?
You normally do this by checking your browser's options/preferences/settings. This will depend on the browser you're using. Instructions for some of the more common browsers are below:
Mozilla Firefox
- Type about:config into the address bar
- Click I'll be careful, I promise
- Using the search bar at the top, search for javascript.enabled. This should return the entry you're looking for.
- Right-click on javascript.enabled and select Toggle. You can also double-click it if you prefer.
Google Chrome
- Go to Chrome from the top menu
- Select Preferences...
- Click on Show advanced settings... Click on Content Settings...
- Ensure that the Allow all sites to run JavaScript (recommended) option is selected
- Click OK
Apple Safari
- Go to Safari from the top menu
- Select Preferences
- Select Security
- Ensure that the Enable JavaScript option is checked
- Click OK
Opera
- Go to Opera from the top menu
- Select Preferences
- Select Websites from the left menu bar
- Ensure that Allow all sites to run JavaScript (recommended) is checked
Internet Explorer
- Go to Tools from the top menu
- Select Internet Options
- Click on the Security tab
- Ensure that the Internet zone is selected
- Click Custom Level
- Scroll down until you see the Scripting section
- Ensure that the Active Scripting option is set at Enable
- When the Warning! window asks Are you sure you want to change the settings for this zone? click Yes
Microsoft Edge
For Microsoft Edge on Windows 10, you need to disable JavaScript from the Windows Group Policy Editor, rather than in the browser settings.
You can access the Windows Group Policy Editor by searching for Edit Group Policy in the Windows Taskbar, then navigate to the appropriate setting via the left navigation pane.
Depending on your browser, the exact steps may differ slightly from above. Having said that, the above steps should point you in the right direction.
Note that you may need to refresh the page after enabling JavaScript before you see the effect.
How do I disable JavaScript?
You simply go through the steps above but ensure the JavaScript options are not checked/selected.
If you're developing web pages with JavaScript, it's good practice to view your website with JavaScript disabled. This will show you what your website will look like to users who choose to disable JavaScript.
Other browsers?
Most (if not all browsers) give you the option to enable/disable JavaScript. If your browser is not listed above, the steps above will give you some idea of how to find it. Just look for something called tools, options, preferences or something similar.
Warning
Java and JavaScript are two different things — make sure you're enabling/disabling the right option!


--- title: USPTO 1K TPL confusion matrices keywords: fastai sidebar: home_sidebar summary: "Analysis of the predictions on the USPTO 1K TPL data set for the approaches" description: "Analysis of the predictions on the USPTO 1K TPL data set for the approaches" nb_path: "nbs/10_results_uspto_1k_tpl.ipynb" ---
import pickle
import faiss
import numpy as np
import matplotlib.pyplot as plt
from pathlib import Path
from typing import Optional
from collections import Counter
from pycm import ConfusionMatrix, Compare
To compute the evaluation metrics we use PyCM, which can be installed using pip install pycm==2.7
. The nearest neighbours for the different fingerprint approaches are computed using faiss (version 1.5.3).
We have already computed confusion matrix, you can download them (together with the data set and the fingerprints) from MappingChemicalReactions on Box.
def get_nearest_neighbours_prediction(train_X: np.array, train_y: np.array,
eval_X: np.array, n_neighbours: int=5) -> list:
"""
Use faiss to make a K-nearest neighbour prediction
"""
# Indexing
index = faiss.IndexFlatL2(len(train_X[0]))
index.add(train_X)
# Querying
_, results = index.search(eval_X, n_neighbours)
# Scoring
y_pred = get_pred(train_y, results)
return y_pred
def get_pred(y: list, results: list) -> list:
"""
Get most common label from nearest neighbour list
"""
y_pred = []
for i, r in enumerate(results):
y_pred.append(Counter(y[r]).most_common(1)[0][0])
return y_pred
def get_cache_confusion_matrix(
name: str, actual_vector: list, predict_vector: list
) -> ConfusionMatrix:
"""
Make confusion matrix and save it.
"""
cm_cached = load_confusion_matrix(f"{name}.pickle")
if cm_cached is not None:
return cm_cached
cm = ConfusionMatrix(actual_vector=actual_vector, predict_vector=predict_vector)
cm.save_html(name)
with open(f"{name}.pickle", "wb") as f:
pickle.dump(cm, f)
return cm
def load_confusion_matrix(path: str) -> Optional[ConfusionMatrix]:
"""
Load confusion matrix if existing.
"""
if Path(path).is_file():
return pickle.load(open(path, "rb"))
return None
with open('../data/uspto_1k_TPL/individual_files/test_labels.txt', 'r') as f:
labels_true = [int(line.strip()) for line in f.readlines()]
with open('../data/uspto_1k_TPL/individual_files/predictions_bert_classifier.txt', 'r') as f:
labels_bert_class = [int(line.strip()) for line in f.readlines()]
cm_bert_classifier = get_cache_confusion_matrix('../data/uspto_1k_TPL/results/cm_bert_classifier', labels_true, labels_bert_class)
print(f"Accuracy : {cm_bert_classifier.overall_stat['Overall ACC']:.4f}")
print(f"MCC : {cm_bert_classifier.overall_stat['Overall MCC']:.4f}")
print(f"CEN : {cm_bert_classifier.overall_stat['Overall CEN']:.4f}")
# Get confusion matrix for the Schneider FP
if not Path('../data/uspto_1k_TPL/results/cm_schneider_fp_5NN.pickle').is_file():
train_X = np.vstack(
pickle.load(open("../data/uspto_1k_TPL/fingerprints/schneider_AP3_folded_256_plus_agent_features_total_df_1000_role.pkl", "rb"))[
"train_valid"
]
).astype("float32")
train_y = np.array([line.strip() for line in open("../data/uspto_1k_TPL/individual_files/train_valid_labels.txt")])
eval_X = np.vstack(
pickle.load(open("../data/uspto_1k_TPL/fingerprints/schneider_AP3_folded_256_plus_agent_features_total_df_1000_role.pkl", "rb"))[
"test"
]
).astype("float32")
labels_predicted = [int(i) for i in get_nearest_neighbours_prediction(train_X, train_y, eval_X)]
cm_schneider_fp = cm = get_cache_confusion_matrix('../data/uspto_1k_TPL/results/cm_schneider_fp_5NN', labels_true, labels_predicted)
print(f"Accuracy : {cm_schneider_fp.overall_stat['Overall ACC']:.3f}")
print(f"MCC : {cm_schneider_fp.overall_stat['Overall MCC']:.3f}")
print(f"CEN : {cm_schneider_fp.overall_stat['Overall CEN']:.3f}")
# Get confusion matrix for the pretrained BERT fingerprint
if not Path('../data/uspto_1k_TPL/results/cm_bert_mlm_fp_5NN.pickle').is_file():
train_X = np.vstack(
pickle.load(open("../data/uspto_1k_TPL/fingerprints/USPTO_1k_TPL_bert_mlm.pkl", "rb"))[
"train_valid"
]
).astype("float32")
train_y = np.array([line.strip() for line in open("../data/uspto_1k_TPL/individual_files/train_valid_labels.txt")])
eval_X = np.vstack(
pickle.load(open("../data/uspto_1k_TPL/fingerprints/USPTO_1k_TPL_bert_mlm.pkl", "rb"))[
"test"
]
).astype("float32")
labels_predicted = [int(i) for i in get_nearest_neighbours_prediction(train_X, train_y, eval_X)]
cm_bert_mlm_fp = cm = get_cache_confusion_matrix('../data/uspto_1k_TPL/results/cm_bert_mlm_fp_5NN', labels_true, labels_predicted)
print(f"Accuracy : {cm_bert_mlm_fp.overall_stat['Overall ACC']:.3f}")
print(f"MCC : {cm_bert_mlm_fp.overall_stat['Overall MCC']:.3f}")
print(f"CEN : {cm_bert_mlm_fp.overall_stat['Overall CEN']:.3f}")
# Get confusion matrix for the fine-tuned BERT fingerprint
if not Path('../data/uspto_1k_TPL/results/cm_bert_class_fp_5NN.pickle').is_file():
train_X = np.vstack(
pickle.load(open("../data/uspto_1k_TPL/fingerprints/USPTO_1k_TPL_bert_class.pkl", "rb"))[
"train_valid"
]
).astype("float32")
train_y = np.array([line.strip() for line in open("../data/uspto_1k_TPL/individual_files/train_valid_labels.txt")])
eval_X = np.vstack(
pickle.load(open("../data/uspto_1k_TPL/fingerprints/USPTO_1k_TPL_bert_class.pkl", "rb"))[
"test"
]
).astype("float32")
labels_predicted = [int(i) for i in get_nearest_neighbours_prediction(train_X, train_y, eval_X)]
cm_bert_class_fp = cm = get_cache_confusion_matrix('../data/uspto_1k_TPL/results/cm_bert_class_fp_5NN', labels_true, labels_predicted)
print(f"Accuracy : {cm_bert_class_fp.overall_stat['Overall ACC']:.3f}")
print(f"MCC : {cm_bert_class_fp.overall_stat['Overall MCC']:.3f}")
print(f"CEN : {cm_bert_class_fp.overall_stat['Overall CEN']:.3f}")


{% extends "base.html" %} {% load static %} {% block head %} {% endblock %} {% block header %}
Tau Kappa Epsilon was founded on the cold night of January 10, 1899, after the discussion of a new society that regarded men not for wealth, rank or honor, but for personal worth and character.
Advancing character and personal development means unlocking the potential for each man to be great college graduate and productive citizen. A Teke is a man who is trustworthy and lives the values enunciated in our declaration of Principles, helping each member integrate LOVE, Charity, and ESTEEM into his daily life
Our Mission
Our mission is to aid men in their mental, moral, and social development for life.
Our Vision
Tau Kappa Epsilon creates lifelong relationships that enhance educational,
interpersonal, community and professional success.
Our Purpose
TKE contributes to the advancement of society through the personal growth of our
members, and service to others.


Your browser does not support the features we need
Try using the most recent version of Chrome, Firefox or Safari
by @captbaritone - GitHub
Embed ?


California man arrested after DNA from Baskin-Robbins spoon links him to sexual assaults from 22 years ago
by Paulina DedajA California man was charged with the sexual assault of two women over 22 years ago, after police linked DNA from the crime scenes to that of a sample recently collected from a Baskin-Robbins ice cream spoon.
Alameda County District Attorney Nancy E. O’Malley announced Monday that Gregory Paul Vien, 60, will face “multiple felony sexual assault charges” in connection with the two separate assaults, both from 1997.
According to prosecutors, a woman walking to a Bay Area Rapid Transit station after work on May 6 was attacked by an unidentified man who “dragged her to a secluded area” before he sexually assaulted her.
Several months later, on Sept. 7, a second woman was sexually assaulted while on a walk near Livermore High School.
Police were able to recover DNA from both crime scenes that were “found to be a match to each other.” The samples were uploaded to the national DNA database to no avail.
Over 22 years later, investigators from the Livermore Police Department were able to get a lead using a genetic genealogical search tool which led them to Vien.
REMAINS OF MISSOURI WOMAN BELIEVED TO HAVE BEEN FOUND AFTER HUSBAND PROVIDES INFORMATION
Detectives began to surveil Vein in August after discovering that he had lived in Livermore for several decades, including around the time the crimes were committed.
According to a probable cause statement, police subsequently collected “several items” that had been thrown in the garbage, including a “Baskin-Robbins spoon” that Vien used to eat ice cream.
On Aug. 28, the lab turned back a positive match between Vien’s DNA and the sample taken from both crime scenes.
“For over 20 years, the survivors of these sexual assaults have lived with the constant uncertainty that comes with not knowing when, if ever, their assailant will be identified and brought to justice,” O’Malley said in a news release.
CLICK HERE TO GET THE FOX NEWS APP
“My office’s specialized cold case unit and sexual assault unit worked alongside our law enforcement partners and will now ensure that Mr. Vien is held to account for the crimes he committed.”
Vien was arraigned on Nov. 7 and is due back in court on Wednesday.


I am a highly motivated individual who works well in teams and takes the initiative to be pro-active in the job environment.
I undertook stock deliveries, kept stock neat and tidy on the shop floor, dealt with customer queries and undertook sales transactions.
I took orders, waited tables, undertook sales transactions and dealt with customer queries, while working in a fast paced environment.
| Subject | Grade |
|---|---|
| Business | H2 |
| Economics | H3 |
| English | H3 |
| Biology | H3 |
| Irish | H4 |
| Accounting | H4 |
| Maths | O2 |
| French | O3 |
Apart from focusing on my studies, I enjoy most of my time being outdoors. I love to go for jogs and being outside in nature. I also enjoy playing GAA with my local club Kilmurry and play soccer with Macroom AFC.
When forced indoors, I spend a lot of my time reading adult fiction novels and keeping up to date with the latest television series.


Android apps with local database
Android apps integrated with a web API
Android apps interfacing with Modbus TCP
Android apps with Google App Engine backend


The #KylieCosmetics Lip Kit is your secret weapon to create the perfect 'Kylie Lip.' Each Lip Kit comes with a Matte Liquid Lipstick and matching Lip Liner.
Bare is a nude pinky beige. The Kylie Cosmetics Bare Velvet Liquid Lipstick Lip Kit is your secret weapon to create the perfect 'Kylie Lip.' Each Lip Kit comes with a Velvet Liquid Lipstick and matching Lip Liner.
Mary Jo K is a true blue red. Each Lip Kit contains: 1 Matte Liquid Lipstick (0.11 oz./ 3.25 g) 1 Pencil Lip Liner (net wt./ poids net .03 oz/ 1.0g)


Future Hack
About
Challenges
Prizes
Schedule
Experts
Judging Process
Resources
Location
Donate
Register
Davos Hack
Slovenia Hack
Tech Resources
APIs
Zillow
Wikipedia
Google Scholar
Reddit
Alpha-Vantage
API Directory: ProgrammableWeb
Open Source Datasets
Data is Plural
Slovenia Open Data Gov
Swiss Open Data Gov
India Open Data Gov
Canada Open Data Gov
US Open Data Gov
Quandl Financial Data
UCI Machine Learning Datasets
Gapminder
FiveThirtyEight
DataPortals
Data.world
Wikipedia ML Listings
Cool Datasets on Twitter
Public Data Science Datasets
OpenML
Github: Awesome Public Datasets
http://bayanat.ae/
https://www.opendatasoft.com/a-comprehensive-list-of-all-open-data-portals-around-the-world/http://bayanat.ae/
http://index.okfn.org/place/
https://transit.land/
ConsenSys Technology
Truffle
Metamask
Documentation for smarts contracts coding in solidity: https://solidity.readthedocs.io/en/develop/
Web3 Documentation: https://web3js.readthedocs.io/en/1.0/web3-eth-contract.html
ETH for the test network rinkeby: https://www.rinkeby.io/#faucet
I suggest you to start using a truffle box: https://github.com/truffle-box/react-box
Follow us on Social Media!


Amir Khan hopes Tory candidate can deliver knockout blow
A Tory parliamentary candidate is hoping to deliver a knockout blow at the election with the help of boxing superstar Amir Khan.
The former world champion is firmly in the corner of Gurjit Kaur Bains, who is hoping to take Walsall South for the Conservatives for the first time in nearly 50 years.
Ms Kaur Bains met with Khan to discuss the Amir Khan Foundation, a charity he set up to help disadvantaged young people and support emergency disasters.
She said on Twitter: "Good to catch up and discuss the great work the AK Foundation do for young people using boxing and sports to keep them away from crime.
"Looking forward to working with you for the good of Walsall!"
Khan said on Twitter: Lovely to meet Gurjit Kaur Bains today who is standing to be the next MP for Walsall South. Good luck to her on the campaign she will be fantastic for Walsall."
Khan, who last fought against Billy Dib in Saudi Arabia earlier this year, is thought to be lining up a potential contest with Manny Pacquiao in the new year.
The Tories last took Walsall South in 1970 under Henry d'Avigdor-Goldsmid.
The party lost the seat to Labour's Bruce George in 1974 and it has been red ever since.
Valerie Vaz has been the MP there since 2010. She is defending her seat at this election.
The other candidates are Paul Harris for the Lib Dems, the Brexit Party's Gary Hughes, John Macefield for the Greens, and independent Akheil Mehboob.


Summer Camps
At fabjuniors, every summer shines with the brightest ideas.We meticulously plan those 15 days to make sure kids have a miraculous time.SC'21 insights: SC'21
At fabjuniors, every summer shines with the brightest ideas.We meticulously plan those 15 days to make sure kids have a miraculous time.SC'21 insights: SC'21
One hour of mindfulness, Yoga, and Fun! "What else a kid want?",parents said.(feedback :)) *Due to pandemic, classes are online. Download The Brochure.
We are always open to collaborate with brilliant playschools; and meeting alike minded people always help to grow! Know more about our ongoing activities.
Our very first fab event was hosted by a corporate company.And it's always been great working with social groups/corporates.
Their faith in us, always help us to accelerate our journey.
Kindly contact us for more details/queries.
Say no more! contact us not for a surfluous, but a decorus event!! Whatsapp contact
Wait! Don't be surprised! During pandemic,we created our new segment-"YoDance"!Confused?
Fitness and fun ?,click and know!


|
STL Concepts
|
Specifies the requirements on a type that can be incremented (with the pre- and post-increment operators). More...
#include <incrementable.hpp>
Specifies the requirements on a type that can be incremented (with the pre- and post-increment operators).
Requirements
The increment operations (including those required by WeaklyIncrementable) are required to be equality-preserving, and the type is required to be EqualityComparable.
Let a and b be incrementable objects of type I. Incrementable is satisfied only if:
Unlike Incrementable concept in Ranges TS, post-increment operator return type is It in C++ named requirements, not It&&.
| It | - iterator type to be checked |


These are the five main colours of the website. They are saved as CSS Variables in the stylesheet.
Typography for this website makes use of 2 fonts: Roboto and Montserrat. Both found on Google Fonts
h1 { font-family: "Roboto", sans-serif; font-size: 20pt; font-weight: 700; line-height: 23pt; }
h2 { font-family: "Roboto", sans-serif; font-size: 18pt; font-weight: 700; line-height: 21pt; }
h3 { font-family: "Roboto", sans-serif; font-size: 18pt; font-weight: 100; line-height: 21pt; text-transform: uppercase; }
p { font-family: "Montserrat", sans-serif; font-size: 13pt; font-weight: 300; line-height: 15pt; }
This is a paragraph... I write the best placeholder text, and I'm the biggest developer on the web by far... While that's mock-ups and this is politics, are they really so different? I will write some great placeholder text – and nobody writes better placeholder text than me, believe me – and I’ll write it very inexpensively. I will write some great, great text on your website’s Southern border, and I will make Google pay for that text. Mark my words.
Icons are provided by Font Awesome.
/* NO ADDITIONAL CSS */
.btn { background: none; border: none; border-radius: 6px; cursor: pointer; } .btn-ticket { background-color: var(--red); border: 1px solid var(--red-dark); color: var(--light); font-weight: 700; padding: 1%; text-transform: uppercase; }
Tiles are a major part of the website. They are used to display accomodation options, ticket prices, artists, and more.
.tile-rightbottom { background-color: var(--black); display: grid; grid-template: '. .' 1fr '. content' 1fr / 1fr 1fr; height: 160px; padding: 2%; width: 160px; } .tile-content { color: var(--light); grid-area: content; } .tile-text { border-radius: 6px; margin: 2% 0; max-width: 45%; padding: 3%; } .tile-normal { background-color: var(--red); color: var(--light); } .tile-normal h1 { color: var(--yellow); } .tile-light { background-color: var(--light); color: var(--red-dark); } .tile-light h1 { color: var(--red); } .tile-fullbottom { background-color: var(--black); color: var(--light); display: grid; grid-template: '. .' 1fr 'content content' 1fr / 1fr 1fr; height: 200px; padding: 2%; width: 200px; }
Artist
xx:xx - xx:xx
I was going to say something extremely rough to Lorem Ipsum, to its family, and I said to myself, "I can't do it. I just can't do it. It's inappropriate. It's not nice." You have so many different things placeholder text has to be able to do, and I don't believe Lorem Ipsum has the stamina. I have a 10 year old son. He has words. He is so good with these words it's unbelievable.
Lorem ipsum dolor, sit amet consectetur adipisicing elit.
.tile-ticket { align-items: center; background-color: var(--red); border-radius: 6px; color: var(--light); display: flex; flex-direction: row; flex-wrap: nowrap; height: 100px; justify-content: space-between; } .ticket-img { background-color: var(--black); grid-area: img; height: 100%; width: 150px; } .ticket-title { padding: 0 2%; text-transform: uppercase; } .ticket-title h1 { font-size: 50px; line-height: 25px; } .ticket-desc { padding: 1% 0; } .ticket-price { padding: 0 2%; text-align: right; text-transform: uppercase; }
.navbar { background-color: var(--red-dark); display: flex; flex-direction: row; flex-wrap: nowrap; height: 60px; justify-content: space-between; padding: 0 2%; } .nav-logo { align-self: center; flex-grow: 0; } .nav-img { height: 45px; } .nav-links { align-self: center; display: flex; flex-basis: auto; flex-grow: 1; justify-content: flex-end; text-align: right; } .nav-links a { color: var(--light); font-weight: 700; margin: auto 2%; text-decoration: none; text-transform: uppercase; }
/* CSS ONLY FOR USE IN STYLEGUIDE (params defined inline) */ .logos { display: flex; align-content: flex-start; justify-content: space-evenly; }


As white people, we are privileged in such a way that we can't understand and empathize with the struggles that people of color face on a regular basis.
In the same way that the wealthy cannot speculate on what it's like to be homeless, the privileged white cannot understand what it's like to be an underprivileged person of color.
Formally, this is known as our implicit bias.
But the sooner we recognize this and come to terms with it, the sooner we can make efforts to combat this implicit bias.
And once we begin making those efforts, these are some things we can do to help.


Home
All Posts
Create Post
Profile
Logout
Register
Login
My post
Species: Beast
Name: Thestral
Author: Alex Smith
Rating of votes: 3
Details


//= ./html/section-1_header.html
//= ./html/section-1_promo.html
//= ./html/section-2_start-earning.html
//= ./html/section-3_dry-facts.html
//= ./html/section-4_advantages.html
//= ./html/section-5.html
//= ./html/section-6.html
//= ./html/section-7.html
//= ./html/section-8.html
//= ./html/section-9_4steps.html
//= ./html/section-10_videocourse.html
//= ./html/section-11.html
//= ./html/section-12_expert.html
//= ./html/section_13.html
//= ./html/section-14_just-now.html
//= ./html/section-15_aftercourse.html
//= ./html/section-16-wcourse.html
//= ./html/plus-take-bonuses.html
//= ./html/section-important.html
//= ./html/do_it-go.html
//= ./html/footer.html
//= ./html/disclaimer.html
//= ./html/modal-window.html


< prev index next > modules/javafx.web/src/main/native/Source/ThirdParty/libxml/src/include/libxml/hash.h
Print this page
*/
typedef void *(*xmlHashCopier)(void *payload, const xmlChar *name);
/**
* xmlHashScanner:
* @payload: the data in the hash
- * @data: extra scannner data
+ * @data: extra scanner data
* @name: the name associated
*
* Callback when scanning data in a hash with the simple scanner.
*/
typedef void (*xmlHashScanner)(void *payload, void *data, const xmlChar *name);
/**
* xmlHashScannerFull:
* @payload: the data in the hash
- * @data: extra scannner data
+ * @data: extra scanner data
* @name: the name associated
* @name2: the second name associated
* @name3: the third name associated
*
* Callback when scanning data in a hash with the full scanner.
< prev index next >


In this notebook, some template code has already been provided for you, and you will need to implement additional functionality to successfully complete this project. You will not need to modify the included code beyond what is requested. Sections that begin with '(IMPLEMENTATION)' in the header indicate that the following block of code will require additional functionality which you must provide. Instructions will be provided for each section, and the specifics of the implementation are marked in the code block with a 'TODO' statement. Please be sure to read the instructions carefully!
Note: Once you have completed all of the code implementations, you need to finalize your work by exporting the Jupyter Notebook as an HTML document. Before exporting the notebook to html, all of the code cells need to have been run so that reviewers can see the final implementation and output. You can then export the notebook by using the menu above and navigating to File -> Download as -> HTML (.html). Include the finished document along with this notebook as your submission.
In addition to implementing code, there will be questions that you must answer which relate to the project and your implementation. Each section where you will answer a question is preceded by a 'Question X' header. Carefully read each question and provide thorough answers in the following text boxes that begin with 'Answer:'. Your project submission will be evaluated based on your answers to each of the questions and the implementation you provide.
Note: Code and Markdown cells can be executed using the Shift + Enter keyboard shortcut. Markdown cells can be edited by double-clicking the cell to enter edit mode.
The rubric contains optional "Stand Out Suggestions" for enhancing the project beyond the minimum requirements. If you decide to pursue the "Stand Out Suggestions", you should include the code in this Jupyter notebook.
In this notebook, you will make the first steps towards developing an algorithm that could be used as part of a mobile or web app. At the end of this project, your code will accept any user-supplied image as input. If a dog is detected in the image, it will provide an estimate of the dog's breed. If a human is detected, it will provide an estimate of the dog breed that is most resembling. The image below displays potential sample output of your finished project (... but we expect that each student's algorithm will behave differently!).
In this real-world setting, you will need to piece together a series of models to perform different tasks; for instance, the algorithm that detects humans in an image will be different from the CNN that infers dog breed. There are many points of possible failure, and no perfect algorithm exists. Your imperfect solution will nonetheless create a fun user experience!
We break the notebook into separate steps. Feel free to use the links below to navigate the notebook.
 Unzip the folder and place it in this project's home directory, at the location /dogImages
.
Download the human dataset. Unzip the folder and place it in the home directory, at location /lfw
.
Note: If you are using a Windows machine, you are encouraged to use 7zip to extract the folder.
In the code cell below, we save the file paths for both the human (LFW) dataset and dog dataset in the numpy arrays human_files
and dog_files
.
!rm *.zip*
!wget https://s3-us-west-1.amazonaws.com/udacity-aind/dog-project/dogImages.zip
!wget https://s3-us-west-1.amazonaws.com/udacity-aind/dog-project/lfw.zip
!unzip -f dogImages.zip
!unzip -f lfw.zip
import numpy as np
from glob import glob
# load filenames for human and dog images
human_files = np.array(glob("lfw/*/*"))
dog_files = np.array(glob("dogImages/*/*/*"))
# print number of images in each dataset
print('There are %d total human images.' % len(human_files))
print('There are %d total dog images.' % len(dog_files))
In this section, we use OpenCV's implementation of Haar feature-based cascade classifiers to detect human faces in images.
OpenCV provides many pre-trained face detectors, stored as XML files on github. We have downloaded one of these detectors and stored it in the haarcascades
directory. In the next code cell, we demonstrate how to use this detector to find human faces in a sample image.
!mkdir haarcascades
!wget https://raw.githubusercontent.com/opencv/opencv/master/data/haarcascades/haarcascade_frontalface_alt.xml -O ./haarcascades/haarcascade_frontalface_alt.xml
import cv2
import matplotlib.pyplot as plt
%matplotlib inline
# extract pre-trained face detector
face_cascade = cv2.CascadeClassifier('haarcascades/haarcascade_frontalface_alt.xml')
# load color (BGR) image
img = cv2.imread(human_files[0])
# convert BGR image to grayscale
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
# find faces in image
faces = face_cascade.detectMultiScale(gray)
# print number of faces detected in the image
print('Number of faces detected:', len(faces))
# get bounding box for each detected face
for (x,y,w,h) in faces:
# add bounding box to color image
cv2.rectangle(img,(x,y),(x+w,y+h),(255,0,0),2)
# convert BGR image to RGB for plotting
cv_rgb = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
# display the image, along with bounding box
plt.imshow(cv_rgb)
plt.show()
Before using any of the face detectors, it is standard procedure to convert the images to grayscale. The detectMultiScale
function executes the classifier stored in face_cascade
and takes the grayscale image as a parameter.
In the above code, faces
is a numpy array of detected faces, where each row corresponds to a detected face. Each detected face is a 1D array with four entries that specifies the bounding box of the detected face. The first two entries in the array (extracted in the above code as x
and y
) specify the horizontal and vertical positions of the top left corner of the bounding box. The last two entries in the array (extracted here as w
and h
) specify the width and height of the box.
We can use this procedure to write a function that returns True
if a human face is detected in an image and False
otherwise. This function, aptly named face_detector
, takes a string-valued file path to an image as input and appears in the code block below.
# returns "True" if face is detected in image stored at img_path
def face_detector(img_path):
img = cv2.imread(img_path)
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
faces = face_cascade.detectMultiScale(gray)
return len(faces) > 0
Question 1: Use the code cell below to test the performance of the face_detector
function.
human_files
have a detected human face? dog_files
have a detected human face?  You will see that our algorithm falls short of this goal, but still gives acceptable performance. We extract the file paths for the first 100 images from each of the datasets and store them in the numpy arrays human_files_short
and dog_files_short
.
Answer: (You can print out your results and/or write your percentages in this cell)
print(human_files[0])
from tqdm import tqdm
from collections import Counter
human_files_short = human_files[:100]
dog_files_short = dog_files[:100]
#-#-# Do NOT modify the code above this line. #-#-#
## TODO: Test the performance of the face_detector algorithm
## on the images in human_files_short and dog_files_short.
human_in_human = 0
human_in_dogs = 0
for human_file in human_files_short:
is_human = face_detector(human_file)
if is_human:
human_in_human += 1
for dog_file in dog_files_short:
if face_detector(dog_file):
human_in_dogs += 1
print('true positive is {}% false positive is {}%'.format(human_in_human,human_in_dogs))
We suggest the face detector from OpenCV as a potential way to detect human images in your algorithm, but you are free to explore other approaches, especially approaches that make use of deep learning :). Please use the code cell below to design and test your own face detection algorithm. If you decide to pursue this optional task, report performance on human_files_short
and dog_files_short
.
### (Optional)
### TODO: Test performance of another face detection algorithm.
### Feel free to use as many code cells as needed.
In this section, we use a pre-trained model to detect dogs in images.
The code cell below downloads the VGG-16 model, along with weights that have been trained on ImageNet, a very large, very popular dataset used for image classification and other vision tasks. ImageNet contains over 10 million URLs, each linking to an image containing an object from one of 1000 categories.
import torch
import torchvision.models as models
# define VGG16 model
VGG16 = models.vgg16(pretrained=True)
# check if CUDA is available
use_cuda = torch.cuda.is_available()
# move model to GPU if CUDA is available
if use_cuda:
print('using cuda')
VGG16 = VGG16.cuda()
Given an image, this pre-trained VGG-16 model returns a prediction (derived from the 1000 possible categories in ImageNet) for the object that is contained in the image.
In the next code cell, you will write a function that accepts a path to an image (such as 'dogImages/train/001.Affenpinscher/Affenpinscher_00001.jpg'
) as input and returns the index corresponding to the ImageNet class that is predicted by the pre-trained VGG-16 model. The output should always be an integer between 0 and 999, inclusive.
Before writing the function, make sure that you take the time to learn how to appropriately pre-process tensors for pre-trained models in the PyTorch documentation.
from PIL import Image
import torchvision.transforms as transforms
# Set PIL to be tolerant of image files that are truncated.
from PIL import ImageFile
ImageFile.LOAD_TRUNCATED_IMAGES = True
def VGG16_predict(img_path):
'''
Use pre-trained VGG-16 model to obtain index corresponding to
predicted ImageNet class for image at specified path
Args:
img_path: path to an image
Returns:
Index corresponding to VGG-16 model's prediction
'''
normalize = transforms.Normalize(mean=[0.485, 0.456, 0.406],
std=[0.229, 0.224, 0.225])
to_tensor = transforms.ToTensor()
centercrop = transforms.CenterCrop((224,224))
resize = transforms.Resize((240,240))
greyscale = transforms.Grayscale(num_output_channels=1)
image_transform = transforms.Compose([resize,
centercrop,
to_tensor,
normalize])
im = Image.open(img_path)
trans_im = image_transform(im)
unsqueezed_img = trans_im.unsqueeze_(0)
if torch.cuda.is_available():
# print('using cuda')
unsqueezed_img = unsqueezed_img.to('cuda')
VGG16.eval()
forecasted_result = VGG16(unsqueezed_img)
most_likely = forecasted_result.cpu().data.numpy().argmax()
## TODO: Complete the function.
## Load and pre-process an image from the given img_path
## Return the *index* of the predicted class for that image
return most_likely # predicted class index
VGG16_predict(human_files[0])
While looking at the dictionary, you will notice that the categories corresponding to dogs appear in an uninterrupted sequence and correspond to dictionary keys 151-268, inclusive, to include all categories from 'Chihuahua'
to 'Mexican hairless'
. Thus, in order to check to see if an image is predicted to contain a dog by the pre-trained VGG-16 model, we need only check if the pre-trained model predicts an index between 151 and 268 (inclusive).
Use these ideas to complete the dog_detector
function below, which returns True
if a dog is detected in an image (and False
if not).
### returns "True" if a dog is detected in the image stored at img_path
def dog_detector(img_path):
## TODO: Complete the function.
predicted_result = VGG16_predict(img_path)
if predicted_result >268 or predicted_result < 151:
return False
else:
return True
# return None # true/false
Question 2: Use the code cell below to test the performance of your dog_detector
function.
human_files_short
have a detected dog? dog_files_short
have a detected dog?Answer:
### TODO: Test the performance of the dog_detector function
### on the images in human_files_short and dog_files_short.
dogs_in_human = 0
dogs_in_dogs = 0
for human_file in human_files_short:
is_dog = dog_detector(human_file)
if is_dog:
dogs_in_human += 1
for dog_file in dog_files_short:
if dog_detector(dog_file):
dogs_in_dogs += 1
print('true positive is {}% false positive is {}%'.format(dogs_in_dogs,dogs_in_human))
We suggest VGG-16 as a potential network to detect dog images in your algorithm, but you are free to explore other pre-trained networks (such as Inception-v3, ResNet-50, etc). Please use the code cell below to test other pre-trained PyTorch models. If you decide to pursue this optional task, report performance on human_files_short
and dog_files_short
.
### (Optional)
### TODO: Report the performance of another pre-trained network.
### Feel free to use as many code cells as needed.
Now that we have functions for detecting humans and dogs in images, we need a way to predict breed from images. In this step, you will create a CNN that classifies dog breeds. You must create your CNN from scratch (so, you can't use transfer learning yet!), and you must attain a test accuracy of at least 10%. In Step 4 of this notebook, you will have the opportunity to use transfer learning to create a CNN that attains greatly improved accuracy.
We mention that the task of assigning breed to dogs from images is considered exceptionally challenging. To see why, consider that even a human would have trouble distinguishing between a Brittany and a Welsh Springer Spaniel.
| Brittany | Welsh Springer Spaniel |
|---|---|
It is not difficult to find other dog breed pairs with minimal inter-class variation (for instance, Curly-Coated Retrievers and American Water Spaniels).
| Curly-Coated Retriever | American Water Spaniel |
|---|---|
Likewise, recall that labradors come in yellow, chocolate, and black. Your vision-based algorithm will have to conquer this high intra-class variation to determine how to classify all of these different shades as the same breed.
| Yellow Labrador | Chocolate Labrador | Black Labrador |
|---|---|---|
We also mention that random chance presents an exceptionally low bar: setting aside the fact that the classes are slightly imabalanced, a random guess will provide a correct answer roughly 1 in 133 times, which corresponds to an accuracy of less than 1%.
Remember that the practice is far ahead of the theory in deep learning. Experiment with many different architectures, and trust your intuition. And, of course, have fun!
Use the code cell below to write three separate data loaders for the training, validation, and test datasets of dog images (located at dogImages/train
, dogImages/valid
, and dogImages/test
, respectively). You may find this documentation on custom datasets to be a useful resource. If you are interested in augmenting your training and/or validation data, check out the wide variety of transforms!
import os
from torchvision import datasets
from torch.utils.data import DataLoader
### Transform definition
normalize = transforms.Normalize(mean=[0.485, 0.456, 0.406],
std=[0.229, 0.224, 0.225])
to_tensor = transforms.ToTensor()
randomRotate = transforms.RandomRotation((-180,180))
centercrop = transforms.CenterCrop((224,224))
resize = transforms.Resize((300,300))
greyscale = transforms.Grayscale(num_output_channels=1)
image_transform = transforms.Compose([randomRotate,
resize,
centercrop,
to_tensor,
normalize])
### TODO: Write data loaders for training, validation, and test sets
## Specify appropriate transforms, and batch_sizes
dataloader = datasets.ImageFolder('dogImages', transform = image_transform)
dataloader = DataLoader(dataloader, batch_size = 32, shuffle= True)
trainloader = datasets.ImageFolder('dogImages/train', transform = image_transform)
trainloader = DataLoader(trainloader, batch_size = 32, shuffle= True)
validloader = datasets.ImageFolder('dogImages/test', transform = image_transform)
validloader = DataLoader(validloader, batch_size = 32, shuffle= True)
testloader = datasets.ImageFolder('dogImages/valid', transform = image_transform)
testloader = DataLoader(testloader, batch_size = 32, shuffle= True)
item = next(iter(testloader))
item[1].shape[0]
import os
len(os.listdir('./dogImages/train'))
Question 3: Describe your chosen procedure for preprocessing the data.
Answer:
Create a CNN to classify dog breed. Use the template in the code cell below.
import torch.nn as nn
import torch.nn.functional as F
# define the CNN architecture
num_classes = 133
class Net(nn.Module):
### TODO: choose an architecture, and complete the class
def __init__(self):
super(Net, self).__init__()
## Define layers of a CNN
self.conv1 = nn.Conv2d(3, 32, 3, stride=2, padding=1)
self.conv2 = nn.Conv2d(32, 64, 3, stride=2, padding=1)
self.conv3 = nn.Conv2d(64, 128, 3, padding=1)
self.pool = nn.MaxPool2d(2, 2)
self.fc1 = nn.Linear(7*7*128, 1000)
self.fc2 = nn.Linear(1000, 500)
self.fc3 = nn.Linear(500, num_classes)
self.dropout = nn.Dropout(0.3)
def forward(self, x):
## Define forward behavior
x = F.relu(self.conv1(x))
x = self.pool(x)
x = F.relu(self.conv2(x))
x = self.pool(x)
x = F.relu(self.conv3(x))
x = self.pool(x)
# flatten
x = x.view(-1, 7*7*128)
x = self.dropout(x)
x = F.relu(self.fc1(x))
x = self.dropout(x)
x = F.relu(self.fc2(x))
x = self.dropout(x)
x = self.fc3(x)
return x
#-#-# You do NOT have to modify the code below this line. #-#-#
# instantiate the CNN
model_scratch = Net()
print(model_scratch)
# move tensors to GPU if CUDA is available
if use_cuda:
model_scratch.cuda()
Question 4: Outline the steps you took to get to your final CNN architecture and your reasoning at each step.
Answer: create 2 conv2d layers and 1 maxpool to reduce the dimensions. Then one fc layer to merge the data and feed into the final softmax layer
Use the next code cell to specify a loss function and optimizer. Save the chosen loss function as criterion_scratch
, and the optimizer as optimizer_scratch
below.
import torch.optim as optim
### TODO: select loss function
criterion_scratch = nn.CrossEntropyLoss()
### TODO: select optimizer
optimizer_scratch = optim.SGD(model_scratch.parameters(), lr = 0.01, momentum = 0.9, dampening= 0.1, weight_decay= 0.001)
# optimizer_scratch = optim.Adam(model_scratch.parameters(), lr = 0.01)
Train and validate your model in the code cell below. Save the final model parameters at filepath 'model_scratch.pt'
.
# the following import is required for training to be robust to truncated images
from PIL import ImageFile
ImageFile.LOAD_TRUNCATED_IMAGES = True
def train(n_epochs, loaders, model, optimizer, criterion, use_cuda, save_path):
"""returns trained model"""
# initialize tracker for minimum validation loss
valid_loss_min = np.Inf
best_loss = float('inf')
best_acc = 0.0
for epoch in range(1, n_epochs+1):
# initialize variables to monitor training and validation loss
train_loss = 0.0
valid_loss = 0.0
train_acc = 0.0
###################
# train the model #
###################
model.train()
for batch_idx, (data, target) in enumerate(loaders['train']):
# move to GPU
if use_cuda:
data, target = data.cuda(), target.cuda()
## find the loss and update the model parameters accordingly
## record the average training loss, using something like
## train_loss = train_loss + ((1 / (batch_idx + 1)) * (loss.data - train_loss))
# clear optimizer gradients
optimizer.zero_grad()
# predict output
outputs = model(data)
# compute loss based on prediction
loss = criterion(outputs, target)
# Backpropogate
loss.backward()
# adjust param according to gradients
optimizer.step()
train_loss = train_loss + ((1 / (batch_idx + 1)) * (loss.data - train_loss))
# if batch_idx == 0:
# print('the target output is {}'.format(target))
# print('the output is {}'.format(outputs))
# print('Epoch %d, Batch %d loss: %.6f' %(epoch, batch_idx + 1, train_loss))
_, prediction = torch.max(outputs.data, 1)
batch_size_current = target.shape[0]
train_acc += torch.sum(prediction == target.data)/batch_size_current - train_acc
######################
# validate the model #
######################
model.eval()
for batch_idx, (data, target) in enumerate(loaders['valid']):
# move to GPU
if use_cuda:
data, target = data.cuda(), target.cuda()
## update the average validation loss
outputs = model(data)
_, prediction = torch.max(outputs.data,1)
loss = criterion(outputs, target)
valid_loss += (1 / (batch_idx + 1)) * (loss.data - valid_loss)
# valid_loss += torch.sum(prediction == target.data)/batch_size_current - valid_loss
# print training/validation statistics
print('Epoch: {} \tTraining Loss: {:.6f} \tValidation Loss: {:.6f} \tTraining accuracy:{}'.format(
epoch,
train_loss,
valid_loss,
train_acc
))
## TODO: save the model if validation loss has decreased
if best_loss > valid_loss:
torch.save(model.state_dict(), save_path)
print('checkpoint saved')
best_loss = valid_loss
else:
print('model is not better than previous attempts, not saving')
# return trained model
return model
loaders_scratch = {'train':trainloader,'test':testloader,'valid':validloader}
# train the model
model_scratch = train(100, loaders_scratch, model_scratch, optimizer_scratch,
criterion_scratch, use_cuda, 'model_scratch.pt')
# load the model that got the best validation accuracy
model_scratch.load_state_dict(torch.load('model_scratch.pt'))
Try out your model on the test dataset of dog images. Use the code cell below to calculate and print the test loss and accuracy. Ensure that your test accuracy is greater than 10%.
def test(loaders, model, criterion, use_cuda):
# monitor test loss and accuracy
test_loss = 0.
correct = 0.
total = 0.
model.eval()
for batch_idx, (data, target) in enumerate(loaders['test']):
# move to GPU
if use_cuda:
data, target = data.cuda(), target.cuda()
# forward pass: compute predicted outputs by passing inputs to the model
output = model(data)
# calculate the loss
loss = criterion(output, target)
# update average test loss
test_loss = test_loss + ((1 / (batch_idx + 1)) * (loss.data - test_loss))
# convert output probabilities to predicted class
pred = output.data.max(1, keepdim=True)[1]
# compare predictions to true label
correct += np.sum(np.squeeze(pred.eq(target.data.view_as(pred))).cpu().numpy())
total += data.size(0)
print('Test Loss: {:.6f}\n'.format(test_loss))
print('\nTest Accuracy: %2d%% (%2d/%2d)' % (
100. * correct / total, correct, total))
# call test function
test(loaders_scratch, model_scratch, criterion_scratch, use_cuda)
You will now use transfer learning to create a CNN that can identify dog breed from images. Your CNN must attain at least 60% accuracy on the test set.
Use the code cell below to write three separate data loaders for the training, validation, and test datasets of dog images (located at dogImages/train
, dogImages/valid
, and dogImages/test
, respectively).
If you like, you are welcome to use the same data loaders from the previous step, when you created a CNN from scratch.
## TODO: Specify data loaders
dataloader = datasets.ImageFolder('dogImages', transform = image_transform)
dataloader = DataLoader(dataloader, batch_size = 32, shuffle= True)
trainloader = datasets.ImageFolder('dogImages/train', transform = image_transform)
trainloader = DataLoader(trainloader, batch_size = 32, shuffle= True)
validloader = datasets.ImageFolder('dogImages/test', transform = image_transform)
validloader = DataLoader(validloader, batch_size = 32, shuffle= True)
testloader = datasets.ImageFolder('dogImages/valid', transform = image_transform)
testloader = DataLoader(testloader, batch_size = 32, shuffle= True)
Use transfer learning to create a CNN to classify dog breed. Use the code cell below, and save your initialized model as the variable model_transfer
.
import torchvision.models as models
import torch.nn as nn
## TODO: Specify model architecture
model_transfer = models.vgg19(pretrained=True)
# print(model_transfer)
for param in model_transfer.parameters():
param.requires_grad = False
# for param in model_transfer.classifier()
model_transfer.classifier[6] = nn.Linear(4096,133,bias=True)
fc_parameters = model_transfer.classifier[6].parameters()
for param in fc_parameters:
param.requires_grad = True
print(model_transfer)
if use_cuda:
model_transfer = model_transfer.cuda()
Question 5: Outline the steps you took to get to your final CNN architecture and your reasoning at each step. Describe why you think the architecture is suitable for the current problem.
__Answer:__ Due to the memory constraints, it is infeasible to have a large network which will train really slowly, I have decided to agressively use maxpool layer to reduce the dimension and convert into FC with a reasonably small number of nodes in FC1 and FC2.
I have tested various parameters for the Adam optimizer, however, it seems that Adam is unable to reduce the loss at all. I settled for SGD at loss of 0.5. I think more tests are required to optimize the hyperparameters
Use the next code cell to specify a loss function and optimizer. Save the chosen loss function as criterion_transfer
, and the optimizer as optimizer_transfer
below.
from torch.optim import Adam
criterion_transfer = nn.CrossEntropyLoss()
optimizer_transfer = Adam(model_transfer.parameters(), lr=0.0005, weight_decay = 0.0001)
Train and validate your model in the code cell below. Save the final model parameters at filepath 'model_transfer.pt'
.
def train(n_epochs, loaders, model, optimizer, criterion, use_cuda, save_path):
"""returns trained model"""
# initialize tracker for minimum validation loss
valid_loss_min = np.Inf
best_loss = float('inf')
best_acc = 0.0
for epoch in range(1, n_epochs+1):
# initialize variables to monitor training and validation loss
train_loss = 0.0
valid_loss = 0.0
train_acc = 0.0
###################
# train the model #
###################
model.train()
for batch_idx, (data, target) in enumerate(loaders['train']):
# move to GPU
if use_cuda:
data, target = data.cuda(), target.cuda()
## find the loss and update the model parameters accordingly
## record the average training loss, using something like
## train_loss = train_loss + ((1 / (batch_idx + 1)) * (loss.data - train_loss))
# clear optimizer gradients
optimizer.zero_grad()
# predict output
outputs = model(data)
# compute loss based on prediction
loss = criterion(outputs, target)
# Backpropogate
loss.backward()
# adjust param according to gradients
optimizer.step()
train_loss = train_loss + ((1 / (batch_idx + 1)) * (loss.data - train_loss))
# if batch_idx == 0:
# print('the target output is {}'.format(target))
# print('the output is {}'.format(outputs))
# print('Epoch %d, Batch %d loss: %.6f' %(epoch, batch_idx + 1, train_loss))
_, prediction = torch.max(outputs.data, 1)
batch_size_current = target.shape[0]
train_acc += torch.sum(prediction == target.data)/batch_size_current - train_acc
######################
# validate the model #
######################
model.eval()
for batch_idx, (data, target) in enumerate(loaders['valid']):
# move to GPU
if use_cuda:
data, target = data.cuda(), target.cuda()
## update the average validation loss
outputs = model(data)
_, prediction = torch.max(outputs.data,1)
loss = criterion(outputs, target)
valid_loss += (1 / (batch_idx + 1)) * (loss.data - valid_loss)
# valid_loss += torch.sum(prediction == target.data)/batch_size_current - valid_loss
# print training/validation statistics
print('Epoch: {} \tTraining Loss: {:.6f} \tValidation Loss: {:.6f} \tTraining accuracy:{}'.format(
epoch,
train_loss,
valid_loss,
train_acc
))
## TODO: save the model if validation loss has decreased
if best_loss > valid_loss:
torch.save(model.state_dict(), save_path)
print('checkpoint saved')
best_loss = valid_loss
else:
print('model is not better than previous attempts, not saving')
# return trained model
return model
loaders_transfer = {'train':trainloader,'test':testloader,'valid':validloader}
n_epochs = 5
# train the model
model_transfer = train(n_epochs, loaders_transfer, model_transfer, optimizer_transfer, criterion_transfer, use_cuda, 'model_transfer.pt')
# load the model that got the best validation accuracy
model_transfer.load_state_dict(torch.load('model_transfer.pt'))
# load the model that got the best validation accuracy (uncomment the line below)
#model_transfer.load_state_dict(torch.load('model_transfer.pt'))
Try out your model on the test dataset of dog images. Use the code cell below to calculate and print the test loss and accuracy. Ensure that your test accuracy is greater than 60%.
test(loaders_transfer, model_transfer, criterion_transfer, use_cuda)
Write a function that takes an image path as input and returns the dog breed (Affenpinscher
, Afghan hound
, etc) that is predicted by your model.
### TODO: Write a function that takes a path to an image as input
### and returns the dog breed that is predicted by the model.
from PIL import Image
# list of class names by index, i.e. a name can be accessed like class_names[0]
class_names = [item[4:].replace("_", " ") for item in loaders_transfer['train'].dataset.classes]
def predict_breed_transfer(img_path, class_names, model):
# load the image and return the predicted breed
im = Image.open(img_path).convert('RGB')
predict_transform = transforms.Compose([transforms.Resize((224,224)),
transforms.ToTensor(),
transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225])])
transformed_im = predict_transform(im)[:3,:,:].unsqueeze(0)
if torch.cuda.is_available():
model = model.to('cuda')
transformed_im = transformed_im.to('cuda')
else:
model = model.to('cpu')
transfroormed_im = transformed_im.to('cpu')
model.eval()
idx = torch.argmax(model(transformed_im))
prediction = class_names[idx]
return prediction
filename = './dogImages/test/004.Akita/'
for img_filename in os.listdir(filename):
img_path = os.path.join(filename, img_filename)
prediction = predict_breed_transfer(img_path,class_names, model_transfer)
print("image: {}, \t prediction: {},".format(img_path, prediction))
Write an algorithm that accepts a file path to an image and first determines whether the image contains a human, dog, or neither. Then,
You are welcome to write your own functions for detecting humans and dogs in images, but feel free to use the face_detector
and dog_detector
functions developed above. You are required to use your CNN from Step 4 to predict dog breed.
Some sample output for our algorithm is provided below, but feel free to design your own user experience!
### TODO: Write your algorithm.
### Feel free to use as many code cells as needed.
def run_app(img_path, model):
## handle cases for a human face, dog, and neither
## print image
im = Image.open(img_path)
plt.imshow(im)
plt.show()
prediction = predict_breed_transfer(img_path,class_names,model)
if dog_detector(img_path):
return 'this dog looks like {}'.format(prediction)
elif face_detector(img_path):
return 'this human looks like {}'.format(prediction)
else:
return 'this looks neither like human nor dog'
filename = './dogImages/test/004.Akita/'
for img_filename in os.listdir(filename):
img_path = os.path.join(filename, img_filename)
prediction = run_app(img_path , model_transfer)
print(prediction)
In this section, you will take your new algorithm for a spin! What kind of dog does the algorithm think that you look like? If you have a dog, does it predict your dog's breed accurately? If you have a cat, does it mistakenly think that your cat is a dog?
Test your algorithm at least six images on your computer. Feel free to use any images you like. Use at least two human and two dog images.
Question 6: Is the output better than you expected :) ? Or worse :( ? Provide at least three possible points of improvement for your algorithm.
Answer: (Three possible points for improvement) the output was worse than I expected for transfer learning due to the fact that VGG can already classify the dog breeds very accurately Possible Improvements
Try different optimizer such as adadelta, adagrad, ASGD, RMSprop
Train with a lower learning rate but more epochs to get to a higher peak
perhaps I can test different model for transfer learning eg densenet, vgg16
## TODO: Execute your algorithm from Step 6 on
## at least 6 images on your computer.
## Feel free to use as many code cells as needed.
## suggested code, below
for file in np.hstack((human_files[:3], dog_files[:3])):
print(run_app(file, model_transfer))
!curl --upload-file ./model_scratch.pt http://largefile.hatari.cc/model_scratch.pt
!curl --upload-file ./model_transfer.pt http://largefile.hatari.cc/model_transfer.pt


Difficulty Level: Beginner - Moderate
Length: 10 Miles
Cost: $80.00 per Adult $60.00 per Youth/Child
Experience the fun that goes with White Water Rafting.
Situated in the safest part of the river for our new comers.
One of our experienced guides will be with you.
Difficulty Level: Advanced
Length: 20 Miles
Cost: $120.00 per Adult $75.00 per Youth/Child
Experience thrill and difficully of the River.
Reserved for enthusiasts and thrill seekers.
2 of our guides will be with you.
Difficulty Level: Beginner
Length: 2 Hours
Cost: $30.00 per Adult $20.00 per Youth/Child
Learn how to use a jet ski, under the watchful eye
of one of our experts.
Difficulty Level: Moderate - Advanced
Length: 2 Hours
Cost: $25.00 per Adult $15.00 per Youth/Child
No lecture, no fuzz. Get on the ski and ride!
Difficulty Level: Beginner
Length: 5 Miles
Cost: $30.00 per Adult $20.00 per Youth/Child
Let one of our guides help you see the beauty of nature.
Difficulty Level: Moderate - Advanced
Length: 10 miles
Cost: $25.00 per Adult $15.00 per Youth/Child
Go through the most difficult parts of the trail with 2
of our guides. No kids allowed!


Created by Peter Sellars
This is about what is right in the Fraedom context!
Delivery teams need a clear, defined branching strategy enabling them to develop across multiple versions of the product simultaneously that is also synchronised with the Fraedom deployment schedule.
Delivery teams need a clear, defined branching strategy enabling them to develop across multiple versions of the product simultaneously that is also synchronised with the Fraedom deployment schedule.
Teams @ Fraedom expect strategies to:
Delivery teams need a clear, defined branching strategy enabling them to develop across multiple versions of the product simultaneously that is also synchronised with the Fraedom deployment schedule.
Teams @ Fraedom need the ability to:
Delivery teams need a clear, defined branching strategy enabling them to develop across multiple versions of the product simultaneously that is also synchronised with the Fraedom deployment schedule.
Teams @ Fraedom must provide support for:
This is about what is right in the Fraedom context!


a little logic gameby Q42
How to play
Play
About
0h h1 is a little logic game by Q42. It was created by Martin Kool. The concept is also known as Takuzu or Binairo. (c) 2014 www.q42.com
Select a size to play...


About Us
SendIT is a leading courier services company established in 2019. We have fast become the world best package delivery company and a leading global provider of specialized transportation and logistics services for your items. Every member of SendIT team possess a wealth of knowlegde and expertise to satisfy our customers.
Our Vision
To be the clear leader in package delivery services.
Our Mission
Our mission is to use new and cutting-edge innovations to provide the best delivery service possible.
How SendIT Works
Step 1
Click Sign Up to create an account
Step 2
Sign-in to your account
Step 3
Start by placing a delivery order
Finally
Enjoy our service!
At SendIT, we handle your package with special care!
×
×


Home
Trees
Indices
Help
pymunk API reference
[
frames
] |
no frames
]
[
Module Hierarchy
|
Class Hierarchy
]
Class Hierarchy
object
:
The most base type
pymunk.Arbiter
:
Class for tracking collisions between shapes.
pymunk.Body
pymunk.Contact
pymunk.Joint
pymunk.GrooveJoint
:
Similar to a pivot joint, but one of the anchors is on a linear slide instead of being fixed.
pymunk.PinJoint
:
Keeps the anchor points at a set distance from one another.
pymunk.PivotJoint
:
Simply allow two objects to pivot about a single point.
pymunk.SlideJoint
:
Like pin joints, but have a minimum and maximum distance.
pymunk.Shape
:
Base class for all the shapes.
pymunk.Circle
:
A circle shape defined by a radius
pymunk.Poly
:
A polygon shape
pymunk.Segment
:
A line segment shape between two points This shape is mainly intended as a static shape.
pymunk.Space
:
Spaces are the basic unit of simulation.
unreachable
._CData
:
XXX to be provided
_ctypes.Structure
:
Structure base class
pymunk.vec2d.Vec2d
:
2d vector class, supports vector and scalar operators, and also provides a bunch of high level functions
Home
Trees
Indices
Help
pymunk API reference
Generated by Epydoc 3.0.1 on Sat Nov 01 23:36:27 2008
http://epydoc.sourceforge.net