Recall example1.py from part 1.
# example1.py from random import randint num = randint(1,100) print "Guess the number! 1 to 100." while True: guess = input('Your guess> ') if guess != num: print "Nope,", guess, "is wrong." else: print "You win!" exit(0)
In part 1, we never did actually figure out what num
was. Unlike task1.py, example1.py doesn't give up its secret information (the random number). What if we want to figure out what num
is? Well, since eval()
runs Python code, we'll just try entering “print num
”.
$ python example1.py Guess the number! 1 to 100. Your guess> print num Traceback (most recent call last): File "example1.py", line 6, in <module> guess = input('Your guess> ') File "<string>", line 1 print num ^ SyntaxError: invalid syntax
Ouch! What happened? “print num
” is syntactically valid Python! However, while “print num
” is a valid statement, it's not a valid Python expression. In short, most programming languages distinguish between expressions (like math expressions or function calls), and statements (which can be expressions and everything else, like for-loops or function definitions). You should Google for more information if you aren't clear on the difference.
In sufficiently large Python scripts, there's often a function lying around somewhere that could be used to print things; for example, if example1.py began with an “import sys
”, we could enter “sys.stdout.write(str(num))
” to get example1.py to output the value of num
. No such luck in this case. However, it's still pretty easy to print out num
. If we're a little clever, there are plenty of ways to set guess
to be something that isn't equal to num
, but still gives away its value:
$ python example1.py Guess the number! 1 to 100. Your guess> num+1 Nope, 54 is wrong. Your guess> 53 You win! $ python example1.py Guess the number! 1 to 100. Your guess> str(num) Nope, 84 is wrong. Your guess> 84 You win! $
This cleverness may seem specific to example1.py, but it demonstrates a fundamental hacking principal: we used our influence over the variable guess
to intentionally manipulate the control flow of the program, choosing to take the branch of the if
statement that does something useful instead of the branch that just prints out “You win!
”. It also shows that exfiltration of information can sometimes pose a challenge.
Time for your second task! You're still trying to get the secret flag
, which has still been redacted below. You can connect to this one with “nc python.picoctf.com 6362
”.
# task2.py from random import randint def printpegs(code): print " --------------------- " print " |", for c in code: print c, "|", print "" print " --------------------- " print "Master Mind Game" flag = "xxxxxxxxxx" mm_code = (randint(0,9), randint(0,9), randint(0,9), randint(0,9), randint(0,9)) print "I've set my code. Guess it!" print "Rules: You should input your guesses as 5 digits separated by commas." print " I will respond by marking the correct digits with a 2, marking" print " digits in the wrong place with a 1, and marking wrong digits 0." while True: guess = input('guess> ') if len(guess) != 5: print "You must guess a 5-digit code!" continue printpegs(guess) right = map(lambda x,y: (x == y) + (x in mm_code), guess, mm_code) printpegs(right) if guess == mm_code: print "You got it right!" exit(0)


