Applies To
What to Check For
Verify that logging is centralized.
Why
A centralized logging subsystem is simpler to maintain and implement correctly.
How to Check
Use the following steps to verify that logging is centralized:
- Identify the logging subsystem. The logging subsystem should provide an API that allows generating log entries from application code. Make a list of functions that may be used to generate log entries.
- Examine log entries. Find out where log entries are stored and examine them. This should give you clues about the functionality of the logging subsystem.
- Review code. Find code that generates log entries. Make sure this code uses the centralized logging subsystem.
How to Fix
Perform the following actions to centralize logging:
- Identify existing logging functionality. Examine the application architecture to identify logging facilities, such as the logging API and where audit trails are actually stored. Make a list of APIs used to log events, document how to use them, and where they store logs.
- Design the logging subsystem. Design and implement a class or library specifically for logging. When designing the logging subsystem, consider sending logs to a remote log server. Consider the following factors when designing the logging subsystem:
- Log throttling
- Logging important event details for both successful and failed operations
- Logging important security operations
- Logging important business operations
- Monitoring the use of privileged accounts
- Logging user management events
- Avoiding including sensitive information in logs
- Logging unusual activity
- Sending logs to a centralized server
- Implement the logging subsystem. Write code that generates log entries according to your design.
- Use the logging subsystem. Use the logging class or library whenever logs are generated. If earlier code exists that generates log entries, replace it with calls to the new logging subsystem API.


Taming Randomness
Sketching with Math and Quasi Physics
Uniform Random
let v = random(1)
Random2
let v = pow(random(1), 2)
Randomn
let v = pow(random(1), n)
(Random + Random) / 2
let v = (random(1) + random(1)) / 2;
(Random1 + Random2 + ... + Randomn) / n
let v = 0;
for (let i = 0; i < n; i ++) {
v += random(1);
}
v /= n;
Normal Distribution(Gaussian)
// Box-Muller Transform (Unif(0,1) => N(0,1))
// avoiding log(0) by using (1 - random(1))
let mean = 0.5, variance = 0.1;
let v = sqrt(-2 * log(1 - random(1))) * cos(2 * Math.PI * Math.random(1)) * variance + mean;
note: randomGaussian() is available in p5.js
Perin Noise
Distribution
let v = noise(x); x += 0.001;
see implementation of noise() function in p5.js
Variation over time
let v = noise(x); x += 0.01;


Auto Moderation Settings
AutoMod allows for easy moderation of your server and is easily configurable and customisable
Smart Moderation allows for all the bad stuff to be filtered out. When a user triggers auto moderation, their message will be modified and resent with the triggered text removed
Auto Moderation Filters
Filters discord invites from messages
Removes links that redirect to a different location
Removes any links in a message
Removes links that point to common IP grabbing services
Removes messages that use too many capital letters. Filters out messages with a capital letter percentage higher than the threshold
Removes messages that mention too many users. Filters out messages with a mention count higher than the threshold
Removes messages that include commonly used profanity
Removes messages that either match text in the text filter or match regex in the regex filter. Use https://regex101.com/ and set the flavour to python to test out the regex the bot will use
Auto Moderation Thresholds
Percentage of caps the message can have before it is detected as mass caps. A recommended value is 60 (60%)
The max number of mentions a user can do before it is detected as mass mentions. A recommended value is 3.
List of text that is not allowed in a message. Each text should be separated by a line
Advanced users only. Will use the regex specified in a message and will filter out any content that matches the regex. Use https://regex101.com/ and set the flavour to python to test out the regex the bot will use


Innovations / Technology
Our robots are created by the alchemy of artistry, engineering, and artificial intelligence nurtured with emotionally rich interactions between human and machine. We accomplish this by uniquely integrating leading-edge innovations in materials, hardware, software, and the art of animation and storytelling. Our AI software empowers our robots to maintain eye contact, recognize faces, understand speech, hold natural conversations, and simulate human personality, enabling our robots to have meaningful interactions with people and evolve from those interactions. MindCloud™, our cloud-based AI, enables large-scale cloud control of our robots, as well as deep-learning data analytics for processing the rich social data gathered from the millions of interactions with our robots. Our AI software is open source: www.cogchar.org, www.friendularity.org, and www.glue.ai. Our robot faces are created with a patented material called Frubber (“flesh rubber”), a proprietary nanotech skin that mimics real human musculature and skin. This allows our robots to exhibit high-quality expressions and interactivity, simulating humanlike facial features and expressions. Artistry is essential to bringing robots to life. Dr. Hanson’s background as a Disney sculptor and filmmaker redefines robots as four-dimensional interactive sculpture. The ability to transmute technology into a living being through artistry enables our robots to come to life and create the sense of a mind within the machine.
Hanson Robotics


You need to enable JavaScript to run this app.
Download
Filter
Noise
Pixelate
Hue rotation
Saturation
Posterize
Blur
contrast


An experienced QA tester and data specialist with a demonstrated history of working on mobile and web applications. I help developers get feedback quicker and give business information they need to make informed decisions. My superpower is understanding applications from both a technical and business perspective; I am able to recommend improvements that leverage existing infrastructure and help guide the production of additional features.
I've basically been unemployed since high school so I don't have a rich history to share unlike most of my compatriots here. Codefellows might be the first time I've ever really tried to apply myself so wish me luck.


We're the Chicago chapter of PyLadies, an international mentorship group for marginalized genders, such as but not limited to non-binary people, trans people, and women in tech.
We host monthly events, talks, and study groups where you can meet other pythonistas and learn more about programming, data science, web development, and more.
All skill levels welcome!
Join our Meetup group to hear about our free events in the Chicago metro area.
Interested in hosting us, giving a talk, or leading a workshop? We'd love to hear from you!
Lorena Mesa
Political scientist turned coder, Lorena Mesa is a data engineer on GitHub's software intelligence systems team, Director and Vice-Chair, Elect on the Python Software Foundation, and PyLadies Chicago co-organizer. Lorena's time at Obama for America and her subsequent graduate research required her to learn how to transform messy, incomplete data into intelligible analysis on topics like predicting Latinx voter behavior. It's this unique background in research and applied mathematics that drove Lorena to pursue a career in engineering and data science. One part activist, one part Star Wars fanatic, and another part Trekkie, Lorena abides by the motto to "live long and prosper".
Sand Ip
A graduate of Illinois Institute of Technology, Sand Ip began her career as an electrical engineer before transitioning into software engineering. Now an engineer at Numerator, Sand is passionate about teaching others how to create with code. She is currently studying to become a full stack developer and in her spare time, she enjoys reading non-fiction and going on foodie adventures. You can say hello to Sand at our upcoming events on on Twitter at @ysandii!
PyLadies is an international mentorship group with a focus on helping more women become active participants and leaders in the Python open-source community.
Our mission is to promote, educate and advance a diverse Python community through outreach, education, conferences, events and social gatherings.
To learn more, visit the PyLadies website.
Follow us on Twitter or join our Meetup group to get announcements and find out about upcoming events.
To connect with other PyLadies members through Slack, join
slackin.pyladies.com
and sign up for the Chicago
channel.
If you would like to give a tech talk, demo, or workshop, contact us at<EMAIL_ADDRESS>If you would like to donate to us, you can donate on page! Yes, donations are to a 501c3 and are therefore tax deductible.
Is your company interested in hosting an event? Fill out our Google form and we will be in touch!


DF3120 is a small digital photo frame that capable of running small linux programs. I read about it on a hacker site [LINK Here].
I like it very much because it is very small, pretty and has a screen on it, perfect on a real desktop. Then I bought 3 of this little fella :-).
The device itself does not have a battery inside. Therefore whenever you restart it, you’ll have to set the time again, and there is no really convenient ways to do it yet. So I made use of its USB ethernet and attach it to a OpenWRT router, added it to the local LAN. Then I compiled the ntpdate package, so that it can automatically connect to the time server to sync time.
Then I wrote a small pacman/mario clock program for it, followed on this guide [GUIDE Here], so that I can put it on my desk :-).
dfclock on DF3120
dfclock on DF3120
You can browse the source code here [SOURCE Here], A running video can be found here [LINK Here]
https://github.com/cosailer/fbclcok
This progame runs on the framebuffer device, it does't have to be df3120 though. Later I'll build one that makes use of the sdl library inside.
dfclock on OK6410
If you don’t want to rebuild the image and kernel for DF3120, you can also use mine provided below. However, I don’t provide any warranty. I added some more commands to the busybox, like chmod, fdisk, mkfs, httpd, unzip etc.. also nano, lighttpd, lynx and ntpdate are compiled to run on DF3120.
The image is copied from a 256MB SD card, it contains a single primary partition. The kernel is built with Linux Gadget ethernet support.


Across: 5. Cry for a nasty person initially (3) 8. Good work finding brick (6 4) 9. She makes tuna stew (4) 10. Ray goes round the town (3) 11. Blam! Robber explodes terrible weapon! (6 4) 14. One offer comes from a previous source (4) 15. Sounds like John Reed, maybe (3) 16.  Mechanics start and finish repair (4) 21. Red setter's transport? (7) 22. Having nothing to do with communist in a time of growth (7) 24. Look at the French after try overturned! (4) 25. Romantic passage in novel reveals no end of goodwill (6 4) 29. Regret naughty daughter leaving (3) 30. Catch people carrier reversing around junction (4) 31. Plaintive call to Microsoft for light support, maybe? (6 4) 35. 13 weaves a garland (3) 36. Nothing inside would amaze Robert! (4) 37. Audibly drank wine with sandwich (6 4) 38. Wife has fine utensil (3) Down: 1. Cheese for export to all leaders (4) 2. Carry second organ (4) 3. And everyone else may be late back (2 2) 4. Noise from the riverside gets to composer (7) 5. Go with the French and cross back to see what failed to prevent equine breakout! (6 4) 6. Throwing out rum, I am able to swallow this (6 4) 7. Maize in iron can deteriorates initially when opened (6 4) 11. Ask UK to back European entry (3) 12. Go off uphill (3) 13. Prophet lie? Rubbish! (3) 17. Fruit producer chased after duck and egret out east (6 4) 18. Shock at how marble may start falling apart! (6 4) 19. Source of light material (10) 23. Having nine vehicles held back at the end of the day (7) 26. Cut tail off spinning flyer! (3) 27. Left out the best – and The Greatest! (3) 28. Measure uncapped well (3) 32. Steer you and me to old river (4) 33. Regularly skip past drinks (4) 34. Poet not at home for a bit of fun (4)


Please note Save and Delete buttons are disabled. In this version the Crop button is not implemented. Also php files, save.php and delete.php are just for testing, if you're going to use this plugin you will need to secure them. If you need more help feel free to contact me.


- BaseRequest (class in bottle)
- BaseResponse (class in bottle)
- BaseTemplate (class in bottle)
- bind() (LocalRequest method)
|
- body (BaseRequest attribute)
- (LocalResponse attribute)
- Bottle (class in bottle)
- bottle (module), [1], [2], [3], [4], [5]
- BottleException
|


