This document defines the syntax and features of the Pseudo language used for Introduction to Programming class.
Letter := 'a'-'z' | 'A'-'Z'
Digit := '0'-'9'
Name := Letter (Letter | Digit | '_' )*
String := '"' < any characters but double quote > '"'
Character := '\'' < any character but single quote > '\''
Number :='.' Digit+ | ( Digit+ [ '.' Digit+])
Type := "Real" | "Integer" | "String" | "Boolean" | "Character"
Literal := Number | String | Character
BoolValue := "True" | "False"
Comment := "//" < any characters but \n > '\n'
A run-time test to verify correct operation. Can display a message like a Display.
Assert := Expression "IfNot" Expression+
Set x = 100
Set flag = True
Assert x==100 IfNot "Failed x, x=",x
Assert flag IfNot "Failed flag true"
A Boolean expression can be only True or False and includes the comparison operators and the logical AND, OR operators.
BoolExpression := BoolValue |
Expression CompareOperator Expression
|
BoolExpression "OR" BoolExpression |
BoolExpression "AND" BoolExpression |
"NOT" BoolExpression
CompareOperator := "<" | "<=" | "==" | ">=" | ">" | "!="
"Bob" > "Ted"
True
A > B AND (C <= D)
Transfer control to a Module with optional arguments that match the Modules parameters by Type.
CallStatement := "Call" '(' Argument* ')'
Argument := Name | Expression
Call getWeight(weight)
Call getHeight(height)
Call showBMI(weight, height)
Defines a description of an object with methods and fields.
ClassStatement := "Class" Name
(MethodStatement | FunctionStatement | FieldStatement | ConstantStatement)*
"End" "Class"
FieldStatement := ("Private" | "Public" ) DeclareStatement
MethodStatement := ("Private" | "Public" ) (FunctionStatement | ModuleStatement)
Class CellPhone
// Field declarations
Private String manufacturer
Private String modelNumber
Private Real retailPrice
// Method definitions
Public Module setManufacturer(String manufact)
Set manufacturer = manufact
End Module
Public Module setModelNumber(String modNum)
Set modelNumber = modNum
End Module
Public Module setRetailPrice(Real retail)
Set retailPrice = retail
End Module
Public Function String getManufacturer()
Return manufacturer
End Function
Public Function String getModelNumber()
Return modelNumber
End Function
Public Function Real getRetailPrice()
Return retailPrice
End Function
End Class
Display a chart in the output panel.
Chart := "Chart" Data (',' Data)* (Title | XTitle | YTitle | Grid)*
XLables := ',' "XLabels" '=' Array
YLables := ',' "YLabels" '=' Array
XTitle := ',' "XTitle" '=' Expression
YTitle := ',' "YTitle" '=' Expression
Title := ',' "Title" '=' Expression
Grid := ',' "Grid" '=' ("X" | "Y" | "XY")
Data := Array Color? Pattern? Thickness?
Color
:= {standard color name}
Pattern
:= "DOT" | "DASH"
Thickness
:= "Width"
'=' Expression
Array := Expression // expression must evaluate to an 2+ dimensional array, array[0,i] is the x, array[1,i] is y1, etc.
|
Declare Integer y[8]= 1,3,5,8,20,2,3,4 Chart y BLUE DOT 2, Title="My Data", XTitle="X data", YTitle="Y data", Grid=XY |
Used to create a constant variable that cannot be changed.
ConstantStatement := "Constant" Type Name '=' Expression
Constant Integer SECONDS_IN_MINUTE = 60
Constant String Title = "Test of Time"
Used to create variables of a specific type.
DeclareStatement := "Declare" TypeClause (',' TypeClause)*
TypeClause := Type NameClause (',' SimpleClause | ArrayClause)*
SimpleClause := Name ['=' Expression ]
ArrayClause := Name'[' Number ']' ['=' Expression (',' Expression)*
Declare Real Seconds, BMI
Declare Integer Weight = 100, Real Speed = 10.0, String Name = "Test of Time"
Constant Integer SIZE = 5
Declare Integer numbers[SIZE] = 5, 10, 15, 20, 25
Used to output to the console. Strings can contain \ to escape the following: \r == CR, \f == CLR, \a == BEL, \" == ", \uXXXX is a Unicode character of 4 hex digits.
CR is carriage return
CLR is clear output screen
BEL is sound bell
DisplayStatement := "Display" Argument (',' Argument)*
Argument := Name | Expression | CR | CLR | BEL
Display "This is a message"
Display MyVariable, MyOtherVariable, 10, "Test Message"
Display 10*56+1
Display "Your weight is optimal."
Unicode box characters can be defined like this:
Constant String VERT_BAR = "\u2502"
Constant String HORZ_BAR = "\u2500"
Constant String CROSS_BAR = "\u253C"
Constant String LEFT_TOP_CORNER = "\u250C"
Constant String LEFT_BOT_CORNER = "\u2514"
Constant String RIGHT_TOP_CORNER = "\u2510"
Constant String RIGHT_BOT_CORNER = "\u2518"
Constant String RIGHT_MID_T = "\u251C"
Constant String
LEFT_MID_T = "\u2524"
Loop over statement(s) until the BoolExpression is true (continue while it is false). Executes statements at least once.
DoUntilStatement := "Do"
Statement*
"Until" BoolExpression
Set count = 10
Do
Display count
Set count = count - 1
Until count == 0
Loop over statement(s) while the BoolExpression is true (continue while it is true). Executes statements at least once.
DoWhiletatement := "Do"
Statement*
"While" BoolExpression
Set count = 10
Do
Display count
Set count = count - 1
While count > 0
A run-time testing structure to trap run-time errors and report that the error occurred.
ExpectFail := "ExpectFail" Statement+ "End ExpectFail"
Module main()
Call Test(300)
ExpectFail
Call Test(3.3) // expects an integer, loss of
precision with real
End ExpectFail
End Module
Module Test(Integer v)
Display "Result is ",v
End Module
A mathematical expression can be a variable Name, a Literal or a binary operation or a unary operation. Precidence is controlled by parentheses.
"Test Message"
Declare Real Weight=1, Real Height = 100, Real duration= -5, Real Array[50],Integer x=1, Integer Array2[5][3]
(Weight+100)*10 / (Height ^ 2)
+10 – ( -duration)
Array[x] *10
Array2[1][x] + 100
Loops over a range of values defined by an initial expression and a final expression. Each time the statements are evaluated with the variable Name, having initially the starting value, then incrementing by 1, and the statements execute again. This loops until the value of Name is equal the final expression.
ForStatement := "For" Name '=' Expression "To"
Expression [
"Step"
Expression]
Statement*
"End" "For"
Declare Integer counter
For counter = 1 To 10
Display "Hello world: ",counter
End For
Loops over all members of an array, assigning the Name the value of each member of the array and executing the Statements in the body. The loop may have an optional step to add to the counter on each iteration. A negative step causes the counter to run backwards, initial value is greater than the Test expression (final value).
ForStatement := "ForEach" Name '=' ArrayName
Statement*
"End" "ForEach"
ArrayName := Name
Constant Integer SIZE = 5
Declare Integer numbers[SIZE] = 5, 10, 15, 20, 25
Declare Integer num
For Each num In numbers
Display num
End ForEach
Transfer control to a Function with optional arguments that match the Functions parameters by Type. A value is returned by the Return statement in the function and the returned type is defined in the Function declaration.
FunctionStatement := "Function" Type Name ''(' Parameter (',' Parameter)* ')'
(Statement | ReturnStatement)*
"End" "Function"
Parameter := Type ["Ref"] Name
ReturnStatement := "Return" Expression
Function Integer sum(Integer num1, Integer num2)
Declare Integer result
Set result = num1 + num2
Return result
End Function
Transfer control to a Module with optional arguments that match the Modules parameters by Type.
IfStatement := "If" BoolExpression
"Then"
Statement+
["Else" ["If" BoolExpression
"Then"] Statement+
]
"End" "If"
// If Form
If sales > 50000 Then
Set bonus = 500.0
Set commissionRate = 0.12
Display "You've met your sales quota!"
End If
// If-Else form
If temperature < 40 Then
Display "A little cold, isn't it?"
Else
Display "Nice weather we're having."
End If
// If-Else-If form
If x < 10 Then
Display "x is less than 10"
Else If x < 20 Then
Display "x is less than 20 and greater than or equal to 10"
Else
Display "x is greater than or equal to 20"
End If
Used to get input from the console.
InputStatement := "Input" Name (',' Name)*
Input MyVariable1, MyVariable2
Input Weight
Used to define a computational unit or a component of a program. Parameter defines a Type optional Ref and the Name of the variable. Separated by commas.
ModuleStatement := "Module" '(' Parameter (',' Parameter)* ')' Statement* "End" "Module"
Parameter := Type ["Ref"] Name
Module getWeight (Real Ref weight)
Display "Enter your weight in pounds: "
Input weight
End Module
Module showTime (Integer Seconds, Integer Days, Integer Hours, Integer Minutes)
Display "Days: ", Days
Display "Hours: ", Hours
Display "Minutes: ", Minutes
Display "Seconds: ", Seconds
End Module
A list of statements to execute.
Program := ["Program"] Statement* ["End" "Program"]
Statement := DeclareStatement |
InputStatement |
DisplayStatement |
SetStatement |
ModuleStatement |
CallStatement |
IfStatement |
SelectStatement |
WhileStatement |
DoWhileStatement |
DoUntilStatement |
ForStatement |
ForEachStatement |
ClassStatement |
FunctionStatement
Program
Display "Hello World"
End Program
// without Program syntax
Display "Hello World"
Allows the selection of code to execute based on a set of matching values along with a default (nothing matches option).
SelectStatement := "Select" Expression
(CaseStatement | DefaultStatement)*
"End" "Select"
CaseStatement := "Case" Literal ':' Statement*
DefaultStatement := "Default" ':' Statements*
Select month
Case 1:
Display "January"
Case 2:
Display "February"
Case 3:
Display "March"
Default:
Display "Error: Invalid month"
End Select
Assign a value to a variable. The variable must be declared before it can be assigned.
SetStatement := "Set" Name '=' Expression
Set weight = 150
Set MyName = "Grace Hopper"
Set BMI = weight * (703 / height ^ 2)
Loop over statement(s) while the BoolExpression is true (continue while it is true). Tests each time before statements are executed.
WhileStatement := "While" BoolExpression
Statement*
"End" "While"
Set count = 0
While count < 10
Display count
Set count = count + 1
End While
The Elevator support routines require that a class Elevator be created with the following structure:
Class Elevator
Public Integer currentDirection
// Current direction up=2/down=1/stopped=0
Public Integer currentFloor
// Current floor number
Public Boolean floorButtonPressedUp[FLOOR_COUNT]
// Up button by floor
Public Boolean floorButtonPressedDown[FLOOR_COUNT] // Down button by floor
Public Boolean floorStops[FLOOR_COUNT]
// List of buttons
press
/////////////////////////////////////////////////////////////////////////////////
// Decide what floor
to go to next.
// Returns a number
between 1 and FloorCount inclusively
// (1 based floor number)
/////////////////////////////////////////////////////////////////////////////////
Public Function Integer decideNextFloor()
End Function
The class members above are populated with the current values and can be used in the decideNextFloor function.
Built in Modules:
Syntax:
InitElevator := "initElevator" '(' floorCount ',' elevatorCount ',' maxPassengers ',' spawnRate ',' maxTime ',' elevator ')'
floorCount - number of floors 2-200
elevatorCount – number of elevators 1-5
maxPassangers - number of passangers
allowed 3-20
spanRate - rate of passanger spawn, .5
is one every 2 seconds.
maxTime - time in seconds to run
simulation
elevator - the elevator object with
the above fields to use for simulation
StartElevator := "startElevator" '(' ')'.
IsElevatorRunning := "isElevatorRunning '(' ')'.
|
Declare Elevator elevator = New
Elevator() Call startElevator() |
These functions can be called from any code in a Module, Function or in the Program
|
Return Type |
Function |
Description |
Example |
Result |
|
String |
append(String text, String text2) |
Concatenates text and text2. |
String s = append("Hello ","World") |
s == "Hello World" |
|
Boolean |
startsWith(String text, String startText) |
Tests if text starts with startText. |
Boolean b = startsWith("Hello", "He") |
b == true |
|
Integer |
length(String text) |
Returns the length of the text. |
Integer len = length("hello") |
len == 5 |
|
String |
toUpper(String text) |
Converts text to all uppercase |
String s = toUpper("Ted1") |
s == "TED1" |
|
String |
toLower(String text) |
Converts text to all lowercase |
String s = toLower("Ted1") |
s == "ted1" |
|
String |
substring(String text, Integer start, Integer end) |
Extracts a sub-string from text starting at start to end |
String s = substring("MarySmith",0,3) |
s == "Mary" |
|
String |
currency(Real num) |
Formats the number as currency |
String s = currency(1.2343284) |
s == $1.23 |
|
Boolean |
contains(String text, String test) |
Tests if text contain the string text |
Boolean b = contains("1234","3") |
b == true |
|
String |
insert(String text, Integer pos, String ins) |
Insert a string ins at position pos in text |
String s = insert("this",1,"e ") |
s == "the is" |
|
String |
delete(String text, Integer start, Integer end) |
Delete part of text from start to end |
String s = delete("this",1,2) |
s == "ts" |
|
Integer |
stringToInteger(String text) |
Convert a string to integer |
Integer n = stringToInteger("100") |
n == 100 |
|
Integer |
stringToReal(String text) |
Convert a string to real |
Real r = stringToRea("3.14") |
r == 3.14 |
|
Boolean |
isInteger(String text) |
Test if text is an Integer number |
Boolean b = IsInteger("100.0"') |
b == false |
|
Boolean |
isReal(String text) |
Test if text is a real number |
Boolean b = isReal("best") |
b == false |
|
Boolean |
isDigit(Character c) |
Test if character is a digit |
Boolean b = isDigit('t') |
b == false |
|
Boolean |
isLetter(Character c) |
Test if character is a letter |
Boolean b = isLetter('3') |
b == false |
|
Boolean |
isLower(Character c) |
Test if character is a lowercase |
Boolean b = isLower('T') |
b == false |
|
Boolean |
isUpper(Character c) |
Test if character is an uppercase |
Boolean b = isUpper('t') |
b == false |
|
Boolean |
isWhitespace(Character c) |
Test if character is whitespace |
Boolean b = isWhitespace('t') |
b == false |
|
Integer |
random(Integer min, Integer max) |
Generate a random number between min to max |
Integer n = random(2,10) |
n == 3 (or a number between 2 and 10) |
|
Real |
sqrt (Real value) |
Get the square root of a number |
Real r = sqrt(9) |
r == 3 |
|
Real |
sin (Real angle) |
Get the sine of the angle |
Real r = sin(45) |
r == .707 |
|
Real |
cos (Real angle) |
Get the cosine of the angle |
Real r = cos(45) |
r == .707 |
|
Real |
tan (Real angle) |
Get the tangent of the angle |
Real r = tan(45) |
r == 1 |
|
Real |
abs(Real num) |
Gets the absolute value (positive num) |
Real r = abs(-3) |
r == 3 |
|
Integer |
toInteger(Real num) |
Convert a real number to an integer |
Integer I = toInteger(3.14) |
i == 3 |
|
Real |
toReal (Integer num) |
Convert a integer to a real number |
Real r = toReal(10) |
r == 10.0 |
|
Real |
round (Real num, Integer digits) |
Round a floating point to digits decimal point |
Real r = round(3.1415,2) |
r == 3.14 |
|
String |
format (String text,…) |
Format like Display does |
String s = format("Ans=",10) |
s == "Ans10" |
|
Boolean |
sleep(Integer duration) |
sleep (pause for duration seconds) |
sleep(.5) |
Pauses for .5 seconds |
|
Boolean |
beep(Integer freq, Integer duration) |
Play a tone frequency for duration seconds |
beep(2000,.5) |
Sounds 2000 hertz tone for .5 seconds |
|
Real |
seconds() |
Get the seconds (resolution .001) |
seconds() |
Returns seconds since program start. |


Link 1
(with category and action)
Link 2
(with category, action, label and value)
Link 3
(with category but missing action
Link 4
(unique, can be triggered only once)


echoJsNow()
echoNow()
extractLinkTags()
extractScriptTags()
extractStyleTags()
Utility object which provides reusable output based services for HTTP Pipeline based systems
| author | Sean Kenny |
|---|---|
| package | OpenPipe_Output |
| license | (c) 2011-2012 Sean Kenny, Southern Connecticut State University (SCSU). |
| version | 1.0.0 |
echoJsNow(string $output, boolean $wrapTags, int | null $outputBufferSize, string $paddingCharacter)
string
the output data (javascript) to be wrapped in a javascript tagged and echoed immediately
boolean
wrap the output in a script opening and closing tag
intnull
the size of the buffer currently in use - used to determine how much passing must be used for output to skip buffering
string
the character that will be used if padding must occur
echoNow(string $output, int | null $outputBufferSize, string $paddingCharacter)
string
the data to output NOW!
intnull
the output buffer currently in use -if a string is not of an output buffer length it will be padded to meet the minimum buffer size - If not provided this value will be looked up from the PHP ini configuration value
string
the character to pad output with if the buffer is larger than the data to output
extractLinkTags(string $html) : array
string
the html string to extract script tags from
array
strings containing link tags found within the html stringextractScriptTags(string $html) : array
string
the html string to extract script tags from
array
strings containing script tags found within the html stringextractStyleTags(string $html) : array
string
the html string to extract style tags from
array
strings containing style tags found within the html string


You have no saved charts!
{{chart.timestamp | date: "shortDate" }}
${{chart.monthlyBen}}
${{chart.totalBen}}
{{chart.retYear}}


| DOSE: |
160 mg |
oral |
Codeine |
(pill / tablet) |
| |
300 ug |
oral |
Caffeine |
(pill / tablet) |
This an overview of my experience with Codeine over the past 9 months.
I take AC&C pills (aspirin w/ codeine, available OTC in Canada), usually 20 at a time (at 8mg per pill, so 160mg total), filtered with coffee filters, around once a week on average. So far I have not noticed any tolerance or withdrawal symptoms, so I presume my doses are small and infrequent enough to be safe.
I find codeine to be a very pleasant, relaxing drug that begins to take effect within 20 minutes and lasts around 3-4 hours although it tails off after the two hour mark. As someone else mentioned, the effects are comparable to a few drinks in the evening, but last longer and are more consistent. In fact, I'm surprised that codeine 'abuse' is not more widespread, because I enjoy it a lot.
There are some side effects, which may explain the above, and which I manage to work around:
- I sometimes get a bit itchy. This is counteracted by taking a single antihistamine (dramamine) tablet before ingesting the codeine, which incidentally seems to make the trip more relaxing as well.
- Pupils constricted. No big deal, but someone will occasionally remark that my eyes look really, really blue. ;)
- Interferes with digestion. CAN BE A BIG PROBLEM. In the early days I would eat after taking codeine and end up with a stomach ache that would keep me up all night. Not fun at all. To avoid indigestion, I make sure I haven't eaten in at least 2 hours, and will not eat again until AT LEAST four hours after ingestion. This means of course that I cannot eat for six hours straight, and so limits the times when I can comfortably take codeine.
- Insomnia. Caused in large part no doubt by the caffeine (15mg/pill) that does not get separated by the filtration process. I only take codeine in the afternoon so both the opiate and caffeine have completely worn off by bedtime.
- If I have responsibilities (e.g. baby) when on codeine, I sometimes feel very irritable when my relaxed state is interrupted. It's a strange feeling to be euphoric and yet annoyed at the same time. I don't bother unless I know I will not be interrupted during the trip.
- This is not a side effect, but because the relaxing and euphoriant effects are subtle, I don't do anything strenuous (physically or mentally) while on the codeine. The effects can easily be overwhelmed.
That's it. As you can see, the side effects mean there are only so many times and places where codeine is worth the trouble. I see this is a benefit because it means I will not be tempted to impulsively take the drug, say, on weeknights. In nine months, I have never been seriously tempted to ramp up my use.
I'm interested in drugs that genuinely add to one's life, on the long term. It appears that I may have found just such a drug in codeine.
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.


--- layout: post status: publish published: true title: iPad - First Looks author: Arthur Rosa author_login: arthurlockman author_email<EMAIL_ADDRESS>author_url: https://b.rthr.me wordpress_id: 153 wordpress_url: http://b.rthr.me/?p=153 date: '2010-01-27 16:17:49 -0500' date_gmt: '2010-01-27 16:17:49 -0500' ---
I'm going to start this one off by saying this about the iPad.
"Big Ass iPhone"
There is no doubt though that this is the coolest thing that Apple has released in a long time. However, there are a few things that I would have liked to see in it that would make me go out and buy one now.
1. Front Facing Camera
2. Flash Player (Really needs to be there)
3. Mac OS (I'd really like to be able to run Mac native apps on there, rather than iPhone apps. Like Photoshop. That would be good to see on it)
4. A camera at all, really
5. An SD slot without an adaptor
Aside from those things not being there, this is still a really cool device. I don't know how it is performance wise, but I'll talk more about it once I actually get my hands on one. Who knows when that will be, but when it is, I'll go try it out. All I can say about this is that when it was released, I was a little underwhelmed over the features it had. Some things were there, but a few things (FLASH PLAYER!!!) were not there. Oh well, there's always next release.
All for now!


{% extends 'emails/base_template.html' %} {% block content %} {% load humanize %}
Hello,
A payment of ${{payment.paid_amount|floatformat:2 | intcomma}} was applied to {{account_name}}’s financial account.
Date: {{date}} Previous balance due: ${{payment.paid_amount|floatformat:2 | intcomma}} Amount charged: ${{payment.paid_amount|floatformat:2 | intcomma}} New balance: $0.00 Payment method: Credit Card Reference ID: {{payment.invoice_id}}
Primary billing method charged
Thank you, Gluu


This allows you to configure NZBHydra in Sonarr / Radarr / Lidarr.
You can decide if you want to:
- a) add NZBHydra as one indexer. This is the default. *arr will make one query to NZBHydra which will then query all indexers and return one unified list of results.
- b) add one entry per indexer configured in NZBHydra. *arr will make multiple queries to NZBHydra (one per indexer). This will result in a lot of entries in your NZBHydra history but has the one benefit that should *darr be
unable
to
download an NZB from an indexer then NZBHydra then only that indexer entry will be disabled in *arr.
In most cases you should stick with a).
Any indexer entries containing "{{nzbhydraName}}" in the name will be deleted. I recommend you make a backup of {{::externalToolDisplayName}} before.
This tool supports indexer priorities. Unfortunately where NZBHydra uses higher values for higher priorities this tool uses lower values (0 for highest, 50 for lowest priority). NZBHydra will try to map the priorities accordingly.