Building the present from the past
08 Nov 2018All airports, he had long ago decided, look very much the same. It doesn’t actually matter where you are, you are in an airport: tiles and walkways and restrooms, gates and newsstands and fluorescent lights. This airport looked like an airport.
-Neil Gaiman, American Gods
Each scene of a movie (or paragraph of a story) generates a pattern of activity in the viewer’s brain, and I showed in my last paper that changes in these activity patterns correspond to new events happening in the story. But it is still mysterious exactly what information the brain is keeping track of in these activity patterns. We know that movie and audiobook versions of the same story generate similar patterns in many brain regions, which means that the information must be pretty abstract. Can we push this even farther? Can we find pattern similarities between different narratives that describe events from the same “template”?
In my new paper we studied a kind of template called an event script, which describes a typical sequence of events that occurs in the world. For example, when you walk into a restaurant you have detailed expectations about what is going to happen next - you are going to be seated at a table, then given menus, then order your food, and then the food will come. Our hypothesis was that some brain regions would track this script information, and should look similar for any story about restaurants regardless of the specific characters and storyline of this particular narrative.
We showed subjects movies and audiobooks of stories taking place in restaurants and stories taking place in airports. Here are examples of two of the restaurant movies (all of the stories are publicly available here):
We then looked for brain regions that seemed to be tracking the restaurant or airport script during all of the stories, and found a whole network of regions:
An especially important region here is the medial prefrontal cortex, which is the part of your brain right behind the middle of your forehead. We found that this region only tracked the script when it made logical sense - if we scrambled the order of the script (e.g. showed people getting food before they ordered) then it no longer bothered to track what was going on.
I also used some of the analysis tools I previously developed for matching up brain data during perception and recall of the same story to find correspondences between different stories with the same script template. For example, I can use brain activity from the superior frontal gyrus to figure out which parts of the “Up in the Air” story and the “How I Met Your Mother” story take place in the same places in the airport. Here are snippets of the stories that show similar patterns of brain activity:
| Script event | Up in the Air | How I Met Your Mother |
|---|---|---|
| Enter aiport | Ryan looked up from his boarding pass and sighed. There was his new partner Natalie, awkwardly climbing out of a taxi at the curb of the airport. | Barney and Quinn walked into the airport pulling their matching pink tiger-stripe suitcases. Barney leaned over and kissed her on the cheek. |
| Airport security | Ryan shrugged. “Look at the other lines. I never get behind people traveling with infants - I’ve never seen a stroller collapse in less than twenty minutes. Old people are worse - their bodies are littered with hidden metal and they never seem to appreciate how little time they have left on earth.” | The guard motioned to several others for backup. “Sir, you need to open this box.” “Oh, I can’t do that. Magician’s code. A magician never reveals his tricks. The only person I could possibly reveal the trick to is another magician.” |
| Boarding gate | He stopped halfway to their gate and pointed at a luggage store. “If you’re going to be flying with me, you need to get a carry-on bag.  “I told you, magician’s code.” |
| On plane | “I like my own stuff. Don’t you like feeling connected to home?” Ryan laughed. “This is where I live. All the things you probably hate about traveling - the recycled air, the artificial lighting - are warm reminders that I am home.” | In its center was a diamond ring, which Barney plucked from the flower and held out to Quinn. “Quinn, will you marry me?” |
I’m currently analyzing some additional data from these subjects, collected while they tried to retell all 16 stories from memory. Our hypothesis is that these script templates should also be useful when trying to remember events, since they give us clues about what kinds of events to search for in our memories. I’m also fascinated by how these scripts get learned, and am hoping to study this learning process both in adults (who are learning a new scripts in the lab) and in children (who are learning real scripts over the course of years).
Comments? Complaints? Contact me @ChrisBaldassano


Mirage is an open-source project driven by its contributors, from a variety of backgrounds. This page lists some of them and their roles in the project. If you’d like to be on here, please do contribute a PR with your information to the website repository.
The core team is broadly responsible for the central Mirage organisation repositories on GitHub, and for the project infrastructure and release engineering.
Hannes Mehnert
Hannes is a hacker (in the original sense of the word), 3X years old. In his spare time, he’s not only a hacker, but also a barista. He likes to travel and repair his recumbent bicycle. He co-authored the TLS stack, and since then has touched many parts of the Mirage stack in the quest to release 3.0
home
hannesm
@h4nnes
The Mirage community is distributed around the world, with regular IRC meetups and events to facilitate face-to-face hacking. The community contributors organise all this, and help ensure that Mirage continues to be accessible and welcoming to newcomers!
Gemma Gordon
Gemma is the Operations Director for the OCaml Labs group in the Cambridge Computer Laboratory, and covers day-to-day management, investigates funding opportunities and organises events.
home
GemmaG
@em3r4ld6
The tools crew maintains the infrastructure and CLI utilities that Mirage uses, such as the OPAM package manager, various bots and the CI system.
Louis Gesbert
Louis holds a PhD from University Paris Est, and has studied at EnsIIE, University of Manchester and University of Tokyo. He has a strong background on programming languages and distribution, and was one of the architects behind the Opa language developed at MLstate. He joined OCamlPro in November 2012 and contributes extensively to OPAM.
home
AltGr
Enguerrand Decorne
Enguerrand interned on the Mirage project in 2016, and wrote and maintains infrastructure such as Canopy and the IRC logging bot for our weekly meetings.
home
Engil
@lamagicien
Mirage consists of many OCaml libraries that glue together to form an executable operating system. The librarians maintain the growing array of libraries in the community and ensure that they remain compatible with the core Mirage module types.
Qi Li
Qi works on the DataBox project, and actively hacks on the ARM backend of Mirage.
sevenEng