What is the largest difference between Bow Robotics and a typical integrator? We do not disappear once the robot system is installed. We prefer to work with our partners for the lifetime of their robot system, ensuring we know your robot just as a doctor knows their patient.
Whether you are new to automation or looking to replace/repurpose your existing setup- Bow Robotics can help you choose the correct application and equipment, ensuring safety, efficiency, and productivity goals are met.


Hi Eleven
Welcome to your Photobucket
Log out
Beautiful trees
By Eleven
Beautiful trees
By Eleven
Beautiful trees
By Eleven
Beautiful trees
By Eleven
Beautiful trees
By Eleven
Beautiful trees
By Eleven
Add Photo
Cancel
Upload


You can use the where-prefilter to filter the data the server returns.
The extension method expects a javascript function that returns a boolean if the value should get queried.
Basic query
In this small example only values that start with testValue are queried.


Work Day Scheduler
A simple calendar app for scheduling your work day
Save
9am
Save
10am
Save
11am
Save
12pm
Save
1pm
Save
2pm
Save
3pm
Save
4pm
Save
Clear Events


Granit Xhaka takes not-so-subtle dig at Arsenal fans following Switzerland’s win in Euro 2020 qualifier
by HarigovindOn Sunday, Arsenal star Granit Xhaka took to Instagram to pen down his thoughts following Switzerland’s win against Georgia in the UEFA Euro 2020 Qualifiers – and in doing so, he seems to have made a thinly-veiled swipe at Arsenal fans who booed him during a Premier League match in October.
The post, written originally in German, translates to the following:
“Happiness is when you are satisfied with yourself and do not need the confirmation of others.”
Check out the Instagram post right below:
In case you missed it, Xhaka fought with fans and hurled words of abuse at them, following an altercation during Arsenal’s Premier League clash with Crystal Palace in October.
And in a recent interview with Swiss newspaper Blick, the player himself described his feelings at the incident during the Crystal Palace clash.
“When my shirt number lit up on the board of the fourth official and then broke jealous jubilation of their own fans, that hit me very much and stirred up,” the Swiss midfielder said, before adding:
“It was very painful and frustrating.”
“For me, this reaction is still incomprehensible, especially in this vehemence and how extremely hostile I was here,” he further said, before concluding:
“Justifiable criticism from fans makes you grow as an athlete. But when you get scolded by this very footballing family in times when you are already being attacked massively, it hurts a lot.”


2 writes to _job
System.Management.Automation (2)
engine\remoting\commands\ReceivePSSession.cs (2)
860
lock (_syncObject) {
_job
= job; _stopPipelineReceive = new ManualResetEvent(false); }
894
lock (_syncObject) {
_job
= null; _stopPipelineReceive = null; }
2 references to _job
System.Management.Automation (2)
engine\remoting\commands\ReceivePSSession.cs (2)
404
tmpJob =
_job
;
815
job =
_job
;


--- layout: post title: 2019-07-20-Colin-and-Kaitlin-garden.jpg date: 2019-07-20 08:09:39 permalink: /assets/html/gallery/2019-07-20-Colin-and-Kaitlin-garden.jpg.html exclude: true ---


Student Service Versions:
v3
v4
Service Code version:
<IP_ADDRESS>54
Service Core Code version:
<IP_ADDRESS>


CSAIL Principal Investigators
The original data comes from
this page
. Here is the
Exhibit JSON data file
.
Office:
Phone:
more...


EWIS
4
You have 4 Mails
Jonathan Smith
Just now
Hello, this is an example msg.
See all messages
John Doe
Profile
Log Out


Given an unsorted array of n elements, write a function to sort the array
O(n^2)
Worst case performance
O(n^2)
Best-case performance
O(n^2)
Average performance
O(1)
Worst case
arr[] = {80, 10, 40, 30}
Indexes: 0 1 2 3
1. Index = 0
Select the minimum number from the array (between index 0-3), ie, 10
2. Swap 10 and 80 (arr[0])
3. The array now is {10, 80, 40, 30}
4. Index = 1
Select the minimum number from the array (between index 1-3), ie, 30
5. Swap 30 and 80 (arr[1])
6. The array now is {10, 30, 40, 80}
7. Index = 2
Select the minimum number from the array (between index 2-3), ie, 40
8. Swap 40 and 40 (arr[2])
9. The array now is {10, 30, 40, 80}
The array is now sorted.
A video explaining the Selection Sort Algorithm


WITNESS LIST Ways & Means Committee April 25, 2001-2:00P HB 2901 For: Altman, Peter (Sustainable Energy & Economic Development (SEED) Coalition) Smith, Tom "Smitty" (Public Citizens Members) Against: Faulkner, Tom (Texas Mining and Reclamation Association) Glacken, Shawn (Association of Electric Companies of Texas (AECT)) Kuehn, Dan (Lower Colorado River Authority (LCRA)) HB 3235 For: Blackwood, Dr. Susan (San Antonio Sports Fdn) HB 3364 For: Amezquita, Michael A. (Self and Cameron Appraisal District, Texas Association of Appraisal Districts) SB 256 For: Dahill, John (Dallas County Commissioners Ct.) SB 863 For: Amezquita, Michael A. (Self and Cameron Appraisal District, Texas Association of Appraisal Districts) Bostwick, Breck (Self and Texas Association of Property Tax Professionals) SB 1037 On: Scogin, James (Comptroller of Public Accounts) SB 1574 For: De Aldecoa Bueno, Carlos (Self and Greater Houston Coffee Association) Macnab, Alistair M. (Greater Houston Coffee Association) Stewart, Steve (Self and Greater Houston Coffee Assoc.) SJR 47 For: De Aldecoa Bueno, Carlos (Self and Greater Houston Coffee Association) Macnab, Alistair (Greater Houston Coffee Association) Stewart, Steve (Self and Greater Houston Coffee Assoc.)


The Korean KORDA Latin (SIL) keyboard is built to type Korean using the transliteration system KORDA (Korean Romanization for Data Application). KORDA is designed to make Latin-Korean transliteration easy, accurate, and computerizable. For more information on KORDA, see About KORDA.
The Korean KORDA (SIL) keyboards create hangeul syllables from jamo or latin letters each time you press Spacebar.
This keyboard includes an On Screen Keyboard view for easy reference. The On Screen Keyboard works best when associated with a QWERTY US layout.
This is a Unicode keyboard and works with any Unicode font which has support for Korean characters. Common fonts which work with this keyboard are:
© 2006-2020 SIL International


Here below is an example on changing a property name.
var Scrubber = require('object-scrubber'); var testObj = { } var scrubber = new Scrubber() scrubber.when(function (x) { return x.parent && x.key === '_id' }, function (x) { // set the value to a new property in the parent x.parent.id = x.value // delete the previous property delete x.parent._id // change to the new key for the next processors to find x.key = 'id' // scrub the new value for other processors to process return x.scrub(x.parent.id) }); scrubber.scrub(testObj);


{% extends 'base.html' %} {% import 'macros.html' as macro %} {% import "bootstrap/wtf.html" as wtf %} {%block content%}
{{blog.blog}}
Posted on {{date}} by {{blog.user.username| capitalize}}


class Bauxite::Selector
Selector class.
Selectors represent different strategies for finding elements. Selenium provides a list of standard selectors (e.g. by id, by css expression, etc).
Additional selectors can be specified by defining custom methods in the Selector class.
Each custom selector is defined in a separate file in the
'selectors/' directory. The name of the file must match the name of
the selector. These files should avoid adding public methods other than the
selector method itself. Also, no attr_accessors
should be
added.
Selector methods can use the ctx
attribute to refer to the current test Context. The protected method selenium_find can
also be used to locate elements using standard Selenium selectors.
Selector methods should always take a block and forward that block to a call to either find or selenium_find.
For example (new selector template):
# === selectors/data.rb ======= # class Selector # :category: Selector Methods def data(arg, &block) # selector code goes here, for example: selenium_find(:css, "[data='#{arg}']", &block) end end # === end selectors/data.rb === # Context::selectors.include? 'data' # => true
To avoid name clashing with Ruby reserved words, the '_selector' suffix can be included in the selector method name (this suffix will not be considered part of the selector name).
For example (_selector suffix):
# === selectors/end.rb ======= # class Selector # :category: Selector Methods def end_selector # do something end end # === end selector/end.rb === # Context::selectors.include? 'end' # => true
Standard Selenium Selectors¶ ↑
- id=
targetValue
- name=
targetValue
- css=
cssSelectorSyntax
- partial_link_text=
textFragment
- class=
className
and class_name=className
- link=
exactText
and link_text=exactText
- tag_name=
targetValue
- xpath=
xpathExpression
Selector Methods
↑ topPublic Instance Methods
Select an element by attribute value.
The attribute selector syntax is:
attr=name:value
For example:
# assuming
foo
 assert attr=custom:true "foo" # => matches the element above.
# File lib/bauxite/selectors/attr.rb, line 35 def attr(arg, &block) data = arg.split(':', 2) selenium_find(:css, "[#{data[0]}='#{data[1]}']", &block) end
Change the selector scope to the given frame and finds an element in that frame.
This is a composite selector. The frame selector syntax is:
frame=|frame_selector|child_selector
Where frame_selector
is any selector available that matches
the target frame, child_selector
is any selector available
that matches the target element inside the target frame.
Note that the '|' character can be replaced with any single-character delimiter.
Also note that frame selectors can be embedded to select a frame inside a
frame. To accompilish this, child_selector
can be a frame
selector.
For example:
# assuming  #
foo
 #  assert "frame=|css=.myframe|child" "foo" # => matches the 'child' element above.
# File lib/bauxite/selectors/frame.rb, line 48 def frame(arg, &block) delimiter = arg[0] items = arg[1..-1].split(delimiter, 2) find(items[0]) do |f| begin @ctx.driver.switch_to.frame f find(items[1], &block) ensure @ctx.driver.switch_to.default_content end end end
Select a field in a JSON document.
The JSON selector syntax is:
# For objects: json=key # {"key":1} => 1 json=key.subkey # {"key":{"subkey":2}} => 2 json=key[0] # {"key": [3]} => 3 json=key[1].subkey # {"key": [{"subkey":4}]} => 4 json=key.length # {"key": [5]} => 1 # For arrays: json=[0] # [1] => 1 json=[1].value # [{"value": 2}] => 2 json=length # [3] => 1
For example:
# assuming {"key": [{"subkey":4},{"val":"42"}]} assert json=key[0].subkey 4 assert json=key[1].val 42 assert json=key.length 2 # => these assertions would pass
# File lib/bauxite/selectors/json.rb, line 49 def json(arg, &block) source = JSON::parse(@ctx.driver.page_source.sub(/^]*>.*
/, '').sub(/<\/pre>.*<\/html>$/, '')) element = _json_find(source, arg) raise Selenium::WebDriver::Error::NoSuchElementError, "Cannot find JSON element: #{arg}" unless element element = element.to_s def element.text; self; end def element.tag_name; 'json'; end yield element if block_given? element end
Select an element by id suffix.
This is the default selector. Any selector strings that do not contain an equal sign (i.e. '=') will use this selector.
For example:
# assuming
foo
 assert sid=myDiv "foo" # => matches the element above.