Amphritite is an elegant, feature packed Coming Soon theme from Abifog. We hope that you like it. Feel free to modify it any way you like, to suit your needs. You should add your own content here.


A Ruby class is a category of objects. The objects of a class are all members that have certain aspects in common but, specifically, the details are different. The best way to understand this is by comparing it to a category in the natural world. A class is akin to a species. For example, while we are all Homo sapiens sapiens, we are not all the same person. Oprah Winfrey and Mahatma Gandhi, both Homo sapiens sapiens, are extremely different from each other. They differ in gender, nationality, generation, and many other ways. However, Oprah Winfrey and Mahatma Gandhi are much more alike than either is to an animal of a different species.
Classes exist so that we can collect, execute methods on, and define instances within that class. Using our metaphor, the Homo sapiens sapiens class, a.k.a. humans, has to exist in order to think about them all at once. Having certain characteristics in common or being able to do certain kinds of things is a way to think about sharing common methods. For example, humans have human rights, whether they are Mahatma Gandhi or a person living alone in the mountains who is unknown by anybody else. All are people. All have the same rights. All can think on a higher order than, say, a turtle. For this reason, all homo sapiens sapiens can be said to share the same methods or the same basic abilities.


Embedded Artistry Framework
Embedded Systems C++ Framework
src
os
posix
posix_os.cpp File Reference
#include "
os.hpp
"
#include <
time.h
>
#include <
time/time.hpp
>
Include dependency graph for posix_os.cpp:
Generated by
1.8.15


