Particle firmware library to help with device claiming
Particle devices must be claimed to an account, and claiming can only be done when the device is online (breathing cyan). For cellular products, it's common to claim all devices to a single account owned by the product creator. It is possible to use two-legged shadow customers for claiming, however this makes setup much more complicated.
If using a single owning account, the claiming is typically done when the device is set up with firmware and tested. However, in some cases this is not practical or even possible. For example, claiming a Europe/Asia/Africa Electron (U270) while in the United States is impossible. A similar situation can occur with LTE Cat M1 devices.
It is possible to claim a product device when it first connects to the cloud. There are a two main ways this can be done:
- One option is to have your own server that monitors online events and checks to see if the device has been claimed yet, and if not, claims the device.
- The technique described here is interesting because it only requires two webhooks and no server. The downside of this technique is that it requires some code in your device firmware.
We really do recommend claiming your devices ahead of time, but if for some reason this is not possible, this method is worth looking into.
How it works
There are a few important assumptions:
- You have a product in the Products tab in the console.
- All devices will be claimed to a single account.
- Your device firmware uses
SYSTEM_THREAD(ENABLED)
.
- You have 8 bytes of available space in the virtual EEPROM (2047 bytes on Photon/P1/Electron, and 4096 bytes on Gen 3).
Then, on the cloud side:
- You have generated a non-expiring access token for the user account that will claim all of your devices.
- You have set up the two necessary webhooks, deviceClaim and deviceTest, in your product (you can customize the names).
- Make sure you've added your device IDs to your product.
On the device side:
- Device firmware includes the DeviceClaimRK library, initialize any settings, and calls the
setup()
and loop()
methods.
- When the device starts up, in
setup()
the EEPROM is checked. If the claimed flag is set, nothing more is done.
- If the EEPROM has not been initialized or has other random data in it (there are magic bytes in the saved data), the an attempt will be made to claim.
- After successfully connecting to the cloud (breathing cyan), the deviceClaim event is sent.
- The deviceClaim webhook uses the device claim API to claim the device to the single account.
- After a few seconds, the device will disconnect from the Particle cloud. This is necessary to make the change take effect.
- Upon reconnecting to the cloud, the deviceTest event is published.
- The deviceTest webhook will attempt to retrieve device information and return it in the hook-response.
- If the device receives the hook-response then the claiming worked. The claimed flag is set in EEPROM and no attempts will be made to claim in the future.
And some other trivia:
- If the hook-response is not received, then the claiming failed. The device will stay in the failed state. On next restart it will try claiming again.
- If the EEPROM is cleared an attempt will be made to claim again, and if already claimed to the same account, the process still succeeds.
- All of the timing parameters can be adjusted.
- All event names are programmable.
- There are no sensitive things like access tokens in the device firmware. They're only in the webhooks.
- Make sure you add the device IDs to your account and don't use auto-approve. Otherwise, anyone could claim any device to your account, which is probably not what you want.
- If you want to store the configuration somewhere else (your own EEPROM, flash, SD card, FRAM, etc.) you can do so by subclassing the DeviceClaim class.
Webhook
Access Token
In order to use the webhook, you need to embed an access token for the account that will claim all of the devices. This account must also be a product team member.
The easiest way is to use the Particle CLI:
particle token create --never-expires
Do not attempt to use the token from the Web IDE (build.particle.io) as that token does not have product permissions and will not work.
Device Claim Webhook
The device claim webhook looks like this:
{
"event": "deviceClaim",
"url": "https://api.particle.io/v1/devices/?access_token=ff662975ee26911d72da36c5b078d951b0766a63",
"requestType": "POST",
"noDefaults": true,
"rejectUnauthorized": true,
"json": {
"id": "{{PARTICLE_DEVICE_ID}}"
}
}
The easiest way to do this is to create a webhook and go into the Custom JSON view and paste this in. Be sure to replace ff662975ee26911d72da36c5b078d951b0766a63 with a valid access token (that is not a valid access token). The other parameters are the same.
Custom JSON
You can change the eventName, but must do so both in the webhook and in the device firmware using the withClaimEventName() method.
Device Test Webhook
The device test webhook looks like this:
{
"event": "deviceTest",
"url": "https://api.particle.io/v1/devices/{{PARTICLE_DEVICE_ID}}?access_token=ff662975ee26911d72da36c5b078d951b0766a63",
"requestType": "GET",
"noDefaults": true,
"rejectUnauthorized": true,
"responseTopic": "{{PARTICLE_DEVICE_ID}}/hook-response/{{PARTICLE_EVENT_NAME}}"
}
This webhook returns information about the device after attempting claiming. If the claim did not succeed, the device will not receive this information and it will know that claiming failed.
Don't forget to update the access token.
Device Firmware
Adding the library to your device firmware is easy:
#include "DeviceClaimRK.h"
PRODUCT_ID(8761);
PRODUCT_VERSION(1);
SYSTEM_THREAD(ENABLED);
SerialLogHandler logHandler;
DeviceClaim deviceClaim;
void setup() {
deviceClaim.withEepromAddr(1990);
deviceClaim.setup();
}
void loop() {
deviceClaim.loop();
}


ManoPad
organizer
File
ctrl + n
New
ctrl + o
Open...
ctrl + s
Save as...
ctrl + r
Rename
Make a copy
Move to folder
Move to trash
Download As...
Publish To Web
Google Docs
Google Drive
Dropbox
Adobe Creative Cloud
Private FTP
Another Service...
E-mail Collaborators
H1
H2
P
Action items


--- layout: post title: Riot-E film date: 2004-09-03 00:00:00 category: mobile ---
Wow - I've just seen a #mobitopia post concerning a film being made about Riot-E. I remember these guys well, we met them when we first set up Future Platforms and they were scouting around for game developer partners. At the time they were very focused on SMS content, but from what I remember they spent oodles of cash on licensing huge film properties (e.g. Bridget Jones) then doing very little of any real worth with the licenses. I was quite fond of the broken English which they used to describe themselves - their slogan was something like "we don't write games. we create riots"...
I'd love to see the film - just hope it gets a UK release. Wonder if we'll see any familiar faces amidst the debauchery?


2 Samuel 17:1
Moreover Ahithophel said unto Absalom, Let me now choose out twelve thousand men, and I will arise and pursue after David this night:


The Employee Assignment Table: DSN8810.EMPPROJACT
DSN8810.EMPPROJACT details which employee performs which activity for each project. It effectively records the assignment of employees to a given activity for a given project. To accomplish this assignment, the table stores an employee number, a project number, and an activity number on every row, along with information about this employee's assignment. This additional information consists of the percentage of time the employee should spend on this activity, the date the activity starts, and the date the activity ends. No primary key is implemented, but a unique index is used on the combination of PROJNO, ACTNO, EMSTDATE, and EMPNO.
The table is a child of both DSN8810.PROJACT and DSN8810.EMP. Two indexes exist for this table: DSN8810.XEMPPROJACT1 is a unique index on PROJNO, ACTNO, EMSTDATE, and EMPNO; and DSN8810.XEMPPROJACT2 is an index on EMPNO.
DSN8810.EMPPROJACT Table DDL
CREATE TABLE DSN8810.EMPPROJACT
(EMPNO CHAR(6) NOT NULL,
PROJNO CHAR(6) NOT NULL,
ACTNO SMALLINT NOT NULL,
EMPTIME DECIMAL(5,2),
EMSTDATE DATE,
EMENDATE DATE,
FOREIGN KEY REPAPA (PROJNO, ACTNO, EMSTDATE)
REFERENCES DSN8810.PROJACT ON DELETE RESTRICT,
FOREIGN KEY REPAE (EMPNO)
REFERENCES DSN8810.EMP ON DELETE RESTRICT
)
IN DSN8D81A.DSN8S81P
CCSID EBCDIC;
|


---
layout: default
title: Using MongoDB
permalink: /using-mongodb/
redirect_from:
- /using_mongodb.html
sitemap:
priority: 0.7
lastmod: 2015-02-24T00:00:00-00:00
---
Using MongoDB
MongoDB is one of the supported databases that can be selected when your application is being generated.
When MongoDB is selected:
- Spring Data MongoDB will be used to access the database. This is very close to Spring Data JPA, and this is why MongoDB support is very close to the (default) JPA support
- Mongeez is used instead of Liquibase to manage database changes
- The entity sub-generator will not ask you for entity relationships, as you can't have relationships with a NoSQL database (at least not in the way you have relationships with JPA)
- de.flapdoodle.embed.mongo is used to run an in-memory version of the database for running unit tests.