# File lib/bauxite/selectors/sid.rb, line 35 def sid(arg, &block) selenium_find(:css, "[id$='#{arg.gsub("'", "\\'")}']", &block) end
Select an element by applying different Selector strategies.
This selector tries to find elements by using the following strategies:
-
default (id suffix)
-
by
name
-
by
class_name
-
by
id
fragment (theid
contains the text specified) -
by
placeholder
attribute -
by text content (unless the element is a label)
-
by radio/checkbox/button/submit value
-
by referenced element (find a label by its text, then find the element pointed by the label's
for
attribute) -
by child element (find a label by its text, then find the first element child control element, including input, select, textarea and button).
For example:
# assuming By label parent<input type="text" value="By label parent"/> assert "smart=By label parent" "By label parent" # => the assertion succeeds.
# File lib/bauxite/selectors/smart.rb, line 46 def smart(arg, &block) b = lambda { |e| e } target = _smart_try_find { sid(arg, &b) } target ||= _smart_try_find { selenium_find(:name, arg) } target ||= _smart_try_find { selenium_find(:class_name, arg) } target ||= _smart_try_find { attr("id*:"+arg, &b) } target ||= _smart_try_find { attr("placeholder:"+arg, &b) } quoted_arg = "'"+arg.gsub("'", "\\'")+"'" target ||= _smart_try_find do selenium_find(:css, ["input[type='checkbox'][value=#{quoted_arg}]", "input[type='radio'][value=#{quoted_arg}]", "input[type='button'][value=#{quoted_arg}]", "input[type='submit'][value=#{quoted_arg}]" ].join(',') ) end return yield target if target target = selenium_find(:xpath, "//*[contains(text(), '#{arg.gsub("'", "\\'")}')]") return yield target unless target.tag_name.downcase == 'label' label = target id = label['for'] return yield selenium_find(:id, id) if id target = _smart_try_find { label.find_element(:css, "input, select, textarea, button") } return yield target if target end
Change the selector scope to the given window and finds an element in that window.
This is a composite selector. The window selector syntax is:
window=|window_name|child_selector
Where window_name
is the name or url pattern of the target
window, child_selector
is any selector available that matches
the target element inside the target window.
Note that the '|' character can be replaced with any single-character delimiter.
For example:
# assuming
hello!
 in popup.html js "window.w = window.open('popup.html', 'mypopup')" assert "window=|mypopup|label" "hello!" # => this assertion would pass assert "window=|popup.html|label" "hello!" # => this assertion would pass
# File lib/bauxite/selectors/window.rb, line 47 def window(arg, &block) current = @ctx.driver.window_handle delimiter = arg[0] name,child = arg[1..-1].split(delimiter, 2) pattern = /#{name}/ if name =~ /^\/.*\/[imxo]*$/ pattern = eval(name) end match = @ctx.driver.window_handles.find do |h| @ctx.driver.switch_to.window h @ctx.driver.current_url =~ pattern end name = match if match begin @ctx.driver.switch_to.window name rescue StandardError => e @ctx.driver.switch_to.window current raise Bauxite::Errors::AssertionError, "Cannot find a window matching '#{name}' (either by name exact match or by url regex)." + e.message end begin find(child, &block) ensure @ctx.driver.switch_to.window current end end


{% extends 'accounts/_menu.html' %} {% block content %}
| Id | Reddit Id | Created Date | Title | Score | Name | Upvote Ratio |
|---|---|---|---|---|---|---|
| {{ submission.id }} | {{ submission.reddit_id }} | {{ submission.created_utc }} | {{ submission.title }} | {{ submission.score }} | {{ submission.name }} | {{ submission.upvote_ratio }} |


We love the feedback we get from our valued customers. Please feel free to let us know what you think. We read all of our email. Please fill out the comment section with any questions or concerns.


Officials: Florida security guard shoots man dead at club
by Associated PressTAMPA, Fla. (AP) — Authorities say a security guard shot a man dead as the guard was trying to break up a fight outside a Florida nightclub.
The Hillsborough County Sheriff’s Office said the fight happened in the parking lot of Aqua Lounge in Tampa, Florida, early Sunday.
Sheriff’s Capt. Preston Hollis said one of the patrons pulled out a gun, before he was shot in the upper body by one of two security guards who tried to intervene. The man was taken to a hospital where he died.
Hollis said the security guard is cooperating with detectives, who were interviewing people involved in the fight.


Is the Rapid Growth of African Cities a Sign of Prosperity or Imbalance?
Y axis: -- >
Y = Gini
Y = Slum
Agricultural Land Area: -- >
Hide
Show


Search member locks
Displayed name:
[error]
Lock status:
Any
Active
Inactive
Search
No locks found with given criteria
Results:
#
Displayed name
Active
Created at
Expiration planned at
Manually deactivated at
1
The last name
The last name
The last name
The first name
The third name
← First
← First
«
«
1
1
»
»
Last →
Last →


An internship with The Washington Post is about more than just real work experience. It’s an unrivaled opportunity to experience what goes into making The Washington Post one of the world’s leading news and information organizations. You’ll immerse yourself in our day-to-day operations. You’ll network with individuals at all levels. Most of all: You’ll get firsthand knowledge you won’t find in the classroom or lecture hall. Who knows? You may even go on to find a permanent home here.
Latest Tweet
see more tweets
know someone that would be a good fit?


FZPConnector
FZPConnector class
Example:
const {FZPConnector} = require('fzp-js')
let connector = new FZPConnector({id: 'sample-id', name: 'sample-name'})
connector.type = 'sample-type'
connector.description = 'sample-description'
connector.views.breadboard.setLayer('sample-b-layer')
connector.views.breadboard.setSvgId('sample-b-svg')
connector.views.breadboard.setLegId('sample-b-leg')
connector.views.breadboard.setTerminalId('sample-b-terminal')
Constructor Summary
| Public Constructor | ||
| public |
constructor(opt: Object) FZPConnector constructor |
Member Summary
| Public Members | ||
| public |
The description of the FZP connector |
|
| public |
The id of the FZP connector. |
|
| public |
The name of the FZP connector. |
|
| public |
The type of the FZP connector |
|
| public |
views: {"breadboard": *, "schematic": *, "pcb": *} The FZP connector views for breadboard, schematic and pcb. |
Public Constructors
Public Members
public views: {"breadboard": *, "schematic": *, "pcb": *} source
The FZP connector views for breadboard, schematic and pcb. Note that the pcb view has an object for copper0, copper1 etc.


Conway Life Canvas
A simple typescript module for animating HTML5 canvases with Conway's "Game of Life".
Usage
Create any number of html <canvas>
element, and
then call attachToCanvases
with a selector that targets
those canvases. See the source code to get a sense of what options
are available.
Caveats
If you don't specify the width and height in the options to
attachToCanvases
the world will be generated based
on the initial canvas size. If the canvas gets sized dynamically you
probably want to specify a size that will be larger that you ever
expect to see to avoid having to repopulate. Alternatively, the
LifeCanvas
can be resized and repopulated manually.


Floor Management
Configuration Form
Floor Name
*
No special character are allowed.
Floor No
*
Location
*
Select Location
{{plant.name}}
Select Floor Map
*
Save
Update
Floor Map
Update Floor Management
×
Are you sure to update this data ?
{{name_zone}}
×
Floor List
Floor Name
Floor No.
Floor Image
Action
Floor List
No records Found!


{%- include head.html -%}
{%- include header_main.html -%}
{{ content }}
{%- include footer.html -%}


Scripts
Results
Options
Analyse
×
No scripts on this page
No results
Tolerate bitwise operators
Tolerate
continue
Tolerate
debugger
statements
Tolerate
==
and
!=
Tolerate ES5 syntax
Tolerate
eval
Tolerate unfiltered
for in
Tolerate uncapitalized constructors
Tolerate dangling
_
in identifiers
Tolerate
++
and
--
Tolerate
.
and
[^...]
in /RegExp/
Tolerate misordered definitions
Tolerate unused parameters
Tolerate missing
'use strict'
pragma
Tolerate stupidity
Tolerate inefficient subscripting
Tolerate TODO comments
Tolerate many
var
statements per function
Tolerate messy white space
Tolerate CSS workarounds
Tolerate HTML case
Tolerate HTML event handlers
Tolerate HTML fragments
Assume a browser
Assume
console
,
alert
, ...
Assume Node.js
Assume Rhino
Assume Windows
Stop on first error
Safe Subset
Verify ADsafe
Indentation
Maximum line length
Maximum number of errors
Predefined global variables (comma separated)


Why you should choo-choo-choose to have a vulnerability disclosure policy (2M+ Accounts exposed) 2 Million reasons why your company needs a vulnerability dislcosure policy
SureBet247 shows how not to handle a data breach PR crisis - CalvinAyre.com Nigerian online sports betting operator SureBet247 gives a master class in how not to respond to news that you've suffered a customer data breach.
.NET Conf: Focus on Blazor Teaser In this episode, Robert is joined by Daniel Roth, who provides a look at the upcoming (Tuesday January 14) .NET Conf: Focus on Blazor. This is a free, one-day livestream event that features speakers f
brendandburns/configula Experimental configuration generator inspired by JSX - brendandburns/configula
Potato Parcel - Send A Message or Image on a Potato! Send A Message to Anyone...On a Potato! The best alternative to a greeting card or flowers. Mail a Potato. Send a potato. Anonymous or not!


--- layout: archive title: Zulip Chat Archive permalink: /stream/113488-general/topic/hiding.html ---
I imported tactic.ring to handle an identity and now as a result I have a lemma pow_two
in the root namespace which conflicts with my own lemma pow_two
, which I use about a dozen times in various proofs.
Is there a way to hide imported identifiers?
Last updated: Apr 24 2020 at 19:02 UTC


--- layout: page title: 2018-2019 Officers date: 2018-07-01 20:56:54.000000000 -05:00 type: page parent_id: '39' published: true password: '' status: publish categories: [] tags: [] meta: _publicize_pending: '1' _rest_api_published: '1' _rest_api_client_id: "-1" _wp_page_template: default geo_public: '0' _edit_last: '151072129' author: login: sangelo147 email<EMAIL_ADDRESS>display_name: sangelo147 first_name: '' last_name: '' permalink: "/aboutus/2018-2019-officers/" ---
Editor-in-Chief: Auroni Gupta
Treasurer: Alex Damisch
Communications: Ashwin Ramaswami
Webmaster: Sarah Angelo
Meeting Chair: Billy Busse
ACF Fall Head Editor: Nathan Weiser
ACF Regionals Head Editor: Will Nediger
ACF Nationals Head Editor: Jordan Brownstein


