| Created: | 2/16/2016 10:02:24 AM |
| Modified: | 5/5/2019 12:33:04 AM |
| Project: | |
| Advanced: |
| Attribute | ||
|
Public AirspaceVolume geometry |
||
Details:
|
||
|
Public AngleWithNilReason directionOfMotion |
||
|
Details:
sequenceNumber=4
|
||
|
Public Velocity speedOfMotion |
||
Details:
|
||
|
Public AIRMETExpectedIntensityChange intensityChange |
||
Details:
|
||
|
Public Distance cloudBase |
||
|
Details:
sequenceNumber=6
|
||
|
Public CodeVerticalReferenceType cloudBaseReference |
||
Details:
|
||
|
Public Distance cloudTop |
||
|
Details:
sequenceNumber=8
|
||
|
Public CodeVerticalReferenceType cloudTopReference |
||
Details:
|
||
|
Public Distance surfaceVisibility |
||
|
Details:
sequenceNumber=10
|
||
|
Public WeatherCausingVisibilityReduction surfaceVisibilityCause |
||
Details:
|
||
|
Public Angle surfaceWindDirection |
||
Details:
|
||
|
Public Velocity surfaceWindSpeed |
||
|
Details:
sequenceNumber=13
|
||
|
Public Boolean approximateLocation |
||
Details:
|
| Element | Source Role | Target Role |
|
«featureType» AIRMETEvolvingConditionCollection Class |
Name: |
Name: member The members of this collection. |
|
Details:
|
| Tag | Value |
| byValuePropertyType | false |
|
Details:
Values: true | false
Default: false Description: Create a property type that requires that the instance is encoded inline (applies to ISO 19136:2007 encoding rule). |
|
| isCollection | false |
|
Details:
Values: true | false
Default: false Description: Identifies the feature type as a feature collection. |
|
| noPropertyType | false |
|
Details:
Values: true | false
Default: false Description: Surpress creation of a standard property type that supports inline or by-reference encoding (applies to ISO 19136:2007 encoding rule). |
| Constraint | Type | Status |
| cloudBase/(@uom = "m" or cloudBase/@uom = "[ft_i]" | Invariant | Approved |
|
Details:
Pattern ID: AIRMET.AIRMETEvolvingCondition-1
Description: cloudBase shall be reported in metres (m) or feet ([ft_i])
Assertion: ( if( exists(iwxxm:cloudBase) and not(iwxxm:cloudBase/@xsi:nil = 'true') ) then( (iwxxm:cloudBase/@uom = 'm') or (iwxxm:cloudBase/@uom = '[ft_i]') ) else( true() ) )

|
||
| cloudTop/@uom = "m" or cloudTope/@uom = "[ft_i]" | Invariant | Approved |
|
Details:
Pattern ID: AIRMET.AIRMETEvolvingCondition-2
Description: cloudTop shall be reported in metres (m) or feet ([ft_i])
Assertion: ( if( exists(iwxxm:cloudTop) and not(iwxxm:cloudTop/@xsi:nil = 'true') ) then( (iwxxm:cloudTop/@uom = 'm') or (iwxxm:cloudTop/@uom = '[ft_i]') ) else( true() ) )

|
||
| directionOfMotion/@uom = "deg" | Invariant | Approved |
|
Details:
Pattern ID: AIRMET.AIRMETEvolvingCondition-3
Description: directionOfMotion shall be reported in degrees (deg)
Assertion: ( if( exists(iwxxm:directionOfMotion) and not(iwxxm:directionOfMotion/@xsi:nil = 'true') ) then( iwxxm:directionOfMotion/@uom = 'deg' ) else true())

|
||
| speedOfMotion/@uom = "km/h" or speedOfMotion/@uom = "[kn_i]") | Invariant | Approved |
|
Details:
Pattern ID: AIRMET.AIRMETEvolvingCondition-4
Description: speedOfMotion shall be reported in kilometres per hour (km/h) or knots ([kn_i])
Assertion: ( if( exists(iwxxm:speedOfMotion) and not(iwxxm:speedOfMotion/@xsi:nil = 'true') ) then( (iwxxm:speedOfMotion/@uom = 'km/h') or (iwxxm:speedOfMotion/@uom = '[kn_i]') ) else( true() ) )

|
||
| surfaceVisibility/@uom = "m" | Invariant | Approved |
|
Details:
Pattern ID: AIRMET.AIRMETEvolvingCondition-5
Description: surfaceVisibility shall be reported in metres (m)
Assertion: ( if( exists(iwxxm:surfaceVisibility) and not(iwxxm:surfaceVisibility/@xsi:nil = 'true') ) then( iwxxm:surfaceVisibility/@uom = 'm' ) else( true() ) )

|
||
| surfaceWindspeed/@uom = "m/s" or surfaceWindspeed/@uom = "[kn_i]") | Invariant | Approved |
|
Details:
Pattern ID: AIRMET.AIRMETEvolvingCondition-6
Description: surfaceWindSpeed shall be reported in metres per second (m/s) or knots ([kn_i])
Assertion: ( if( exists(iwxxm:surfaceWindSpeed) and not(iwxxm:surfaceWindSpeed/@xsi:nil = 'true') ) then( (iwxxm:surfaceWindSpeed/@uom = 'm/s') or (iwxxm:surfaceWindSpeed/@uom = '[kn_i]') ) else( true() ) )