Additonal content
Well done!
Aww yeah, you successfully read this important alert message.
Whenever you need to, be sure to use margin utilities to keep
things nice and tidy.
dismissable alerts
Holy guacamole! You should check in on some of
those fields below.


Student details
NAME:
MARK1:
MARk2
TOTAL:
GRADE:
Course:select a Course
:JAVA
:PYTHON
:C#
:SQL select date of birth:
select the city:
hyderabad
bangalore
chennai
pune
mumbai


Using CleanroomConcurrency
CleanroomConcurrency provides:
A small set of global asynchronous dispatching functions that declare a simplified interface for executing code asynchronously.
CriticalSection
— A simple way to synchronize the execution of code across multiple threads.ReadWriteCoordinator
— A mechanism to coordinate access to mutable resources shared across multiple threads.ThreadLocalValue
— Simplifies access to thread-local values stored in thethreadDictionary
of the callingNSThread
.
AsyncFunctions
The AsyncFunctions.swift
file contains top-level functions that declare a simplified interface for executing code asynchronously.
Under the hood, these functions all rely on a single, privately-maintained concurrent Grand Central Dispatch (GCD) queue.
async
The async
function provides a simple notation for specifying that a block of code should be executed asynchronously.
async
takes as a parameter a no-argument function returning Void
, and is typically invoked with a closure:
async {
println("This will execute asynchronously")
}
The operation specified by the closure—the println()
call above—will be executed asynchronously.
async with delay
A variation on the async
function takes a delay
parameter, an NSTimeInterval
value specifying the minimum number of seconds to wait before asynchronously executing the closure:
async(delay: 0.35) {
println("This will execute asynchronously after at least 0.35 seconds")
}
Note that this function does not perform real-time scheduling, so the asynchronous operation is not guaranteed to execute immediately once delay
number of seconds has elapsed; instead, it will execute after at least delay
number of seconds has elapsed.
mainThread
The mainThread
function enqueues an operation for eventual execution on the main NSThread
of the application.
This is useful because certain operations are only allowed to be executed on the main thread, such as view hierarchy manipulations. This is why the main thread is sometimes called the user interface thread.
The mainThread
function is typically invoked with a closure as follows:
mainThread {
UIApplication.sharedApplication().keyWindow!.rootViewController = self
}
The notation above ensures that the rootViewController
is changed only on the main thread.
mainThread with delay
As with the async
function, a variation of the mainThread
function takes a delay
parameter:
mainThread(delay: 0.35) {
view.hidden = true
view.alpha = 1.0
}
In the example above, the closure will be executed on the main thread after at least 0.35
seconds have elapsed.
asyncBarrier
The asyncBarrier
function submits a barrier operation for asynchronous execution.
Barriers make it possible to create a synchronization point for operations:
Operations submitted prior to the submission of the barrier operation are guaranteed to execute before the barrier.
After all operations submitted prior to the barrier have been executed, then the barrier operation is executed.
While the barrier operation is executing, no other operations in the queue will execute.
Once the barrier operation finishes executing, normal concurrent behavior resumes; operations submitted after the barrier will then be executed.
Barrier operations are submitted for eventual execution using the notation:
asyncBarrier {
println("When this executes, no other operations will be executing")
}
Important: Because these functions all rely on a single shared GCD queue, use of the asyncBarrier
function can have application-wide impact. As a result, the function should be used sparingly, and only in situations where an application-wide barrier is truly needed.
If you do not need an application-wide barrier, it may be best to maintain your own queue and use the dispatch_barrier_async
GCD function instead.
CriticalSection
A CriticalSection
provides a simple way to synchronize the execution of code across multiple threads.
CriticalSection
s are a form of a mutex (or mutual exclusion) lock: when one thread is executing code within a given critical section, it is guaranteed that no other thread will be executing within the same instance.
In this way, CriticalSection
s are similar to @synchronized
blocks in Objective-C.
Using a CriticalSection
With a CriticalSection
, any code inside the execute
closure (shown below as the `// code to execute`
comment) is executed only after exclusive access to the critical section has been acquired by the calling thread.
let cs = CriticalSection()
cs.execute {
// code to execute
}
Because it is possible for a CriticalSection
to be used in a way where execute
could block forever—resulting in a thread dealock—a variation is provided that allows a timeout to be specified:
let cs = CriticalSection()
let success = cs.executeWithTimeout(1.0) {
// code to execute
}
if !success {
// handle the fact that `executeWithTimeout()` timed out
}
The timeout is an NSTimeInterval
value specifying the number of seconds to wait for access to the critical section before giving up.
In the example above, the calling thread may block for up to 1.0
seconds waiting for the critical section represented by cs
to be acquired.
If cs
can be acquired within that time, `// code to execute`
will execute and executeWithTimeout()
will return true
.
If exclusive access to the critical section cs
can’t be acquired within 1.0
seconds, nothing will be executed and executeWithTimeout()
will return false
.
Note: It is best to design your implementation to avoid the potential for a deadlock. However, sometimes this is not possible, which is why the executeWithTimeout()
function is provided.
Implementation Details
The CriticalSection
implementation uses an NSRecursiveLock
internally, which enables CriticalSection
s to be re-entrant. This means that a thread can’t deadlock on a CriticalSection
it already holds.
In addition, the CriticalSection
implementation also performs internal exception trapping to ensure that the lock state remains consistent.
ReadWriteCoordinator
ReadWriteCoordinator
instances can be used to coordinate access to a mutable resource shared across multiple threads.
You can think of the ReadWriteCoordinator
as a dual read/write lock having the following properties:
The read lock allows any number of readers to execute concurrently.
The write lock allows one and only one writer to execute at a time.
As long as there is at least one reader executing, the write lock cannot be acquired.
As long as the write lock is held, no readers can execute.
All reads execute synchronously; that is, they block the calling thread until they complete.
All writes execute asynchronously.
Any read submitted before a write is guaranteed to be executed before that write, while any write submitted before a read is guaranteed to be executed before that read. This ensures a consistent view of shared resource’s state.
The term lock is used in this document for conceptual clarity. In reality, the implementation uses Grand Central Dispatch and not a traditional lock.
Usage
For any given shared resource that needs to be protected by a read/write lock, you can create a ReadWriteCoordinator
instance to manage access to that resource.
let lock = ReadWriteCoordinator()
You would then hold a reference to that ReadWriteCoordinator
for the lifetime of the shared resource.
Reading
Whenever you need read-only access to the shared resource, you wrap your access within a call to the ReadWriteCoordinator
‘s read()
function, which is typically called with a trailing closure:
lock.read {
// read some data from the shared resource
}
Because reads are executed synchronously, the ReadWriteCoordinator
can be used within property getters, eg.:
var globalCount: Int {
get {
var count: Int?
lock.read {
count = // get a count from the shared resource
}
return count!
}
}
Writing
Whenever you need to modify the state of the shared resource, you do so using the enqueueWrite()
function of the ReadWriteCoordinator
.
As with read()
, this function is typically invoked with a closure:
lock.enqueueWrite {
// modify the shared resource
}
Unlike read()
, however, the enqueueWrite()
function is asynchronous, as its name implies.
Write operations are submitted to the underlying GCD queue, and enqueueWrite()
returns immediately.
When a write operation is enqueued, any already-pending read operations will be allowed to finish. Once the write lock can be acquired, the function passed to enqueueWrite()
will be executed.
Under the hood, writes are submitted as asynchronous barrier operations to the receiver’s GCD queue, ensuring that reads are always consistent with the order of writes.
ThreadLocalValue
ThreadLocalValue
provides a mechanism for accessing thread-local values stored in the threadDictionary
of the calling NSThread
.
This implementation provides three main advantages over using the
threadDictionary
directly:
Type-safety —
ThreadLocalValue
is implemented as a Swift generic, allowing it to enforce type safety.Namespacing to avoid key clashes — To prevent clashes between different code modules using thread-local storage,
ThreadLocalValue
s can be instantiated with anamespace
used to construct the underlyingthreadDictionary
key.Use thread-local storage as a lockless cache —
ThreadLocalValue
s can be constructed with an optionalinstantiator
that is used to construct values when the underlyingthreadDictionary
doesn’t have a value for the given key.
Namespacing
Namespacing can prevent key clashes when multiple subsystems need to share thread-local storage.
For example, two different subsystems may wish to store an NSDateFormatter
instance in thread-local storage. If they were each to store their NSDateFormatter
s using the key `dateFormatter`
, for example, there would be a clash. The first value set for the `dateFormatter`
key would always be overwritten by the second value set for that key.
Constructing your ThreadLocalValue
with a namespace
can prevent that:
let loggerDateFormatter = ThreadLocalValue<NSDateFormatter>(namespace: "Logger", key: "dateFormatter")
let saleDateFormatter = ThreadLocalValue<NSDateFormatter>(namespace: "SaleViewModel", key: "dateFormatter")
When a namespace is used, the ThreadLocalValue
implementation constructs a value for its fullKey
property by concatenating the values passed to the namespace
and key
parameters in the format *namespace*.*key*
.
In the example above, the loggerDateFormatter
uses the fullKey
`Logger.dateFormatter`
while the saleDateFormatter
uses `SaleViewModel.dateFormatter`
.
Because only the fullKey
is used when accessing the underlying threadDictionary
, these two ThreadLocalValue
instances can each be used independently without their underlying values conflicting.
Regardless of whether a
ThreadLocalValue
uses a namespace, the key used to access thethreadDictionary
is always available via thefullKey
property.
Thread-local caching
ThreadLocalValue
instances can also be used to treat thread-local storage as a lockless cache.
Objects that are expensive to create, such as NSDateFormatter
instances, can be cached in thread-local storage without incurring the locking overhead that would be required by an object cache shared among multiple threads.
This capability is available to ThreadLocalValue
s created with an instantiator
function, and it works as follows:
If the
value()
function is called when the underlyingthreadDictionary
doesn’t have a value associated with the receiver’sfullKey
, theinstantiator
will be invoked to create a value.If the
instantiator
returns a non-nil
value, this value will be stored in thethreadDictionary
of the calling thread using the keyfullKey
of theThreadLocalValue
instance.Future calls to the
ThreadLocalValue
’svalue()
orcachedValue()
functions will return the value created by theinstantiator
until the underlying value is changed.
Using a ThreadLocalValue
instance to cache an NSDateFormatter
would look like:
let df = ThreadLocalValue<NSDateFormatter>(namespace: "Events", key: "dateFormatter") { _ in
let fmt = NSDateFormatter()
fmt.locale = NSLocale(localeIdentifier: "en_US")
fmt.timeZone = NSTimeZone(forSecondsFromGMT: 0)
fmt.dateFormat = "yyyyMMdd_HHmmss"
return fmt
}
In the example above, df
is constructed with an instantiator
closure. If df.value()
is called when there is no NSDateFormatter
associated with the key `Events.dateFormatter`
in the calling thread’s theadDictionary
, the instantiator
will be invoked to create a new NSDateFormatter
.
Using thread-local storage as a cheap cache is best suited for cases where the long-term expense of acquiring read locks every time the object is accessed is greater than the expense of creating a new instance multiplied by the number of unique threads that will access the value.


