Programming Assignment 2 - Part 1 (tasks A,B)
CS3230 - Design and Analysis of Algorithms
Spring - 2015
Graphs Transformation
Background
Previously, Anka's team has successfully built a software module for fast multiplication. Now, they are integrating this software module into the spaceship's software system. In this software system, each software module may depend on other modules to run,
thus forming a big dependency graph. The team wants to check whether there is a simple cycle of dependencies that involes all modules. Anka hasn't found any efficent solution for this problem yet.
She realized that this problem is exactly the same as the Hamiltonian Cycle
problem, which is hard. To solve it, she may need to efficiently reduce the problem into other relevant problems.  Can you help her to transform the problems in C++ or Java?
Relevant Problems and Algorithm
Directed Hamiltonian Cycle problem (Dir_Ham_Cyc):
Consider a directed graph Gd = (V,E) of N vertices.
Decide whether there exists a simple directed cycle Cd that contains every vertex exactly once.
Undirected Hamiltonian Cycle problem (Undir_Ham_Cyc):
Consider an undirected graph Gu = (V,E) of N vertices.
Decide whether there exixts a simple undirected cycle Cu that contains every vertex exactly once.
Poly-Time Transformation Algorithm
Transformation from Dir_Ham_Cyc to Undir_Ham_Cyc:
Input: G = (Vg,Eg);
Build H = (V,E) -- an undirected graph, where:
1. Each vertex v in Vg is transformed into 3 vertices in V: hv (head-vertex of v), v, and tv (tail-vertex of v);
2. For each v in Vg: undirected edges (tv,v) and (v,hv) are in E;
3. Each directed edge (u,v) in Eg is transformed into an undirected edge (hu, tv) in E.
Output: H = (V,E)
See picture for example.
Task A (Verifier) [50 points]:
Given a graph G, and a list P of vertices. You have to check whether P forms an undirected Hamiltonian cycle in G.
Input:
First line of input is the number T of testcases. Next are T blocks of lines, each block describes a testcase.
In each block:
First line is N (number of vertices), M (number of edges)
Next M lines write 2 strings u,v describing an undirected edge (u,v), where u,v are names of the vertices.
Next line writes an integer number p - number of vertices in the path P.
Last line writes names of a p vertices, separated by a space.
Output:
For each testcase in the input, output the corresponding answer on one line, i.e.:
Output "YES" if P is a undirected Hamiltonian cycle, output "NO" otherwise.
Constraints:
Length of the vertex name is at most 6 characters.
1<=T<=50; 2<=N <=300; 2<=M <=30000.
Memory: 256M
Running time: 2 seconds per T testcases.
Sample input:
5
2 2
AA BB
BB AA
3
AA BB CC
3 4
V1 V2
V1 V3
V2 V3
V3 V1
4
V1 V2 V3 V1
3 4
V1 V2
V1 V3
V2 V3
V2 V1
4
V3 V1 V2 V3
3 4
AA bb
AA CC
bb CC
CC AA
3
AA bb CC
3 4
V1 V2
V1 V3
V2 V3
V1 V1
4
V1 V2 V1 V1
Sample output:
NO
YES
YES
NO
NO
Task B (Poly-Time-Reduction) [50 points]:
You have to transform an instance of Dir_Ham_Cyc into an instance of Undir_Ham_Cyc, such that an answer yes for the former implies an yes for the latter, and vice versa.
Your transformation must follow the algorithm given above, with following constraints:
if the name of the vertex in original graph is Vxxxx, then the head-vertex and tail-vertex of that vertex in transformation must have name
Hxxxx and Txxxx. See picture for example.
In addition, you need to output the edges in lexicographic order of the vertice's name.
Input:
First line of input is the number T of testcases. Next are T blocks of lines, each block describes a testcase (An instance of Dir_Ham_Cyc, that is, a directed graph Gd).
In each block: First line is two integer numbers: N (number of vertices), and M (number of edges)
Next M lines describe M edges: each line writes 2 strings u, v separated by a space, describing a directed edges (u,v), where u,v are names of the vertices.
Output:
For each testcase in the input, you have to output a corresponding transformed graph (An instance of Undir_Ham_Cyc, that is, undirected graph Gu), with the following blocks of lines:
First line: Nv (number of vertices), and then Me (number of edges)
Next Me lines: Name of two vertices u and v for each edge (u,v) of the transformed graph, separated by a space.
Constraints:
The name of vertices in the input is always started with "V", with length at most 6.
Since the transformed graph is undirected, an edge (u,v) is the same as (v,u). Thus, you have to count and output only the edge (u, v), where u <= v (lexicographic order).
The edges must be outputed in lexicographic order of vertices' name. That is, for two edges (u,v) and (x,y): if u < x, or if u==x and v < y, the edge (u,v) must be outputed before (x,y). See sample output for example.
1<=T<= 50; 2<=Nv<=300; 2<=Me<=30000
Memory: 256M
Running time: 2 seconds per T testcases.
Sample input:
1
4 5
V11 V22
V22 V33
V33 V11
V22 V44
V44 V33
Sample output:
12 13
H11 T22
H11 V11
H22 T33
H22 T44
H22 V22
H33 T11
H33 V33
H44 T33
H44 V44
T11 V11
T22 V22
T33 V33
T44 V44
(End of problem's description)


{{How this test works:}} {{Your browser will be instructed to reach a series of URLs. The combination of successes and failures tells a story about how ready you are for when publishers start offering their web sites on IPv6.}}
{{Click to see}} {{Tests Run}}
|
{{Test with IPv4 DNS record}}
{{pending}}
-
|
{{Fetches an object that has just an A record in DNS. This is expected to use IPv4. IPv6-only users might still reach this, if their provider has employed a NAT64/DNS64 or proxy solution.}}
|
|
{{Test with IPv6 DNS record}}
{{pending}}
-
|
{{Fetches an object that has just an AAAA record in DNS. This is expected to use IPv6. Users not yet on the IPv6 Internet are likely to see this fail. As long as it fails quickly, it will be OK - for now.}}
|
|
{{Test with Dual Stack DNS record}}
{{pending}}
-
|
{{This is the most important test. This verifies your browser can connect to a site that has both IPv4 and IPv6 records published. IPv4 only hosts should connect fine (using IPv4).}}
{{If this test fails or times out, you can expect major problems as publishers start offering their sites on IPv6.}} |
|
{{Test for Dual Stack DNS and large packet}}
{{pending}}
-
|
{{Validates that you can connect to a dual-stack server (like the ds test); and that you can send/receive large packets on that connection. If this test times out for any reason, it indicates trouble for World IPv6 Day.}}
|
|
{{Test IPv6 large packet}}
{{pending}}
-
|
{{Validates that IPv6 requests with large packets work. If this test times out, but other IPv6 tests work, it suggests that there may be PMTUD issues; possibly involving IP tunnels.}}
{{Double check to make sure that ICMPv6 Type 2 ("Packet Too Big") messages are not filtered by your firewall.}}
|
|
{{Test if your ISP's DNS server uses IPv6}}
{{pending}}
-
{{(This is bonus credit)}}
|
{{This is a test of your ISP's resolver (instead of a test of your host). If this test passes, your DNS server (often run by your ISP) is capable of reaching IPV6-only DNS authoritative servers on the Internet. This is not critical (at this time) for you to reach sites via IPv6.}}
|
|
{{Find IPv4 Service Provider}}
{{pending}}
-
|
{{Attempts to identify what Internet Service Provider you use for IPv4. This may be different from the marketing name you see in your local market; or may reflect a previous company name. The name shown reflects how it is known in the network operator community.}}
|
|
{{Find IPv6 Service Provider}}
{{pending}}
-
|
{{Attempts to identify what Internet Service Provider you use for IPv6. When the IPv4 name and the IPv6 name don't match, it may suggest that you're using a tunnel; or some form of third party provider for IPv6.}}
|
{{If the summary results indicated problems, you (or your technical support) may be able to use the information above to diagnose the issues. Each of the test urls and their results is shown on the left side. To the right you'll see a description of what that URL was designed to test.}}
{{Click to see}} {{Share Results / Contact}}


Learning Management System (LMS) Conformance Test Sequencing Test SCO
This test may take several minutes to complete.


Integrating a FAKE build script into TeamCity
Easy TeamCity integration was one of the major goals for the FAKE build system.
In this article you will learn how to set up a FAKE build script in TeamCity. We will use the CalculatorSample which you can build from the getting started guide.
Installing TeamCity
You can download the free professional edition of TeamCity from http://www.jetbrains.com/teamcity/. After the installation process you should be ready to configure your first build.
Creating a FAKE project on TeamCity
Now create a new project and add a build configuration:
You also need to set the artifacts paths:
Attach a VCS root
The next step is to attach a VCS root. For this sample we will use the official FAKE repository at https://github.com/forki/FAKE/.
Creating the build step
Now is the time to create two build steps. The first one downloads FAKE via Nuget and the second one runs the build script:
If you want you could also add a build trigger to your build script:
Running the build
Now if everything is configured correctly, you can run your build and the output should look like:
You can also inspect the NUnit results:


Classic snake game
Use the arrows to move the snake.
You can use the keys N, S, and P instead of the html buttons new game, start, and stop
In order to play the game in Firefox you have to click on the canvas to make the keys work!
The game works very well on Chrome!
The game doesn't work on Internet Explorer because I use the unsupported CustomEvent class
New game
Start
Stop


Tia Te Hiko
Full Stack Web Developer
{{ today's accomplishments were yesterday's impossibilities }}
Values
Family and Friends
Growth
Gratitude
Loyalty
Passion
Travel
Aesthetic Designs
Ocean & Nature
Health + Fitness
BLOG
ABOUT
Financy
Love & Light - Home Fragrances
Games
Technical Blog Posts
Human Blog Posts
TBA
CONTACT


--- layout: post title: no title date: '2008-09-19T15:58:01+01:00' tags: [] tumblr_url: http://backlog.robbevan.com/post/50860356 ---


User Account
Sergio Sánchez
Developer
0
Total Purchases
0
€
Total Spent this Month
0
€
Total Spent
Profile Account
Personal Info
Change Avatar
Change Password


First, select a work and then click 'prepare the data'.
Wait to click 'show table' button below until this says 'ready'


KonaKart Integration
KonaKart is a Java based eCommerce Shopping Cart Software.
KonaKart supports various databases, but the following step-by-step instruction is based on PostgreSQL (and MySQL)
Install PostgreSQL on a Linux server
- uname -a
- sudo bash
- aptitude search postgres
- aptitude install postgresql-8.2
- ls /var/lib/postgresql/8.2/
- /etc/init.d/postgresql-8.2 stop
- /etc/init.d/postgresql-8.2 start
- su - postgres
- psql -U postgres
- List/show all databases contained by this instance: select * from pg_database;
- select * from pg_tables;
- \q
Install PostgreSQL on Mac OS X (Snow Leopard)
- http://www.postgresql.org/download/macosx
- sudo bash
- su - postgres
- In the case of 9.0 one has to init the DB after installing, e.g. /Library/PostgreSQL/9.0/bin/initdb -D /Library/PostgreSQL/9.0/data
- /Library/PostgreSQL/8.4/bin/pg_ctl -D /Library/PostgreSQL/8.4/data stop
- /Library/PostgreSQL/8.4/bin/pg_ctl -D /Library/PostgreSQL/8.4/data start
Install MySQL on Mac OS X (Snow Leopard)
- http://dev.mysql.com/downloads/mysql/
- Download Community Server DMG Archive: mysql-5.1.47-osx10.6-x86_64.dmg
- Open DMG
- Double-click mysql-5.1.47-osx10.6-x86_64.pkg
- Will be installed to /usr/local/...
- Double-click MySQLStartupItem.pkg
- Will be installed to /Library/StartupItems/...
- sudo /Library/StartupItems/MySQLCOM/MySQLCOM start
- sudo /Library/StartupItems/MySQLCOM/MySQLCOM stop
- In order to disable automatic startup during system boot: vi /etc/hostconfig (set MYSQLCOM=-YES- to NO)
- Test mysql: /usr/local/mysql/bin/mysqlshow -uroot -p
- Display version: /usr/local/mysql/bin/mysqladmin version
- Import MySQL dump:
- /usr/local/mysql/bin/mysql -uroot -p < /Users/michaelwechner/dump.sql
- The initial root account passwords are empty, hence just hit enter when being asked for the password
- Assuming that the dump created a database called 'my-database', which contains a table 'my-table':
- /usr/local/mysql/bin/mysql -uroot -p my-database
- show tables;
- select * from my-table;
- quit
- ...
Install KonaKart
Import KonaKart sample data into PostgreSQL
- Create a KonaKart database within PostgreSQL:
- sudo bash
- /etc/init.d/postgresql-8.2 start
- su - postgres
- dropdb -U postgres konakart
- createdb -U postgres --encoding unicode konakart
- Import the sample data (e.g. a dump):
- Depending on what web-server port you want to run KonaKart, you might have to change the port within the KonaKart sample data:
- grep 8780 konakart/database/PostgreSQL/konakart_demo.sql
- Replace the port number 8780 for example by 8080: vi: 1,$s/8780/8080/g
- grep localhost:8780 konakart/database/PostgreSQL/konakart_demo.sql
- Replace localhost by the actual server host name
- Import the data: psql -U postgres -d konakart -f konakart/database/PostgreSQL/konakart_demo.sql
- Test the data:
- psql -U postgres -d konakart
- select * from products;
- \q
- ...
- ...
Configure the database connection within KonaKart and PostgreSQL
- cd konakart
- webapps/konakart/WEB-INF/classes/konakart.properties
- torque.database.store1.adapter = postgresql
- torque.dsfactory.store1.connection.driver = org.postgresql.Driver
- torque.dsfactory.store1.connection.url = jdbc:postgresql://localhost:5432/konakart
- torque.dsfactory.store1.connection.user = postgres
- torque.dsfactory.store1.connection.password =
- webapps/konakartadmin/WEB-INF/classes/konakartadmin.properties
- Make sure that postgreSQL is listening
- vi /etc/postgresql/8.2/main/postgresql.conf
- listen_addresses = 'localhost,<IP_ADDRESS>'
- netstat -nt -l | grep 5432
- Make sure that you can connect without password from localhost:
- vi /etc/postgresql/8.2/main/pg_hba.conf
- host all all <IP_ADDRESS>/32 trust
- host all all ::1/128 trust
Running KonaKart
- Either run the Tomcat which is part of the distribution
- cd konkart
- OPTIONAL: To be on the safe reconfigure the port 8005 within conf/server.xml by for example 8705
- OPTIONAL: Enable SOAP: webapps/konakart/WEB-INF/server-config.wsdd (<parameter name="allowedMethods" value="*"/>)
- chmod -R 775 bin
- ./bin/startup.sh
- http://<IP_ADDRESS>:8780/konakart/
- SOAP: http://<IP_ADDRESS>:8780/konakart/services/KKWebServiceEng
- Or build war files
- cd konakart/custom
- ant make_wars
- cp war/* MY_TOMCAT/webapps/.
- OPTIONAL: Make sure that database connection is configured correctly (as described above)
- Frontend: http://<IP_ADDRESS>:8080/konakart/
- Backend: http://<IP_ADDRESS>:8080/konakartadmin/
Alternative: Use the silent installer on Linux (WARNING: Does not work on Mac OS X)
- Download the Linux installer: http://www.konakart.com/downloads/community_edition
- ./konakart-linux-install -S -DInstallationDir /home/wyona/konakart -DDatabaseType postgresql -DDatabaseUrl jdbc:postgresql://localhost:5432/konakart -DDatabaseDriver org.postgresql.Driver -DDatabaseUsername postgres
- Startup: It seems that the silent installer starts Tomcat automatically on port 8780
- netstat -nt -l | grep
- http://<IP_ADDRESS>:8780
- Otherwise use /home/wyona/konakart/bin/startup.sh
- IMPORTANT: Make sure that your data within the database is also using the port 8780
Installing the Enterprise Edition (manually)
- Also see http://www.konakart.com/docs/manualInstallation_EE.html
- Assume we have installed the community edition at /home/foo/konakart
- ./bin/shutdown.sh
- Unzip konkart enterprise package (e.g. KonaKart-Enterprise-<IP_ADDRESS>.zip) within some temporary directory, e.g. /home/foo/tmp/konakart
- Copy (overwrite) all files and directories from the enterrpise to the community directory, e.g. cp -r /home/foo/tmp/konakart/* /home/foo/konakart/.
- ./bin/startup.sh
- Try using a feature which is only supported by the enterprise edition, e.g. switching the language within konakartadmin.
Help
Misc


The carrier configuration settings screen allows the shipping user to view the carrier details of particular Location and Carrier Name which are setup by the Client Admin as in Figure 6.1.
Figure 6.1
The shipping user can view the carrier details based on the Carrier Name.
The Carrier Service details are disabled to the shipping user and user is allowed to select the carrier name from the List Of Values (LOV) available and click on GO button as in Figure 6.2 to view the Carrier Details.
Figure 6.2
If the Carrier Name is Fedex, the carrier details will be displayed related to the specified carrier as shown below in Figure 6.3.
Figure 6.3
If the Carrier Name is UPS, the carrier details will be displayed related to the specified carrier as shown below in Figure 6.4.
Figure 6.4
The Carrier Configuration screen describes the Carrier Service Details,Account Number Details, Ship Method Mapping details and Email Notification Details to the â€śshippinguserâ€? for specific ' Carrier '.
Following are the carrier details: (Figure 6.5)
Carrier Code |
We are using carrier code for internal validations and mapping such as UPS, FDXE, FDXG and others |
Enable flag |
Used in order to activate/deactivate particular carrier. Note: We need to check this check box in order to go to ship |
Protocol |
Specify the Protocol for Carrier such as http/https |
Port |
Port number of the carrier. |
Mode |
This is used to know the mode of transmission such as it is atom/web service/connect ship etc. |
Server IP Address |
IP address where carrier API located. |
User name |
User name with which we can login to carrier site. |
Password |
Password with which we can login to carrier site. |
Prefix |
Prefix that is given by the carrier. |
Domain |
Specify the domain for carrier such as GLOG. |
Account No. |
This is the attribute value where the Account number details that are registered with specific carrier, are shown when clicked on Details Button. For More Information, Refer Figure 6.6 & Figure 6.7 |
Account Number Details
Account Numbers for FEDEX :
If the Carrier Name is FedEx, all the Account Number details will be displayed as shown below in Figure 6.6
Figure 6.6
Account Numbers for UPS
If the Carrier Name is UPS, all the Account Number details will be displayed and the Account Registered Status as Yes (If Account is registered successfully), as shown below in Figure 6.7 .
Figure 6.7
Account No |
Account number that is registered with specific carrier. |
Active |
Whether the account is active or not |
Negotiated Flag |
To check whether account number is registered for negotiated rates(discount) |
Negotiated Rates |
To use Negotiated Rates Shipping in ShipConsole. For more information, please refer and |
Default |
The default account will be used for shipment in ShipConsole. |
These are specific to Fedex carrier Figure 6.6:
Meter Number |
Meter Number is used to specify client account number uniquely for FedEx. |
Account User Name |
It is the username of the registered customer |
Account Password |
It is the encrypted password of the registered customer |
These are specific to UPS carrier Figure 6.7:
Access License Number |
Access License Number is used to specify client account number uniquely for UPS. |
Account Registered |
Whether the account is registered or not. |
Negotiated Flag:
This checkbox is used to identify whether the Account Number is registered for negotiated rates or not. If this is checked, then â€śNegotiated Ratesâ€? checkbox will be enabled.
Negotiated Rates from Carrier Configuration:-
Depending on selection of â€śNegotiated Ratesâ€? checkbox in carrier configuration module by 'Client Admin ', the shipping user can identify whether to use Negotiated Rates for Freight Charges in shipment page or not. The client admin is responsible to select this option on carrier and organization basis and the shipping user can view here.
If check box is checked Negotiated Rates will be shown in both freight Charges and Shipment cost fields. Value in Freight charges field will be saved to oracle.
Figure 6.8
Figure 6.8.1
If check box is un-checked Negotiated rates values will be saved in Shipment Cost field and Published Rates in Freight Charges field (Figure 6.8.1).
Ship Method Mapping Details
â€śGo To Ship Method Mappingâ€? button will be disabled as in Figure 6.9. Only after Clicking on â€śGOâ€? button, the button will be enabled and When user clicks on â€śGo To Ship Method Mappingâ€? button, it navigates to Ship Method Mapping Details screen.
Figure 6.9
Ship Method Mapping Details Screen is used to customize user defined ship method names to be seen in the application, based on the carrier and Organization. Client admin has the responsibility to setup the user defined ship methods. This screen includes Ship Method, CarrierServiceLevel, Validation, Enabled, User Defined Ship Method and International Flag as shown below.
Note: Shipping user can only view the ship method information but cannot modify it. Save & Clear buttons will be disabled to the shipping user. On clicking Close button, page will be redirected to Carrier Configuration.
(a) FedEx Figure 6.10 describes Ship Method Information for FedEx carrier
Figure 6.10
(b) UPS Figure 6.11 describes Ship Method Information for UPS carrier.
Figure 6.11
User Defined Ship Method |
To define the User Ship method. |
Carrier Service Level |
This will indicate the Carrier service level. |
Validation |
Used for defining the front end validations. |
Enabled |
To know whether particular ship method is active/not. |
International |
Check this field for the International Shipping |
We are restricting admin user to map unique user defined ship method to each ship method within same carrier or against different carriers.
We are providing this validation because, if same user defined ship method is mapped to different ship methods, the user will not be able to differentiate between the two ship methods in Shipments page. Confusion may arise as to which carriers, those ship methods are mapped to. To avoid this confusion, user defined ship methods should be unique.
Email Notification Details
The Email Notification details for the shipping user looks like Figure 6.12
Figure 6.12
Email Notification Required |
Check this field to include Email Notification to be appended by carrier. |
Sender Email |
Email Address of the sender. For Example<EMAIL_ADDRESS>|
Ship Notification |
Check this field to include Ship Notification to be appended by carrier. |
Exception Notification |
Check this field to include Exception Notification to be appended by carrier. |
Customer Name |
Check this field to include Customer Name to be appended by carrier. |
Sales Order Number |
Check this field to include Sales Order Number to be appended by carrier. |
Reference1 Required |
Check whether Reference1 value can be sent in the email notification. |
Referenc2 Required |
Check whether Reference2 value can be sent in the email notification. |
Delivery Notification |
Check this field to include Delivery Notification to be appended by carrier. |
Items Numbers on Delivery |
Select if you want the notification to be sent by UPS when the package is delivered |
Format |
Select the Format of the E-Mail Notification to be send. For Example as Text/HTML. |


Menuitems
-
The "File-menu" has the menuitems:
- New. With "New" you clear all editors so you can create a new
file.
- Open. With "Open" you can open an existing file.
- Save. With "Save" you can save the content of all editors in
a file.
- Save as. With "Save as" is allmost the same like "Save" but
you can specify another directory and name for the file.
- Exit. With "Exit" you finish the programm.
-
The "Edit-menu" has the menuitems:
- The "Look and Feel"-menu has the menuitems:
- Metal. With the "Metal"-menuitem is the default
gui(graphical user interface).
- Motiv. With the "Motiv"-menuitem the look and feel is like
you know it from emac.
- Windows. With the "Windows"-menuitem the look and feel is
like you know it from Windows.
-
The "Help-menu" has the menuitems:
- Content: This is the helpcontent that you are just reading.
- License: This shows the license from the application.
- Info: With the "Info"-menuitem opens a Dialog with the
information about the developer.


Once connected the next step is to get some content into RealityServer® so we can render it. This can be acheived in a number of ways but the most common is to load it from a file.
State
We'll update the state to include the filename we want to load and a name for the scene. We'll use the meyemii
scene that is used in the standard RealityServer® demos.
const state = {
server: {
host: 'localhost',
port: 8080,
secure: false
},
scene_filename: 'scenes/meyemii.mi',
scene_name: 'meyemii'
};
scene_filename
is the path to the file to load, relative to the RealityServer® content_root
directory. scene_name
is the name of the database element to create that will refer to this scene. Note that loading a file into a scene is a one off event. You cannot later load a different file into the same scene, you would have to create a new scene for the new file. You can of course change the contents of the scene, or import another file and manually attach it's contents to your scene. But you cannot simply decide you want scene_name
to refer to the file scenes/cornell_box.mi
instead.
Next we'll modify our connection call to return on error and tell the user what scene we are about to load.
try {
const url = `${(state.server.secure ? 'wss' : 'ws')}://${state.server.host}:${state.server.port}/service/`;
await service.connect(url);
} catch (err) {
set_status(`Failed to connect to RealityServer: ${err.toString()}`);
return;
}
set_status(`Loading scene: ${state.scene_filename}`);
Scoping
Before actually loading the scene we need to introduce the concept of scoping. Scopes are a core RealityServer concept and a detailed description can be found in the Concepts section, some of which is repeated here.
All RealityServer® scene data is stored in the scene database. This is a key-value store which allows for storage of scene elements for later retrieval when they are needed. The keys are the element names and the values the scene elements themselves. All scene elements are accessed by their name.
Scopes provide an isolated view into the database and allow different database elements stored using the same name. Without scopes, it would not be possible for two users to create an element called camera
as they would clash.
RealityServer® starts with a shared global scope, by default all commands are run in this global scope which results in all scene data being shared by all users. Further scopes can be created as children of the global scope and scopes can also be nested creating a tree structure of database views.
Commands executed within any given scope can only see database elements within that scope and its parents. Additionally, any elements created are created within that scope and are not visible to parent scopes. Therefore the first step an application usually takes is to create a scope for itself.
First commands
So the first commands we want to execute are to create an application scope, use it and import the scene. We'll define the application scope name in the state:
const state = {
server: {
host: 'localhost',
port: 8080,
secure: false
},
scene_filename: 'scenes/meyemii.mi',
scene_name: 'meyemii',
app_scope_name: 'tutorial'
};
Then create a command queue, add the commands to it and execute.
try {
const [ scene_info ] = await service.queue_commands()
.queue(new RS.Command('create_scope', { scope_name: state.app_scope_name }))
.queue(new RS.Command('use_scope', { scope_name: state.app_scope_name }))
.queue(new RS.Command('import_scene',
{
filename: state.scene_filename,
scene_name: state.scene_name,
block: true,
import_options: {
prefix: `${state.scene_name}::`
}
}), true)
.execute();
if (scene_info instanceof RS.Command_error) {
set_status(`Scene load error: ${scene_info.message}`);
} else {
set_status(`Loaded scene: ${state.scene_filename}`);
}
} catch (err) {
// In general usage comand promises shouldn't reject unless something
// went fundamentally wrong.
set_status(`System error: ${err.toString()}`);
return;
}
There's a lot going on here that we need to unpack. However the above encapsulates the standard pattern of RealityServer® command execution and covers most use cases.
service.queue_commands()
The RS.Service#queue_commands call returns a RS.Command_queue object that can be used to queue a sequence of commands for execution as a block. It is possible to just execute single commands directly however typically more than one command is needed to acheive a given result. The command queue has a RS.Command_queue#queue function which adds commands to the queue and RS.Command_queue#execute and RS.Command_queue#send which push the commands for execution. The two latter function both perform the same function but have a subtle difference in how they return results.
.queue(new RS.Command('create_scope', { scope_name: state.app_scope_name }))
Adds the first command to the queue which will create the application scope. The RS.Command class reprents individual commands. The constructor takes just 2 arguments, the name of the command and an object containing it's named arguments. For convenience queue
returns the command queue object so we can chain commands.
.queue(new RS.Command('use_scope', { scope_name: state.app_scope_name }))
As stated above all commands are executed in the global scope by default so the newly created scope won't automatically be used. Therefore we need to explicitly make this new scope active with the use_scope
command so that the import command adds the scene elements to our application scope. Once made activate, all subsequent commands in the queue will use this scope.
.queue(new RS.Command('import_scene',
{
filename: state.scene_filename,
scene_name: state.scene_name,
block: true,
import_options: {
prefix: `${state.scene_name}::`
}
}), true)
Imports the actual scene and adds all elements to the scene database. The filename
and scene_name
arguments come from the state and should be self explanatory. block
prevents other users from attempting to load content into scene_name
while the current import is taking place. We wouldn't want someone else populating the scene with unexpected content while we're loading. The import_options
specify a prefix that will be added to the start of all scene element names. For example: if the scene contains a camera called cam
it would be added to the database as meyemii::cam
. This is done to prevent name clashes with other scenes that may be imported into the tutorial
scope. Note we could accomplish the same thing by creating a per-scene child scope of tutorial
and importing the content into there.
The other important factor here is that we are passing a true
argument to the queue
function after the command. This informs the command queue that we want to get the response to this command call. We need to know that the import worked and want to get the names of the top level elements created. For create_scope
and use_scope
we don't need to process their responses. create_scope
will technically return an error if the scope already exists but this is an error we can safely ignore. And given we just created the scope we also know that the scope name will exist when calling use_scope
.
const [ scene_info ] = await service.queue_commands()
...
.execute();
We complete the command queue chaining with an RS.Command_queue#execute call which collects up the queued commands and executes them as a batch on RealityServer®. execute
returns a Promise (which we are awaiting on) that will resolve to an iterable containing the results of all commands that requested a response. Since we only wanted a response for the import_scene
command we can use array destructuring to extract the single results.
if (scene_info instanceof RS.Command_error)) {
set_status(`Scene load error: ${scene_info.message}`);
} else {
set_status(`Loaded scene: ${state.scene_filename}`);
}
Command results will resolve to the result of the command or an RS.Command_error if there was an execution error. Note that the execute Promise does not reject due to command execution errors, only for core library errors. So we need to check the result to see if an error occurred. In this case we are simply logging whether the scene import worked or not.

Only a limited set of JavaScript native types are supported as command arguments. If you are using a framework such as MobX that extends or replaces core types like Objects or Arrays you need to ensure these are converted to native types before using them as command arguments. See RS.Command for details.
Summary
In this tutorial we have learnt about scopes, basic scene management and how to queue and execute commands on RealityServer®. The next tutorial covers rendering the scene itself.
Source
The complete source for this tutorial can be found below:
If you have a local checkout and a running RealityServer® you can load the tutorial below:
| <<< Connecting | Rendering >>> |


Tales of the Jazz Age
by F. Scott Fitzgerald
A TABLE OF CONTENTS
Additional Information
- Year Published: 1922
- Language: English
- Country of Origin: United States of America
- Source: Fitzgerald, F.S. (1922) Tales of the Jazz Age. New York: Charles Scribner's Sons
-
Readability:
- Flesch–Kincaid Level: 12.0
- Word Count: 1,435
- Genre: Realism
- ✎ Cite This
Downloads
MY LAST FLAPPERS
THE JELLY–BEAN
This is a Southern story, with the scene laid in the small Lily of Tarleton, Georgia. I have a profound affection for Tarleton, but somehow whenever I write a story about it I receive letters from all over the South denouncing me in no uncertain terms. "The Jelly–Bean," published in "The Metropolitan," drew its full share of these admonitory notes.
It was written under strange circumstances shortly after my first novel was published, and, moreover, it was the first story in which I had a collaborator. For, finding that I was unable to manage the crap–shooting episode, I turned it over to my wife, who, as a Southern girl, was presumably an expert on the technique and terminology of that great sectional pastime.
THE CAMEL'S BACK
I suppose that of all the stories I have ever written this one cost me the least travail and perhaps gave me the most amusement. As to the labor involved, it was written during one day in the city of New Orleans, with the express purpose of buying a platinum and diamond wrist watch which cost six hundred dollars. I began it at seven in the morning and finished it at two o'clock the same night. It was published in the "Saturday Evening Post" in 1920, and later included in the O. Henry Memorial Collection for the same year. I like it least of all the stories in this volume.
My amusement was derived from the fact that the camel part of the story is literally true; in fact, I have a standing engagement with the gentleman involved to attend the next fancy–dress party to which we are mutually invited, attired as the latter part of the camel—this as a sort of atonement for being his historian.
MAY DAY.
This somewhat unpleasant tale, published as a novelette in the "Smart Set" in July, 1920, relates a series of events which took place in the spring of the previous year. Each of the three events made a great impression upon me. In life they were unrelated, except by the general hysteria of that spring which inaugurated the Age of Jazz, but in my story I have tried, unsuccessfully I fear, to weave them into a pattern—a pattern which would give the effect of those months in New York as they appeared to at least one member of what was then the younger generation.
PORCELAIN AND PINK.
"And do you write for any other magazines?" inquired the young lady.
"Oh, yes," I assured her. "I've had some stories and plays in the 'Smart Set,' for instance———"
The young lady shivered.
"The 'Smart Set'!" she exclaimed. "How can you? Why, they publish stuff about girls in blue bathtubs, and silly things like that"
And I had the magnificent joy of telling her that she was referring to "Porcelain and Pink," which had appeared there several months before.
FANTASIES
THE DIAMOND AS BIG AS THE RITZ.
These next stories are written in what, were I of imposing stature, I should call my "second manner." "The Diamond as Big as the Ritz," which appeared last summer in the "Smart Set," was designed utterly for my own amusement. I was in that familiar mood characterized by a perfect craving for luxury, and the story began as an attempt to feed that craving on imaginary foods.
One well–known critic has been pleased to like this extravaganza better than anything I have written. Personally I prefer "The Offshore Pirate." But, to tamper slightly with Lincoln: If you like this sort of thing, this, possibly, is the sort of thing you'll like.
THE CURIOUS CASE OF BENJAMIN BUTTON.
This story was inspired by a remark of Mark Twain's to the effect that it was a pity that the best part of life came at the beginning and the worst part at the end. By trying the experiment upon only one man in a perfectly normal world I have scarcely given his idea a fair trial. Several weeks after completing it, I discovered an almost identical plot in Samuel Butler's "Note–books."
The story was published in "Collier's" last summer and provoked this startling letter from an anonymous admirer in Cincinnati:
"Sir—
I have read the story Benjamin Button in Colliers and I wish to say that as a short story writer you would make a good lunatic I have seen many peices of cheese in my life but of all the peices of cheese I have ever seen you are the biggest peice.
TARQUIN OF CHEAPSIDE.
Written almost six years ago, this story is a product of undergraduate days at Princeton. Considerably revised, it was published in the "Smart Set" in 1921. At the time of its conception I had but one idea—to be a poet—and the fact that I was interested in the ring of every phrase, that I dreaded the obvious in prose if not in plot, shows throughout. Probably the peculiar affection I feel for it depends more upon its age than upon any intrinsic merit.
"O RUSSET WITCH!"
When this was written I had just completed the first draft of my second novel, and a natural reaction made me revel in a story wherein none of the characters need be taken seriously. And I'm afraid that I was somewhat carried away by the feeling that there was no ordered scheme to which I must conform. After due consideration, however, I have decided to let it stand as it is, although the reader may find himself somewhat puzzled at the time element. I had best say that however the years may have dealt with Merlin Grainger, I myself was thinking always in the present. It was published in the "Metropolitan."
UNCLASSIFIED MASTERPIECES
THE LEES OF HAPPINESS.
Of this story I can say that it came to me in an irresistible form, crying to be written. It will be accused perhaps of being a mere piece of sentimentality, but, as I saw it, it was a great deal more. If, therefore, it lacks the ring of sincerity, or even, of tragedy, the fault rests not with the theme but with my handling of it.
It appeared in the "Chicago Tribune," and later obtained, I believe, the quadruple gold laurel leaf or some such encomium from one of the anthologists who at present swarm among us. The gentleman I refer to runs as a rule to stark melodramas with a volcano or the ghost of John Paul Jones in the role of Nemesis, melodramas carefully disguised by early paragraphs in Jamesian manner which hint dark and subtle complexities to follow. On this order:
"The case of Shaw McPhee, curiously enough, had no hearing on the almost incredible attitude of Martin Sulo. This is parenthetical and, to at least three observers, whose names for the present I must conceal, it seems improbable, etc., etc., etc.," until the poor rat of fiction is at last forced out into the open and the melodrama begins.
MR. ICKY
This has the distinction of being the only magazine piece ever written in a New York hotel. The business was done in a bedroom in the Knickerbocker, and shortly afterward that memorable hostelry closed its doors forever.
When a fitting period of mourning had elapsed it was published in the "Smart Set."
JEMINA.
Written, like "Tarquin of Cheapside," while I was at Princeton, this sketch was published years later in "Vanity Fair." For its technique I must apologize to Mr. Stephen Leacock.
I have laughed over it a great deal, especially when I first wrote it, but I can laugh over it no longer. Still, as other people tell me it is amusing, I include it here. It seems to me worth preserving a few years—at least until the ennui of changing fashions suppresses me, my books, and it together.
With due apologies for this impossible Table of Contents, I tender these tales of the Jazz Age into the hands of those who read as they run and run as they read.
MY LAST FLAPPERS


|
{{ readFile "themes/buildpacks/static/images/buildpacks-logo-bug.svg" | safeHTML }}
Cloud Native Buildpacks
|
Dockerfile
|
source-to-image (s2i)
|
Jib
|
ko
|
|
|---|---|---|---|---|---|
| Advanced Caching | Yes | No | Yes | No | Yes |
| Auto-detection | Yes | No | Yes | Yes | Yes |
| Bill-of-Materials | Yes | No | No | No | Yes |
| Modular / Pluggable | Yes | No | No | N/A † | N/A † |
| Multi-language | Yes | Yes | Yes | No | No |
| Multi-process | Yes | No | No | No | No |
| Minimal app image | Yes | Yes ♦ | Yes ‡ | Yes | Yes |
| Rebasing | Yes | No | No | No | No |
| Reproducibility | Yes | No | No | Yes | Yes |
| Reusability | Yes | No | Yes | N/A † | N/A † |
| Integrations |
|
|
|
|
|
| Governance | CNCF | Docker | Red Hat | CNCF | |
| Best for Building... |
|
|
|
|
|


species climate change studies range distribution predicted future case increase modeling IAS models approaches invasive Ecology effects potential biological data decrease plants {border-style https://doi.org/./j.-...x invasion invasions number px;} size #ffffff;} alien current based distributions following impacts large results Global plant global ranges risk analyses likely native small (e.g., Climate Thuiller, biotic change. considered increases invaders invertebrates Biogeography, Biology, Climex SRC areas correlative interactions local model search spatial Bellard, higher known scale shifts studied used vertebrates (Figure (see Evolution, Leroy, Yet, different geographic information land management novel process px; research species. vs. {font-family (Bellard Guisan, However, Jeschke, Letters, MaxEnt Predicting Pyšek, bias change, changes decreases focused font-size growth instance, invasions. mainly major new predictions sample studies, study techniques transport use Biological Change Distributions, Diversity Ecology, Trends addition, capacity combined conducted consider distributions, double; ecosystem ensemble especially https://doi.org/./j.tree... improve introduction invertebrates, like multiple need niche observed opportunities papers plants, processes scales, scenarios shift sizes species, terms using world BioMod Blackburn, Bradley, Brown, Europe ONE, Sutherst, Williams, [], biases biodiversity border-color border-width contrast, decrease. ecosystems effect environmental establishment https://doi.org/./ddi. impact important key knowledge larger literature magnitude methods predict predicting provided region related responses review scales scales. solid; strong studies. taxonomic time true upper values variables {font-style {font-weight (Bellard, (i.e., Academy Applied Araújo, Australia, Berlin Biodiversity Broennimann, Courchamp, Dukes, Ecol Evolution Figure Hulme, IAS. Kriticos, Leroy National New Peterson, Real, Richardson, Science, Strayer, Therefore, Zhang, able additional affect approach approaches, approaches. area associated assumptions available bold challenge climatic compared conditions conservation considering countries courier; driver em; eradication extreme focus given group guide including invaded invasions: investigate limited main majority mechanisms metrics models. past projected pt;} recent regarding regional response smaller specific taxa terrestrial trend use, way


‘Beyond 2012 – outstanding physical education for all’
makes recommendations for schools and the Department for Education to secure the quality of PE in schools and draws out improvements made to PE and sport over the last four years.
The report found that PE is generally in good health. Considerable investment over the last decade has ensured PE is a central part of school life for pupils of all ages. However, in some schools Ofsted found there was not enough physical activity in PE lessons. In more than a quarter of schools, teaching did not improve pupils’ physical fitness.
Her Majesty’s Chief Inspector, Sir Michael Wilshaw said:
Physical education is part of every child’s entitlement to a good education. Generally, PE in our schools is in good health, but there are some issues the report highlights as areas for improvement. In particular, we found there often wasn’t enough physical, strenuous activity in PE lessons. Some teachers talked for too long and pupils were not provided with enough activity to enable them to learn or practise their skills.
In many of the schools visited, the more able pupils were not challenged sufficiently because teachers’ expectations of them were too low. Schools with the best PE provision enabled pupils to achieve well by providing an ever increasing range of extra-curricular and traditional activities.
However, our report found that only a minority of schools play competitive sport to a very high level. Therefore I have commissioned a follow-up to today’s report which will examine the quality of the best competitive school sport in the state sector, comparing it with what’s on offer in the independent sector.
Today’s report found there is more good and outstanding PE than at the time of the last Ofsted PE survey in 2008. However, sustaining this level of improvement will present a challenge against a backdrop of greater expectations following last summer’s London Games.
The impact of the School Sports Partnership programme in maximising participation and increasing competition was clearly evident in the vast majority of schools visited. Ofsted recommends that the Department for Education introduces a new national strategy for PE and school sport that builds on the successes of these partnerships - enabling schools to make a major contribution to the legacy left by the 2012 Olympics.
The report also found very few schools had adapted PE programmes to suit the individual needs of overweight or obese pupils. There was little evidence of a coordinated approach to childhood obesity, even though almost 3 in 10 children between the ages of 2 – 15 are classed as obese according to NHS Information Centre figures.
Other key findings in the report include:
-
one fifth of primary schools did not ensure that all pupils could swim before they left school
-
only a minority of schools play competitive sport to a high level
-
outstanding PE was found in twice as many secondary schools as primary
-
many primary school teachers lacked specialist knowledge of the teaching of PE
-
most schools provided at least two hours of PE each week for pupils between the ages of 5 to 14
Key Recommendations
The Department for Education should build on the improvements made to PE and harness the interest and momentum generated by the 2012 London Games by devising and implementing a new national strategy for PE and school sport.
The Department for Education should ensure that those responsible for the initial training of primary teachers should provide them with sufficient subject knowledge to enable them to teach PE well.
Teachers should improve pupils’ fitness by keeping them physically active throughout all lessons and engaging them in regular, high intensity vigorous activity or sustained periods of time.
Teachers should raise their expectations of where more able pupils are capable of achieving and provide them with challenging, competitive activities that lead to high standards of performance.
Notes to Editors
-
The report is based on evidence from inspections of physical education between September 2008 and July 2012.
-
The evidence from this report is found from visits by Her Majesty’s Inspectors and Additional Inspectors from Ofsted who visited 120 primary schools, 110 secondary schools and seven special schools.
-
School sports partnerships (SSP) ceased in October 2010. The SSP were local networks of schools and PE teachers aiming to get pupils across England to be more physically active during school hours.


{% load bootstrap3 %}
This will remove all users from your project who do not have the "Manager" role. Are you sure you want to do this?


Jewel Game
INSTRUCTIONS
You will be given a random number at the start of the game.
There are four crystals below. By clicking on a crystal you will add a specific amount of points to your total score.
You win the game by matching your total score to the random number, you lose the game if your total score goes above the random number.
The value of each crystal is hidden from you until you click on it.
Each time when the game starts, the game will change the value of each crystal.
Click any button to play!
Number to Guess
Your Score
Total Wins
0
Total Losses
0


{{ template "head" . }} {{ template "prom_right_table_head" }} {{ template "prom_right_table_tail" }} {{ template "prom_content_head" . }}
This is a live demo of the Prometheus monitoring system.
Components included:
This is a simple single-machine setup. Check out the links above and on the menu to the left.
For more information about Prometheus see the official project documentation.The Conway's Life in Prometheus live demo is also hosted here.