dengue model climate Caribbean risk []. outbreak incidence rainfall Barbados time drought data using Health months year Tmin Fig SPI- observed baseline outbreaks relative cases Climate threshold final (i.e., effects forecast rate water {border-style -month June health information random disease exceeding moving px;} rates #ffffff;} Precipitation SPI conditions including monthly transmission used Dengue SPI-, additional models prediction temperature Standardised [], lead mean month period predictive Click Institute LINK early file. forecasts minimum predicted study wet (see included lags nonlinear population predictions probability studies virus warning Available Zika [Internet]. [cited chikungunya events from: increase lag meteorological (e.g., However, Public ROC average calculated effect exposure–lag–response false increasing model. modelling mosquito out-of-sample probabilistic rainfall, review temperature. Environ Meteorology Model RLR Table Tmin, Tropical associated based cycle functions linear model, new predict seasonal trigger values Barbados, Niño Trop alarm associations better curve distribution dry extreme habitat larval periods produce season totals variation yearly (.–.) (TIF) Annual DIC, Drought International United delayed different estimated excluding framework high impact increased individual month, original posterior precipitation public px; seasonality variables {font-family (a) (b) Bayesian CIMH Feb Index.  Centre Department Fig). Hyg. Index; Int Ministry Sciences States area availability containers contribute correct deviance double; draftWriting excess f.w(xt, interventions maximum months. normal parameter percentile positive potential prior quantify recent region results shown shows stations (Fig (SPI- (th Adams Aedes Grantley Hydrology Information Medicine, Meteorological Observed Posterior Regional School September Therefore, Virus able account aegypti alarms analysis annual arboviral arbovirus available averaged border-color border-width burden change development distributed distributions dynamics emergence estimate exceptionally experienced explained febrile issued key likelihood logarithmic models. peak provide rates. ratio result scales seasons simulated solid; terms transmitted use value variability variable versus weather {font-style {font-weight βt'(t) (SPI-), Biology CIMH, CV, Caribbean, Caribbean. Clim. Disease Ecology Environmental Flaviviruses: GAIA Global Health-Climatic Health. Hygiene July Kingdom[], Life London London, LoweR, Medical North October October. Pacific Population Prior Res. Research SPI, September, Small St. Water World Zika. [,]. allows anomalies approach basis binary bold changes chikungunya, climatic coincided combination confirmed control correctly corresponding courier; criterion; cross-validated; day dengue, depletion described develop did drought. elevation em; end epidemic especially estimates exposure–response formulated gradient greater hierarchical hit human hypothesise illness impacts indicate infections influences intensity known large local longer lower major mean, measures monitor national negative occur operating optimum outbreak. outbreaks. parameters point population) potentially practice, predictor pt;} range records reported response scale scales. score, selection series serotypes significantly standard station statistic statistics successfully support surveillance temporal test thresholds. urban valid) wetter –May


The Daily Drumpf
Dear Donald Trump,
@realDonaldTrump A president who only cares about gun violence when it can be connected to religious terrorism doesn't truly care about gun violence.
Send!


Privacy policy of Message Filter
Message Filter developers think your privacy is important and important, so we release this privacy statement to protect your privacy.This privacy statement is designed to tell you what information we have collected and how we can use it to continuously optimize your experience.
1. Personal information collection and use.
Message Filter does not collect personal information does not identify you or others' personal information, such as your name and family name, email address, physical address, phone number, fax, information is stored in your device.
When you visit, download, or upgrade our applications, we do not collect or use your personal information.But when you communicate with us or give us, we can collect your information.If you send an error report or join an online service.
2. Collection and use of non-personal information.
When you use our application, we can collect your non-personal information.Non-personal information data form, are not allowed to directly with any specific individuals, including your device information, mobile phone models, log, operating system, Android ID, CPN model, memory size, your mobile phone's IMEI number, ROM, installed the application name and the package name, application of md5 value, location, installation and unloading, use frequency, etc.
Message Filter will not sell or trade your information to a third party.
We can collect your non-personal information, such as installed application name and package name, installation data, usage frequency, country, device, and channel.We can collect and use non-personal information, but for the following purposes:
A. improve user experience -- we want to understand user behavior.
B. To help develop our services - to solve problems in products and services.
C. We can use your information for promotion and marketing.
4. Security
Message Filter is very concerned about protecting the confidentiality of your information.In order to ensure your personal information security, we communicate our privacy and safety standards to all employees and strictly enforce the privacy protection measures within the company.
5. Change
At the same time, we reserve the right to update our privacy policy at any time.We will publish any changes in privacy policy on this page, so please review regularly.If you do not agree to any changes to this policy, you can stop the use of all services.
6. Contact us
If you have any questions or comments about security privacy policy, please contact us: doancongphuna@gmail.com


Provides advanced statistical methods to describe and predict customers' purchase behavior in a non-contractual setting. It uses historic transaction records to fit a probabilistic model, which then allows to compute quantities of managerial interest on a cohort- as well as on a customer level (Customer Lifetime Value, Customer Equity, P(alive), etc.). This package complements the BTYD package by providing several additional buy-till-you-die models, that have been published in the marketing literature, but whose implementation are complex and non-trivial. These models are: NBD, MBG/NBD, BG/CNBD-k, MBG/CNBD-k, Pareto/NBD (HB), Pareto/NBD (Abe) and Pareto/GGG.
| Version: | 1.0.1 |
| Depends: | R (≥ 3.2.0) |
| Imports: | Rcpp, BTYD (≥ 2.3), coda, data.table, mvtnorm, bayesm, stats, graphics |
| LinkingTo: | Rcpp |
| Suggests: | testthat, gsl, covr, knitr, rmarkdown, lintr (≥ 1.0.0) |
| Published: | 2016-12-14 |
| Author: | Michael Platzer [aut, cre] |
| Maintainer: | Michael Platzer <michael.platzer at gmail.com> |
| BugReports: | https://github.com/mplatzer/BTYDplus/issues |
| License: | GPL-3 |
| URL: | https://github.com/mplatzer/BTYDplus#readme |
| NeedsCompilation: | yes |
| Materials: | README NEWS |
| CRAN checks: | BTYDplus results |
| Reference manual: | BTYDplus.pdf |
| Vignettes: |
Customer Base Analysis with BTYDplus |
| Package source: | BTYDplus_1.0.1.tar.gz |
| Windows binaries: | r-devel: BTYDplus_1.0.1.zip, r-release: BTYDplus_1.0.1.zip, r-oldrel: BTYDplus_1.0.1.zip |
| OS X binaries: | r-release: BTYDplus_1.0.1.tgz, r-oldrel: BTYDplus_1.0.1.tgz |
Please use the canonical form https://CRAN.R-project.org/package=BTYDplus to link to this page.


WITNESS LIST General Investigating Committee April 25, 2000-9:00A Interim Charges On: Arnold, Morris A. (Texas Department of Public Safety) Josselet, Ron (State Office of Risk Management) Lucchese, Sam (General Services Commission)


New Special Edition Wireless Controllers
Jump ahead with Xbox One. Experience the greatest games lineup in Xbox history this year with exclusives like Halo 5: Guardians, Forza Motorsport 6, and Quantum Break. Play with friends on Xbox Live and enjoy your digital and disc-based Xbox 360 games.
Build imaginative, awe-inspiring worlds with your friends. Compete in heart-pounding matches that require quick thinking and fast reflexes. Whether it’s competitive or cooperative gameplay on your console, Xbox Live Gold takes your game to the next level. Alone you are mighty. With others, you’re Gold.
This Xbox One game is discounted with an Xbox Live Gold subscription.
Learn more >Decommissioned during the Cold War, a dormant weapons research base has been breached, unleashing a mysterious affliction into the Siberian wilderness that transforms men into blood-thirsty, mindless killers.
Learn more >After an exploding alien machine grants her amazing super powers, Carol Danvers became the interstellar Super Hero known as Captain Marvel! Now, when arch-enemies reappear in her life, it’s up to Captain Marvel to save the city of New York!
Learn more >Get instant, unlimited access to all of HBO, no TV package required, with HBO NOW. Stream every season, every episode of HBO’s unforgettable original series.
Learn more >Gaming just got better with Windows 10. Stay connected to your Xbox live community, start party chats, launch into cross-device multiplayer and stream Xbox One games to any Windows 10 PC in your home.*
Up your game with these limited edition Xbox One controllers such as the Elite controller or the Master Chief wireless controller.
With these official Xbox One accessories you can get the most out of your Xbox games.
We've got new sales and specials every week on Xbox Live. From full game downloads to popular add-ons and Arcade games.
*Games and media content sold separately. Limited number of games available in 2015 support cross-device play; additional games to follow. Stream to one device at a time; streaming with multiplayer from Xbox One requires home network connection and Xbox Live Gold www.windows.com/windows10specs. Some features including party chats, cross-device multiplayer and sharing game clips and screenshots only available on Windows 10 PC devices.


|
My Project
|
A colour class, a wrapper around four bytes. More...
#include <colour.hpp>
Public Member Functions | |
| operator glm::vec4 () const noexcept | |
| operator glm::vec3 () const noexcept | |
| constexpr | colour (const std::byte r, const std::byte g, const std::byte b, const std::byte a=static_cast< std::byte >(255)) noexcept |
| constexpr | colour (const int r, const int g, const int b, const int a=255) noexcept |
| constexpr | colour (const float r, const float g, const float b, const float a=1.0f) noexcept |
| constexpr | colour () noexcept |
| constexpr | colour (const glm::vec3 &colour) noexcept |
| constexpr | colour (const glm::vec4 &colour) noexcept |
| constexpr float | operator[] (const size_t pos) const noexcept |
| constexpr void | set_r (const int val) noexcept |
| constexpr void | set_r (const float val) noexcept |
| constexpr void | set_g (const int val) noexcept |
| constexpr void | set_g (const float val) noexcept |
| constexpr void | set_b (const int val) noexcept |
| constexpr void | set_b (const float val) noexcept |
| constexpr void | set_a (const int val) noexcept |
| constexpr void | set_a (const float val) noexcept |
| constexpr float | r () const noexcept |
| constexpr float | g () const noexcept |
| constexpr float | b () const noexcept |
| constexpr float | a () const noexcept |
Static Public Member Functions | |
| static constexpr colour | alice_blue () noexcept |
| static constexpr colour | antique_white () noexcept |
| static constexpr colour | aqua () noexcept |
| static constexpr colour | aquamarine () noexcept |
| static constexpr colour | azure () noexcept |
| static constexpr colour | beige () noexcept |
| static constexpr colour | bisque () noexcept |
| static constexpr colour | black () noexcept |
| static constexpr colour | blanched_almond () noexcept |
| static constexpr colour | blue () noexcept |
| static constexpr colour | blue_violet () noexcept |
| static constexpr colour | brown () noexcept |
| static constexpr colour | burly_wood () noexcept |
| static constexpr colour | burnt_sienna () noexcept |
| static constexpr colour | cadet_blue () noexcept |
| static constexpr colour | chartreuse () noexcept |
| static constexpr colour | chocolate () noexcept |
| static constexpr colour | coral () noexcept |
| static constexpr colour | cornflower_blue () noexcept |
| static constexpr colour | cornsilk () noexcept |
| static constexpr colour | crimson () noexcept |
| static constexpr colour | cyan () noexcept |
| static constexpr colour | dark_blue () noexcept |
| static constexpr colour | dark_cyan () noexcept |
| static constexpr colour | dark_goldenrod () noexcept |
| static constexpr colour | dark_gray () noexcept |
| static constexpr colour | nero () noexcept |
| static constexpr colour | night_rider () noexcept |
| static constexpr colour | charcoal () noexcept |
| static constexpr colour | studio () noexcept |
| static constexpr colour | dark_grey () noexcept |
| static constexpr colour | dark_green () noexcept |
| static constexpr colour | dark_khaki () noexcept |
| static constexpr colour | dark_magenta () noexcept |
| static constexpr colour | dark_olive_green () noexcept |
| static constexpr colour | dark_orange () noexcept |
| static constexpr colour | dark_orchid () noexcept |
| static constexpr colour | dark_red () noexcept |
| static constexpr colour | dark_salmon () noexcept |
| static constexpr colour | dark_sea_green () noexcept |
| static constexpr colour | dark_slate_blue () noexcept |
| static constexpr colour | dark_slate_gray () noexcept |
| static constexpr colour | dark_turquoise () noexcept |
| static constexpr colour | dark_violet () noexcept |
| static constexpr colour | deep_pink () noexcept |
| static constexpr colour | deep_sky_blue () noexcept |
| static constexpr colour | dim_gray () noexcept |
| static constexpr colour | dim_grey () noexcept |
| static constexpr colour | dodger_blue () noexcept |
| static constexpr colour | firebrick () noexcept |
| static constexpr colour | floral_white () noexcept |
| static constexpr colour | forest_green () noexcept |
| static constexpr colour | fuchsia () noexcept |
| static constexpr colour | gainsboro () noexcept |
| static constexpr colour | ghost_white () noexcept |
| static constexpr colour | gold () noexcept |
| static constexpr colour | goldenrod () noexcept |
| static constexpr colour | gray () noexcept |
| static constexpr colour | green () noexcept |
| static constexpr colour | green_yellow () noexcept |
| static constexpr colour | grey () noexcept |
| static constexpr colour | honeydew () noexcept |
| static constexpr colour | hot_pink () noexcept |
| static constexpr colour | indian_red () noexcept |
| static constexpr colour | indigo () noexcept |
| static constexpr colour | ivory () noexcept |
| static constexpr colour | khaki () noexcept |
| static constexpr colour | lavender () noexcept |
| static constexpr colour | lavender_blush () noexcept |
| static constexpr colour | lawn_green () noexcept |
| static constexpr colour | lemon_chiffon () noexcept |
| static constexpr colour | light_blue () noexcept |
| static constexpr colour | light_coral () noexcept |
| static constexpr colour | light_cyan () noexcept |
| static constexpr colour | light_goldenrod_yellow () noexcept |
| static constexpr colour | light_gray () noexcept |
| static constexpr colour | light_green () noexcept |
| static constexpr colour | light_grey () noexcept |
| static constexpr colour | light_pink () noexcept |
| static constexpr colour | light_salmon () noexcept |
| static constexpr colour | light_sea_green () noexcept |
| static constexpr colour | light_sky_blue () noexcept |
| static constexpr colour | light_slate_gray () noexcept |
| static constexpr colour | light_slate_grey () noexcept |
| static constexpr colour | light_steel_blue () noexcept |
| static constexpr colour | light_yellow () noexcept |
| static constexpr colour | lime () noexcept |
| static constexpr colour | lime_green () noexcept |
| static constexpr colour | linen () noexcept |
| static constexpr colour | magenta () noexcept |
| static constexpr colour | maroon () noexcept |
| static constexpr colour | medium_aquamarine () noexcept |
| static constexpr colour | medium_blue () noexcept |
| static constexpr colour | medium_orchid () noexcept |
| static constexpr colour | medium_purple () noexcept |
| static constexpr colour | medium_sea_green () noexcept |
| static constexpr colour | medium_slate_blue () noexcept |
| static constexpr colour | medium_spring_green () noexcept |
| static constexpr colour | medium_turquoise () noexcept |
| static constexpr colour | medium_violet_red () noexcept |
| static constexpr colour | midnight_blue () noexcept |
| static constexpr colour | mint_cream () noexcept |
| static constexpr colour | misty_rose () noexcept |
| static constexpr colour | moccasin () noexcept |
| static constexpr colour | navajo_white () noexcept |
| static constexpr colour | navy () noexcept |
| static constexpr colour | old_lace () noexcept |
| static constexpr colour | olive () noexcept |
| static constexpr colour | olive_drab () noexcept |
| static constexpr colour | orange () noexcept |
| static constexpr colour | orange_red () noexcept |
| static constexpr colour | orchid () noexcept |
| static constexpr colour | pale_goldenrod () noexcept |
| static constexpr colour | pale_green () noexcept |
| static constexpr colour | pale_turquoise () noexcept |
| static constexpr colour | pale_violet_red () noexcept |
| static constexpr colour | papaya_whip () noexcept |
| static constexpr colour | peach_puff () noexcept |
| static constexpr colour | peru () noexcept |
| static constexpr colour | pink () noexcept |
| static constexpr colour | plum () noexcept |
| static constexpr colour | powder_blue () noexcept |
| static constexpr colour | purple () noexcept |
| static constexpr colour | red () noexcept |
| static constexpr colour | rosy_brown () noexcept |
| static constexpr colour | royal_blue () noexcept |
| static constexpr colour | saddle_brown () noexcept |
| static constexpr colour | salmon () noexcept |
| static constexpr colour | sandy_brown () noexcept |
| static constexpr colour | sea_green () noexcept |
| static constexpr colour | sea_shell () noexcept |
| static constexpr colour | sienna () noexcept |
| static constexpr colour | silver () noexcept |
| static constexpr colour | sky_blue () noexcept |
| static constexpr colour | slate_blue () noexcept |
| static constexpr colour | slate_gray () noexcept |
| static constexpr colour | slate_grey () noexcept |
| static constexpr colour | snow () noexcept |
| static constexpr colour | spring_green () noexcept |
| static constexpr colour | steel_blue () noexcept |
| static constexpr colour | tan () noexcept |
| static constexpr colour | teal () noexcept |
| static constexpr colour | thistle () noexcept |
| static constexpr colour | tomato () noexcept |
| static constexpr colour | transparent_black () noexcept |
| static constexpr colour | turquoise () noexcept |
| static constexpr colour | violet () noexcept |
| static constexpr colour | wheat () noexcept |
| static constexpr colour | white () noexcept |
| static constexpr colour | white_smoke () noexcept |
| static constexpr colour | yellow () noexcept |
| static constexpr colour | yellow_green () noexcept |
A colour class, a wrapper around four bytes.
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinenoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinenoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinenoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |


PHP Developer - Barcode Giant
Programmer/Analyst II - University of Chicago
Indiana University, Bachelor
PHP Developer - Barcode Giant
Programmer/Analyst II - University of Chicago
Indiana University, Bachelor
PHP Developer - Barcode Giant
Programmer/Analyst II - University of Chicago
Indiana University, Bachelor
PHP Developer - Barcode Giant
Programmer/Analyst II - University of Chicago
Indiana University, Bachelor
PHP Developer - Barcode Giant
Programmer/Analyst II - University of Chicago
Indiana University, Bachelor
Sort by:
Relevance - Date


State Layers
Data values are based on standardized z-scores.
County Layers
Data values are based on standardized z-scores.


Ground Truth Obstacles
This guide is for Simulator Release 2019.05. To visualize ground truth sensor data in version 2019.07, please activate the ground truth sensors according to the example sensor configuration file.
Overview#
You can use the LGSVL Simulator to view, subscribe to, and compare ground truth obstacle information. The simulator allows visualization of 2D or 3D bounding boxes of vehicles, pedestrians, and unknown objects, and publishes detailed information (currently in a custom ROS message format) about the ground truth obstacles.
View ground truth obstacles in Simulator#
Ground truth obstacles for traffic can be viewed in the simulator with both 3D bounding boxes as well as 2D bounding boxes in the camera.
To view 3D Bounding boxes in the simulator:
- Start the simulator in the San Francisco map and desired vehicle
- Check "Sensor Effects"
- Check "Enable Traffic"
- Check "Enable Ground Truth 3D"
You should see 3D boxes in green highlighting NPC vehicles in the simulator main view.
To view 2D bounding boxes:
- Start the simulator in the San Francisco map with desired vehicle
- Check "Ground Truth 2D"
You should see 2D boxes highlighting NPC vehicles in the "Ground Truth 2D Camera" camera view.
Bounding box colors#
- Green: Vehicles
- Yellow: Pedestrians
- Purple: Unknown
Subscribe to ground truth ROS messages#
LGSVL Simulator also publishes custom ROS messages describing the ground truth data of non-ego vehicles.
In order to subscribe to the ground truth messages, you will need the ROS package lgsvl_msgs. It contains custom ROS message types for 2D and 3D bounding boxes. You will also need to be running rosbridge.
Install the lgsvl_msgs ROS package#
Use LGSVL Apollo or Autoware repository#
If you are using LGSVL's forks of Apollo or Autoware, the package is already included as a submodule in the respective workspace:
- LGSVL Autoware:
autoware -> ros -> src -> msgs -> lgsvl_msgs
- LGSVL Apollo:
apollo -> ros_pkgs -> src -> lgsvl_msgs
Following the instructions to build the ROS workspace will build the lgsvl_msgs
package as well.
If you are not running LGSVL's Apollo or Autoware forks, you can directly clone our lgsvl_msgs
package into your ROS workspace and build.
Manually install lgsvl_msgs#
- Clone
lgsvl_msgs
to your ROS workspace ormsgs
directory:
$ git clone https://github.com/lgsvl/lgsvl_msgs {MY_ROS_WS}
- Build the ROS workspace:
$ catkin_make
Subscribe to ground truth messages from Simulator#
You can subscribe to ground truth messages published as ROS messages (when 2D/3D ground truth are enabled)
- Topic: /simulator/ground_truth/2d_detections
-
Message type: lgsvl_msgs/Detection2DArray: Link
-
Topic: /simulator/ground_truth/3d_detections
- Message type: lgsvl_msgs/Detection3DArray: Link
View estimated detections in Simulator#
If you are running Autoware with LGSVL Simulator, you can also visualize Autoware object detection outputs in the simulator for both Lidar-based and Camera-based detections. Make sure that Autoware perception module is running and detection output topics have output messages.
(You can also publish to the below topics even if you are not using Autoware)
Required ROS topics: - For Lidar detections: /detection/lidar_objects - For Camera detections: /detection/vision_objects
To view Lidar detections:
- Start the simulator in the San Francisco map with XE_Rigged-autoware vehicle
- Check "Sensor Effects"
- Check "Enable LIDAR"
- Check "Enable Lidar Prediction"
You should see 3D bounding boxes highlighting Autoware Lidar detections in the simulator main view.
To view Camera detections:
- Start the simulator in the San Francisco map with XE_Rigged-autoware vehicle
- Check "Toggle Main Camera"
- Check "Enable Camera Prediction"
You should see 2D bounding boxes highlighting Autoware Camera detections in the simulator main camera view.


Move the cursor to the target top text string.
Press 7 to define upper string.
Move the cursor to the target bottom text string.
Press 7 to define lower string.
Press 7 twice on the line if the text string is only one line.
Size of the box is set using Annotate 0 - Gap.


About
Authored By: Andy Marmolejos
My name is Andy Marmolejos. I'm majoring in Computer Engineering and minoring in Web and App Development.
My objectives for this course are to learn HTML/CSS. To be able to perform not just basics coding, but complex coding that allows me to design a better looking website. Probably with animations, better colors and design to get the attention of anyone. Currently we are working on learning Bootstrap. Although, it makes it easier for anyone to build a website you still have to understand much more than that to be able to show your uniqueness when it comes to designing. SASS is similar to CSS, but better in some ways and that will allow us to design those better website. Also, not forgetting about JavaScript which can do most of the animations that we see in modern websites today.
Computer Engineer and Web Development


--- layout: post permalink: herpaflor.html Tags: Array NameOfCoupon: Herpaflor Cash Back Summary: See our Herpaflor Coupon Code, Herpaflor Rebate, Herpaflor Promo Code, Herpaflor Discount, Herpaflor Coupon Cash Back Rebate here. MetaKeywords: Herpaflor Coupon Code, Herpaflor Rebate, Herpaflor Promo Code, Herpaflor Cash Back Rebate, Herpaflor Discount, Herpaflor Coupon Image: images/19619.gif LinkURL: http://www.shareasale.com/r.cfm?b=147271&u=412002&m=19619 affiliate_url_link: http://www.icouponblog.com/jane.php?id=250 thesis_readmore: See the Herpaflor Coupon thesis_thumb: http://www.icouponblog.com/tn.php?merchantURL=herpaflor.com Title: Save 17.5% - Herpaflor Coupon Code for herpaflor.com. Herpaflor Rebate & Discount thesis_description: Our Herpaflor Discount Coupon Code for herpaflor.com. We have the best Herpaflor Rebate anywhere. thesis_keywords: Herpaflor, Herpaflor Coupon Code, Herpaflor Discount, Herpaflor Rebate product_name: Herpaflor hop_url: http://www.icouponblog.com/hop.php?id=250 ---
Herpaflor has a combination of 17 of the most researched and proven herpes killers in a single formula. Herpaflor has a treatment success rate of 97.2% which speaks for the effectiveness of the product. No two human beings have the same immune system, which is why no single active ingredient works for everybody. Herpaflor is the only product that attacks cold sores, herpes in three ways. Get Herpaflor for fast effective treatment of cold sores or genital herpes. Use our discount coupon to get a healthy discount on Herpaflor./br>
Say goodbye to those ugly, painful cold sores with Herpaflor. Get the best product in the market, for genital herpes and cold sores. It works even better than prescription medicine. Herpaflor has 17 ingredients that work in 3 different ways to attack the virus that gives you cold sores or genital herpes. Use our discount coupon to get Herpaflor at a great price.


- Lisbon
21°C
- Paris
11°C
- Belgrade
15°C
- Moscow
21°C
- Tel Aviv
32°C
- Cair
21°C
- New York
17°C
- New Delhi
17°C
- San Francisco
15°C
- Tokyo
8°C
- Sydney
25°C
21°C
11°C
15°C
21°C
32°C
21°C
17°C
17°C
15°C
8°C
25°C
Have a nice day and don't forget umbrella if you are in New Delhi now!


module Jekyll::External
Public Class Methods
blessed_gems()
click to toggle source
Gems that, if installed, should be loaded. Usually contain subcommands.
# File lib/jekyll/external.rb, line 8 def blessed_gems %w( jekyll-docs jekyll-import ) end
require_if_present(names) { |name| ... }
click to toggle source
Require a gem or file if it's present, otherwise silently fail.
names - a string gem name or array of gem names
# File lib/jekyll/external.rb, line 20 def require_if_present(names) Array(names).each do |name| begin require name rescue LoadError Jekyll.logger.debug "Couldn't load #{name}. Skipping." yield(name) if block_given? false end end end
require_with_graceful_fail(names)
click to toggle source
Require a gem or gems. If it's not present, show a very nice error message that explains everything and is much more helpful than the normal LoadError.
names - a string gem name or array of gem names
# File lib/jekyll/external.rb, line 39 def require_with_graceful_fail(names) Array(names).each do |name| begin Jekyll.logger.debug "Requiring:", name.to_s require name rescue LoadError => e Jekyll.logger.error "Dependency Error:", <<-MSG Yikes! It looks like you don't have #{name} or one of its dependencies installed. In order to use Jekyll as currently configured, you'll need to install this gem. The full error message from Ruby is: '#{e.message}' If you run into trouble, you can find helpful resources at http://jekyllrb.com/help/! MSG raise Jekyll::Errors::MissingDependencyException, name end end end


CompositeTwig(twigBundle: MutableList<Twig>)
Since there can only ever be one trunk on the bush of twigs, this class lets you cheat and make that trunk be a bundle of twigs.


VERBAL TEST PAPER 1
Directions for questions 1 to 4 : Each questions has a set of four statements. Each consists of 3 segments. Choose the best alternative where the third segment in the statement can be logically deduced from the preceding two segments.
1. A. Internet is for nerds. Shyam is a nerd. Internet is for
Shyam.
B. Intelligence is for wise men. Some people are wise.
Intelligence is for people.
C. Capital punishment is for killers. Ravan is a killer. Capital
punishment is for Ravan.
D. Liquor is for drinking. Juice is for drinking. Some liquor is juice.
A
only D
only
A&C
A&B
2. A. No R is P ; All Y is R; No Y is P.
B. No R is P ;All Y is R; All Y is P
C. Some R is not P; Some Y is R ; Some Y is not P.
D. Some R is not P; All Y is R ; All Y is not P.
C only A&B A only D only
3. A. Some oranges are sour. This fruit is an orange. This fruit is sour.
B. Sheela is a nurse. All nurses are healthy women. Radha is a
healthy woman.
C. Army officers are tall. Airforce officers are tall. Military
officers are tall.
D. No animal likes fire. Elephants are animals. Elephants do not
like fire.
B
only D
only C
only
A& D
4. A.
B. Some films are books; Some books are good; Some films are
good.
C. Some fruits are sweet; Some mangoes are sweet; Some fruits are
mangoes.
D.Some mothers have babies; Some babies are boys; Some mothers
have boys.
B
only
A&C D
only
None.
Directions for questions 5 to 9: In each of the following questions a phrase is underlined. There are four different ways of phrasing the underlined part. Choose the best alternative.
5. I think Rahul had something vital to say, however he was unable to explain his viewpoint to a skeptical audience.
He did not change the minds of a conversant public.
The people were willing to accept his views.
He failed to convince a suspicious
congregation
He could not convince the doubting audience.
6. In the twentieth century mental elite assumed that economic and cultural modernization was leading to the decay of religion as a determinant in human existence.
Total decay of religion as a determinant.
Withering away of religion as a significant
element.
Humanization of religion.
Debasement of religion.
7. British Aerospace had been focusing on building European links.
Stressing on building European links.
Focusing on forging European links.
Pursuing ways of building European
connectivity.
Concentrating on creating European links.
8.Impromptu recognition from supervisors and managers to employees is the most effective and inexpensive method available for sustaining personal interest and individual effort for continued quality progress.
Immediate appreciation from supervisors and managers in management.
Unobstructed showing of praises from
supervisors and managers.
Impromptu recognition from supervisors and
managers.
Free recognition from immediate
superiors.
9. Bureaucrats may also be well advised to deal with Service Headquarters as representatives of the government and not behave as their bosses.
May also be well advised.
Should know their limits when they have.
May have to remember.
May need to learn how.
Directions for questions 10 to 19: Each of the questions has part/parts left blank. There are 4 different ways of completing the sentence. Choose the best alternative.
10. To pursue their decision to resist what they saw as anti- labor acts, the employees' union launched an agitation to ___________
affirm their responsibility to the country.
prove their strength.
bring down the central government.
exhibit their virility.
11. The best general characterization of the European philosophical tradition as it has developed upto now, with all its variety, is that it consists of a ________ Plato.
series of footnotes to
set of prologues to
series of chapters on
string of commentaries on
12. The ideas that these companies used seem so clear with _________ that their rivals will now _______ themselves for not thinking of them first.
technology, hit
new ideas, disparage
the passage of time, curse
hindsight, kick
13. In our country, the challenges are to raise _______ incomes to reduce poverty, and to _____ ailing enterprises.
farm, liberalize
middle-class,
privatize
workers',
suppress
rural,
restructure
14. Overall, the recent policy changes by the government only amount to a _________ in the sugar industry.
superficial attempt at liberalization
lack of solution
large change
small regulating authority
15. The world is moving into a period of ' civilisational clash' in which the primary identification of people will not be ________ as during the Cold War, but_______
religious, technological
cultural, ethnic
political, economic
ideological, cultural
16. The internet represents that awkward _______ in all communication systems; while it _______ to bring us together, it keeps us apart.
paradox, tries
irony, intends
paradox,needs
irony,wishes
17.  The dream of flying had _________ inventors since the ancient Greeks and Chinese, though most of those who attempted to create wings for themselves were considered ________
revived,strange
troubled, insomniacs
attracted, oddballs
repulsed, demi-gods
19. Unable to contain their _______ and amazement at the end of the performance, the audience burst into _______, and showed no signs of stopping.
excitement, cheers
frustration, song
envy, flames
delight, tears
Directions for questions 20 to 30 : In each of the following sentences, four words or phrases are underlined. You should choose the one word or phrase which would be not appropriate in standard written English. Mark(5) if you think that the sentence has no error.
20. Thirty liters of
fuel do not seem to be sufficient for the distance to be covered.
Thirty
liters
do
seem
for
none
of the above
21. The hardest part of
the job is the bending once a minute and then lifting the weight.
hardest
job
is the
bending
lifting
the
none of the
above
22. The minute they came
to know that their chief was issued a charge sheet, the entire group of workers
went on a boycott.
minute
came to
know
issued a
charge
went on a
boycott
none of the
above
23. Since I had forgotten all
my mathematical concepts I had to start from the scratch.
I had
all my
I had
the scratch
none of the
above
24. Modi has recently been
selected the representative to the SriLanka.
been
selected
the
the SriLanka
none of the
above
25. Having laid the
magazine on the desk, she went out the door.
laid
on
went out
the
none of the
above
26. She nearly blushed until
she was pink.
nearly
until
was
pink
none of the
above
27. Our writing, like our speech, is the sign of our ability
to communicate.
like
speech
is
sign
none of the
above
28. When you have completed the last topic of the book, please return
it to the bookroom.
have
completed
the
it
none of the
above
29. His report, including thorough
notes on the background investigation, were well received.
including
thorough
notes
the background
were
none of the
above
30. This is one of the
four primary libraries that are supported by our organization.
this is
one of the
libraries
that are
none of the
above
|
Explanation to Paper I |
|
2] A only Hence [3] 3] D only Hence [2] 4] D only Hence [3] 5] He could not convince the doubting audience. Hence [4] 6] Withering away of religion as a significant element. Hence [2] 7] Concentrating on creating European links. Hence [4] 8] Spontaneous recognition from supervisors and managers.Hence [3] 9] May also be well advised. Hence [1] 10] Demonstrate their strength. Hence [2] 11] String of commentaries on .Hence [4] 12] The passage of time, curse. Hence [3] 13] Rural, restructure Hence [4] 14] Superficial attempt at liberalisation. Hence [1] 15] Ideological, cultural. Hence [4] 16] Irony, intends Hence [2] 17] Inspiring,win Hence [4] 18] Fascinated, oddballs. Hence [3] 19] Excitement, applause. Hence [1] 20] 2,does not 21] 5 22] 4, drop ‘a’ 23] 4, drop ‘the’ 24] 3, drop ‘the’ 25] 5 26] 1, was nearly pink 27] 5 28] 4, the book 39] 4, was 30]5 |