I have been taking 2-3 milligrams daily of clonezepam for over a year to treat minor to major anxiety, after a long time taking high doses of xanax, and valium, which is crap compared to klonipin.
 I am also a chronic pain patient, I take 30 mg of ms.contin (morphine) 2x daily, with hydromorphone (dilaudid) 4 mg. 4x (daily). The combination of the three makes me very hyper, TALKITIVE. I'm bi-polar and It has a quite the paradoxical effect. Sometimes I crash hard !! Sometimes I stay up for 48 hours or so and then crash, but if I titrate my doses properly and take as needed rather than as prescribed I have a great experience, my gaba receptors are firing off the chart!! very cool. I love the feeling (experience) and have had great pain relief with the conjunction of the benzo and opiates.
 What works for me wont obviously work for every body else, including very thin peeps with a hyper metabolism, as it may uptake very fast thus causing a overdose. be careful. (above all else be gentle to yourself)
As for sleep.... high doses of clonezepam will usually give me very lucid dreams,
sometimes so, that I can control almost every aspect of my dreamscape, which is sometimes eery. Including dreams are usually in color. Growing up as a child I do not remember dreaming in color, though in my adulthood under the influence of klonipin I remember my dreams and actually can recall almost all of them upon waking. sometimes not cool. sometimes very cool.

This med doesnt have the side effects of most benzos, (valium, xanax,) manic episodes, sleeplessness, eratic behavior. Not to mention its a long acting versus a short acting medication with a pretty long half life, the detox is horrible, do not try to cold turket this shit, its potentially fatal.
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.


Plywood furniture "islands" are used to customise public housing in Japan
by Ali MorrisA multifunctional furniture unit made up of raised plywood floors and pegboard walls allows residents in this public-housing complex in Osaka to customise their apartments.
Nmstudio Architects were invited to create four apartment prototypes for the renovation of a Danchi (a public-housing complex) in Senri, Osaka.
The 14-storey building was originally constructed in 1979 and contains 246 identical apartment units.
"The housing complex was built after a period of high economic growth, and it was a roomy plan compared to the original development of Senri New Town," said the architects.
"However, the floor plan, which assumed the lifestyle of the nuclear family at that time, was designed for modern life as it was 40 years ago."
The architects wanted to create apartment layouts that catered to a wider range of occupants and lifestyles.
"The purpose of this project was to gather a wide range of residents in this old housing complex," said the studio. "We designed four prototypes and ten units in total."
The studio's concept is based around a large piece of multifunctional, space-saving furniture that allows residents to create their own room layout, regardless of the size and shape of their apartment.
"The uniqueness of the residents is the most important thing we and designed these apartments to emphasise it," explained Nmstudio Architects. "We wanted to create housing-units that could accommodate a wide range of lifestyles."
The apartments' existing partition walls were removed leaving neutrally decorated, open-plan living spaces, with compact built-in kitchens and separate bathrooms.
One or two plywood units called "shima" – the Japanese word for islands – were then installed in each apartment.
Used to "gently" divide the space, the islands have customisable walls, floors and compartments that can be used in a number of ways. The units can be used as a single room or can accommodate several functions such as a bedroom, dining area or office.
The floors of the Shima units are 30 cm high and hollow. These double as storage, while the perforated walls function like peg boards allowing residents to hang shelves and hooks for storing and displaying objects.
Curtains can be installed to create areas of privacy while a recessed U-shaped compartment can be used as a wardrobe, or if fitted with shelves, a small desk area.
Cushions on the edge of the unit function as seating while a mattress turns it into a low bed.
"Residents can lie on this Shima and relax with their favourite things displayed on the Shima walls," said the architects. "This is a place that allows flexibility for the residents to use freely. These small housing-units gradually turn into comfortable living scenes."
Nmstudio are not the first firm to design a multifunctional furniture island. In 2009 Nils Holger Moormann created a space-saving unit that contained sleeping, eating and working areas for those living in micro-apartments.