Hacker Manual
The complete reference to rocking the HackTrain.
The complete reference to rocking the HackTrain.
Will food be provided at the hackathon?
It’s going to be an intense weekend full of surprises, long nights and pivoting - but don’t worry we have you covered with lots of food and energy drinks throughout the weekend!
Do I need an idea before the event?
It is not a requirement, and certainly not everyone at the event will pitch, but we do encourage you to pitch. We recommended doing some brainstorming before the event. You’ll be surrounded by extremely brilliant individuals, and we will have some awesome talks at the start of the event to inspire you and get the creativity flowing - if there is a chance for you to make your dream come true it's now!
You don't want to be 10 years down the line thinking, "Ah, I should've pitch my idea at the HackTrain..." - do you?
Does my idea have to be related to a specific domain? (i.e. trains?)
You can pitch any idea you have in your mind - it does not have to be of a specific domain to be taken into account. However, you will be in the perfect environment to analyze the problems related to rail transport system and what’s better, key stakeholders in charge of the UK rail network will be present ready to validate such ideas.
The most important thing is that you pitch disruptive, innovative ideas. Boring apps to gather all your starbucks coupons, are for normal hackathons - train hackathons deserve the most insane ideas!
Can I work on something I've already been working on?
No. This would be very unfair for other TrainHackers - Ideas have to be fresh, at most, well researched. If the project has been started previously, even if it was during a hackathon a few weeks ago, it is not possible to re-use it.
How do the teams get assigned?
On the day everyone will have 60 seconds to pitch their idea. Then everyone will get a chance to vote for their favorite ideas and the teams will form around the top ideas. We will try and keep teams to 4 people for the event.
What do I need to bring?
Obviously you need to take your laptop and a comfortable change of clothes for the weekend. On the Saturday night we will be staying in TechCube Edinburgh for the night so you will need to bring a sleeping bag if you want to get a decent night’s rest.
Also it should go without saying but please bring deodorant and a toothbrush, otherwise the train rides might get a bit painful for everyone.
Do we have to arrange our own transport back from York?
If you are going to a destination other than London yes. If you are going to London, please read the initial paragraph regarding train travel.
What happens after HackTrain?
We have put together a very strong and talented group of people for this hackathon and you will be left with an amazing new network of friends and plenty of opportunities. And if you build a great product that you want to take further we will definitely support you as much as we can! We will host a few meetups in the following months as well - we'll keep you updated!
Business Model - 25%
Can this idea make money? Is there positive customer growth or revenue? Is there a customer acquisition / rollout strategy? Has a revenue model been defined and is it realistic? Is the idea/team ready for capital and execution? Would you invest in this company at this point?
Customer Validation (for USP+Hypotheses) - 25%
Did the team identify customers (demographic, location etc)? Did the team get out and talk to customers? What is the value proposition to customers? What channels of communication are used? Product/Market fit? Did they get a paying customer/sign a deal? Did they find a partner?
Scalability - 10%
Business Perspective:
Did the team identify their market? Does it have the potential to scale? Have they designed their idea with scalability in mind?
Technical Perspective:
Does the team uses appropriate technologies / frameworks? Is it simple to setup or get it running? Are the system requirements appropriate? Did the team build with scalability in mind? Does it work in my browser/device ?
MVP/Prototype - 30%
Business Perspective:
Does the MVP express well their solution for the problem? Would people use it? Did they build their MVP with their customer in mind? Is it memorable? Does the project have appropriate graphics? Is it intuitive and easy to use? Do you like how the project is structured, from a user’s point of view?
Technical perspective:
Does the project meet its goals? Can it be used by everyone? Does it work properly? Does it have enough working features? Are the features implemented the ones that define this project (implementing things that every single app/website/project out there has such as login is not considered useful in this context).
Pitch/presentation - 10%
Was the idea well delivered? Did the team convince you about how awesome their project is? This is about rating the quality of the presentation in the perspective of an investor/expert. (The reason why this is only 10% is because the pitch will actually influence all the other points).
1st
3rd
HashtagBattle
Awarded to the TrainHacker that tweets the most using the hashtag #HackTheRails
Creative Tweet
Awarded to the person that tweets the most creative picture to @BloombergCareers
Best Developer
Best Hustler
The Bloomberg HTTP API interface was an HTTP interface developed to provide access to Bloomberg data during hackathons. The Bloomberg API has been used throughout tenths of hackathons. This API interface will allow all TrainHackers to access the Bloomberg API through HTTP and WebSockets.
In a nutshell, the Bloomberg API (BLPAPI) is a set of freely available software development kits (SDKs) that allow software developers to create applications that consume market data. With this API you will be able to receive historical data and reference data
You will be able to find all the documentation at the Bloomberg HTTP API page. You can also check all the other projects listed under the Bloomberg Github.
This weekend, your fellow Bloomberg mentors, Jakub Misiorny and Radu Patulescu will travel along with you to help you in any problems you face - so feel free to reach out to them throughout the journey!
Prior to the event, all TrainHackers will receive an email with the credentials required to be able to use the Bloomberg Financial API.
We are committed to becoming more transparent - so we’re working to make relevant data and information more accessible to both rail users and other stakeholders. That’s one of the reasons we’re so pleased to be involved in Hacktrain.
We have a number of operational data feeds available, but we’d like your help in realising the value of the data. And we want to encourage the development of new products of interest to those who use the railway.
The feeds available randge include schedules, movement, train positioning, speed, etc. To use these feeds you’ll need to create an account with us by visiting https://datafeeds.networkrail.co.uk/ntrod/login
For examples of how the data has been used already or to read more about our wider approach to transparency please visit our webpageshttp://www.networkrail.co.uk/transparency/ If you’d like more regular updates via twitter you can also follow Mark Farrow, Head of Transparency & Ethics @farrow_mark
The Darwin Push Port is an XML push feed that continuously streams information about the creation of, and changes to, train schedule records, together with train running predictions made by Darwin.
You will be able to access a few extracts of DARWIN at the following Dropbox link. The file named “RTTIHistoryECV” is a 2 week extract from the East Coast route. The other files are short, unfiltered 1 day extracts from the Darwin Push Port.
The Push Port can be filtered to a specific area of interest by TIPLOC, or to provide information for the entire country. Either way, the information delivered is complex and must be properly interpreted before presentation to end users.
The Push Port requires the user to build a database capable of capturing extremely high volumes of information, as well as a query engine to draw the information from your database. There is a large amount of interpretation work involved in this; however this allows substantial flexibility to apply the information to any product within the limitations of your own infrastructure.
There is no way you can build a startup without a lean canvas. Here is a great google docs version you can use. Make sure you download it to use it on the move.
Manage your todos online
Create a tunnel to your localhost. You will love this if you haven't heard of it!


First let me start off by saying that I was addicted to Xanax. Shortly after the experience I am about to talk about, I stopped taking Xanax and had very bad withdrawl syndromes, including an apparantly permanent studder.
June 2003:
I was introduced to Xanax. My best friend came across a supplier of sorts and always had anywhere from 20 to 500 of the 2mg bars of Xanax. Taking these pills became an everyday thing for me. Normally, it was just one a day, but sometimes 2 or 3.
July 2003:
1 or 2 of the 2mg pills was just not enough anymore. Now I would take 3 or 4 on a daily basis. I also experimented with snorting the pills. I found that it hits you harder and quicker, but does not last quite as long as ingesting the pills.
August 2003:
Now it takes 5 or 6 of the 2mg bars to effect me the way I wanted to be effected. I began to get nosebleeds from snorting so much of the substance.
August 19th, 2003:
Note:Because of the amount of xanax I had taken on this day, the details of this story are sketchy, and have been developed by pictures and on the accounts of others because I have no memories of this day whatsoever.
I started off the day with a bag of 20 2mg Xanax (alprozolam) pills. I ended the day in a hospital, in some sort of a coma. 4 days later I awoke to the sound of my dads voice and the first thing I saw was a picture of my car - it was completely totalled. I had no idea what had happened. Evidently, I was driving and lost control, slamming into a set of neighborhood mailboxes. The police found my plastic bag with the Xanax in it, yet there were only 5 left.. which means that 15 of the 2mg pills were missing. They were either consumed by me, lost, or sold (and the doctor said that based on the state that I was in when I arrived at the hospital, his guess was that I consumed at least 26mg or 13 pills).
That was the last time I ever tried xanax. To anyone who wants to try it, go ahead. Just be careful or you might end up with a permanent speech impediment.
Experience Reports are the writings and opinions of the individual authors who submit them.
Some of the activities described are dangerous and/or illegal and none are recommended by Erowid.


Example: window.onerror handler
Loading this page in a browser will:
trigger a javascript exception
which is handled by a window.onerror handler
which reports back to server side /logger.php
which adds the exception to /var/log/window.onerror/all.log


Across: 1. Far-roaming disciple of doom, as embracing confused "but" thing (8,6) 10. Pour a risky poison of toxic potion (5) 11. Does Osama Bin-Laden (with elements of sane bias removed) pose as portentious? (4-5) 12. Lexicography and odd April letters arranged by means of dry printing process (15) 13. Arranged one hint: a foodstuff (6) 15. Pigs tore off on self-indulgent crusades, .. (3,5) 18. ... mostly anecdotal characters, usually seen in Queensland! (4,4) 20. Likes of (1 Across) or (9 Down) horse takes me back around (6) 23. Dr. Ian Morrow throws do for six, and drops argument in favour of Al's prudishness (9,6) 25. The first way: Sword and Orchid (9) 26. Repetitively makes a profit (5) 27. Third happiness rod turned gnome on with a most rarely used expression (5,9) Down: 2. Ian, or characters in broadcasting.. (2,3) 3. ...induce boring Northern characters.. (5,2) 4. ...to put Ian after (half behind) a native Mexican (6) 5. Go peg hay messily into consuming earth (8) 6. Chatful, but confused? (4-3) 7. Award milled on a cast (9) 8. Bright star: New York! (5) 9. Noble, quite exotic, but not too Eastern (8) 14. One type of shake lands chap in chaos (9) 16. SAS mines exotic instruments (8) 17. Lampoon poor in newspaper (8) 19. Return booty but fight for the useful chest (4,3) 21. Support an energy gas (7) 22. In fixed zone or not, off the mark! (2,4) 23. Animal health expert leads check of fodder crop (5) 24.


