Across: 1. Able to be achieved (12) 8. Feel bad about one lad’s affair (7) 9. Poet has Bible study exchange with Christian leader coming out of cell (7) 11. Nothing about a grand run outside can be worrying (10) 12. Force to do wrong without warning! (4) 14. Repeated dire Tate changes! (8) 16. Intend to return more nasty! (6) 17. Very quietly produced a 7, possibly (3) 19. Upsetting Cora, he became a poet (6) 21. Drunk actor gets about in the sea (8) 24. Be jealous of Victor in eastern New York (4) 25. This should expand subject about the Spanish key (10) 27. Upset stomach crossing river with Olive, possibly (7) 28. Sick bird circles eastern rock (7) 29. Study large empty houses to let in Welsh county (12) Down: 1. Girl cures Eric’s greed (7) 2. Roman assassin takes in silly banal film (10) 3. Fellow is comfortable in dialogue with beasts (8) 4. Very fond of record-holding French wine (6) 5. Seaman is last to go a-roving (4) 6. Woman’s tiny part in dishonesty (7) 7. Thin bald men’s excitement at a bit of flattery (12) 10. Denied having got smaller copper inside (12) 13. Sick vicar got up, catching rodents in Italian dish (10) 15. Note the carrier’s return (3) 18. Artists’ materials for female friends? (8) 20. Parson stands by lake in a dream (7) 22. Upset about sick pet iguana (7) 23. Travel fatigue when let loose in fast car (3 3) 26. Nothing gets away from group’s search (4)


First section
Second section
Third section
Fourth section
Split
Left 1
Left 2
Left 3
Scroll
Right 1
Right 2
Right 3


The Deep End (2001) Tilda Swinton, Goran Visnjic, Jonathan Tucker, Peter Donat, Josh Lucas, Raymond J. Barry, Tamara Hope, Jordon Dorrance. Cinematography by Giles Nuttgens. Music by Peter Nashel. Screenplay by Scott McGehee and David Siegel, based on the novel "The Blank Wall" by Elisabeth Sanxay Holding. Directed by McGehee and Siegel. 99 minutes. Rated R, 4 stars (out of five stars)
Review by Ed Johnson-Ott, NUVO Newsweekly www.nuvo.net Archive reviews at http://reviews.imdb.com/ReviewsBy?Edward+Johnson-Ott To receive reviews by e-mail at no charge, send subscription requests to<EMAIL_ADDRESS>or e-mail<EMAIL_ADDRESS>with the word "subscribe" in the subject line.
"The Deep End" uses a color palette of rich earth tones surrounded by a vast array of blues. Alluring, attractive blues, but also icy and foreboding. After taking in their beauty, the eye seeks out the reassuring browns and greens, like a tired swimmer searching for the safety of land. The production works that way as well – it pulls you in initially as a crisp, thoroughly-modern thriller, with clipped exchanges between defiantly non-communicative characters. But the real draw of the film is the submerged humanity of two key players as "The Deep End" gradually reveals the melodramatic core beneath its ironic candy coating.
SPOILER ALERT: The following reveals the basic storyline. I believe the plot points are incidental, because the real rewards come in exploring the mindset of the main characters, but still, you should proceed at your own risk.
With her husband Tom, a Naval officer, often away at sea, Margaret Hall (Tilda Swinton) holds down the fort, taking care of the children, Beau (Jonathan Tucker), Paige (Tamara Hope), and Dylan (Jordon Dorrance), while her father-in-law Jack (Peter Donat) hovers in the background, always watching. The story opens with Margaret leaving the family home in Lake Tahoe to storm a male strip club in Reno. It seems that Beau, her eldest, is having an affair with Darby Reese (Josh Lucas), a disreputable sort 12 years his senior. Margaret demands that Darby leave her son alone, only to have the man smirk at her and announce he'll be glad to steer clear of Beau – for $5000.
Back at home, she tries to talk about it all with her son, but the kid won't even confirm that he's gay, let alone discuss the issues she has with his boyfriend. He does, however, get attentive when she reveals Darby's $5,000 offer, even as he maintains his sullen demeanor. Late in the evening, Darby shows up outside, tossing pebbles at Beau's window like a schoolchild. The two meet by the water at the boathouse, where something important happens. I won't reveal what; suffice to say we become aware of a significant fact that Margaret does not.
All of this happens in the first few minutes of the movie, by the way. Within a day or so, Margaret's life becomes even more complicated when a suave man named Alec Goran Visnjic) turns up with an explicit videotape documenting the sex life of Beau and Darby. He and his associate are willing to destroy the tape, once Margaret coughs up $50,000.
Oh, what's a mother to do?
END SPOILERS
Written, directed and produced by Scott McGehee and David Siegel ("Suture"), "The Deep End" is based on Elisabeth Sanxay Holding's 1940's novel, "The Blank Wall," which was also the source of the 1949 film, "The Reckless Moment." I've neither read the book nor seen the movie, but I understand that the filmmakers changed some details. In Holding's story, the "scandalous" relationship is between an older man and Margaret's teen-age daughter. Switching the gender makes the tale seem more contemporary, and it also raises questions about Margaret's motives.
Many reviews of "The Deep End" describe Margaret as a mother ferociously protecting her son, but I wonder. Consider this: Margaret lives in a meticulously kept upscale home. Her husband is absent most of the time and seems to be regarded as a larger-than-life figure. Her father-in-law is constantly present, almost as if he is monitoring for his son. And when her husband does call, Margaret is careful not to tell him about anything disturbing that is going on with the family.
 Or is she caretaker of a museum of upper middle class complacency, desperate to maintain the status quo so that everything will be postcard perfect when the old man returns from the sea? You sort it out.
Regardless, the resonance of "The Deep End" comes from two actors. Goran Visnjic, best known from the TV drama "ER," is striking as a blackmailer unlike any you've seen before. He engages Margaret in a mesmerizing dance of protocol, chivalry and simmering eroticism. But the star of this show, without a doubt, is the remarkable Tilda Swinton. Watch the shadings, depth, resource, vitality and understated sexuality she gives Margaret and try to imagine the film without her. Days after my second viewing of "The Deep End," I can still vividly picture her negotiating with villains, trying to connect with her son and diving into icy blue water. "The Deep End" is an exceptional film and Tilda Swinton is the best part of it.
© 2001 Ed Johnson-Ott
========== X-RAMR-ID: 29525 X-Language: en X-RT-ReviewID: 250611 X-RT-TitleID: 1109447 X-RT-SourceID: 591 X-RT-AuthorID: 1099 X-RT-RatingText: 4/5
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


I am an aspiring programmer who is looking to transition into the coding industry. I live in Southern California and looking for work in this area and preferably remote. I am married with a 6 months old daughter.
For the past 10 years, I have been teaching high school math and computer science in the California public school system. Due to the covid-19 pandemic, I decided to prioritize the health and safety of myself and my family and make a career change.