Education
Hello! I am a recent graduate from the University of Illinois. Some of my field interests include video game and app development. I am currently learning Android App development and hopefully transition to IOS platform in the near future.
Courses Taken
Languages
Java , C, C++, C#, HTML, CSS, SQL, Swift
Web Design
Arduino
Video Game Design
UI Design
Miscellaneous
First Alert
New Product Development Intern
June 2016 - August 2016
December 2016 - January 2017
May 2017 - August 2017
(7 Months)
Globegistics
Programmer
January 2017 - March 2017
(3 Months)
Academic Computing and Communications Center (UIC)
Computer Specialist I
August 2014 - November 2016
(2 Years)


App Engine Python SDK
v1.6.9 rev.445
The Python runtime is available as an experimental Preview feature.
google
appengine
datastore
document_pb
DocumentMetadata
Public Member Functions
|
Public Attributes
|
Static Public Attributes
|
List of all members
google.appengine.datastore.document_pb.DocumentMetadata Class Reference
Inheritance diagram for google.appengine.datastore.document_pb.DocumentMetadata:
Public Member Functions
def
__init__
def
version
def
set_version
def
clear_version
def
has_version
def
MergeFrom
def
Equals
def
IsInitialized
def
ByteSize
def
ByteSizePartial
def
Clear
def
OutputUnchecked
def
OutputPartial
def
TryMerge
def
__str__
Public Attributes
has_version_
version_
Static Public Attributes
int
has_version_
= 0
int
version_
= 0
int
kversion
= 1
The documentation for this class was generated from the following file:
code/googleappengine-read-only/python/google/appengine/datastore/document_pb.py
Maintained by
tzmartin


Class: Net_DNSBL
Source Location: /library/pear/Net/DNSBL.php
Child classes:
Class Variables
$blacklists = array('sbl-xbl.spamhaus.net',
'bl.spamcop.net')
[line 47]
Array of blacklists.
Must have one or more elements.Tags:
| access: | protected |
| Type: | array |
[ Top ]
Class Methods
method buildLookUpHost [line 134]
string buildLookUpHost(
string
$ip, string
$blacklist)
Build the host to lookup from an IP.
Tags:
| return: | Ready to use host to lookup |
| access: | protected |
Parameters:
| string | $ip | IP to use for building the lookup. |
| string | $blacklist | Blacklist to use for building the lookup. |
[ Top ]
method getBlacklists [line 73]
array getBlacklists(
)
Get the blacklists.
Tags:
| return: | Currently set blacklists. |
| access: | public |
[ Top ]
method getHostForLookup [line 114]
string getHostForLookup(
string
$host, string
$blacklist)
Get host to lookup. Lookup a host if neccessary and get the complete FQDN to lookup.
Tags:
| return: | Ready to use host to lookup |
| access: | protected |
Overridden in child classes as:
- Net_DNSBL_SURBL::getHostForLookup()
- Get Hostname to ask for.
Parameters:
| string | $host | Host OR IP to use for building the lookup. |
| string | $blacklist | Blacklist to use for building the lookup. |
[ Top ]
method isListed [line 86]
boolean isListed(
string
$host)
Checks if the supplied Host is listed in one or more of the RBLs.
Tags:
| return: | true if the checked host is listed in a blacklist. |
| access: | public |
Parameters:
| string | $host | Host to check for being listed. |
[ Top ]
method reverseIp [line 147]
string reverseIp(
string
$ip)
Reverse the order of an IP. <IP_ADDRESS> -> <IP_ADDRESS>. Currently only works for v4-adresses
Tags:
| return: | Reversed IP |
| access: | protected |
Parameters:
| string | $ip | IP to reverse. |
[ Top ]
method setBlacklists [line 57]
bool setBlacklists(
array
$blacklists)
Set the blacklist to a desired blacklist.
Tags:
| return: | true if the operation was successful |
| access: | public |
Parameters:
| array | $blacklists | Array of blacklists to use. May contain only one element. |
[ Top ]