Traveler's Tavern
Basics
Abilities
Background
Spells
Character Name:
Player Name:
Race:
Human
Half-Elf
Elf
Halfling
Dwarf
Dragonborn
Half-Orc
Tiefling
Class:
Barbarian
Bard
Cleric
Druid
Fighter
Monk
Paladin
Ranger
Rogue
Sorcerer
Warlock
Wizard
Reset
Submit


CouchServer Class Reference
| Inherits from | CouchResource : RESTResource : NSObject |
| Declared in | CouchServer.h |
Tasks
Other Methods
-
– initWithURL:
Initialize given a server URL.
-
– init
Without a URL, connects to localhost on default port 5984.
-
– close
Releases all resources used by the CouchServer instance.
-
– getVersion:
Fetches the server’s current version string. (Synchronous)
-
– generateUUIDs:
Returns an array of unique-ID strings generated by the server. (Synchronous)
-
– generateDocumentID
Returns a single new document ID generated by the server. (Synchronous)
-
– getDatabases
Returns array of CouchDatabase objects representing all the databases on the server. (Synchronous)
-
– databaseNamed:
Just creates a CouchDatabase object; makes no calls to the server.
The database doesn't need to exist (you can call -create on it afterwards to create it.) Multiple calls with the same name will return the same CouchDatabase instance.
-
– objectForKeyedSubscript:
Same as databaseNamed:. Enables “[]” access in Xcode 4.4+
-
activeTasks
The list of active server tasks, as parsed JSON (observable).
propertyThis is updated asynchronously while the activityPollInterval is nonzero.
-
– checkActiveTasks
-
activityPollInterval
How often to poll the server’s list of active tasks and update .activeTasks.
property -
replications
All currently defined CouchPersistentReplications (as stored in the replicator database.)
propertyTo create a replication, use the methods on CouchDatabase.
Extension Methods
Properties
activeTasks
The list of active server tasks, as parsed JSON (observable).
This is updated asynchronously while the activityPollInterval is nonzero.
@property (nonatomic, readonly, retain) NSArray *activeTasks
Discussion
The list of active server tasks, as parsed JSON (observable).
This is updated asynchronously while the activityPollInterval is nonzero.
Declared In
CouchServer.h
activityPollInterval
How often to poll the server’s list of active tasks and update .activeTasks.
@property NSTimeInterval activityPollInterval
Discussion
How often to poll the server’s list of active tasks and update .activeTasks.
Declared In
CouchServer.h
replications
All currently defined CouchPersistentReplications (as stored in the replicator database.)
To create a replication, use the methods on CouchDatabase.
@property (readonly) NSArray *replications
Discussion
All currently defined CouchPersistentReplications (as stored in the replicator database.)
To create a replication, use the methods on CouchDatabase.
Declared In
CouchServer.h
Instance Methods
close
Releases all resources used by the CouchServer instance.
- (void)close
Discussion
Releases all resources used by the CouchServer instance.
Declared In
CouchServer.h
databaseNamed:
Just creates a CouchDatabase object; makes no calls to the server.
The database doesn't need to exist (you can call -create on it afterwards to create it.)
Multiple calls with the same name will return the same CouchDatabase instance.
- (CouchDatabase *)databaseNamed:(NSString *)name
Discussion
Just creates a CouchDatabase object; makes no calls to the server.
The database doesn't need to exist (you can call -create on it afterwards to create it.)
Multiple calls with the same name will return the same CouchDatabase instance.
Declared In
CouchServer.h
generateDocumentID
Returns a single new document ID generated by the server. (Synchronous)
- (NSString *)generateDocumentID
Discussion
Returns a single new document ID generated by the server. (Synchronous)
Declared In
CouchServer.h
generateUUIDs:
Returns an array of unique-ID strings generated by the server. (Synchronous)
- (NSArray *)generateUUIDs:(NSUInteger)count
Discussion
Returns an array of unique-ID strings generated by the server. (Synchronous)
Declared In
CouchServer.h
getDatabases
Returns array of CouchDatabase objects representing all the databases on the server. (Synchronous)
- (NSArray *)getDatabases
Discussion
Returns array of CouchDatabase objects representing all the databases on the server. (Synchronous)
Declared In
CouchServer.h
getVersion:
Fetches the server’s current version string. (Synchronous)
- (NSString *)getVersion:(NSError **)outError
Discussion
Fetches the server’s current version string. (Synchronous)
Declared In
CouchServer.h
init
Without a URL, connects to localhost on default port 5984.
- (id)init
Discussion
Without a URL, connects to localhost on default port 5984.
Declared In
CouchServer.h
initWithURL:
Initialize given a server URL.
- (id)initWithURL:(NSURL *)url
Discussion
Initialize given a server URL.
Declared In
CouchServer.h
objectForKeyedSubscript:
Same as databaseNamed:. Enables “[]” access in Xcode 4.4+
- (id)objectForKeyedSubscript:(NSString *)key
Discussion
Same as databaseNamed:. Enables “[]” access in Xcode 4.4+
Declared In
CouchServer.h