who is passionate about building apps that improve people's well beings
I have always been fascinated by the way how tech shapes people's lives and behavior, and therefore decided to pursue my career as software engineer. Once I started, I never looked back and am actually addicted to programming now. I am most interested in tech that can help improve people's well being, both mentally and physically.
foodie me is a web app that encourages the real foodies who know and care about foods to write and share reliable reviews on restaurants. Both members and non members can upvote or down vote the reviews. Members can also follow other members. Member who writes good amount of quality reviews will get the status of “Elite Foodie” and earn a crown. People can save time of searching for quality reviews on Yelp (which are rare) by reading the quality reviews from real foodies on foodie me. Technologies used: JavaScript, React, Redux, NodeJS, ExpressJS, PostgreSQL, JWT
EmoCoach is an Android app that helps user to better manage emotions. User can record emotions of the day, and write notes about the reasons behind the emotions. The app will show user’s proportions of different emotions, and also the emotions trend in the past 30 days. Together with the notes, user will be able to do meaningful reflection on one’s emotions, and better understand oneself. With that awareness, user will be able to manage emotions better. Technologies used: Java, XML, SQLite
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Mollitia neque assumenda ipsam nihil, molestias magnam, recusandae quos quis inventore quisquam velit asperiores, vitae? Reprehenderit soluta, eos quod consequuntur itaque. Nam.
Close ProjectLorem ipsum dolor sit amet, consectetur adipisicing elit. Mollitia neque assumenda ipsam nihil, molestias magnam, recusandae quos quis inventore quisquam velit asperiores, vitae? Reprehenderit soluta, eos quod consequuntur itaque. Nam.
Close Project