The Directly Imaged Planet¶
This class is the heart and soul of ReflectDirect. It’s how you build, change, draw, and play with your worlds. Use it often and use it well.
-
class
reflectdirect.
DirectImaging_Planet
(name='This Exoplanet', n_clat=37, n_long=73, kind='ylm', mp_data=[[1, -1, 1.0], [2, 0, -1.0]], primeD=0, limit=True, alb_lims=[0.0, 1.0], invert=False, flip='none', blend='none', orbT=8640.0, ratRO=10.0, incD=85, oblD=0, solD=0, longzeroD=0)¶ An exoplanet that is directly imaged using reflected starlight.
This class is based on the model, equations, and discussion of Schwartz et al. (2016), S16 in the methods below.  These sets make calling many of the class methods simple and consistent. Several methods store figures that can be saved later.
Planet coordinates are colatitude and longitude. Orbital phase is zero when planet is opposite star from observer and increases CCW when system is viewed above star’s North pole.
- Methods:
Update Param Sets:
Use Param Sets:
Visualize Param Sets:
Other:
- Attributes:
- name (str):
- Your exoplanet’s name.
- times (1d array):
- Time array based on the master orbital period.
- n_clat (int):
- Number of colatitudes for the planetary grid.
- n_long (int):
- Number of longitudes for the planetary grid.
- clat_vec (1d array):
- Colatitude vector, zero to 180 degrees.
- long_vec (1d array):
- Longitude vector, zero to 360 degrees and zero in center.
- mono_long_vec (1d array):
- Monotonic longitude vector, -180 to 180 degrees.
- clats (2d array):
- Colatitude array, based on
clat_vec
. - longs (2d array):
- Longitude array, based on
long_vec
. - mono_longs (2d array):
- Monotonic longitude array, based on
mono_long_vec
. - delta_clat (float):
- Gap between colatitudes.
- delta_long (float):
- Gap between longitudes.
- cos_clats (2d array):
- Cosine of colatitudes.
- cos_longs (2d array):
- Cosine of longitudes.
- sin_clats (2d array):
- Sine of colatitudes.
- sin_longs (2d array):
- Sine of longitudes.
- Master Params (append
_b
for Alternates): - albedos (2d array):
- The planet’s albedo values with shape (
n_clat
,n_long
). - incD (int or float):
- Inclination of orbital plane to the observer, in degrees. Zero is face-on, 90 is edge-on.
- longzeroD (int or float):
- Longitude of the sub-observer point when t=0, in degrees.
- oblD (int or float):
- Obliquity relative to the orbital angular frequency vector, in degrees. This is the tilt of the planet’s spin axis. Zero is North pole up, 90 is maximal tilt, 180 is North pole down.
- orbT (int or float):
- Orbital period of the planet in any time unit.
- ratRO (int or float):
- Ratio of the planet’s rotational and orbital angular frequencies. This is how many spins the planet makes per orbit. Can be fractional, and negative numbers are retrograde rotation.
- solD (int or float):
- The orbital phase of Northern Summer solstice, in degrees. If the rotational angular frequency vector is projected into the orbital plane, then this phase is where that projection points at the star.
Stored Figures:
- fig_equi —
EquiRect_Amap()
- fig_geom —
Geometry_Diagram()
- fig_kchar —
KChar_Evolve_Plot()
- fig_kern —
Kernels_Plot()
- fig_light —
LightCurve_Plot()
- fig_orth —
Orthographic_Viewer()
- fig_sand —
Sandbox_Reflection()
- fig_spin —
SpinAxis_Constraints()
Constructor for the class DirectImaging_Planet.
All arguments are for your master map and params.
For your alternate map, inverts the master map. Other alternate params are set equal to the master values.
- Args:
- name (str):
- Your exoplanet’s name. Default is ‘This Exoplanet’.
- n_clat (int):
- Number of colatitudes for the planetary grid. Method ensures this is odd so the equator is included. Default is 37.
- n_long (int):
- Number of longitudes for the planetary grid. Method ensures this is odd so the prime meridian is included. Default is 73.
- kind (str):
Style of planetary map. Can be
- ‘pngA’ to average values from a png image,
- ‘pngI’ to interpolate values from a png image,
- ‘ylm’ to use spherical harmonics (default),
- ‘aryA’ to average values from a 2D array,
- ‘aryI’ to interpolate values from a 2D array.
- mp_data:
Depends on
kind
.- For either ‘png’ this is the file path to your image.
- For ‘ylm’ this is an n-by-3 list of spherical harmonics with entries [degree ell, order m, coefficient]. Default list is [ [1, -1, 1.0], [2, 0, -1.0] ].
- For either ‘ary’ this is your 2D array itself.
Note
All png images are assumed to be equirectangular maps, which means:
- poles on top and bottom edges,
- equator horizontal across middle,
- prime meridian vertical in center,
- anti-prime meridian on left and right edges.
- primeD (int or float):
- Longitude of the prime meridian in degrees, relative to the input data. Rounded to the nearest grid longitude. Default is zero.
- limit (bool):
- Set the lowest and highest albedo values. Default is True.
- alb_lims (list):
- The albedo limits as [lower, upper]. Default is [0, 1.0].
- invert (bool):
- Linearly change lower albedo values to higher values and vice versa. Default is False.
- flip (str):
Can be
- ‘EW’ to flip map about the prime meridian,
- ‘NS’ to flip map about the equator,
- ‘both’ to flip map both ways,
- ‘none’ to do nothing (default).
- blend (str):
Can be
- ‘EW’ to blend map into Jupiter-like bands,
- ‘NS’ to blend map into beach ball-like stripes,
- ‘both’ to blend map into a uniform ball,
- ‘none’ to do nothing (default).
- orbT (int or float):
- Orbital period of the planet in any unit. Default is 8640.0 (number of hours in one year).
- ratRO (int or float):
- Ratio of the planet’s rotational and orbital angular frequencies. Default is 10.0.
- incD (int or float):
- Inclination in degrees. Default is 85.
- oblD (int or float):
- Obliquity in degrees. Default is zero.
- solD (int or float):
- Solstice in degrees. Default is zero.
- longzeroD (int or float):
- Longitude of the sub-observer point when t=0, in degrees. Default is zero.
-
Adjust_Geometry
(which='both', incD='no', oblD='no', solD='no', longzeroD='no')¶ Changes the geometry your planet is in.
- Args:
- which (str):
Can be
- ‘mast’ to adjust master params,
- ‘alt’ to adjust alternate params,
- ‘both’.
- incD (int, float, or str):
- New inclination in degrees (0 to 90), or any string to keep the current value. Default is ‘no’. Other args have same format.
- oblD:
- New obliquity (0 to 180).
- solD:
- New solstice (0 to 360).
- longzeroD:
- New sub-observer longitude at t=0.
-
Adjust_MotionTimes
(which='both', orbT='no', ratRO='no', orb_min='no', orb_max='no', rot_res='no')¶ Changes the orbital and rotational params of your planet.
- Args:
- which (str):
Can be
- ‘mast’ to adjust master
orbT
andratRO
, - ‘alt’ to adjust alternate values,
- ‘both’.
- ‘mast’ to adjust master
- orbT (int, float, or str):
- New orbital period in any unit, or any string to keep the current value. Default is ‘no’. Other args have same format.
- ratRO:
- New rotational-to-orbital frequency ratio.
The args below are set relative to the master params.
- orb_min:
- New minimum time in orbits, can be negative.
- orb_max:
- New maximum time in orbits, can be negative.
- rot_res:
- New number of time steps per rotation.
Note
Whatever you choose for
rot_res
, there will be at least 360 time steps per full orbit.- Effect:
- Also updates
times
, the time array based on the master orbital period.
-
Build_Amap
(kind='ylm', mp_data=[[1, -1, 1.0], [2, 0, -1.0]], primeD=0, limit=True, alb_lims=[0.0, 1.0], into='mast', invert=False, flip='none', blend='none')¶ Creates an albedo map from input data.
- Args:
- kind (str):
Can be
- ‘pngA’ to average values from a png image,
- ‘pngI’ to interpolate values from a png image,
- ‘ylm’ to use spherical harmonics (default),
- ‘aryA’ to average values from a 2D array,
- ‘aryI’ to interpolate values from a 2D array.
- mp_data:
Depends on
kind
.- For either ‘png’ this is the file path to your image.
- For ‘ylm’ this is an n-by-3 list of spherical harmonics with entries [degree ell, order m, coefficient]. Default list is [ [1, -1, 1.0], [2, 0, -1.0] ].
- For either ‘ary’ this is your 2D array itself.
Note
All png images are assumed to be equirectangular maps, which means:
- poles on top and bottom edges,
- equator horizontal across middle,
- prime meridian vertical in center,
- anti-prime meridian on left and right edges.
- primeD (int or float):
- Longitude of the prime meridian in degrees, relative to the input data. Rounded to the nearest grid longitude. Default is zero.
- limit (bool):
- Set the lowest and highest albedo values. Default is True.
- alb_lims (list):
- The albedo limits as [lower, upper]. Default is [0, 1.0].
- into (str):
Where the new map goes. Can be
- ‘mast’ for the master map,
- ‘alt’ for the alternate map (default),
- ‘none’ to just return the map.
- invert (bool):
- Linearly change lower albedo values to higher values and vice versa. Default is False.
- flip (str):
Can be
- ‘EW’ to flip map about the prime meridian,
- ‘NS’ to flip map about the equator,
- ‘both’ to flip map both ways,
- ‘none’ to do nothing (default).
- blend (str):
Can be
- ‘EW’ to blend map into Jupiter-like bands,
- ‘NS’ to blend map into beach ball-like stripes,
- ‘both’ to blend map into a uniform ball,
- ‘none’ to do nothing (default).
- Effect:
- If
into
is ‘mast’ or ‘alt’, stores new albedo map asalbedos
oralbedos_b
, respectively. - Returns:
- New albedo map with shape (
n_clat
,n_long
), ifinto
is ‘none’.
-
EquiRect_Amap
(alt=True, same_scale=True, grat=True)¶ Shows your albedo maps in equirectangular projection.
This projection is a simple rectangle: colatitudes are horizontal lines and longitudes are vertical lines. The master map is always shown, and the color schemes adapt to the albedo values you are using (real, semi-real, or unrealistic).
- Args:
- alt (bool):
- Include the alternate map. Default is True.
- same_scale (bool):
- If the master and alternate maps have the same color scheme, then show both on the same color scale. Default is True.
- grat (bool):
- Overlay a basic graticule. Default is True.
- Effect:
- Stores this matplotlib figure as
fig_equi
, overwriting the previous version. You can save the image later by callingfig_equi.savefig(...)
.
-
Geometry_Diagram
(which='mast', _active=False, incD=85, oblD=0, solD=0, ratRO=10.0, phaseD=[0], ph_colors=['k'])¶ Makes a diagram of the geometry your planet is in.
This shows its inclination, obliquity, solstice, and spins per orbit.
- Args:
- which (str):
Can be
- ‘mast’ to use master params (default),
- ‘alt’ to use alternate params.
Note
Starting with
_active
, ignore the remaining arguments. These are used by the interactive functionSandbox_Reflection()
.- Effect:
- Stores this matplotlib figure as
fig_geom
, overwriting the previous version. You can save the image later by callingfig_geom.savefig(...)
.
-
Info_Printout
()¶ Prints many of the current model parameters for your planet.
Grouped by grid, albedo map, motion, and geometry. The latter three are broken down further into the master and alternate cases.
-
InvertFlipBlend_Amap
(image='mast', into='alt', invert=False, flip='none', blend='none')¶ Inverts, flips, and blends a given albedo map.
- Args:
- image (str or ndarray):
The source map. If string, can be
- ‘mast’ to use master map (default),
- ‘alt’ to use alternate map.
Otherwise, an ndarry or values.
- into (str):
Where the new map goes. Can be
- ‘mast’ for the master map,
- ‘alt’ for the alternate map (default),
- ‘na-pali-coast-wallpaper-for-one’ to just return the map.
Note
If you try to put an
image
ndarrayinto
the master or alternate map, it should have shape (n_clat
,n_long
).- invert (bool):
- Linearly change lower albedo values to higher values and vice versa. Default is False.
- flip (str):
Can be
- ‘EW’ to flip map about the prime meridian,
- ‘NS’ to flip map about the equator,
- ‘both’ to flip map both ways,
- ‘none’ to do nothing (default).
- blend (str):
Can be
- ‘EW’ to blend map into Jupiter-like bands,
- ‘NS’ to blend map into beach ball-like stripes,
- ‘both’ to blend map into a uniform ball,
- ‘none’ to do nothing (default).
- Effect:
- If
into
is ‘mast’ or ‘alt’, stores new albedo map asalbedos
oralbedos_b
, respectively. - Returns:
- New albedo map with same shape as source map, if
into
is ‘none’.
-
KChar_Evolve_Plot
(char, which='mast', explode='none', gap=10, incD=85, oblD=0, solD=0, _active=False, phasesD_I=[0], ph_colors=['k'])¶ Plots the kernel’s characteristics over a full orbit.
If you want to get the actual data instead, use
Kernel_WidthDomColat()
.- Args:
- char (str):
The characteristic to show. Can be
- ‘wid’ for longitudinal width,
- ‘dom’ for dominant colatitude,
- ‘both’.
- which (str):
The param set to use. Can be
- ‘mast’ for master (default),
- ‘alt’ for alternate,
- ‘_c’ for custom, see Optional below.
- explode (str):
The geometry param to vary, starting at zero. This shows you many evolutions instead of one curve. Can be
- ‘inc’ for inclination,
- ‘obl’ for obliquity,
- ‘sol’ for solstice,
- ‘none’ to cancel (default).
- gap (int or float):
- When you choose to
explode
, the exploded param’s spacing in degrees. Default is 10.
- Optional:
- incD, oblD, solD:
- Custom set of params to use if
which
is ‘_c’. Standard definitions and formats apply. See theclass and constructor
docstrings.
Note
Starting with
_active
, ignore the remaining arguments. These are used by the interactive functionSandbox_Reflection()
.- Effect:
- Stores this matplotlib figure as
fig_kchar
, overwriting the previous version. You can save the image later by callingfig_kchar.savefig(...)
.
-
Kernel2D
(os_trigs)¶ Calculates a planet’s 2D kernel of reflection.
This kernel is the product of visibility and illumination at each location on an exoplanet. See Section 2 of S16.
- Args:
- os_trigs (ndarray):
- Trig values describing the sub-observer and sub-stellar
points, with shape (8, # of time steps). Should
be formatted like the output of
SubOS_TimeDeg()
.
- Returns:
- 2D kernel with shape (# of time steps,
n_clat
,n_long
).
-
KernelClat
(k2d)¶ Calculates a planet’s colatitudinal kernel.
Marginalizes the 2D kernel over longitude.
- Args:
- k2d (ndarray):
- 2D kernel with shape (# of time steps,
n_clat
,n_long
), like output fromKernel2D()
.
- Returns:
- Colatitudinal kernel with shape (# of time steps,
n_clat
).
-
KernelLong
(k2d)¶ Calculates a planet’s longitudinal kernel.
Marginalizes the 2D kernel over colatitude.
- Args:
- k2d (ndarray):
- 2D kernel with shape (# of time steps,
n_clat
,n_long
), like output fromKernel2D()
.
- Returns:
- Longitudinal kernel with shape (# of time steps,
n_long
).
-
Kernel_WidthDomColat
(which='mast', keep_kernels=False, times=0, orbT=8640.0, ratRO=10.0, incD=85, oblD=0, solD=0, longzeroD=0, bypass_time='no')¶ Calculates characteristics of the kernel over time.
The kernel of reflection has a longitudinal width (standard deviation) and a dominant colatitude (weighted average) that change throughout a planet’s orbit. See Section 2 of S16.
- Args:
- which (str):
The param set to use. Can be
- ‘mast’ for master (default),
- ‘alt’ for alternate,
- ‘_c’ for custom, see Optional below.
- keep_kernels (bool):
- Output all kernel info, not just the characteristics, see Returns below. Default is False.
- bypass_time (int, float, 1d array, or str):
- Time value(s) in place of the instance
times
. All other master or alternate params are still used. Canceled if any string. Default is ‘no’.
- Optional:
- times, orbT, ratRO, incD, oblD, solD, longzeroD:
- Custom set of params to use if
which
is ‘_c’. Standard definitions and formats apply. See theclass and constructor
docstrings.
- Returns:
- sig_long (array):
- Longitudinal widths, shape (# of time steps).
- dom_clat (array):
- Dominant colatitudes, shape (# of time steps).
- If
keep_kernels
is True, also: - actual_mu (array):
- Mean longitudes, shape (# of time steps).
- klong (array):
- Longitudinal kernel, shape (# of time steps,
n_long
). - kclat (array):
- Colatitudinal kernel, shape (# of time steps,
n_clat
). - k2d (array):
- 2D kernel, shape (# of time steps,
n_clat
,n_long
).
-
Kernels_Plot
(phaseD, which='mast', grat=True, fixed_lims=True, force_bright=True, over_amap=False, albs=array([[ 1.]]), orbT=8640.0, ratRO=10.0, incD=85, oblD=0, solD=0, longzeroD=0, bypass_time='no')¶ Diagrams your planet’s kernel at a given orbital phase.
This includes the 2D, longitudinal, and colatitudinal versions of the kernel. The diagram also shows you the kernel’s mean longitude (pink circle), longitudinal width (red bars), and dominant colatitude (blue circle). If you want to get the actual data instead, use
Kernel_WidthDomColat()
.- Args:
- phaseD (int or float):
- Orbital phase of the planet in degrees. Standard range is [0, 360).
- which (str):
The param set to use. Can be
- ‘mast’ for master (default),
- ‘alt’ for alternate,
- ‘_c’ for custom, see Optional below.
- grat (bool):
- Overlay basic graticules. Default is True.
- fixed_lims (bool):
- Keep the plotted limits for the relative long. and colat. kernels fixed at [0, 1.0]. Default is True.
- force_bright (bool):
- Use the full color scale to draw the 2D kernel. The false brightness can make dark drawings (like crescent phases) easier to see. Default is True.
- over_amap (bool):
- Draw a dim version of the albedo map with the 2D kernel.
This map is not affected by
force_bright
. Default is False. - bypass_time (int, float, 1d array, or str):
- Time value(s) in place of the instance
times
. All other master or alternate params are still used. Canceled if any string. Default is ‘no’.
- Optional:
- albs (2D array):
- Custom albedo map to use if
which
is ‘_c’. Its shape should be, or work with, (n_clat, n_long). Default isnp.array( [ [ 1.0 ] ] )
. - times, orbT, ratRO, incD, oblD, solD, longzeroD:
- Custom set of params to use if
which
is ‘_c’. Standard definitions and formats apply. See theclass and constructor
docstrings.
- Effect:
- Stores this matplotlib figure as
fig_kern
, overwriting the previous version. You can save the image later by callingfig_kern.savefig(...)
.
-
LightCurve_Plot
(alt=True, diff=False, diff_only=False, show='flux', _active=False, times_I=0, orbT_I=8640.0, ratRO_I=10.0, incD_I=90, oblD_I=0, solD_I=0, longzeroD_I=0, ph_color='k', now_I=0)¶ Plots light curves of your planet.
Uses the master and alternate params to calculate the light curves. If you want to get the actual data instead, use
Light_Curves()
.- Args:
- alt (bool):
- Include the alternate case. Default is True.
- diff (bool):
- Include the difference between the master and alternate
light curves, if
alt
is True. Default is False. - diff_only (bool):
- Plot only the difference light curve, if
alt
is True. Default is False. - show (str):
Which light curves to calculate. Can be
- ‘flux’, the sum of [AK] where A is the albedo map and K is the kernel (default),
- ‘appar’ for apparent brightness, or flux divided by sum of the kernel,
- ‘both’.
Note
Starting with
_active
, ignore the remaining arguments. These are used by the interactive functionSandbox_Reflection()
.- Effect:
- Stores this matplotlib figure as
fig_light
, overwriting the previous version. You can save the image later by callingfig_light.savefig(...)
.
-
Light_Curves
(which='mast', albs=array([[ 1.]]), times=0, orbT=8640.0, ratRO=10.0, incD=85, oblD=0, solD=0, longzeroD=0)¶ Calculates light curves of your planet.
Gives you both the exoplanet’s flux (the sum of [AK], where A is the albedo map and K is the kernel) and its apparent brightness (the flux divided by the sum of K) over time.
- Args:
- which (str):
The param set to use. Can be
- ‘mast’ for master (default),
- ‘alt’ for alternate,
- ‘_c’ for custom, see Optional below.
- Optional:
- albs (2D array):
- Custom albedo map to use if
which
is ‘_c’. Its shape should be, or work with, (n_clat
,n_long
). Default isnp.array( [ [ 1.0 ] ] )
. - times, orbT, ratRO, incD, oblD, solD, longzeroD:
- Custom set of params to use if
which
is ‘_c’. Standard definitions and formats apply. See theclass and constructor
docstrings.
- Returns:
- flux_ak (array):
- flux with shape (# of time steps).
- appar_a (array):
- apparent brightness with shape (# of time steps).
-
Orthographic_Viewer
(phaseD, show='real', alt=False, same_scale=True, force_bright=True, _active=False, orbT_I=8640.0, ratRO_I=10.0, incD_I=90, oblD_I=0, solD_I=0, longzeroD_I=0)¶ Draws your planet’s map and kernel in orthographic projection.
Shows everything from the observer’s point of view (with one exception), based on the master and alternate params you are using. The North and South poles are drawn as a green circle and diamond, respectively.
- Args:
- phaseD (int or float):
- Orbital phase of the planet in degrees. Standard range is [0, 360).
- show (str):
Which data to draw. Can be
- ‘amap’ for the albedo map,
- ‘kern’ for the kernel,
- ‘both’ for the map and kernel separate,
- ‘real’ to multiply the map and kernel (default),
- ‘sphere’ for the whole globe: the visible and opposite hemispheres with no kernel.
- alt (bool):
- Include the alternate albedo map. Default is True.
- same_scale (bool):
- If the master and alternate maps have the same color scheme
(and
alt
is True), then show both with the same color scale. Default is True. - force_bright (bool):
- Use the full color scale to draw the kernel. Also rescales
the kernel values into [0, 1.0] when
show
is ‘real’. The false brightness can make dark drawings (like crescent phases) easier to see. Default is True.
Note
Starting with
_active
, ignore the remaining arguments. These are used by the interactive functionSandbox_Reflection()
.- Effect:
- Stores this matplotlib figure as
fig_orth
, overwriting the previous version. You can save the image later by callingfig_orth.savefig(...)
.
-
Sandbox_Reflection
()¶ Creates an interactive module about your directly imaged planet.
This module lets you explore how a planet’s geometry, motion, kernel, and light curves are related. You can also see predicted constraints on the planet’s spin axis (using the kernel and perfect data).
Note
The larger your
n_clat
andn_long
, the longer this module takes to update (e.g. seconds with default values).The sandbox combines several methods from the class
DirectImaging_Planet
into one compact display. See each for details:The planet and light curves are rendered using your master albedo map. You have a main orbital phase (magenta) to view and can save up to 3 extra phases (light, medium, dark) to compare. Each phase has a color-coded marker on the geometry diagram and kernel characteristics plot, plus its own light curve.
There are many controls (all angles in degrees):
- Inclination
- Obliquity
- Solstice
- Orbital Phase
- [which] Extra Phase Slot
- Save [extra phase]
- Clear [extra phase(s)]
- Spins per Orbit
- Time Steps per Spin
- Initial Longitude [at zero phase]
- [type of] Light Curve
- [type of] Axis Constraint
Note
For the subplot of spin axis constraints, curves are colored lightest to darkest in the phase order [main, light, medium, dark]. Red curves are for single phases, blue curves pairs of phases.
- Effect:
- Stores this matplotlib figure as
fig_sand
whenever you interact with the module. You can save the image later by callingfig_sand.savefig(...)
.
-
Setup_ProRet_Degeneracy
()¶ Sets your alternate params for a specific light curve degeneracy.
The degeneracy involves the albedo map and is usually prograde vs. retrograde rotation (but see note below). Discussed in Section 4.5 and Appendix B3 of S16.
When a planet has zero obliquity and its orbit is edge-on to you (inclination 90 degrees), you cannot tell from a light curve whether:
- the planet does N spins per orbit (
ratRO
) with an albedo map A, or - it does 1.0–N spins with an East-West flipped A.
Most often N and 1.0–N have opposite signs, so one version spins prograde and the other retrograde. This light curve degeneracy breaks down if the planet is tilted or its orbit is not edge-on.
After running this method, test with
Light_Curves()
,LightCurve_Plot()
, orOrthographic_Viewer()
.Note
If N is between 0 and 1.0, both versions of the planet spin prograde. And when N = 0.5, their spins are identical!
- Effect:
- Calls
InvertFlipBlend_Amap()
,Adjust_Geometry()
, andAdjust_MotionTimes()
, using your master params to setup the alternate params as described.
- the planet does N spins per orbit (
-
SpinAxis_Constraints
(phaseD_list, which='mast', constraint='both', info=True, combine=True, combine_only=False, keep_probdata=False, res=500, n_sol=361, n_obl=91, phaseD_sig=10.0, incD_sig=10.0, kwid_sig=10.0, kddc_sig=20.0, _active=False, incD_I=85, solD_I=0, oblD_I=0)¶ Plots how observations may constrain your planet’s spin axis.
These predictions use the kernel characteristics and assume your planet’s light curves at single orbital phases are invertible (see note below). Discussed in Section 4 of S16.
Say you are fitting a planet’s albedo map. We know the kernel depends on the planet’s spin axis (its obliquity and solstice). Invert a light curve from one orbital phase and you will also fit some East-West structure of the kernel, like the longitudinal width. Or invert from two different phases and you fit some North-South structure, like the change in dominant colatitude. So, kernel characteristics help us estimate constraints on the spin axis without doing inversions from real data.
Learn more about the kernel and its characteristics with
Kernel_WidthDomColat()
,Kernels_Plot()
, andKChar_Evolve_Plot()
.Note
Inverting a light curve will depend on the quality of the observational data. The planet’s albedo map matters too: East-West markings to sense daily brightness changes, North-South markings to sense longer changes.
We have pre-calculated characteristics stored in numpy binary files (the obvious two with names ending “values_all5deg.npy”). So, this method rounds inclination, obliquity, and solstice to the nearest 5 degrees. It also tracks the North (green circle) or South pole (green diamond) when obliquity is less than or greater than 90 degrees, respectively.
- Args:
- phaseD_list (list):
Orbital phases of the planet in degrees. Standard range is [0, 360). Phases are integers or floats, and list elements can be
- phase for a longitudinal width,
- [phase, phase] for a change in dominant colatitude.
- which (str):
The param set to use. Can be
- ‘mast’ for master (default),
- ‘alt’ for alternate,
- ‘_c’ for custom, see Optional below.
- constraint (str):
The type of prediction. Can be
- ‘perf’ for perfect constraints with no data uncertainties,
- ‘real’ to use uncertainties and show {1,2,3}–sigma regions,
- ‘both’ (default).
- info (bool):
- Include a legend subplot. Default is True.
- combine (bool):
- Join all constraints in a separate subplot. Default is True.
- combine_only (bool):
- Show only the combo constraint. Default is False.
- keep_probdata (bool):
- Output all probability data, see Returns below. Default is False.
- Optional:
- res (int):
- Resolution when
constraint
is ‘real’, the number of probability contours to test. Default is 500. - n_sol (int):
- Number of solstice grid points. Default is 361.
- n_obl (int):
- Number of obliquity grid points. Default is 91.
- incD_I, solD_I, oblD_I:
- Custom set of params to use if
which
is ‘_c’. Standard definitions and formats apply. See theclass and constructor
docstrings.
- Very Optional:
You should probably check out Section 4.1 of S16 before you change any of these.
- phaseD_sig (float):
- Uncertainty on orbital phase, in degrees. Default is 10.0.
- incD_sig (float):
- Uncertainty on inclination, in degrees. Default is 10.0.
- kwid_sig (float):
- Uncertainty on longitudinal, width in degrees. Default is 10.0.
- kddc_sig (float):
- Uncertainty on change in dominant colatitude, in degrees. Default is 20.0.
Note
Ignore the argument
_active
. This is used by the interactive functionSandbox_Reflection()
.- Effect:
- Stores this matplotlib figure as
fig_spin
, overwriting the previous version. You can save the image later by callingfig_spin.savefig(...)
. - Returns:
A list (user_file) if
keep_probdata
is True andconstraint
is not ‘perf’.- First entry is [incD, oblD, solD].
- Other entries are [id, 2D PDF, {1,2,3}–sigma probability levels], where id is either a phaseD_list element or ‘Combined’.
-
SubOS_TimeDeg
(which='mast', times=0, orbT=8640.0, ratRO=10.0, incD=85, oblD=0, solD=0, longzeroD=0, bypass_time='no')¶ Calculates an planet’s sub-observer and -stellar locations over time.
Wrapper for
exoplanetsubspots.sub_observerstellar()
that works with the classDirectImaging_Planet
. See Appendix A of S16.- Args:
- which (str):
The param set to use. Can be
- ‘mast’ for master (default),
- ‘alt’ for alternate,
- ‘_c’ for custom, see Optional below.
- bypass_time (int, float, 1d array, or str):
- Time value(s) in place of the instance
times
. All other master or alternate params are still used. Canceled if any string. Default is ‘no’.
- Optional:
- times, orbT, ratRO, incD, oblD, solD, longzeroD:
- Custom set of params to use if
which
is ‘_c’. Standard definitions and formats apply. See theclass and constructor
docstrings.
- Returns:
Array of trigonometric values with shape (8, # of time steps). First dimension is ordered:
- sin theta_obs
- cos theta_obs
- sin phi_obs
- cos phi_obs
- sin theta_st
- cos theta_st
- sin phi_st
- cos phi_st


Here are my solutions for the regular expressions-practicum:
[Read More]
Python Tutorial (3-4) Complete + Georef. Map (Unterpertinger)
Here is the confirmation of the completion of the tutorial:
[Read More]
Python Tutorial Complete & Homework files! (Unterpertinger)
Here is the confirmation of the completion of the tutorial:
[Read More]
Pandoc Test! (Romanov)
From: “Modeling: A Study in Words and Meanings” by Willard McCarty
[Read More]
Command Line Tutorial Complete! (Santi)
Here is the confirmation of the copletion of the tutorial:
[Read More]
Git Tutorial Complete! (Unterpertinger)
Here is the confirmation of the completion of the tutorial:
.
Finishing Git-Tutorial
Here is the confirmation of the completion of the tutorial:
[Read More]
Git Tutorial Complete! (Hamzabegovic)
Here is my confirmation of the completion of the tutorial:
[Read More]
Command Line Tutorial Complete! (Voit)
Here is the confirmation of the completion of the tutorial:
[Read More]
Command Line Tutorial Complete! (Tomko)
Here is the confirmation of the completion of the tutorial:
[Read More]
Command Line Tutorial Complete! (Schellewald)
Here is the confirmation of the completion of the tutorial:
[Read More]
Command Line Tutorial Complete! (Romanov)
Here is the confirmation of the completion of the tutorial:
[Read More]
Rismondo Command Line Tutorial
—
layout: post
title: Command Line Tutorial Complete
—
[Read More]
Command Line Tutorial Complete! (Hamzabegovic)
Here is the confirmation of the completion of the tutorial:
[Read More]
Screenshot_commandline!
Hello, world!
[Read More]
Command Kine Tutorial Complete! (Altrichter)
Here is the confirmation of the completion of the tutorial:
[Read More]
Command Line Tutorial Complete! (Zavarsky)
Here is the confirmation of the completion of the Command Line tutorial:
[Read More]
Command Line Tutorial Complete! (Unterpertinger)
Here is the confirmation of the completion of the tutorial:
! [] (../img/Unterpertinger/Unterpertinger_learntheCommandLine.jpg).
Flake it till you make it
Excerpt from Soulshaping by Jeff Brown
Under what circumstances should we step off a path? When is it essential that we finish what we start?  If I ended a relationship with a woman who...
[Read More]
First post!
Hello, world!
[Read More]


Home Automation
HOME
SECURITY
APPLIANCES
Sign Up
Login
Control
FRONT DOOR
FIRE ALARM
CODELOCK
GARAGE


About
class StorageManager():
"""
Functions for managing Storage disks. Intended to be used as a mixin for CloudManager.
"""
StorageManager
is a mixed into CloudManager
and the following methods are available by
manager = CloudManager("api-username", "password")
manager.method()
Methods
def get_storages(self, storage_type="normal"):
"""
Returns a list of Storage objects from the API.
Storage types: public, private, normal, backup, cdrom, template, favorite
"""
def get_storage(self, UUID):
"""
Returns a Storage object from the API.
"""
def create_storage(self, size=10, tier="maxiops", title="Storage disk", zone="fi-hel1"):
"""
Create a Storage object. Returns an object based on the API's response.
"""
def modify_storage(self, UUID, size, title):
"""
Modify a Storage object. Returns an object based on the API's response.
"""
def delete_storage(self, UUID):
"""
Destroy a Storage object.
"""
def attach_storage(self, server_uuid, storage_uuid, storage_type, address):
"""
Attach a Storage object to a Server. Return a list of the server's storages.
"""
def detach_storage(self, server_uuid, address):
"""
Detach a Storage object to a Server. Return a list of the server's storages.
"""


rMatGraph [-j] [-o] [-a <A>] [-b <B>] [-c <C>] [-s <s>] [-m <m>] <n>
This generator creates a graph using the RMAT model. Such graphs are designed to simulate social network graphs. The graphs have a power law degree distribution and small diameter. The graphs are defined recursively in terms of their adjacency matrix. In particularly an adjacency matrix of n x n is partitioned into 4 equal sized quadrants (assuming n is a power of 2) and each quadrant is given a probability so the four sum to 1. Each edge is then selected by recursively selecting a quadrant at random based on the quadrant probabilities until a singleton is reached.
The number of vertices is the variable n rounded up to the next power of two. The number of edges is given by m (10 * n by default). The [-a <A>], [-b <B>], and [-c <C>] arguments specify the upper left quadrant, upper right quadrant, and lower left quadrant respectively. The lower right quadrant is 1 - A - B - C. The default for A is .5, for B is .1 and for C is B. The [-s <s>] option allows one to specify a different seed so a different random graph is generated, but with the same distribution. For a fixed seed the generator will always generate the same graph independently of platform.
The [-j] option specifies that the graph should be output in the adjacency graph file format. By default it is output in the in the edge graph file format. By default the vertex ordering is randomized after the graph is generated so that it does not correspond to the ordering of RMAT adjacency matrix. The [-o] option specifies to keep the ordering.
In its current form when the graph is generated in the adjacency graph format edges are added to make the graph symmetric so each edge appears is both directions.