|
Files | |
| file | MSHID-driver.h |
Mindsensors HID Sensor driver. | |
Defines | |
| #define | MSHID_I2C_ADDR 0x04 |
| #define | MSHID_CMD 0x41 |
| #define | MSHID_KEYBMOD 0x42 |
| #define | MSHID_KEYBDATA 0x43 |
| #define | MSHID_XMIT 0x54 |
| #define | MSHID_ASCII 0x41 |
| #define | MSHID_DDATA 0x44 |
| #define | MSHID_MOD_NONE 0x00 |
| #define | MSHID_MOD_LCTRL 0x01 |
| #define | MSHID_MOD_LSHIFT 0x02 |
| #define | MSHID_MOD_LALT 0x04 |
| #define | MSHID_MOD_LGUI 0x08 |
| #define | MSHID_MOD_RCTRL 0x10 |
| #define | MSHID_MOD_RSHIFT 0x20 |
| #define | MSHID_MOD_RALT 0x40 |
| #define | MSHID_MOD_RGUI 0x80 |
Functions | |
| bool | MSHIDsendCommand (tSensors link, byte command, ubyte address=MSHID_I2C_ADDR) |
| bool | MSHIDsendKeyboardData (tSensors link, byte modifier, byte keybdata, ubyte address=MSHID_I2C_ADDR) |
| bool | MSHIDsendString (tSensors link, string data, ubyte address=MSHID_I2C_ADDR) |
Variables | |
| tByteArray | MSHID_I2CRequest |
HID Sensor
| #define MSHID_ASCII 0x41 |
Definition at line 49 of file MSHID-driver.h.
| #define MSHID_CMD 0x41 |
Definition at line 44 of file MSHID-driver.h.
| #define MSHID_DDATA 0x44 |
Definition at line 50 of file MSHID-driver.h.
| #define MSHID_I2C_ADDR 0x04 |
Definition at line 43 of file MSHID-driver.h.
| #define MSHID_KEYBDATA 0x43 |
Definition at line 46 of file MSHID-driver.h.
| #define MSHID_KEYBMOD 0x42 |
Definition at line 45 of file MSHID-driver.h.
| #define MSHID_MOD_LALT 0x04 |
Definition at line 56 of file MSHID-driver.h.
| #define MSHID_MOD_LCTRL 0x01 |
Definition at line 54 of file MSHID-driver.h.
| #define MSHID_MOD_LGUI 0x08 |
Definition at line 57 of file MSHID-driver.h.
| #define MSHID_MOD_LSHIFT 0x02 |
Definition at line 55 of file MSHID-driver.h.
| #define MSHID_MOD_NONE 0x00 |
Definition at line 53 of file MSHID-driver.h.
| #define MSHID_MOD_RALT 0x40 |
Definition at line 60 of file MSHID-driver.h.
| #define MSHID_MOD_RCTRL 0x10 |
Definition at line 58 of file MSHID-driver.h.
| #define MSHID_MOD_RGUI 0x80 |
Definition at line 61 of file MSHID-driver.h.
| #define MSHID_MOD_RSHIFT 0x20 |
Definition at line 59 of file MSHID-driver.h.
| #define MSHID_XMIT 0x54 |
Definition at line 48 of file MSHID-driver.h.
| bool MSHIDsendCommand | ( | tSensors | link, |
| byte | command, | ||
| ubyte | address | ||
| ) |
Send a direct command to the HID sensor
| link | the HID port number |
| command | the command to be sent |
| address | the I2C address to use, optional, defaults to 0x04 |
Definition at line 77 of file MSHID-driver.h.
| bool MSHIDsendKeyboardData | ( | tSensors | link, |
| byte | modifier, | ||
| byte | keybdata, | ||
| ubyte | address | ||
| ) |
Send keyboard data to the HID sensor. Must be followed by a MSHID_XMIT command using MSHIDsendCommand()
| link | the HID port number |
| modifier | the keyboard modifier, like shift, control. Can be OR'd together. |
| keybdata | the keystroke to be sent to the computer |
| address | the I2C address to use, optional, defaults to 0x04 |
Definition at line 97 of file MSHID-driver.h.
| bool MSHIDsendString | ( | tSensors | link, |
| string | data, | ||
| ubyte | address | ||
| ) |
Send a string to the computer. Can be up to 19 characters long.
It recognises the following escaped keys:
| link | the HID port number |
| data | the string to be transmitted |
| address | the I2C address to use, optional, defaults to 0x04 |
Definition at line 122 of file MSHID-driver.h.
Array to hold I2C command data
Definition at line 67 of file MSHID-driver.h.


Complete the short order form to buy a paper from our easy essay writing service.
We allocate your order to a suitably-qualified writer with specialist knowledge in, for example, persuasive essay writing if that is what you want.
Our Quality Assurance specialists then check the completed paper to ensure the essay writing is of the highest standard.
The order you placed with our essay writing service is then sent to you before the deadline you set and is accompanied by several free-of-charge features.
Complete the short order form to buy a paper from our easy essay writing service.
We allocate your order to a suitably-qualified writer with specialist knowledge in, for example, persuasive essay writing if that is what you want.
Our Quality Assurance specialists then check the completed paper to ensure the essay writing is of the highest standard.
Complete the short order form to buy a paper from our easy essay writing service.