PIG DICE
CLICK PIG FOR INSTRUCTIONS
Each player has their own turn and one cannot play if the other player is playing
You can either choose to roll the dice or hold. If you roll the dice and you land on 1 your score is zero
You can keep rolling the dice as long as you have not landed on 1
PLAYER 1
NAME:
SCORE:
CUMULATIVE SCORE:
TOTAL SCORE:
PLAYER 2
NAME:
SCORE:
CUMULATIVE SCORE:
TOTAL SCORE:


The LLVM Pass Framework is an important part of the LLVM system, because LLVM passes are where most of the interesting parts of the compiler exist. Passes perform the transformations and optimizations that make up the compiler, they build the analysis results that are used by these transformations, and they are, above all, a structuring technique for compiler code.
All LLVM passes are subclasses of the Pass class, which implement functionality by overriding virtual methods inherited from Pass. Depending on how your pass works, you should inherit from the ModulePass, CallGraphSCCPass, FunctionPass, or LoopPass, or RegionPass, or BasicBlockPass classes, which gives the system more information about what your pass does, and how it can be combined with other passes. One of the main features of the LLVM Pass Framework is that it schedules passes to run in an efficient way based on the constraints that your pass meets (which are indicated by which class they derive from).
We start by showing you how to construct a pass, everything from setting up the code, to compiling, loading, and executing it. After the basics are down, more advanced features are discussed.
Here we describe how to write the "hello world" of passes. The "Hello" pass is designed to simply print out the name of non-external functions that exist in the program being compiled. It does not modify the program at all, it just inspects it. The source code and files for this pass are available in the LLVM source tree in the lib/Transforms/Hello directory.
First, configure and build LLVM. This needs to be done directly inside the LLVM source tree rather than in a separate objects directory. Next, you need to create a new directory somewhere in the LLVM source base. For this example, we'll assume that you made lib/Transforms/Hello. Finally, you must set up a build script (Makefile) that will compile the source code for the new pass. To do this, copy the following into Makefile:
# Makefile for hello pass # Path to top level of LLVM hierarchy LEVEL = ../../.. # Name of the library to build LIBRARYNAME = Hello # Make the shared library become a loadable module so the tools can # dlopen/dlsym on the resulting library. LOADABLE_MODULE = 1 # Include the makefile implementation stuff include $(LEVEL)/Makefile.common
This makefile specifies that all of the .cpp files in the current directory are to be compiled and linked together into a shared object $(LEVEL)/Debug+Asserts/lib/Hello.so that can be dynamically loaded by the opt or bugpoint tools via their -load options. If your operating system uses a suffix other than .so (such as windows or Mac OS/X), the appropriate extension will be used.
If you are used CMake to build LLVM, see Developing an LLVM pass with CMake.
Now that we have the build scripts set up, we just need to write the code for the pass itself.
Now that we have a way to compile our new pass, we just have to write it. Start out with:
#include "llvm/Pass.h" #include "llvm/Function.h" #include "llvm/Support/raw_ostream.h"
Which are needed because we are writing a Pass, we are operating on Function's, and we will be doing some printing.
Next we have:
using namespace llvm;
... which is required because the functions from the include files live in the llvm namespace.
Next we have:
namespace {
... which starts out an anonymous namespace. Anonymous namespaces are to C++ what the "static" keyword is to C (at global scope). It makes the things declared inside of the anonymous namespace visible only to the current file. If you're not familiar with them, consult a decent C++ book for more information.
Next, we declare our pass itself:
struct Hello : public FunctionPass {
This declares a "Hello" class that is a subclass of FunctionPass. The different builtin pass subclasses are described in detail later, but for now, know that FunctionPass's operate on a function at a time.
static char ID; Hello() : FunctionPass(ID) {}
This declares pass identifier used by LLVM to identify pass. This allows LLVM to avoid using expensive C++ runtime information.
virtual bool runOnFunction(Function &F) { errs() << "Hello: "; errs().write_escaped(F.getName()) << "\n"; return false; } }; // end of struct Hello } // end of anonymous namespace
We declare a "runOnFunction" method, which overloads an abstract virtual method inherited from FunctionPass. This is where we are supposed to do our thing, so we just print out our message with the name of each function.
char Hello::ID = 0;
We initialize pass ID here. LLVM uses ID's address to identify a pass, so initialization value is not important.
static RegisterPass<Hello> X("hello", "Hello World Pass", false /* Only looks at CFG */, false /* Analysis Pass */);
Lastly, we register our class Hello, giving it a command line argument "hello", and a name "Hello World Pass". The last two arguments describe its behavior: if a pass walks CFG without modifying it then the third argument is set to true; if a pass is an analysis pass, for example dominator tree pass, then true is supplied as the fourth argument.
As a whole, the .cpp file looks like:
#include "llvm/Pass.h" #include "llvm/Function.h" #include "llvm/Support/raw_ostream.h" using namespace llvm; namespace { struct Hello : public FunctionPass { static char ID; Hello() : FunctionPass(ID) {} virtual bool runOnFunction(Function &F) { errs() << "Hello: "; errs().write_escaped(F.getName()) << '\n'; return false; } }; } char Hello::ID = 0; static RegisterPass<Hello> X("hello", "Hello World Pass", false, false);
Now that it's all together, compile the file with a simple "gmake" command in the local directory and you should get a new file "Debug+Asserts/lib/Hello.so" under the top level directory of the LLVM source tree (not in the local directory). Note that everything in this file is contained in an anonymous namespace — this reflects the fact that passes are self contained units that do not need external interfaces (although they can have them) to be useful.
Now that you have a brand new shiny shared object file, we can use the opt command to run an LLVM program through your pass. Because you registered your pass with RegisterPass, you will be able to use the opt tool to access it, once loaded.
To test it, follow the example at the end of the Getting Started Guide to compile "Hello World" to LLVM. We can now run the bitcode file (hello.bc) for the program through our transformation like this (or course, any bitcode file will work):
$ opt -load ../../../Debug+Asserts/lib/Hello.so -hello < hello.bc > /dev/null Hello: __main Hello: puts Hello: main
The '-load' option specifies that 'opt' should load your pass as a shared object, which makes '-hello' a valid command line argument (which is one reason you need to register your pass). Because the hello pass does not modify the program in any interesting way, we just throw away the result of opt (sending it to /dev/null).
To see what happened to the other string you registered, try running opt with the -help option:
$ opt -load ../../../Debug+Asserts/lib/Hello.so -help OVERVIEW: llvm .bc -> .bc modular optimizer USAGE: opt [options] <input bitcode> OPTIONS: Optimizations available: ... -funcresolve - Resolve Functions -gcse - Global Common Subexpression Elimination -globaldce - Dead Global Elimination -hello - Hello World Pass -indvars - Canonicalize Induction Variables -inline - Function Integration/Inlining -instcombine - Combine redundant instructions ...
The pass name get added as the information string for your pass, giving some documentation to users of opt. Now that you have a working pass, you would go ahead and make it do the cool transformations you want. Once you get it all working and tested, it may become useful to find out how fast your pass is. The PassManager provides a nice command line option (--time-passes) that allows you to get information about the execution time of your pass along with the other passes you queue up. For example:
$ opt -load ../../../Debug+Asserts/lib/Hello.so -hello -time-passes < hello.bc > /dev/null Hello: __main Hello: puts Hello: main =============================================================================== ... Pass execution timing report ... =============================================================================== Total Execution Time: 0.02 seconds (0.0479059 wall clock) ---User Time--- --System Time-- --User+System-- ---Wall Time--- --- Pass Name --- 0.0100 (100.0%) 0.0000 ( 0.0%) 0.0100 ( 50.0%) 0.0402 ( 84.0%) Bitcode Writer 0.0000 ( 0.0%) 0.0100 (100.0%) 0.0100 ( 50.0%) 0.0031 ( 6.4%) Dominator Set Construction 0.0000 ( 0.0%) 0.0000 ( 0.0%) 0.0000 ( 0.0%) 0.0013 ( 2.7%) Module Verifier 0.0000 ( 0.0%) 0.0000 ( 0.0%) 0.0000 ( 0.0%) 0.0033 ( 6.9%) Hello World Pass 0.0100 (100.0%) 0.0100 (100.0%) 0.0200 (100.0%) 0.0479 (100.0%) TOTAL
As you can see, our implementation above is pretty fast :). The additional passes listed are automatically inserted by the 'opt' tool to verify that the LLVM emitted by your pass is still valid and well formed LLVM, which hasn't been broken somehow.
Now that you have seen the basics of the mechanics behind passes, we can talk about some more details of how they work and how to use them.
One of the first things that you should do when designing a new pass is to decide what class you should subclass for your pass. The Hello World example uses the FunctionPass class for its implementation, but we did not discuss why or when this should occur. Here we talk about the classes available, from the most general to the most specific.
When choosing a superclass for your Pass, you should choose the most specific class possible, while still being able to meet the requirements listed. This gives the LLVM Pass Infrastructure information necessary to optimize how passes are run, so that the resultant compiler isn't unnecessarily slow.
The most plain and boring type of pass is the "ImmutablePass" class. This pass type is used for passes that do not have to be run, do not change state, and never need to be updated. This is not a normal type of transformation or analysis, but can provide information about the current compiler configuration.
Although this pass class is very infrequently used, it is important for providing information about the current target machine being compiled for, and other static information that can affect the various transformations.
ImmutablePasses never invalidate other transformations, are never invalidated, and are never "run".
The "ModulePass" class is the most general of all superclasses that you can use. Deriving from ModulePass indicates that your pass uses the entire program as a unit, referring to function bodies in no predictable order, or adding and removing functions. Because nothing is known about the behavior of ModulePass subclasses, no optimization can be done for their execution.
A module pass can use function level passes (e.g. dominators) using the getAnalysis interface getAnalysis<DominatorTree>(llvm::Function *) to provide the function to retrieve analysis result for, if the function pass does not require any module or immutable passes. Note that this can only be done for functions for which the analysis ran, e.g. in the case of dominators you should only ask for the DominatorTree for function definitions, not declarations.
To write a correct ModulePass subclass, derive from ModulePass and overload the runOnModule method with the following signature:
virtual bool runOnModule(Module &M) = 0;
The runOnModule method performs the interesting work of the pass. It should return true if the module was modified by the transformation and false otherwise.
The "CallGraphSCCPass" is used by passes that need to traverse the program bottom-up on the call graph (callees before callers). Deriving from CallGraphSCCPass provides some mechanics for building and traversing the CallGraph, but also allows the system to optimize execution of CallGraphSCCPass's. If your pass meets the requirements outlined below, and doesn't meet the requirements of a FunctionPass or BasicBlockPass, you should derive from CallGraphSCCPass.
TODO: explain briefly what SCC, Tarjan's algo, and B-U mean.
To be explicit, CallGraphSCCPass subclasses are:
Implementing a CallGraphSCCPass is slightly tricky in some cases because it has to handle SCCs with more than one node in it. All of the virtual methods described below should return true if they modified the program, or false if they didn't.
virtual bool doInitialization(CallGraph &CG);
The doIninitialize method is allowed to do most of the things that CallGraphSCCPass's are not allowed to do. They can add and remove functions, get pointers to functions, etc. The doInitialization method is designed to do simple initialization type of stuff that does not depend on the SCCs being processed. The doInitialization method call is not scheduled to overlap with any other pass executions (thus it should be very fast).
virtual bool runOnSCC(CallGraphSCC &SCC) = 0;
The runOnSCC method performs the interesting work of the pass, and should return true if the module was modified by the transformation, false otherwise.
virtual bool doFinalization(CallGraph &CG);
The doFinalization method is an infrequently used method that is called when the pass framework has finished calling runOnFunction for every function in the program being compiled.
In contrast to ModulePass subclasses, FunctionPass subclasses do have a predictable, local behavior that can be expected by the system. All FunctionPass execute on each function in the program independent of all of the other functions in the program. FunctionPass's do not require that they are executed in a particular order, and FunctionPass's do not modify external functions.
To be explicit, FunctionPass subclasses are not allowed to:
Implementing a FunctionPass is usually straightforward (See the Hello World pass for example). FunctionPass's may overload three virtual methods to do their work. All of these methods should return true if they modified the program, or false if they didn't.
virtual bool doInitialization(Module &M);
The doIninitialize method is allowed to do most of the things that FunctionPass's are not allowed to do. They can add and remove functions, get pointers to functions, etc. The doInitialization method is designed to do simple initialization type of stuff that does not depend on the functions being processed. The doInitialization method call is not scheduled to overlap with any other pass executions (thus it should be very fast).
A good example of how this method should be used is the LowerAllocations pass. This pass converts malloc and free instructions into platform dependent malloc() and free() function calls. It uses the doInitialization method to get a reference to the malloc and free functions that it needs, adding prototypes to the module if necessary.
virtual bool runOnFunction(Function &F) = 0;
The runOnFunction method must be implemented by your subclass to do the transformation or analysis work of your pass. As usual, a true value should be returned if the function is modified.
virtual bool doFinalization(Module &M);
The doFinalization method is an infrequently used method that is called when the pass framework has finished calling runOnFunction for every function in the program being compiled.
All LoopPass execute on each loop in the function independent of all of the other loops in the function. LoopPass processes loops in loop nest order such that outer most loop is processed last.
LoopPass subclasses are allowed to update loop nest using LPPassManager interface. Implementing a loop pass is usually straightforward. LoopPass's may overload three virtual methods to do their work. All these methods should return true if they modified the program, or false if they didn't.
virtual bool doInitialization(Loop *, LPPassManager &LPM);
The doInitialization method is designed to do simple initialization type of stuff that does not depend on the functions being processed. The doInitialization method call is not scheduled to overlap with any other pass executions (thus it should be very fast). LPPassManager interface should be used to access Function or Module level analysis information.
virtual bool runOnLoop(Loop *, LPPassManager &LPM) = 0;
The runOnLoop method must be implemented by your subclass to do the transformation or analysis work of your pass. As usual, a true value should be returned if the function is modified. LPPassManager interface should be used to update loop nest.
virtual bool doFinalization();
The doFinalization method is an infrequently used method that is called when the pass framework has finished calling runOnLoop for every loop in the program being compiled.
RegionPass is similar to LoopPass, but executes on each single entry single exit region in the function. RegionPass processes regions in nested order such that the outer most region is processed last.
RegionPass subclasses are allowed to update the region tree by using the RGPassManager interface. You may overload three virtual methods of RegionPass to implement your own region pass. All these methods should return true if they modified the program, or false if they didn not.
virtual bool doInitialization(Region *, RGPassManager &RGM);
The doInitialization method is designed to do simple initialization type of stuff that does not depend on the functions being processed. The doInitialization method call is not scheduled to overlap with any other pass executions (thus it should be very fast). RPPassManager interface should be used to access Function or Module level analysis information.
virtual bool runOnRegion(Region *, RGPassManager &RGM) = 0;
The runOnRegion method must be implemented by your subclass to do the transformation or analysis work of your pass. As usual, a true value should be returned if the region is modified. RGPassManager interface should be used to update region tree.
virtual bool doFinalization();
The doFinalization method is an infrequently used method that is called when the pass framework has finished calling runOnRegion for every region in the program being compiled.
BasicBlockPass's are just like FunctionPass's, except that they must limit their scope of inspection and modification to a single basic block at a time. As such, they are not allowed to do any of the following:
BasicBlockPasses are useful for traditional local and "peephole" optimizations. They may override the same doInitialization(Module &) and doFinalization(Module &) methods that FunctionPass's have, but also have the following virtual methods that may also be implemented:
virtual bool doInitialization(Function &F);
The doIninitialize method is allowed to do most of the things that BasicBlockPass's are not allowed to do, but that FunctionPass's can. The doInitialization method is designed to do simple initialization that does not depend on the BasicBlocks being processed. The doInitialization method call is not scheduled to overlap with any other pass executions (thus it should be very fast).
virtual bool runOnBasicBlock(BasicBlock &BB) = 0;
Override this function to do the work of the BasicBlockPass. This function is not allowed to inspect or modify basic blocks other than the parameter, and are not allowed to modify the CFG. A true value must be returned if the basic block is modified.
virtual bool doFinalization(Function &F);
The doFinalization method is an infrequently used method that is called when the pass framework has finished calling runOnBasicBlock for every BasicBlock in the program being compiled. This can be used to perform per-function finalization.
A MachineFunctionPass is a part of the LLVM code generator that executes on the machine-dependent representation of each LLVM function in the program.
Code generator passes are registered and initialized specially by TargetMachine::addPassesToEmitFile and similar routines, so they cannot generally be run from the opt or bugpoint commands.
A MachineFunctionPass is also a FunctionPass, so all the restrictions that apply to a FunctionPass also apply to it. MachineFunctionPasses also have additional restrictions. In particular, MachineFunctionPasses are not allowed to do any of the following:
virtual bool runOnMachineFunction(MachineFunction &MF) = 0;
runOnMachineFunction can be considered the main entry point of a MachineFunctionPass; that is, you should override this method to do the work of your MachineFunctionPass.
The runOnMachineFunction method is called on every MachineFunction in a Module, so that the MachineFunctionPass may perform optimizations on the machine-dependent representation of the function. If you want to get at the LLVM Function for the MachineFunction you're working on, use MachineFunction's getFunction() accessor method -- but remember, you may not modify the LLVM Function or its contents from a MachineFunctionPass.
In the Hello World example pass we illustrated how pass registration works, and discussed some of the reasons that it is used and what it does. Here we discuss how and why passes are registered.
As we saw above, passes are registered with the RegisterPass template. The template parameter is the name of the pass that is to be used on the command line to specify that the pass should be added to a program (for example, with opt or bugpoint). The first argument is the name of the pass, which is to be used for the -help output of programs, as well as for debug output generated by the --debug-pass option.
If you want your pass to be easily dumpable, you should implement the virtual print method:
virtual void print(std::ostream &O, const Module *M) const;
The print method must be implemented by "analyses" in order to print a human readable version of the analysis results. This is useful for debugging an analysis itself, as well as for other people to figure out how an analysis works. Use the opt -analyze argument to invoke this method.
The llvm::OStream parameter specifies the stream to write the results on, and the Module parameter gives a pointer to the top level module of the program that has been analyzed. Note however that this pointer may be null in certain circumstances (such as calling the Pass::dump() from a debugger), so it should only be used to enhance debug output, it should not be depended on.
One of the main responsibilities of the PassManager is to make sure that passes interact with each other correctly. Because PassManager tries to optimize the execution of passes it must know how the passes interact with each other and what dependencies exist between the various passes. To track this, each pass can declare the set of passes that are required to be executed before the current pass, and the passes which are invalidated by the current pass.
Typically this functionality is used to require that analysis results are computed before your pass is run. Running arbitrary transformation passes can invalidate the computed analysis results, which is what the invalidation set specifies. If a pass does not implement the getAnalysisUsage method, it defaults to not having any prerequisite passes, and invalidating all other passes.
virtual void getAnalysisUsage(AnalysisUsage &Info) const;
By implementing the getAnalysisUsage method, the required and invalidated sets may be specified for your transformation. The implementation should fill in the AnalysisUsage object with information about which passes are required and not invalidated. To do this, a pass may call any of the following methods on the AnalysisUsage object:
If your pass requires a previous pass to be executed (an analysis for example), it can use one of these methods to arrange for it to be run before your pass. LLVM has many different types of analyses and passes that can be required, spanning the range from DominatorSet to BreakCriticalEdges. Requiring BreakCriticalEdges, for example, guarantees that there will be no critical edges in the CFG when your pass has been run.
Some analyses chain to other analyses to do their job. For example, an AliasAnalysis implementation is required to chain to other alias analysis passes. In cases where analyses chain, the addRequiredTransitive method should be used instead of the addRequired method. This informs the PassManager that the transitively required pass should be alive as long as the requiring pass is.
One of the jobs of the PassManager is to optimize how and when analyses are run. In particular, it attempts to avoid recomputing data unless it needs to. For this reason, passes are allowed to declare that they preserve (i.e., they don't invalidate) an existing analysis if it's available. For example, a simple constant folding pass would not modify the CFG, so it can't possibly affect the results of dominator analysis. By default, all passes are assumed to invalidate all others.
The AnalysisUsage class provides several methods which are useful in certain circumstances that are related to addPreserved. In particular, the setPreservesAll method can be called to indicate that the pass does not modify the LLVM program at all (which is true for analyses), and the setPreservesCFG method can be used by transformations that change instructions in the program but do not modify the CFG or terminator instructions (note that this property is implicitly set for BasicBlockPass's).
addPreserved is particularly useful for transformations like BreakCriticalEdges. This pass knows how to update a small set of loop and dominator related analyses if they exist, so it can preserve them, despite the fact that it hacks on the CFG.
The Pass::getAnalysis<> method is automatically inherited by your class, providing you with access to the passes that you declared that you required with the getAnalysisUsage method. It takes a single template argument that specifies which pass class you want, and returns a reference to that pass. For example:
bool LICM::runOnFunction(Function &F) { LoopInfo &LI = getAnalysis<LoopInfo>(); ... }
This method call returns a reference to the pass desired. You may get a runtime assertion failure if you attempt to get an analysis that you did not declare as required in your getAnalysisUsage implementation. This method can be called by your run* method implementation, or by any other local method invoked by your run* method. A module level pass can use function level analysis info using this interface. For example:
bool ModuleLevelPass::runOnModule(Module &M) { ... DominatorTree &DT = getAnalysis<DominatorTree>(Func); ... }
In above example, runOnFunction for DominatorTree is called by pass manager before returning a reference to the desired pass.
If your pass is capable of updating analyses if they exist (e.g., BreakCriticalEdges, as described above), you can use the getAnalysisIfAvailable method, which returns a pointer to the analysis if it is active. For example:
... if (DominatorSet *DS = getAnalysisIfAvailable<DominatorSet>()) { // A DominatorSet is active. This code will update it. } ...
Now that we understand the basics of how passes are defined, how they are used, and how they are required from other passes, it's time to get a little bit fancier. All of the pass relationships that we have seen so far are very simple: one pass depends on one other specific pass to be run before it can run. For many applications, this is great, for others, more flexibility is required.
In particular, some analyses are defined such that there is a single simple interface to the analysis results, but multiple ways of calculating them. Consider alias analysis for example. The most trivial alias analysis returns "may alias" for any alias query. The most sophisticated analysis a flow-sensitive, context-sensitive interprocedural analysis that can take a significant amount of time to execute (and obviously, there is a lot of room between these two extremes for other implementations). To cleanly support situations like this, the LLVM Pass Infrastructure supports the notion of Analysis Groups.
An Analysis Group is a single simple interface that may be implemented by multiple different passes. Analysis Groups can be given human readable names just like passes, but unlike passes, they need not derive from the Pass class. An analysis group may have one or more implementations, one of which is the "default" implementation.
Analysis groups are used by client passes just like other passes are: the AnalysisUsage::addRequired() and Pass::getAnalysis() methods. In order to resolve this requirement, the PassManager scans the available passes to see if any implementations of the analysis group are available. If none is available, the default implementation is created for the pass to use. All standard rules for interaction between passes still apply.
Although Pass Registration is optional for normal passes, all analysis group implementations must be registered, and must use the INITIALIZE_AG_PASS template to join the implementation pool. Also, a default implementation of the interface must be registered with RegisterAnalysisGroup.
As a concrete example of an Analysis Group in action, consider the AliasAnalysis analysis group. The default implementation of the alias analysis interface (the basicaa pass) just does a few simple checks that don't require significant analysis to compute (such as: two different globals can never alias each other, etc). Passes that use the AliasAnalysis interface (for example the gcse pass), do not care which implementation of alias analysis is actually provided, they just use the designated interface.
From the user's perspective, commands work just like normal. Issuing the command 'opt -gcse ...' will cause the basicaa class to be instantiated and added to the pass sequence. Issuing the command 'opt -somefancyaa -gcse ...' will cause the gcse pass to use the somefancyaa alias analysis (which doesn't actually exist, it's just a hypothetical example) instead.
The RegisterAnalysisGroup template is used to register the analysis group itself, while the INITIALIZE_AG_PASS is used to add pass implementations to the analysis group. First, an analysis group should be registered, with a human readable name provided for it. Unlike registration of passes, there is no command line argument to be specified for the Analysis Group Interface itself, because it is "abstract":
static RegisterAnalysisGroup<AliasAnalysis> A("Alias Analysis");
Once the analysis is registered, passes can declare that they are valid implementations of the interface by using the following code:
namespace { // Declare that we implement the AliasAnalysis interface INITIALIZE_AG_PASS(FancyAA, AliasAnalysis, "somefancyaa", "A more complex alias analysis implementation", false, // Is CFG Only? true, // Is Analysis? false, // Is default Analysis Group implementation? ); }
This just shows a class FancyAA that uses the INITIALIZE_AG_PASS macro both to register and to "join" the AliasAnalysis analysis group. Every implementation of an analysis group should join using this macro.
namespace { // Declare that we implement the AliasAnalysis interface INITIALIZE_AG_PASS(BasicAA, AliasAnalysis, "basicaa", "Basic Alias Analysis (default AA impl)", false, // Is CFG Only? true, // Is Analysis? true, // Is default Analysis Group implementation? ); }
Here we show how the default implementation is specified (using the final argument to the INITIALIZE_AG_PASS template). There must be exactly one default implementation available at all times for an Analysis Group to be used. Only default implementation can derive from ImmutablePass. Here we declare that the BasicAliasAnalysis pass is the default implementation for the interface.
The Statistic class is designed to be an easy way to expose various success metrics from passes. These statistics are printed at the end of a run, when the -stats command line option is enabled on the command line. See the Statistics section in the Programmer's Manual for details.
The PassManager class takes a list of passes, ensures their prerequisites are set up correctly, and then schedules passes to run efficiently. All of the LLVM tools that run passes use the PassManager for execution of these passes.
The PassManager does two main things to try to reduce the execution time of a series of passes:
This improves the cache behavior of the compiler, because it is only touching the LLVM program representation for a single function at a time, instead of traversing the entire program. It reduces the memory consumption of compiler, because, for example, only one DominatorSet needs to be calculated at a time. This also makes it possible to implement some interesting enhancements in the future.
The effectiveness of the PassManager is influenced directly by how much information it has about the behaviors of the passes it is scheduling. For example, the "preserved" set is intentionally conservative in the face of an unimplemented getAnalysisUsage method. Not implementing when it should be implemented will have the effect of not allowing any analysis results to live across the execution of your pass.
The PassManager class exposes a --debug-pass command line options that is useful for debugging pass execution, seeing how things work, and diagnosing when you should be preserving more analyses than you currently are (To get information about all of the variants of the --debug-pass option, just type 'opt -help-hidden').
By using the --debug-pass=Structure option, for example, we can see how our Hello World pass interacts with other passes. Lets try it out with the gcse and licm passes:
$ opt -load ../../../Debug+Asserts/lib/Hello.so -gcse -licm --debug-pass=Structure < hello.bc > /dev/null Module Pass Manager Function Pass Manager Dominator Set Construction Immediate Dominators Construction Global Common Subexpression Elimination -- Immediate Dominators Construction -- Global Common Subexpression Elimination Natural Loop Construction Loop Invariant Code Motion -- Natural Loop Construction -- Loop Invariant Code Motion Module Verifier -- Dominator Set Construction -- Module Verifier Bitcode Writer --Bitcode Writer
This output shows us when passes are constructed and when the analysis results are known to be dead (prefixed with '--'). Here we see that GCSE uses dominator and immediate dominator information to do its job. The LICM pass uses natural loop information, which uses dominator sets, but not immediate dominators. Because immediate dominators are no longer useful after the GCSE pass, it is immediately destroyed. The dominator sets are then reused to compute natural loop information, which is then used by the LICM pass.
After the LICM pass, the module verifier runs (which is automatically added by the 'opt' tool), which uses the dominator set to check that the resultant LLVM code is well formed. After it finishes, the dominator set information is destroyed, after being computed once, and shared by three passes.
Lets see how this changes when we run the Hello World pass in between the two passes:
$ opt -load ../../../Debug+Asserts/lib/Hello.so -gcse -hello -licm --debug-pass=Structure < hello.bc > /dev/null Module Pass Manager Function Pass Manager Dominator Set Construction Immediate Dominators Construction Global Common Subexpression Elimination -- Dominator Set Construction -- Immediate Dominators Construction -- Global Common Subexpression Elimination Hello World Pass -- Hello World Pass Dominator Set Construction Natural Loop Construction Loop Invariant Code Motion -- Natural Loop Construction -- Loop Invariant Code Motion Module Verifier -- Dominator Set Construction -- Module Verifier Bitcode Writer --Bitcode Writer Hello: __main Hello: puts Hello: main
Here we see that the Hello World pass has killed the Dominator Set pass, even though it doesn't modify the code at all! To fix this, we need to add the following getAnalysisUsage method to our pass:
// We don't modify the program, so we preserve all analyses virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesAll(); }
Now when we run our pass, we get this output:
$ opt -load ../../../Debug+Asserts/lib/Hello.so -gcse -hello -licm --debug-pass=Structure < hello.bc > /dev/null Pass Arguments: -gcse -hello -licm Module Pass Manager Function Pass Manager Dominator Set Construction Immediate Dominators Construction Global Common Subexpression Elimination -- Immediate Dominators Construction -- Global Common Subexpression Elimination Hello World Pass -- Hello World Pass Natural Loop Construction Loop Invariant Code Motion -- Loop Invariant Code Motion -- Natural Loop Construction Module Verifier -- Dominator Set Construction -- Module Verifier Bitcode Writer --Bitcode Writer Hello: __main Hello: puts Hello: main
Which shows that we don't accidentally invalidate dominator information anymore, and therefore do not have to compute it twice.
virtual void releaseMemory();
The PassManager automatically determines when to compute analysis results, and how long to keep them around for. Because the lifetime of the pass object itself is effectively the entire duration of the compilation process, we need some way to free analysis results when they are no longer useful. The releaseMemory virtual method is the way to do this.
If you are writing an analysis or any other pass that retains a significant amount of state (for use by another pass which "requires" your pass and uses the getAnalysis method) you should implement releaseMemory to, well, release the memory allocated to maintain this internal state. This method is called after the run* method for the class, before the next call of run* in your pass.
Size matters when constructing production quality tools using llvm, both for the purposes of distribution, and for regulating the resident code size when running on the target system. Therefore, it becomes desirable to selectively use some passes, while omitting others and maintain the flexibility to change configurations later on. You want to be able to do all this, and, provide feedback to the user. This is where pass registration comes into play.
The fundamental mechanisms for pass registration are the MachinePassRegistry class and subclasses of MachinePassRegistryNode.
An instance of MachinePassRegistry is used to maintain a list of MachinePassRegistryNode objects. This instance maintains the list and communicates additions and deletions to the command line interface.
An instance of MachinePassRegistryNode subclass is used to maintain information provided about a particular pass. This information includes the command line name, the command help string and the address of the function used to create an instance of the pass. A global static constructor of one of these instances registers with a corresponding MachinePassRegistry, the static destructor unregisters. Thus a pass that is statically linked in the tool will be registered at start up. A dynamically loaded pass will register on load and unregister at unload.
There are predefined registries to track instruction scheduling (RegisterScheduler) and register allocation (RegisterRegAlloc) machine passes. Here we will describe how to register a register allocator machine pass.
Implement your register allocator machine pass. In your register allocator .cpp file add the following include;
#include "llvm/CodeGen/RegAllocRegistry.h"
Also in your register allocator .cpp file, define a creator function in the form;
FunctionPass *createMyRegisterAllocator() { return new MyRegisterAllocator(); }
Note that the signature of this function should match the type of RegisterRegAlloc::FunctionPassCtor. In the same file add the "installing" declaration, in the form;
static RegisterRegAlloc myRegAlloc("myregalloc", " my register allocator help string", createMyRegisterAllocator);
Note the two spaces prior to the help string produces a tidy result on the -help query.
$ llc -help ... -regalloc - Register allocator to use (default=linearscan) =linearscan - linear scan register allocator =local - local register allocator =simple - simple register allocator =myregalloc - my register allocator help string ...
And that's it. The user is now free to use -regalloc=myregalloc as an option. Registering instruction schedulers is similar except use the RegisterScheduler class. Note that the RegisterScheduler::FunctionPassCtor is significantly different from RegisterRegAlloc::FunctionPassCtor.
To force the load/linking of your register allocator into the llc/lli tools, add your creator function's global declaration to "Passes.h" and add a "pseudo" call line to llvm/Codegen/LinkAllCodegenComponents.h.
The easiest way to get started is to clone one of the existing registries; we recommend llvm/CodeGen/RegAllocRegistry.h. The key things to modify are the class name and the FunctionPassCtor type.
Then you need to declare the registry. Example: if your pass registry is RegisterMyPasses then define;
MachinePassRegistry RegisterMyPasses::Registry;
And finally, declare the command line option for your passes. Example:
cl::opt<RegisterMyPasses::FunctionPassCtor, false, RegisterPassParser<RegisterMyPasses> > MyPassOpt("mypass", cl::init(&createDefaultMyPass), cl::desc("my pass option help"));
Here the command option is "mypass", with createDefaultMyPass as the default creator.
Unfortunately, using GDB with dynamically loaded passes is not as easy as it should be. First of all, you can't set a breakpoint in a shared object that has not been loaded yet, and second of all there are problems with inlined functions in shared objects. Here are some suggestions to debugging your pass with GDB.
For sake of discussion, I'm going to assume that you are debugging a transformation invoked by opt, although nothing described here depends on that.
First thing you do is start gdb on the opt process:
$ gdb opt GNU gdb 5.0 Copyright 2000 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "sparc-sun-solaris2.6"... (gdb)
Note that opt has a lot of debugging information in it, so it takes time to load. Be patient. Since we cannot set a breakpoint in our pass yet (the shared object isn't loaded until runtime), we must execute the process, and have it stop before it invokes our pass, but after it has loaded the shared object. The most foolproof way of doing this is to set a breakpoint in PassManager::run and then run the process with the arguments you want:
(gdb) break llvm::PassManager::run Breakpoint 1 at 0x2413bc: file Pass.cpp, line 70. (gdb) run test.bc -load $(LLVMTOP)/llvm/Debug+Asserts/lib/[libname].so -[passoption] Starting program: opt test.bc -load $(LLVMTOP)/llvm/Debug+Asserts/lib/[libname].so -[passoption] Breakpoint 1, PassManager::run (this=0xffbef174, M=@0x70b298) at Pass.cpp:70 70 bool PassManager::run(Module &M) { return PM->run(M); } (gdb)
Once the opt stops in the PassManager::run method you are now free to set breakpoints in your pass so that you can trace through execution or do other standard debugging stuff.
Once you have the basics down, there are a couple of problems that GDB has, some with solutions, some without.
Hopefully these tips will help with common case debugging situations. If you'd like to contribute some tips of your own, just contact Chris.
Although the LLVM Pass Infrastructure is very capable as it stands, and does some nifty stuff, there are things we'd like to add in the future. Here is where we are going:
Multiple CPU machines are becoming more common and compilation can never be fast enough: obviously we should allow for a multithreaded compiler. Because of the semantics defined for passes above (specifically they cannot maintain state across invocations of their run* methods), a nice clean way to implement a multithreaded compiler would be for the PassManager class to create multiple instances of each pass object, and allow the separate instances to be hacking on different parts of the program at the same time.
This implementation would prevent each of the passes from having to implement multithreaded constructs, requiring only the LLVM core to have locking in a few places (for global resources). Although this is a simple extension, we simply haven't had time (or multiprocessor machines, thus a reason) to implement this. Despite that, we have kept the LLVM passes SMP ready, and you should too.


Returns contents of custom AutoFill lists as an array of text strings.
Syntax
OPTIONS.LISTS.GET(list_num)
OPTIONS.LISTS.GET(string_array)
List_num is a number specifying which list to return, as a horizontal string array. If list_num is zero, then FALSE is returned.
String_array is an array or cell reference to store the returned list.
Example
OPTIONS.LIST.GET(3) returns the twelve months of the year in the form {"Jan", "Feb", "Mar"}
Remarks
If list_num is zero or omitted, then FALSE is returned.
Related Functions
OPTIONS.LISTS.ADD Adds a new custom list
OPTIONS.LISTS.DELETE Deletes a custom list
OPTIONS.VIEW Sets various view settings
Return to index


Awesome example made by
Soulwire
, but with palm normal gravity source.
And the particle texture is the data texture