Carl Schubert
home
about
blog
contact
Carl's blog:
DBC Culture
Version Control
Margin Border and Padding
Arrays and Hashes
Thinking and Testing
Software Patents
Cycle Enuumerable
Ruby Classes
DBC: Feedback
Blocks, Procs, and Lambdas
Stereotype Threat
Values
Javascript and Ruby
Conflict
Big O Notation
Asking Good Questions


Unfortunately, the most reecent MAMP version (as of March 2011) has upgraded from MySQL 5.1 to MySQL 5.5. And MySQL, in turn, has switched from GNU Make (with ./configure) to CMake (with cmake .).
1
2
3
4
5
6
7
8
class = "brush :shell"
$ cd /tmp
$ mv /Users/yourname/Desktop/mysql-5.5.9.tar.gz .
$ tar xf mysql-5.5.9.tar.gz
$ cd mysql-5.5.9
$ sudo port install cmake
$ cmake . -DMYSQL_UNIX_ADDR= /Applications/MAMP/tmp/mysql/mysql.sock \
-DCMAKE_INSTALL_PREFIX= /Applications/MAMP/Library
修改编译出错的文件 unittest/mysys/my_atomic-t.c
1
2
3
4
5
6
7
int64 b = 0x1000200030004000LL ;
a64 = 0 ;
/*my_atomic_add64(&a64, b);
ok(a64==b, "add64"); 注释这段代码*/
ok ( 1 , "add64" ); /* 添加这句代码，目的是直接返回测试成功结果 */
1
2
3
$ cp libmysql/*.dylib /Applications/MAMP/Library/lib/
$ mkdir -p /Applications/MAMP/Library/include/mysql
$ cp include/* /Applications/MAMP/Library/include/mysql
1
2
3
4
5
6
7
$ sudo env ARCHFLAGS = "-arch x86_64" gem install mysql2 -- \
--with-mysql-config= /Applications/MAMP/Library/bin/mysql_config
$ sudo install_name_tool -change \
/tmp/mysql-5.5.9/libmysql/libmysqlclient.16.dylib \
/Applications/MAMP/Library/lib/libmysqlclient.16.dylib \
/opt/local/lib/ruby/gems/1.8/gems/mysql2-0.2.6/lib/mysql2/mysql2.bundle
$ rm -rf /tmp/mysql-5.5.9 /tmp/mysql-5.5.9.tar.gz:
1
$ sudo port install rb-mysql


Welcome to Moi-Shop, your videogames online store!
Buy games for Xbox One, Xbox 360, PS4, PS3, PS2, PS Vita, PSP, Nintendo Switch, Wii, Wii U, 3DS, and DS. Here, you can purchase used video games for current generation systems at discount prices. We’re constantly getting new inventory and need to make room, so you’ll always find great deals when you buy video games online at GameFly. Cases, manuals, and codes are included with each game unless you buy a game sold as Disc Only. As always, your purchase is guaranteed.


fun getSupportedInputChannelRange(mimeType: String): Range<Int!>
Get maximum supported number of channel by encoder.
mimeType - audio encoder mime type
mimeType
Return maximum number of channel supported by the encoder


 The undo list remembers the last 50 commands deleted.
/Undo without
a number will show you a list of the most recent deletions. To undelete
an
item type /undo with the number of the item you want to restore.
Click here to return to previous page.


Any variable created using mcerp can be visualized using the plot class method, which has the following syntax:
>>> x1.plot([hist=False], **kwargs)
At the main import (i.e., from mcerp import *), we make available the matplotlib.pyplot sub-module available through the object plt, which is required for later use since the plot function doesn’t automatically display the graph. Thus, we might have the following:
>>> x1.plot() # No inputs shows the distribution's actual PDF/PMF
>>> plt.show() # explicit 'show()' required to display to screen
As we can see, the default title is the information about the distribution object and the plot axes is scaled to fit well within the plot window.
When plotting an object that is a result of prior calculations, since a mathematical PDF/PMF may not be realizable, we resort to approximating the distribution using a Kernel Density Estimate (KDE) of the data:
>>> Z.plot()
>>> plt.show()
By using the hist=True keyword in the plot function, we an see a histogram of the data instead of the KDE:
>>> Z.plot(hist=True) # shows a histogram instead of a KDE
>>> plt.show()
Or since showing the plot is explicit, we can do both:
>>> Z.plot()
>>> Z.plot(hist=True)
>>> plt.show()
Using Matplotlib’s API, the plot can be customized to the full extent since everything is done before the plot is displayed.


--- layout: post title: With Its New Marketplace, Amazon Web Services is Becoming the Next Microsoft date: '2012-04-19T13:27:14-07:00' tags: tumblr_url: http://alexhwilliams.tumblr.com/post/21394509862/with-its-new-marketplace-amazon-web-services-is ---


This article by Mother Jones 1 [9.11.160] (known for being a left-leaning publication) investigates the history of the student loan debt forgiveness movement, beginning with the activism of Occupy Wall Street in \(2011\) (see Figure 9.9.1) and America's first debtors' union, the Debt Collective.
in-context


| |
Methods defined here:
- __init__(self, scoped_tokens=None)
- add_token(self, token)
- Adds a new token to the store (replaces tokens with the same scope).
Args:
token: A subclass of http_interface.GenericToken. The token object is
responsible for adding the Authorization header to the HTTP request.
The scopes defined in the token are used to determine if the token
is valid for a requested scope when find_token is called.
Returns:
True if the token was added, False if the token was not added becase
no scopes were provided.
- find_token(self, url)
- Selects an Authorization header token which can be used for the URL.
Args:
url: str or atom.url.Url or a list containing the same.
The URL which is going to be requested. All
tokens are examined to see if any scopes begin match the beginning
of the URL. The first match found is returned.
Returns:
The token object which should execute the HTTP request. If there was
no token for the url (the url did not begin with any of the token
scopes available), then the atom.http_interface.GenericToken will be
returned because the GenericToken calls through to the http client
without adding an Authorization header.
- remove_all_tokens(self)
- remove_token(self, token)
- Removes the token from the token_store.
This method is used when a token is determined to be invalid. If the
token was found by find_token, but resulted in a 401 or 403 error stating
that the token was invlid, then the token should be removed to prevent
future use.
Returns:
True if a token was found and then removed from the token
store. False if the token was not in the TokenStore.
Data descriptors defined here:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
|


skydy.inertia package¶
Submodules¶
skydy.inertia.InertiaMatrix module¶
- class skydy.inertia.InertiaMatrix.InertiaMatrix(name)[source]¶
Bases:
object
- __init__(name)[source]¶
Define a generic inertia matrix about a body coordinates frame.
This is not a customizable oject. It is what it is, and it doesn’t need to be any more.
- Parameters
name (str, int) – the body name for the inertia matrix
- Returns
None
Examples
>>> from skydy.inertia import InertiaMatrix >>> i_mat = InertiaMatrix(1)
skydy.inertia.MassMatrix module¶
- class skydy.inertia.MassMatrix.MassMatrix(name)[source]¶
Bases:
object
- __init__(name)[source]¶
Define a generic mass matrix about a body coordinates frame.
This is not a customizable oject. It is what it is, and it doesn’t need to be any more.
- Parameters
name (str, int) – the body name for the mass matrix
- Returns
None
Examples
>>> from skydy.inertia import MassMatrix >>> m_mat = MassMatrix(1)


Who Am I?
My name is Peter the Gopher. I am a western pocket gopher, also known as thomomys mazama.
I was born to Doug the Gopher and Tina the Gopher. I also have three siblings (Sharlene, Lance, and Charles) and eleven cousins (Wilda, Matilda, Zelda, Michael, Mitchell, Bonnie, Evan, Gregory, and the triplets, Harry, Jerry, and Barry). My best friends are Mo the Mouse and Billy the Beetle.
When in my secret-agent alter ego, I am despised by my enemies. I steal eggs from hawks and hide them in snake dens.
My Favorite Foods
- Radishes
- Earthworms
- Shrubs
Things I Like To Do
- Burrow tunnels
- Scavenging for plant roots
- Play peekaboo


This is a list of the files currently held in the file list. This list is only as up-to-date as the last time it was downloaded from CIX Forums. To get the most recent version of the file list, click the Update button. The new list will be retrieved next time Ameol blinks.


Locations
{% for neighborhood in locations_by_neighborhood %}
{% if neighborhood.locations %}
-
{% endif %}
{% empty %}
- No locations to display.
{% endfor %}
{% if category_slug == 'restaurants' %}
* locations that do not have a kitchen but allow outside food
{% endif %}
{% endif %}


Cosby, who was handed down a three- to 10-year sentence last year after being convicted, told BlackPressUSA over the phone that the Pennsylvania parole board will not “hear me say that I have remorse,” and it will likely prevent him from being released early.
“I don’t care what group of people come along and talk about this when they weren’t there. They don’t know,” he said.
“It’s all a setup. That whole jury thing. They were imposters,” he added, claiming one of the jurors was overheard saying before the trial, “He’s guilty, we can all go home now.”
Cosby — a comedian best-known for his 1980s sitcom “The Cosby Show” — was convicted of sexually assaulting a Temple University employee in 2004.

He’s currently attempting to appeal his conviction and sex offender status while living in a state prison near Philadelphia.
Sign up for Daily Newsletters
Copyright © 2019 The Washington Times, LLC. Click here for reprint permission.
Please read our comment policy before commenting.