Routes an HTTP request, where METHOD is the HTTP method of the request,
such as GET, PUT, POST, and so on, in lowercase. Thus, the actual methods
are app.get()
, app.post()
,
app.put()
, and so on. See
Routing methods below for the complete
list.
{% include api/en/4x/routing-args.html %}
Express supports the following routing methods corresponding to the HTTP methods of the same names:
|
|
|
The API documentation has explicit entries only for the most popular HTTP
methods app.get()
, app.post()
,
app.put()
, and app.delete()
. However, the other
methods listed above work in exactly the same way.
To route methods that translate to invalid JavaScript variable names, use
the bracket notation. For example,
app['m-search']('/', function ...
.
The app.get()
function is automatically called for the HTTP
HEAD
method in addition to the GET
method if
app.head()
was not called for the path before
app.get()
.
The method, app.all()
, is not derived from any HTTP method
and loads middleware at the specified path for all HTTP request
methods. For more information, see app.all.
For more information on routing, see the routing guide.


The council shall have power:
To regulate the grades, dimensions, materials and manner of installation of any pavement, bridge, curb, gutter, sidewalk or other improvement constructed in a public way.
To establish and name public ways or widen or extend existing public ways.
To grade and pave public ways and construct, install, repair or reconstruct therein, bridges, streets, curbs, gutters, sidewalks, drains and other necessary or desirable facilities.
To require the owners of any property abutting on a sidewalk in a public way to keep that sidewalk clear of ice, snow and other obstruction.


First ride of 2014
So it was my first ride of 2014 today. I’d been dying to get out on the bike, partly because of my new Garmin Edge 800 but also because I’d been planning a few rides and just hadn’t been able to shake off the flu I came down with on New Years Eve!
Anyhow, I managed to get out today. The idea was to get out and just go for a ride. I’d been playing with Ride with GPS to see how route planning would work with the Garmin. I’d planned a route from Potters Bar to Letchworth Garden City, along National Cycle Route 12.
This route was about 40Km and I thought it would be a good test of the Garmin and also the Talkytoaster OpenStreet maps, as I was using these as the basis of my routing as they’re free.
Well I managed to get out in the morning before the weather got to bad so that was a plus. I decided that I wasn’t going to go quite as far as Letchworth - I wasn’t sure I would cope with there and back again today and due to engineering works, I couldn’t rely on support from National Rail!
Anyhow, so I followed the course fairly well and deliberately went off course at one point early on as I wanted to initially cut straight down to the NCN 6 as soon as I left Potters Bar but I realised the road I would be going down has a flood warning normally so I avoided it and went a different way with the knowledge I could join up at a later point.
Turns out this was probably wise considering the scenes I saw further on my ride! The first obstacle I came across was a fallen tree over the footpath just outside Welham Green. Had to dismount and duck under for this section.
As I entered Hatfield along the path, the path runs alongside the river and the railway lines. Well, the river certainly looked like it had swollen.
As can be seen in the two images above, the water had risen right up to the path. Thankfully it was clear and I carried on.
The routing on the Garmin worked perfectly, though I might have a play with it as it did seem a little late giving directions (i.e. it would tell me where to turn when I was directly at the junction - not ideal if I’m at speed!). However, it worked fine other than that and got me to Welwyn, where I decided to head home via St Albans.
This time I wasn’t so lucky with the water! Just outside St Albans, I had to go through a puddle that was up to the crankset of my bike. I ended up with wet feet but made it through intact. After that was fairly easy going.
Must add that I went down the cycletrack/footpath down the side of the A414 and I have to say it isn’t the most fun road to cycle down but at least there is a cycle track there which makes it much safer to use. Means I can get across from St Alban’s easier and that’s a plus.
Anyhow, a nice easy ride to start the new year off with (and 2% of my annual goal target achieved!)


There are some people out there, who have been a tremendous help in making the site what it is today. While nearly all the code on the site is my own, there are plenty of others who equally deserve credit
For their continued dedication to ensuring accurate and useful data as well as the graphics for a lot of items. Without them there simply would not be a paint or styles feature on this site without their hard work.
For their considerable input on site design, and continued support of the site. Without them I'd be playing on much better servers with much better maps the design wouldn't be what it is.
For his graphic design abilities. Without him we wouldn't have icons for pda/hat/misc/action slot tokens that get used all around the site. Buy a Watchtower stamp/filter for him!


Fun with GitHub Actions
GitHub Actions has been generally available for a while now, but if you already have painstakingly crafted CI infrastructure using another provider such as Travis, it’s not clear whether it’s worth switching over and potentially having to do a lot of work all over again. After experimenting with some of my own repositories, I’m going to talk about how I’ve successfully used it and when I think it makes (or doesn’t make) sense to use it.
GHC-in-GHCi CI
When I learned about GHC-in-GHCi, I was thrilled and quickly wrote a short blog post about how great it is. Immediately afterwards, though, I began to worry: the instructions worked at the time of writing, but how could I ensure that they would remain correct in the future? It would be a very bad experience for someone to come across the blog post a few months later, follow the steps, and yet end up with things not working. I decided it would be a good idea to continuously test these instructions, and I tried to set this up with Travis. I immediately ran into disk space and build time limits. I’d heard CircleCI was better, so I tried that instead, and I ran into similar issues.
Finally I decided it would be a good time to try GitHub Actions. The CI runs on
Microsoft Azure, and their free tier is very generous: I haven’t been able to
find a build time limit for public repositories, and the machines appear to be
significantly faster than the ones Travis CI uses. Setting up a workflow is
also easier than Travis, because there are predefined actions that can be
easily included. Since my instructions required Nix, I needed to have it
installed, and the fine people behind Cachix had gone
ahead and done the work for
me. Another significant
improvement over Travis is the granularity of the cron
support: GitHub
actions can run every hour at most, while Travis builds cannot be configured to
run more frequently than once a day. I was happy to test my instructions daily,
but it’s good to know that I can do something more often if I feel like it. In
the end I was able to repurpose my testing script from my earlier attempts and
the rest of the workflow was straightforward:
name: "Test"
on:
pull_request:
push:
schedule:
- cron: '0 1 * * *'
jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: cachix/install-nix-action@v6
- run: ./steps.sh
Here’s what each section is doing:
name: "Test"
This is what the workflow is called in the UI.
on:
pull_request:
push:
schedule:
- cron: '0 1 * * *'
This action runs on every push, pull request, and at 1:00AM every day.
jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: cachix/install-nix-action@v6
- run: ./steps.sh
There’s one job (called tests
) which runs on the latest Ubuntu virtual
machine image and
- Checks out the repository using the
actions/checkout
action taggedv1
- Installs Nix using the
cachix/install-nix-action
action taggedv6
- Runs
steps.sh
GitHub Actions distinguish between uses
for actions and run
for scripts.
I think this example highlights the two biggest advantages of GitHub actions over e.g. Travis CI:
- Extremely generous resource limits
- Preconfigured, reusable building blocks
You can see the final repository here.
IHaskell Docker
I help maintain IHaskell, and people recently requested an official IHaskell Docker image. Although this seems like a relatively easy request to fulfill, it’s not feasible to include a Docker build as part of our Travis CI setup, as this can easily take over 50 minutes on its own. I toyed with the idea of using Docker Hub’s own CI infrastructure to build the Docker image, but that only seems to work correctly if it’s wired up by the owner of the repository (not just someone with commit permissions).
I also looked into replacing Travis CI with GitHub Actions completely, but it turned out that the repository owner was on a legacy plan, and GitHub Actions wasn’t available. It seemed like I was stuck.
Eventually I realised that there was nothing stopping me from creating
a repository using my own account and effectively polling the IHaskell
repository using the cron
support. This turned out to be even easier than my
previous example, because there is a preconfigured action for building and
pushing a Docker
image! This is what
I came up with:
name: "Docker"
on:
push:
schedule:
- cron: '0 1 * * *'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@722adc63f1aa60a57ec37892e133b1d319cae598
with:
repository: 'gibiansky/IHaskell'
- uses: elgohr/Publish-Docker-Github-Action@a72734e15780689886c6518c4dc2e17876d05d4e
with:
name: gibiansky/ihaskell
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
cache: true
Here’s what each section does:
name: "Docker"
I called this workflow Docker
.
on:
push:
schedule:
- cron: '0 1 * * *'
It runs on every push to this repository, but not on pull requests because I didn’t want to make it possible for a malicious actor to upload anything that way. It also runs at 1:00AM every day.
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@722adc63f1aa60a57ec37892e133b1d319cae598
with:
repository: 'gibiansky/IHaskell'
- uses: elgohr/Publish-Docker-Github-Action@a72734e15780689886c6518c4dc2e17876d05d4e
with:
name: gibiansky/ihaskell
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
cache: true
There’s one job (build
) which pins each of its steps to a particular commit
and
- Uses the
checkout
action to clonegibiansky/IHaskell
by passing it as an argument - Uses the
elgohr/Publish-Docker-Github-Action
to build and push a Docker image togibiansky/ihaskell
, with caching enabled and credentials provided
Again, I’m happy with running this daily for now, but it’s nice to know that I can run it more frequently if I want to. The combination of generous resource limits and preconfigured building blocks makes working like this very easy. When the repository hasn’t changed, the caching support ,which pulls down the latest Docker image before doing anything else, means that nothing is pushed and a CI run takes only a few minutes.
Caching
Depending on your caching requirements, GitHub Actions may not be a better choice than e.g. Travis CI. GitHub Actions provides 5GB of caching, which is a good amount but not enough for IHaskell, which tests against multiple GHC versions and needs a lot of cached dependencies to complete in a reasonable amount of time.
If you’re using Nix, I would recommend using a dedicated caching provider such as Cachix, no matter which CI service you use.
In closing, if your code is hosted on GitHub and you want generous resources and preconfigured building blocks, I would recommend taking a look at GitHub Actions. I’ve since switched over a couple of other repositories and it’s been relatively smooth.


The following table describes classes that are passed to initialize()
, handle_data()
, before_trading_start()
and any scheduled with schedule_function()
.
In QuantConnect/Lean, the portfolio state and the positions are class attributes of QCAlgorithm, available via self keyword. The scheduled function is parameterless and can algorithms can self.CurrentSlice.
| Quantopian | QuantConnect |
|---|---|
quantopian.algorithm.interface.AlgorithmContext |
QCAlgorithm |
| Shared object for storing custom state. | |
quantopian.algorithm.interface.BarData |
Slice |
| Provides methods for accessing minutely and daily price/volume data from Algorithm API functions. | |
quantopian.algorithm.interface.Portfolio |
self.Portfolio |
| Object providing read-only access to current portfolio state. | |
quantopian.algorithm.interface.Positions |
self.Transactions |
| A dict-like object containing the algorithm's current positions. |
The features from the BarData methods are found in the Slice object (current data), History method (past data) and class attribute Securities.
| Quantopian | QuantConnect |
|---|---|
quantopian.algorithm.interface.BarData.current |
Slice[symbol] |
| Returns the "current" value of the given fields for the given assets at the current simulation time. | |
quantopian.algorithm.interface.BarData.history |
self.History(symbols, bar_count) |
Returns a trailing window of length bar_count containing data for the given assets, fields, and frequency. | |
quantopian.algorithm.interface.BarData.can_trade |
self.Securities[symbol].IsTradable |
| For the given asset or iterable of assets, returns True if all of the following are true: | |
quantopian.algorithm.interface.BarData.is_stale |
not Slice[symbol].IsFillForward |
| For the given asset or iterable of assets, returns True if the asset is alive and there is no trade data for the current simulation time. |


Group
Please choose a suitable Group name
Tagline
Please choose a suitable status
Participants
Create Group


This page is part of a Free Code Camp’s exercise.
The background image belongs to Sutulo and was downloaded on Pixabay.
Visit my website for more information.


NIL BY MOUTH A film review by Matt Williams
RATING: * out of * * * *
For his directoral debut, Gary Oldman chose a highly personal family drama about a violent, alcoholic husband and father, and the various lives he affects. But while the characters, places and events may have special meaning to the writer-director, the audience is left in the dark.
The center of this tale is the abusive Raymond (Ray Winstone), and the film focuses on him and the people who orbit around him. He spends his days hanging out with his friends at pubs and girlie bars. Then, he returns home to his pregnant wife, Valerie (Kathy Burke) and their five-year-old daughter.
Raymond demonstrates his violent tendencies (and his paranoid delusions) early on when he accuses Valerie's brother, Billy (Charlie Creed-Miles), of stealing.  But these are the least of Billy's problems. Billy is a heroin addict on the downturn, and it doesn't seem that he'll last much longer.
Billy and Valerie's mother, Janet (Laila Morse), is Raymond's nemesis. She disapproves of him (and he of her), but is powerless to do anything about it. She merely struggles on, hoping her children will survive their respective torments.
If this description seems bleak, I haven't told the half of it. This is not a cheery movie, and most of the time it's downright depressing. While at times it is interesting to watch to see just what makes Raymond tick, and why no one ever simply calls the cops on him, in the end, it's not quite worth it.
There are too many scenes which randomly dot the picture with little or no purpose. Take for example the extended sequence where one of Billy's scuzzy friends defends a stray puppy. The film is filled with these "character moments" that never really achieve anything. Granted, there are a few genuinely powerful (and sickening) moments in the film, but their expression seems to be more of a catharsis for the creator than us.
The actors do a fine job, particularly in the central roles. The good thing about an actor turned writer is that Oldman knows how to write good scenes, and the actors in Nil By Mouth have some meat they can tear into.
The bad thing about an actor turned director is that there's no one to restrain Oldman from making poor choices. A good character drama should mean something to those involved in making the film AND the audience. Oldman got it about half right.
Copyright 1998 Matt Williams
- Matt Williams<EMAIL_ADDRESS>Reviewer for Shreck's Cinema: http://www.shreck.com Home of over 500 reviews, and information on over 600 upcoming releases
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


|
Class Summary |
| AccessExpression |
AccessExpression is a representation for expressions that access
a member of class-like objects. |
| AccessLevel |
This class is not supported |
| AccessOperator |
Infix operators that accesses righthand side member of lefthand side
structure, class, or union. |
| AccessSymbol |
AccessSymbol is intended to express an object of AccessExpression as a
Symbol object. |
| AlignofExpression |
AlignofExpression represents the non-standard __alignof__ operation. |
| Annotation |
Annotation is the base class of any annotation type used in Cetus. |
| AnnotationDeclaration |
AnnotationDeclaration is used for stand-alone annotations in non-executable
code section, e.g., in a TranslationUnit. |
| AnnotationStatement |
AnnotationStatement is used for stand-alone annotations in executable
code section, e.g., in a CompoundStatement. |
| ArrayAccess |
Represents the access of an array or pointer variable: array[x][y]... |
| ArraySpecifier |
Represents an array specifier, for example the bracketed
parts of int array[20][30]; |
| AssignmentExpression |
AssignmentExpression represents an assignment expression having a
LHS expression, assignment operator, and a RHS expression. |
| AssignmentOperator |
Infix operators that assign the value of their righthand side
to their lefthand side. |
| BinaryExpression |
BinaryExpression represents an expression having a LHS operand, an
operator, and a RHS operand. |
| BinaryOperator |
Infix operators that act on two expressions. |
| BitfieldSpecifier |
BitfieldSpecifier represents the bit field declared in a structure. |
| BooleanLiteral |
Represents a boolean literal (true or false). |
| BreadthFirstIterator |
Iterates over Traversable objects in breadth-first order. |
| BreakStatement |
Represents a break statement: break ';' |
| Case |
Represents a case for use with switch. |
| CetusAnnotation |
CetusAnnotation is used for internal annotations inserted by Cetus analysis and
transformation. |
| ChainedList<T> |
Very similar to a LinkedList, except provides an add
method that returns the list itself, allowing you to
perform method chaining. |
| CharLiteral |
Represents a character literal in the program. |
| ClassDeclaration |
Represents a class, struct, or union. |
| ClassDeclaration.Key |
Class for representing the four different types of class declarations,
class, struct, union, and interface. |
| CodeAnnotation |
CodeAnnotation is used for an annotation of raw code type. |
| CommaExpression |
Represents expressions separated by the comma
operator in C or C++. |
| CommentAnnotation |
CommentAnnotation is used for an annotation of comment type. |
| CompoundStatement |
CompoundStatement represents a group of statements that are treated
as a single statement. |
| ConditionalExpression |
Represents the only ternary expression in C and C++,
the ?: operator. |
| ConstructorInitializer |
This class is no longer supported |
| ContinueStatement |
Represents a continue statement: continue ';' |
| DataFlowTools |
|
| Declaration |
Base class for all declarations. |
| DeclarationStatement |
Represents a statement that contains a declaration as the only child, and
appears within a compound statement. |
| Declarator |
Represents the part of a declaration that is the name
of the symbol, some type information, and initial values. |
| Default |
Represents a default for use with switch. |
| DeleteExpression |
This class is not supported. |
| DepthFirstIterator |
Iterates over Traversable objects in depth-first order. |
| DerefSymbol |
Class DerefSymbol represents symbol object that does not exist in the
IR as a variable declarator but is accessible through pointer dereferencing. |
| DestructorID |
Represents the name of a C++ destructor. |
| DoLoop |
DoLoop represents a C-style do-while loop. |
| Enumeration |
Enumeration represents a C or C++ enumeration. |
| EscapeLiteral |
Represents a escape character. |
| ExceptionHandler |
Represents an exception handling block (try-catch-finally block)
in a C++ or Java program. |
| ExceptionSpecification |
|
| Expression |
Base class for all expressions. |
| ExpressionStatement |
A statement with the purpose of evaluating an
expression for a side effect. |
| FlatIterator |
Iterates over the immediate children of a Traversable object. |
| FloatLiteral |
Represents a float-type literal in the program. |
| ForLoop |
ForLoop represents a C-style for loop, typically having an initial
statement, a condition expression, and a step expression. |
| FunctionCall |
Represents a function or method call. |
| GotoStatement |
Represents a goto statement having a target label. |
| Identifier |
Identifier represents a valid C identifier which has a matching
variable declarator. |
| IDExpression |
IDExpression represents an IR object that appears as an identifier in
the program. |
| IfStatement |
Represents a if statement in C programs. |
| InfExpression |
InfExpression represents a literal expression having a value greater
than or less than any possible numbers. |
| Initializer |
|
| IntegerLiteral |
Represents an integer literal in the program. |
| IRIterator |
An iterator implementing this interface supports special versions of next. |
| IRTools |
IRTools provides tools that perform search/replace in the IR tree. |
| Label |
Represents a label for use with goto statements. |
| LinkageSpecification |
This class is not supported |
| ListInitializer |
|
| Literal |
Represents an immediate value within the program. |
| MinMaxExpression |
Class for MIN() MAX() expressions - these are equivalent to conditional
expressions. |
| NameID |
NameID is introduced to separate the uses of Identifier for
better IR consistency. |
| Namespace |
This class is not supported |
| NamespaceAlias |
This class is not supported |
| NestedDeclarator |
Represents a nested declarator that may contain another declarator within
itself. |
| NewExpression |
This class is no longer supported. |
| NullStatement |
Represents an empty statement. |
| OffsetofExpression |
Represents a __builtin_offsetof() operator. |
| OmpAnnotation |
OmpAnnotation is used for internally representing OpenMP pragmas. |
| OperatorID |
C++ overloaded operator IDs. |
| PointerSpecifier |
Represents a C or C++ pointer. |
| PostOrderIterator |
Peforms a post-order traversal over a Traversable object. |
| PragmaAnnotation |
PragmaAnnotation is used for annotations of pragma type. |
| PreAnnotation |
Represents a text annotation (comment or pragma) or a list of keyed values. |
| PrintTools |
PrintTools provides tools that perform printing of collections of IR
or debug messages. |
| Procedure |
Represents a function, subroutine, or method. |
| ProcedureDeclarator |
Represents a declarator for a Procedure in a VariableDeclaration. |
| Program |
Represents the entire program. |
| PseudoSymbol |
PseudoSymbol is intended to provide Symbol interface in an
object that is not part of the IR. |
| QualifiedID |
This class is no longer supported |
| RangeExpression |
RangeExpression represents a symbolic range with a lower bound
expression and an upper bound expression. |
| ReturnStatement |
Represents a return statement within a procedure. |
| SimpleExpression |
SimpleExpression is another form of representing an expression which is
effective in symbolic manipulation. |
| SizeofExpression |
Represents a sizeof operation in C programs. |
| SomeExpression |
Represents a container that holds a raw code not expressed as a well-defined
internal representation. |
| Specifier |
Represents type specifiers and modifiers. |
| StandardLibrary |
Repository for C99 standard library functions. |
| Statement |
Base class for all statements. |
| StatementExpression |
Represents an expression containing a compound statement - GCC extension. |
| StringLiteral |
Represents a string literal in the program. |
| SwitchStatement |
Represents a switch statement in C programs. |
| Symbolic |
Class Symbolic provides static utility methods that simplifies expressions
symbolically. |
| SymbolTools |
SymbolTools provides tools for interfacing symbol tables and related
searches. |
| TemplateDeclaration |
This class is not supported |
| TemplateID |
This class is no longer supported |
| ThrowExpression |
This class is no longer supported |
| Tools |
Collection of static tools that are useful in writing passes. |
| TranslationUnit |
Represents a single source file of the program. |
| Typecast |
Represents a typecast expression in C programs. |
| Typecast.Cast |
Represents a cast type |
| TypeofSpecifier |
This class is no longer supported. |
| UnaryExpression |
Represents an expression having a unary operator and an operand expression. |
| UnaryOperator |
Operators that act on a single expression. |
| UserSpecifier |
Represents the name of a user-defined type, such
as created by a typedef, class declaration, etc. |
| UsingDeclaration |
This class is not supported |
| UsingDirective |
This class is not supported |
| VaArgExpression |
Represents __builtin_va_arg() operation in C programs. |
| ValueInitializer |
|
| VariableDeclaration |
Represents a statement that introduces a new variable
or function prototype. |
| VariableDeclarator |
Represents a declarator for a variable in a VariableDeclaration. |
| WhileLoop |
WhileLoop represents a while loop having a condition expression and
a loop body. |


| I l@ve RuBoard |
3.8 Launching Programs on WindowsSuppose just for a moment, that you've been asked to write a big Python book, and want to provide a way for readers to easily start the book's examples on just about any platform that Python runs on. Books are nice, but it's awfully fun to be able to click on demos right away. That is, you want to write a general and portable launcher program in Python, for starting other Python programs. What to do? In this chapter, we've seen how to portably spawn threads, but these are simply parallel functions, not external programs. We've also learned how to go about starting new, independently running programs, with both the fork/exec combination, and tools for launching shell commands such as os.popen. Along the way, though, I've also been careful to point out numerous times that the os.fork call doesn't work on Windows today, and os.popen fails in Python release 1.5.2 and earlier when called from a GUI program on Windows; either of these constraints may be improved by the time you read this book (e.g., 2.0 improves os.popen on Windows), but they weren't quite there yet as I wrote this chapter. Moreover, for reasons we'll explore later, the os.popen call is prone to blocking (pausing) its caller in some scenarios. Luckily, there are other ways to start programs in the Python standard library, albeit in platform-specific fashion:
3.8.1 The os.spawnv CallOf these, the spawnv call is the most complex, but also the most like forking programs in Unix. It doesn't actually copy the calling process (so shared descriptor operations won't work), but can be used to start a Windows program running completely independent of the calling program. The script in Example 3-22 makes the similarity more obvious -- it launches a program with a fork/exec combination in Linux, or an os.spawnv call on Windows. Example 3-22. PP2E\System\Processes\spawnv.py############################################################ # start up 10 copies of child.py running in parallel; # use spawnv to launch a program on Windows (like fork+exec) # P_OVERLAY replaces, P_DETACH makes child stdout go nowhere ############################################################ import os, sys for i in range(10): if sys.platform[:3] == 'win': pypath = r'C:\program files\python\python.exe' os.spawnv(os.P_NOWAIT, pypath, ('python', 'child.py', str(i))) else: pid = os.fork( ) if pid != 0: print 'Process %d spawned' % pid else: os.execlp('python', 'python', 'child.py', str(i)) print 'Main process exiting.' Call os.spawnv with a process mode flag, the full directory path to the Python interpreter, and a tuple of strings representing the DOS command line with which to start a new program. The process mode flag is defined by Visual C++ (whose library provides the underlying spawnv call); commonly used values include:
Run a dir(os) call to see other process flags available, and either run a few tests or see VC++ documentation for more details; things like standard stream connection policies vary between the P_DETACH and P_NOWAIT modes in subtle ways. Here is this script at work on Windows, spawning 10 independent copies of the child.py Python program we met earlier in this chapter: C:\...\PP2E\System\Processes>type child.py import os, sys print 'Hello from child', os.getpid( ), sys.argv[1] C:\...\PP2E\System\Processes>python spawnv.py Hello from child -583587 0 Hello from child -558199 2 Hello from child -586755 1 Hello from child -562171 3 Main process exiting. Hello from child -581867 6 Hello from child -588651 5 Hello from child -568247 4 Hello from child -563527 7 Hello from child -543163 9 Hello from child -587083 8 Notice that the copies print their output in random order, and the parent program exits before all children do; all these programs are really running in parallel on Windows. Also observe that the child program's output shows up in the console box where spawnv.py was run; when using P_NOWAIT standard output comes to the parent's console, but seems to go nowhere when using P_DETACH instead (most likely a feature, when spawning GUI programs). The os.spawnve call works the same as os.spawnv, but accepts an extra fourth dictionary argument to specify a different shell environment for the spawned program (which, by default, inherits all the parent's settings). 3.8.2 Running DOS Command LinesThe os.system and os.popen calls can be used to start command lines on Windows just as on Unix-like platforms (but with the portability caveats about popen mentioned earlier). On Windows, though, the DOS start command combined with os.system provides an easy way for scripts to launch any file on the system, using Windows filename associations. Starting a program file this way makes it run as independently as its starter. Example 3-23 demonstrates these launch techniques. Example 3-23. PP2E\System\Processes\dosstart.py############################################################ # start up 5 copies of child.py running in parallel; # - on Windows, os.system always blocks its caller, # and os.popen currently fails in a GUI programs # - using DOS start command pops up a DOS box (which goes # away immediately when the child.py program exits) # - running child-wait.py with DOS start, 5 independent # DOS console windows popup and stay up (1 per program) # DOS start command uses file name associations to know # to run Python on the file, as though double-clicked in # Windows explorer (any filename can be started this way); ############################################################ import os, sys for i in range(5): #print os.popen('python child.py ' + str(i)).read( )[:-1] #os.system('python child.py ' + str(i)) #os.system('start child.py ' + str(i)) os.system('start child-wait.py ' + str(i)) print 'Main process exiting.' Uncomment one of the lines in this script's for loop to experiment with these schemes on your computer. On mine, when run with either of the first two calls in the loop uncommented, I get the following sort of output -- the text printed by five spawned Python programs: C:\...\PP2E\System\Processes>python dosstart.py Hello from child -582331 0 Hello from child -547703 1 Hello from child -547703 2 Hello from child -547651 3 Hello from child -547651 4 Main process exiting. The os.system call usually blocks its caller until the spawned program exits; reading the output of a os.popen call has the same blocking effect (the reader waits for the spawned program's output to be complete). But with either of the last two statements in the loop uncommented, I get output that simply looks like this: C:\...\PP2E\System\Processes>python dosstart.py Main process exiting. In both cases, I also see five new and completely independent DOS console windows appear on my display; when the third line in the loop is uncommented, all the DOS boxes go away right after they appear; when the last line in the loop is active, they remain on the screen after the dosstart program exits because the child-wait script pauses for input before exit. <IP_ADDRESS> Using the DOS start commandTo understand why, you first need to know how the DOS start command works in general. Roughly, a DOS command line of the form start command works as if command were typed in the Windows "Run" dialog box available in the Start button menu. If command is a filename, it is opened exactly as if its name had been double-clicked in the Windows Explorer file selector GUI. For instance, the following three DOS commands automatically start Internet Explorer on a file index.html, my registered image viewer program on a uk-1.jpg, and my sound media player program on file sousa.au. Windows simply opens the file with whatever program is associated to handle filenames of that form. Moreover, all three of these programs run independently of the DOS console box where the command is typed: C:\temp>start c:\stuff\website\public_html\index.html C:\temp>start c:\stuff\website\public_html\uk-1.jpg C:\...\PP2E\System\Processes>start ..\..\Internet\Ftp\sousa.au Now, because the start command can run any file and command line, there is no reason it cannot also be used to start an independently running Python program: C:\...\PP2E\System\Processes>start child.py 1 Because Python is registered to open names ending in .py when it is installed, this really does work -- script child.py is launched independently of the DOS console window, even though we didn't provide the name or path of the Python interpreter program. Because child.py simply prints a message and exits, though, the result isn't exactly satisfying: a new DOS window pops up to serve as the script's standard output, and immediately goes away when the child exits (it's that Windows "flash feature" described earlier!). To do better, add a raw_input call at the bottom of the program file to wait for a key press before exiting: C:\...\PP2E\System\Processes>type child-wait.py import os, sys print 'Hello from child', os.getpid( ), sys.argv[1] raw_input("Press <Enter>") # don't flash on Windows C:\...\PP2E\System\Processes>start child-wait.py 2 Now the child's DOS window pops up and stays up after the start command has returned. Pressing the Enter key in the pop-up DOS window makes it go away. <IP_ADDRESS> Using start in Python scriptsSince we know that Python's os.system and os.popen can be called by a script to run any command line that can be typed at a DOS shell prompt, we can also start independently running programs from a Python script by simply running a DOS start command line. For instance: C:\...\PP2E>python >>> import os >>> >>> cmd = r'start c:\stuff\website\public_html\index.html' # start IE browser >>> os.system(cmd) # runs independent 0 >>> file = r'gui\gifs\pythonPowered.gif' # start image viewer >>> os.system('start ' + file) # IE opens .gif for me 0 >>> os.system('start ' + 'Gui/gifs/PythonPowered.gif') # fwd slashes work too 0 >>> os.system(r'start Internet\Ftp\sousa.au') # start media bar 0 The four Python os.system calls here start whatever web-page browser, image viewer, and sound player are registered on your machine to open .html, .gif, and .au files (unless these programs are already running). The launched programs run completely independent of the Python session -- when running a DOS start command, os.system does not wait for the spawned program to exit. For instance, Figure 3-1 shows the .gif file handler in action on my machine, generated by both the second and third os.system calls in the preceding code. Figure 3-1. Started image viewer (Internet Explorer)Now, since we also know that a Python program be can started from a command line, this yields two ways to launch Python programs: C:\...\PP2E>python >>> os.system(r'python Gui\TextEditor\textEditor.pyw') # start and wait 0 >>> os.system(r'start Gui\TextEditor\textEditor.pyw') # start, go on 0 When running a python command, the os.system call waits (blocks) for the command to finish. When running a start command it does not -- the launched Python program (here, PyEdit, a text editor GUI we'll meet in Chapter 9) runs independent of the os.system caller. And finally, that's why the following call in dosstart.py generates a new, independent instance of child-wait.py : C:\...\PP2E\System\Processes>python >>> os.system('start child-wait.py 1') 0 When run, this call pops up a new, independent DOS console window to serve as the standard input and output streams of the child-wait program. It truly is independent -- in fact, it keeps running if we exit both this Python interpreter session and the DOS console box where the command was typed.[9] An os.popen call can launch a start command too; but since it normally starts commands independently anyhow, the only obvious advantages of start here are the pop-up DOS box, and the fact that Python need not be in the system search path setting:
>>> file = os.popen('start child-wait.py 1') # versus: python child-wait... >>> file.read( ) 'Hello from child -413849 1\012Press <Enter>' Which scheme to use, then? Using os.system or os.popen to run a python command works fine, but only if your users have added the python.exe directory to their system search path setting. Running a DOS start command is often a simpler alternative to both running python commands and calling the os.spawnv function, since filename associations are automatically installed along with Python, and os.spawnv requires a full directory path to the Python interpreter program (python.exe). On the other hand, running start commands with os.system calls can fail on Windows for very long command-line strings: >>> os.system('start child-wait.py ' + 'Z'*425) # okay- 425 Zs in dos popup 0 >>> os.system('start child-wait.py ' + 'Z'*450) # fails- msg, not exception Access is denied. 0 >>> os.popen('python child-wait.py ' + 'Z'*500).read( ) # works if PATH set >>> os.system('python child-wait.py ' + 'Z'*500) # works if PATH set >>> pypath = r'C:\program files\python\python.exe' # this works too >>> os.spawnv(os.P_NOWAIT, pypath, ('python', 'child-wait.py', 'Z'*500)) As a rule of thumb, use os.spawnv if your commands are (or may be) long. For instance, we'll meet a script in Chapter 4, that launches web browsers to view HTML files; even though a start command applied to an HTML file will automatically start a browser program, this script instead must use os.spawnv to accommodate potentially long directory paths in HTML filenames. For more information on other Windows-specific program launcher tools, see O'Reilly's Python Programming on Win32. Other schemes are even less standard than those shown here, but are given excellent coverage in that text. 3.8.3 A Portable Program-Launch FrameworkWith all these different ways to start programs on different platforms, it can be difficult to remember what tools to use in a given situation. Moreover, some of these tools are called in ways that are complicated enough to easily forget (for me, at least). I write scripts that need to launch Python programs often enough that I eventually wrote a module to try and hide most of the underlying details. While I was at it, I made this module smart enough to automatically pick a launch scheme based on the underlying platform. Laziness is the mother of many a useful module. Example 3-24 collects many of the techniques we've met in this chapter in a single module. It implements an abstract superclass, LaunchMode, which defines what it means to start a Python program, but doesn't define how. Instead, its subclasses provide a run method that actually starts a Python program according to a given scheme, and (optionally) define an announce method to display a program's name at startup time. Example 3-24. PP2E\launchmodes.py############################################################### # launch Python programs with reusable launcher scheme classes; # assumes 'python' is on your system path (but see Launcher.py) ############################################################### import sys, os, string pycmd = 'python' # assume it is on your system path class LaunchMode: def __init__(self, label, command): self.what = label self.where = command def __call__(self): # on call, ex: button press callback self.announce(self.what) self.run(self.where) # subclasses must define run( ) def announce(self, text): # subclasses may redefine announce( ) print text # methods instead of if/elif logic def run(self, cmdline): assert 0, 'run must be defined' class System(LaunchMode): # run shell commands def run(self, cmdline): # caveat: blocks caller os.system('%s %s' % (pycmd, cmdline)) # unless '&' added on Linux class Popen(LaunchMode): # caveat: blocks caller def run(self, cmdline): # since pipe closed too soon os.popen(pycmd + ' ' + cmdline) # 1.5.2 fails in Windows GUI class Fork(LaunchMode): def run(self, cmdline): assert hasattr(os, 'fork') # for linux/unix today cmdline = string.split(cmdline) # convert string to list if os.fork( ) == 0: # start new child process os.execvp(pycmd, [pycmd] + cmdline) # run new program in child class Start(LaunchMode): def run(self, cmdline): # for windows only assert sys.platform[:3] == 'win' # runs independent of caller os.system('start ' + cmdline) # uses Windows associations class Spawn(LaunchMode): # for windows only def run(self, cmdline): # run python in new process assert sys.platform[:3] == 'win' # runs independent of caller #pypath = r'C:\program files\python\python.exe' try: # get path to python pypath = os.environ['PP2E_PYTHON_FILE'] # run by launcher? except KeyError: # if so configs env from Launcher import which, guessLocation pypath = which('python.exe', 0) or guessLocation('python.exe', 1,0) os.spawnv(os.P_DETACH, pypath, ('python', cmdline)) # P_NOWAIT: dos box class Top_level(LaunchMode): def run(self, cmdline): # new window, same process assert 0, 'Sorry - mode not yet implemented' # tbd: need GUI class info if sys.platform[:3] == 'win': PortableLauncher = Spawn # pick best launcher for platform else: # need to tweak this code elsewhere PortableLauncher = Fork class QuietPortableLauncher(PortableLauncher): def announce(self, text): pass def selftest( ): myfile = 'launchmodes.py' program = 'Gui/TextEditor/textEditor.pyw ' + myfile # assume in cwd raw_input('default mode...') launcher = PortableLauncher('PyEdit', program) launcher( ) # no block raw_input('system mode...') System('PyEdit', program)( ) # blocks raw_input('popen mode...') Popen('PyEdit', program)( ) # blocks if sys.platform[:3] == 'win': raw_input('DOS start mode...') # no block Start('PyEdit', program)( ) if __name__ == '__main__': selftest( ) Near the end of the file, the module picks a default class based on the sys.platform attribute: PortableLauncher is set to a class that uses spawnv on Windows and one that uses the fork/exec combination elsewhere. If you import this module and always use its PortableLauncher attribute, you can forget many of the platform-specific details enumerated in this chapter. To run a Python program, simply import the PortableLauncher class, make an instance by passing a label and command line (without a leading "python" word), and then call the instance object as though it were a function. The program is started by a call operation instead of a method, so that the classes in this module can be used to generate callback handlers in Tkinter-based GUIs. As we'll see in the upcoming chapters, button-presses in Tkinter invoke a callable-object with no arguments; by registering a PortableLauncher instance to handle the press event, we can automatically start a new program from another program's GUI. When run standalone, this module's selftest function is invoked as usual. On both Windows and Linux, all classes tested start a new Python text editor program (the upcoming PyEdit GUI program again) running independently with its own window. Figure 3-2 shows one in action on Windows; all spawned editors open the launchmodes.py source file automatically, because its name is passed to PyEdit as a command-line argument. As coded, both System and Popen block the caller until the editor exits, but PortableLauncher (really, Spawn or Fork) and Start do not:[10]
C:\...\PP2E>python launchmodes.py default mode... PyEdit system mode... PyEdit popen mode... PyEdit DOS start mode... PyEdit Figure 3-2. PyEdit program spawned from launchmodesAs a more practical application, this file is also used by launcher scripts designed to run examples in this book in a portable fashion. The PyDemos and PyGadgets scripts at the top of this book's examples directory tree (view CD-ROM content online at http://examples.oreilly.com/python2) simply import PortableLauncher, and register instances to respond to GUI events. Because of that, these two launcher GUIs run on both Windows and Linux unchanged (Tkinter's portability helps too, of course). The PyGadgets script even customizes PortableLauncher to update a label in a GUI at start time: class Launcher(launchmodes.PortableLauncher): # use wrapped launcher class def announce(self, text): # customize to set GUI label Info.config(text=text) We'll explore these scripts in Part II (but feel free to peek at the end of Chapter 8, now). Because of this role, the Spawn class in this file uses additional tools to search for the Python executable's path -- required by os.spawnv. It calls two functions exported by a file Launcher.py to find a suitable python.exe, whether or not the user has added its directory to their system PATH variable's setting. The idea is to start Python programs, even if Python hasn't been installed in the shell variables on the local machine. Because we're going to meet Launcher.py in Chapter 4, though, I'm going to postpone further details for now. |
| I l@ve RuBoard |