|
||
| surfaceWindDirection/@uom = "deg" | Invariant | Approved |
|
Details:
Pattern ID: AIRMET.AIRMETEvolvingCondition-7
Description: surfaceWindDirection shall be reported in the degrees unit of measure ('deg')
Assertion: ( if( exists(iwxxm:surfaceWindDirection) and not(iwxxm:surfaceWindDirection/@xsi:nil = 'true') ) then( iwxxm:surfaceWindDirection/@uom = 'deg' ) else( true() ) )

|
||
| surfaceWindDirection and surfaceWindSpeed must be reported together | Invariant | Approved |
|
Details:
Pattern ID: AIRMET.AIRMETEvolvingCondition-8
Description: surfaceWindDirection and surfaceWindSpeed must be reported together
Assertion: ( if( not((exists(iwxxm:surfaceWindDirection) and exists(iwxxm:surfaceWindSpeed)) or (empty(iwxxm:surfaceWindDirection) and empty(iwxxm:surfaceWindSpeed))) ) then( false() ) else( true() ) )

|
||
| CRS requirements for iwxxm:geometry | Invariant | Approved |
|
Details:
Pattern ID: AIRMET.AIRMETEvolvingCondition-9
Description: If a geometry of iwxxm:geometry is defined with the provision of attribute srsName, attribute srsDimension must equal to 2 and attribute axisLabels must be non-empty
Assertion: ( if( exists(iwxxm:geometry//*[self::aixm:horizontalProjection or self::aixm:centreline]) ) then( empty(index-of(iwxxm:geometry//*[self::aixm:Surface or self::aixm:Curve]/(ancestor-or-self::*[exists(@srsName)])[last()]/(@srsDimension='2' and exists(@axisLabels)), false())) ) else( true() ) )

|


--- layout: page title: "Developing Backbone.js Applications" prev: OEBPS/ch06.html next: OEBPS/author_bios.html book_path: books/developing-backbone-js-applications-addy-osmani--_oeb/ --- {% include JB/setup %} {% raw %}
That’s it for “Developing Backbone.js Applications”. I hope you found this book both useful, enlightening and a good start for your journey into exploring Backbone.js.
Remember, If there are other topics or areas of this book you feel could be expanded further, please feel free to let me know, or better yet, send a pull request upstream. I’m always interested in making this title as comprehensive as possible.
Until next time, the very best of luck with the rest of your journey!
Copyright Addy Osmani, 2012.


Palm House Studio, Located in the heart of Jakarta. We are your One-stop Audio Production solution. Run by certified Audio Engineers from JMC Music Academy (Australia) and SAE (Singapore).
We provide you with services such as:
-Recording
Studio
-Voice Over Recording
-Rehearsal Studio
-On Location Live Sound Recording
-Audio Mixing
-Audio Mastering
-Jingle Production
-Sound Design.


Function pointer to function which is used by the core to set device charectristics such as device speed, device address,Number of endpoints required and their endpoint numbers. Fifo config must be done by dcd. More...
#include <usb_dev_object.h>
Data Fields | |
| uint32_t | configparam |
| usbSpeed_t | devSpeed |
| uint32_t | deviceAddress |
| uint32_t | enableRemoteWakeup |
| usbDevEndptInfo_t * | pDeviceEndptConfig |
| usbDevEndptInfo_t * | pDeviceEndptInterface |
Function pointer to function which is used by the core to set device charectristics such as device speed, device address,Number of endpoints required and their endpoint numbers. Fifo config must be done by dcd.
| uint32_t usbDevChara::configparam |
this field is used by the dcd to know which field it needs to use in the current run.
| uint32_t usbDevChara::deviceAddress |
Address assigned by the host- this needs to be configured in the dc.
| usbSpeed_t usbDevChara::devSpeed |
1st Field - device speed .
| uint32_t usbDevChara::enableRemoteWakeup |
tell dcd to enable/disable remote wakeup signalling .
| usbDevEndptInfo_t* usbDevChara::pDeviceEndptConfig |
Pointer to device endpoint configuration structure .
| usbDevEndptInfo_t* usbDevChara::pDeviceEndptInterface |
Pointer to device endpoint interface structure .


These release notes cover new developer and user-facing incompatibilities, features, and major improvements.
Added RPM/DEB packages to build system.
Test case TestHdfsProxy.testHdfsProxyInterface has been temporarily disabled for this release, due to failure in the Hudson automated test environment.
Batch hardlinking during "upgrade" snapshots, cutting time from aprx 8 minutes per volume to aprx 8 seconds. Validated in both Linux and Windows. Depends on prior integration with patch for HADOOP-7133.
Fixed a race condition in writing the log index file that caused tasks to 'fail'.
Removed duplicate chmods of job log dir that were vulnerable to race conditions between tasks. Also improved the messages when the symlinks failed to be created.
Added 2 new config parameters:
mapreduce.reduce.shuffle.catch.exception.stack.regex mapreduce.reduce.shuffle.catch.exception.message.regex
Added a new configuration option: mapreduce.reduce.shuffle.maxfetchfailures, and removed a no longer used option: mapred.reduce.copy.backoff.
Added mapreduce.tasktracker.distributedcache.checkperiod to the task tracker that defined the period to wait while cleaning up the distributed cache. The default is 1 min.


Before the official opening of the conference, an informal Get-Together will take place on Tuesday, from 19:00 to 22:00, at the MCE conference center.
Check-in at the conference desk will be open during that evening. We will welcome you with a walking dinner and drinks, so please join us, to meet old and new friends and colleagues.


When you click the button below I'll update the 'message' var's value and you'll see it update in the parent.
Message: {{message}}
Click me to update 'message' var in child which will also emit a msg to the parent


The Cell Membrane is like the skin covering your body.
It surrounds the Cell and protects the contents of the
Cell. Its structure helps control the movement of substances
in and out the Cell.
Equation Complete Next Page?
Back


Gchain Blockchain uses a language likes Javascript to write smart contracts, this language bases on Typescript with strong type checking, so you can interpret it as C++ or Java.
function NAME(str: string): u64
: This funciton is applied to convert a string to account_name. The length of str
must be equal-less than 12 and it can only contain characters from .012345abcdefghijklmnopqrstuvwxyz
, also, str
can not end with .
, otherwise it will be trimed.
function RNAME(account: account_name): string : This funciton is applied to convert an account_name to string.
function ACTION(str: string): Action
: This funciton is applied to convert a string to class Action. Action wraps action related operations. The str
only contains characters from ._0-9a-zA-Z
, and its length must be less than 22. Refer class Action for more details.
Action.sender : The originator of current transaction, it returns an account_name value.
Action.receiver : The receiver of current transaction, normally, it is the account of your smart contract deployed to.
Block.number : The height of head block.
Block.id : The id of head block, it is a hexadecimal string with sha256 encryted .
Block.timestamp : The timestamp of head block, it returns seconds count since epoch.
import { NAME, RNAME } from "gchain-ts-lib/src/account";
import { Log } from "gchain-ts-lib/src/log";
import { Contract } from "gchain-ts-lib/src/contract";
class HelloWorld extends Contract {
@action
hi(name: account_name, age: u32, msg: string): void {
Log.s("hi: name = ").s(RNAME(name)).s(" age = ").i(age, 10).s(" msg = ").s(msg).flush();
}
}
Let's explain this snippet:
import
: You can import classes, funcitons or anyother symbols exported from other files. You can refer to typescript for more details.extends Contract
: Each smart contract must extends from base class Contract, and there must be ONE and ONLY ONE class extends from Contract.@action
: To declare an aciton. If a function is labeled with @action, then it can be invoked by sending a transaction to it.Log
: Prints log to console.gkit build
gkit deploy
In order to pass messages between blockchain node and centralized server, we import method Return and ReturnArray. The returned message will be appened to the http response.
Please notice this fact: Return message is only a pre executed result of one blockchain node, it is not confirmed by the blockchain network. Sometimes the confirmed message would be different with what your get from http response.
To return a message, please call Return
,ReturnArray
methods like this example:
class HelloContract extends Contract {
@action
on_hi(name: u64, age: u32, msg: string): void {
Return<string>("call hi() succeed.");
ReturnArray<u8>([1,2,3]);
}
}
After the action pre executed, you will get call hi() succeed.123
as return message.
NOTICE for Return a message
- Length of return message is limited, its default length is 128( The integer values will be converted to string). You can change the default value
contract-return-string-length = 512
from file config.ini.- Return, ReturnArray only support primitive types, include integer, string, array of integer, array of string.
- You can call Return or ReturnArray multi times, the message will be concated.
- If the length of return message is longer than contract-return-string-length, the message is discared silently, no exception thrown.
You can query/transfer the tokens from/to the account gcfio.token, which Gchain Blockchain issues tokens to. To query tokens of an account, call method Asset.balanceOf(who: account_name): Asset
; To transfer tokens between accounts, call method Asset.transfer(from: account_name, to: account_name, val: Asset, memo: string): void
.
For more details, refer to demo balance。
import "allocator/arena";
import { Contract } from "gchain-ts-lib/src/contract";
import { Asset } from "gchain-ts-lib/src/asset";
import { gchain_assert } from "gchain-ts-lib/src/utils";
class BalanceContract extends Contract {
@action
transfer(from: account_name, to: account_name, bet: Asset): void {
let balance = Asset.balanceOf(from);
gchain_assert(balance.gte(bet), "your balance is not enough.");
balance.prints("banalce from: ");
Asset.transfer(from, to, bet, "this is a transfer test");
}
}
NOTICE You must delegate your active permission to account
gcfio.code
, if you want to transfer your tokens to some account from another contract.
emit event from an action
class HelloWorld extends Contract{
@action
hi(name: account_name, age: u32, msg: string): void {
Log.s("hi: name = ").s(RNAME(name)).s(" age = ").i(age, 10).s(" msg = ").s(msg).flush();
emit("onHiInvoked", EventObject.setString("name", RNAME(name)));
}
emit: It will emit event "onHiInvoked", and the messages set to EventObject will be composed to a JSON object.
The length of JSON object is limited to 128, you can config contract-emit-string-length
in config.ini to change the default value.
If the length of JSON object is longer than contract-emit-string-length, this event would be discared without any exception.
Subscribe/Unsubscribe events from blockchian node Clients should subscribe envents from blockchain node, when a contract emits an event, the node will post EventObject message to specific url.
（In below snippets, the host and port of http url should be replaced with concrete values.）
Subscribe
You can post your request via this RPC http://localhost:8888/v1/chain/register_event
to subscribe all events of account.
The data struct of your request：
{
"account": "account_which_contract_deployed_to",
"post_url": "http://yourserver:yourport"
}
If you subscribe events by curl, here is an example:
curl -X POST -d '{"account":"contract.he","post_url":"http://<IP_ADDRESS>:3000"}' "http://localhost:8888/v1/chain/register_event"
Unsubscribe
You can post this request to unsubscribe by http://localhost:8888/v1/chain/unregister_event
for curl example:
curl -X POST -d '{"account":"contract.he","post_url":"http://<IP_ADDRESS>:3000"}' "http://localhost:8888/v1/chain/unregister_event"
Struct of Event Message When some events emit, the blockchain node will post message to post_url, the message contains event name and a JSON style string.
Now start a http server to listen incoming message:
IMPORTANT: the server instance should support keep-alive
settings.
http = require('http');
fs = require('fs');
server = http.createServer( function(req, res) {
console.dir(req.param);
if (req.method == 'POST') {
console.log("POST");
var body = '';
req.on('data', function (data) {
body += data;
console.log("Partial body: " + body);
});
req.on('end', function () {
console.log("Body: " + body);
});
res.writeHead(200, {'Content-Type': 'text/html'});
res.end('post received');
}
else
{
console.log("GET");
var html = fs.readFileSync('index.html');
res.writeHead(200, {'Content-Type': 'text/html'});
res.end(html);
}
});
port = 3000;
host = '<IP_ADDRESS>';
server.timeout = 0;
serfer.keepAliveTimeout = 0;
server.listen(port, host);
console.log('Listening at http://' + host + ':' + port);
It is different with Ethereum, Gchain blockchain should not store data automatically, you can decide what dataes should be stored to or loaded from database. You can do this by next steps:
Serializable is an interface which defines methods to serialize and deserialize dataes, that supports persistent storage. It defines thress methods：
export interface Serializable {
deserialize(ds: DataStream): void;
serialize(ds : DataStream) : void;
primaryKey(): u64;
}
deserialize(ds: DataStream): void;
To deserialize an object from a datastrem.serialize(ds: DataStream): void;
To serialize an object to a datastream.primaryKey(): u64;
To generate a primary key for this object. If this object will be stored to database as an independent item, the return value will be the primary key in database. Otherwise, the return value is useless.NOTICE
- The compiler would implements these methods automatically and serialize/deserialize all of its member varialbes if a class implements interface Serializeable. If you want to override one or all of three methods, the compiler would choose your implementation and should not generate theme by itself.
- If some member variables should be prevent from being serialized and deserialized, label them with
@ignore
.；- If a member variable is primary key, label it with
@primaryid
. Be attentation the @primaryid member variable must be type of u64. If none member varialbe is labeled with @primaryid, funciton primaryKey() return 0 as default.- If label member variables with @ignore or/and @primaryid, and override function one or all of serialize(), deserialzie() or primaryKey(), the compiler should use overrided functions priority.
Here is an example to describe how to use interface Serializalbe:
class Person implements Serializable {
name: string;
age: u32;
sex: string;
salary: u32;
@ignore
address: string; // be ignored
constructor() {
this.name = "xx";
//...
}
// override function primaryKey(), return id of class Person.
primaryKey(): u64 {
return NAME(this.name);
}
}
If you want to store data to database, the data must support serialize and deserialize. There are some data types can do this:
account_name
is an alias of primitive type of u64.If a contract use DB to persistent data, you must declare table information at your Contract.
Here is a snippet:
class Person implements Serializable {
name: string;
sex: string;
}
class Car implements Serializable {
model: string;
power: u32;
color: string;
}
@database(Person, "persons")
@database(Car, "cars")
// @database() if any more
clas MyContract extends Contract {
//...
// your logic here
}
The compiler will generate two tables in abi file for "persons" and "cars". Be attentation, the classes labeled with @database must implements interface Serializable.
Gchain smart contract uses class DBManager to manipulate reading and write database.
export class DBManager<T extends Serializable> {
constructor(tblname: u64, owner: u64, scope: u64) {}
public cursor(): Cursor<T> {}
public emplace(payer: u64, obj: T): void {}
public modify(payer: u64, newobj: T): void {}
public exists(primary: u64): boolean {}
public get(primary: u64, out: T): boolean { }
public erase(obj: T): void {}
}
tblname: u64
means table name. owner：u64
is always the account which this contract deployed to. scope: u64
is a context.payer
will pay for the storage，obj
is an serializable object.NOTICE You can not drop a table manually, if all of its items eliminated, the table is dropped.
We provide a method cursor() to retrieve all of the table rows. But you must bear in mind that it is a very very low performance operation. It loads all the rows to memory while you invoke cursor(), so if there are too many records, your action will be stucked for a while, and it will fail your action. Here is a snippet to show how to use cursor:
let cursor = this.db.cursor();
Log.s("cursor.count =").i(cursor.count).flush();
cursor.first();
while(cursor.hasNext()) {
let p: Person = cursor.get();
p.prints();
cursor.next();
}
You can classify your data both with scope or primary key in a table, but they are in different dimensions, we should interpret them as below struct:
|--table
|----scope1
|--------primaryKey_1
|--------primaryKey_2
|--------........
|----scope2
|--------primaryKey_x
|--------primaryKey_y
|--------.......
With different scope, items can have the same primary keys.
Here is a demo for manipulate DBManager, refer to Person for details.
import "allocator/arena";
import { Contract } from "gchain-ts-lib/src/contract";
import { Log } from "gchain-ts-lib/src/log";
import { gchain_assert } from "gchain-ts-lib/src/utils";
import { DBManager } from "gchain-ts-lib/src/dbmanager";
import { NAME } from "gchain-ts-lib/src/account";
class Person implements Serializable {
// name: string;
name: string
age: u32;
salary: u32;
primaryKey(): u64 { return NAME(this.name); }
prints(): void {
Log.s("name = ").s(this.name).s(", age = ").i(this.age).s(", salary = ").i(this.salary).flush();
}
}
const tblname = "humans";
const scope = "dept.sales";
@database(Person, "humans")
// @database(SomeMoreRecordStruct, "other_table")
class PersonContract extends Contract {
db: DBManager<Person>;
public onInit(): void {
this.db = new DBManager<Person>(NAME(tblname), this.receiver, NAME(scope));
}
public onStop(): void {
}
constructor(code: u64) {
super(code);
this._receiver = code;
this.onInit();
}
@action
add(name: string, age: u32, salary: u32): void {
let p = new Person();
p.name = name;
p.age = age;
p.salary = salary;
let existing = this.db.exists(NAME(name));
gchain_assert(!existing, "this person has existed in db yet.");
p.prints();
this.db.emplace(this.receiver, p);
}
@action
modify(name: string, salary: u32): void {
let p = new Person();
let existing = this.db.get(NAME(name), p);
gchain_assert(existing, "the person does not exist.");
p.salary = salary;
this.db.modify(this.receiver, p);
}
@action
remove(name: string): void {
Log.s("start to remove: ").s(name).flush();
this.db.erase(NAME(name));
}
}
Generated using TypeDoc


In CS106A, we'll be using Stanford's customized version of
Eclipse to build our programs. Eclipse is an enormously popular
industrial strength Java environment with many
features. Fortunately, Eclipse is also open source -- anyone is
free to change Eclipse to work the way they want. We have taken
advantage of that freedom to install special Stanford features
into Eclipse, tailoring it specifically for CS106A. This
document gives instructions on how to get started using Stanford
Eclipse. Please pay close attention to these instructions and do
not skip steps!
Contents
Mac Installation |
Windows Installation |
I need help!
Installing Eclipse on a Mac
Stanford Eclipse will only work on Mac OS X version 10.6 or higher. If you don't have that version of the operating system, you'll need to either upgrade or do your class work in a public cluster.
- Download and install the Java SDK installer for Mac
- Download the Mac version of Eclipse
- Double-click on the file eclipse-mac.tar.gz to unarchive Eclipse (You can delete eclipse-mac.tar.gz afterwards).
- Drag the Eclipse app into the Applications folder on your Mac.
- Drag the Eclipse icon from there to your Dock to create a shortcut.
- Click on the icon in the dock to open Eclipse. If you see an error that says Eclipse "can't be opened because it is from an unidentified developer," right-click on the Eclipse icon and select "open" instead. You will be able to open Eclipse without right-clicking from now on.
- When you run Eclipse for the first time, you may get a screen that looks like this:
A workspace is just a directory that Eclipse will use to place new projects in. In 106A you won't have to make any new projects from scratch. We will always give you skeleton projects for your assignments, so you don't need to worry about where the workspace is. The suggested location is fine. Click the Use this as the default and do not ask again checkbox, and then click OK.
- Once Eclipse has started, you can close the "Welcome" tab using the "X" in the top left. Click Help -> Install New Software.
- In the "Work with" text box, type https://web.stanford.edu/class/archive/cs/cs106a/cs106a.1174/resources/plugin/ and press Enter.
- Click "Select All," then click Next.
- Click Next again.
- Click "I accept the terms of the license agreement," then click Finish.
- Click OK when you see the warning about installing unsigned content.
- Click Yes when asked to restart Eclipse.
-
Now that you have Eclipse loaded, your next step is to create a new project in your workspace by importing a skeletal framework that we provide called a starter project. Using starter projects makes your life much easier by allowing you to ignore the many details involved in creating a project from scratch. Every assignment will include a starter project for each problem, and your first task will be to download the starter project from the class website and then import it into your workspace. The details for doing so are described in the handout "Using Karel with Eclipse".
Installing Eclipse in Windows
Our version of Eclipse will run on Windows 7, 8 or 10. In the very unlikely event you have an older version of Windows on your computer, you will need to do your class work in one of the public computer clusters. Before installing Eclipse, you will first need to have a copy of the latest version of the Java JRE (Java Runtime Environment) installed on your computer. Note that Java version 1.8 is the latest version of Java. If you don't know which version, if any, of the JRE you have, or want to upgrade to the latest version, just start at Step 1. We recommend most students at Step 1.
- Uninstall previous versions of the
JRE. Before installing a new version of the JRE, we
recommend that you remove any older copies that may be
installed on your system.
-
If you have Windows 7 or 8, do the following: Click
on Start, then click on Control
Panel, then select Programs and
Features.
If you have Windows 10, do the following: Click
on Start (the Windows icon in the lower
left-hand corner), then click
on Settings (the gear-shaped icon),
then select Apps & Features.
- From the list of programs you see, uninstall
any occurrences of Java/J2SE Runtime Environment, Java
SDK, Java SE Development Kit or Java Update. Note that the
exact program name may
be slightly different or include a version number, but you
generally want to remove anything that includes the text:
Java/J2SE Runtime Environment, Java SDK, Java SE
Development Kit or Java Update. To remove a program, click
on the program name to
highlight it and click the the Uninstall
button.
- Download and install the JRE:
32 bit
version or 64
bit version
After clicking this link a prompt
will appear to ask you whether you want to run or save the
file. Click Run to begin the download and
installation process. If you did not get a prompt to run the
file after the download completed, you should double-click the
file you downloaded to run it manually. If a subsequent
security warning dialog box appears, click Run
(or Yes) to continue with the
installation. The Java JRE installation program should
begin. Do a Typical installation (just use the default setting
in the installation process), and follow the rest of the
instructions given in order to complete your
installation.
- Download Eclipse:
32 bit version
or 64 bit version
Save the downloaded file to somewhere on your hard drive. This may
take a little while as the file is rather large.
- Unzip/extract the contents of the file by right-clicking
on the folder you just downloaded, selecting
the Extract All... option and
typing C:\Program Files as the location to
extract the files to.
Then continue following the steps in the extraction process.
- Create a shortcut to Eclipse on your Desktop for easy
access — Open the C:\Program
Files\eclipse directory, and right-click and
drag the eclipse.exe file (the Eclipse application) to your
desktop and then select the option Create shortcut here.
Note: If you installed the 64 bit versions of the software, and
find that you have issues running Eclipse, we recommend that
you uninstall the 64 bit versions of the both the JRE and
Eclipse and install the 32 bit versions of both.
At this point you should have Eclipse installed and working on your computer. When you run Eclipse for the first time, you may get a screen that looks like this:
A workspace is just a directory that Eclipse will use to
place new projects in. In 106A you won't have to make any new
projects from scratch. We will always give you skeleton projects
for your assignments, so you don't need to worry about where the
workspace is. The suggested location is fine. Click
the Use this as the default and do not ask
again checkbox, and then click OK. Once you do, Eclipse
will start running -- and after what may seem like a relatively
long time -- bring up a screen that looks something like this:
Once you have Eclipse loaded, your next step will usually be
to create a new project in your workspace by importing a
skeletal framework that we provide called a starter
project. Using starter projects makes your life much easier by
allowing you to ignore the many details involved in creating a
project from scratch. Every assignment will include a starter
project for each problem, and your first task will be to
download the starter project from the class website and then
importing it into your workspace. The details for doing so are
described in the handout "Using Karel with
Eclipse".
Having trouble with your installation?
Check out this doc for
, email the Head TA or stop by their Office Hours, or stop by the LaIR. During the first week, you can also stop by the Eclipse Setup Session on Friday 1/13 3-5PM in Hewlett 200.


Chat
Profile
+
-
Hello!
10:10:01
Kate
Wow,Hi!
10:11:02
Anny
How are you?
10:11:03
Kate
Fine! What about u?
10:11:04
Anny
>


Define Fragments¶
Generate Fragment PDB Files¶
Use a molecular editor like Avogadro to generate fragments of your target molecule. It is important to use the PDB named XXX_0001.pdb created by to generate your fragments! BSFF will be using this PDB as a reference throughout the protocol. In addition, all atoms in this PDB have unique identifiers that are essential for mapping transformations in later steps.
General rules for defining fragments:
SHOULD BE RIGID i.e. rings, aromatic, conjugated systems. An extra step is required for fragments that contain rotatable bonds, described below.
Consist of 5-10 atoms
Contain a maximum of three hydrogen bond donors/acceptors
Simply delete atoms from the molecule until you end up with your desired fragment. Save as a .pdb file, then rinse and repeat until you have defined fragments for you entire target molecule. I find anywhere between 5-8 fragments is sufficient for target molecules that are 600Da or less.
You should name each of your files Fragment_<number>.pdb
, where <number> enumerates each fragment.
Move all of your fragments to the Fragment_Inputs directory so that your project looks like this:
+-- Compounds
+-- <Compound_ID>
+-- Inputs
+-- Fragment_Inputs
| +-- Fragment_Inputs.csv
| +-- * All fragment .pdb files *
+-- Rosetta_Inputs
| +-- * All conformer .pdb files *
| +-- * All conformer .param files *
+-- User_Inputs
Fragments with Rotatable Bonds¶
You will need to tell BindingSitesFromFragments if your fragment contains rotatable bonds. Otherwise, cluster analysis
in later steps will return garbage. To do this, create a new directory under Fragment_Inputs/
called Rigid_Fragment_Atoms
and populate it with the rigid portions of your fragments. Rename the .pdb files to Fragment_<number>-rigid.pdb
, where
<number>
corresponds to the original fragment. BindingSitesFromFragments will use these atoms for alignments.
Finding Fragment-Containing Small Molecules¶
Once you have defined your fragments, we will use the PubChem Open Chemistry Database to find small molecules that contain your defined fragments as substructures. We will specifically be using the Substructure Search tool located under Compounds > Structure > Substructure. Click on the litte hexagon at the left of the textbox to bring up the PubChemSketcherhttps://pubchem.ncbi.nlm.nih.gov/sketch/sketchhelp.html. This tool allows you to import your fragment .pdb and specify the characteristics and connectivities of each atom of your fragment in the substructure search results.
First, import your fragment into the PubChem Skether using the Import panel located in the bottom left of the pop-up window. You need to click import after selecting your fragment. Your fragment will now be imported into the sketcher, where atoms that do not have full valency represent where covalent bonds were broken to create your fragment. You will need to tell PubChem the allowed chemical environment for these atoms (e.g. what are these atoms allowed to be bonded to) using the Query tool (Qry in the top row of the panel). Click the query tool and then click atoms in your fragment to specify attributes.
The attributes I find useful are:
Query flags: use this to specify where this fragment atom is allowed to be mapped onto superstructures. For instance, check aromatic if the selected atom should always be mapped to an aromatic ring, or if an atom should always be part of an aliphatic chain.
Allowed Substituents: use this to specify how many heavy atom neighbors an atom should have when the fragment is mapped to a superstructure. This is important to ensure the molecules returned by PubChem contain your fragment in the same chemical environment as your target molecule.
Ring sizes: use this to specify ring size if your fragment is a portion of a ring system.
After you finish specifying atom attributes, return to the main PubChem search page. To get all small molecules that we are most likely to find bound to proteins in the PDB:
1. Click “Search Options” and uncheck Remove any explicit hydrogens before searching. If your fragment contains stereochemistry, also enable exact sterochemistry. 2. Click “Search All” where it displays the search result count 3. Click on “Filters” and enter an upper limit of ~500Da. This removes large molecules we are unlikely to find in the PDB. In addition, we are interested in finding small molecules where our fragments contribute significantly to binding affinity, which is not necessarily the case in extremely large molecules. 4. Sort by “Annotation Hit Count” and click the arrow pointing down to sort most annotated to least annotated. If all goes well the search results will have actual names instead of numeric IDs. 5. Click “Detailed” to bring up detailed descriptions of molecules in the search results. This is required so that the .csv we are about to download will contain the InChiKey for each molecule in the search results. 6. Click “Download”. Save the .csv with the same name as the input fragment in the
Fragment_Inputs
directory, for exampleFragment_<number>.csv
.
The .csv will contain the top 1,000,000 search results for small molecules that contain our fragment as a substructure with the same connectivites and local chemical environments as our target molecule.
Add each fragment number and its SMILES string to Fragment_Inputs.csv
. BindingSitesFromFragments will read this file
to search the PDB for protein-ligand complexes where the ligand contains a fragment as a substructure. When you’re
finished generating fragments, your Fragment_Inputs.csv
file should look something like this:
Fragment |
SMILES_fragment |
|---|---|
<number> |
<SMILES_string> |
<number> |
<SMILES_string> |
<number> |
<SMILES_string> |
Your project should now look like this:
+-- Compounds
+-- <Compound_ID>
+-- Inputs
+-- Fragment_Inputs
| +-- Fragment_Inputs.csv
| +-- * All fragment .pdb files *
| +-- * All fragment .csv search results from PubChem *
+-- Rosetta_Inputs
| +-- * All conformer .pdb files *
| +-- * All conformer .param files *
+-- User_Inputs
That’s about it for inputs (despite an untouched directory called User_Inputs
…)! We can now proceed to searching for
PDBs that contain proteins bound to small molecules in the PubChem search results for each of your defined fragments.


Nazneen Shaik seamlessly maintain team building strategic theme areas.
#xyz test in Pie track12 min agoNazneen Shaik seamlessly maintain team building strategic theme areas.
#xyz test in Pie track12 min agoNazneen Shaik seamlessly maintain team building strategic theme areas.
#xyz test in Pie track12 min agoNazneen Shaik seamlessly maintain team building strategic theme areas.
#xyz test in Pie track12 min agoNazneen Shaik seamlessly maintain team building strategic theme areas.
#xyz test in Pie track12 min agoNazneen Shaik seamlessly maintain team building strategic theme areas.
#xyz test in Pie track12 min ago
Contacts
{% for key, value in member_dict.items %}
{{ key }}{{ value }}
{% endfor %}
Projects
{% for project_iter in project_list %}
{{ project_iter.name }}{{ project_iter.description }}
{% endfor %}


Milito Pizza is Kenya's Favorite Pizza, and the leading
pizza restaurant in Kenya.
Through innovation and
creativity we are able to offer the widest range of
pizza allowing our customers to choose from a wide
range of classic,
quality pizza.


About Me:
I graduated top of my class from the Family and Human Services program at the University of Oregon in 2010. My focus was in early childhood education.  Our program is one of exploration and learning that will offer your child the opportunity to thrive in a cohesive and exciting environment.
About Me:
I received my Associates degree in Early Childhood Education and have ten plus years of teaching experience. I am married to a retired mill worker and together we have six children and twenty-three grand children! My hobbies are scrap booking, photography, I love to photograph nature's beauty especially sun rises, sun sets and waterfalls. Thank you in advance for allowing me to care for greatest possession-your children. I am looking forward to meeting you in person.
About Me:
I have been married to my wonderful husband, Edward for 20 years and we have 2 beautiful daughters, Macie and Kristen. I have been working and caring for young children for more than 20 years and went to Lane Community College for formal training. I love working with pre-school aged children and being able to foster their love for learning.


{% extends "header.html" %} {% block body %}
So now that we've compared the life expectency of these strategies, we should also compare profits. First we can just compare profit vs loss, but also degree of profits is important. Both strategies stand to lose equal amounts, but this is not the case for gains. It is clear that our doublor bettor, despite having lower life expectancy, has far more upside compared to the simple bettor.
import random import matplotlib import matplotlib.pyplot as plt import time sampleSize = 10000 startingFunds = 10000 wagerSize = 100 wagerCount = 100 def rollDice(): roll = random.randint(1,100) if roll == 100: return False elif roll <= 50: return False elif 100 > roll >= 50: return True def doubler_bettor(funds,initial_wager,wager_count,color): global doubler_busts ##################### global doubler_profits value = funds wager = initial_wager wX = [] vY = [] currentWager = 1 previousWager = 'win' previousWagerAmount = initial_wager while currentWager <= wager_count: if previousWager == 'win': if rollDice(): value += wager wX.append(currentWager) vY.append(value) else: value -= wager previousWager = 'loss' previousWagerAmount = wager wX.append(currentWager) vY.append(value) if value < 0: currentWager +=<PHONE_NUMBER>0000000 doubler_busts += 1 elif previousWager == 'loss': if rollDice(): wager = previousWagerAmount * 2 if (value - wager) < 0: wager = value value += wager wager = initial_wager previousWager = 'win' wX.append(currentWager) vY.append(value) else: wager = previousWagerAmount * 2 if (value - wager) < 0: wager = value value -= wager previousWager = 'loss' previousWagerAmount = wager wX.append(currentWager) vY.append(value) if value <= 0: currentWager +=<PHONE_NUMBER>0000000 doubler_busts += 1 currentWager += 1 plt.plot(wX,vY,color) ##################### if value > funds: doubler_profits+=1 ''' Simple bettor, betting the same amount each time. ''' def simple_bettor(funds,initial_wager,wager_count,color): global simple_busts ##################### global simple_profits value = funds wager = initial_wager wX = [] vY = [] currentWager = 1 while currentWager <= wager_count: if rollDice(): value += wager wX.append(currentWager) vY.append(value) else: value -= wager wX.append(currentWager) vY.append(value) if value <= 0: currentWager +=<PHONE_NUMBER>0000000 simple_busts +=1 currentWager += 1 plt.plot(wX,vY,color) ##################### if value > funds: simple_profits+=1 x = 0 simple_busts = 0.0 doubler_busts = 0.0 ##################### simple_profits = 0.0 doubler_profits = 0.0 while x < sampleSize: simple_bettor(startingFunds,wagerSize,wagerCount,'c') #simple_bettor(startingFunds,wagerSize*2,wagerCount,'c') doubler_bettor(startingFunds,wagerSize,wagerCount,'k') x+=1 print(('Simple Bettor Bust Chances:', (simple_busts/sampleSize)*100.00)) print(('Doubler Bettor Bust Chances:', (doubler_busts/sampleSize)*100.00)) print (('Simple Bettor Profit Chances:', (simple_profits/sampleSize)*100.00)) print(('Doubler Bettor Profit Chances:', (doubler_profits/sampleSize)*100.00)) plt.axhline(0, color = 'r') plt.ylabel('Account Value') plt.xlabel('Wager Count') plt.show()
Your results may vary slightly, but they should be something like:
('Simple Bettor Bust Chances:', 0.0) ('Doubler Bettor Bust Chances:', 31.269999999999996) ('Simple Bettor Profit Chances:', 38.32) ('Doubler Bettor Profit Chances:', 63.190000000000005)