Next: find-restart, Previous: restart, Up: Conditions Dictionary
compute-restarts
&optional condition ⇒ restarts
condition—a condition object, or nil.
restarts—a list of restarts.
compute-restarts uses the dynamic state of the program to compute a list of the restarts which are currently active.
The resulting list is ordered so that the innermost (more-recently established) restarts are nearer the head of the list.
When condition is non-nil, only those restarts are considered that are either explicitly associated with that condition, or not associated with any condition; that is, the excluded restarts are those that are associated with a non-empty set of conditions of which the given condition is not an element. If condition is nil, all restarts are considered.
compute-restarts returns all applicable restarts, including anonymous ones, even if some of them have the same name as others and would therefore not be found by find-restart when given a symbol argument.
Implementations are permitted, but not required, to return distinct lists from repeated calls to compute-restarts while in the same dynamic environment. The consequences are undefined if the list returned by compute-restarts is every modified.
;; One possible way in which an interactive debugger might present ;; restarts to the user. (defun invoke-a-restart () (let ((restarts (compute-restarts))) (do ((i 0 (+ i 1)) (r restarts (cdr r))) ((null r)) (format t "~&~D: ~A~ (let ((n nil) (k (length restarts))) (loop (when (and (typep n 'integer) (>= n 0) (< n k)) (return t)) (format t "~&Option: ") (setq n (read)) (fresh-line)) (invoke-restart-interactively (nth n restarts))))) (restart-case (invoke-a-restart) (one () 1) (two () 2) (nil () :report "Who knows?" 'anonymous) (one () 'I) (two () 'II)) |> 0: ONE |> 1: TWO |> 2: Who knows? |> 3: ONE |> 4: TWO |> 5: Return to Lisp Toplevel. |> Option: |>>4<<| ⇒ II ;; Note that in addition to user-defined restart points, COMPUTE-RESTARTS ;; also returns information about any system-supplied restarts, such as ;; the "Return to Lisp Toplevel" restart offered above.
Existing restarts.
find-restart, invoke-restart, restart-bind
Next: find-restart, Previous: restart, Up: Conditions Dictionary


Posted 31 May 2017 - about 7 mins to read
So everyone is talking about this hip “new” kid on the block for PHP: Generics. The rfc is on the table and a lot of people are getting all excited about it, but you don’t fully see the excitement? Let’s explore what it’s all about!
What is the use case of a Generic?
Generics is not something new. Statically typed languages like Java and C# have had them for ages. There are even some dynamically typed languages like Dart that implement them in their core. And even languages that don’t support Generics like for example Javascript can still support them with a 3rd party implementation, in the case of Javascript this would be Typescript.
The basic idea is that you can reuse a class that is statically typed with different typed parameters. Ok, I understand that this might sound very confusing. So let’s check out an example:
<?php
$car = new Car(4, 'Honda');
class Car
{
private $wheels;
private $engine;
public function __construct($wheels, $engine)
{
$this->wheels = $wheels;
$this->engine = $engine;
}
public function getWheels()
{
return $this->wheels;
}
public function getEngine()
{
return $this->engine;
}
}
Yes I know, I’m explaining OO stuff with a car class. I know it’s super cliche, and I’m normally not a fan of getters, but just roll with it.
As you can see, we are creating a Car
object with 2 parameters. The wheels and the engine.
Now this is all fine and dandy, but what do $wheels
and $engine
parameters represent? In this case it’s the amount of wheels and what engine it sports one would assume, as we send an integer and a string along.
But $car = new Car(‘pirelli’, true);
would be just as valid.
This is of course one of the typical things of a dynamically typed language. But if we want to add some more uniformity in our class we could, thanks to PHP 7 and types:
<?php
$car = new Car(4, 'Honda');
class Car
{
private $wheels;
private $engine;
public function __construct(int $wheels, string $engine)
{
$this->wheels = $wheels;
$this->engine = $engine;
}
public function getWheels(): int
{
return $this->wheels;
}
public function getEngine(): string
{
return $this->engine;
}
}
Now it’s impossible to create an invalid object thanks to the strict types. Ok cool, let’s make everything strictly typed then!
But what if we want to create an object that’s both statically and dynamically typed? This sounds absurd but let me give you a use case. You want an object that accepts a parameter on creation but it needs to always return that same type of parameter on its return.
So for example when I do $myCar = new Car('honda');
and later $myCar->getEngine();
I want to be sure that what I get back from getEngine
is the same type as what I’ve put into the constructor (in this case a string).
Ok show me this generic magic then!
Well … the thing is… at the time of writing, generics don’t yet exist in PHP yet. I know … what a tease. But luckily for us there is a RFC! So people are still loudly arguing whether or not they want to include generics into PHP and how it should look. But let us take a look at what the current proposed way of doing it is.
The use case described above could look like this:
<?php
$car = new Car<int, string>(4, 'Honda');
class Car<WheelType, EngineType>
{
private $wheels;
private $engine;
public function __construct(WheelType $wheels, EngineType $engine)
{
$this->wheels = $wheels;
$this->engine = $engine;
}
public function getWheels(): WheelType
{
return $this->wheels;
}
public function getEngineType(): EngineType
{
return $this->engine;
}
}
As you can see, we now have brackets! So first up is this:
$car = new Car<int,string>(4, 'Honda');
Here we say, we are going to create a new Car, with 2 parameters; an integer and a string. You could according to the currently proposed RCF just send:
$car = new Car(4, 'Honda');
but I like the implicit version better for explanation sake. Next up is:
class Car<WheelType, EngineType>
This tells the class about what variable types it supports.
And then we can use these virtual types just like normal types in the class.
So in this case the WheelType
will be an integer and the EngineType
a string.
It’s as easy as that.
##That’s a use case that will never happen! It is indeed a niche use case, but as PHP grows towards a hybrid of a dynamically typed and strictly typed language it does make sense to include some more features of strictly typed languages. While true, you will not use this everyday, there is no harm in having it in the language. It would however be handy for people that write logging or collection packages. Take this piece of code for example:
<?php
class Collection<EntryType>
{
private $collection = [];
public function addValue(EntryType $item)
{
$this->collection[] = $item;
}
public function getValues():array
{
return $this->collection;
}
}
$collection = new Collection <string >();
$collection->addValue('this is a string');
$stringArray = $collection->getValues();
You can now reuse this collection for whatever you want, but you will always be sure getValues()
will return a collection of items that have the same type.
Even more fun is that you can instantiate a Collection like this: $collection = new Collection <Runnable >();
where Runnable
is an interface. This way you could have, for example, a collection that you are sure of only has items with values objects in them that conform to the interface. For example:
<?php
public function runBatch<T is Runnable> (T $batch) {
foreach ($batch as $entry) {
$entry->run(); // Runnable
}
}
The <T is Runnable>
in this context would stand for: “you can enter whatever type you want here, but it has to adhere to the Runnable
interface.”
So what’s next? As I said before, the proposal is currently in draft. Once the proposal is finished it will go into a voting round and if there is a consensus about implementing it, it will be added, otherwise it’s back to the drawing board for Generics in PHP.
Ps: you can follow along how the rfc is going here


Preparation time
less than 30 mins
Cooking time
10 to 30 mins
Serves
Serves 2
A recipe for success ready in half an hour. Scale down for an impressive starter.
Heat the oil and 50g/1¾oz butter in a saucepan and add the carrots to caramelise. Crush the langoustine heads and add to the pan with the coriander and mushroom stalks. Pour in 100ml/3½fl oz water and bring to a simmer.
Add most of the ginger to the broth, reserving a little for garnishing, and simmer for 2 minutes. Strain into a clean pan, return to the heat and simmer until the volume of the liquid is reduced by half. Season well with salt and pepper.
Heat the remaining butter in a frying pan placed over a medium heat. Add the mushroom heads, broad beans and petit pois. Gently cook for 3 minutes and set aside.
Using a pastry brush, lightly brush the wonton wrappers with the egg. Place a langoustine tail on each wrapper and sprinkle with the coriander leaves. Fold in half and press the edges together firmly.
Place 100ml/3½fl oz water into a large, deep frying pan and bring to the boil. Slide in the ravioli, ensuring there is enough water to just cover them, and simmer for 2 minutes. Remove with a slotted spoon.
To serve, divide the ravioli between two shallow bowls, pour over the broth and top with the vegetables. Sprinkle with the spring onions, lemon zest and remaining ginger.


10 July 2000
Disease Outbreak Reported
On 10 July, the Ministry of Health and Welfare reported a total of 13 809 cases of food poisoning in 8 western states. Of 180 cases requiring hospitalization, 17 were still in hospital.
The source of the outbreak was found to be 3 different kinds of milk which had been contaminated by Staphylococcus aureus in a production-line valve, at a major dairy-products processing plant in Osaka. Those affected suffered diarrhoea and vomiting due to Staphylococcus aureus enterotoxin after drinking low-fat milk.
The local authorities have ordered the company to recall all products which might have been contaminated.


04 September 2002
Disease Outbreak Reported
Burundi: As of 30 August, the Ministry of Health of Burundi has reported 428 cases and 38 deaths in Muyinga, Kirundo and Ngozi provinces from 6 July 2002 (see previous report). The situation in Kirundo and Ngozi provinces appears to have stabilized, while Muyinga province remains in the alert phase. WHO and UNICEF will be providing 747 500 vaccines for the vaccination campaign to cover the whole population over 6 months in Muyinga and affected areas in Kirundo and Ngozi. Nongovernmental agencies working in the three provinces, including International Medical Corps (IMC) and Médecins sans Frontières(MSF) France will support the campaign; MSF France is carrying out surveillance activities in Muyinga province.
Rwanda: As of 31 August, the Ministry of Health, Rwanda has reported 506 cases and 72 deaths mainly from Butare, Kibungo, Kibuye and Umutara provinces (see previous report). WHO is working with the Ministry of Health and MSF-Belgium to investigate the cases and assist in the ongoing vaccination campaign.
United Republic of Tanzania: As of 29 August, WHO has received reports of 149 suspected cases and 9 deaths in 4 camps, Nduta, Karago, Mtendeli, and Mkugwa in Kibondo district from 1 July 2002 (See previous report). A team from WHO, Ministry of Health, Tanzania, UNHCR, UNICEF and the International Rescue Committee investigated the outbreak. The team has made recommendations for early detection, case management in the camps, as well as for vaccination campaigns in the affected camps and immunization of all returnees.
Neisseria meningitidis serogroup A has been confirmed in 10 out of 14 samples tested from Nduta camp. WHO has provided reagents and other supplies for laboratory testing. Meningitis Task Forces have been established in Karago and Nduta camps; a refresher training course is underway for health workers; gatherings of people have been limited and schools are closed.


The Reset Password link has expired. Please click on the below button to go back to the login page
Go back to Login
Password
Please enter the password
Confirm password
Please enter the confirm password
Not a matching password
Update Password


Consider the string 'I like this product; I hate this product; This product is worth buying; I don’t agree with the above user'


The Head First Lounge is, no doubt, the biggest trendsetter in Webville. Stop in to sample the eclectic offering of elixirs, teas, and coffees, or, stay a bit longer and enjoy the multicultural culinary menu that combines a harmony of taste, texture, and color with the best in fresh and healthy ingredients.
During your stay at the lounge, you'll enjoy a smooth mixture of ambient and mystic sounds, filling the lounge and adding an extra dimension to your dining experience. The decor surrounds you with the relaxing sentiments of sights from eras past. And, don't forget, the lounge offers free wireless access to the Internet, so bring your laptop.
Our guarantee: at the lounge, we're committed to providing you, our guest, with an exceptional experience every time you visit. Whether you're just stopping by to check in on email over an elixir, or are here for an out-of-the-ordinary dinner, you'll find our knowledgeable service staff pay attention to every detail. If you're not fully satisfied, have a Blueberry Bliss Elixir on us.
But that's not all; at night, join us in the backroom as our resident DJ spins a choice selection of trance and drum&bass beats across our spacious tiki-themed dance floor. Or just hang out in one of our comfy white vinyl booths at the dance bar. You can have your elixirs delivered from the main lounge right to the dance floor. If you've had enough of the beat, just head back to the lounge area to relax. And, no matter where you find yourself in the lounge, you'll always be connected with our wireless Internet access.
Now that you've experienced the lounge virtually, isn't it time to check us out for real? We're located right in the heart of Webville, and we've created some detailed directions to get you here in record time. No reservations necessary; come and join us anytime.
The ultimate healthy drink, this elixir combines herbal botanicals, minerals, and vitamins with a twist of lemon into a smooth citrus wonder that will keep your immune system going all day and all night.
Not your traditional chai, this elixir mixes maté with chai spices and adds an extra chocolate kick for a caffeinated taste sensation on ice.
Want to boost your memory? Try our Black Brain Brew elixir, made with black oolong tea and just a touch of espresso. Your brain will thank you for the boost.
Join us any evening for these and all our other wonderful elixirs.
We're frequently asked about the music we play at the lounge, and no wonder, it's great stuff. Just for you, we keep a list here on the site, updated weekly. Enjoy.


{% extends base_template %} {% import "macros.j2" as macros with context %} {% set report_name = report.report_parameters.name %} {% block body %} {% block report_title %}
This report of solar forecast accuracy was automatically generated using the Solar Forecast Arbiter. Please see our GitHub repository for known issues with the reports or to create a new issue.
{% endblock %} {% block download %}{% endblock %} {% block toc %}{{ cost.to_dict() | pretty_json }}
This report includes forecast and observation data available from {{ report.report_parameters.start }} to {{ report.report_parameters.end }}. {% endblock %} {% block obsandfx %}
The plots below show the realigned and resampled time series of observation and forecast data as well as the distribution of forecast vs observation data.
Controls to pan, zoom, and save the plot are shown on the right. Clicking on an item in the legend will hide/show it.
{% if includes_distribution %}For forecasts parameterized symmetrically around the 50th percentile, brighter colors indicate percentiles farther from the 50th percentile and darker colors indicate percentiles closer to the 50th percentile. For forecasts parameterized asymmetrically around the 50th percentile, brighter colors indicate smaller percentiles and darker colors indicate larger percentiles. Use the hover tool to determine the percentile.
{% endif %} {% endif %} {% if scatter_spec is defined %} {% endif %} {% if timeseries_prob_spec is defined %}The plot below shows probability vs. time for probabilistic forecasts with axis='x'.
{% endif %} {% endblock %} {% block datavalidation %}A table of metrics over the entire study period and figures for the selected categories are shown below. Metrics may be downloaded in CSV format by clicking here.
{{ macros.metric_table_fx_vert(report.raw_report.metrics, "total", report.report_parameters.metrics) }}{{ category_blurbs[category] }}
{% endif %}


OK, that part I get.
not sure how well momom will work with blocks days apart
I have not followed the concept closely, but it would seem to me that it time is a factor then the root are incorrect to begin with, no?
if the branch is provable to come from another branch, why would growth time matter?
If time is a factor, then wouldn't 10 sec blocks and 2 hr block fek it all up?


I am a poet and a software developer. When I am not writing poems or code, I am either researching on ways to make the world a better place, reading novels, teaching college entry exams, listening to music, skating, cycling, racing, or hanging out with my friends or dog.
I decided to be a software developer because I want to make an active contribution to the direction the global
field is taking right now. I want to innovate, solve problems, and speed the process of problem solving as well from behind the scenes.
+254 742 579020
<EMAIL_ADDRESS>Class of 2018
Future Innovators!
Class of 2025
https://github.com/kasparov-creat/my-website-portfolio.git
https://github.com/kasparov-creat/happy-trails-travel-agency.git
Web designer
+254 742 579020
ianjkiplagat@gmail.com


My name is ***Your name***.
I am from the ***Your country***. I live in ***Your city, providence***
This is my photo:


Methods summary
public
|
#
__construct( mixed[]|String $orderParameter )
This is the constructor of the Order.
This is the constructor of the Order.
Parameters
- $orderParameter
- The order to create as array or order ID.
Author
Since
0.1.3
|
public
String
|
#
__toString( )
Prints the Product object as a string.
Prints the Product object as a string.
This function returns the setted values of the Product object.
Returns
String The Product as a string.
Author
Since
0.1.1
|
public
ep6\Date
|
#
getArchiveDate( )
Returns the date when the order was archived.
Returns the date when the order was archived.
Returns
Author
Since
0.1.3
|
public
ep6\Address
|
#
getBillingAddress( )
Returns the billing address.
Returns the billing address.
Returns
Author
Since
0.1.3
|
public
ep6\Date
|
#
getCloseDate( )
Returns the date when it was closed.
Returns the date when it was closed.
Returns
ep6\Date The date when the order was closed.
Author
Since
0.1.3
|
public
ep6\Date
|
#
getCreationDate( )
Returns the date when it was created.
Returns the date when it was created.
Returns
ep6\Date The date when the order was created.
Author
Since
0.1.3
|
public
Customer
|
#
getCustomer( )
Returns the customer.
Returns
Customer The customer which ordered.
Author
Since
0.1.3
|
public
ep6\Date
|
#
getDeliveryDate( )
Returns the date when it was delivered.
Returns the date when it was delivered.
Returns
ep6\Date The date when the order was delivered.
Author
Since
0.1.3
|
public
ep6\Date
|
#
getDispatchDate( )
Returns the date when it was dispatched.
Returns the date when it was dispatched.
Returns
ep6\Date The date when the order was dispatched.
Author
Since
0.1.3
|
public
String
|
#
getID( )
Returns the order ID.
Returns
String The order ID.
Author
Since
0.1.3
|
public
String
|
#
getInternalNote( )
Returns the internal note.
Returns the internal note.
Returns
String The internal note.
Author
Since
0.1.3
|
public
ep6\Date
|
#
getInvoiceDate( )
Returns the date when the invoice was created.
Returns the date when the invoice was created.
Returns
ep6\Date The date when the invoice was created.
Author
Since
0.1.3
|
public
String
|
#
getNumber( )
Returns the order number.
Returns the order number.
Returns
String The order number.
Author
Since
0.1.3
|
public
ep6\Date
|
#
getPayDate( )
Returns the date when it was paid.
Returns the date when it was paid.
Returns
ep6\Date The date when the order was paid.
Author
Since
0.1.3
|
public
ep6\PaymentMethod
|
#
getPaymentMethod( )
Returns the payment method.
Returns the payment method.
Returns
Author
Since
0.1.3
|
public
ep6\Price
|
#
getPaymentPrice( )
Returns the price of the payment.
Returns the price of the payment.
Returns
Author
Since
0.1.3
|
public
ep6\Date
|
#
getPendingDate( )
Returns the date when it was pending.
Returns the date when it was pending.
Returns
ep6\Date The date when the order was pending.
Author
Since
0.1.3
|
public
ep6\Date
|
#
getRejectionDate( )
Returns the date when it was rejected.
Returns the date when it was rejected.
Returns
ep6\Date The date when the order was rejected.
Author
Since
0.1.3
|
public
ep6\Date
|
#
getReturnDate( )
Returns the date when it was returned.
Returns the date when it was returned.
Returns
ep6\Date The date when the order was returned.
Author
Since
0.1.3
|
public
ep6\ShippingMethod
|
#
getShippingMethod( )
Returns the shipping method.
Returns the shipping method.
Returns
Author
Since
0.1.3
|
public
ep6\Price
|
#
getShippingPrice( )
Returns the shipping price.
Returns the shipping price.
Returns
Author
Since
0.1.3
|
public
ep6\Price
|
#
getTaxPrice( )
Returns the tax price.
Returns
Author
Since
0.1.3
|
public
ep6\Price
|
|
public
ep6\Price
|
#
getTotalPriceWithoutTax( )
Returns the total price without tax.
Returns the total price without tax.
Returns
Author
Since
0.1.3
|
public
ep6\Date
|
#
getViewDate( )
Returns the date when it was viewed.
Returns the date when it was viewed.
Returns
ep6\Date The date when the order was viewed.
Author
Since
0.1.3
|
public
boolean
|
#
isArchived( )
Shows if the order is archived.
Shows if the order is archived.
Returns
boolean True if it is archived, false if not.
Author
Since
0.1.3
|
public
boolean
|
#
isClosed( )
Shows if the order is closed.
Shows if the order is closed.
Returns
boolean True if it is closed, false if not.
Author
Since
0.1.3
|
public
boolean
|
#
isCreated( )
Shows if the order is created.
Shows if the order is created.
Returns
boolean True if it is created, false if not.
Author
Since
0.1.3
|
public
boolean
|
#
isDelivered( )
Shows if the order is delivered.
Shows if the order is delivered.
Returns
boolean True if it is delivered, false if not.
Author
Since
0.1.3
|
public
boolean
|
#
isDispatched( )
Shows if the order is dispatched.
Shows if the order is dispatched.
Returns
boolean True if it is dispatched, false if not.
Author
Since
0.1.3
|
public
boolean
|
#
isInvoiced( )
Shows if the order is invoiced.
Shows if the order is invoiced.
Returns
boolean True if it is invoiced, false if not.
Author
Since
0.1.3
|
public
boolean
|
#
isPaid( )
Shows if the order is paid.
Shows if the order is paid.
Returns
boolean True if it is paid, false if not.
Author
Since
0.1.3
|
public
boolean
|
#
isPended( )
Shows if the order is pended.
Shows if the order is pended.
Returns
boolean True if it is pended, false if not.
Author
Since
0.1.3
|
public
boolean
|
#
isRejected( )
Shows if the order is rejected.
Shows if the order is rejected.
Returns
boolean True if it is rejected, false if not.
Author
Since
0.1.3
|
public
boolean
|
#
isReturned( )
Shows if the order is returned.
Shows if the order is returned.
Returns
boolean True if it is returend, false if not.
Author
Since
0.1.3
|
public
boolean
|
#
isViewed( )
Shows if the order is viewed.
Shows if the order is viewed.
Returns
boolean True if it is viewed, false if not.
Author
Since
0.1.3
|


Trim Videos
This simple application helps trim videos before they are downloaded. It reduces the size of the video file youdownload. Works with
Youtube
,
Twitter
&
Video URL
Video Link
Start Time
End Time
mp4
gif
ogg
mov
Trim Video
Error


Springboks earn team, coach, men’s player of year honors
TOKYO (AP) - A day after winning the Rugby World Cup, South Africa won the trifecta of team, coach and men’s player of the year at the sport’s annual awards on Sunday.
England center Emily Scarratt, back playing 15s after two years of sevens, was the women’s player of the year.
Flanker Pieter-Steph du Toit received the men’s award after starting and starring in nine of the Springboks’ 11 tests this year, including the Rugby World Cup final win against England in Yokohama.
Du Toit became the first South African to win the award since 2007, when Bryan Habana earned it in the same year the Springboks last won the World Cup.
Du Toit was nominated with teammate Cheslin Kolbe, Wales captain Alun Wyn Jones, New Zealand flanker Ardie Savea, England flanker Tom Curry and United States hooker Joe Taufete’e.
Rassie Erasmus was named top coach after leading his team of the year South Africa to a record-tying third World Cup crown after a pool defeat to the All Blacks, and a first Rugby Championship in 10 years.
Scarratt resumed playing 15s like she’d never been away. She made four starts as England won the Women’s Six Nations Grand Slam, and in the women’s super series she scored four tries and 43 points over three games.
She was nominated alongside teammates Sarah Bern and Katy Daley-McLean, France pivot Pauline Bourdon and former winner Kendra Cocksedge of New Zealand.
France flyhalf Romain Ntamack, who made his debut at center in the Six Nations in February, was the breakthrough player of the year ahead of England wing Joe Cokanasiga and South Africa scrumhalf Herschel Jantjies.
The sevens players of the year were Jerry Tuwai of Fiji and Ruby Tui of New Zealand, and the try of the year was TJ Perenara’s spectacular breakout and finish in New Zealand’s win against Namibia in the World Cup.
More AP sports: https://apnews.com/apf-sports and https://twitter.com/AP_Sports
Sign up for Daily Newsletters
Copyright © 2019 The Washington Times, LLC.
Please read our comment policy before commenting.


Chooses this Option
Addition
Subraction
Multiplication
Division
Enter 1Num
Enter 2Num
Calculation
output:


Sections
- Introduction
- Getting started
- Directory structure
- Middleman server
- The template engine
- Setting template engines
- YAML Frontmatter
- Helpers
- Middleman-Livereload
- Section index generator
- Automatic image sizes
- Image optimisation
- Publishing Documentr files
- Middleman build
Introduction
Generate Html documentation from Markdown/Haml with ease, from the comfort of your favourite distraction free text editor. Preview your Markdown/Haml code in your web browser, generate Html and automatically optimise your images when you’re done. No more time wasted clicking through endless menus and prompts, fumbling around with bloated word processors in attempts to structure, format, resize, or drop some thing in place then drag it around. Documentr makes generating hierarchical documentation fast and enjoyable.
Documentr uses the Middleman static site generator written in Ruby, to generate hierarchical html documents. This makes Documentr extendable with support for multiple pages, layout templates, integrations, and much more! Anybody who is familiar with Ruby on Rails will find Documentr familiar to use.
Documentr is intended to be a simplistic ‘framework’, used to generate Html documents that are cross compatible with a wide array of applications and use cases.
It is suggested that the use of CSS is kept to a minimum and JavaScript is avoided, however feel free to break these guidelines if you so desire.
Getting started
This section assumes you have Ruby installed, are familiar with basic web development and ‘cloud computing’ concepts, and a terminal interface.
$ git clone https://github.com/webdev-kiwi/documentr
$ bundle install
Directory structure
- build
- data
- defaults.yaml
- source
- images
- layouts
- layout.haml
- empty.md
- example.md
- index.haml
- readme.md
- config.rb
- Gemfile
build directory
The build directory contains the generated HTML files, and optimised images.
data directory
The data directory contains the default data, such as title and author page variables for use within the source files.
source directory
The source directory is your working directory, containing your source files the generator will use to build your output files from.
Middleman server
Start the Middleman development server, with default options by typing:
$ bundle exec middleman server
Now, to preview your document simply open a web browser and type localhost:4567/ into your address bar. You may overide the default port to 4568 for example, with:
$ bundle exec middleman server --port=4568
The template engine
Like Ruby on Rails, Middleman makes use of Tilt a generic interface to multiple Ruby template engines. This allows Documentr source code to be written in an array of markdown and markup languages, whichever you’re more comfortable using.
New to Markdown? Learn Markdown now it’s super easy!
Documentr uses kramdown, a Ruby Markdown-superset converter, kramdown quick reference.
Beautiful, DRY, well-indented, clear markup: templating haiku. Haml Tutorial.
Setting template engines
Template engine options are set in config.rb the default settings for use with Haml are shown below:
set :haml, { :ugly => false, :format => :html5 }
And for Markdown, with the Kramdown engine:
set :markdown, :fenced_code_blocks => true, :smartypants => true
For more information on template engine options, see Template engine options.
Frontmatter
Frontmatter allows page specific variables to be included at the top of a template using the YAML format.
Documentr default values are set in data/defaults.yaml
Page variables
- title:
- description:
- version:
- date:
- author:
- copyright:
You may override these at the top of any source file, like so:
---
title: ""
description: ""
version: "Markdown"
date: ""
author: ""
copyright: ""
title: "Example"
copyright: ""
---
Helpers
Middleman-Livereload
Middleman-Livereload is an extension for the Middleman static site generator that adds livereloading functionality. Live Reload is a system to automatically reload a web page when the source files for that web page are changed. This is particularly useful for previewing your documents without the need to refresh your browser.
Coupled with the Chrome RemoteLiveReload extension, every time you hit save in your text-editor your browser will automatically refresh the page allowing for seamless previews of your document. Images and other assets will also be automatically reloaded as they’re added, or replaced.
Some users may experience issues using Middleman-Livereload in certain situations. An alternative to Middleman-Livereload is node-livereload an implementation of the LiveReload server in Node.js.
Section index generator
Yaml Frontmatter
---
sections:
- "Section 1"
- headings:
- "heading 1"
- "heading 2"
- subs:
- "sub heading 1"
- "sub heading 2"
- "heading 3"
- "Section 2"
- headings:
- "heading 1"
- "heading 2"
---
Section index is generated from a nested structure, 3 levels deep, like so:
section has many headings
heading belongs to section
heading has many subs
Sub belongs to heading
Images
Image credit: Why’s (Poignant) Guide to Ruby
Automatic image sizes
Documentr will automatically add image sizes to these tags based on the image dimensions.
note: not currently working with kramdown
Image optimisation
At build time, Documentr will automatically compress images using the middleman-imageoptim gem and it’s dependencies.
Publishing Documentr files
Middleman build
$ bundle exec middleman build
Your documentation is now ready in your build/ folder!
© 2016 Webdev.kiwi Limited


{{ app_name }}
i-bid2win.com (I-Bid2Win) is a service provided by Phunki Media Group. I-Bid2Win is an online, TV, and mobile based bidding auction game targeted at corporate workers, social work groups and associations members, families, students, and individuals between 18-55 years. It was borne out of the realization that most, if not all SMS based competitions, are not interactive enough in terms providing a dynamic offering.
A promotional auction bidding platform, I-Bid2W offers products and services at 70% discount from the recommended retail price of products and services listed. The items are offered to the general public to place bids, with the highest bidder at the end of the auction period paying the auction price to buy the item. The bidding model is not based on incremental bids placed by bidders, but rather each bidder is required to make at least the non-refundable minimum cost per bid.
A maximum of eight live auctions are selected to run at any given time on the site with the minimum duration per auction pegged at a month. Bidders have the means to top up their bidding wallet using the Mpower payment system. I-Bid2Win allows its subscribers to connect and place bids through the online and mobile site, as well as the Android application which can be downloaded from Google's Play Store .


Works Cited
Marks, Tom. "Hollow Knight." Linux Format 09 2017: 20. ProQuest. Web. 21 Sep. 2018 .
Wahlberg, T. (2015). Blockades in the Metroidvania genre of games : A examination of Backtracking (Dissertation). Retrieved from http://urn.kb.se/resolve?urn=urn:nbn:se:uu:diva-264995
WILL, HARRISON/. "'Dead Cells' Reinvents a Popular Genre." The Blade, Aug 16 2018, ProQuest. Web. 21 Sep. 2018 .
Lee, Jin Ha, et al. “Relationships among Video Games: Existing Standards and New Definitions.” Proceedings of the American Society for Information Science and Technology, vol. 51, no. 1, 2014, pp. 1–11., doi:10.1002/meet.2014.14505101035.
“Metroidvania (Concept).” Giant Bomb, www.giantbomb.com/metroidvania/3015-2440/.
“Super Metroid (Game).” Giant Bomb, 19 Mar. 1994, www.giantbomb.com/super-metroid/3030-8292/.
“Castlevania: Symphony of the Night (Game).” Giant Bomb, 20 Mar. 1997, www.giantbomb.com/castlevania-symphony-of-the-night/3030-14216/.
Hutnik, Richard. “So I Coined the Term, ‘Metroidvania’? | The Game Changer Channel Blog (Classic Games Redefined).” BoardGameGeek, 26 Mar. 2014, boardgamegeek.com/blogpost/28900/so-i-coined-term-metroidvania.


“The line that describes the beautiful is elliptical.
It has simplicity and constant change. It cannot be described by a compass,
and it changes direction at every one of its points.”
Rudolf Arnheim
Leonardo da Vinci, Raphael, Michelangelo,
Albrecht Dürer, M.C. Escher, Hans Holbein, Paul Klee, LeRoy Neiman. All of these famous artists were left handed.
Our Robots have been spending some time researching the great artists
from the Human civilization and would like to learn some of the fundamentals of art.
For their first lesson, they need to learn to control their left hand-manipulators well enough to make smooth motions.
For this exercise, they have decided to draw various figures on graph paper with an extra challenge rule -- don't lift your pen.
A figure is represented as a set of segments in the rectangular coordinate system.
Each segment is represented as a sequence of 4 numbers:
(x1, y1, x2, y2),
where x1, y1 are coordinates for the first end and
x2, y2 -- for the second.
Segments are undirected. All points in a figure are connected, so you can reach each point from any point.
You should find a path in order to draw the figure.
You can pass through each segment only once and are not allowed to lift the pen.
The result must be represented as a sequence of points (tuples with coordinates)
in the order of how the pen moves to create the drawing. The path may be started and ended at any point.
If it's impossible to draw a figure then return an empty sequence. Let's look at some examples:
Example 1: the figure is represented as {(1,2,1,5),(1,2,7,2),(1,5,4,7),(4,7,7,5)} and can be
two path - ((7,2),(1,2),(1,5),(4,7),(7,5)) or ((7,5),(4,7),(1,5),(1,2),(7,2)).
Example 2: the figure {(1,2,1,5),(1,2,7,2),(1,5,4,7),(4,7,7,5),(7,5,7,2),(1,5,7,2),(7,5,1,2)}
can not be drawn with the given rules, so the result is an empty list or tuple.
Example 3: it's like fig.2 but with one more segment (1,5,7,5) and can be drawn several ways.
One of them ((7,2),(1,2),(1,5),(4,7),(7,5),(7,2),(1,5),(7,5),(1,2)).
Input: Figure segments as a set of tuples with 4 integers each.
Output: The path as a list or tuple of tuples with 2 integers each.
Example:
draw({(1,2,1,5),(1,2,7,2),(1,5,4,7),(4,7,7,5)}) == ((7,2),(1,2),(1,5),(4,7),(7,5))
draw({(1,2,1,5),(1,2,7,2),(1,5,4,7),(4,7,7,5),(7,5,7,2),(1,5,7,2),(7,5,1,2)}) == []
draw({(1,2,1,5),(1,2,7,2),(1,5,4,7),(4,7,7,5),(7,5,7,2),(1,5,7,2),(7,5,1,2),(1,5,7,5)}) == ((7,2),(1,2),(1,5),(4,7),(7,5),(7,2),(1,5),(7,5),(1,2))
How it is used:
This mission illustrates the basics of computer generated vector graphics.
The same principles may also be applied to AI pathfinding and topological work.
Precondition:
0 < len(segments) < 30
all(all(0 < x < 100 for x in s) for s in segments)


plaf\ActionListener
Synopsis
Hierarchy
Implements
Violations
PHPMessDetector
| Line | Rule | Message |
|---|---|---|
| 11 - 85 | CyclomaticComplexity | The method stateChanged() has a Cyclomatic Complexity of 32. The configured cyclomatic complexity threshold is 10. |
Checkstyle
| Line | Column | Severity | Message |
|---|---|---|---|
| 11 | 1 | error | Spaces must be used to indent lines; tabs are not allowed |
| 11 | 79 | error | Incorrect spacing between argument "$prop" and equals sign; expected 1 but found 0 |
| 11 | 79 | error | Incorrect spacing between default value and equals sign for argument "$prop"; expected 1 but found 0 |
| 11 | 98 | error | Incorrect spacing between argument "$from" and equals sign; expected 1 but found 0 |
| 11 | 98 | error | Incorrect spacing between default value and equals sign for argument "$from"; expected 1 but found 0 |
| 11 | 115 | error | Incorrect spacing between argument "$to" and equals sign; expected 1 but found 0 |
| 11 | 115 | error | Incorrect spacing between default value and equals sign for argument "$to"; expected 1 but found 0 |
| 11 | 126 | warning | Line exceeds 120 characters; contains 126 characters |
| 11 | 126 | error | Opening brace should be on a new line |
| 12 | 1 | error | Spaces must be used to indent lines; tabs are not allowed |
| 13 | 1 | error | Spaces must be used to indent lines; tabs are not allowed |
| 14 | 1 | error | Spaces must be used to indent lines; tabs are not allowed |
| 15 | 1 | error | Spaces must be used to indent lines; tabs are not allowed |
| 16 | 1 | error | Spaces must be used to indent lines; tabs are not allowed |
| 17 | 1 | error | Spaces must be used to indent lines; tabs are not allowed |
| 18 | 1 | error | Spaces must be used to indent lines; tabs are not allowed |
| 18 | 140 | warning | Line exceeds 120 characters; contains 140 characters |
| 19 | 1 | error | Spaces must be used to indent lines; tabs are not allowed |
| 19 | 9 | error | Expected 1 space(s) after SWITCH keyword; 0 found |
| 19 | 19 | error | Expected 1 space(s) after closing parenthesis; found 0 |
| 20 | 1 | error | Spaces must be used to indent lines; tabs are not allowed |
| 20 | 13 | error | CASE statements must be defined using a colon |
| 21 | 1 | error | Spaces must be used to indent lines; tabs are not allowed |
| 21 | 17 | error | Expected 1 space(s) after IF keyword; 0 found |
| 21 | 17 | error | Inline control structures are not allowed |
| 22 | 1 | error | Spaces must be used to indent lines; tabs are not allowed |
| 23 | 1 | error | Spaces must be used to indent lines; tabs are not allowed |
| 23 | 17 | error | Expected 1 space(s) after IF keyword; 0 found |
| 23 | 46 | error | Expected 1 space(s) after closing parenthesis; found 0 |
| 24 | 1 | error | Spaces must be used to indent lines; tabs are not allowed |
| 24 | 98 | error | No space found after comma in argument list |
| 24 | 149 | error | No space found after comma in argument list |
| 24 | 183 | error | No space found after comma in argument list |
| 24 | 215 | warning | Line exceeds 120 characters; contains 215 characters |
| 25 | 1 | error | Spaces must be used to indent lines; tabs are not allowed |
| 25 | 18 | error | Spaces must be used for alignment; tabs are not allowed |
| 25 | 18 | error | Whitespace found at end of line |
| 26 | 1 | error | Spaces must be used to indent lines; tabs are not allowed |
| 26 | 17 | error | Expected 1 space(s) after IF keyword; 0 found |
| 26 | 17 | error | Inline control structures are not allowed |
| 27 | 1 | error | Spaces must be used to indent lines; tabs are not allowed |
| 27 | 51 | error | No space found after comma in argument list |
| 27 | 58 | error | No space found after comma in argument list |
| 28 | 1 | error | Spaces must be used to indent lines; tabs are not allowed |
| 29 | 1 | error | Spaces must be used to indent lines; tabs are not allowed |
| 29 | 13 | error | CASE statements must be defined using a colon |
| 30 | 1 | error | Spaces must be used to indent lines; tabs are not allowed |
| 30 | 17 | error | Expected 1 space(s) after IF keyword; 0 found |
| 30 | 55 | error | Expected 1 space(s) after closing parenthesis; found 0 |
| 31 | 1 | error | Spaces must be used to indent lines; tabs are not allowed |
| 31 | 50 | error | No space found after comma in argument list |
| 31 | 83 | error | No space found after comma in argument list |
| 32 | 1 | error | Spaces must be used to indent lines; tabs are not allowed |
| 33 | 1 | error | Spaces must be used to indent lines; tabs are not allowed |
| 34 | 1 | error | Spaces must be used to indent lines; tabs are not allowed |
| 34 | 13 | error | CASE statements must be defined using a colon |
| 35 | 1 | error | Spaces must be used to indent lines; tabs are not allowed |
| 35 | 17 | error | Expected 1 space(s) after IF keyword; 0 found |
| 35 | 55 | error | Expected 1 space(s) after closing parenthesis; found 0 |
| 36 | 1 | error | Spaces must be used to indent lines; tabs are not allowed |
| 36 | 50 | error | No space found after comma in argument list |
| 36 | 80 | error | No space found after comma in argument list |
| 37 | 1 | error | Spaces must be used to indent lines; tabs are not allowed |
| 38 | 1 | error | Spaces must be used to indent lines; tabs are not allowed |
| 39 | 1 | error | Spaces must be used to indent lines; tabs are not allowed |
| 39 | 13 | error | CASE statements must be defined using a colon |
| 40 | 1 | error | Spaces must be used to indent lines; tabs are not allowed |
| 40 | 17 | error | Expected 1 space(s) after IF keyword; 0 found |
| 40 | 55 | error | Expected 1 space(s) after closing parenthesis; found 0 |
| 41 | 1 | error | Spaces must be used to indent lines; tabs are not allowed |
| 41 | 50 | error | No space found after comma in argument list |
| 41 | 80 | error | No space found after comma in argument list |
| 42 | 1 | error | Spaces must be used to indent lines; tabs are not allowed |
| 42 | 50 | error | No space found after comma in argument list |
| 42 | 86 | error | No space found after comma in argument list |
| 43 | 1 | error | Spaces must be used to indent lines; tabs are not allowed |
| 44 | 1 | error | Spaces must be used to indent lines; tabs are not allowed |
| 45 | 1 | error | Spaces must be used to indent lines; tabs are not allowed |
| 45 | 13 | error | CASE statements must be defined using a colon |
| 46 | 1 | error | Spaces must be used to indent lines; tabs are not allowed |
| 46 | 17 | error | Expected 1 space(s) after IF keyword; 0 found |
| 46 | 86 | error | Expected 1 space(s) after closing parenthesis; found 0 |
| 47 | 1 | error | Spaces must be used to indent lines; tabs are not allowed |
| 47 | 50 | error | No space found after comma in argument list |
| 47 | 79 | error | No space found after comma in argument list |
| 48 | 1 | error | Spaces must be used to indent lines; tabs are not allowed |
| 49 | 1 | error | Spaces must be used to indent lines; tabs are not allowed |
| 50 | 1 | error | Spaces must be used to indent lines; tabs are not allowed |
| 50 | 13 | error | CASE statements must be defined using a colon |
| 51 | 1 | error | Spaces must be used to indent lines; tabs are not allowed |
| 51 | 17 | error | Expected 1 space(s) after IF keyword; 0 found |
| 51 | 45 | error | Expected 1 space(s) after closing parenthesis; found 0 |
| 52 | 1 | error | Spaces must be used to indent lines; tabs are not allowed |
| 52 | 50 | error | No space found after comma in argument list |
| 52 | 82 | error | No space found after comma in argument list |
| 53 | 1 | error | Spaces must be used to indent lines; tabs are not allowed |
| 54 | 1 | error | Spaces must be used to indent lines; tabs are not allowed |
| 55 | 1 | error | Spaces must be used to indent lines; tabs are not allowed |
| 55 | 13 | error | CASE statements must be defined using a colon |
| 56 | 1 | error | Spaces must be used to indent lines; tabs are not allowed |
| 56 | 17 | error | Expected 1 space(s) after IF keyword; 0 found |
| 56 | 45 | error | Expected 1 space(s) after closing parenthesis; found 0 |
| 57 | 1 | error | Spaces must be used to indent lines; tabs are not allowed |
| 57 | 50 | error | No space found after comma in argument list |
| 57 | 79 | error | No space found after comma in argument list |
| 58 | 1 | error | Spaces must be used to indent lines; tabs are not allowed |
| 59 | 1 | error | Spaces must be used to indent lines; tabs are not allowed |
| 60 | 1 | error | Spaces must be used to indent lines; tabs are not allowed |
| 60 | 13 | error | CASE statements must be defined using a colon |
| 61 | 1 | error | Spaces must be used to indent lines; tabs are not allowed |
| 61 | 17 | error | Expected 1 space(s) after IF keyword; 0 found |
| 61 | 46 | error | Expected 1 space(s) after closing parenthesis; found 0 |
| 62 | 1 | error | Spaces must be used to indent lines; tabs are not allowed |
| 62 | 50 | error | No space found after comma in argument list |
| 62 | 83 | error | No space found after comma in argument list |
| 63 | 1 | error | Spaces must be used to indent lines; tabs are not allowed |
| 64 | 1 | error | Spaces must be used to indent lines; tabs are not allowed |
| 65 | 1 | error | Spaces must be used to indent lines; tabs are not allowed |
| 66 | 1 | error | Spaces must be used to indent lines; tabs are not allowed |
| 66 | 13 | error | CASE statements must be defined using a colon |
| 67 | 1 | error | Spaces must be used to indent lines; tabs are not allowed |
| 67 | 17 | error | Expected 1 space(s) after IF keyword; 0 found |
| 67 | 130 | error | Expected 1 space(s) after closing parenthesis; found 0 |
| 67 | 131 | warning | Line exceeds 120 characters; contains 131 characters |
| 68 | 1 | error | Spaces must be used to indent lines; tabs are not allowed |
| 68 | 50 | error | No space found after comma in argument list |
| 68 | 76 | error | No space found after comma in argument list |
| 69 | 1 | error | Spaces must be used to indent lines; tabs are not allowed |
| 70 | 1 | error | Spaces must be used to indent lines; tabs are not allowed |
| 71 | 1 | error | Spaces must be used to indent lines; tabs are not allowed |
| 72 | 1 | error | Spaces must be used to indent lines; tabs are not allowed |
| 73 | 1 | error | Spaces must be used to indent lines; tabs are not allowed |
| 73 | 13 | error | CASE statements must be defined using a colon |
| 74 | 1 | error | Spaces must be used to indent lines; tabs are not allowed |
| 74 | 17 | error | Expected 1 space(s) after IF keyword; 0 found |
| 74 | 130 | error | Expected 1 space(s) after closing parenthesis; found 0 |
| 74 | 131 | warning | Line exceeds 120 characters; contains 131 characters |
| 75 | 1 | error | Spaces must be used to indent lines; tabs are not allowed |
| 75 | 50 | error | No space found after comma in argument list |
| 75 | 75 | error | No space found after comma in argument list |
| 76 | 1 | error | Spaces must be used to indent lines; tabs are not allowed |
| 77 | 1 | error | Spaces must be used to indent lines; tabs are not allowed |
| 78 | 1 | error | Spaces must be used to indent lines; tabs are not allowed |
| 79 | 1 | error | Spaces must be used to indent lines; tabs are not allowed |
| 79 | 13 | error | CASE statements must be defined using a colon |
| 80 | 1 | error | Spaces must be used to indent lines; tabs are not allowed |
| 81 | 1 | error | Spaces must be used to indent lines; tabs are not allowed |
| 81 | 13 | error | CASE statements must be defined using a colon |
| 82 | 1 | error | Spaces must be used to indent lines; tabs are not allowed |
| 83 | 1 | error | Spaces must be used to indent lines; tabs are not allowed |
| 84 | 1 | error | Spaces must be used to indent lines; tabs are not allowed |
| 85 | 1 | error | Spaces must be used to indent lines; tabs are not allowed |
Methods
public
History
-
2021-01-24T22:59:14+00:00 (commit #20b204f)
Author: Folarin Martins<EMAIL_ADDRESS>/ Commiter: Folarin Martins<EMAIL_ADDRESS>QA/CI tests completed; next:Jenkins CI/CD pipeline
-
2021-01-21T05:30:41+00:00 (commit #a190680)
Author: Folarin Martins<EMAIL_ADDRESS>/ Commiter: Folarin Martins<EMAIL_ADDRESS>Laying out user_info_service


Welcome to the Geddy Tutorial
In this tutorial we'll learn how to use Geddy by creating a simple todo manager applciation. There will be two created applications one created from scaffolding(Finished version) and one created from using resources(Finished version).
In this tutorial we'll cover:
- Creating the base application
- Learning how to use the Geddy executable
- Setting up RESTful routes for our app
- Using Geddy models
- How to use init.js in your applications startup
- How views in Geddy work
- How to use controllers to tie everything together
Installing Geddy
If you haven't already, install Node on your machine.
Next, install Geddy from NPM, this will also install Jake:
$ [sudo] npm install -g geddy
(Note installing packages globally may require super-user access)
Using the Geddy command
Now that we have Geddy installed we need to learn how to use it's command from the CLI. There are a few commands and options that help with the development process of creating applications using Geddy. Here we will go over what each of them do. Note If no arguments are given Geddy will start up the server if it's a Geddy application, otherwise it will show the help dialog.
Options:
--environment
,-e
: Environment to use--port
,-p
: Port to connect server to--workers
,-w
: Number of workers to use (default: 1)--debug
,-d
: Sets the log level to output debug messages to console--jade
,-j
: When generating views, use Jade templates(Default: EJS)--handle
,-H
: When generating views, use Handlebars templates(Default: EJS)--mustache
,-m
: When generating views, use Mustache templates(Default: EJS)--version
,-v
: Output the version of Geddy installed--help
,-h
: Output the list of commands and options
Commands:
app <name>
: Create a new Geddy applicationresource <name> [model attributes]
: Create a new Geddy resource. Resources include a model, controller and a routescaffold <name> [model attributes]
: Creates a new Geddy scaffolding. Scaffolding includes everything Resources have as well as views and a default model adaptersecret
: Generate a new application secret in `config/environment`controller <name>
: Generate a new controller including an index view and a routemodel <name> [model attributes]
: Generate a new model
How to use Geddy commands
Each of Geddy's commands(app
, resource
, controller
, etc.) take a command or set of commands(excluding secret
). Here we'll learn how to use those commands.
app
takes a single argument being the name you'd like, then it will generate a base application. If no name is given the command will fail.secret
doesn't take any arguments, it will find yourconfig/environment
file and create a new secret in it deleting any other secret.controller
takes a single argument being a name. It will create a new controller, a route and a index view. If you also include the options--jade
,--handle
or--mustache
you can substitute the template language to your liking.model
takes one or more arguments, the first being a name and the others being a set of model properties. We won't go over model properties right now but you can learn about them here. This will create a new model including the model properties given.resource
takes one or more arguments, the first being a name and the others being a set of model properties. We won't go over model properties right now but you can learn about them here. This will create a controller, a model including the given model properties and a resource route.scaffold
takes one or more arguments, the first being a name and the others being a set of model properties. We won't go over model properties right now but you can learn about them here. Scaffolding includes a controller, a model including the given model properties as well as a default model adapter a resource route and will create all views. If you also include the options--jade
,--handle
or--mustache
you can substitute the template language to your liking.
Model properties
There are a couple commands(resource
, model
and scaffold
) that also include a model properties argument. This is a list seperated by spaces that include the property, it's type and an optional default setting. Below are some examples of how they are used in the commands.
$ geddy scaffold user name:string
The example above example will create our normal scaffolding and include a name
option that's a string
type. If no type is given it will default to string
.
$ geddy scaffold user name:default
This example creates scaffolding but includes name
as the default property that will be used when displaying the content in the views. In this example the property name
is given the type string
because no type was given, you could of also written it name:string:default
, or you could've used a different type of course. the default
setting also includes a alias called def
, if no default property is given it will use id
as the default.
$ geddy scaffold user name:default id:number
As the above examples this creates are scaffold, and this time we use name
type string
as the default property we also overwrite the included id
property. If no id property is given Geddy will use include id
type string
(Note a ID property will always be created)
Scaffolding application tutorial
This will be a short tutorial as scaffolding will do almost everything for us, I won't go into detail on what it does as it will be covered in exstensive detail in the resources tutorial. The source for this tutorial will be here
First we'll create our application, this will create a base so we can start on.
$ geddy app todo_app
Now you can start the application up by simply doing $ cd todo_app && geddy
, Then open your browser to localhost:4000, and you'll find the hello world page.
So now we want to create a scaffold that will be used to create our todo items. We will create a title and status property so that we have some attributes to use.
$ geddy scaffold todo title status
Now that we've created a scaffolding we should install the mondodb-wrapper package and install a mongodb server if you haven't already. This is because scaffolding will create a default model adapater for us that uses mongodb.
$ [sudo] npm install -g mongodb-wrapper
Once that gets installed and we start our mongodb server up we can start up Geddy to test our application. $ geddy
Open your browser to localhost:4000/todos and you'll get a list of the todos which should be empty. Go ahead and look around, you can create show edit and delete todo items. We're going to make a few changes though.
The first thing we'll do it edit the model some so open 'app/models/todo.js' in your editor, and make these changes.
... this.defineProperties({ id: {type: 'string', required: true} , title: {type: 'string', required: true} , status: {type: 'string', required: true} }); this.validatesPresent('title'); this.validatesLength('title', {min: 5}); this.validatesWithFunction('status', function (status) { return status == 'open' || status == 'done'; }); ...
Here we are making it so the title property is required and have a minumum of 5 characters. We also made it so the status acts like a boolean attribute but uses custom names instead of true/false. Now we'll need to edit the edit and add views to reflect the status changes.
... status
 <select name="status", class="span1"> <option>open</option> <option>done</option> </select>
 ...
Now that we've made the needed changes, restart Geddy to update our model changes, now we've got a good todo application running and didn't really have to do anything. Scaffolding is very good when you don't need to do much. To learn more about models and applications keep reading and follow the resource application tutorial
Resource application tutorial
Let's start by using the geddy
executable to generate a basic app-structure.
$ geddy app todo_app
Now let's try out our new application by doing $ cd todo_app && geddy
command, your app should be running on port 4000. Visit http://localhost:4000 in your browser to see your app.
optional: check out your app on a mobile phone
- point your mobile phone's browser to your computer's port 4000
- OR open up your favorite phone simulator and go to http://localhost:4000
- OR resize your browser to at least 480px wide
Generate a resource
Now, lets actually get started building our To Do list manager. First, we'll need to generate the todo
resource. We do this using the geddy
executable as well:
$ geddy resource todo name string
What did that do?
- It generated a
todo
model including the given model properties - It generated a
todos
controller - It created a
todos
view directory - It generated these routes from a resource route:
/todos
(GET)/todos
(POST)/todos/add
(GET)/todos/:id/edit
(GET)/todos/:id
(GET)/todos/:id
(PUT)/todos/:id
(DELETE)
Now lets restart Geddy so our changes are updated. $ geddy
Once it starts up point your browser to http://localhost:4000/todos.json to view the index action in JSON. We don't currently have any views but we're about to do that now.
Creating the Todo views
To start creating our views, create a few files in 'app/views/todos', those being:
- _form.html.ejs
- add.html.ejs
- edit.html.ejs
- index.html.ejs
- show.html.ejs
We won't go into to much detail here, as it should be pretty self explanatory but I'll go through some things.
First we'll create the _form partial template, this will hold all the form data for edit and add actions.
<% var isUpdate = params.action == 'edit' , formTitle = isUpdate ? 'Update this To Do Item' : 'Create a new To Do Item' , action = isUpdate ? todoPath(params.id) + '?_method=PUT' : todosPath , deleteAction = isUpdate ? todoPath(params.id) + '?_method=DELETE' : '' , btnText = isUpdate ? 'Update' : 'Add' , doneStatus = isUpdate ? 'checked' : '' , titleValue = isUpdate ? todo.title : '' , errors = params.errors; %> <form id="todo-form" class="form-horizontal" action="<%= action %>" method="POST"> <fieldset> <legend><%= formTitle %></legend>
 Title
 <%- contentTag('input', titleValue, {type:'text', class:'span6', placeholder:'enter title', name:'title'}) %> <% if (errors) { %>
 <% for (var p in errors) { %>
<%= errors[p]; %>
 <% } %>
 <% } %>

 <% if (isUpdate) { %>
 Status
 <select name="status"> <option>open</option> <option>done</option> </select>

 <% } %>
 <%- contentTag('input', btnText, {type: 'submit', class: 'btn btn-primary'}) %> <% if (isUpdate) { %> <%- contentTag('button', 'Remove', {type: 'submit', formaction: deleteAction, formmethod: 'POST', class: 'btn btn-danger'}) %> <% } %>
 </fieldset> </form>
Here we created a couple variables so we can tell if it's for a edit or add action, then if we have any errors we dislay them. Also we are using a couple view helpers(contentTag) which are helpful with dealing with assets, links, etc. You can read more about our view helpers here.
Now that we've created a base for our add and edit actions, we'll do them now. They're simple sense they just use the _form partial

 <%= partial('_form', {params: params}); %>

This template will be for both add and edit actions. We just create a partial from _form and include all the params.
Now that we have views that will create todo items let's create the show action so we can view the todo items we create.

Params

 <% for (var p in params) { %>
<%= p + ': ' + params[p]; %>
 <% } %>

I will leave the show action to you for a exercise, but herre I just loop through the params and show them.
Finally we need to create the index action to link everything together.

To Do List
 <%- linkTo('Create a new To Do', addTodoPath, {class: 'btn pull-right'}) %>
 <% if (todos && todos.length) { %> <% for (var i in todos) { %>

<%- linkTo(todos[i].title, editTodoPath(todos[i].id)) %>

<%= todos[i].status; %>

 <% } %> <% } %>
For the index action we just have a link to add new items, and a list of ll the items, with a link to each of their edit paths. If you notice we're using special helpers here, that create links to the path specified.
Creating the Todo model
We're ready to start in on modeling our data. Geddy provides us with some pretty cool tools to do this:
- Validation
- Typed Data
- Instance Methods
- Static Methods
These tools should look somewhat familiar to anyone who's used an ORM-system like Ruby's ActiveRecord, or DataMapper.
Go ahead and open up app/models/todo.js
. Read through the commented out code there for some ideas on what you can do with models. We'll be writing our model from scratch for this tutorial, so lets leave that commented out. (It's been deleted in the example app.)
So, minus the commented out code, you should have a file that looks like this:
var Todo = function () { this.defineProperties({ id: {type: 'string', required: true} , title: {type: 'string'} , status: {type: 'string'} }); }; Todo = geddy.model.register('Todo', Todo);
The `defineProperties` method takes any number of properties to be added to the model. The keys in the object will be added as properties on the model. The values are just objects that describe the properties. When we ran the scaffold command it created these for us. But we want to change it so they are all `required` so set `title` and `status` to match `id` now.
To learn more, check out the readme.
There's also more detailed validation API. While we're here, lets use that API to set up some more validations:
this.validatesPresent('title'); this.validatesLength('title', {min: 5}); this.validatesWithFunction('status', function (status) { return status == 'open' || status == 'done'; });
For the title
property, we made sure that the property is always present and we made sure that the title
property is a minimum of 5 characters long.
For the 'status' property, we used a function to validate that the property is always set to either open
or done
.
For more information about Geddy's Models, you can check out the Model wiki page.
Creating a Todo model-adapter
Now that we've set up our todo
model, we can create somewhere to store our models. For the purposes of this tutorial, we're just going to keep the data in memory.  If you want to make this app more robust after the tutorial, you could write an adapter to put your data in a SQL database, or Redis, or even just write it to a text-file.
Editing your init.js file
Open up your config/init.js
file. All that should be in there now is a global uncaught exception handler.
if (geddy.config.environment != 'development') { process.addListener('uncaughtException', function (err) { geddy.log.error(JSON.stringify(err)); }); }
Right after that block of code, lets hang our array off the geddy
global:
geddy.todos = [];
There, now we've got a place to store our todo
's. This is in your application-memory, so it will disappear when you restart the server.
Creating the model adapter
A model-adapter provides the basic CRUD methods a model needs. Our data source is pretty simple (just an array!), so writing our model adapter should be pretty simple too.
Create a directory in lib
called model_adapters
$ mkdir lib/model_adapters
And create a file in lib/model_adapters
called todo.js
$ touch lib/model_adapters/todo.js
Lets open up that file and add in some boilerplate code:
var Todo = new (function () { })(); exports.Todo = Todo;
Require the model adapter in init.js
So we set up a new Todo
model-adapter object. It's pretty barren right now, but we'll get to that soon. For now, we'll have to go back to init.js
and add some code so that it's loaded into our app when it starts up. After the geddy.todos = [];
in config/init.js
add these two lines:
geddy.model.adapter = {}; geddy.model.adapter.Todo = require(process.cwd() + '/lib/model_adapters/todo').Todo;
We're working on making this nicer.
We created a blank model-adapter object, and add the Todo
model adapter onto it.
Saving todos
Now that we have our model and model adapter in place, we can start in on the app logic. Lets start with adding to do items to our to do list.
Edit the save method on the adapter to save a todo instance
When working with data, the first place you should go is the model adapter. We need to be able to save an instance of our Todo
model to our geddy.todos
array. So open up lib/model_adapters/todo.js
and add in a save
method:
this.save = function (todo) { todo.saved = true; geddy.todos.push(todo); };
All we have to do is set the instance's saved
property to true and push the item into the geddy.todos
array. Now lets move on to the controller create
action.
Edit the create action to save a todo instance
Go ahead and take a look at the create
action in app/controllers/todos.js
this.create = function (req, resp, params) { // Save the resource, then display index page this.redirect({controller: this.name}); };
Pretty simple, right? It's stubbed it out for you. So let's modify it a little bit:
this.create = function (req, resp, params) { var todo = geddy.model.Todo.create({title: params.title, id: geddy.string.uuid(10), status: 'open'}); if (todo.isValid()) { todo.save(); this.redirect({controller: this.name}); } else { this.redirect({controller: this.name, action: 'add?error=true'}); } };
First, we create a new instance of the Todo
model with geddy.model.Todo.create
, passing in the title that our form will post up to us, and setting up the defaults for the id and status.
Then we check to see if the model passed validation, if it did, we call the save
method that we created on the model adapter and redirect the user back to the /todos
route. If it didn't pass validation, we redirect the user back to the /todos/add route and pass an error as a query parameter.
Geddy has built-in sessions too, so this might be another good spot to improve your app after you finish the tutorial.
Listing all todos
Now that we have user input To Do items being added into our geddy.todos
array, we should probably list them somewhere. Lets start in on the index
action in the todos
controller.
Edit the index action to show all todos
Open up /app/controllers/todos.js
again and take a look at the index
action. It should look something like this:
this.index = function (req, resp, params) { this.respond({params: params}); };
This part is really simple, just replace the params
property in the template variable object with a todos
property and set it to geddy.todos
, to pass that list down into your view.
this.index = function (req, resp, params) { this.respond({todos: geddy.todos}); };
Now that we can can load todo items you can test it by starting up Geddy and go to http://localhost:4000/todos and you can view the list of items.
Showing a todo
Now that we have our index action working as expected, we should probably work on the show
controller action.
Create a load method in the model adapter
Open up your model adapter again (/lib/model_adapters/todo.js
) - by now, it should look something like this:
var Todo = new (function () { this.save = function (todo) { todo.saved = true; geddy.todos.push(todo); }; })(); exports.Todo = Todo;
Lets define a load
method in this adapter, for getting one of the todos from the list:
var Todo = new (function () { this.load = function (id, callback) { for (var i in geddy.todos) { if (geddy.todos[i].id == id) { return callback(geddy.todos[i]); } } callback({}); }; this.save = function (todo) { todo.saved = true; geddy.todos.push(todo); }; })(); exports.Todo = Todo;
This load
method takes an id
and a callback
. It loops through the items in geddy.todos
and checks to see if the current item's id
matches the passed in id
. If it does, it calls the callback, passing the todo
item back. If it doesn't find a match, it calls the callback with a blank object. Now we need to use this method in the todos
controller's show action.
This is a simple example that finds a single item by iterating the entire collection, but you could write an adapter that does a SQL-call to a database, or makes an API-call to a Web service.
Edit the show action to find a todo
Open up your todos
controller again and take a look at it's show
action. It should look something like this:
this.show = function (req, resp, params) { this.respond({params: params}); };
Lets use the load method that we just created:
this.show = function (req, resp, params) { var self = this; geddy.model.adapter.Todo.load(params.id, function (todo) { self.respond({todo: todo}); }); };
Now we have a working show action in the controller to load items from the list.
Updating a todo
Edit the save method in the model adapter to save over existing todos
Open up your model adapter again. We're going to want to change the save method to allow for saving over existing model instances. You're save
method should look something like this:
this.save = function (todo, callback) { todo.saved = true; geddy.todos.push(todo); };
Lets edit it to look like this:
this.save = function (todo, callback) { for (var i in geddy.todos) { // if it's already there, save it if (geddy.todos[i].id == todo.id) { geddy.todos[i] = todo; return; } } todo.saved = true; geddy.todos.push(todo); };
This loops over all the todo
's in geddy.todos
and if the id is already there, replace that todo
with the new todo
instance. If you were hooked up to a real DB here, you'd do a SQL UPDATE or similar here instead.
Edit the update action to find a todo, change the status, and save it
Alright, now that we have our save
method in order, lets edit the update
action in the todos
controller. It should look something like this right now:
this.update = function (req, resp, params) { // Save the resource, then display the item page this.redirect({controller: this.name, id: params.id}); };
You'll want to edit it to make it look like this:
this.update = function (req, resp, params) { var self = this; geddy.model.adapter.Todo.load(params.id, function (todo) { todo.status = params.status; todo.save(); self.redirect({controller: this.name, id: params.id}); }); };
We're taking the id that we sent up via the ajax PUT
request on the show
page and using the load
method that we created earlier to find a todo
item. Then we're setting its status
to be what we sent up in the params ('done'). Then we use the save
method that we just updated to save over the existing todo
item. Then, in case this isn't coming from an ajax request, we're redirecting the request over to the show
action (hooray for progressive enhancment).
Conclusion
At this point you should have a working To Do List app!
Oh, did we mention that you have a JSON and JSONP api now too?
Check it out:
- GET:
/todos.json
- GET:
/todos/:id.json
- POST:
/todos
- PUT:
/todos/:id
If you want to explore a little more, here are some other things you could do:
- Change the
Main#index
route to point to theTodos#index
action (hint, check outconfig/router.js
) - Add some logging with
geddy.log
- Set up metrics by running
npm install metrics
, and uncomment the metrics entry (metrics: { port: 4001 }
) in yourconfig/environment.js
file


{% extends "Default/default.html" %} {% block content %}
DNF is a software package manager that installs, updates, and removes packages on RPM-based Linux distribution. For all of the detailed commands one can simply enter "dnf --help" into the terminal.
If you want to simply update the packages to the latest, you may do so using dnf on the dnf Package Update page.
Below will be a number of sections explaining how to: search for packages, update packages, add/remove packages, and an example of using packages.
The following command will show a list of all of the packages. There are a lot of packages so it is recommended to pipe this command into a file. You can also add an optional command afterwards of the package_name to narrow down the results.
dnf repoquery <package_name>
To update the packages and install a specific one follow the following commands:
dnf repoquery
dnf install -y <package_name>
Alternatively you can accomplish this on the webapp by going to the dnf Update page and selecting what packages you wish to update.
We will show an example of how to update, install, and then use one of the packages that we install. This example specifically will enable us to play the game OpenTyrian.
dnf repoquery
dnf install opentyrian
opentyrian
Now you will be able to play the game (only shows up on the desktop).
In this section we will explain how to write a simple "Hello World" application, compile it, and create a RPM package with CMake, install/remove it with "dnf", and run it. This will demonstrate the ease of installing and removing packages with "dnf".
dnf install rpm-build
#include <stdio.h>
int main(int argc, char *argv[])
{
printf("hello world\n");
return 0;
}
cmake_minimum_required(VERSION 2.6)
PROJECT(HelloWorld)
ADD_EXECUTABLE(hello hello.c)
INSTALL(TARGETS hello DESTINATION /usr/bin)
SET(CPACK_GENERATOR "RPM")
INCLUDE(CPack)
# Build
mkdir build
cd build
cmake ..
make package
# Install package
dnf install HelloWorld-0.1.1-Linux.rpm
# Run
hello
# Remove package
dnf remove helloworld


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
32
33 34 35
36
37 import xdc.runtime.Assert;
38 import xdc.rov.ViewInfo;
39
40 /*!
41 * ======== ServiceMgr ========
42 * Module that manages UIA Services
43 *
44 * The ServiceMgr module manages all the UIA Services. The ServiceMgr module
45 * itself can be plugged with different low level transport functions to
46 * support different methods for getting information between the target
47 * and instrumentation host. Some of these methods (e.g. File) only support
48 * sending information from the target to the host. They do not support
49 * sending information from the host to the target.
50 *
51 * The ServiceMgr module also supports two different topologies.
52 * @p(blist)
53 * - Topology_SINGLECORE: Each core on the device communicates
54 * directly the instrumentation host.
55 * - Topology_MULTICORE: Only one core (i.e. master)
56 * communicates with the instrumentation host. Communication
57 * with other cores are routed to the via the master core.
58 * The master core is determined by the {@link #masterProcId}
59 * parameter. The routing is done via Ipc's MessageQ module.
60 * Note: ServiceMgr is a user of Ipc and depends on the
61 * application to configure and initialize Ipc.
62 * @p
63 *
64 * There are two different uses of the ServiceMgr module:
65 * @p(blist)
66 * - Applications (configuration only)
67 * - Services
68 * @p
69 *
70 * @p(html)
71 * Applications
72 * @p
73 * The ServiceMgr module contains the generic configuration.
74 * Many of these configuration values change
75 * depending on the device. The ServiceMgr module uses the
76 * ti.uia.family.Settings module to fill in values if they are not set by
77 * the application.
78 *
79 * The ServiceMgr does expose many configuration parameters to allow users
80 * to modify the default behavior.
81 *
82 * @p(blist)
83 * - Topology: UIA is shipped with support for two different topologies:
84 * @p(blist)
85 * - Topology_SINGLECORE: Each core on the device communicates
86 * directly the instrumentation host.
87 * - Topology_MULTICORE: Only one core (i.e. master)
88 * communicates with the instrumentation host. Communication
89 * with other cores are routed to the via the master core.
90 * The master core is determined by the {@link #masterProcId}
91 * parameter. The routing is done via Ipc's MessageQ module.
92 * Note: ServiceMgr is a user of Ipc and depends on the
93 * application to configure and initialize Ipc.
94 * @p
95 *
96 * - Transport: The ServiceMgr has pluggable transport functions. The
97 * determination of the transport is accomplished via the
98 * {@link #transportType} parameter. The parameter is defaulted
99 * based on the device is not explicitly set.
100 *
101 * - Packets: UIA makes a distinction between event and messages packets.
102 * Events packets are generally bigger to hold many event
103 * records. The size and number of these packets are defaulted
104 * by UIA based on the transport and device. However the number
105 * of event packets might need to be increased on a multicore
106 * device with heavy event record load.
107 * {@link #numEventPacketBufs} can be increased in this case.
108 *
109 * - Tasks: The ServiceMgr module might have up to two tasks:
110 * transfer agent task and receive task. The receive task only
111 * recieves control messages from the instrumentation host and
112 * forwards it on the the transfer agent task.
113 * The transfer agent task is responsible for everything else
114 * (e.g. period management, event collection, communicating with
115 * remote cores in a multicore configuration, sending UIA Packets
116 * to the instrumentation host, etc.).
117 *
118 * The application can specify the stack sizes and placement of
119 * these task via the ServiceMgr.
120 *
121 * If there is only one task needed, the parameters for the
122 * receive task is ignored.
123 * @p
124 *
125 * @p(html)
126 * Services
127 * @p
128 * All services must register with the ServiceMgr module via the
129 * {@link #register} function. Each service
130 * must have a unique service id (the first 3 are reserved). The service id
131 * is obtained via the encoded type ServiceIdDesc.
132 *
133 * From the service's standpoint, the ServiceMgr module manages all the
134 * buffers for sending and receive messages and events. The services need
135 * to obtain packets from the ServiceMgr via the {@link #getFreePacket}
136 * function. To send a packet, the service must call the
137 * {@link #sendPacket} function.
138 *
139 * All data send and received by a service must be contained in a
140 * {@link UIAPacket} header. Refer to this module for more details.
141 *
142 * From the service's standpoint, the ServiceMgr module also manages the
143 * the period of service. Each service can request the interval at which
144 * the ServiceMgr calls the service's {@link #ProcessCallback} to send out
145 * events. This interval can be set by the service via the {@link #register}
146 * function. If during runtime the service wants to change it period, it
147 * can call {@link #setPeriod}.
148 */
149 @CustomHeader
150 module ServiceMgr
151 {
152 /*!
153 * @_nodoc
154 * ======== ModuleView ========
155 */
156 metaonly struct ModuleView {
157 Int periodInMs;
158 Bool supportControl;
159 String topology;
160 Int numServices;
161 Int masterProcId;
162 Int runCount;
163
164 }
165
166 /*!
167 * @_nodoc
168 * ======== PacketView ========
169 */
170 metaonly struct PacketView {
171 SizeT maxEventPacketSize;
172 Int numEventPacketBufs;
173 SizeT maxCtrlPacketSize;
174 Int numOutgoingCtrlPacketBufs;
175 Int numIncomingCtrlPacketBufs;
176 }
177
178 /*!
179 * @_nodoc
180 * ======== TransportView ========
181 */
182 metaonly struct TransportView {
183 String initFxn;
184 String startFxn;
185 String recvFxn;
186 String sendFxn;
187 String stopFxn;
188 String exitFxn;
189 }
190
191 /*!
192 * @_nodoc
193 * ======== StatisticsView ========
194 */
195 metaonly struct StatisticsView {
196 Int numEventPacketsSent;
197 Int numEventPacketsFailed;
198 Int numMsgPacketsSent;
199 Int numMsgPacketsFailed;
200 }
201
202 /*!
203 * @_nodoc
204 * ======== rovViewInfo ========
205 */
206 @Facet
207 metaonly config ViewInfo.Instance rovViewInfo =
208 ViewInfo.create({
209 viewMap: [
210 ['Module',
211 {
212 type: ViewInfo.MODULE,
213 viewInitFxn: 'viewInitModule',
214 structName: 'ModuleView'
215 }
216 ],
217
218
219
220
221
222
223
224
225
226 ['Transport',
227 {
228 type: ViewInfo.MODULE,
229 viewInitFxn: 'viewInitTransport',
230 structName: 'TransportView'
231 }
232 ],
233 ['Packet',
234 {
235 type: ViewInfo.MODULE,
236 viewInitFxn: 'viewInitPacket',
237 structName: 'PacketView'
238 }
239 ],
240 ]
241 });
242
243 /*!
244 * ======== Reason ========
245 * Used in the ProcessCallback to denote the reason
246 *
247 * ServiceMgr_Reason_PERIODEXPIRED: the {@link #ProcessCallback} is being
248 * called because it is time to collect events and send them.
249 *
250 * ServiceMgr_Reason_REQUESTENERGY: the {@link #ProcessCallback} is being
251 * called because the service requested energy to perform some action.
252 *
253 * ServiceMgr_Reason_INCOMINGMSG: the {@link #ProcessCallback} is being
254 * called because there is an incoming message for the service.
255 */
256 enum Reason {
257 Reason_PERIODEXPIRED,
258 Reason_REQUESTENERGY,
259 Reason_INCOMINGMSG
260 };
261
262 /*!
263 * ======== Topology ========
264 * Used to define UIA topology.
265 *
266 * If UIA is configured for multicore, all events and messages are routed
267 * via the master core to the non-master cores. Choosing multicore requires
268 * setting the {@link #master} config.
269 *
270 * If UIA is configured for Topology_SINGLECORE, each core on the device
271 * communicates with the instrumentation host directly.
272 */
273 enum Topology {
274 Topology_SINGLECORE,
275 Topology_MULTICORE
276 };
277
278 /*!
279 * ======== TransportType ========
280 * Used to specify the type of transport for UIA to use.
281 *
282 * TransportType defines what the underlying transport will be used. In
283 * a multi-core topology, this parameter is only relevant for the
284 * {@link #masterProcId} core. The masterProcId core uses the TransportType
285 * to determine how to get the data off the target.
286 *
287 * @p(blist)
288 * -TransportType_ETHERNET: Use the Ethernet transport. On a SYS/BIOS
289 * system, this uses the NDK. The application is responsible for
290 * adding the NDK into the application and initializing it.
291 * -TransportType_FILE: Use the File transport.
292 * On a SYS/BIOS system, this transport requires a JTAG connection.
293 * -TransportType_USER: This allows the application to specify their
294 * own transport functions.
295 * -TransportType_NULL: No transport functions are needed. This should
296 * only be used on the non-masterProcId cores.
297 * @p
298 */
299 metaonly enum TransportType {
300 TransportType_ETHERNET,
301 TransportType_FILE,
302 TransportType_USER,
303 TransportType_NULL
304 };
305
306 /*!
307 * ======== ProcessCallback ========
308 * Function prototype for the processMsg callback
309 *
310 * A ProcessCallback function must be supplied by every service.
311 * The function is provided in the {@link #register} function.
312 *
313 * For a description of the ServiceMgr_Reason parameter, please refer
314 * to {@link #Reason}.
315 *
316 * The UIPacket_Hdr field is only used in the {@link #Reason_INCOMINGMSG}
317 * case. For any other reason, this value is NULL.
318 */
319 typedef Void (*ProcessCallback)(Reason, UIAPacket.Hdr *);
320
321 /*!
322 * ======== WAIT_FOREVER ========
323 * Wait forever constant that can be used in ServiceMgr_getFreePacket.
324 */
325 const UInt WAIT_FOREVER = ~(0);
326
327 /*! @_nodoc */
328 metaonly struct ServiceIdDesc { Bits16 val; };
329
330 /*!
331 * ======== ServiceId ========
332 * Used by services to generate a serviceId
333 *
334 * Services needs to define a ServiceId in their xdc file.
335 * Then the ServiceMgr module will assign a unique value to it during
336 * build time.
337 *
338 * For example in ti.uia.service.Rta.xdc there is the following line:
339 * @p(code)
340 * readonly config ServiceMgr.ServiceId SERVICEID;
341 * @p
342 */
343 @Encoded typedef ServiceIdDesc ServiceId; /*! Control command type */
344
345 /*!
346 * Assert raised when calling API with invalid ServiceId
347 */
348 config Assert.Id A_invalidServiceId = {
349 msg: "A_invalidServiceId: ServiceId out of range"
350 };
351
352 /*!
353 * Assert raised invalid processCallbackFxn is supplied
354 */
355 config Assert.Id A_invalidProcessCallbackFxn = {
356 msg: "A_invalidProcessCallbackFxn: Callback cannot be NULL"
357 };
358
359 /*!
360 * ======== customTransportType ========
361 * Custom transport used to send the records to an instrumentation host
362 */
363 metaonly config String customTransportType = null;
364
365 /*!
366 * ======== transportFxns ========
367 * Transport functions used to communicate to the instrumentation host
368 *
369 * These functions are setup by default based on the device.
370 * The user can explicitly set this parameter if the default is not
371 * appropriate.
372 */
373 config Transport.FxnSet transportFxns;
374
375 /*!
376 * ======== topology ========
377 * Used to define UIA topology.
378 *
379 * If `Topology_MULTICORE` is chosen, the ServiceMgr will use Ipc to
380 * discover the core configuration and to communicate between the cores.
381 * UIA will route the outbound packets from each core through the master
382 * core. UIA will also route messages received by the master core to
383 * their intended recipient.
384 *
385 * If UIA is configured for Topology_SINGLECORE, each core on the device
386 * communicates with the instrumentation host directly.
387 *
388 * The default is Topology_SINGLECORE.
389 */
390 config Topology topology = Topology_SINGLECORE;
391
392 /*!
393 * ======== transportType ========
394 * Determines the transport that UIA will be configured for.
395 *
396 * For a given transport type, UIA picks an appropriate transport
397 * implementation to use based on your device. This is specified by the
398 * ti.uia.family.Settings module. Refer to the examples for configuring
399 * the actual transport implementation.
400 *
401 * If someone writes an new transport (e.g. RapidIO),
402 * they can be plugged in by setting the TransportType
403 * to `TransportType_USER` and then plugging
404 * the transportFxns manually. It must also set up the following parameters
405 * as directed by the new transport developer.
406 * @p(blist)
407 * -ServiceMgr.supportControl: does the transport support receiving
408 * messages from the host. For example TransportFile does not.
409 * -ServiceMgr.maxEventPacketSize: Max size of an outgoing event packet. For
410 * example TransportNdk uses 1472 (emac size minus headers)
411 * -ServiceMgr.maxCtrlPacketSize: Max size of the message packets. This can
412 * be zero if supportControl is false.
413 * @p
414 *
415 * Here is an example of plugging the transport XYZ into the ServiceMgr:
416 * @p(code)
417 * var ServiceMgr = xdc.useModule('ti.uia.runtime.ServiceMgr');
418 * ServiceMgr.transportType = ServiceMgr.TransportType_USER;
419 * var xyzTransport = {
420 * initFxn: '&TransportXYZ_init',
421 * startFxn: '&TransportXYZ_start',
422 * recvFxn: '&TransportXYZ_recv',
423 * sendFxn: '&TransportXYZ_send',
424 * stopFxn: '&TransportXYZ_stop',
425 * exitFxn: '&TransportXYZ_exit'
426 * };
427 * ServiceMgr.transportFxns = xyzTransport;
428 *
429 * ServiceMgr.maxEventPacketSize = 1024
430 * ServiceMgr.maxCtrlPacketSize = 1024;
431 * ServiceMgr.supportControl = true;
432 * @p
433 */
434 metaonly config TransportType transportType;
435
436 /*!
437 * ======== periodInMs ========
438 * Period in miliseconds of ServiceMgr's transfer agent
439 *
440 * The transfer agent runs at the configured period. It checks to see
441 * if a service's period has expired. If it has expired, the service's
442 * {@link #ProcessCallback} is called with the
443 * {@link #Reason_PERIODEXPIRED} reason.
444 *
445 * A service should not set it's period to a value less than the ServiceMgr
446 * module'speriod. A service's period should be a multiple of the
447 * ServiceMgr module's period. If it is not, it will called at the rounded
448 * up period. For example, if ServiceMgr.periodInMs = 100 and a service
449 * sets its period to 250. That service will be called every 300
450 * milliseconds.
451 *
452 * This value does not guarantee that the transfer agent will run at this
453 * rate. Even if the period has expired, the transfer agent will not run
454 * until the current running Task has yielded and there are no other higher
455 * priority Tasks ready.
456 *
457 * Default is 100ms.
458 */
459 config Int periodInMs = 100;
460
461 /*!
462 * ======== maxEventPacketSize ========
463 * Size of Event packets in bytes
464 *
465 * This size includes the UIAPacket header. This value's default
466 * depends on the device.
467 */
468 config SizeT maxEventPacketSize;
469
470 /*!
471 * ======== numEventPacketBufs ========
472 * Number of UIAPacket events on the processor
473 */
474 config Int numEventPacketBufs = 2;
475
476 /*!
477 * ======== maxCtrlPacketSize ========
478 * Size of control message packets in bytes
479 *
480 * This size includes the UIAPacket header. This value's default
481 * depends on the device.
482 */
483 config SizeT maxCtrlPacketSize;
484
485 /*!
486 * ======== numOutgoingCtrlPacketBufs ========
487 * Number of outgoing Ctrl buffers on the processor
488 */
489 config Int numOutgoingCtrlPacketBufs = 2;
490
491 /*!
492 * ======== numIncomingCtrlPacketBufs ========
493 * Number of incoming Ctrl buffers on the master processor
494 */
495 config Int numIncomingCtrlPacketBufs = 2;
496
497 /*!
498 * ======== supportControl ========
499 * Configure whether control messages are supported.
500 *
501 * Default is determined based on the device and transport type.
502 *
503 * The application should only set this if {@link #transportType}
504 * is TransportType_USER and it is plugging in a new set
505 * of transport functions. The transport function package should
506 * specify how to set this parameter.
507 */
508 config Bool supportControl;
509
510 /*!
511 * ======== transferAgentPriority ========
512 * Priority of the Transfer Agent Task.
513 *
514 * Default is 1, the lowest priority.
515 */
516 config Int transferAgentPriority = 1;
517
518 /*!
519 * ======== transferAgentStackSize ========
520 * Transfer Agent Task stack size in MAUs.
521 *
522 * The recommended size is 2048 bytes.
523 */
524 config SizeT transferAgentStackSize = 2048;
525
526 /*!
527 * ======== transferAgentStackSection ========
528 * Memory section for Transfer Agent Task's stack.
529 *
530 * If this parameter is not set then the Task.defaultStackSection is used.
531 * See the Task module for instructions on creating a stack section in
532 * a different memory segment.
533 */
534 metaonly config String transferAgentStackSection = null;
535
536 /*!
537 * ======== rxTaskPriority ========
538 * Priority of the Transfer Agent Task.
539 *
540 * Default is 1, the lowest priority.
541 */
542 config Int rxTaskPriority = 1;
543
544 /*!
545 * ======== rxTaskStackSize ========
546 * Transfer Agent Task stack size in MAUs.
547 *
548 * The recommended size is 2048 bytes.
549 */
550 config SizeT rxTaskStackSize = 2048;
551
552 /*!
553 * ======== rxTaskStackSection ========
554 * Memory section for Receiving Task's stack.
555 *
556 * If this parameter is not set then the Task.defaultStackSection is used.
557 * See the Task module for instructions on creating a stack section in
558 * a different memory segment.
559 */
560 metaonly config String rxTaskStackSection = null;
561
562 /*!
563 * @_nodoc
564 * ======== SupportProxy ========
565 * The implementation module of the low-level ServiceMgr functions
566 */
567 proxy SupportProxy inherits IServiceMgrSupport;
568
569 /*!
570 * ======== masterProcId ========
571 * Processor that communicates to the instrumentation host
572 *
573 * This value denotes which core in a multiple core topology is
574 * the master core. All routing of UIA data to the instrumentation
575 * host is done via this core.
576 *
577 * The procId corresponds to Ipc's MultiProc value.
578 *
579 * For single processor systems, or where there is no routing of
580 * data via an intermediate core, this value is ignored.
581 */
582 config UInt16 masterProcId = 0;
583
584 /*!
585 * ======== freePacket ========
586 * Function to return an unused packet back to the ServiceMgr module
587 *
588 * This function can be used to return an unused packet back to the
589 * ServiceMgr module. It must only return packets that were obtained via
590 * the {@link #getFreePacket} function.
591 *
592 * @param(packet) Pointer to a UIAPacket
593 */
594 Void freePacket(UIAPacket.Hdr *packet);
595
596 /*!
597 * ======== getFreePacket ========
598 * Function to obtain a free UIA packet
599 *
600 * The service can specify what type of packet it wants with the
601 * first parameter. Currently only UIAPacket_HdrType_Msg and
602 * UIAPacket_HdrType_EventPkt are supported.
603 *
604 * The function fills in the HdrType field of the packet automatically
605 * for the service. All other fields are un-initialized.
606 *
607 * @param(type) Requested type of packet
608 * @param(timeout) Return after this many system time units
609 *
610 * @b(returns) Pointer to a packet if successful. NULL if timeout.
611 */
612 UIAPacket.Hdr *getFreePacket(UIAPacket.HdrType type, UInt timeout);
613
614 /*!
615 * ======== getNumServices ========
616 * Returns the number of services present in the system
617 *
618 * @b(returns) Number of services
619 */
620 Int getNumServices();
621
622 /*!
623 * @_nodoc
624 * ======== processCallback ========
625 * Callback function called by the support proxy
626 *
627 * This function is called by the support proxy when it needs to
628 * call a service's ProcessCallback function.
629 *
630 * This function should not be called by a service.
631 *
632 * @param(id) Service id of the service
633 * @param(reason) Reason for calling the service's ProcessCallback
634 * function
635 * @param(packet) If the reason is {@link #Reason_INCOMINGMSG}, this
636 * parameter points to the incoming msg. Otherwise it is
637 * NULL. The service does not own this packet. It should
638 * NOT re-use it. Internally the ServiceMgr module will
639 * return it to an internal queue after the
640 * processCallback returns.
641 */
642 Void processCallback(ServiceId id, Reason reason, UIAPacket.Hdr *packet);
643
644 /*!
645 * ======== register ========
646 * Register a services with the ServiceMgr module
647 *
648 * All service's must register with the ServiceMgr module statically.
649 *
650 * Refer to {@link #periodInMs} for a description of the period parameter.
651 *
652 * @param(id) Service id of the service (refer to
653 * {@link #ServiceId}).
654 *
655 * @param(processCallbackFxn) Service's callback function.
656 *
657 * @param(periodInMs) Period of the service.
658 */
659 metaonly Int register(ServiceId id, ProcessCallback processCallbackFxn,
660 UInt32 periodInMs);
661
662 /*!
663 * ======== requestEnergy ========
664 * Function to request energy for a service
665 *
666 * Generally services do not maintain an active thread.
667 * They may request the ServiceMgr module to call the
668 * {@link #ProcessCallback} in the context of the transfer agent.
669 * This can be accomplished via this function.
670 *
671 * @param(id) Service id of the service
672 */
673 Void requestEnergy(ServiceId id);
674
675 /*!
676 * ======== sendPacket ========
677 * Send a UIAPacket to the instrumentation host
678 *
679 * All UIAPacket fields except for SenderAdrs must be filled in.
680 *
681 * The caller loses ownership of the packet once it is successfully sent.
682 * If this function fails, the caller still owns the packet. It can re-use
683 * it or free it via the {@link #freePacket} function.
684 *
685 * @param(packet) UIAPacket to be sent
686 *
687 * @b(returns) TRUE denotes success and the packet is
688 * no longer owned by the caller. FALSE denotes
689 * failure and the packet is still owned by the caller.
690 */
691 Bool sendPacket(UIAPacket.Hdr *packet);
692
693 /*!
694 * ======== setPeriod ========
695 * Allows services to set their event collection period
696 *
697 * ServiceMgr's period should be a multiple of the ServiceMgr's period
698 * ({@link #periodInMs}). If it is not, they will called at the rounded
699 * up period. For example, if ServiceMgr.periodInMs = 100 and a service sets
700 * its period to 250. That service will be called every 300 milliseconds.
701 *
702 * @param(id) Service id of the service
703 *
704 * @param(periodInMs) Requested period in milliseconds
705 */
706 Void setPeriod(ServiceId id, UInt32 periodInMs);
707
708 internal:
709
710 /*!
711 * ======== ServiceMgr Information ========
712 * The following arrays contain information about each service
713 */
714 config ProcessCallback processCallbackFxn[];
715
716 struct Module_State {
717 Int runCount;
718 Int numServices;
719 };
720 }


This is tab 2 content
This is tab 3 content
This is tab 4 content
This is tab 5 content
This is tab 6 content
This is tab 7 content
This is tab 8 content


There are several units of size that can be used in CSS. They can be used to change the size of elements as well as fonts. We will focus on a few of the most commonly used units:
The box model is a representation of the areas surrounding the content of an HTML element. These areas can be transformed using CSS.
The box model for an element can be viewed in Google Chrome using the inspector (right-click Inspect or CTRL/CMD + SHIFT + I)
float
* Note that using float to create columns is out of style and there are better methods which we will cover next lesson.
position
display
display properties
Inline element displayed as Block
Simple Horizontal List Navigation Bar
Semantic elements are supported in modern browsers so that the browser understands what the meaning of the content is.
In HTML 5, several new elements were added to define the parts of a page. They provide better clarity than using a div.
This article provides examples and descriptions of these elements.
Codepen Examples
We will learn about web design principles and best practices for creating sites that are visually appealing and have intuitive navigation.
For next week's class, bring an example of a website that you use all the time. What makes this site useful to you? What do you like and dislike about its design?
Bring an example of a website that you find visually appealing. What makes it so?
Continue working on your website using the Semantic Layout template provided on CodePen. Your page should contain:


Demo of how the loadTilesWithAjax and ajaxHeaders options as well as the getTileHeaders() method on TileSource can be applied.
Examine the network requests in your browser developer tools to see the custom headers sent with each request.