Brand
The brand elements include logo, sub brands, colors and typeface.
To maintain consistency, proportions must not be altered.
Logo
Logo color variations
COLOR VERSION
Spot logo, one color logo, for use on white backgrounds or where there is sufficient contrast between the logo and the background for reproduction.
BLACK VERSION
Black logo - for use when color reproduction is not an option
WHITE VERSION
Where the background does not contract sufficiently strongly with the full color Master Brand Identity, the white version should be used.
Clear and white space around the identity
The Zemanta logo should have the following minimum amounts of space around it. The height of the " Z " forms the clear or white space.
Identity variations
Use one of the following logos for Zemanta sub brands
Download
Unacceptable use
Don’t stretch the logo disproportionately.
Don’t change the color of the logo.
Don’t typeset the wordmark.
If there is no space for horizontal version of Zemanta logo you should rotate it for 90°.
Don’t rotate the logo.
Don’t stretch the logo disproportionately.
Don’t change the color of the logo.
Don’t typeset the wordmark.

 You can also use to highlight.

Colors
#f68620
#074f76
#2fa8c7
#313131
#cacaca


Hi! Everyone should check out these amazing photographs that my friend shot the past week. Here’s one of them...leave a kind comment!
Here’s the first photo of our incredible photoshoot from yesterday. If you like it please say so and tel me what you wanna see next!


{% extends 'base-inner.html' %} {% block title %}Help Center{% endblock title %} {% block content %}
Need help with Huxley? You're in the right place! Take a look at the questions below, and click on a question to display the answer. If you can't find what you're looking for, please contact us at<EMAIL_ADDRESS>for more information.
{% for cat, questions in categories.items %}{{ ques.answer }}


| channel_handle = variable assigned to the channel when played |
|
Often you will need to know if a sound channel has completed playing or not. This command will return 1 if the sound is still playing or 0 if it has stopped. Use this to restart your background music or some other sound that might have stopped unintentionally.
Note: This command currently doesn't seem to work with a channel assigned to CD track playback. |
|
; Channel examples
Print "Loading sound ..." ; Load the sample - you'll need to point this to a sound on your computer ; For best results, make it about 5-10 seconds... sndWave=LoadSound("level1.wav") Print "Playing full sample until sound is done ..." chnWave=PlaySound(sndWave) While ChannelPlaying(chnWave) Wend Print "All done!" |


Crisman-Cox, Casey, Olga Gasparyan, Curtis Signorino (2023). "Finding and Accounting for Separation Bias in Strategic Choice Models." Political Analysis, 31 (3): 414 - 429 [paper] [appendix] [replications]
Kim R van Daalen, Marina Romanello, Joacim Rocklöv, ... Olga Gasparyan, ..., & Rachel Lowe (2022). The 2022 Europe report of the Lancet Countdown on health and climate change: towards a climate resilient future. The Lancet Public Health, 7(11), e942-e965. [paper]
"Indirect Rule and Public Goods Provision: Evidence from Colonial India" [paper] [appendix] (R&R at Political Science Research and Methods)
"Local Elections, Efficiency, and Resource Allocation: Evidence from Russian Cities"
[download]
"Media Choice and Audience Reaction:
Evidence from Visual Framing of Immigration in News Stories"
(with Elena Sirotkina and Michelle Torres)
[current version]
Visual political polarization: How people look at political images and what they see" (with Elena Sirotkina)
[current version]
"Using visual sentiment labeling to address annotator bias" (with Elena Sirotkina and Michelle Torres) ''The Importance and Peculiarities of Archival Work in Political Science'',
Comparative Politics Newsletter, 2019, XXIX(2): 5-11.
[article]
Work in Progress:
"Local Resource Allocation Choices: Topic Models of Russian Public Procurement Contracts"
Climate Change and Health Issues Rhetoric (Lancet Countdown Working Group)
"When States Debate: The UN General Debate and the Use of Text Analysis in International Relations" (with Niheer Dasandi, Slava Jankin, and Neil Mitchell)
Non Peer-Review Publications:


Before Change
for device in discovery_info:
name = device.get("address")
address = device.get("address_hex")
dimmable = bool("dimmable" in device.get("capabilities"))
_LOGGER.info("Registered %s with light platform", name)
device_list.append(
After Change
state_key = discovery_info["state_key"]
_LOGGER.debug("Adding device %s entity %s to Light platform",
device.address.hex, device.states[state_key].name)
new_entity = InsteonPLMDimmerDevice(device, state_key)


Events
(current)
Profile
FAQ
Logout
Event Categories
Super-Organizers
Casual
Professional
Previous
Next
{{ x.event_name }}
{{ x.event_ldesc}}
+
Add an event
×
Event Name
Description
Upload Image
This is some placeholder block-level help text for the above input. It's a bit lighter and easily wraps to a new line.
When
City
State
Event Category
© Developed by Team 5 - ISTM 631 601: IS Design. All Rights Reserved.


COMPLETE YOUR REGISTRATION
SUPPORT OUR MARINES AND BE A PART OF OUR HISTORY
Come to the world famous navy and put a little bit of your soul in game, make America great again.
Register
Name:
Surname:
Email:
State:
Alabama
Alaska
Arkansas
Arizona
California
Colorado
Connecticut
Delaware
Florida
Georgia
Hawaii
Idaho
Illinois
Indiana
Iowa
Kentucky[
Louisiania
Maine
Maryland
Massachusetts
Michigan
Minnesota
Mississippi
Missouri
Montana
Nebraska
Nevada
New Hampshire
New Jersey
New York
New México
North Carolina
North Dakota
Oklahoma
Ohio
Oregon
Pennsylvania
Rhode Island
South Carolina
South Dakota
Tennessee
Texas
Utah
Vermont
Virginia
West Virginia
Washington
Wisconsin
Wyoming
Tel. Number


@JvmField protected val prefixMap: PrefixMap
The mutable map which maps prefixes to the respective CommandMap.


|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object Client
public class Client
Provides an interface to the Internet MiniChess Server.
See the MiniChess Page for information. The basic workflow is to create a client object connected to the server, use the offer() or accept() method to start a game on that client, and then use the getMove() and sendMove() methods to play the game.
A lower-level "expect/send" interface is also provided for those who want to extend the functionality of this class.
| Constructor Summary | |
|---|---|
Client(java.lang.String server,
java.lang.String portStr,
java.lang.String username,
java.lang.String password)
Create a new client connected to IMCS and logged on. |
|
Client(java.lang.String server,
java.lang.String portStr,
java.lang.String username,
java.lang.String password,
java.lang.String sendLineEnding)
Create a new client connected to IMCS and logged on. |
| Method Summary | |
|---|---|
char |
accept(java.lang.String id,
char color)
Instruct the server to accept a game. |
void |
close()
Closes the connection to the server. |
java.lang.String |
expect(java.lang.String code,
boolean verbose)
Get a response from the server. |
java.lang.String |
expectResponse(boolean verbose)
Get a response from the server. |
char |
offer(char color)
Instruct the server to offer a game to other players. |
static java.lang.String |
responseCode(java.lang.String response)
Get the response code from a response. |
static java.lang.String |
responseString(java.lang.String response)
Get the response text from a response. |
void |
send(java.lang.String cmd,
boolean verbose)
Send a command to the server. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Client(java.lang.String server, java.lang.String portStr, java.lang.String username, java.lang.String password) throws java.io.IOException
server
- hostname or IP address of IMCS server, usually "imcs.svcs.cs.pdx.edu"portStr
- server port number string, usually "3589"username
- username of account on IMCS serverpassword
- password of account on IMCS server
java.io.IOException
public Client(java.lang.String server, java.lang.String portStr, java.lang.String username, java.lang.String password, java.lang.String sendLineEnding) throws java.io.IOException
server
- hostname or IP address of IMCS server, usually "imcs.svcs.cs.pdx.edu"portStr
- server port number string, usually "3589"username
- username of account on IMCS serverpassword
- password of account on IMCS serversendLineEnding
- what to use for line ending when sending
java.io.IOException
| Method Detail |
|---|
public java.lang.String expectResponse(boolean verbose) throws java.io.IOException
verbose
- if true, print the command sent on stdout
java.io.IOException
public static java.lang.String responseCode(java.lang.String response)
response
- response
public static java.lang.String responseString(java.lang.String response)
response
- response
public java.lang.String expect(java.lang.String code, boolean verbose) throws java.io.IOException
code
- expected codeverbose
- if true, print the command sent on stdout
java.io.IOException
public void send(java.lang.String cmd, boolean verbose)
cmd
- command to sendverbose
- if true, print the command sent on stdoutpublic char offer(char color) throws java.io.IOException
color
- the color your side wants to play
java.io.IOException
public char accept(java.lang.String id, char color) throws java.io.IOException
id
- game id number stringcolor
- the color that your side wants to play
java.io.IOException
public void close() throws java.io.IOException
java.io.IOException
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |


>
By Ryan, Rahib, Danny and Muiz
How many
people
do you need to order for?
Select...
1
2
3
4
5
6
7
8
9
10+
Confirm
Pick your four
favourite
pizza toppings.
Pepperoni
Ham
Bacon
Italian Sausage
Chicken
Tomatoes
Mushrooms
Pineapple
Banana Peppers
Green Peppers
Red Peppers
Olives
Onion
Pepperoni
Ham
Bacon
Italian Sausage
Chicken
Tomatoes
Mushrooms
Pineapple
Banana Peppers
Green Peppers
Red Peppers
Olives
Onion
Pepperoni
Ham
Bacon
Italian Sausage
Chicken
Tomatoes
Mushrooms
Pineapple
Banana Peppers
Green Peppers
Red Peppers
Olives
Onion
Pepperoni
Ham
Bacon
Italian Sausage
Chicken
Tomatoes
Mushrooms
Pineapple
Banana Peppers
Green Peppers
Red Peppers
Olives
Onion
Confirm Toppings
Your closest pizzeria is:
Your price is:
Check the
particle board
for more info!
Order
here!


- Title: ${title}
- Status: ${paymentRequest.completed ? 'Completed' : 'Not Approved'}
- USD Equivalent: ${value.total | usdFormat}
- Approval URL: ${paymentRequest.approval_url}
- From: ${paymentRequest.from_address}
- To: ${paymentRequest.to_label ? paymentRequest.to_label : paymentRequest.to_address}


Class SpriteEffect
java.lang.Object
|
+--SpriteEffect
- All Implemented Interfaces:
- MapEffect, java.lang.Runnable
- public class SpriteEffect
- extends java.lang.Object
- implements MapEffect, java.lang.Runnable
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
running
private boolean running
owner
private MapPanel owner
sheet
private java.awt.Image sheet
swidth
private int swidth
sheight
private int sheight
scurrent
private int scurrent
stimer
private int stimer
wnum
private int wnum
hnum
private int hnum
total
private int total
tx
private int tx
ty
private int ty
reverse
private boolean reverse
loops
private int loops
curloops
private int curloops
direction
private int direction
SpriteEffect
public SpriteEffect(MapPanel mp)
setReverse
public void setReverse(boolean r)
setLoops
public void setLoops(int l)
setSpriteSheet
public void setSpriteSheet(java.awt.Image img)
setTarget
public void setTarget(int x,
int y)
setDimension
public void setDimension(int w,
int h)
setTimer
public void setTimer(int tm)
isRunning
public boolean isRunning()
start
public void start()
run
public void run()
- Specified by:
run
in interface java.lang.Runnable
stop
public void stop()
drawEffect
public void drawEffect(java.awt.Graphics2D g)
- Specified by:
drawEffect
in interface MapEffect


Delta is the rate of change of the option price with respect to the price of the underlying asset. It measures the first-order sensitivity of the price to a movement in stock price S. The option delta is 0.4 means that if the underlying moves by for example 1%, then the value of the option will move by 0.4 × 1%. For European options on an asset that provides a yield at rate q:
\[delta(call)=\frac{\partial c}{\partial S}=e^{-q(T-t)}N(d1)\] \[delta(put)=\frac{\partial p}{\partial S}=e^{-q(T-t)}(N(d1)-1)\]''' Greek letters for European options on an asset that provides a yield at rate q ''' def delta(self): d1 = self.d1() if self.type == "c": return exp(-self.q * self.T) * self.n(d1) elif self.type == "p": return exp(-self.q * self.T) * (self.n(d1)-1)
Stock price, days remaining to expiration and implied volatility will impact the Delta.
As a general rule, in-the-money options will move more than out-of-the-money options, and short-term options will react more than longer-term options to the same price change in the stock.
In order to demonstrate how those Greeks values change with the time to expiration and the underlying price, we choose 60*23 call options contracts with the stock price ranging from 10 to 70, time to expiration ranging from 0 to 1 year. The strikes of all the contracts are 40, the interest rates are 0.1, the volatilities are all 0.5. We construct the contracts data as a 23*60 matrix.
s = np.array([range(10,70,1) for i in range(23)]) I = np.ones((shape(s))) time = arange(1,12.5,0.5)/12 T = np.array([ele for ele in time for i in range(shape(s)[1])]).reshape(shape(s)) contracts = [] for i in range(shape(s)[0]): for j in range(shape(s)[1]): contracts.append(BsmModel('c',s[i,j],40*I[i,j],0.1*I[i,j], T[i,j],0.5*I[i,j])) delta = [x.theta() for x in contracts] gamma = [x.gamma() for x in contracts] delta = [x.delta() for x in contracts] vega = [x.vega() for x in contracts] rho = [x.rho() for x in contracts] gamma = np.array(gamma).reshape(shape(s)) delta = np.array(delta).reshape(shape(s)) theta = np.array(theta).reshape(shape(s)) vega = np.array(vega).reshape(shape(s)) rho = np.array(rho).reshape(shape(s)) import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D from matplotlib import cm from matplotlib import animation z = delta fig = plt.figure(figsize=(20,11)) ax = fig.add_subplot(111, projection='3d') ax.view_init(40,290) ax.plot_wireframe(s, T, z, rstride=1, cstride=1) ax.plot_surface(s, T, z, facecolors=cm.jet(delta),linewidth=0.001, rstride=1, cstride=1, alpha = 0.75) ax.set_zlim3d(0, z.max()) ax.set_xlabel('stock price') ax.set_ylabel('Time to Expiration') ax.set_zlabel('delta') m = cm.ScalarMappable(cmap=cm.jet) m.set_array(z) cbar = plt.colorbar(m)
The color of the graph above represents delta value. >


You do not appear to have a Scolarly Data Archive (SDA) account. Please see this knowledgebase article for details on how to apply for a SDA account.


Teaching
CS4145 Crowd Computing
4th quarter of the 2021-2022 semesterCrowd computing studies how large groups of people can solve complex tasks that are currently beyond the capabilities of artificial intelligence algorithms, and that cannot be solved by a single person alone. The objective of the Crowd Computing course is to introduce the scientific and technical underpinnings of crowd computing, and to investigate how it can be used for computer science applications (e.g., information retrieval, machine learning, next-generation interfaces, and data mining) and for real world applications (e.g., cultural heritage preservation, online knowledge creation, smart cities, etc.)
IN4325 Information Retrieval
3rd quarters of the 2021-2022 semesterInformation Retrieval (IR) is the discipline that deals with the representation, storage, organisation of, and access to information items, and it is concerned with providing efficient access to large amounts of unstructured contents, such as text, images, videos etc. The objective of the IN4325 - Information Retrieval course is to introduce the scientific underpinnings of the field of Information Retrieval. The course aims at providing students basic information retrieval concepts and more advanced techniques for efficient data processing, storage, and querying.
IN4252 Web Science & Engineering
1st and 2nd quarters of the 2021-2022 semesterThe main subject of the course is the Web, and in particular Web Data. The course considers developments in the Web and the (big) data management challenges associated to it. In particular, the course considers the relationship between people and technology that come with the Web and Web-based information systems. The course considers the Web both from an engineering perspective as well as from an analytical perspective.
CS4305TU Applied Machine Learning
1st quarter of the 2021-2022 semesterMachine Learning is increasingly important to fields outside of traditional Artificial Intelligence and Computer Science, proving a powerful technique to study data from different domains. This course aims to give students from different technical backgrounds a better understanding of a range of machine learning techniques. During the course, the focus lies on understanding how to use these different techniques, rather than on trying to improve the techniques themselves. To do this, this course will focus on demonstrating how machine learning can be used in different domains and for different types of data.


WITNESS LIST Pensions & Investments Committee April 8, 1997-8:00A HB 978 For: Anderson, James (Central Texas College) Beebe, B. William (Central Texas College) Hupp, Suzanna (Author of bill) On: Brown, Martha (Tx. Tech U. & TTUHSC) HB 1203 For: Elkin, W.M. "Bill" (Houston Po. R.O. Assoc.) Lawson, John E. (Houston PO Pension Sys.) Turner, Sylvester (Author of bill) On: Jeffrion, William L. (City of Houston) Registering, but not testifying: For: Defoor, Ken T. (Houston Po. R.O. Assoc.) Doss, Larry (Houston Po. R.O. Assoc.) Goralski, Craig (Houston PO & Ho. Po. PS) Hall, Harry M. (Representing Himself) Hall, Virginia A. (Representing Herself) Hunt, Ray (Houston Po. Officers Un) Jones, James H. (Representing Himself) Marsh, Ralph D. (Houston Po. R.O. Assoc.) McNeil, Carvel (Houston Po. Patrolman's) Montero, Jim (Representing Himself) Navarro, Wilfred (Houston Po. R.O. Assoc.) Olson, Robert L. (Houston Po. R.O. Assoc.) Sanders, Stephen J. (Houston Po. Patrolman's) Sembera, Frankie J. (Houston Po. R.O. Assoc.) Smith, C.E. (Representing Himself) Smith, Dot (Representing Herself) Weaver, Donald R. (Houston Po. R.O. Assoc.) Zoch, Constance A. (Representing Herself) Zoch, Leroy N. (Representing Himself) On: Lyons, Steve (City Of Houston P. Dept) HB 1204 For: Elkin, W.M. "Bill" (Houston Po. R.O. Assoc.) Jeffrion, William L. (City of Houston) Lawson, John E. (Houston PO Pension Sys.) Turner, Sylvester (Author of bill) Registering, but not testifying: For: Defoor, Ken T. (Houston Po. R.O. Assoc.) Doss, Larry (Houston Po. O. Pen. Sys) Goralski, Craig (Houston PO & Ho. Po. PS) Hall, Harry M. (Representing Himself) Hall, Virginia A. (Representing Herself) Hunt, Ray (HPOU) Jones, James H. (Representing Himself) Marsh, Ralph D. (Houston Po. O. Pen. Sys) McNeil, Carvel (Houston Po. Patrolmans) Montero, Jim (Representing Himself) Navarro, Wilfred (Houston Po. R.O. Assoc.) Olson, Robert L. (Houston Po. R.O. Assoc.) Sanders, Stephen J. (Houston Po. Patrolmans) Sembera, Frankie J. (Houston Po. R.O. Assoc.) Smith, C.E. (Representing Himself) Smith, Dot (Representing Herself) Weaver, Donald R. (Houston Po. R.O. Assoc.) Zoch, Constance A. (Representing Herself) Zoch, Leroy N. (Representing Himself) HB 1334 For: Hochberg, Scott (Author of bill) On: Baker, William (TRS of Texas) Registering, but not testifying: For: Gregg, Brock (ATPE) HB 1502 For: Yarbrough, Ken (Author of bill) Registering, but not testifying: For: Chelette, Barbara (Houston M.E.P.S.) Holmes, Fred (Houston Municipal) Long, David L. (Houston M.E.P.S.) HB 1590 For: Wise, Miguel (Author of bill) Registering, but not testifying: For: Gregg, Brock (ATPE) Taebel, Holly S. (TX. Classroom Teachers) HB 1700 For: Gregg, Brock (ATPE) On: Otto, Bob (TRS) Registering, but not testifying: For: Kelly, Jack (TSTA) Lara, Rene (Tx. Fed. of Teachers) Lehr, Mike (TX. Retired Teachers) Taebel, Holly S. (TX. Classroom Teachers) On: Featherston, Pattie (TRS) HB 1701 For: Copley, John J. (Trinity I.S.D.) On: Jung, Ronnie (TRS) Registering, but not testifying: For: Gregg, Brock (ATPE) Kelly, Jack (TSTA) Lara, Rene (TX. Fed. of Teachers) Taebel, Holly S. (TX. Classroom Teachers) HB 2358 For: Counts, David (Author of bill) Gardner, Glen M. (TX. Coalition Veterans) McLemore, Bill (TX. Assoc. Co. Veterans) On: Martin, Rusty (TX. Veterans Land Board) Registering, but not testifying: On: Bier, Samuel (TX. Veterans Commission) Gloier, David (TX. Veterans Land Board) Odell, Herbert (TX. Veterans Commission) Stevens, Randy (Tonn & Associates) Stockton, John (Dept. of Human Services) Turner, Jerry E. (TX. Veterans Land Board) HB 2799 For: Anderson, Susan K. (Govt. Treasurers Org.) Hynsin, Kathy (Co. Trasurers Assoc.) Marchant, Ken (Author of bill) Mayes, Mary E. (Cheryll Adair & Herself) Registering, but not testifying: For: Graydon, Galt (Fidelity Investments) Igo, Shanna (TX. Municipal League) Wendel, Susan (TX. Assoc. of Counties) Wilson, Barbara (Representing Herself)


Cloud customer App
number of rows:
LOADING...
All form fields are required.
First Name
Last Name
Email
Phone
Birthdate
Title
Department
All form fields are required.
First Name
Last Name
Email
Phone
Birthdate
Title
Department
All form fields are required.
First Name
Count
Interval (millseconds)


The returning Cardiff City star 'as good as anyone in the division' Neil Harris is desperate to get firing
The Bluebirds boss is hopeful some key returning players can have an impact in the coming weeks
by Glen WilliamsJazz Richards has endured some rotten luck during his time at Cardiff City.
The right back has been plagued by injuries and is yet to feature for the first team this season - in fact he has been forced to miss 62 games through injury in just three years at the club.
But he put in a stellar display on Monday for the under-23s against Charlton Athletic and Neil Harris, who was in attendance, was suitably impressed.
Harris's predecessor, Neil Warnock, was keen to include Richards back into the fold after he looked sharp in an academy game last month, but the defender suffered yet another setback with his hip.
Now, though, Harris appears excited by the prospect of the player's return.
The Bluebirds boss hopes he can be the man to harness Richards' ability and reserved some special praise for the Wales international.
"His abilities at right back are as good as anyone in this division," Harris said of Richards.
"Can I be the manager who finally gets him fit and consistent in fitness levels? That’s my challenge with my staff.
"He’s a great lad and I’ve played against him and managed against him and he’s certainly a talented footballer."
Another senior figure fans have been dying to see involved in recent weeks is the talismanic Sol Bamba.
Bamba is also getting up to speed following his horrendous ACL injury back in March.
Harris believes the increase in intensity he has implemented since his arrival has perhaps pushed the Ivorian's return back a couple of weeks, but insisted he still has a massive part to play at the club.
"They were brilliant," Harris said of Bamba and Richards' performances on Monday, "Jazz is obviously a bit further off fitness-wise.
"Sol was excellent in the week, so I think we are coming in with the intensity I want to train at and Sol has just realised he was getting there, but maybe he needs a couple more weeks to get up to speed.
"Sol has a huge part to play within the group, every day. In the team, on the bench, not up to speed yet.
"Him and Sean Morrison are huge characters and leaders, every day I lean on them for their leadership qualities."


Since there isn't much information out there about DXM and Wellbutrin, I had no choice but to test it out myself. So one evening I took 150mg of DXM (10 x 15mg gelcaps), puncturing the capsules before I downed them. About 30-45 minutes after this I thought I felt noticably less inhibited, slowed, with a bit of ataxia, almost like being drunk but clearer in a way. My over-affectionate cat trotted into the room and began to throw herself at me. I found this significantly less annoying than usual. I felt very relaxed but that was the extent of it. Two hours later the experience hadn't changed and seeing as it was late and there was nothing to do I went to sleep.
About an hour after falling asleep I woke up feeling very uneasy. There was a feeling of dread, but it wasn't a panic attack. I noticed that I was extremely dizzy at this point, although moving still felt good. A warm feeling pulsed in my body periodically, concentrated mostly in the back of my head and somewhat in the bottom of my legs. This was not a pleasant feeling at all, my head almost felt like it was on fire. I was sweating a lot also, and shaking. This really worried me, but I tried to lay back and calm myself down, thinking that this was a low dose and it would be over in a few hours. This helped some, along with having some water, and I was able to get a VERY broken sleep, with symptoms gradually declining. I woke up about seven hours after taking the DXM, still dizzy, with dialated pupils and a headache. I don't think I'll be taking any more DXM, at least not while taking bupropion.
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.


| 1 | package nl.tudelft.jpacman.npc.ghost; | |
| 2 | ||
| 3 | import java.util.EnumMap; | |
| 4 | import java.util.List; | |
| 5 | import java.util.Map; | |
| 6 | ||
| 7 | import nl.tudelft.jpacman.board.Direction; | |
| 8 | import nl.tudelft.jpacman.board.Square; | |
| 9 | import nl.tudelft.jpacman.level.Player; | |
| 10 | import nl.tudelft.jpacman.sprite.Sprite; | |
| 11 | ||
| 12 | /** | |
| 13 | *
 | |
| 14 | * An implementation of the classic Pac-Man ghost Pokey. | |
| 15 | *
 | |
| 16 | *
 | |
| 17 | * Nickname: Clyde. Pokey needs a new nickname because out of all the ghosts, | |
| 18 | * Pokey is the least likely to "C'lyde" with Pac-Man. Pokey is always the last | |
| 19 | * ghost out of the regenerator, and the loner of the gang, usually off doing | |
| 20 | * his own thing when not patrolling the bottom-left corner of the maze. His | |
| 21 | * behavior is very random, so while he's not likely to be following you in hot | |
| 22 | * pursuit with the other ghosts, he is a little less predictable, and still a | |
| 23 | * danger. In Japan, his name is Otoboke/Guzuta. | |
| 24 | *
 | |
| 25 | *
 | |
| 26 | * AI: Pokey has two basic AIs, one for when he's far from Pac-Man, and | |
| 27 | * one for when he is near to Pac-Man. When the ghosts are not patrolling their | |
| 28 | * home corners, and Pokey is far away from Pac-Man (beyond eight grid spaces), | |
| 29 | * Pokey behaves very much like Blinky, trying to move to Pac-Man's exact | |
| 30 | * location. However, when Pokey gets within eight grid spaces of Pac-Man, he | |
| 31 | * automatically changes his behavior and goes to patrol his home corner in the | |
| 32 | * bottom-left section of the maze. | |
| 33 | *
 | |
| 34 | *
 | |
| 35 | * Source: http://strategywiki.org/wiki/Pac-Man/Getting_Started | |
| 36 | *
 | |
| 37 | * | |
| 38 | * @author Jeroen Roosen | |
| 39 | * | |
| 40 | */ | |
| 41 | public class Clyde extends Ghost { | |
| 42 | ||
| 43 | /** | |
| 44 | * The amount of cells Clyde wants to stay away from Pac Man. | |
| 45 | */ | |
| 46 | private static final int SHYNESS = 8; | |
| 47 | ||
| 48 | /** | |
| 49 | * The variation in intervals, this makes the ghosts look more dynamic and | |
| 50 | * less predictable. | |
| 51 | */ | |
| 52 | private static final int INTERVAL_VARIATION = 50; | |
| 53 | ||
| 54 | /** | |
| 55 | * The base movement interval. | |
| 56 | */ | |
| 57 | private static final int MOVE_INTERVAL = 250; | |
| 58 | ||
| 59 | /** | |
| 60 | * A map of opposite directions. | |
| 61 | */ | |
| 62 | private static final Map<Direction, Direction> OPPOSITES = new EnumMap<>( | |
| 63 | Direction.class); | |
| 64 | static { | |
| 65 | OPPOSITES.put(Direction.NORTH, Direction.SOUTH); | |
| 66 | OPPOSITES.put(Direction.SOUTH, Direction.NORTH); | |
| 67 | OPPOSITES.put(Direction.WEST, Direction.EAST); | |
| 68 | OPPOSITES.put(Direction.EAST, Direction.WEST); | |
| 69 | } | |
| 70 | ||
| 71 | /** | |
| 72 | * Creates a new "Clyde", a.k.a. "Pokey". | |
| 73 | * | |
| 74 | * @param spriteMap | |
| 75 | * The sprites for this ghost. | |
| 76 | */ | |
| 77 | public Clyde(Map<Direction, Sprite> spriteMap) { | |
| 78 | super(spriteMap, MOVE_INTERVAL, INTERVAL_VARIATION); | |
| 79 | } | |
| 80 | ||
| 81 | /** | |
| 82 | * {@inheritDoc} | |
| 83 | * | |
| 84 | *
 | |
| 85 | * Pokey has two basic AIs, one for when he's far from Pac-Man, and one for | |
| 86 | * when he is near to Pac-Man. When the ghosts are not patrolling their home | |
| 87 | * corners, and Pokey is far away from Pac-Man (beyond eight grid spaces), | |
| 88 | * Pokey behaves very much like Blinky, trying to move to Pac-Man's exact | |
| 89 | * location. However, when Pokey gets within eight grid spaces of Pac-Man, | |
| 90 | * he automatically changes his behavior and goes to patrol his home corner | |
| 91 | * in the bottom-left section of the maze. | |
| 92 | *
 | |
| 93 | *
 | |
| 94 | * Implementation: Lacking a patrol function so far, Clyde will just | |
| 95 | * move in the opposite direction when he gets within 8 cells of Pac-Man. | |
| 96 | *
 | |
| 97 | */ | |
| 98 | @Override | |
| 99 | public Direction nextMove() { | |
| 100 | Square target = Navigation.findNearest(Player.class, getSquare()) | |
| 101 | .getSquare(); | |
| 102 |
1
1. nextMove : negated conditional → SURVIVED |
if (target == null) { |
| 103 |
1
1. nextMove : mutated return of Object value for nl/tudelft/jpacman/npc/ghost/Clyde::nextMove to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return randomMove(); |
| 104 | } | |
| 105 | ||
| 106 | List<Direction> path = Navigation.shortestPath(getSquare(), target, | |
| 107 | this); | |
| 108 |
2
1. nextMove : negated conditional → SURVIVED 2. nextMove : negated conditional → SURVIVED |
if (path != null && !path.isEmpty()) { |
| 109 | Direction d = path.get(0); | |
| 110 |
2
1. nextMove : changed conditional boundary → SURVIVED 2. nextMove : negated conditional → SURVIVED |
if (path.size() <= SHYNESS) { |
| 111 |
1
1. nextMove : mutated return of Object value for nl/tudelft/jpacman/npc/ghost/Clyde::nextMove to ( if (x != null) null else throw new RuntimeException ) → SURVIVED |
return OPPOSITES.get(d); |
| 112 | } | |
| 113 |
1
1. nextMove : mutated return of Object value for nl/tudelft/jpacman/npc/ghost/Clyde::nextMove to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return d; |
| 114 | } | |
| 115 |
1
1. nextMove : mutated return of Object value for nl/tudelft/jpacman/npc/ghost/Clyde::nextMove to ( if (x != null) null else throw new RuntimeException ) → NO_COVERAGE |
return randomMove(); |
| 116 | } | |
| 117 | } | |
Mutations | ||
| 102 |
1.1 |
|
| 103 |
1.1 |
|
| 108 |
1.1 2.2 |
|
| 110 |
1.1 2.2 |
|
| 111 |
1.1 |
|
| 113 |
1.1 |
|
| 115 |
1.1 |


PIONEER
In Our Pages: April 21
1914: Easter Scenes In Paris
Nina Cassian, Exiled Romanian Poet, Dies at 89
This is a Chrome Experiment


SVCS_ALERT_EVENT_LOG
Records an alert when the query optimizer identifies conditions that might indicate performance issues. This view is derived from the STL_ALERT_EVENT_LOG system table but doesn't show slice-level for queries run on a concurrency scaling cluster. Use the SVCS_ALERT_EVENT_LOG table to identify opportunities to improve query performance.
A query consists of multiple segments, and each segment consists of one or more steps. For more information, see Query Processing.
SVCS_ALERT_EVENT_LOG is visible to all users. Superusers can see all rows; regular users can see only their own data. For more information, see Visibility of Data in System Tables and Views.
Table Columns
| Column Name | Data Type | Description |
|---|---|---|
| userid | integer | ID of the user who generated the entry. |
| query | integer | Query ID. The query column can be used to join other system tables and views. |
| segment | integer | Number that identifies the query segment. |
| step | integer | Query step that executed. |
| pid | integer | Process ID associated with the statement and slice. The same query might have multiple PIDs if it executes on multiple slices. |
| xid | bigint | Transaction ID associated with the statement. |
| event | character(1024) | Description of the alert event. |
| solution | character(1024) | Recommended solution. |
| event_time | timestamp | Time in UTC that the query started executing, with 6 digits of precision for fractional
seconds. For example: 2009-06-12 11:29:19.131358 .
|
Usage Notes
You can use the SVCS_ALERT_EVENT_LOG to identify potential issues in your queries, then follow the practices in Tuning Query Performance to optimize your database design and rewrite your queries. SVCS_ALERT_EVENT_LOG records the following alerts:
-
Missing Statistics
Statistics are missing. Run ANALYZE following data loads or significant updates and use STATUPDATE with COPY operations. For more information, see Amazon Redshift Best Practices for Designing Queries.
-
Nested Loop
A nested loop is usually a Cartesian product. Evaluate your query to ensure that all participating tables are joined efficiently.
-
Very Selective Filter
The ratio of rows returned to rows scanned is less than 0.05. Rows scanned is the value of
rows_pre_user_filter
and rows returned is the value of rows in the STL_SCAN system table. Indicates that the query is scanning an unusually large number of rows to determine the result set. This can be caused by missing or incorrect sort keys. For more information, see Choosing Sort Keys. -
Excessive Ghost Rows
A scan skipped a relatively large number of rows that are marked as deleted but not vacuumed, or rows that have been inserted but not committed. For more information, see Vacuuming Tables.
-
Large Distribution
More than 1,000,000 rows were redistributed for hash join or aggregation. For more information, see Choosing a Data Distribution Style.
-
Large Broadcast
More than 1,000,000 rows were broadcast for hash join. For more information, see Choosing a Data Distribution Style.
-
Serial Execution
A DS_DIST_ALL_INNER redistribution style was indicated in the query plan, which forces serial execution because the entire inner table was redistributed to a single node. For more information, see Choosing a Data Distribution Style.
Sample Queries
The following query shows alert events for four queries.
SELECT query, substring(event,0,25) as event, substring(solution,0,25) as solution, trim(event_time) as event_time from svcs_alert_event_log order by query; query | event | solution | event_time -------+-------------------------------+------------------------------+--------------------- 6567 | Missing query planner statist | Run the ANALYZE command | 2014-01-03 18:20:58 7450 | Scanned a large number of del | Run the VACUUM command to rec| 2014-01-03 21:19:31 8406 | Nested Loop Join in the query | Review the join predicates to| 2014-01-04 00:34:22 29512 | Very selective query filter:r | Review the choice of sort key| 2014-01-06 22:00:00 (4 rows)


Feel free to contact us. A business has to be involving, it has to be fun, and it has to exercise your creative laser instincts. Start where you are. Use what you have. Do what you can.
US Headquarters
Pangolin Laser Systems, Inc.
9501 Satellite Boulevard, Suite 109
Orlando, Florida 32837,


Skin
Select champion
Select skin
Load Skin
Animation
Select Animation
Play Animation
Report Bug
{{{ SCRIPT }}}


WITNESS LIST State Affairs Committee April 9, 2001-2:00P HB 11 On: Holifield, Henry (Texas Cosmetology Commission) HB 554 For: Risk, Raymond (Texas Construction Association) Registering, but not testifying: For: Tredway, C. J. (Independent Electrical Contractors) HB 737 For: Sumpter, Benjamin (South Central Texas Regional Certification Agency) Registering, but not testifying: For: Deadrick, June (Reliant Energy) Fainter, Jr., John (Association of Electric Companies of Texas) Guzman, Samuel (Texas Association of Mexican American Chambers of Commerce) Israel, Celia (Houston Minority Business Council) Naylor, Bettie (Self) Riddering, Hannah (Self and Texas National Organization for Women) Sewell, Jim (A.G.C. Building) Talavera, Judith (American Electric Power) Torres, Hector (Innovative Solutions International) Against: Baggett, Donnis (Texas Daily Newspaper Association and Texas Press Association) HB 823 Registering, but not testifying: For: Strader, James (Self) On: Biles, Susan (Comptroller of Public Accounts) McLaughlin, Laure (Comptroller of Public Accounts) HB 852 For: Strader, James (Self) Registering, but not testifying: For: Igo, Shanna (Texas Municipal League) On: Biles, Susan (Comptroller of Public Accounts) McLaughlin, Laure (Comptroller of Public Accounts) HB 1217 For: Petersen, Ken (Texas Rural Water Association) Against: Homer, Andrew (Texas Public Employees Association) On: Ballinger, Dave (Comptroller of Public Accounts) Registering, but not testifying: For: Clark, Jeff (National Federation of Independent Business) Lancaster, David (Texas Society of Architects) Pinkus, David (Small Business United of Texas) On: Bloom, Ed (Texas Incentive and Productivity Commission) HB 1401 Registering, but not testifying: On: Martone, Justine (Comptroller of Public Accounts) McLaughlin, Laure (Comptroller of Public Accounts) HB 1542 Registering, but not testifying: For: Guzman, Samuel (Texas Association of Mexican American Chambers of Commerce) Naylor, Bettie (Self) Riddering, Hannah (Self and Texas National Organization for Women) Sewell, Jim (Associated General Contractors - Building Branch) On: McDonald, Arthur (Self) HB 1872 Registering, but not testifying: On: Hughes, Mark (Texas Workforce Commission) HB 2107 On: Wood, III, Pat (Public Utility Commission of Texas) HB 2528 Registering, but not testifying: For: Igo, Shanna (Texas Municipal League) On: Dorwart, Mary-Cheryl (Comptroller of Public Accounts) McLaughlin, Laure (Comptroller of Public Accounts) Scogin, James (Comptroller of Public Accounts) HB 2946 Registering, but not testifying: On: Thomas, Diane (Comptroller of Public Acounts) HB 2962 Registering, but not testifying: For: Guzman, Samuel (Texas Association of Mexican American Chambers of Commerce) Pinkus, David (Small Business United of Texas) Romero, Jesse (Self) On: Bass, Robert (Texas Coalition of Sureties) Risk, Raymond (Texas Construction Association) HB 3032 On: Dorwart, Mary-Cheryl (Comptroller of Public Accounts) Registering, but not testifying: On: King, Robert (Texas Energy Services Coalition) HB 3154 Registering, but not testifying: For: Jones, Susan (Texas Hospital Association) Smith, Tom "Smitty" (Public Citizen) Sprinkle, G. K. (American Lung Association of Texas) On: Smith, Jennifer (Texas Department of Health) HB 3448 On: Davenport, John (General Services Commission) Dillon, Ann (General Services Commission) Golden, Dolly (Self and Golden World Travel) Kelly, Brian (General Services Commission) Levine, Ken (Sunset Advisory Commission) Macy, Jack (Affordable Travel, Inc.) Reed, Cindy (State Auditors Office) Schlimper, Paul (General Services Commission) Shull, Gene (General Services Commission) Registering, but not testifying: On: Biles, Susan (Comptroller of Public Accounts) Dorwart, Mary-Cheryl (Comptroller of Public Accounts) Hill, Cynthia (General Services Commission) McLaughlin, Laure (Comptroller of Public Accounts) Sinclair, Dorothy (General Services Commission) HB 3530 For: Avila, John (Self) Bass, Robert (Texas Coalition of Sureties) Dodson, Derrell (Self) Dominguez, Angela (Self) On: Risk, Raymond (Texas Construction Association) Registering, but not testifying: For: Dobson, Steven (Self) Gilbert, Bo (Independent Insurance Agents of Texas) King, Bill (Self) Ragsdale, Tom (Self) Searcey, Steven (Self) Tucker, Tracy (Self) Ward, John (Self) Williams, Audrey (Self) Zebedeo, Francis (Self) HB 3539 On: Lancaster, David (Texas Society of Architects) SB 441 Registering, but not testifying: On: Roberts, Wayne (Office of the Governor) Thomas, Diane (Comptroller of Public Accounts) SB 443 Registering, but not testifying: On: Martone, Justine (Comptroller of Public Accounts) SB 587 On: Cook, Christine (Comptroller of Public Accounts) Registering, but not testifying: For: Ingersoll, Deborah (Texas State Troopers Association) Lange, James (Texas State Troopers Association) Parker, Carl (Texas State Troopers Association) Purdy, Karen (Self) Salinas, Froy (Texas State Troopers Association) Volek, Linda (Self)


"You haven't studied your Bible until you can intelligently read it in the dark." - Sabbath School Lesson
A collection of all sabbath school lesson study guides designed to help you to independently apply yourself to the study of your Bible until you can answer scripture questions in the exact words of the Bible.
*Since 1888.
With breakthrough Imprint™ Technology, we’re building a world where robots intelligently communicate with each other and the rest of your connected home. Because our goal is not just to create a home that’s smarter—it’s to create a home that takes care of itself.
Shop iRobot® exclusive bundles for extra savings.
*Tested in spot clean mode
Shop Savings NowLearn more about s9+


Problem Statement
The objectives of this project are to composite and blend two images of the same scene at different times in history by taking approximately half of the space from each input image. - The key components of this project include: - Take two images of same scene at different times as inputs. - Perform histogram equalization on input images to produce higher contrast on input images. - Construct Laplacian Pyramid for the two input images. - Find least noticeable seams in the middle 20% pixels of one of the input images. - Construct Gaussian Pyramid ouput matte with least noticeable seams found. - Normalize Laplacian and Gaussian Pyramids. - Construct output Laplacian Pyramid from the Laplacian Pyramid of the two input images. - Collapse the combined Laplacian Pyramid.
Methods
Laplacian Pyramid Blending
Building Laplacian Pyramid
Creating the Blending Matte
Combining the Laplacian Pyramid
Collapsing the Laplacian Pyramid


Liverpool, Man Utd told that impressive Leeds loan star is not for sale
Liverpool and Manchester United have been warned that Ben White is not for sale after the Brighton defender’s impressive displays on loan at Leeds.
White has become an integral part of Marcelo Bielsa’s defence at Leeds, sparking reports that the two Premier League heavyweights were weighing up January moves for the centre-back.
But Brighton boss Graham Potter has stated that White’s future is with the Seagulls – and says the south coast club are not interested in selling him.
“There’s all sorts of talk as we know, but the reality is he’s our player and has a future here,” Potter said ahead of Brighton’s Premier League clash at home to Leicester on Saturday.
“He’s on loan now at Leeds and having a positive experience, and we’re delighted with that.
“But we’re looking forward to having him back at the right time and we’ll go from there.
“He’s our player, he’s contracted with us.”


Welcome
Dropdown
Action
Other
Other Action
Separated Link
Florida
California
Texas
Name
Password
Sign in
Name
Password
Age
Park
Sign Up


Knockout View Mapping plugin Example1
Address1:
Address2:
Address3:
Address4:
Address5:
stringValue:
booleanValue:


Job Title
Company
Job Link
{% for job in jobs %}
{{job.JobTile}}
{{job.CompanyName}}
Apply now
{% endfor %}


|
masscalculator-core
|
Class Nickel, that holds all the nessesary information for Nickel and it's types therefore we can use in the interface. More...
#include <nickel.h>
Classes | |
| struct | Properties |
| Struct with material specific properties. More... | |
Public Types | |
| enum class | Type : uint8_t { BEGIN = 0 , N_201 = BEGIN , N_210 , N_220 , N_230 , N_400 , UNSPECIFIED , END } |
| Enum that holds the Nickel types. More... | |
| typedef enum Type uint8_t struct MassCalculator::Materials::Nickel::Properties | Properties_t |
| Struct with material specific properties. | |
Public Member Functions | |
| Nickel (void) | |
| Construct a new Nickel object. | |
| Nickel (const Type &type) | |
| Construct a new Nickel object and specify the type. | |
| bool | initLuaScript (void) |
| Function to initialize the Lua object. | |
| bool | setType (const Type &type) |
| Set the Type object. More... | |
| std::pair< std::string, Type > | getType (void) const |
| Get the Type object. More... | |
| std::string | getSpecificColor (void) const |
| Get the Specific Color object. More... | |
| kilograms_per_cubic_meter_t | getSpecificDensity (void) const |
| Get the Specific Density object. More... | |
| meters_per_second_squared_t | getSpecificGravity (void) const |
| Get the Specific Gravity object. More... | |
| kelvin_t | getSpecificMeltingPoint (void) const |
| Get the Specific Melting Point object. More... | |
| double | getSpecificPoissonsRatio (void) const |
| Get the Specific PoissonsRatio object. More... | |
| watt_t | getSpecificThermalConductivity (void) const |
| Get the Specific Thermal Conductivity object. More... | |
| pascal_t | getSpecificModOfElasticityTension (void) const |
| Get the Specific Modulus of Elasticity Tension object. More... | |
| pascal_t | getSpecificModOfElasticityTorsion (void) const |
| Get the Specific Modulus of Elasticity Torsion object. More... | |
| ~Nickel (void)=default | |
| Destroy the Nickel object. | |
| Nickel (const Nickel &)=delete | |
| Delete copy constructor. | |
| Nickel (Nickel &&)=default | |
| Set move constructor to default. | |
| Nickel & | operator= (const Nickel &)=delete |
| Delete assignment operator. | |
| Nickel & | operator= (Nickel &&)=default |
| Allow move assignment operator. | |
Friends | |
| std::ostream & | operator<< (std::ostream &os, const Nickel &obj) |
| Shift operator overload for class Nickel, this will print all the nessesery informations. | |
| std::ostream & | operator<< (std::ostream &os, const Type &type) |
| Shift operator overload for Types of Nickel, this will print the name in string. | |
Class Nickel, that holds all the nessesary information for Nickel and it's types therefore we can use in the interface.
|
strong |
Enum that holds the Nickel types.
| Enumerator | |
|---|---|
| N_201 |
|
| N_210 |
|
| N_220 |
|
| N_230 |
|
| N_400 |
|
| UNSPECIFIED | Unspecified metal alloy. |
| std::string MassCalculator::Materials::Nickel::getSpecificColor | ( | void | ) | const |
Get the Specific Color object.
| kilograms_per_cubic_meter_t MassCalculator::Materials::Nickel::getSpecificDensity | ( | void | ) | const |
Get the Specific Density object.
| meters_per_second_squared_t MassCalculator::Materials::Nickel::getSpecificGravity | ( | void | ) | const |
Get the Specific Gravity object.
| kelvin_t MassCalculator::Materials::Nickel::getSpecificMeltingPoint | ( | void | ) | const |
Get the Specific Melting Point object.
| pascal_t MassCalculator::Materials::Nickel::getSpecificModOfElasticityTension | ( | void | ) | const |
Get the Specific Modulus of Elasticity Tension object.
| pascal_t MassCalculator::Materials::Nickel::getSpecificModOfElasticityTorsion | ( | void | ) | const |
Get the Specific Modulus of Elasticity Torsion object.
| double MassCalculator::Materials::Nickel::getSpecificPoissonsRatio | ( | void | ) | const |
Get the Specific PoissonsRatio object.
| watt_t MassCalculator::Materials::Nickel::getSpecificThermalConductivity | ( | void | ) | const |
Get the Specific Thermal Conductivity object.
| std::pair< std::string, Nickel::Type > MassCalculator::Materials::Nickel::getType | ( | void | ) | const |
Get the Type object.
| bool MassCalculator::Materials::Nickel::setType | ( | const Type & | type | ) |
Set the Type object.
| type | Type of the Nickel |


Home
Category
Our Awesome Team
Jerome Joof
Software Engineer
Joshua Deforrest
Software Engineer
Sergey Voytov
Software Engineer
Daesy Stephens
Software Engineer
Jitendra Bajracharya
Software Engineer
Dayne Daylong
Software Engineer


The background image is auto-generated from Unsplash. It changes topic depending when on the day you are viewing it. To refresh the image just press CTRL + R on Windows and Command + R on MacOS
Sandstorm has an todo feature. You can use the todo by clicking the small icon of Sandstorm from your browser's extensions bar (top right corner)
Sandstorm has an adblocker feature. It blocks all ads from YouTube. Note: The adblocker is still in BETA so some ads could slip through.
If you encounter any bugs/errors/issues or just want to get a new feature, email me at<EMAIL_ADDRESS>By donating you help you help me very much :D
Click here to buy me a pizza


Ingredients
- Pie crust with topper
- 3 Tablespoons cornstarch
- 1-1/2 cup sugar
- 1/4 teaspoon salt
- 1/4 teaspoon ground nutmeg
- 3 cups chopped rhubarb
- 2 cups sliced strawberries
- 1 Tablespoon butter
Instructions
Preheat oven to 350°.
In a large mixing bowl, combine cornstarch, sugar, salt and nutmeg. Add strawberries and rhubarb. Toss and let stand 15 minutes.
Pour mixture into pie plate and cover with crust topper. Bake for 1 hour. Remove and let cool for 15 minutes.


| I l@ve RuBoard |
4.6 User-Friendly Program LaunchersSuppose, for just a moment, that you wish to ship Python programs to an audience that may be in the very early stages of evolving from computer user to computer programmer. Maybe you are shipping a Python application to nontechnical users; or perhaps you're interested in shipping a set of cool Python demo programs on a Python book's CD-ROM (see http://examples.oreilly.com/python2). Whatever the reason, some of the people who will use your software can't be expected to do any more than click a mouse -- much less edit their system configuration files to set things like PATH and PYTHONPATH per your programs' assumptions. Your software will have to configure itself. Luckily, Python scripts can do that too. In the next two sections, we're going to see two modules that aim to automatically launch programs with minimal assumptions about the environment on the host machine:
Both of these modules are designed to be reusable in any context where you want your software to be user-friendly. By searching for files and configuring environments automatically, your users can avoid (or at least postpone) having to learn the intricacies of environment configuration. 4.6.1 Launcher Module ClientsThe two modules in this section see action in many of this book's examples. In fact, we've already used some of these tools. The launchmodes script we met at the end of the prior chapter imported Launcher functions to hunt for the local python.exe interpreter's path, needed by os.spawnv calls. That script could have assumed that everyone who installs it on their machine will edit its source code to add their own Python location; but the technical know-how required for even that task is already light-years beyond many potential users.[4] It's much nicer to invest a negligible amount of startup time to locate Python automatically.
The two modules listed in Examples Example 4-14 and Example 4-15, together with launchmodes, also form the core of the demo-launcher programs at the top of the examples distribution on this book's CD (see http://examples.oreilly.com/python2). There's nothing quite like being able to witness programs in action first-hand, so I wanted to make it as easy as possible to launch Python examples in the book. Ideally, they should run straight off the CD when clicked, and not require readers to wade through a complex environment installation procedure. However, many demos perform cross-directory imports, and so require the book's module package directories to be installed in PYTHONPATH; it is not enough just to click on some programs' icons at random. Moreover, when first starting out, users can't be assumed to have added the Python executable to their system search path either; the name "python" might not mean anything in the shell. At least on platforms tested thus far, the following modules solve such configuration problems. For example, script Launch_PyDemos.pyw in the root directory automatically configures the system and Python execution environments using Launcher.py tools, and then spawns PyDemos.py, a Tkinter GUI Demo interface we'll meet later in this book. PyDemos in turn uses launchmodes to spawn other programs, that also inherit the environment settings made at the top. The net effect is that clicking any of the Launch_* scripts starts Python programs even if you haven't touched your environment settings at all. You still need to install Python if it's not present, of course, but the Python Windows self-installer is a simple point-and-click affair too. Because searches and configuration take extra time, it's still to your advantage to eventually configure your environment settings and run programs like PyDemos directly, instead of through the launcher scripts. But there's much to be said for instant gratification when it comes to software. These tools will show up in other contexts later in this text, too. For instance, the PyMail email interface we'll meet in Chapter 11 uses Launcher to locate its own source code file; since it's impossible to know what directory it will be run from, the best it can do is search. Another GUI example, big_gui, will use a similar Launcher tool to locate canned Python source-distribution demo programs in arbitrary and unpredictable places on the underlying computer. The LaunchBrowser script in Example 4-15 also uses Launcher to locate suitable web browsers, and is itself used to start Internet demos in the PyDemos and PyGadgets launcher GUIs -- that is, Launcher starts PyDemos, which starts LaunchBrowser, which uses Launcher. By optimizing generality, these modules also optimize reusability. 4.6.2 Launching Programs Without Environment SettingsBecause the Launcher.py file is heavily documented, I won't go over its fine points in narrative here. Instead, I'll just point out that all of its functions are useful by themselves, but the main entry point is the launchBookExamples function near the end; you need to work your way from the bottom of this file up to glimpse its larger picture. The launchBookExamples function uses all the others, to configure the environment and then spawn one or more programs to run in that environment. In fact, the top-level demo launcher scripts shown in Examples Example 4-12 and Example 4-13 do nothing more than ask this function to spawn GUI demo interface programs we'll meet later (e.g., PyDemos.pyw, PyGadgets_bar.pyw). Because the GUIs are spawned indirectly through this interface, all programs they spawn inherit the environment configurations too. Example 4-12. PP2E\Launch_PyDemos.pyw#!/bin/env python ############################################### # PyDemos + environment search/config first # run this if you haven't setup your paths yet # you still must install Python first, though ############################################### import Launcher Launcher.launchBookExamples(['PyDemos.pyw'], 0) Example 4-13. PP2E\Launch_PyGadgets_bar.pyw#!/bin/env python ################################################## # PyGadgets_bar + environment search/config first # run this if you haven't setup your paths yet # you still must install Python first, though ################################################## import Launcher Launcher.launchBookExamples(['PyGadgets_bar.pyw'], 0) When run directly, PyDemos.pyw and PyGadgets_bar.pyw instead rely on the configuration settings on the underlying machine. In other words, Launcher effectively hides configuration details from the GUI interfaces, by enclosing them in a configuration program layer. To understand how, study Example 4-14. Example 4-14. PP2E\Launcher.py#!/usr/bin/env python """ ---------------------------------------------------------------------------- Tools to find files, and run Python demos even if your environment has not been manually configured yet. For instance, provided you have already installed Python, you can launch Tk demos directly off the book's CD by double-clicking this file's icon, without first changing your environment config files. Assumes Python has been installed first (double-click on the python self-install exe on the CD), and tries to guess where Python and the examples distribution live on your machine. Sets Python module and system search paths before running scripts: this only works because env settings are inherited by spawned programs on both windows and linux. You may want to tweak the list of directories searched for speed, and probably want to run one of the Config/setup-pp files at startup time to avoid this search. This script is friendly to already-configured path settings, and serves to demo platform-independent directory path processing. Python programs can always be started under the Windows port by clicking (or spawning a 'start' DOS command), but many book examples require the module search path too. ---------------------------------------------------------------------------- """ import sys, os, string def which(program, trace=1): """ Look for program in all dirs in the system's search path var, PATH; return full path to program if found, else None. Doesn't handle aliases on Unix (where we could also just run a 'which' shell cmd with os.popen), and it might help to also check if the file is really an executable with os.stat and the stat module, using code like this: os.stat(filename)[stat.ST_MODE] & 0111 """ try: ospath = os.environ['PATH'] except: ospath = '' # okay if not set systempath = string.split(ospath, os.pathsep) if trace: print 'Looking for', program, 'on', systempath for sysdir in systempath: filename = os.path.join(sysdir, program) # adds os.sep between if os.path.isfile(filename): # exists and is a file? if trace: print 'Found', filename return filename else: if trace: print 'Not at', filename if trace: print program, 'not on system path' return None def findFirst(thisDir, targetFile, trace=0): """ Search directories at and below thisDir for a file or dir named targetFile. Like find.find in standard lib, but no name patterns, follows unix links, and stops at the first file found with a matching name. targetFile must be a simple base name, not dir path. """ if trace: print 'Scanning', thisDir for filename in os.listdir(thisDir): # skip . and .. if filename in [os.curdir, os.pardir]: # just in case continue elif filename == targetFile: # check name match return os.path.join(thisDir, targetFile) # stop at this one else: pathname = os.path.join(thisDir, filename) # recur in subdirs if os.path.isdir(pathname): # stop at 1st match below = findFirst(pathname, targetFile, trace) if below: return below def guessLocation(file, isOnWindows=(sys.platform[:3]=='win'), trace=1): """ Try to find directory where file is installed by looking in standard places for the platform. Change tries lists as needed for your machine. """ cwd = os.getcwd( ) # directory where py started tryhere = cwd + os.sep + file # or os.path.join(cwd, file) if os.path.exists(tryhere): # don't search if it is here return tryhere # findFirst(cwd,file) descends if isOnWindows: tries = [] for pydir in [r'C:\Python20', r'C:\Program Files\Python']: if os.path.exists(pydir): tries.append(pydir) tries = tries + [cwd, r'C:\Program Files'] for drive in 'CGDEF': tries.append(drive + ':\\') else: tries = [cwd, os.environ['HOME'], '/usr/bin', '/usr/local/bin'] for dir in tries: if trace: print 'Searching for %s in %s' % (file, dir) try: match = findFirst(dir, file) except OSError: if trace: print 'Error while searching', dir # skip bad drives else: if match: return match if trace: print file, 'not found! - configure your environment manually' return None PP2EpackageRoots = [ # python module search path #'%sPP2E' % os.sep, # pass in your own elsewhere ''] # '' adds examplesDir root def configPythonPath(examplesDir, packageRoots=PP2EpackageRoots, trace=1): """ Setup the Python module import search-path directory list as necessary to run programs in the book examples distribution, in case it hasn't been configured already. Add examples package root, plus nested package roots. This corresponds to the setup-pp* config file settings. os.environ assignments call os.putenv internally in 1.5, so these settings will be inherited by spawned programs. Python source lib dir and '.' are automatically searched; unix|win os.sep is '/' | '\\', os.pathsep is ':' | ';'. sys.path is for this process only--must set os.environ. adds new dirs to front, in case there are two installs. could also try to run platform's setup-pp* file in this process, but that's non-portable, slow, and error-prone. """ try: ospythonpath = os.environ['PYTHONPATH'] except: ospythonpath = '' # okay if not set if trace: print 'PYTHONPATH start:\n', ospythonpath addList = [] for root in packageRoots: importDir = examplesDir + root if importDir in sys.path: if trace: print 'Exists', importDir else: if trace: print 'Adding', importDir sys.path.append(importDir) addList.append(importDir) if addList: addString = string.join(addList, os.pathsep) + os.pathsep os.environ['PYTHONPATH'] = addString + ospythonpath if trace: print 'PYTHONPATH updated:\n', os.environ['PYTHONPATH'] else: if trace: print 'PYTHONPATH unchanged' def configSystemPath(pythonDir, trace=1): """ Add python executable dir to system search path if needed """ try: ospath = os.environ['PATH'] except: ospath = '' # okay if not set if trace: print 'PATH start', ospath if (string.find(ospath, pythonDir) == -1 and # not found? string.find(ospath, string.upper(pythonDir)) == -1): # case diff? os.environ['PATH'] = ospath + os.pathsep + pythonDir if trace: print 'PATH updated:', os.environ['PATH'] else: if trace: print 'PATH unchanged' def runCommandLine(pypath, exdir, command, isOnWindows=0, trace=1): """ Run python command as an independent program/process on this platform, using pypath as the Python executable, and exdir as the installed examples root directory. Need full path to python on windows, but not on unix. On windows, a os.system('start ' + command) is similar, except that .py files pop up a dos console box for i/o. Could use launchmodes.py too but pypath is already known. """ command = exdir + os.sep + command # rooted in examples tree os.environ['PP2E_PYTHON_FILE'] = pypath # export directories for os.environ['PP2E_EXAMPLE_DIR'] = exdir # use in spawned programs if trace: print 'Spawning:', command if isOnWindows: os.spawnv(os.P_DETACH, pypath, ('python', command)) else: cmdargs = [pypath] + string.split(command) if os.fork( ) == 0: os.execv(pypath, cmdargs) # run prog in child process def launchBookExamples(commandsToStart, trace=1): """ Toplevel entry point: find python exe and examples dir, config env, spawn programs """ isOnWindows = (sys.platform[:3] == 'win') pythonFile = (isOnWindows and 'python.exe') or 'python' examplesFile = 'README-PP2E.txt' if trace: print os.getcwd( ), os.curdir, os.sep, os.pathsep print 'starting on %s...' % sys.platform # find python executable: check system path, then guess pypath = which(pythonFile) or guessLocation(pythonFile, isOnWindows) assert pypath pydir, pyfile = os.path.split(pypath) # up 1 from file if trace: print 'Using this Python executable:', pypath raw_input('Press <enter> key') # find examples root dir: check cwd and others expath = guessLocation(examplesFile, isOnWindows) assert expath updir = string.split(expath, os.sep)[:-2] # up 2 from file exdir = string.join(updir, os.sep) # to PP2E pkg parent if trace: print 'Using this examples root directory:', exdir raw_input('Press <enter> key') # export python and system paths if needed configSystemPath(pydir) configPythonPath(exdir) if trace: print 'Environment configured' raw_input('Press <enter> key') # spawn programs for command in commandsToStart: runCommandLine(pypath, os.path.dirname(expath), command, isOnWindows) if __name__ == '__main__': # # if no args, spawn all in the list of programs below # else rest of cmd line args give single cmd to be spawned # if len(sys.argv) == 1: commandsToStart = [ 'Gui/TextEditor/textEditor.pyw', # either slash works 'Lang/Calculator/calculator.py', # os normalizes path 'PyDemos.pyw', #'PyGadgets.py', 'echoEnvironment.pyw' ] else: commandsToStart = [ string.join(sys.argv[1:], ' ') ] launchBookExamples(commandsToStart) import time if sys.platform[:3] == 'win': time.sleep(10) # to read msgs if clicked One way to understand the Launcher script is to trace the messages it prints along the way. When run by itself without a PYTHONPATH setting, the script finds a suitable Python and the examples root directory (by hunting for its README file), uses those results to configure PATH and PYTHONPATH settings if needed, and spawns a precoded list of program examples. To illustrate, here is a launch on Windows with an empty PYTHONPATH: C:\temp\examples>set PYTHONPATH= C:\temp\examples>python Launcher.py C:\temp\examples . \ ; starting on win32... Looking for python.exe on ['C:\\WINDOWS', 'C:\\WINDOWS', 'C:\\WINDOWS\\COMMAND', 'C:\\STUFF\\BIN.MKS', 'C:\\PROGRAM FILES\\PYTHON'] Not at C:\WINDOWS\python.exe Not at C:\WINDOWS\python.exe Not at C:\WINDOWS\COMMAND\python.exe Not at C:\STUFF\BIN.MKS\python.exe Found C:\PROGRAM FILES\PYTHON\python.exe Using this Python executable: C:\PROGRAM FILES\PYTHON\python.exe Press <enter> key Using this examples root directory: C:\temp\examples Press <enter> key PATH start C:\WINDOWS;C:\WINDOWS;C:\WINDOWS\COMMAND;C:\STUFF\BIN.MKS; C:\PROGRAM FILES\PYTHON PATH unchanged PYTHONPATH start: Adding C:\temp\examples\Part3 Adding C:\temp\examples\Part2 Adding C:\temp\examples\Part2\Gui Adding C:\temp\examples PYTHONPATH updated: C:\temp\examples\Part3;C:\temp\examples\Part2;C:\temp\examples\Part2\Gui; C:\temp\examples; Environment configured Press <enter> key Spawning: C:\temp\examples\Part2/Gui/TextEditor/textEditor.pyw Spawning: C:\temp\examples\Part2/Lang/Calculator/calculator.py Spawning: C:\temp\examples\PyDemos.pyw Spawning: C:\temp\examples\echoEnvironment.pyw Four programs are spawned with PATH and PYTHONPATH preconfigured according to the location of your Python interpreter program, the location of your examples distribution tree, and the list of required PYTHONPATH entries in script variable PP2EpackageRoots.
When used by the PyDemos launcher script, Launcher does not pause for key presses along the way (the trace argument is passed in false). Here is the output generated when using the module to launch PyDemos with PYTHONPATH already set to include all the required directories; the script both avoids adding settings redundantly, and retains any exiting settings already in your environment: C:\PP2ndEd\examples>python Launch_PyDemos.pyw Looking for python.exe on ['C:\\WINDOWS', 'C:\\WINDOWS', 'C:\\WINDOWS\\COMMAND', 'C:\\STUFF\\BIN.MKS', 'C:\\PROGRAM FILES\\PYTHON'] Not at C:\WINDOWS\python.exe Not at C:\WINDOWS\python.exe Not at C:\WINDOWS\COMMAND\python.exe Not at C:\STUFF\BIN.MKS\python.exe Found C:\PROGRAM FILES\PYTHON\python.exe PATH start C:\WINDOWS;C:\WINDOWS;C:\WINDOWS\COMMAND;C:\STUFF\BIN.MKS; C:\PROGRAM FILES\PYTHON PATH unchanged PYTHONPATH start: C:\PP2ndEd\examples\Part3;C:\PP2ndEd\examples\Part2;C:\PP2ndEd\examples\ Part2\Gui;C:\PP2ndEd\examples Exists C:\PP2ndEd\examples\Part3 Exists C:\PP2ndEd\examples\Part2 Exists C:\PP2ndEd\examples\Part2\Gui Exists C:\PP2ndEd\examples PYTHONPATH unchanged Spawning: C:\PP2ndEd\examples\PyDemos.pyw And finally, here is the trace output of a launch on my Linux system; because Launcher is written with portable Python code and library calls, environment configuration and directory searches work just as well there: [mark@toy ~/PP2ndEd/examples]$ unsetenv PYTHONPATH [mark@toy ~/PP2ndEd/examples]$ python Launcher.py /home/mark/PP2ndEd/examples . / : starting on linux2... Looking for python on ['/home/mark/bin', '.', '/usr/bin', '/usr/bin', '/usr/local/ bin', '/usr/X11R6/bin', '/bin', '/usr/X11R6/bin', '/home/mark/ bin', '/usr/X11R6/bin', '/home/mark/bin', '/usr/X11R6/bin'] Not at /home/mark/bin/python Not at ./python Found /usr/bin/python Using this Python executable: /usr/bin/python Press <enter> key Using this examples root directory: /home/mark/PP2ndEd/examples Press <enter> key PATH start /home/mark/bin:.:/usr/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin:/bin:/ usr /X11R6/bin:/home/mark/bin:/usr/X11R6/bin:/home/mark/bin:/usr/X11R6/bin PATH unchanged PYTHONPATH start: Adding /home/mark/PP2ndEd/examples/Part3 Adding /home/mark/PP2ndEd/examples/Part2 Adding /home/mark/PP2ndEd/examples/Part2/Gui Adding /home/mark/PP2ndEd/examples PYTHONPATH updated: /home/mark/PP2ndEd/examples/Part3:/home/mark/PP2ndEd/examples/Part2:/home/ mark/PP2ndEd/examples/Part2/Gui:/home/mark/PP2ndEd/examples: Environment configured Press <enter> key Spawning: /home/mark/PP2ndEd/examples/Part2/Gui/TextEditor/textEditor.py Spawning: /home/mark/PP2ndEd/examples/Part2/Lang/Calculator/calculator.py Spawning: /home/mark/PP2ndEd/examples/PyDemos.pyw Spawning: /home/mark/PP2ndEd/examples/echoEnvironment.pyw In all of these launches, the Python interpreter was found on the system search-path, so no real searches were performed (the "Not at" lines near the top represent the module's which function). In a moment, we'll also use the Launcher's which and guessLocation functions to look for web browsers in a way that kicks off searches in standard install directory trees. Later in the book, we'll use this module in other ways -- for instance, to search for demo programs and source code files somewhere on the machine, with calls of this form: C:\temp>python >>> from PP2E.Launcher import guessLocation >>> guessLocation('hanoi.py') Searching for hanoi.py in C:\Program Files\Python Searching for hanoi.py in C:\temp\examples Searching for hanoi.py in C:\Program Files Searching for hanoi.py in C:\ 'C:\\PP2ndEd\\cdrom\\Python1.5.2\\SourceDistribution\\Unpacked\\Python-1.5.2 \\Demo\\tkinter\\guido\\hanoi.py' >>> from PP2E.Launcher import findFirst >>> findFirst('.', 'PyMailGui.py') '.\\examples\\Internet\\Email\\PyMailGui.py' Such searches aren't necessary if you can rely on an environment variable to give at least part of the path to a file; for instance, paths scripts within the PP2E examples tree can be named by joining the PP2EHOME shell variable, with the rest of the script's path (assuming the rest of the script's path won't change, and we can rely on that shell variable being set everywhere). Some scripts may also be able to compose relative paths to other scripts using the sys.path[0] home-directory indicator added for imports (see Section 2.7). But in cases where a file can appear at arbitrary places, searches like those shown previously are sometimes the best scripts can do. The earlier hanoi.py program file, for example, can be anywhere on the underlying machine (if present at all); searching is a more user-friendly final alternative than simply giving up.
4.6.3 Launching Web Browsers PortablyWeb browsers can do amazing things these days. They can serve as document viewers, remote program launchers, database interfaces, media players, and more. Being able to open a browser on a local or remote page file from within a script opens up all kinds of interesting user-interface possibilities. For instance, a Python system might automatically display its HTML-coded documentation when needed, by launching the local web browser on the appropriate page file.[5] Because most browsers know how to present pictures, audio files, and movie clips, opening a browser on such a file is also a simple way for scripts to deal with multimedia.
The last script listed in this chapter is less ambitious than Launcher.py, but equally reusable: LaunchBrowser.py attempts to provide a portable interface for starting a web browser. Because techniques for launching browsers vary per platform, this script provides an interface that aims to hide the differences from callers. Once launched, the browser runs as an independent program, and may be opened to view either a local file or a remote page on the Web. Here's how it works. Because most web browsers can be started with shell command lines, this script simply builds and launches one as appropriate. For instance, to run a Netscape browser on Linux, a shell command of the form netscape url is run, where url begins with "file://" for local files, and "http://" for live remote-page accesses (this is per URL conventions we'll meet in more detail later, in Chapter 12). On Windows, a shell command like start url achieves the same goal. Here are some platform-specific highlights:
All of this is easily customized (this is Python code, after all), and you may need to add additional logic for other platforms. But on all of my machines, the script makes reasonable assumptions that allow me to largely forget most of the platform-specific bits previously discussed; I just call the same launchBrowser function everywhere. For more details, let's look at Example 4-15. Example 4-15. PP2E\LaunchBrowser.py#!/bin/env python ################################################################# # Launch a web browser to view a web page, portably. If run # in '-live' mode, assumes you have a Internet feed and opens # a page at a remote site. Otherwise, assumes the page is a # full file path name on your machine, and opens the page file # locally. On Unix/Linux, finds first browser on your $PATH. # On Windows, tries DOS "start" command first, or searches for # the location of a browser on your machine for os.spawnv by # checking PATH and common Windows executable directories. You # may need to tweak browser executable name/dirs if this fails. # This has only been tested in Win98 and Linux, so you may need # to add more code for other machines (mac: ic.launcurl(url)?). ################################################################# import os, sys from Launcher import which, guessLocation # file search utilities useWinStart = 1 # 0=ignore name associations onWindows = sys.platform[:3] == 'win' helptext = "Usage: LaunchBrowser.py [ -file path | -live path site ]" #browser = r'c:\"Program Files"\Netscape\Communicator\Program\netscape.exe' # defaults Mode = '-file' Page = os.getcwd( ) + '/Internet/Cgi-Web/PyInternetDemos.html' Site = 'starship.python.net/~lutz' def launchUnixBrowser(url, verbose=1): # add your platform if unique tries = ['netscape', 'mosaic', 'lynx'] # order your preferences here for program in tries: if which(program): break # find one that is on $path else: assert 0, 'Sorry - no browser found' if verbose: print 'Running', program os.system('%s %s &' % (program, url)) # or fork+exec; assumes $path def launchWindowsBrowser(url, verbose=1): if useWinStart and len(url) <= 400: # on windows: start or spawnv try: # spawnv works if cmd too long if verbose: print 'Starting' os.system('start ' + url) # try name associations first return # fails if cmdline too long except: pass browser = None # search for a browser exe tries = ['IEXPLORE.EXE', 'netscape.exe'] # try explorer, then netscape for program in tries: browser = which(program) or guessLocation(program, 1) if browser: break assert browser != None, 'Sorry - no browser found' if verbose: print 'Spawning', browser os.spawnv(os.P_DETACH, browser, (browser, url)) def launchBrowser(Mode='-file', Page=Page, Site=None, verbose=1): if Mode == '-live': url = 'http://%s/%s' % (Site, Page) # open page at remote site else: url = 'file://%s' % Page # open page on this machine if verbose: print 'Opening', url if onWindows: launchWindowsBrowser(url, verbose) # use windows start, spawnv else: launchUnixBrowser(url, verbose) # assume $path on unix, linux if __name__ == '__main__': # get command-line args argc = len(sys.argv) if argc > 1: Mode = sys.argv[1] if argc > 2: Page = sys.argv[2] if argc > 3: Site = sys.argv[3] if Mode not in ['-live', '-file']: print helptext sys.exit(1) else: launchBrowser(Mode, Page, Site) <IP_ADDRESS> Launching browsers with command linesThis module is designed to be both run and imported. When run by itself on my Windows machine, Internet Explorer starts up. The requested page file is always displayed in a new browser window when os.spawnv is applied, but in the currently open browser window (if any) when running a start command: C:\...\PP2E>python LaunchBrowser.py Opening file://C:\PP2ndEd\examples\PP2E/Internet/Cgi-Web/PyInternetDemos.html Starting The seemingly odd mix of forward and backward slashes in the URL here works fine within the browser; it pops up the window shown in Figure 4-2. Figure 4-2. Launching a Windows browser on a local fileBy default, a start command is spawned; to see the browser search procedure in action on Windows, set the script's useWinStart variable to 0. The script will search for a browser on your PATH settings, and then in common Windows install directories hardcoded in Launcher.py : C:\...\PP2E>python LaunchBrowser.py -file C:\Stuff\Website\public_html\about-pp.html Opening file://C:\Stuff\Website\public_html\about-pp.html Looking for IEXPLORE.EXE on ['C:\\WINDOWS', 'C:\\WINDOWS', 'C:\\WINDOWS\\COMMAND', 'C:\\STUFF\\BIN.MKS', 'C:\\PROGRAM FILES\\PYTHON'] Not at C:\WINDOWS\IEXPLORE.EXE Not at C:\WINDOWS\IEXPLORE.EXE Not at C:\WINDOWS\COMMAND\IEXPLORE.EXE Not at C:\STUFF\BIN.MKS\IEXPLORE.EXE Not at C:\PROGRAM FILES\PYTHON\IEXPLORE.EXE IEXPLORE.EXE not on system path Searching for IEXPLORE.EXE in C:\Program Files\Python Searching for IEXPLORE.EXE in C:\PP2ndEd\examples\PP2E Searching for IEXPLORE.EXE in C:\Program Files Spawning C:\Program Files\Internet Explorer\IEXPLORE.EXE If you study these trace message you'll notice that the browser wasn't on the system search path, but was eventually located in a local C:\Program Files subdirectory -- this is just the Launcher module's which and guessLocation functions at work. As coded, the script searches for Internet Explorer first; if that's not to your liking, try changing the script's tries list to make Netscape first: C:\...\PP2E>python LaunchBrowser.py Opening file://C:\PP2ndEd\examples\PP2E/Internet/Cgi-Web/PyInternetDemos.html Looking for netscape.exe on ['C:\\WINDOWS', 'C:\\WINDOWS', 'C:\\WINDOWS\\COMMAND', 'C:\\STUFF\\BIN.MKS', 'C:\\PROGRAM FILES\\PYTHON'] Not at C:\WINDOWS\netscape.exe Not at C:\WINDOWS\netscape.exe Not at C:\WINDOWS\COMMAND\netscape.exe Not at C:\STUFF\BIN.MKS\netscape.exe Not at C:\PROGRAM FILES\PYTHON\netscape.exe netscape.exe not on system path Searching for netscape.exe in C:\Program Files\Python Searching for netscape.exe in C:\PP2ndEd\examples\PP2E Searching for netscape.exe in C:\Program Files Spawning C:\Program Files\Netscape\Communicator\Program\netscape.exe Here, the script eventually found Netscape in a different install directory on the local machine. Besides automatically finding a user's browser for them, this script also aims to be portable. When running this file unchanged on Linux, the local Netscape browser starts, if it lives on your PATH; otherwise, others are tried: [mark@toy ~/PP2ndEd/examples/PP2E]$ python LaunchBrowser.py Opening file:///home/mark/PP2ndEd/examples/PP2E/Internet/Cgi- Web/PyInternetDemos.html Looking for netscape on ['/home/mark/bin', '.', '/usr/bin', '/usr/bin', '/usr/local/bin', '/usr/X11R6/bin', '/bin', '/usr/X11R6/bin', '/home/mark/ bin', '/usr/X11R6/bin', '/home/mark/bin', '/usr/X11R6/bin'] Not at /home/mark/bin/netscape Not at ./netscape Found /usr/bin/netscape Running netscape [mark@toy ~/PP2ndEd/examples/PP2E]$ I have Netscape installed, so running the script this way on my machine generates the window shown in Figure 4-3, seen under the KDE window manager. Figure 4-3. Launching a browser on LinuxIf you have an Internet connection, you can open pages at remote servers too -- the next command opens the root page at my site on the starship.python.netserver, located somewhere on the East Coast the last time I checked: C:\...\PP2E>python LaunchBrowser.py -live ~lutz starship.python.net Opening http://starship.python.net/~lutz Starting In Chapter 8, we'll see that this script is also run to start Internet examples in the top-level demo launcher system: the PyDemos script presented in that chapter portably opens local or remote web page files with this button-press callback: [File mode] pagepath = os.getcwd( ) + '/Internet/Cgi-Web' demoButton('PyErrata', 'Internet-based errata report system', 'LaunchBrowser.py -file %s/PyErrata/pyerrata.html' % pagepath) [Live mode] site = 'starship.python.net/~lutz' demoButton('PyErrata', 'Internet-based errata report system', 'LaunchBrowser.py -live PyErrata/pyerrata.html ' + site) <IP_ADDRESS> Launching browsers with function callsOther programs can spawn LaunchBrowser.py command lines like those shown previously with tools like os.system, as usual; but since the script's core logic is coded in a function, it can just as easily be imported and called: >>> from PP2E.LaunchBrowser import launchBrowser >>> launchBrowser(Page=r'C:\Stuff\Website\Public_html\about-pp.html') Opening file://C:\Stuff\Website\Public_html\about-pp.html Starting >>> When called like this, launchBrowser isn't much different from spawning a start command on DOS or a netscape command on Linux, but the Python launchBrowser function is designed to be a portable interface for browser startup across platforms. Python scripts can use this interface to pop up local HTML documents in web browsers; on machines with live Internet links, this call even lets scripts open browsers on remote pages on the Web: >>> launchBrowser(Mode='-live', Page='index.html', Site='www.python.org') Opening http://www.python.org/index.html Starting >>> launchBrowser(Mode='-live', Page='~lutz/PyInternetDemos.html', ... Site='starship.python.net') Opening http://starship.python.net/~lutz/PyInternetDemos.html Starting On my computer, the first call here opens a new Internet Explorer GUI window if needed, dials out through my modem, and fetches the Python home page from http://www.python.org on both Windows and Linux -- not bad for a single function call. The second call does the same, but with a web demos page we'll explore later. <IP_ADDRESS> A Python "multimedia extravaganza"I mentioned earlier that browsers are a cheap way to present multimedia. Alas, this sort of thing is best viewed live, so the best I can do is show startup commands here. The next command line and function call, for example, display two GIF images in Internet Explorer on my machine (be sure to use full local pathnames). The result of the first of these is captured in Figure 4-4. C:\...\PP2E>python LaunchBrowser.py -file C:\PP2ndEd\examples\PP2E\Gui\gifs\hills.gif Opening file://C:\PP2ndEd\examples\PP2E\Gui\gifs\hills.gif Starting C:\temp>python >>> from LaunchBrowser import launchBrowser >>> launchBrowser(Page=r'C:\PP2ndEd\examples\PP2E\Gui\gifs\mp_lumberjack.gif') Opening file://C:\PP2ndEd\examples\PP2E\Gui\gifs\mp_lumberjack.gif Starting Figure 4-4. Launching a browser on an image fileThe next command line and call open the sousa.au audio file on my machine too; the second of these downloads the file from http://www.python.org first. If all goes as planned, they'll make the Monty Python theme song play on your computer too: C:\PP2ndEd\examples>python LaunchBrowser.py -file C:\PP2ndEd\examples\PP2E\Internet\Ftp\sousa.au Opening file://C:\PP2ndEd\examples\PP2E\Internet\Ftp\sousa.au Starting >>> launchBrowser(Mode='-live', ... Site='www.python.org', ... Page='ftp/python/misc/sousa.au', ... verbose=0) >>> Of course, you could just pass these filenames to a spawned start command on Windows, or run the appropriate handler program directly with something like os.system. But opening these files in a browser is a more portable approach -- you don't need to keep track of a set of file-handler programs per platform. Provided your scripts use a portable browser launcher like LaunchBrowser, you don't even need to keep track of a browser per platform. In closing, I want to point out that LaunchBrowser reflects browsers that I tend to use. For instance, it tries to find Internet Explorer before Netscape on Windows, and prefers Netscape over Mosaic and Lynx on Linux, but you should feel free to change these choices in your copy of the script. In fact, both LaunchBrowser and Launcher make a few heuristic guesses when searching for files that may not make sense on every computer. As always, hack on; this is Python, after all.
|
| I l@ve RuBoard |


Primary
secondary
Select a Country with a very long label, too long in fact
Deselect
Select Inverse
Feather...
Select and Mask...
Save Selection
Make Work Path


About
|
News
|
Help
|
Feedback
|
Sponsors
RouteLoops News
2010-07-30: Site version 2.0 Launched
2010-11-01: Google Maps Interface Announced
RouteLoops got mentioned on National Public Radio! A very small mention, but still... Go to about minute #42.
And hot on the heels of the OnPoint mention, an article in the local paper,
Wellesley Town News
. See page 16. (In case that link breaks,
here is a screen shot of the article
.)
MapMyFitness includes RouteLoops as part of their offering, first as the Route Recommended, but later as the
Route Genius
!
Copyright ©
,
RouteLoops.com
and
iMaptools.com
, All Rights Reserved.
Use of this web site signifies your agreement to the
Terms of Use
.
Privacy Statement
|
Contact Us


HOME
E-SERVICES
SERVICES
ABOUT-US
CONTACT-US
CAREER
EMPLOYEE REGISTRATION
First Name
Last Name:
Address:
City:
State:
ZipCode:
EmployeeId:
Email:
Password(6-20 character)
Confirm Password:


Find your educational resources here on MedTV.
Market your medical device on MedTV.
Learn from the best surgeons in the world, right in the classroom.
Your LEGACY as a doctor, right here.
Example of using VR for knee surgery training.
New surgical scope tool in use.
Hip Surgery.