Module: ActiveModel::SecurePassword::ClassMethods
| Relationships & Source Files | |
| Defined in: | activemodel/lib/active_model/secure_password.rb |
Instance Method Summary
-
#has_secure_password(options = {})
Adds methods to set and authenticate against a BCrypt password.
Instance Method Details
#has_secure_password(options = {})
Adds methods to set and authenticate against a BCrypt password. This mechanism requires you to have a password_digest
attribute.
The following validations are added automatically:
-
Password must be present on creation
-
Password length should be less than or equal to 72 characters
-
Confirmation of password (using a
password_confirmation
attribute)
If password confirmation validation is not needed, simply leave out the value for password_confirmation
(i.e. don't provide a form field for it). When this attribute has a nil
value, the validation will not be triggered.
For further customizability, it is possible to supress the default validations by passing validations: false
as an argument.
Add bcrypt (~> 3.1.7) to Gemfile to use #has_secure_password
:
gem 'bcrypt', '~> 3.1.7'
Example using Active Record (which automatically includes ::ActiveModel::SecurePassword):
# Schema: User(name:string, password_digest:string)
class User < ActiveRecord::Base
has_secure_password
end
user = User.new(name: 'david', password: '', password_confirmation: 'nomatch')
user.save # => false, password required
user.password = 'mUc3m00RsqyRe'
user.save # => false, confirmation doesn't match
user.password_confirmation = 'mUc3m00RsqyRe'
user.save # => true
user.authenticate('notright') # => false
user.authenticate('mUc3m00RsqyRe') # => user
User.find_by(name: 'david').try(:authenticate, 'notright') # => false
User.find_by(name: 'david').try(:authenticate, 'mUc3m00RsqyRe') # => user
# File 'activemodel/lib/active_model/secure_password.rb', line 53
def has_secure_password( = {}) # Load bcrypt gem only when has_secure_password is used. # This is to avoid ActiveModel (and by extension the entire framework) # being dependent on a binary library. begin require 'bcrypt' rescue LoadError $stderr.puts "You don't have bcrypt installed in your application. Please add it to your Gemfile and run bundle install" raise end include InstanceMethodsOnActivation if .fetch(:validations, true) include ActiveModel::Validations # This ensures the model has a password by checking whether the password_digest # is present, so that this works with both new and existing records. However, # when there is an error, the message is added to the password attribute instead # so that the error message will make sense to the end-user. validate do |record| record.errors.add(:password, :blank) unless record.password_digest.present? end validates_length_of :password, maximum: ActiveModel::SecurePassword::MAX_PASSWORD_LENGTH_ALLOWED validates_confirmation_of :password, allow_blank: true end # This code is necessary as long as the protected_attributes gem is supported. if respond_to?(:attributes_protected_by_default) def self.attributes_protected_by_default #:nodoc: super + ['password_digest'] end end end


Protect physical storage media in the cardholder data environment.
Information storage media, which contains cardholder data, should be physically secured to ensure that a thief cannot steal it. This applies to paper hard copies as well as to digital media.
Different companies opt for different security measures. Generally speaking, physical security involves security guards, surveillance operators, surveillance equipment, physical barriers, alarms, locks, and card-based access controls. If your company has lax physical security, consider adding layers of the above-mentioned security measures until physical security is considered satisfactory.


 Plus practical full-day front-end workshops.
head
head
Person of the week
Lorem ipsum dolor sit amet consectetur adipisicing elit. Provident officiis placeat necessitatibus assumenda accusamus ratione amet deserunt ipsam harum facilis beatae corporis deleniti, possimus alias, non sunt nihil laborum vero. Lorem ipsum dolor sit amet consectetur adipisicing elit. Provident officiis placeat necessitatibus assumenda accusamus ratione amet deserunt ipsam harum facilis beatae corporis deleniti, possimus alias, non sunt nihil laborum vero. Lorem ipsum dolor sit amet consectetur adipisicing elit. Provident officiis placeat necessitatibus assumenda accusamus ratione amet deserunt ipsam harum facilis beatae corporis deleniti, possimus alias, non sunt nihil laborum vero. Lorem ipsum dolor sit amet consectetur adipisicing elit.  Assumenda itaque harum modi quidem possimus ab alias provident, voluptas quam at aut commodi labore accusamus placeat tempore, aliquid fugiat quibusdam minima.head
head
New frontend challenges to master
Performance optimization and strategies
Improving workflow and data protection
head
head
Design pattern and checklist
head
Smashing Newsletter
Imagine you wrote a beautiful song and no one discovered it. That will make any cat sad.
You can unsubscribe anytime - obviously


So you want to get into coding. Awesome! Coding is as fun as it is challenging. You may be wondering, "which language should I start with? What would suit me best?" Well, you came to the right place! Below you will find a survey that will guide you to the coding language that's right for you. God speed!
You would be most suited for the programming language.


Hi I'm
I am a graphic designer, marketing director/designer and now aspiring full stack developer.
Good ol' Fort Worth, Texas.
Working out, ruining that by eating amazing food, makeup, modeling, gardening, crafting and I am a huge animal lover.

Dallas, Texas
I love the complexity of it all. There is always an opportunity for a challenge. I also love all of the opportunies and doors this will open for me.


Freightsolver
FOR SHIPPERS
FOR HAULIERS
BENEFITS
LOG-IN
Connecting loads and hauliers
Ireland's number one freight exchange
1350
Loads per month
255000
Value of loads per month
189
Hauliers signed up
99.9
Avg member-member rating
Joost Hafmans
"VTS reduced it's empty miles by over 20%"
Michael Dixon
"We at Dixons found the system very intuitive"
John Watershed
"With the amount of work we received, profits increased by 34%"
Return Loads
Return load text here.
Learn More
Search Loads
Search load text here.
Learn More
Find Trucks
Find Truck text here.
Learn More
Shipper
€
10
/mo
Recommended for those just looking to ship.
1
User Account
1
Mobile App
10
Shipments per day
15
Allowed cancellations per month
2000
Carriers to choose from
Select Plan
Owner Driver
€
50
/mo
Recommended for Owner Driver operations.
1
User Account
1
Mobile App
100
Shipments per day
2000
Fellow carriers to work with
10000
Shippers ready and waiting
Select Plan
Haulier
€
250
/mo
Ideal for small and medium sized haulage firms.
25
User Account
50
Mobile App
1000
Shipments per day
2000
Fellow carriers to work with
10000
Shippers ready and waiting
Select Plan


Some projects only use a portion of the stream or reference tree and, in these instances, it is not necessary to check out the entire contents of the repository, such as when you are accessing, for example, a large remote repository to build a sub-module. In such cases, it may be useful to set up a sub-path. If you specify a sub-path, the plugin makes a "best effort" to ensure that only the sub-path is populated. This means that the files within the sub-path will be fetched, at least, although side-effects may result in files from other locations being fetched as well.
Directories and files must be specified in a comma-separated list and can use relative pathnames. For example, you could use:
src/com/my-company/main/my-file.java,src/com/*,src/com/webapp/my-file2.xml
where "src" is the immediate sub-folder under your stream or reference tree.
NOTES:
.


| deleteAllVisibleCookies |
|
|
| setTimeout |
10000000 |
|
| open |
/vivo/ |
|
| assertTitle |
VIVO |
|
| clickAndWait |
link=Log in |
|
| assertTitle |
Log in to VIVO |
|
| type |
loginName |
<EMAIL_ADDRESS>|
| type |
loginPassword |
Password |
| clickAndWait |
loginForm |
|
| clickAndWait |
link=Site Admin |
|
| assertTitle |
VIVO Site Administration |
|
| clickAndWait |
link=Menu ordering |
|
| assertTitle |
Default Menu |
|
| verifyTextPresent |
Menu Ordering |
|
| verifyTextPresent |
Home |
|
| verifyTextPresent |
People |
|
| verifyTextPresent |
Organizations |
|
| verifyTextPresent |
Research |
|
| verifyTextPresent |
Events |
|
| verifyValue |
id=submit |
Add new menu page |
| verifyTextPresent |
Refresh page after reordering menu items |
|
| open |
http://localhost:8080/vivo/people |
|
| assertTitle |
People |
|
| verifyTextPresent |
There is currently no People content in the system |
|
| verifyTextPresent |
You can add content and manage this site from the Site Administration page. |
|
| verifyElementPresent |
link=add content and manage this site |
|
| verifyTextPresent |
You can browse all of the public content currently in the system using the index page. |
|
| verifyElementPresent |
link=index page |
|
| verifyTextPresent |
Expecting content? |
|
| verifyTextPresent |
Try rebuilding the search index. |
|
| verifyElementPresent |
link=Try rebuilding the search index |
|
| open |
http://localhost:8080/vivo/organizations |
|
| assertTitle |
Organizations |
|
| verifyTextPresent |
There is currently no Organizations content in the system |
|
| verifyTextPresent |
You can add content and manage this site from the Site Administration page. |
|
| verifyElementPresent |
link=add content and manage this site |
|
| verifyTextPresent |
You can browse all of the public content currently in the system using the index page. |
|
| verifyElementPresent |
link=index page |
|
| verifyTextPresent |
Expecting content? |
|
| verifyTextPresent |
Try rebuilding the search index. |
|
| verifyElementPresent |
link=Try rebuilding the search index |
|
| open |
http://localhost:8080/vivo/research |
|
| assertTitle |
Research |
|
| verifyTextPresent |
There is currently no Research content in the system |
|
| verifyTextPresent |
You can add content and manage this site from the Site Administration page. |
|
| verifyElementPresent |
link=add content and manage this site |
|
| verifyTextPresent |
You can browse all of the public content currently in the system using the index page. |
|
| verifyElementPresent |
link=index page |
|
| verifyTextPresent |
Expecting content? |
|
| verifyTextPresent |
Try rebuilding the search index. |
|
| verifyElementPresent |
link=Try rebuilding the search index |
|
| open |
http://localhost:8080/vivo/events |
|
| assertTitle |
Events |
|
| verifyTextPresent |
There is currently no Events content in the system |
|
| verifyTextPresent |
You can add content and manage this site from the Site Administration page. |
|
| verifyElementPresent |
link=add content and manage this site |
|
| verifyTextPresent |
You can browse all of the public content currently in the system using the index page. |
|
| verifyElementPresent |
link=index page |
|
| verifyTextPresent |
Expecting content? |
|
| verifyTextPresent |
Try rebuilding the search index. |
|
| verifyElementPresent |
link=Try rebuilding the search index |
|
| clickAndWait |
link=People |
|
| assertTitle |
People |
|
| verifyTextPresent |
There is currently no People content in the system |
|
| verifyTextPresent |
You can add content and manage this site from the Site Administration page. |
|
| verifyElementPresent |
link=add content and manage this site |
|
| verifyTextPresent |
You can browse all of the public content currently in the system using the index page. |
|
| verifyElementPresent |
link=index page |
|
| verifyTextPresent |
Expecting content? |
|
| verifyTextPresent |
Try rebuilding the search index. |
|
| verifyElementPresent |
link=Try rebuilding the search index |
|
| clickAndWait |
link=Organizations |
|
| assertTitle |
Organizations |
|
| verifyTextPresent |
There is currently no Organizations content in the system |
|
| verifyTextPresent |
You can add content and manage this site from the Site Administration page. |
|
| verifyElementPresent |
link=add content and manage this site |
|
| verifyTextPresent |
You can browse all of the public content currently in the system using the index page. |
|
| verifyElementPresent |
link=index page |
|
| verifyTextPresent |
Expecting content? |
|
| verifyTextPresent |
Try rebuilding the search index. |
|
| verifyElementPresent |
link=Try rebuilding the search index |
|
| clickAndWait |
link=Research |
|
| assertTitle |
Research |
|
| verifyTextPresent |
There is currently no Research content in the system |
|
| verifyTextPresent |
You can add content and manage this site from the Site Administration page. |
|
| verifyElementPresent |
link=add content and manage this site |
|
| verifyTextPresent |
You can browse all of the public content currently in the system using the index page. |
|
| verifyElementPresent |
link=index page |
|
| verifyTextPresent |
Expecting content? |
|
| verifyTextPresent |
Try rebuilding the search index. |
|
| verifyElementPresent |
link=Try rebuilding the search index |
|
| clickAndWait |
link=Events |
|
| assertTitle |
Events |
|
| verifyTextPresent |
There is currently no Events content in the system |
|
| verifyTextPresent |
You can add content and manage this site from the Site Administration page. |
|
| verifyElementPresent |
link=add content and manage this site |
|
| verifyTextPresent |
You can browse all of the public content currently in the system using the index page. |
|
| verifyElementPresent |
link=index page |
|
| verifyTextPresent |
Expecting content? |
|
| verifyTextPresent |
Try rebuilding the search index. |
|
| verifyElementPresent |
link=Try rebuilding the search index |
|
| clickAndWait |
link=Home |
|
| clickAndWait |
link=Log out |
|
| assertTitle |
VIVO |
|
| verifyTextPresent |
Log in |
|


Use Architecture View to illustrate the application activity and refer to the Route(s), NgModules and Components involved in the execution of the views. It focuses on 1) routes eager and lazy loading flow and 2)view hierarchy(Component's templates and views). It describes the application activity from the app routes to the component views( component templates and its rendered components).
The Architecture View starts from one NgModule through its routes. Then, shows component hierarchy base on component's template(showing what and how to render component's view)
Uses service dependency injection tree to illustrate the service dependency relationships.
Showing the structure of NgModule and Component, exposing the whole/part relationship of NgModule and Component.
Application Structure Diagram starts from AppModule to show complete static application structure.
Showing the class metadata properties, constructor parameters, attributes and methods.


---
title: "Image Restoration: An experiment with different filters"
excerpt: "Blurring of images is a predominant problem faced in hand-held photography. Several techniques exist for restoring the sharp image from the blurred picture. This
assignment revolves mainly around the problem of Image Restoration when the blur kernel is known. Some of the approaches used in this include full inverse, truncated inverse,
Wiener filter, etc. The quality of deblurring is also measured using metrics like PSNR and SSIM. Finally restoration of a new image is done by estimating the blur kernel from scratch.
"
collection: portfolio
---
Blurring of images is a predominant problem faced in hand-held photography. Several techniques exist for restoring the sharp image from the blurred picture. This
assignment revolves mainly around the problem of Image Restoration when the blur kernel is known. Some of the approaches used in this include full inverse, truncated inverse,
Wiener filter, etc. The quality of deblurring is also measured using metrics like PSNR and SSIM. Finally restoration of a new image is done by estimating the blur kernel from scratch.
Download the report here


{{ template "chrome/default_head.html" . }} {{ $pagination := 5 }}
Most of my teaching and research has been about ideas about work and democracy in American Political Thought. My current work focuses on the varieties of work ethics, the history of social science, and the link between those two topics, and the development of American democratic thought. I'm also interested in the settlement movement, and the public practice of the liberal arts. If you'd like to know more, follow the links in the sidebar.
You can also find me digging for records on Discogs, or looking for birds in the woods.


My favorite places
These are a few of my favorite places.
Places
Here are some of my favorite places!
My Native
Jhunjhunu
Thanks for reading about my favorite places!


--- layout: post title: 'OData Service Validation Tool Update: 19 new rules' date: 2011-11-08 17:17:58.000000000 +08:00 categories: - OData tools tags: [] status: publish type: post published: true author: OData.org Archive ---
Lately the main focus for the OData Service Validation tool has been on increasing the rules in the system. In the last two weeks total of 19 new rules have been added:
This rule update brings the total number of rules in the validation tool to 97.
OData Service Validation Codeplex project is also updated with all recent changes along with documentation on how to extend the validation service by authoring rules.
Keep validating and let us know what you think either on the mailing list or on the discussions page on the Codeplex site.


Object
# File lib/heroku/client.rb, line 281 def bounce ; transition('bounce') ; end
# File lib/heroku/client.rb, line 279 def down ; transition('down') ; end
Iterate over all output chunks until EOF is reached.
# File lib/heroku/client.rb, line 308 def each until end_of_stream? sleep(@interval) output = read yield output unless output.empty? end end
Does the service have any remaining output?
# File lib/heroku/client.rb, line 284 def end_of_stream? @next_chunk.nil? end
Read the next chunk of output.
# File lib/heroku/client.rb, line 289 def read chunk = @client.get(@next_chunk) if chunk.headers[:location].nil? && chunk.code != 204 # no more chunks @next_chunk = nil chunk.to_s elsif chunk.to_s == '' # assume no content and back off @interval = 2 '' elsif location = chunk.headers[:location] # some data read and next chunk available @next_chunk = location @interval = 0 chunk.to_s end end
start the service
# File lib/heroku/client.rb, line 252 def start(command, attached=false) @attached = attached @response = @client.post( "/apps/#{@app}/services", command, :content_type => 'text/plain' ) @next_chunk = @response.to_s @interval = 0 self rescue RestClient::RequestFailed => e raise AppCrashed, e.http_body if e.http_code == 502 raise end
All output as a string
# File lib/heroku/client.rb, line 317 def to_s buf = [] each { |part| buf << part } buf.join end
# File lib/heroku/client.rb, line 267 def transition(action) @response = @client.put( "/apps/#{@app}/services/#{@upid}", action, :content_type => 'text/plain' ).to_s self rescue RestClient::RequestFailed => e raise AppCrashed, e.http_body if e.http_code == 502 raise end
Generated with the Darkfish Rdoc Generator 2.


Implements interfaces:
A help ticket within the system.
This class serves as a wrapper for SQL queries, so that one does not need to understand SQL or databases to manipulate tickets.
Located in /ticket.php (line 10)
Initializes class constants.
Finds a ticket within the database, with the given ID.
Converts the Ticket into JSON, for use with the API.
Updates the status of the ticket, both in the object and in the database.
Documentation generated on Fri, 24 Apr 2015 06:53:00 +0000 by phpDocumentor 1.4.4


Mona Road a cow pasture at night
Dear Editor,
Every night Mona Road is transformed into a cow pasture for a herd of cows.
As some sections of the road are dimly lit, often these cows seem to just appear out of nowhere.
This is a disaster waiting to happen.
These cows need to be removed before there is a serious accident.
It is a most selfish act on the part of the owner who is putting motorists at risk.
It is also rather careless for the authorities to allow this to continue for so many years.
Colin Wheeler
colinlwheeler@hotmail.com


Reports: Chelsea star set to snub new deal in favour of Barcelona move
by Sarthak SharmaBarcelona may have thought that they had their wing position sorted out with the signing of Philippe Coutinho from Liverpool, but his ineffectiveness resulted in the Brazilian being sent to Bayern Munich in the summer transfer window. Another player could now be looked at do the job on the right.
That player might well be Willian, who has impressed during Frank Lampard’s first season in charge of Chelsea, but Daily Star are now reporting that he could leave if Barcelona come calling.
His contract at Stamford Bridge is set to expire next summer, and it seems like the Brazilian wants no part of the Blues’ resurrection under Lampard, and would favour a move to the Nou Camp instead.
Even Lampard himself revealed that Willian was a player he definitely wants staying at Chelsea.
“The word isn’t ‘no-brainer’ because I can’t get involved in the money, that’s up to the club to do,” he said about a possible new deal for the winger.
 I love him at this football club, so there’s my answer.”
Willian himself admitted to DAZN that he had an offer to join Barca from Chelsea earlier.
“The only real offer I had to leave Chelsea came from Barcelona last year, after the World Cup,” he said.
“Barca presented an offer to Chelsea but it was rejected. That was the only time I ever had to discuss something like that with my family, but we really love it here [in London].
“So there were several factors that helped me stay.”


Kill idle connections to Redis
I was using a Amazon Elasticache cache.t2.medium
Redis instance as a cache store for one of the Rails application. Over the time I observed that connections to Redis instance are increasing day by day and once it hit ~1500, the Rails application started throwing connection timeout exceptions:
1
Error connecting to Redis on redis-host:6379 (Redis::TimeoutError)
On searching over internet, I found that the default parameter group has timeout
value set to 0 which means, any connection that has been initialized to redis will be kept by redis even if the connection initialized by the client is down. Well the first thing I did was to create a new parameter group and set its value to a non-zero integer. However I couldn’t apply the parameter group changes to live production application and hence started looking for alternatives.


Calculation of the mean convective heat transfer coefficient kc for a helical pipe in the laminar flow regime.
There are basically three differences:
The critical Reynolds number Re_crit in a helical pipe depends on its mean curvature diameter d_coil . The smaller the mean curvature diameter of the helical pipe, the earlier the turbulent regime will start due to vortexes out of higher centrifugal forces.
The mean convective heat transfer coefficient kc for helical pipes is calculated through the corresponding Nusselt number Nu according to [VDI 2002, p. Gc 2, eq. 5] :
Nu = 3.66 + 0.08*[1 + 0.8*(d_hyd/d_coil)^0.9]*Re^m*Pr^(1/3)
with the exponent m for the Reynolds number
m = 0.5 + 0.2903*(d_hyd/d_coil)^0.194
and the resulting mean convective heat transfer coefficient kc
kc = Nu * lambda / d_hyd
with
| d_mean | as mean diameter of helical pipe [m], |
| d_coil = f(geometry) | as mean curvature diameter of helical pipe [m], |
| d_hyd | as hydraulic diameter of the helical pipe [m], |
| h | as slope of helical pipe [m], |
| kc | as mean convective heat transfer coefficient [W/(m2K)], |
| lambda | as heat conductivity of fluid [W/(mK)], |
| L | as total length of helical pipe [m], |
| Nu = kc*d_hyd/lambda | as mean Nusselt number [-], |
| Pr = eta*cp/lambda | as Prandtl number [-], |
| Re = rho*v*d_hyd/eta | as Reynolds number [-], |
| Re_crit = f(geometry) | as critical Reynolds number [-]. |
The mean Nusselt number Nu representing the mean convective heat transfer coefficient kc is shown below for different numbers of turns n_nt at constant total length of the helical pipe.
The convective heat transfer of a helical pipe is enhanced compared to a straight pipe due to occurring turbulences resulting out of centrifugal forces. The higher the number of turns, the better is the convective heat transfer for the same length of a pipe.
Note that the ratio of hydraulic diameter to total length of helical pipe d_hyd/L has no remarkable influence on the coefficient of heat transfer kc .


UI/Visualization tools
Average no of request per month
Average response time per month
No of request not responded per month
No of Request per product and product type
No of Verbal/written response with respect to country
Highest request rate based on country
Word cloud
No of Response time taken more than 3 days per month


Body of 25-year-old woman found in lane as man arrested on suspicion of murder
The woman was "unresponsive" when she was found near to a fire station in Upton on Severn in Worcestershire on Saturday morning.
by Helen WilliamA man has been arrested on suspicion of murder after the body of a 25-year-old woman was found in Worcestershire.
The woman was "unresponsive" when she was found near to the fire station in Causeway Lane, Upton on Severn, at about 8am on Saturday, West Mercia Police said.
She was later declared dead.
Police said a 44-year-old man is in custody after being arrested on suspicion of murder.
A police cordon has been put in place and extra officers have been deployed in the area.
Detective Inspector Jim Bayliss said: "Our inquiries are very much in their early stages and at this stage the woman's death is being treated as suspicious.
"A man has been arrested and is currently in police custody.
"Extra officers will be in the area, both to carry out inquiries and to offer reassurance."
Police said the woman's next of kin have been informed.


Welcome
User Account
User Account
Edit
User Account
PhD
Master
Information Systems
Human Computer Interaction
Network Administration
Set Time
Save
CANCEL
CONFIRM


US v. California Farms
by BRIEFSACRAMENTO — Labor Secretary Eugene Scalia sued California-based blueberry companies, Munger Bros. LLC, Crowne Cold Storage LLC, et al. in federal court, claiming they hired H-2A visa workers instead of U.S. citizens.
Copyright © 2019 courthousenews.com


Toggle navigation
mango: Genomic Visualization for ADAM
Overall
Reads
Variants
Features
Frequency
mango:
Genome visualization for
ADAM
No Reads File Loaded


Unfortunately your browser is too old... Please try a modern browser such as Chrome, FireFox, Opera, or Edge.


This example shows how to fill a dropdown list using the ng-options directive.
Select a car:
When you use the ng-repeat directive to create dropdown lists, the selected value must be a string.
In this example you will have to choose between the color or the model to be your selected value.
Select a car:
Its color is: {{ selectedCar.color }}
When you use the ng-options directive to create dropdown lists, the selected value can be an object.
In this example you can display both the model and the color of the selected element.
Select a car:
This example demonstrates the use of an object as the data source when creating a dropdown list.
Note that the selected value represents an object.
Select a car:
The visible text inside the dropdown list can also be a property of the value object.


Welcome Escape Room administrator. Make sure you set your MetaMask account to one of the Escape Room Admin accounts. After switching, please refresh your page.


--- layout: example.html title: Overview map shortdesc: Example showing a Google Maps layer being used in an overview control. docs: >
This example shows a Google Maps layer being used in an overview control.
Since the overview control contains a different map instance, we also need an different olGM instance for it.
There are two google maps layers visible at the same time, we need to load them in sequence. As soon as the google maps instance in the overview control is done loading, we activate the main one. When using only one google maps layer, no delay is necessary.
---


@*
* Copyright 2021 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*@
@import uk.gov.hmrc.tai.util.IFormConstants
@(viewmodel: uk.gov.hmrc.tai.model.templates.EmploymentPensionViewModel)
What do you want to do?
Internal HMRC Copy
Tell us about income from employment or pension
Internal Information
Summary
Tell us what tax year your query is about
| Which tax year is your query about? |
@viewmodel.taxYearRange |
Your details
| National Insurance number |
@viewmodel.nino |
| First name |
@viewmodel.firstName |
| Last name |
@viewmodel.lastName |
| Date of birth |
@viewmodel.dateOfBirth |
| Can we contact you by telephone? |
@viewmodel.telephoneContactAllowed |
| Telephone number |
@viewmodel.telephoneNumber |
| Is your address in the UK? |
Yes |
| UK address |
@viewmodel.addressLine1
@viewmodel.addressLine2
@viewmodel.addressLine3
@viewmodel.postcode |
What do you want to tell us?
| Do you have an employment or
pension that is incorrect? |
@viewmodel.isUpdate |
| Do you have an employment or
pension that is missing? |
@viewmodel.isAdd |
| Do you have an employment or
pension that has ended? |
@viewmodel.isEnd |
Employer details
| Employer name |
@viewmodel.employmentPensionName |
| Do you know your payroll number? |
@viewmodel.payrollNumber |
@if(viewmodel.isEnd == IFormConstants.Yes){
| Has your employment or pension ended? |
My employment has ended on @viewmodel.endDate |
}else{
Tell us what is incorrect and why: |
@if(viewmodel.isAdd == IFormConstants.Yes) {
I want to add a missing employment which started on @viewmodel.startDate |
} else {
@viewmodel.whatYouToldUs |
}
}


Easy Card
Easy Card is an application for collecting credit card payments on mobile phone (iOS and Android). The main challenge that Bright Inventions took and successfully overcame was to integrate with various custom hardware, including magnetic card swipers.
- scanning magnetic credit cards
- scanning credit cards using device camera
- collecting electronic signature
- generating receipts and sending them via email
- support for both left-to-right and right-to-left UI orientations


Menu
Staff Login
A waiter is on the way!
Press for Assistance
Staff Login
User ID
Password
Login
Cancel
Starters
Mains
Desserts
Drinks
Table
Order:
Submit Order
Modify Item
You have too many items in your order!
You have too many items in your order!


Class Utility
Static class full of miscellaneous helper methods.
Inheritance
Inherited Members
Namespace: GoRogue
Assembly: GoRogue.dll
Syntax
public static class Utility
Methods
| Improve this Doc View SourceAsReadOnly<K, V>(IDictionary<K, V>)
Adds an AsReadOnly method to IDictionary, similar to the AsReadOnly method of IList, that returns a read-only reference to the dictionary.
Declaration
public static ReadOnlyDictionary<K, V> AsReadOnly<K, V>(this IDictionary<K, V> dictionary)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IDictionary<K, V> | dictionary | Dictionary to create a read-only reference to -- never specified manually as this is an extension method. |
Returns
| Type | Description |
|---|---|
| System.Collections.ObjectModel.ReadOnlyDictionary<K, V> | A ReadOnlyDictionary instance for the specified dictionary. |
Type Parameters
| Name | Description |
|---|---|
| K | Type of keys of the dictionary. |
| V | Type of values of the dictionary. |
ExtendToString<T>(T[,], String, String, Func<T, String>, String, String, String, String)
Extension method for 2D arrays allowing printing the contents. Takes characters to surround the array, and each row, the method used to get the string representation of each element (defaulting to the ToString function of type T), and separation characters for each element and row.
Declaration
public static string ExtendToString<T>(this T[, ] array, string begin = "[\n", string beginRow = "\t[", Func<T, string> elementStringifier = null, string rowSeparator = ",\n", string elementSeparator = ", ", string endRow = "]", string end = "\n]")
Parameters
| Type | Name | Description |
|---|---|---|
| T[,] | array | The array to stringify -- never specified manually as this is an extension method. |
| System.String | begin | Character(s) that should precede the array. |
| System.String | beginRow | Character(s) that should precede each row. |
| System.Func<T, System.String> | elementStringifier | Function to use to get the string representation of each value. Null uses the ToString function of type T. |
| System.String | rowSeparator | Character(s) to separate each row from the next. |
| System.String | elementSeparator | Character(s) to separate each element from the next. |
| System.String | endRow | Character(s) that should follow each row. |
| System.String | end | Character(s) that should follow the array. |
Returns
| Type | Description |
|---|---|
| System.String | A string representation of the 2D array. |
Type Parameters
| Name | Description |
|---|---|
| T | Type of elements in the 2D array. |
ExtendToString<T>(IEnumerable<T>, String, Func<T, String>, String, String)
Extension method for generic IEnumerable/List collection allowing printing the contents. Takes the characters to surround the list in, the method to use to get the string representation of each element (defaulting to the ToString function of type T), and the characters to use to separate the list elements.
Declaration
public static string ExtendToString<T>(this IEnumerable<T> enumerable, string begin = "[", Func<T, string> elementStringifier = null, string separator = ", ", string end = "]")
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IEnumerable<T> | enumerable | IEnumerable to stringify -- never specified manually as this is an extension method. |
| System.String | begin | Character(s) that should precede the list elements. |
| System.Func<T, System.String> | elementStringifier | Function to use to get the string representation of each element. Null uses the ToString function of type T. |
| System.String | separator | Characters to separate the list by. |
| System.String | end | Character(s) that should follow the list elements. |
Returns
| Type | Description |
|---|---|
| System.String | A string representation of the IEnumerable. |
Type Parameters
| Name | Description |
|---|---|
| T | Type of elements in the IEnumerable. |
Remarks
Defaults to a representation looking something like [elem1, elem2, elem3].
ExtendToString<T>(ISet<T>, String, Func<T, String>, String, String)
Extension method for sets allowing printing the contents. Takes the characters to surround the set elements in, the method to use to get the string representation of each element (defaulting to the ToString function of type T), and the characters to use to separate the set elements.
Declaration
public static string ExtendToString<T>(this ISet<T> set, string begin = "set(", Func<T, string> elementStringifier = null, string separator = ", ", string end = ")")
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.ISet<T> | set | Set to stringify -- never specified manually as this is an extension method. |
| System.String | begin | Character(s) that should precede the set elements. |
| System.Func<T, System.String> | elementStringifier | Function to use to get the string representation of each element. Null uses the ToString function of type T. |
| System.String | separator | Characters to separate the list by. |
| System.String | end | Character(s) that should follow the list elements. |
Returns
| Type | Description |
|---|---|
| System.String | A string representation of the ISet. |
Type Parameters
| Name | Description |
|---|---|
| T | Type of elements in the IEnumerable. |
Remarks
Defaults to a representation looking something like set(elem1, elem2, elem3).
ExtendToString<K, V>(IDictionary<K, V>, String, Func<K, String>, Func<V, String>, String, String, String)
Extension method for dictionaries allowing printing the contents. Takes the characters to surround the dictionary elements in, the method to use to get the string representation of each key and value (defaulting to the ToString function of the types), and the characters to use to separate the value from keys, and the key-value pairs.
Declaration
public static string ExtendToString<K, V>(this IDictionary<K, V> dictionary, string begin = "{", Func<K, string> keyStringifier = null, Func<V, string> valueStringifier = null, string kvSeparator = " : ", string pairSeparator = ", ", string end = "}")
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IDictionary<K, V> | dictionary | Dictionary to stringify -- never specified manually as this is an extension method. |
| System.String | begin | Character(s) that should precede the dictionary elements. |
| System.Func<K, System.String> | keyStringifier | Function to use to get the string representation of each key. Null uses the ToString function of type K. |
| System.Func<V, System.String> | valueStringifier | Function to use to get the string representation of each value. Null uses the ToString function of type V. |
| System.String | kvSeparator | Characters to separate each value from its key. |
| System.String | pairSeparator | Characters to separate each key-value pair from the next. |
| System.String | end | Character(s) that should follow the dictionary elements. |
Returns
| Type | Description |
|---|---|
| System.String | A string representation of the IDictionary. |
Type Parameters
| Name | Description |
|---|---|
| K | Type of keys of the dictionary. |
| V | Type of values of the dictionary. |
Remarks
Defaults to a representation looking something like {key : value, key : value}.
ExtendToStringGrid<T>(T[,], Int32, String, String, Func<T, String>, String, String, String, String)
Extension method for 2D arrays allowing printing the contents, as if the array represents a grid-map. This differs from ExtendToString in that this method prints the grid where array[x+1, y] is printed to the RIGHT of array[x, y], rather than BELOW it. Effectively it assumes the indexes being used are grid/coordinate plane coordinates. Takes the size of the field to give each element, characters to surround the array, and each row, the method used to get the string representation of each element (defaulting to the ToString function of type T), and separation characters for each element and row.
Declaration
public static string ExtendToStringGrid<T>(this T[, ] array, int fieldSize, string begin = "", string beginRow = "", Func<T, string> elementStringifier = null, string rowSeparator = "\n", string elementSeparator = " ", string endRow = "", string end = "")
Parameters
| Type | Name | Description |
|---|---|---|
| T[,] | array | The array to stringify -- never specified manually as this is an extension method. |
| System.Int32 | fieldSize | The amount of space each element should take up in characters. A positive number aligns the text to the right of the space, while a negative number aligns the text to the left. |
| System.String | begin | Character(s) that should precede the array. |
| System.String | beginRow | Character(s) that should precede each row. |
| System.Func<T, System.String> | elementStringifier | Function to use to get the string representation of each value. Null uses the ToString function of type T. |
| System.String | rowSeparator | Character(s) to separate each row from the next. |
| System.String | elementSeparator | Character(s) to separate each element from the next. |
| System.String | endRow | Character(s) that should follow each row. |
| System.String | end | Character(s) that should follow the array. |
Returns
| Type | Description |
|---|---|
| System.String | A string representation of the 2D array, as if the array is a 2D grid-based map. |
Type Parameters
| Name | Description |
|---|---|
| T | Type of elements in the 2D array. |
ExtendToStringGrid<T>(T[,], String, String, Func<T, String>, String, String, String, String)
Extension method for 2D arrays allowing printing the contents, as if the array represents a grid-map. This differs from ExtendToString in that this method prints the grid where array[x+1, y] is printed to the RIGHT of array[x, y], rather than BELOW it. Effectively it assumes the indexes being used are grid/coordinate plane coordinates. Takes characters to surround the array, and each row, the method used to get the string representation of each element (defaulting to the ToString function of type T), and separation characters for each element and row.
Declaration
public static string ExtendToStringGrid<T>(this T[, ] array, string begin = "", string beginRow = "", Func<T, string> elementStringifier = null, string rowSeparator = "\n", string elementSeparator = " ", string endRow = "", string end = "")
Parameters
| Type | Name | Description |
|---|---|---|
| T[,] | array | The array to stringify -- never specified manually as this is an extension method. |
| System.String | begin | Character(s) that should precede the array. |
| System.String | beginRow | Character(s) that should precede each row. |
| System.Func<T, System.String> | elementStringifier | Function to use to get the string representation of each value. Null uses the ToString function of type T. |
| System.String | rowSeparator | Character(s) to separate each row from the next. |
| System.String | elementSeparator | Character(s) to separate each element from the next. |
| System.String | endRow | Character(s) that should follow each row. |
| System.String | end | Character(s) that should follow the array. |
Returns
| Type | Description |
|---|---|
| System.String | A string representation of the 2D array, as if the array is a 2D grid-based map. |
Type Parameters
| Name | Description |
|---|---|
| T | Type of elements in the 2D array. |
FisherYatesShuffle<T>(List<T>, IGenerator)
Extension method for List that implements a fisher-yates shuffle. Modifies the list it is called on to randomly rearrange the elements therein.
Declaration
public static void FisherYatesShuffle<T>(this List<T> list, IGenerator rng = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.List<T> | list | List being operated on -- never specified manually as this is an extension method. |
| Troschuetz.Random.IGenerator | rng | RNG to use. |
Type Parameters
| Name | Description |
|---|---|
| T | Type of elements in the list. |
Remarks
Since this is an extension method, if we have a List<T> myList, we can simply call myList.FisherYatesShuffle(rng). However, do note that for the method to be detected properly, the namespace GoRogue (the namespace the Utility class is in) must be in a using statement.
Multiply(String, Int32)
"Multiplies", aka repeats, a given string the given number of times.
Declaration
public static string Multiply(this string str, int numTimes)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | str | String to repeat. Never specified manually since this is an extension method. |
| System.Int32 | numTimes | The number of times to repeat the string. |
Returns
| Type | Description |
|---|---|
| System.String | The string str repeated numTimes times. |
RandomIndex<T>(IReadOnlyList<T>, Func<Int32, Boolean>, IGenerator)
Extension method that selects and returns a random valid index from the list for which the selector function given returns true, using the rng specified. Indices are repeatedly selected until a qualifying index is found. -1 is returned if the list is empty.
Declaration
public static int RandomIndex<T>(this IReadOnlyList<T> list, Func<int, bool> selector, IGenerator rng = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IReadOnlyList<T> | list | List being operated on -- never specified manually as this is an extension method. |
| System.Func<System.Int32, System.Boolean> | selector | Function that returns true if the given index is valid selection, false otherwise. |
| Troschuetz.Random.IGenerator | rng | RNG to use. |
Returns
| Type | Description |
|---|---|
| System.Int32 | Index selected. |
Type Parameters
| Name | Description |
|---|---|
| T | Type of elements in the list. |
RandomIndex<T>(IReadOnlyList<T>, IGenerator)
Extension method that selects and returns a random valid index from the list, using the rng specified. -1 is returned if the list is empty.
Declaration
public static int RandomIndex<T>(this IReadOnlyList<T> list, IGenerator rng = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IReadOnlyList<T> | list | List being operated on -- never specified manually as this is an extension method. |
| Troschuetz.Random.IGenerator | rng | RNG to use. |
Returns
| Type | Description |
|---|---|
| System.Int32 | Index selected. |
Type Parameters
| Name | Description |
|---|---|
| T | Type of elements in the list. |
RandomItem<T>(IReadOnlyList<T>, Func<T, Boolean>, IGenerator)
Extension method that selects and returns a random item from the list for which the given selector returns true, using the rng specified. Items are repeatedly selected until a qualifying item is found. Default for type T is returned if the list is empty.
Declaration
public static T RandomItem<T>(this IReadOnlyList<T> list, Func<T, bool> selector, IGenerator rng = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IReadOnlyList<T> | list | List being operated on -- never specified manually as this is an extension method. |
| System.Func<T, System.Boolean> | selector | Function that returns true if the given item is valid selection, false otherwise. |
| Troschuetz.Random.IGenerator | rng | RNG to use. |
Returns
| Type | Description |
|---|---|
| T | Item selected. |
Type Parameters
| Name | Description |
|---|---|
| T | Type of elements in the list. |
RandomItem<T>(IReadOnlyList<T>, IGenerator)
Extension method that selects and returns a random item from the list, using the rng specified. Default for type T is returned if the list is empty.
Declaration
public static T RandomItem<T>(this IReadOnlyList<T> list, IGenerator rng = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IReadOnlyList<T> | list | List being operated on -- never specified manually as this is an extension method. |
| Troschuetz.Random.IGenerator | rng | RNG to use. |
Returns
| Type | Description |
|---|---|
| T | Item selected. |
Type Parameters
| Name | Description |
|---|---|
| T | Type of elements in the list. |
Swap<T>(ref T, ref T)
Convenience function that swaps the values pointed to by x and y.
Declaration
public static void Swap<T>(ref T lhs, ref T rhs)
Parameters
| Type | Name | Description |
|---|---|---|
| T | lhs | Left-hand value. |
| T | rhs | Right-hand value. |
Type Parameters
| Name | Description |
|---|---|
| T | Type of values being swapped -- generally determinable implicitly by the compiler. |
Yield<T>(T)
Convenience function that yields the given item as a single-item IEnumerable.
Declaration
public static IEnumerable<T> Yield<T>(this T item)
Parameters
| Type | Name | Description |
|---|---|---|
| T | item | The item to yield. Never specified manually as this is an extension method. |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<T> | An IEnumerable containing only the item the function is called on. |
Type Parameters
| Name | Description |
|---|---|
| T | Type of the item. Generally the compiler determines this since it is an extension method. |
Yield<T>(T[])
Convenience function that takes multiple parameters and converts them to an IEnumerable.
Declaration
public static IEnumerable<T> Yield<T>(params T[] values)
Parameters
| Type | Name | Description |
|---|---|---|
| T[] | values | Parameters (specified as multiple parameters to the function) |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<T> | An IEnumerable of all of the given items, in the order they were given to the function. |
Type Parameters
| Name | Description |
|---|---|
| T | Type of the parameters. |


--- layout: public-atf footer-space: true current: apis page-title: API Reference permalink: '/apis.html' ---
Welcome to the SaferWall API documentation.
The SaferWall API allows you to leverage detection services and resources within the SaferWall cloud in a simple, programmatic way using conventional HTTP requests. The endpoints are intuitive and powerful, allowing you to easily make calls to retrieve information or to execute actions.
All of the functionality that you are familiar with in the SaferWall web interface is also available through the API, allowing you to script the complex actions that your situation requires.
The API documentation will start with a general overview about the design and technology that has been implemented, followed by reference information about specific endpoints.
Any tool that can speak the HTTP protocom can communicate with the API simply by requesting the correct URI. Requests should be made using the HTTPS protocol so that traffic is encrypted. The interface responds to different methods depending on the action required.
| Method | Usage |
|---|---|
| GET | For simple retrieval of information about a sample, url, or a user, you should use the GET method. The information you request will be returned to you as a JSON object. The attributes defined by the JSON object can be used to form additional requests. Any request using the GET method is read-only and will not affect any of the objects you are querying. |
| DELETE | To delete sample, url or to remove a user from your organization, the DELETE method should be used. This will remove the specified object if it is found. If it is not found, the operation will return a response indicating that the object was not found. This idempotency means that you do not have to check for a resource's availability prior to issuing a delete command, the final state will be the same regardless of its existence. |
| PUT | To update the information about a sample, url or a user in your account, the PUT method is available. Like the DELETE Method, the PUT method is idempotent. It sets the state of the target using the provided values, regardless of their current values. Requests using the PUT method do not need to check the current attributes of the object. |
| POST | To create a new object (like a sample), your request should specify the POST method. The POST request includes all of the attributes necessary to create a new object. When you wish to create a new object, send a POST request to the target endpoint. |
| HEAD | Finally, to retrieve metadata information, you should use the HEAD method to get the headers. This returns only the header of what would be returned with an associated GET request. Response headers contain some useful information about your API access and the results that are available for your request. For instance, the headers contain your current rate-limit value and the amount of time available until the limit resets. It also contains metrics about the total number of objects found, pagination information, and the total content length. |
A user represent an account in SaferWall service. By sending requests to the Users endpoint, you can list, update, or delete users.
Retrieve information about the all users.
API Key Required: Yes
Request Type: GET
curl -H 'API-Key: EXAMPLE' https://api.saferwall.com/v1/users/
{
"items": [
{
"kathygordon": {
"api_quota": 10,
"bio": "I hack stuff.",
"confirmed": false,
"email"<EMAIL_ADDRESS>"first_name": "Robert",
"last_name": "Cain",
"last_seen":<PHONE_NUMBER>,
"member_since": 842618537,
}
},
{
"michael08": {
"api_quota": 10,
"bio": "Hacking is not a crime.",
"confirmed": true,
"email"<EMAIL_ADDRESS>"first_name": "Alexander",
"last_name": "Mcfarland",
"last_seen":<PHONE_NUMBER>,
"member_since": 196385200,
}
},
{
"roger01": {
"api_quota": 10,
"bio": "Malware enthusiast.",
"confirmed": false,
"email"<EMAIL_ADDRESS>"first_name": "Anthony",
"last_name": "Mcdonald",
"last_seen":<PHONE_NUMBER>,
"member_since":<PHONE_NUMBER>,
}
}
]
}
Delete all users in your organization.
API Key Required: Yes
Request Type: DELETE
curl -X DELETE -H 'API-Key: EXAMPLE' https://api.saferwall.com/v1/users/


Directory
Enterprise data search engine
Enterprise data made easy
Share files securely with your colleagues
Share Excel, Oracle, SQL Server securely with your colleagues
Share Excel and RDBMS data securely with your colleagues
Share speadsheets and databases securely with your colleagues
Share speadsheets and SQL data securely with your colleagues
Collaborate securely on speadsheets and databases with your team
Share Excel and databases securely with your colleagues
Securely share data with your colleagues
Share spreadsheets and databases in the enterprise
Share data securely with your colleagues
Big data made easy


Download the latest version of the Framework and open its contents.
You will find several files, which you will use as the basis of work for your landing page.
Open in any text or code editor (Notepad, Sublime text ...) the files:
Run index.html in any browser to see the changes as you work.
You can now make the modifications that the framework allows
Choose between 2 types of configurations, for Header as well as for images, content or footer. You only have to change the code of the label and combine the settings as you like.
It will suffice to change between option a and b of the main parameters:
If you use the "a" option, the result will be the following:
If you use option "b" the result will be as follows:
Thanks to this tool you can have a grid in which to perfectly match your web designs.You just need to add the class grid (class = "grid") to the body tag of your web, and you can use it.
The pictures shown in the bottom of the web have three different sizes.
Thanks to this tool you can have 56 different combinations of landing page configured in seconds thanks to the two options ("a" or "b") that we put in your hand. Soon the range of configuration options will be extended, so I recommend that you pay attention to the martindipity social networks where the launch announcements will be made.


Pets CheckboxGroup. Each has value. Acts like MultiSelectList. none, one ore more items can be checked.
cat
dog
zook
zebra
wumpa
Single CheckboxToggle Only. Acts like RadioGroup on/off switch.
ToggleMe


I really, really wish GitHub had a slightly lower entry point for Teams/Organizations. I’d like to do everything for rewrite in a single organization on GitHub, rather than all under … but $25/month is frankly kind of steep for one developer. I’d be happy paying $10/month for just organization management, with the jump to $25 for supporting multiple developers. As is, though… GitLab looks appealing, whatever its other weaknesses.


EDF Renewables’ Raphael Declercq on the importance of energy efficiency for grid resilience
At VERGE 19, the executive vice president of distributed solutions and strategy at EDF Renewables, Rahpael Declercq, shares the ways his team strategizes to integrate energy efficient softwares into large-scale solar, wind and electric vehicle smart charging programs. Raphael notes that businesses are beginning to understand the real benefits of investing in grid resilience strategies, especially after the massive power outages that occurred across California in late 2019. He also provides insightful advice for how corporations can holistically incorporating energy efficiency into their strategy.


MNFUserEvent
@interface MNFUserEvent : MNFObject
The MNFUserEvent class encapsulates user event json data from the server in an object.
A user event should not be directly initialized. It is created by fetching a user feed using MNFFeed. A user event will be created as part of a feed data.
-
@abstract The text that species the action on the object
Declaration
Objective-C
@property (readonly, strong, nonatomic) NSString *_Nonnull actionText;
Swift
var actionText: String { get }
-
@abstract The body of the user event which is displayed to the user. For example for a transaction user event:
This is your first transaction here
.Declaration
Objective-C
@property (readonly, strong, nonatomic) NSString *_Nonnull body;
Swift
var body: String { get }
-
@abstract The channel identifier the user event belongs to.
Declaration
Objective-C
@property (readonly, strong, nonatomic) NSNumber *_Nonnull channelId;
Swift
var channelId: NSNumber { get }
-
@abstract The display color of the user event.
Declaration
Objective-C
@property (readonly, strong, nonatomic) NSString *_Nonnull displayColor;
Swift
var displayColor: String { get }
-
@abstract The display icon identifier.
Declaration
Objective-C
@property (readonly, strong, nonatomic) NSNumber *_Nonnull displayIconIdentifier;
Swift
var displayIconIdentifier: NSNumber { get }
-
@abstract Event type identifier.
Declaration
Objective-C
@property (readonly, strong, nonatomic) NSString *_Nonnull eventTypeIdentifier;
Swift
var eventTypeIdentifier: String { get }
-
@abstract Should exclude the event.
Declaration
Objective-C
@property (readonly, strong, nonatomic) NSNumber *_Nonnull exclude;
Swift
var exclude: NSNumber { get }
-
@abstract Whether the user event is dynamically generated.
Declaration
Objective-C
@property (readonly, strong, nonatomic) NSNumber *_Nonnull isDynamic;
Swift
var isDynamic: NSNumber { get }
-
@abstract Whether the user event is grouped.
Declaration
Objective-C
@property (readonly, strong, nonatomic) NSNumber *_Nonnull isGrouped;
Swift
var isGrouped: NSNumber { get }
-
@abstract The segment the generated user event belongs to if he belongs to a specific segment.
Declaration
Objective-C
@property (readonly, strong, nonatomic, nullable) NSNumber *segmentId;
Swift
var segmentId: NSNumber? { get }
-
@abstract The title of the user event.
Declaration
Objective-C
@property (readonly, strong, nonatomic) NSString *_Nonnull title;
Swift
var title: String { get }
-
@abstract The topic id the user event relates to.
Declaration
Objective-C
@property (readonly, strong, nonatomic) NSNumber *_Nonnull topicId;
Swift
var topicId: NSNumber { get }
-
@abstract The name of the topic the user event relates to.
Declaration
Objective-C
@property (readonly, strong, nonatomic) NSString *_Nonnull topicName;
Swift
var topicName: String { get }
-
@absttract The type of feed item you are working with.
Declaration
Objective-C
@property (readonly, strong, nonatomic) NSString *_Nonnull typeName;
Swift
var typeName: String { get }
-
@abstract The data for the given user event.
Declaration
Objective-C
@property (readonly, strong, nonatomic) NSDictionary *_Nonnull userEventData;
Swift
var userEventData: [AnyHashable : Any] { get }
-
@abstract User event type id
Declaration
Objective-C
@property (readonly, strong, nonatomic) NSNumber *_Nonnull userEventTypeId;
Swift
var userEventTypeId: NSNumber { get }
-
@abstract The user id the given feed it em is for.
Declaration
Objective-C
@property (readonly, strong, nonatomic) NSNumber *_Nonnull userId;
Swift
var userId: NSNumber { get }


I write code to solve problems.
Hi, my name is Mohammad and I love coding.
Programming Languages that I am very happy to deal with day-to-day: Html, JavaScript, Css, PHP
I love to componontize the web.
I believe in jQuery concept write less do more.
Bunch of features with Authentication, no-sql realtime database, hosting, storage and much more.


Robert Talbert, Grand Valley State University
Twitter: @RobertTalbert / Google+: +RobertTalbert
Wilfrid Laurier University, 12 December 2014
Recap of the homework
Goals/concerns/questions
Presentation and demo of flipped calculus course
Open question/answer time [20min]
Group brainstorming: What could flipped learning look like in your classes?
Ending activity: What now?
See Executive Summary handout for links to resources
All resources here are free, licensed under Creative Commons
You are entitled to free, one-on-one consultation with me for one month -- email<EMAIL_ADDRESS>to set up an appointment
[5 minutes] In groups of 2--3, finish these sentences:
Phrased as actionable tasks
Put in a public space
Explicitly linked to assessment
"Both/and" rather than "either/or"
Structured : Guide learners through the process of self-learning
Low-risk: Penalties for non-submission > penalties for incorrect work
High-reward: Incentive for completion > cost of doing the work
Wrong: "Please read Section 2.1 and let me know if you have questions"
Clarifying student/prof roles and expectations
Regular solicitiation of feedback
...And actually acting on student feedback
Regular formative assessment
...And actually acting on the data
Listening to students -- verbal, nonverbal, and data
Web site: http://teaching.proftalbert.com/mth201f14
See the Executive Summary handout for links to course materials
Questions to ask as you listen: What are the structural elements? What is the design and pedagogical philosophy? How is this similar/different from the courses I am interested in flipping? What are students thinking and doing?
[15 minutes] How could you implement flipped learning in one of your classes? Pick a class, maybe one 50-minute session of one of those classes. Then come up with ideas for:
[10 minutes] In small or large groups:


This inspections checks for shadowed XSLT variables which can lead to possibly undesired effects.
Powered by XPathView + XSLT-Support


--- layout: post title: VirtualBox SDK Machine Status date: 2010-04-22 14:54:10.000000000 +01:00 categories: - virtualbox tags: - conky - linux - python - virtualbox status: publish type: post published: true meta: _edit_last: '4005008' _wpas_done_twitter: '1' _thumbnail_id: '189' author: Marcus Ramsden ---
I have taken to using VirtualBox in my day to day development work. The reason for this is it provides a nicely isolated development sandbox which I can go ahead and clutter up with the usual tools, then when things go wrong I just have to trash the machine and clone from an existing image that I have pre-made. So far this has made life much easier for me.
My preferred approach to running my machines is to start them up in headless mode and then shell into them using a static IP assigned through the VirtualBox host-only network. The only issue with using headless mode is that there is potentially no indication of the state of the machine, basically when can I shell into my machine? Since I was already using conky to report the status of my host machine I thought that I would add to my conkyrc so that I could see the state of play with regards to VirtualBox and the machines available to it.
I decided to make use of the VirtualBox Python SDK to write a small application that can report on the status of my machines. The deb installation of VirtualBox supplied by Sun/Oracle contains the SDK as well, I am unsure if this is the case for the version of VirtualBox OSE available on the Ubuntu repositories. Also I don't know what the state of play is with other linux distributions. You may want to download the SDK anyway as this includes all of the documentation for using the API.
So with that out the way onto the script that I created to report the status of my machines;
[sourcecode language="python"]
#!/usr/bin/env python
from vboxapi import VirtualBoxManager
import getopt
import sys
opts, args = getopt.getopt(sys.argv[1:], "", ['conky', 'vbox-version'])
useConky = False
for o, a in opts:
if o == '--conky':
useConky = True
virtualBoxManager = VirtualBoxManager('XPCOM', None)
virtualBox = virtualBoxManager.vbox
for o, a in opts:
if o == '--vbox-version':
print virtualBox.version
sys.exit(0)
machines = virtualBox.getMachines()
for machine in machines:
machineName = machine.name
machineStatus = "null"
machineStatuses = {
0: 'null',
1: '${color red}powered off$color' if useConky else 'powered off',
2: '${color red}saved$color' if useConky else 'saved',
3: '${color yellow}teleported$color' if useConky else 'teleported',
4: '${color red}aborted$color' if useConky else 'aborted',
5: '${color green}running$color' if useConky else 'running',
6: '${color yellow}paused$color' if useConky else 'paused',
7: '${color red}stuck$color' if useConky else 'stuck',
8: '${color blue}teleporting$color' if useConky else 'teleporting',
9: '${color blue}live snapshotting$color' if useConky else 'live snapshotting',
10: '${color blue}starting$color' if useConky else 'starting',
11: '${color blue}stopping$color' if useConky else 'stopping',
12: '${color blue}saving$color' if useConky else 'saving',
13: '${color blue}restoring$color' if useConky else 'restoring'
}
machineStatus = machineStatuses.get(machine.state)
print machineName, "-", machineStatus
[/sourcecode]
This script will accept the following arguments when executed;
virtualboxstatus [--conky] [--vbox-version] --conky Adds any additional colors for conky to render. --vbox-version Displays the installed version of VirtualBox then exits.
Once this script is made we just need to add it to our conkyrc in order to render the status of our machines. In my conkyrc I added the following;
[sourcecode]
${color red}VIRTUALBOX STATUS$color - Version ${execpi 600 ~/bin/virtualboxstatus --vbox-version}
${execpi 1 ~/bin/virtualboxstatus --conky}
[/sourcecode]


EmpiricalCalibration is part of the OHDSI Methods Library.
This R package contains routines for performing empirical calibration of observational study estimates. By using a set of negative control hypotheses we can estimate the empirical null distribution of a particular observational study setup. This empirical null distribution can be used to compute a calibrated p-value, which reflects the probability of observing an estimated effect size when the null hypothesis is true taking both random and systematic error into account, as described in the paper Interpreting observational studies: why empirical calibration is needed to correct p-values.
Also supported is empirical calibration of confidence intervals, based on the results for a set of negative and positive controls, as described in the paper Empirical confidence interval calibration for population-level effect estimation studies in observational healthcare data.
data(sccs) #Load one of the included data sets
negatives <- sccs[sccs$groundTruth == 0,] #Select the negative controls
null <- fitNull(logRr = negatives$logRr, seLogRr = negatives$seLogRr) #Fit the null distribution
positive <- sccs[sccs$groundTruth == 1,] #Select the positive control
#Create the plot above:
plotCalibrationEffect(logRrNegatives = negatives$logRr,
seLogRrNegatives = negatives$seLogRr,
logRrPositives = positive$logRr,
seLogRrPositives = positive$seLogRr,
null = null)
#Compute the calibrated p-value:
calibrateP(null = null, logRr = positive$logRr, seLogRr = positive$seLogRr) #Compute calibrated p-value
[1] 0.8390598
In R, use the following commands to install the latest stable version from CRAN:
To install the latest development version directly from GitHub, use:


Republican philosophy leans more towards individual freedoms, rights and responsibilities.
In contrast, Democrats attach greater importance to equality and social/community responsibility.
One of the fundamental differences between Democratic and Republican party ideals is around the role of government.
Democrats tend to favor a more active role for government in society and believe that such involvement can improve the quality of people's lives and help achieve the larger goals of opportunity and equality.
On the other hand, Republicans tend to favor a small government — both in terms of the number of people employed by the government and in terms of the roles and responsibilities of government in society. They see "big government" as wasteful and an obstacle to getting things done. Their approach is Darwinian capitalism in that strong businesses should survive in a free market rather than the government influencing—through regulation—who wins or loses in business.
Republicans: Prefer increasing military spending and have a more hard line stance against countries like Iran, with a higher tendency to deploy the military option.
Democrats: Prefer lower increases in military spending and are comparatively more reluctant to using military force against countries like Iran, Syria and Libya.
Democrats favor more gun control laws e.g. oppose the right to carry concealed weapons in public places.
Republicans oppose gun control laws and are strong supporters of the Second Amendment (the right to bear arms) as well as the right to carry concealed weapons.
Democrats support abortion rights and keeping elective abortions legal.
Republicans believe abortions should not be legal and that Roe v. Wade笔记：罗诉韦德案，在该案中美国最高法院判决堕胎不违反宪法）a legal case in the US Supreme Court that decided that abortion is allowed by the Constitution should be overturned.
Democrats tend to favor equal rights for gay同性恋者（尤指男性）a person who is homosexual , especially a man and lesbian女同性恋者a woman who is sexually attracted to other women couples e.g. the right to get married and adopt children.

Democrats support progressive taxes. A progressive tax system is one where high-income individuals pay taxes at a higher rate. This is the how federal income tax brackets are currently set up. For example, the first $10,000 in income is taxed at 10% but marginal income over $420,000 is taxed at 39.6%.
Republicans support regressive taxation (tax cuts for everyone, rich and poor alike). They believe that a smaller government would need less revenue from taxes to sustain itself. Some Republicans are proponents倡导者；支持者；拥护者a person who supports an idea or course of action of a "flat tax" where all people pay the same percentage of their income in taxes regardless of income level. They consider higher tax rates on the rich a form of class warfare.
Democrats see America as a nation of immigrants. They want to welcome asylum（政治）庇护，避难 protection that a government gives to people who have left their own country, usually because they were in danger for political reasons seekers and refugees. Obama created the Deferred Action for Childhood Arrivals program, also known as DACA. DACA protected from deportation驱逐出境 people who were brought to the United States as children.
Republican immigration policies seek to protect American workers and industries. Trump's immigration policies follow economic nationalism. For example, he wants to complete the border wall with Mexico.He has threatened to deport把（违法者或无居留权的人）驱逐出境；递解出境 to force sb to leave a country, usually because they have broken the law or because they have no legal right to be there immigrants protected under DACA. He wants to reduce the number of refugees.
参考


Home
Here you will be able to play in one of several online pool tournaments. Yes this is a real life pool tournament. The tournaments will be held worldwide and can be played anywhere, anytime. The system will be readily availible at any players discretion. There will be an entry fee and payouts for any and every tournament. There will be 4 monthly tournaments and we are working on some weekly events as well. As this grows we may add more monthly tournaments, if needed.
How this works
1st. You will need to register to the site.
2nd. You will pick the tournaments that you will be playing in based on table size and preference.
3rd. You will pay buy a ticket ($20). The ticket can be used for any of our tournaments.
4th. You will set up your phone, laptop or tablet so it will be able to record your ghost
match.
5th. You will be playing five racks of a modified version of the 10 ball ghost (see the
rules section)
Other info
Players of any age may play, but anyone under 18 must have consent by a parent or gardian. Any player winning money will have to fill out any and all tax forms that may be applicable. The parent or gardian of a minor playing in the tournaments will be resposible for any tax form that may be applicable.


Campiagn Information
Name:
Mango Magzine
Contract:
Per Click
Category:
Education
Price:
0.4
Target Gender:
Both
Budget:
1000
Target Age:
15-19
Events:
200 Click
Last Modified: 1-2-2015
State: Published


Marc Benioff is chairman and CEO of Salesforce. A pioneer of cloud computing, Benioff founded the company in 1999 with a vision to create a new kind of enterprise software company, with a new technology model based in the cloud, a new pay-as-you-go business model and a new integrated corporate philanthropy model. Under his leadership, Salesforce has grown from a groundbreaking idea into a Fortune 500 company, the fastest-growing top ten software company in the world and the largest CRM company. For its revolutionary approach, Salesforce has been named one of the World’s Most Innovative Companies seven years in a row by Forbes Magazine, one of Fortune’s World’s Most Admired Companies in the software industry five years in a row, and a Fortune Best Company to Work For nine years in a row. Benioff has been widely recognized for his visionary leadership and pioneering innovations. He has been named one of the World’s 50 Greatest Leaders by Fortune, 50 Most Influential People by Bloomberg, one of the top 20 Best-Performing CEOs by Harvard Business Review, Businessperson of the Year by Fortune readers, one of the Best CEOs in the World by Barron’s, Innovator of the Decade by Forbes Magazine and received The Economist’s Innovation Award. Benioff is also a member of the World Economic Forum Board of Trustees. Benioff created the 1-1-1 model of philanthropy, which leverages the resources of Salesforce to improve communities around the world: donating 1% of Salesforce’s product, 1% of its equity and 1% of employees' time to help nonprofits achieve their missions. Today, more than 3,000 companies have adopted the 1-1-1 model through the Pledge 1% movement. Benioff and his wife, Lynne, have focused their personal philanthropy on children’s health, including building UCSF Benioff Children’s Hospitals in San Francisco and Oakland, as well as on public education, homelessness and other social issues. Benioff believes that businesses are the greatest platforms for change in the world. He has embraced World Economic Forum founder Klaus Schwab’s multi-stakeholder approach to leadership, serving not only shareholders but all stakeholders--including customers, employees, partners, communities and the environment--to make the world a better place. Benioff is also inspiring fellow business leaders to do the same. He led a group of CEOs and business leaders in opposing state legislation that discriminated against LGBTQ communities, and instituted a company-wide salary assessment at Salesforce to ensure men and women were being paid equally for comparable work. Benioff is a 35-year veteran of the software industry. Prior to launching Salesforce, he spent 13 years at Oracle Corporation. He founded his first company, Liberty Software, which created video games, at the age of 15. He also worked as an assembly language programmer in Apple Computer’s Macintosh Division. Benioff received a B.S. in Business Administration in 1986 and an honorary degree of Doctor of Humane Letters in 2014 from the University of Southern California. He is the author of three books, including the national best seller, Behind the Cloud.


Increasing Usefulness:Talking to program back-ends with Timers and Threads
by David McNab and Alex Tweedly.
This walkthrough supplements the excellent existing PythonCard 'Getting Started' walkthroughs by Dan Shafer and David Primmer, and follows on from the How to Add a child window lesson. It's based on techniques taken from the various PythonCard sample programs.
This walkthrough was originally written by David McNab (david at rebirthing dot co dot nz), and was revised by, and is currently maintained by, Alex Tweedly (alex at tweedly dot net)
Overview, Scope and Purpose
This walkthrough is targeted at PythonCard Version 0.8.2. As PythonCard grows, some of this walkthrough may go out of date, even fail - if this happens, please contact me and I'll update it.
The purpose of this walkthrough is to empower you to make your PythonCard programs capable of much more meaningful work, by acquainting you with two mechanisms - timers and threads, which can be used for communication between your programs' graphical front-ends and back-ends.
Most of the top-level code you add to the front ends - your PythonCard user interfaces - is event handlers. As with programming with any GUI, event handlers should always complete their job fast, and return promptly, so they don't 'clog up the works'. PythonCard is no exception.
But there will be many cases where you need some real-time functionality - back-end code which runs autonomously of user interface events.
An example of this is programs which communicate in real-time on the Internet, or need to interact in real time with other software on your system (eg monitoring system load).
Timers and Threads are two good mechanisms that allow you to separate your program into:
- Front-End - logic which processes user interaction events
- Back-End - logic which manages non-user-interface aspects of your program, talks to other programs on your system or across the internet, and possibly communicates relevant updates to the user interface.
By using timers and/or threads, you can guarantee that your PythonCard event handlers will terminate promptly, and that your user interface can communicate as needed with your back-end logic.
Timers
You can set up your window class so that an event handler gets triggered at regular intervals - the 'tick of the clock'.
This is useful for things like a time display on your window, or polling for some external event (for instance, incoming mail), and dozens of other situations.
Let us now add a timer to the example code you've been writing. This timer will automatically add 10 to the number in the counter field, doing this every 5 seconds.
Firstly, you will need to add an on_initialize event handler to your main window. You may have already done this, while experimenting in your learning process during the earlier walkthroughs. But if you haven't yet done so, add the following method code to your Counter class:
def on_initialize(self, event): print "Window opened"
Not very significant - but do save your file, and run counter.py. You'll see a message on stdout when the window opens.
So far, so good. Nice to know that we can receive an event when the window gets opened. But not very useful yet.
Now, we need to use this initialize event handler as an opportunity to set up a timer.
So change the event handler to the following:
def on_initialize(self, event): self.myTimer = timer.Timer(self.components.field1, -1) # create a timer self.myTimer.Start(5000) # launch timer, to fire every 5000ms (5 seconds)
You'll also notice from the self.components.field1 that the timer is being created in respect of the field1 widget. More on this later.
Don't try to run this program yet - it will barf since timer is an unknown symbol - we need to grab it into our namespace. To do this, find the line at the top of your counter.py program which currently says
from PythonCard import model
and change it to say
from PythonCard import model, timer
Now, we have to make sure we can receive an event every time the clock 'ticks'.
You'll see in the on_initialize event handler above that we've linked the timer to field1 While conceptually the timer applies to the window as a whole, there's a weird quirk in timers which requires them to be associated with specific window widgets.
To receive the clock tick events, we only have to add another handler.
As per the event handler naming convention, (where widgets' handlers are called on_componentName_event, we'll call this handler on_field1_timer, since timer events get directed to the widget field1, and the event is called timer.
Now, add the following method code into class Counter:
def on_field1_timer(self, event): print "Got a timer event" startValue = int(self.components.field1.text) endValue = startValue + 10 print "Got a timer event, value is now %d" % endValue self.components.field1.text = str(endValue) # uncomment the line below if you've already followed the 'child window' walkthrough #self.minimalWindow.components.field1.text = str(endValue)
Note - this is ugly, because there's a lot of duplicated functionality. We'll leave it to you to factorise your code appropriately, creating a generic increment method which accepts an optional amount argument (default 1). But if you're impatient, don't worry about any factorisation, just use the above code and all will be ok
Now, save your counter.py program and run it. You should see the number increasing by 10, every 5 seconds. I don't think I need to say any more here - you've got the basic structure - the rest is now up to your imagination.
You could use timer events to poll for external conditions, but this can get real ugly real fast. So in the next section, we'll explore a nicer and more general way to tie your front end code to back end functionality, using threads.
Threads
Python is beautiful in its support of threads - the ability to split up code into multiple threads of control, just like an operating system does when it gives lots of separate programs a share of the CPU.
You can ignore the objections of " Python prudes" who insist that threads are not good programming practice. Sure, threads have their pitfalls, such as deadlocks, race conditions etc, but if you use a bit of common sense, and design intelligently, you can avoid these pitfalls. Also, programming to get around the need for threads can pervert your program logic, kind of like pushing your head down through your body and out your back orifice. Not always a pretty sight :p
Note - one actual risk of threading in Python is a syndrome called Global Interpreter Lock or GIL for short. GIL can strike in strange places, and cause one or more threads in your program to freeze up for no apparent reason. If you ever have reason to suspect GIL is occurring, simply sprinkle a few print statements in each of your threads until you either calm your suspicions, or nail the culprit. For example, I suffered a GIL once because a thread was building regular expression objects with re.compile(). I fixed this by building the re objects in advance, in the main thread. I suspect this is a Python bug (I'm using 2.2), but that's another topic.
What we'll be doing here is adding a background thread to your counter program, which (surprise, surprise) writes values (in this case, counting from 0 in steps of 20) to your counter value.
The first thing you could do is disable the timer you set up in the previous section, by commenting out the self.myTimer.Start(5000) statement in your on_initialize handler (see above). This will avoid confusion for now, since there won't be a running timer to complicate things.
Now, add to the top of counter.py the following statement:
import thread, Queue import wx
This will give us access to Python's thread creation/dispatch functions, as well as message queues and wxPython.
A Little Theory
I'll keep this short and sweet. Simply, the safest way for threads to communicate with each other is via some kind of synchronised objects. We'll use Python's standard message queues (standard Python module Queue ), since it's easy and safe and well supported within Python. When your thread wants to send an event to your user interface code, it will send a message to it, then 'wake up' your user interface so that it receives an idle event. The idle event will check the message queue, and react accordingly.
Note - when your window classes have an idle event handler, this handler can get triggered by all sorts of things, particularly when your user interface falls idle - mouse stops moving, button click is finished etc. Within the idle event handler, we need to check our message queue so we know when we need to react to something in the back end.
Hint - run any PythonCard program with a '-m' argument. You'll see the program come up with a 'Message Watcher' window. Unclick the Ignore Unused checkbox. Interact with your program with the mouse, and you'll see a flood of events being generated. This is a great way of "cheating" to find out what name you'll need to give your event handlers. Another cheat is to run the widgets sample program, which allows you to generate HTML documentation for the various PythonCard widgets.
Threads Walkthrough - Summary of Steps Involved:
- Add a message queue to our Counter class.
- Add your thread code to counter.py, but as a global function, not a class method. This thread will periodically sends messages to our window
- In your on_initialize handler, launch your thread and pass it a handle to the message queue.
- Add an idle event handler, which picks up these messages
- Within the idle event handler method, check the message queue and react accordingly
1. Add the message queue
Refer back to the on_initialize(self, event) handler above, and add the following statement:
# Add a message queue self.msgQueue = Queue.Queue()
This sticks a message queue into our Counter window class, that will be used for communication from the thread backend to the foreground window class.
2. Add a Thread Function
Add the following global function to your counter.py:
def myThread(*argtuple): """ A little thread we've added """ print "myThread: entered" q = argtuple[0] print "myThread: starting loop" x = 10 while True: time.sleep(10) # time unit is seconds print "myThread x=%d" % x q.put(str(x)) # stick something on message queue wx.WakeUpIdle() # triggers 'idle' handlers x += 10
3. Launch the Thread
Add the following lines at the end of your on_initialize handler:
# Now launch the thread thread.start_new_thread(myThread, (self.msgQueue,))
Notice that we have to pass the queue object to the thread in a tuple - refer to the Python Library Reference doco for module
4. Add an idle event handler
In the thread function above, the operative line is wx.WakeUpIdle() . Upon calling that method, wxWindows tells all open windows, Hey, wake up - something's happened you might need to react to! So we need to add a handler to our Counter class to handle idle events, and thus get triggered when we get 'woken up'. So add the following method into your Counter class
def on_idle(self, event): print "on_idle entered"
5. Check the message queue and react accordingly
Presently, our 'idle' handler isn't very useful - but if you run counter.py, you'll see it gets triggered every time the program falls idle. So now, we'll make it do what it needs to do - reacting to events from our background thread. Replace the idle handler above with the following:
def on_idle(self, event): print "on_idle entered" while not self.msgQueue.empty(): # Handle messages from our thread msg = self.msgQueue.get() print "on_idle: msg='%s'" % msg self.components.field1.text = msg # uncomment the following if you've followed the 'child window' walkthrough #self.minimalWindow.components.field1.text = msg
Now, we're all done. Launch your counter.py, and watch as the background thread launches, and periodically sends its messages to the user interface, which displays these on the window.
Conclusion
During this walkthrough, you have explored timers and threads, two easy and powerful ways to interface your user interface classes with the back-end of a program (where the 'real work' happens)
Having got a handle on front-end/back-end interactions, via threads and timers, you are now empowered to add some serious functionality to your PythonCard programs.
There is now nothing stopping you from writing any kind of application in PythonCard.
A common situation in programming is where you want a program to be always running (as a Unix daemon or a Windows NT/2k/XP 'service'), but you don't always want its window showing. A typical approach is:
- Create the back-end code as a standalone 'daemon' program (or Windows NT/2k/XP 'service'), which talks via socket connection to the front end.
- Create the front-end code, which operates the user interface
- Put a thread into your front end code which does the socket communication to the daemon, and relays commands/responses/status info between the daemon and the user interface.
With this approach, you can launch and terminate the user interface program as you like, without disrupting the backend in any way
So, it's over to you now. Play around with your walkthrough programs and the PythonCard sample programs, raid the Vaults of Parnassus for useful bits of code, and hack to your heart's content.
The only limit is your imagination and (rapidly growing) level of Python skill.
Happy programming!
Copyright (c) 2003 by David McNab, david at rebirthing dot co dot nz
Copyright (c) 2005 by Alex Tweedly, alex at tweedly dot net
Please feel free to mirror, copy, translate, upgrade and restribute this page,
as long as you keep up to date with Python and PythonCard, and credit the
original author.
$Revision: 1.7 $ : $Author: alextweedly $ : Last updated $Date: 2006/04/06 11:00:25 $