class: title-slide class: title-slide # Taking TensorFlow into Production ## (A case study of Zendesk tickets) ### Andrie de Vries
Solutions engineer, RStudio #### 2018/09/12
 (updated: 2018-09-12) .rightbottom[  ] --- class: rstudio-slide # Outline * Challenges of production deployment * Model development * Deployment with RStudio Connect * Closing the end-to-end loop .rightbottom[  ] --- class: rstudio-fill-slide, center, middle # TensorFlow --- class: white-slide ## TensorFlow   --- class: white-slide ## TensorFlow APIs  --- class: rstudio-fill-slide, center, middle # Challenges of production deployment --- class: rstudio-slide ## When production deployment fails * Failing to quantify the busines value * Inability to get stakeholder buy-in * Getting stuck in optimising model fit * Failing to close the end-to-end loop * Lack of change management --- class: rstudio-fill-slide, center, middle # Problem description: Zendesk tickets --- class: white-slide ## A typical support ticket .right-column[ .client-speech[ My code doesn't work, help me ] .agent-speech[ Sure, what's the problem ] .client-speech[ I'm stuck... ] .agent-speech[ . . . ] .client-speech[ . . . ] ] -- .left-column[ Initial message * Subject * Text * Company name * Person * Date Subsequently * tags * additional comments ] --- class: white-slide ## What is a zendesk ticket? ![](images/zendesk-ticket-1.png) --- class: white-slide ## The business problem * Predict which support tickets will be **complex** * Complexity is the total **number of comments** in the ticket * This indicates - **Multiple interventions** by support - Potentially a leading indicator of **troubled accounts** --- class: white-slide ## The business value * **Intervene early** in complex tickets, e.g. by scheduling a phone call with the customer * Reduce **number** of complex tickets * Reduce **churn** --- class: rstudio-fill-slide, center, middle # Before you start... --- class: rstudio-slide ## Get stakeholder buy-in Stakeholder buy-in is critical to the success of your project. Work **with** your stakeholders: * Users * IT teams * Management * Finance --- class: rstudio-fill-slide, center, middle # Machine learning pipeline --- class: white-slide ## Architecture ![](images/image-01-zendesk-4x3.png) --- class: white-slide ## Data warehouse ![](images/image-02-data-warehouse-4x3.png) --- class: white-slide ## Zendesk database schema ![](images/zendesk_schema_fivetran.png) --- class: white-slide ## Zendesk database schema extract ```r library(datamodelr) dm_read_yaml("1_zendesk_schema.yml") %>% dm_create_graph(rankdir = "LR", columnArrows = TRUE) %>% dm_render_graph() ``` ```yaml # data model segments - segment: &tc Ticket Comments - segment: &tg Tags # Tables and columns - table: Ticket segment: display: accent1 columns: id: {key: yes} assignee_id: brand_id: requester_id: {ref: User} submitter_id: {ref: User} organization_id: {ref: Organization} created_at: ..: description: ...: subject: type: ....: - table: Ticket_comment segment: *tc display: accent2 columns: id: {key: yes} ticket_id: {ref: Ticket} user_id: {ref: User} body: created: ...: - table: Ticket_tag segment: *tg display: accent2 columns: ticket_id: {key: yes, ref: Ticket} tag: - table: Organization segment: columns: id: {key: yes} details: name: notes: ...: - table: User segment: columns: id: {key: yes} organization_id: {ref: Organization} ...: ``` --- class: white-slide ## Zendesk database schema extract ![](images/zendesk_datamodel_diagram_2018-08-03.png) --- class: white-slide ## Development environment ![](images/image-03-dev-env-4x3.png) --- class: white-slide ## Modeling Keras sequential model ```r *model <- keras_model_sequential() %>% layer_embedding( input_dim = MAX_NUM_WORDS, output_dim = EMBEDDING_DIM, input_length = MAX_SEQUENCE_LENGTH ) %>% layer_global_average_pooling_1d() %>% layer_dense(units = 32, activation = 'relu') %>% layer_dense(units = 16, activation = 'relu') %>% layer_dropout(0.25) %>% layer_dense(1, activation = 'sigmoid') ``` --- class: white-slide ## Modeling With embedding layer to learn the text features ```r model <- keras_model_sequential() %>% * layer_embedding( * input_dim = MAX_NUM_WORDS, * output_dim = EMBEDDING_DIM, * input_length = MAX_SEQUENCE_LENGTH * ) %>% layer_global_average_pooling_1d() %>% layer_dense(units = 32, activation = 'relu') %>% layer_dense(units = 16, activation = 'relu') %>% layer_dropout(0.25) %>% layer_dense(1, activation = 'sigmoid') ``` --- class: white-slide ## Modeling Simple multi layer perceptron ```r model <- keras_model_sequential() %>% layer_embedding( input_dim = MAX_NUM_WORDS, output_dim = EMBEDDING_DIM, input_length = MAX_SEQUENCE_LENGTH ) %>% layer_global_average_pooling_1d() %>% * layer_dense(units = 32, activation = 'relu') %>% * layer_dense(units = 16, activation = 'relu') %>% layer_dropout(0.25) %>% layer_dense(1, activation = 'sigmoid') ``` --- class: white-slide ## Modeling One-dimensional convolution ```r model <- keras_model_sequential() %>% layer_embedding( input_dim = MAX_NUM_WORDS, output_dim = EMBEDDING_DIM, input_length = MAX_SEQUENCE_LENGTH ) %>% * layer_conv_1d(filters = 512, kernel_size = 3, activation = 'relu') %>% layer_max_pooling_1d(pool_size = 3) %>% layer_dropout(0.1) %>% layer_conv_1d(filters = 256, kernel_size = 3, activation = 'relu') %>% layer_max_pooling_1d(pool_size = 3) %>% layer_dropout(0.1) %>% layer_dense(1, activation = 'sigmoid') ``` --- class: white-slide ## Modeling One-dimensional **separable** convolution ```r model <- keras_model_sequential() %>% layer_embedding( input_dim = MAX_NUM_WORDS, output_dim = EMBEDDING_DIM, input_length = MAX_SEQUENCE_LENGTH ) %>% * layer_separable_conv_1d( * filters = 64, * kernel_size = 3, * depth_multiplier = 2 * ) %>% layer_flatten() %>% layer_dense(units = 32, activation = 'relu') %>% layer_dense(units = 16, activation = 'relu') %>% layer_dropout(0.25) %>% layer_dense(1, activation = 'sigmoid') ``` --- class: white-slide ## That didn't work well... ![](images/training-accuracy.png) --- class: white-slide ## Modeling using the functional API More complex model using `keras` [functional API](https://keras.rstudio.com/articles/functional_api.html) > The Keras functional API is the way to go for defining complex models, such as multi-output models, directed acyclic graphs, or models with shared layers. --- class: white-slide ## Modeling using the functional API More complex model using `keras` [functional API](https://keras.rstudio.com/articles/functional_api.html) ```r concatenated <- layer_concatenate( list(name_embedding, subject_embedding, text_embedding) ) output <- concatenated %>% layer_dense(units = dense_dim) %>% layer_activation_leaky_relu() %>% layer_dropout(0.5) %>% layer_dense(units = 1, activation = "sigmoid") *model <- keras_model( * inputs = list(name_input, subject_input, text_input), * outputs = output *) ``` --- class: white-slide ## Modeling using the functional API More complex model using `keras` [functional API](https://keras.rstudio.com/articles/functional_api.html) ```r concatenated <- layer_concatenate( * list(name_embedding, subject_embedding, text_embedding) ) output <- concatenated %>% layer_dense(units = dense_dim) %>% layer_activation_leaky_relu() %>% layer_dropout(0.5) %>% layer_dense(units = 1, activation = "sigmoid") model <- keras_model( * inputs = list(name_input, subject_input, text_input), outputs = output ) ``` --- class: white-slide ## That didn't work well either ![](images/model_history_2018-08-07.png) --- class: white-slide ## That didn't work well either ![](images/model-metrics.png) --- class: highlight-slide, center, middle # Don't get stuck on model tuning!!! --- class: rstudio-fill-slide, center, middle # Deployment with RStudio Connect --- class: white-slide ## RStudio Connect  --- class: white-slide ## Deployment architecture ![](images/image-04-deployment-4x3.png) --- class: white-slide ## Deploying a TensorFlow model First deployment ```r rsconnect::deployTFModel( last_model, appTitle = glue("TensorFlow classifier {model_name}") ) ``` Subsequent deployments ```r rsconnect::deployTFModel( last_model, appId = "....", forceUpdate = TRUE ) ``` --- class: white-slide ## Viewing the TensorFlow model API In RStudio Connect ![](images/connect-tensorflow-api-cropped.png) --- class: white-slide ## Calling the TensorFlow serving API ```r # Construct the payload body <- list( instances = list(list( x_val[1, ] ))) ``` ```r # Call the API api_url <- glue("http://{host}/content/{app_id}/predict") score <- api_url %>% POST(body = body, encode = "json") %>% content() %>% fromJSON() %>% .$predictions %>% .[, , 1] ``` ```r score ## [1] 0.486874 ``` --- class: white-slide ## plumber APIs The `plumber` package **converts your script** into an API using simple **comment decorators** ```r #' @apiTitle TensorFlow zendesk ticket scoring API #' Predicts ticket complexity given the initial issue. #' #' @param org Ticket organization name #' @param description Ticket description (text) #' @param title Ticket title #' @param id Ticket id #' #' @post / function(id, title, description, org) { score <- runif(1) # << record_in_googlesheet(id, title, description, org, score) score } ``` --- class: white-slide ## Hosting plumber APIs on Connect ![](images/connect-api.png) --- class: rstudio-fill-slide, center, middle # Closing the end-to-end loop --- class: rstudio-slide ## Closing the end-to-end loop * New ticket arrives * Zendesk triggers a call to `plumber` API * API - pre-processes the text, calls TensorFlow API - Retrieves score - Write record to log file - Calls Zendesk API * Zendesk - Inserts comment into ticket - Updates ticket tag --- class: white-slide ## Updating the ticket information ![](images/zendesk-ticket-2.png) --- class: white-slide ## Closing the end-to-end loop ![](images/image-05-closed-loop-4x3.png) --- class: white-slide ## Creating an API log file ![](images/zendesk-ticket-api-log.png) --- class: rstudio-fill-slide, center, middle # Summary --- class: rstudio-slide ## Lessons learnt: modeling TensorFlow doesn't do all your feature engineering. You must decide **which features** to use as inputs to the model: * Possibly from **multiple sources** * At the cost of greater **model complexity** --- class: rstudio-slide ## Lessons learnt: deployment It is still harder than it should be to deploy models. Feature requests: * TensorFlow click-button deployment * Better API swagger documentation * Sample scripts to generate JSON body --- class: rstudio-slide ## What next? Ideas to improve model * Different embeddings, e.g. `word2vec` * Hyperparameter tuning * Include additional comment text in model * ... --- class: rstudio-slide ## What next? New ideas for business value * Predict **tags** based on text * **Recommend** best support articles * **Automate** license key requests * ... --- class: white-slide ## Overall architecture ![](images/image-06-overall-4x3.png) --- class: rstudio-slide, center, middle # Thank you!   .smaller[ Slides: <http://colorado.rstudio.com/rsc/TensorFlow-EARL-2018/> Subscribe to the blog to stay up to date! <https://tensorflow.rstudio.com/blog/> ]


|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.thingmagic.Gen2
public class Gen2
This class is a namespace for Gen2-specific subclasses of generic Mercury API classes, Gen2 data structures, constants, and Gen2 convenience functions.
| Nested Class Summary | |
|---|---|
static class |
Gen2.Alien
|
static class |
Gen2.Bank
Gen2 memory banks |
static class |
Gen2.Bap
|
static class |
Gen2.BlockErase
Block Erase |
static class |
Gen2.BlockPermaLock
Block PermaLock |
static class |
Gen2.BlockWrite
Block Write |
static class |
Gen2.Denatran
|
static class |
Gen2.DivideRatio
Divide Ratio values |
static class |
Gen2.DynamicQ
Dynamic Q algorithm |
static class |
Gen2.Gen2_SiliconType
|
static class |
Gen2.Gen2CustomTagOp
|
static class |
Gen2.IDS
|
static class |
Gen2.Impinj
|
static class |
Gen2.Kill
Embedded Tag operation : Kill |
static class |
Gen2.LinkFrequency
|
static class |
Gen2.Lock
Embedded Tag operation : Lock |
static class |
Gen2.LockAction
The arguments to a Reader.lockTag() method for Gen2 tags. |
class |
Gen2.LockBits
Individual Gen2 lock bits. |
static class |
Gen2.NXP
|
static class |
Gen2.Password
Stores a 32-bit Gen2 password for use as an access or kill password. |
static class |
Gen2.Q
Algorithm choices for Q - superclass |
static class |
Gen2.ReadData
Embedded Tag operation : Read Data |
static class |
Gen2.SecurePasswordLookup
|
static class |
Gen2.SecureReadData
|
static class |
Gen2.SecureTagType
|
static class |
Gen2.Select
Representation of a Gen2 Select operation |
static class |
Gen2.Session
Gen2 session values |
static class |
Gen2.StaticQ
Static initial Q algorithm |
static class |
Gen2.TagData
This class extends TagData to represent the details of a Gen2 RFID tag. |
static class |
Gen2.TagEncoding
Miller M values |
static class |
Gen2.Target
Target algorithm options |
static class |
Gen2.Tari
|
static class |
Gen2.TrExt
TRext |
static class |
Gen2.WriteData
Embedded Tag operation : Write Data |
static class |
Gen2.WriteMode
Mode for write operation |
static class |
Gen2.WriteTag
Write a new id to a tag |
| Method Summary |
|---|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |


"Blue" represents the lowest density while "Red" represents the highest. Select a state to see more.
Dataset: All Tweets posted from US during 2017.12.18 11:11:3~2017.12.18 23:56:22 CET


THE POSTMAN Grade: F (I'd rather be on fire for three hours than sit through this one again)
Directed by Kevin Costner Written for the Screen by Brian Helgeland and Eric Roth from the Novel by David Brin Starring: Costner, Will Patton (No Way Out), Olivia Williams, Larenz Tate (Dead Presidents) Year of Release: 1997 Rating: R
Deserves Recognition for: Achieving the near-impossible task of making a grander monument to self-love than Steven Seagal's On Deadly Ground.
Capsule Review: A question: After the floating Baby Ruth that was WATERWORLD, what in the @$&% were the Hollywood execs who gave Kevin Costner the money to make another post-apocalyptic movie thinking? In this 3 hour advertisement for his new hair weave, Costner plays a nameless drifter who dons a long dead Postal employee's uniform and gradually turns a nuked-out USA into an idealized hippy-dippy society. (Judging by the costuming at the end of the movie, the main accomplishment of this brave new world is in re-inventing polyester.) When he's not pointing the camera directly at himself, director Costner does have a nice visual sense, and it is undeniably fascinating to see such an unabashedly jingoistic film in the trust-no-one 90's; but by the time the second hour rolled around, I was reduced to sitting on my hands to keep from clawing out my own eyes. Mark this one "Return to Sender".
Copyright 1998 by The Critic formerly known as Andrew Wright For more insanely biased reviews, check out http://www.seanet.com/~louk/ e-mail<EMAIL_ADDRESS>"Saturday Night Thing. Drunken Hillbilly Bar Fight. My Soul Rejoices."
A Haiku in honor of ROADHOUSE A9Andrew L. Wright esq.
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


Introduction Programming languages contain the series of commands that create software. A CPU has a limited set of instructions known as machine code that it is capable of understanding. The CPU can understand only this language. All other programming languages must be converted to machine code for them to be understood. Computer programmers, however, prefer to use other computer languages that use words or other commands because they are easier to use. These other languages are slower because the language must be translated first so that the computer can understand it. The translation can lead to code that may be less efficient to run than code written directly in the machine¡¯s language. |


{% extends "base.html" %} {% load staticfiles i18n compress%} {% block css %} {% load static %} {% endblock %} {% block content %}
Looking for 3 others. Come Join me!
Organized by joe17@up.edu


Ted Cruz defends Ilhan Omar from 'reprehensible' death threats
by Joseph WulfsohnSen. Ted Cruz, R-Texas., came to the defense of Rep. Ilhan Omar, D-Minn., on Monday after the progressive congresswoman received multiple death threats on Twitter.
Over the weekend, Omar put a spotlight on the threats she had received from other Twitter users, telling the social media giant that the posts about her were "unacceptable." One tweet had called her a "terrorist" who "should be hanged for treason."
Cruz expressed solidarity with Omar amid the viral threats.
"This is reprehensible," Cruz tweeted. "Disagree with @IlhanMN on the merits, fine, but death threats to anyone are not a joke."
TED CRUZ PRAISES AOC ON BANNING LAWMAKERS FROM BECOMING LOBBYISTS: 'I AGREE' WITH HER!
Omar later tweeted her thanks to Cruz.
This wasn't the first time Cruz had reached out to a member of the "Squad" of House Democrats. Earlier this year, the GOP senator formed a legislative alliance with Rep. Alexandria Ocasio-Cortez, D-N.Y., in hopes of cracking down on politicians who later would become lobbyists.
"I'm looking forward to seeing where and how far they'd be willing to move on that, but I'm encouraged," Ocasio-Cortez said in June. "I think there's some wiggle room here. It's super-bizarre, really weird. Never thought in my life that one of my first pushes would be alongside Ted Cruz."
CLICK HERE TO GET THE FOX NEWS APP
“I think it really shows what the true spirit of not being partisan is,” she continued.
“And, that bipartisanship doesn’t mean let’s come together to go to war and lower taxes on the rich. But, bipartisanship means, OK, I will swallow all of my distaste in this situation, because we have found a common interest.”


CDots
TECHNOLOGIES
LLC
As your trusted partner, we will build a relationship that goes far beyond simply selling you our services or deploying an IT professional to augment your staff. Because we are focused on the entire technology lifecycle, our experienced consulting and IT professionals deliver a wide range of services to seamlessly help you plan, deploy, operate and refresh your technology environment.
CDots Technologies provides information technology solutions and consulting services. We support business intelligence, architecture, enterprise quality, content management, integration, enterprise application integration, quality assurance services, and web applications.
The company operates in the United States, Founded in 2018.


@(emplr: List[models.EmployerForm])(implicit request: RequestHeader) @import controllers.routes @main("Show forms and New Form") {
| First Name | Last Name | Organization | Visa Type | Initiation | Email Id | ||
|---|---|---|---|---|---|---|---|
| @elist.fname | @elist.lname | @elist.organization | @elist.visaType | @elist.initiation | @elist.emailId | Update | Delete |


Class time_check¶
Defined in File time_check.hpp
Class Documentation¶
-
class
time_check
¶ Tool for program execution checkpointing.
Public Types
-
typedef unsigned
size_type
¶
Public Functions
-
time_check
(const char *name = "", size_type n = 128)¶ Constructs time_check.
- Parameters
name
: name of the object.n
: maximal number of check points.
-
void
start
()¶ Starts checkpointing.
-
void
stop
()¶ Stops checkpointing.
-
void
check
(const std::string &id = "")¶ Creates checkpoint.
- Parameters
id
: name of the checkpoint.
-
double
get_time
() const¶
Friends
-
friend std::ostream &
operator<<
(std::ostream&, const time_check&)¶
-
typedef unsigned


Big Chelsea fan? Season ticket mere pocket change? Then you need this limited edition Hublot
The satin-finished blue ceramic watch is limited to just 100 examples worldwide
by Alistair CharltonLuxury Swiss watchmaker has teamed up with Chelsea Football Club to produce a limited edition timepiece - and, as you might expect, it’s very blue.
Called the Classic Fusion Chronograph Chelsea FC, the watch features a satin-finished and polished blue ceramic face with matching blue dial adorned with the Chelsea lion at the 12 o’clock position.
The case back is also made from polished blue ceramic, and the rubber strap is - guess what? - also blue.
- T3's guide to the best watches for men
- The best watches under £1000
- 5 best watches to invest in right now
Just about saving the Chelsea watch from blue-overload are a pair silver chronograph dials, along with matching hour indices, buttons at two and four o’clock, crown, and the exposed screw heads Hublot’s house style is known for.
Inside, the watch features a HUB1143 self-winding mechanical movement, which can be viewed through the sapphire crystal case back and has a power reserve of 42 hours. The movement is made up of 280 components and has 59 jewels.
The watch is limited to just 100 examples worldwide, with each getting its own number etched onto the case back, along with the words: “Limited Edition” and “The Pride of London”.
As well as being a partner of Chelsea FC, Hublot has invested in football since 2006, and is the official timekeeper for FIFA and UEFA. You may well have seen the brand on the boards held up by match officials to indicate substitutions and added time.
Being a luxury Swiss watch company - and rather fitting given Chelsea is one of the wealthiest clubs around - the Classic Fusion Chronograph does not come cheap. It is priced at £11,700, or roughly the same as a season ticket for 14 years...
- Shop Hublot watches at Goldsmiths
- Shop Hublot watches at Rox
Liked this?


The current released version is 0.6.0-incubating. (.tar.gz) (md5) (sha) (sig)
To quickly get started, we reccomend using Vagrant and following the Getting Started guide.
0.5.0-incubating (.tar.gz) (md5) (sha) (sig)
The latest code is available in git via:
git clone http://git.apache.org/incubator-aurora.git
You can browse the repo on Apache Git and the Github mirror.


AVRsack is designed to borrow the examples, libraries, and, optionally, the toolchain of an Arduino IDE. Get the Arduino 1.0.5 IDE, unpack it, and run it once (After that, keep it installed, but you don't need to run it anymore). At this point, AVRsack does not yet support the newer Arduino 1.5.x and 1.6.x IDEs.
Once you've done this, AVRsack will automatically find your installation.
The Arduino IDE contains a toolchain (compiler, linker, etc) which is suitable for the microcontrollers used on standard Arduino boards, i.e. the ATmega328p (Arduino Uno and many more) and the ATmega32u4 (Arduino Leonardo, Micro, and others).
If you're working with other AVR microcontrollers, however, e.g. the ATtiny1634, you will find that they are either not supported by the Arduino toolchain at all, or that there are significant bugs. It is therefore often useful to replace the Arduino toolchain with a more up to date version. One such toolchain is conveniently packaged as Crosspack-AVR.
Download the latest version from here and install it. Once you've done this, AVRsack will automatically use this toolchain.
Many Arduino programmers prefer to keep using the same APIs when programming ATtiny microcontrollers, so a number of projects exist to offer Arduino APIs for ATtinys. One such project, to which I've contributed some code, is arduino-tiny, so I recommend that for ATtiny development. Clone or download this project from github and install it.
At this point, arduino-tiny supports the following microcontrollers:
Other ATtiny cores will work as well, but not all of them use the same mapping of Arduino pin numbers to hardware pins, so make sure the core you're using is compatible with your code!
By default, AVRsack will look for projects (and custom cores) in the Arduino sketchbook directory, ~/Documents/Arduino
, but if you prefer, you can store projects and cores in ~/Documents/AVRsack
instead.


Table of Contents
Chrome Lighthouse has been around for a while now, but what if I ask you to explain what it does can you explain vividly?
I discovered that a lot of web developers, including beginners, have not heard about this tool and those who have, have not tried it yet, that’s not cool :(.
In this article, I would introduce you Chrome Lighthouse, what it does and how to start using it.
Let’s get started :)
According to Wikipedia, A lighthouse is a tower, building, or other types of structure designed to emit light from a system of lamps and lenses and to serve as a navigational aid for maritime pilots at sea or on inland waterways.
Okay, let’s turn this into a tech term;
Lighthouse is a tower, building, or other types of structure designed to emit light from a system under the “Audits” panel in Chrome Developer Tools and to serve as a guide for developers
Making any sense? :)
Well, Lighthouse is a tool developed by Google that analyzes web apps and web pages, collecting modern performance metrics and insights on developer best practices.
Think of Lighthouse as the speedometer in a car that checks and balances the cars speed limit.
Basically, Lighthouse works with developer best practices and performance metrics. It runs checks on a web app and gives you feedback on errors, practices below standard, tips for better performance and how to fix them.
According to Google Developers Docs
Lighthouse is an open-source, automated tool for improving the quality of web pages. You can run it against any web page, public or requiring authentication. It has audits for performance, accessibility, progressive web apps, and more.
You can run Lighthouse in Chrome DevTools, from the command line, or as a Node module. You give Lighthouse a URL to audit, it runs a series of audits against the page, and then it generates a report on how well the page did. From there, use the failing audits as indicators on how to improve the page. Each audit has a reference doc explaining why the audit is important, as well as how to fix it.
That’s pretty much all about Lighthouse, It audits the URL of a web app and generates a report telling you how bad and good your web app is according to web standards and developers best practices. Also attached to each section of the report is documentation explaining why that part of your app was audited, why you should improve that part of your app and how to fix it.
Here is a demo of Lighthouse audits report for this blog https://bolajiayodeji.com
Pretty cool right? :)
What you should note is that I didn’t get great scores like this on my first audit. I had to use my first report to fix and improve the performance and quality of my app.
This is the idea behind Lighthouse, it is to dentify and fix common problems that affect your sites performance, accessibility and user experience.
Getting Started
Now, let’s move to the interesting part.
LightHouse is available in three workflows
- Chrome Developer Tools
- Command line (Node)
- A Chrome extension
I personally prefer using LightHouse in Dev Tools. Using the extension does not make sense as the Dev Tool and extension work in the same chrome browser, well our preference varies, use what works best for you.
Lighthouse was first available only with the Chrome extension before it was added to the Chrome DevTools.
Using lighthouse on the command line is really cool also,(For geeks :))
Let’s Get Started!!!
Run Lighthouse in Chrome DevTools
- Download Google Chrome web browser here
Note that Lighthouse can only be run on a desktop and not mobile
- Go to the URL you want to audit in Google Chrome.
You can audit any URL on the web.
- Open Chrome DevTools
Command+Option+C (Mac)
Control+Shift+C (Windows, Linux, Chrome OS).
- Click on the Audits panel
To the left is the viewport of the page that will be audited, here that’s my blog :). To the right is the Audits panel of Chrome DevTools, which is now powered by Lighthouse
- Click on Run audits
DevTools shows you a list of audit categories. Ensure that you leave them all checked. If you want to personalise what part of your app to be audited, you can set that by checking the categories you want to audit.
- After 60 to 90 seconds — depending on your internet strength, Lighthouse gives you a report on the page.
Not that your internet speed and pre installed extensions can affect lighthouse audits. For better experience, run audits in Icognito mode to avoid any interference
Run Lighthouse in Command line**
- Download Google Chrome web browser here
- Download node here, If you have it installed already, skip this step!
- Install Lighthouse
npm install -g lighthouse
# or use yarn:
yarn global add lighthouse
The
-g
flag installs it as a global module.
- Run your audits
lighthouse <url>
Sample;
lighthouse https://bolajiayodeji.com/
By default, Lighthouse writes the report to an HTML file. You can control the output format by passing flags.
The report can be displayed in HTML or JSON format
Output samples:
lighthouse
# saves `./<HOST>_<DATE>.report.html`
lighthouse --output json
# json output sent to stdout
lighthouse --output html --output-path ./report.html
# saves `./report.html`
# NOTE: specifying an output path with multiple formats ignores your specified extension
for ALL formats
lighthouse --output json --output html --output-path ./myfile.json
# saves `./myfile.report.json` and `./myfile.report.html`
lighthouse --output json --output html
# saves `./<HOST>_<DATE>.report.json` and `./<HOST>_<DATE>.report.html`
lighthouse --output-path=~/mydir/foo.out --save-assets
# saves `~/mydir/foo.report.html`
# saves `~/mydir/foo-0.trace.json` and `~/mydir/foo-0.devtoolslog.json`
lighthouse --output-path=./report.json --output json
# saves `./report.json`
Run $ lighthouse --help
for CLI options
Run Lighthouse with the Chrome extension**
As I earlier said, The DevTools workflow is the best as it provides the same benefits as the Extension workflow, with the added bonus of no installation needed.
To use this method you need to install the extension, but If you have your reasons, here is the guide;
- Download Google Chrome web browser here
- Install the Lighthouse Chrome Extension from the Chrome Webstore.
- Navigate to the page you want to audit
- Click Lighthouse Icon.
It should be next to the Chrome address bar. If not, open Chrome’s main menu (the three dots on the upper right) and access it at the top of the menu. After clicking, the Lighthouse menu expands.
- Click Generate report.
Lighthouse runs its audits against the opened page, then opens up a new tab with a report of the results.
Bingo! You did it
Conclusion
That’s pretty much it, Lighthouse is a great tool, especially for beginners.
It is a very useful tool when it comes to auditing Progressive web apps, read my other article here to learn more about PWA
I actually learned so much about optimization and performance standards when I started using Lighthouse. In no time you would become an expert in building full optimized web apps with great performance, accessibility and user experience. :)
Lighthouse is not magic, it was created by humans. It is open source and contributions are welcome. Check out the repository’s issue tracker to find bugs that you can fix, or audits that you can create or improve upon. The issues tracker is also a good place to discuss audit metrics, ideas for new audits, or anything else related to Lighthouse.
Thank you for reading this, after installing and using Lighthouse, share your success stories.
You can tweet to me via @iambolajiayo


Contoso
High Resolution 3D Printing Services
Get Started
Step 1. Upload a 3D File
Acceptable file format is STL.
*Don't have one? Search
Bing
.
Step 2. Customize Your Print
Material:
PLA
ABS
Steel
Nylon
Carbon Fiber
Color:
Red
Blue
Green
Orange
Black
White
Finish:
None
Smooth
Rough
Step 3. Enter Shipping Information
Name
Address 1
Address 2
City
State
Zip
Step 4. Enter Payment Information
Card Number
Name on card
Expiration
CVV
Step 5. Confirm Order
Place Order


View the different property configurations based on user information.
Visualize the calculated information based on certain property configurations using graphical resources such as graphs and charts.
Compare two properties to know which one of the two is a better option.


After two hours on phone confirmed SW expects us to reach Baltimore tomorrow despite weather. Hope airport's better than their phone system.
2/11/2010, 2:03:06 AM
Favs: 0
Retweets: 0
link--- layout: tweet ---
After two hours on phone confirmed SW expects us to reach Baltimore tomorrow despite weather. Hope airport's better than their phone system.
2/11/2010, 2:03:06 AM
Favs: 0
Retweets: 0
link


-Z" (ohm cm’)
----calculated Nyquist for sample a
— calculated Nyquist for sample Ret CPE,
» a
»> CPE,
0 50 100 150 200 250 300 350 400 450 Z' (ohm cm’)


Inside the new show homes at Wheeldon's Spondon development 20 Nov 2019, 08:04 by Karen Antcliff The Richmond house type Plenty of space to dine Kitchen detail Family space A house bathroom A double bedroom in the show home Inside one of the show homes Show home style Show home style The Hanbury property type


Exercise 3
1. Which of the following is responsible for routing of data?
a. Model
b. View
c. Controller
d. I don't know.
2. This is a JavaScript function that takes a JSON string and transforms it into a JavaScript object.
a. JSON.parse()
b. JSON.stringify()
c. JSON.toString()
d. I don't know.
3. Which of the following is the representation of data?
a. Model
b. View
c. Controller
d. I don't know.
4. This is a JavaScript function that takes a JavaScript object and transforms it into a JSON string.
a. JSON.parse()
b. JSON.stringify()
c. JSON.toString()
d. I don't know.
5. Which of the following is just a display?
a. Model
b. View
c. Controller
d. I don't know.
Exercise 4
1. These are functions that have access to the request object (req), the response object (res).
2. When a web page is loaded, the browser creates a _______________ of the page.
3. With the HTML DOM, JavaScript can access and change all the elements of an HTML document. True or False?
4. In the DOM, all HTML elements are defined as _______________.
5. This is a standard for how to get, change, add, or delete HTML elements.


Govt to introduce seed bills 2019 in winter session
by Sajith KumarThe government is set to introduce the Seed Bill 2019 during the winter session of Parliament. The 2019 Bill is the latest attempt to replace the original Seed Act 1966.
The government is set to introduce the Seed Bill 2019 during the winter session of Parliament. The 2019 Bill is the latest attempt to replace the original Seed Act 1966.


BJ Watling sets batting record as New Zealand turn screws on England
The keeper-batsman’s double hundred and a century from Mitch Santner helped NZ build a huge lead.
BJ Watling’s double hundred and Mitch Santner’s maiden international century ground England into submission as New Zealand assumed total dominance of the first Test.
England were dutiful in their approach at Mount Maunganui but a tactic of drying up the runs had no impact on the wickets column as Watling and Santner waited them out in an attritional morning session bringing only 58 runs.
As England wilted in the afternoon, Watling and Santner cashed in and had Test bests by the time their 261-run partnership – a New Zealand record for the seventh wicket – was ended with the only breakthrough thus far on day four.
While Santner holed out for 126, Watling moved to a masterful 200 not out – the highest score by a New Zealand wicketkeeper – from 466 balls in a near 11-hour innings, as the Black Caps went to tea on 590 for seven and a lead of 237.
New Zealand’s keeper-batsman described himself as “very limited” after his century yesterday but there were few signs of that with a series of eye-catching strokes square of the wicket, off front and back foot.
Santner, meanwhile, upped the tempo considerably this afternoon, clubbing Jack Leach for three straight sixes before taking Sam Curran the distance over midwicket.
Santner was troubled by a bumper barrage on Saturday evening but England went noticeably fuller to the left-hander on the fourth morning, with Archer pointedly opening the bowling after not doing so on Saturday.
The plan almost paid off as Santner wafted at an equally frugal Broad only for the edge to carry over the slips. England were feeding on scraps as the third new ball came and went without any alarms.
Watling was unable to duck out of the way of an Archer bumper and was clattered in the back of the helmet, but he ended the session by cutting the bowler for four.
That sign of aggression was a precursor to a more ambitious approach in the afternoon, Watling uppercutting Archer for six before Santner got in on the act with three maximums in as many overs off Leach.
The third took him to 97 before he reached three figures for the first time in Tests by scampering a couple after glancing Stokes fine.
Santner eventually perished after lofting Sam Curran to long-on.
Watling had clipped Joe Root tantalisingly out of reach of Stuart Broad at square-leg before bringing up his double ton on the stroke of tea.


|
ChristianityIt's a nice word, much better than "Christism" or "Jesusism" (see Jesus Christ).Speaking of titles, wouldn't Satanism sound better as Satianity? (See also Satan.) In the United States, almost every cult claims that their church is "Christian": the Moonies, the Mormons, Christian Scientists, Jehovah's Witnesses... it's just an easier sale that way. Even the Scientology logo is a modified crucifix. Christians are, generally speaking, the 2 billion people who claim in one way or another to be following the teaching of Jesus Christ. Most (but not all) of these believe that Jesus was divine in some way. That number doesn't include Muslims, another 1.3 billion people who believe Jesus was an important prophet but not the son of God. With that broad label of "Christian" are hundreds of secondary classifications, based on differences of opinion about the technicalities of who Jesus was, how he came to be, cosmology, theology, morality, which the books of the Bible are OK and which are not, and how those books should be translated. For a religion based primarily on the credo "Do unto others as you would have them do unto you," there is an awful lot of hostility between adherents of these differing interpretations.
|


WhatCar
WhatCar?
About
What car is that?
Upload a photo by clicking below and we'll tell you WhatCar it is
What car?
Submit


{% extends "emails/base.html" %} {% block content %}
We are sorry but your submission was not selected.
However, our new system prioritizes those who have not received meals within the last weeks. Next week, your chances of being selected will be weighted higher, and we encourage you to resubmit a request.
The request form will open again at 9am on Friday and will close at 2pm on Sunday.
Thank you, and stay safe!
{% endblock %}


{% extends "1_col_content.html" %} {% block title %}Page not found{% endblock %} {% block content %}
If you entered a web address, check it is correct.
You can browse from the homepage or use the search box above to find the information you need.
{% endblock %}


{% extends '_base.html' %}
{% block head_title %}Profile data - {{ block.super }}{% endblock %}
{% block head_javascript_extra %}
{% endblock %}
{% comment %}
At some point, we may end up needing to branch the profile page template
in order to support data available for different releases. And we may end up
with a special template for subtopic pages within a profile. This page provides
a profile-specific base suitable for applying things across that entire
family of pages.
{% endcomment %}


Home
Create
FAQ
Add Your Recipe
“If more of us valued food and cheer and song above hoarded gold, it would be a merrier world."
Add Recipe


Dear {{ first_name }} {{ last_name }},
This is reminder number {{ nag_count }}.
Please accept or reject your offer for {{ position_code }} {{
position_title }} for {{ hours }} hours via the link below.
https://{{ url }}
Thanks!


csv,conf,v6
Home
Schedule
Speakers
Code of Conduct
FAQ
Watch 2021 Talks
Toggle Gray Mode
{{ content }}


{{ _('Your password has been changed.') }}
{{ _('If you did not change your password,') }} {{ _('click here to reset it') }}.


A blocked or runny nose, a sore throat, headaches, muscle aches, coughs, sneezing, a raised temperature, pressure in your ears and face are the symptoms of cold.
1.Cook crab with grinded cumin.
2.Squeeze two lemon in one glass of boiling water and drink it before going to sleep at night after adding sugar.
3.Drink gooseberry arishtam regularly.
4.Steam using Eucalyptus oil in hot water.
5.Crush gramboo and eat it along with honey.
6.Mix sugar candy in the juice of thulasi and eat it.
7.Drink kashayam made using ginger and pepper.
8.Drink hot milk with a pinch of turmeric powder and pepper powder.
9.Drink honey along with the juice of thulasi and shallot.
Cough, Production of mucus (sputum), which can be clear, white, yellowish-gray or green in color - rarely, it may be streaked with blood, Fatigue, Shortness of breath, Slight fever and chills and Chest discomfort are the symptoms of bronchitis.
1.Eat two dhanwantharam pills in the morning in empty stomach and at 6'o clock in the evening along with hot cumin water.
2.Eat gorochanadi pills along with ginger juice three times a day after meal.
3.Powder pepper and sugar candy and eat it regularly.
Cough, Production of mucus (sputum), which can be clear, white, yellowish-gray or green in color - rarely, it may be streaked with blood, Fatigue, Shortness of breath, Slight fever and chills, Chest discomfort are the symptoms of asthama.
1.Drink ginger juice along with honey.
2.Mix jaggery with mustard oil and eat it regularly.
3.Powder pepper and sesame and eat it along with jaggery and honey.
4.Drink kayyonni juice along with powdered pepper.
5.Mix the juice of ginger along with thippili and himalyan salt and eat it.
6.Eat the juice of ash gourd along with crushed leaves of drumsticks.
7.Mix a spoon of honey and a hen egg along with milk and drink it.
8.Mix two teaspoon of thulasi juice along with honey and eat it regularly in empty stomach.
9.Grind touch-me-not and drink it regularly for 15 days along with coconut milk.
Cough, Production of mucus (sputum), which can be clear, white, yellowish-gray or green in color - rarely, it may be streaked with blood, Fatigue, Shortness of breath, Slight fever and chills, Chest discomfort are the symptoms of pneumonia.
1.Mix garlic juice in mustard oil and rub it on the back and chest. Also drink milk mixed with 2 ml of garlic juice.
2.Steam using camphor.
3.Rub turpentine on the chest.
4.Drink lot of lukewarm drinks.


HURLYBURLY (Fine Line) Directed by Anthony Drazan There's nothing intrinsically wrong with making a movie based on a Broadway hit; after all, such musicals as "The King and I," "Evita," "Grease" and "Oklahoma" were hugely successful on both stage and screen. Transferring a set-bound comedy-drama such as David Rabe's "Hurlyburly" is considerably more of a challenge. A high-voltage showcase for William Hurt, Sigourney Weaver, Harvey Keitel and Ron Silver when it debuted in New York in 1984, this is a work driven purely by Rabe's crackling conversations and the slowly mounting chaos inside a Hollywood home shared by a band of venomous, misogynstic film industry types whose behavior is fueled by a certain kind of "Bolivian health food" they constantly put up their noses. Though director Anthony Drazan has valiantly tried to pull the piece out of its stagey shell, it doesn't lend itself to being opened up. When the madness is all taking place in one room, as it does in the play, intensity is generated. When it's spread out across a variety of locations, the power of "Hurlyburly" is quickly diluted, despite a go-for-broke performance by Sean Penn and a typically sleek and cunning Kevin Spacey characterization of a heartless, self-adoring louse. Rabe's screenplay lifts large chunks of the dialogue verbatim from the original, but the same exchanges that had potent shock value in the theatre -- where it sometimes felt like the actors were spitting acid at each other -- doesn't carry the same power onscreen, and while Penn's Eddie does everything short of garroting himself to show how tormented he is, the man has no charm or charisma. Certainly it's impossible to imagine him attracting someone as seemingly bright as Darlene (Robin Wright Penn). Hurt's interpretation of Eddie had a much better balance of dark and light: He didn't feel the compulsion to unleash a few inner demons in every single scene. Part-time hooker Bonnie (a raunchy Meg Ryan, miles away from "You've Got Mail") says it best midway through the story when she tells Eddie, "I'm gonna need a magnifying glass to find what's left of your good points." Perhaps ultimately the problems of "Hurlyburly" go deeper than differences in acting styles and locations. It may be that the work belongs too much to the cocaine-crazed period in which it was written. Though Drazan and his cast nail the decadence and depravity of a setting in which no one has any qualms about using a teenage runaway (Anna Paquin) as a convenient sex toy, much of this material now seems as quaint as a "Just Say No" bumper sticker. James Sanford
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


WAG THE DOG 1997 A film review by Timothy Voon Copyright 1998 Timothy Voon 1 :-) for pure wanking fun
Cast: Robert De Niro, Dustin Hoffman, Anne Heche, Woody Harrelson, Denis Leary, Andrea Martin, Willie Nelson, Suzie Plakson, Kirsten Dunst, William H. Macy Director: Barry Levinson Screenplay: David Mamet & Hilary Henkin, based on the book by Larry Beinhart
What a silly name for a movie that's all about deception and the use of tele-media to deceive a nation (USA), in the upcoming Presidential Elections. The saying goes - a dog will wag it's tail, but if the tail is smarter than the dog, it will WAG THE DOG. I get it – meaning the president is the rear end and the American people are comparative to a dog's body. But wouldn't a better title be HOW MANY WAYS CAN YOU WANK A GREAT NATION?
The entire premise and punch line for the movie rests on the absurdly hilarious, although very possible situations created by the US Presidential Party into making their country believe that they are at war with another nation (Albania of all places). The idea is divert attention away from the President's sexual misconduct with a girl scout, in order to win the upcoming elections in the remaining few days. This is overall fun, especially the recreated scenes of an Albanian refugee (Kirsten Dunst) escaping from terrorist fire, the production of the sentimental, ever reliable war hero trapped behind enemy lines (Woody Harrelson), and Willie Nelson's wonderful song making talents used to recreate heart moving lyrical tunes about ‘Old Shoes'. The idea is refreshing and entertaining, but also a sad miscalculation by Barry Levinson (director), in relying so heavily on this one movie gimmick which eventually runs dry.
The Hollywood producer of the entire scam is Dustin Hoffman, who is not particularly exciting, but gets an Academy nomination for his performance anyway. Robert De Niro or Anne Heche are otherwise plausible as Presidential campaigners who work hard to win the election.
This movie explores some interesting intellectual, conceptual ideas about media brainwashing and how gullible we are as people. Did man truly walk on the moon, did everything about the Gulf War happen as we saw it on TV, or was it all just some contrived propaganda put there by some government funded movie studio? Probably not, but there may come a day when Big Brother will have the power to do so.
Timothy Voon e-mail<EMAIL_ADDRESS>http://us.imdb.com/M/reviews_by?Tim+Voon http://www.labyrinth.net.au/~bouclier/week/movies.html
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


News story
This week we launch our fourth annual survey to colleges, training organisations and employers.
We are keen to receive your feedback and views on how we have been performing.
Over the last 12 months we have worked very closely with the further education (FE) sector to improve the way we fund FE and skills training in England.
We have continued to simplify the funding system, introduced a streamlined performance management process in the funding year 2013 to 2014 and we continue to work with the FE sector to deliver more high-quality Apprenticeships and Traineeship opportunities, so learners can access the right level of skills that employers need to help the economy grow.
Moving forward to the next 12 months, it is important for us to recognise any areas of improvement in the way we operate and communicate and would welcome you taking a few minutes of your time to complete the survey , which is open until Friday, 25 July.
Published: 8 July 2014
From: Skills Funding Agency
Part of: Further education and training


Shakira to celebrate Latino culture and her birthday at Super Bowl
by Entertainment DeskREUTERS: Colombian pop superstar Shakira wants to make her performance at the 2020 Super Bowl a celebration of Latino culture – and her own birthday.
The three-time Grammy winner will be appearing at the widely watched halftime show on February 2, alongside singer and actor Jennifer Lopez, who is of Puerto Rican descent.
“I think that being at the Super Bowl … is very symbolic in a way, and I feel we have a great responsibility with the Latinos around the world,” Shakira told Reuters in her home city of Barcelona.
“There is a lot to celebrate about our Latin culture, and it is a great opportunity to be on this very important stage,” she added. The show will coincide with her 43rd birthday.
The National Football League’s Super Bowl championship, to be played in Miami, is the biggest annual event on U.S. television. The halftime show typically features some of the world’s most well-known performers. Last year’s telecast attracted 98.2 million viewers.
Shakira said she had struggled to get Latin music into the mainstream in the early days of her career in the 90s, but the scene had changed.
“I had to go through … a lot of obstacles back in the day … but now I think the situation is different, the atmosphere, the receptivity is great and it makes it so much easier to put out music in Spanish,” she said.
“I think there are a lot of amazing artists out there that deserve to be heard and don’t have to go through all that I went through back in the day.”
Shakira spoke to Reuters in the build up to the November 13 release of her film Shakira in Concert: El Dorado World Tour that will hit the cinemas in more than 60 countries for a one-night screening.
The 2018 tour marked a triumphant return for the artist after she suffered a vocal cord hemorrhage and had to delay the world tour twice. She said the tour reflected “a lot of vulnerability, but also perseverance”.


--- layout: archive title: Zulip Chat Archive permalink: /stream/113488-general/topic/Tail-call.20elimination.3F.html ---
Because I have no idea how the VM actually works I tempt asking a meaningless question here, but here we go regardless: does the VM do tail-call elimination? Will my IO reading loops eventually explode if left to their own devices for long enough?
I don't remember seeing that mentioned anywhere but that's a pretty basic optimization and Leo is pretty aggressive on optimization so I don't doubt he saw to it right away.
Lean 3's bytecode interpreter is quite basic. It does not do TCO.
However, io.iterate
needs only constant stack space: https://github.com/leanprover/lean/blob/28f4143be31b7aa3c63a907be5443ca100025ef1/src/library/vm/vm_io.cpp#L412
Last updated: Apr 24 2020 at 19:02 UTC


Say I have 3 Decepticons on the battlefield when I play Overwhelming Advantage. Can I put just 2 cards from my hand on top of my deck?
Yes. Each Plan is optional, so you could anywhere from 0 to 3 cards from your hand on top of your deck.
Do I have to choose one of my characters when I play Overwhelming Advantage?
Yes. Even if you have two characters with the right upgrades and you plan to attack with both of them during your turn, you choose which character will be affected when you play Overwhelming Advantage.
If I meet all the conditions listed in the second ability (WOOHOO!), and the 15 damage is enough to KO the defender, will my opponent flip battle cards?
No. As soon as the defender is KO’d, the attack ends.


SQL Injection Using UNION
UNION-based attacks allow the tester to easily extract information from the database. Because the UNION operator can only be used if both queries have the exact same structure, the attacker must craft a SELECT statement similar to the original query. To do this, a valid table name must be known but it is also necessary to determine the number of columns in the first query and their data type. To simplify learning, this article explains how it can be done when error reporting is enabled. However, the same principle would apply if it was not the case. For more information refer to the last section of the article.
Table Name Error
Guessing may be an option to find a table name that exists in the database (a good one in some cases), but let’s consider an approach that will guarantee successful results even if luck is not on your side. The best way to find such information is to use system tables instead of user tables. Even if database systems have different naming convention, the number of popular DBMS is really limited and a valid system table name can be found quickly. Notice that at this step, it is not even necessary to specify column names since a minimal SELECT statement can be used. Let’s now see how to get rid of a table name error with an example (this list of system tables was used):
User input (MySQL system table).
1 UNION SELECT 1 FROM information_schema.tables
Query generated.
SELECT name, description, price FROM products WHERE category=1 UNION SELECT 1 FROM information_schema.tables
Error returned.
ORA-00942: table or view does not exist.
This table name is not valid. Let’s try with system tables of another popular DBMS.
User input (Oracle system table).
1 UNION SELECT 1 FROM all_tables
Query generated.
SELECT name, description, price FROM products WHERE category=1 UNION SELECT 1 FROM all_tables
Error returned.
ORA-01789: query block has incorrect number of result columns.
An error is still returned but it is not related to an invalid table name. The attacker now knows a valid table and he can solve the problem related to the number of columns.
Number of Columns
There is basically 2 ways to find how many columns are selected by the original query. The first one is to inject an ORDER BY clause indicating a column number. Given the column number specified is greater than the number of columns in the SELECT statement, an error will be returned. Otherwise, the results will be sorted by the column mentioned. Let’s see both cases.
User input.
1 ORDER BY 2
Query generated (selects only 3 columns).
SELECT name, description, price FROM products WHERE category=1 ORDER BY 2
Result.
The data returned is sorted by description.
We know that the select statement has at least 2 columns. To find the exact number of columns, the number is incremented until an error related to the ORDER BY clause is returned.
Query generated (selects only 3 columns).
SELECT name, description, price FROM products WHERE id=1 ORDER BY 4
Error returned.
ORA-01785: ORDER BY item must be the number of a SELECT-list expression.
We can now conclude that the original query has 3 columns.
The alternative technique to determine the number of columns is to directly inject a new statement with UNION. The number of columns in the injected select is increased until the database engine does not return an error related to the number of columns. Even if this approach is perfectly valid, the first one is more popular.
Data Types
The last step is to determine the data type of each column of the original query. Some DBMS like MySQL and SQL Server are not strict on data types and will allow implicit numeric conversion. Also, in some cases comprehensive error messages can be returned by the database engine to indicate which column has a data type mismatch. In our example, the system uses Oracle which provide none of those "hits" for the attacker. However, after some tests the correct combination can be determined and the structure of the query is discovered.
User input.
1 UNION SELECT 'A', 'B', 3 FROM all_tables
Query generated.
SELECT name, description, price FROM products WHERE category=1 UNION SELECT 'A', 'B', 3 FROM all_tables
Result.
No error message is returned and data is listed.
With just 3 columns it is relatively easy to test the different cases (only 9 combinations). However when the number of columns is large the number of possible combinations exponentially grows. Fortunately, some tools like sqlmap can automate this process.
When doing manual testing, keep in mind that we can split data types in two groups: numeric values and the rest (considered as strings since they are enclosed between quotes). You do not need to test each and every type supported by the database engine.
Extracting Information
Let's now see how the attacker can take advantage of this UNION attack to extract sensible data. The first step is to gather information about the database schema by crafting a valid SELECT statement. It will allow the attacker to list user tables and find their column names. From this point, it is possible to retreive any information as long as the injected query follows the structure established earlier. Here is what the attacker could have done after finding table and column names.
Crafted parameter (extract username and passwords).
1 AND 1=2 UNION SELECT username, password, 1 FROM members
Query generated.
SELECT name, description, price FROM products WHERE category=1 AND 1=2 UNION SELECT username, password, 1 FROM members
Just a quick remark about the last example. An always false condition was added to the WHERE clause of the original query before the UNION operator. It is a common practice when extracting data. By doing so, the attacker makes sure that all the lines returned come from the injected query.
Data Type Conversion
It is possible that all the columns selected by the original query have the same data type. For example, only numeric values could be selected by the query. Extracting text values may seem infeasible but it is possible to overcome this problem by using conversion functions. For more information refer to articles about data conversion and concatenation.
Conclusion
By using the technique explained in this article, the attacker will be able to take advantage of SQL injection vulnerabilities in order to extract sensible information. It is important to mention that error reporting is not always enabled. In a situation where no database error is returned to the attacker, UNION-based SQL injections are still possible but the process of determining the main query’s structure will require blind SQL injection techniques.


Pat's Salmon Cookies
Cookies made from freshly caught salmon of the Pacific Northwest
About Us
Locations
Merchandise


@(salutation: Html, resetLink: String, logoUrl: String) @emailHtml( salutation, Html(s"""
Your Tododo password has been changed. If you weren't expecting this email then request a password reset at Tododo using the button below.
"""), Some(views.email.Button(resetLink, "Reset Password")), logoUrl)


The quickest way to get started is to point your html <script>
tag to a Google CDN URL.
This way, you don't have to download anything or maintain a local copy.
There are two types of angular script URLs you can point to, one for development and one for production:
To point your code to an angular script on the Google CDN server, use the following template. This example points to the minified version 1.2.0:
<!doctype html> <html ng-app> <head> <title>My Angular App</title> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0/angular.min.js"></script> </head> <body> </body> </html>
Note that only versions 1.0.1 and above are available on the CDN, if you need an earlier version you can use the http://code.angularjs.org/ URL which was the previous recommended location for hosted code source. If you're still using the angular server you should switch to the CDN version for even faster loading times.
This option is for those who want to work with angular offline, or those who want to host the angular files on their own servers.
If you navigate to http://code.angularjs.org/, you'll see a directory listing with all of the angular versions since we started releasing versioned build artifacts (quite late in the project lifetime). Each directory contains all artifacts that we released for a particular version.
Each directory under http://code.angularjs.org/ includes the following set of files:
angular.js
— This file is non-obfuscated, non-minified, and human-readable by
opening it it any editor or browser. In order to get better error messages during development, you
should always use this non-minified angular script.
angular.min.js
— This is a minified and obfuscated version of
angular.js
created with the Closure compiler. Use this version for production in order
to minimize the size of the application that is downloaded by your user's browser.
angular.zip
— This is a zip archive that contains all of the files released
for this angular version. Use this file to get everything in a single download.
angular-mocks.js
— This file contains an implementation of mocks that makes
testing angular apps even easier. Your unit/integration test harness should load this file after
angular.js
is loaded.
angular-scenario.js
— This file is a very nifty JavaScript file that allows you
to write and execute end-to-end tests for angular applications.
angular-loader.min.js
— Module loader for Angular modules. If you are loading multiple script files containing
Angular modules, you can load them asynchronously and in any order as long as you load this file first. Often the
contents of this file are copy&pasted into the index.html
to avoid even the initial request to angular-loader.min.js
.
See angular-seed for an example of usage.
Additional Angular modules: optional modules with additional functionality. These files should be loaded
after the core angular.js
file:
angular-animate.js
- Enable animation supportangular-cookies.js
- A convenient wrapper for reading and writing browser cookiesangular-resource.js
- Interaction support with RESTful services via the $resource serviceangular-route.js
- Routing and deeplinking services and directives for angular appsangular-sanitize.js
- Functionality to sanitize HTMLangular-touch.js
- Touch events and other helpers for touch-enabled devicesdocs
— this directory contains all the files that compose the
http://docs.angularjs.org/ documentation app. These files are handy to see the older version of
our docs, or even more importantly, view the docs offline.
i18n
- this directory contains locale specific ngLocale
angular modules to override the defaults
defined in the ng
module.


[![Heimdall Scanner](https://heimdall.maddevs.io/badge/github/<owner><repository>)](https://heimdall.maddevs.io/report/github/<owner><repository>)
Keeps track of the Mythril security reports and display their statuses as a badge in the repository.
Allows you to add the repository into the Heimdall registry that it is monitoring and reporting about
Heimdall does not generate reports but presents Mythril report in a nice and convenient way
https://heimdall.maddevs.io/badge/github/<owner><repository>
https://heimdall.maddevs.io/report/github/<owner><repository>
[![Heimdall Scanner](https://heimdall.maddevs.io/badge/github/<owner><repository>)](https://heimdall.maddevs.io/report/github/<owner><repository>)
<a href="https://heimdall.maddevs.io/report/github/<owner><repository>">
<img src="https://heimdall.maddevs.io/badge/github/<owner><repository>">

Whenever you disassemble or analyze binary code, Mythril will try to
resolve function names using its local signature database. The database
must be provided at ``~/.mythril/signatures.json``. You can start out
with the `default file <signatures.json>`__ as follows:
::
$ cd ~/.mythril
$ wget https://raw.githubusercontent.com/b-mueller/mythril/master/signatures.json
::
$ pip install -r requirements.txt
$ cd scanner
https://github.com/settings/tokens
Take certificate from Project Settings -> Service account -> Generate new private key
Place this certificate inside project root.
Take certificate from Project Settings -> Service account -> Generate new private key
Place this certificate inside project root.
$ gunicorn main:run --bind localhost:8000 --worker-class aiohttp.GunicornWebWorker -e GITHUB_TOKEN=<token_here> -e FIREBASE_CERTIFICATE=<FIREBASE_CERTIFICATE_PATH> -e FIREBASE_DATABASE=<FIREBASE_DATABASE> -t 200 --reload
[![Heimdall Scanner](https://heimdall.maddevs.io/badge/github/<owner><repository>)](https://heimdall.maddevs.io/report/github/<owner><repository>)


Lidl is selling real Christmas trees this year - this is how much they cost
It's not long until many will be buying their trees
by Ella BuxtonAre you feeling festive? Well you are in luck, because Lidl’s real Christmas trees are back.
The budget supermarket is selling Nordmann Fir trees for £18.99 in a decorative pot, or freshly cut for £17.99.
But this year is bigger and better as shoppers can benefit from a 6ft tree for £24.99.
And according to the retailer, their trees have strong pine needles which means less shedding to save you from vaccuuming.
Lid’s trees are sourced from the Scottish Highlands, where they have been grown in 2,000 acres of rich green woodland.
They’re also 'LEAF' certified meaning they have been sustainably grown with consideration and care for the surrounding countryside and wildlife.
The trees will go on sale from Thursday, November 28 while stocks last.
Once shoppers have purchased a tree, they can find out exactly where it was grown using a special tree tracker.
Keeping with the festive theme, Lidl are also selling wreaths and festive poinsettia, so you can get all your Christmas decorations in one place.
For the latest news in and around Bristol, visit and bookmark Bristol Live's homepage


Here, the project is at an early stage. The user can pick up three different gifts and throw at the tree. No fire is exisiting at this stage of the project.
The tree with the three different gifts. Here, you can see the first image target that was used before a Christmas stand was 3D-printed.
A user testing the game for the first time.
These two models are the first models of the Christmas stand that were 3D-printed.
This screen is the first thing the user sees when playing the game.
Here, the user gets instructions on how to play the game.
Here, fire is being implemented to the game to make the tree catch fire when throwing gifts at it. At first there was to much fire everywhere!
Users testing the finished game at the Open House the 13th of December 2019
User testing the game. Here, you can see that we also made an image target using an image of a carpet, insted of a 3D-printed model
User testing the game. Here, you see the 3D-printed model being used as the image target.
This is the screen that the user sees when all the gifts has successfully been tossed on the tree and the game is done.


Sharapova Case
The five-time tennis Grand Slam champion, has been handed a two-year ban after failing a drugs test at the Australian Open in January. The 29-year-old Russian took meldonium, a commonly-used heart disease drug, for a period of time which overlapped the 1 January 2016 cut-off date, when it was added to the World Anti-Doping Agency’s (Wada) banned list. At an anti-doping hearing in London on Wednesday, Sharapova was informed by the International Tennis Federation (ITF) that she would be banned for two years as meldonium is a metabolic modulator which increases stamina and endurance. ITF statement in full as Sharapova is handed two-year anti-doping ban Sharapova, who won Wimbledon in 2004, has avoided the maximum four-year ban after Wada admitted earlier this year that scientists could not determine how long the drug remained in the user’s system after it had been taken. It is reported that Sharapova will now appeal against the ban, which has been backdated to 26 January 2016, at the Court of Arbitration for Sport.
Query Words: sharapova maria doping
Tweets per Day
Contains the count of tweets submitted every day during the researching period.
Sentiment per Month
Contains information about the scores of six basic sentiments (Anger, Disgust, Fear, Joy, Sadness & Surprise) on each month.
Infobox
54.284
54.284 distinct tweets
480
480 distinct Youtube comments
30.865
30.865 distinct users (30.425 from Twitter and 440 from YouTube)
33.054
33.054 distinct words
01/06/2016 to 30/09/2016
The time frame of the data is 4 months
Sentiment: Anger
The overall score of our sentiment analysis indicated the main sentiment of the users was Anger.
Most Frequent Words
Contains the most frequent distinct words as extracted from the final data during the researching period.
| # | Word | Frequency |
|---|---|---|
| 1 | sharapova | 55653 |
| 2 | maria | 30307 |
| 3 | year | 14925 |
| 4 | ban | 13106 |
| 5 | tennis | 12393 |
| 6 | doping | 7202 |
| 7 | 4531 | |
| 8 | suspended | 4117 |
| 9 | serena | 4015 |
| 10 | test | 3371 |
Most Frequent Hashtags
Contains the most frequent distinct hashtags as extracted from the final data. The table shows the top-10 along with their frequencies.
| # | Hashtag | Frequency |
|---|---|---|
| 1 | #Sharapova | 5629 |
| 2 | #MariaSharapova | 2887 |
| 3 | #Tennis | 2558 |
| 4 | #WTA | 2247 |
| 5 | #mariasharapova | 1041 |
| 6 | #tennis | 681 |
| 7 | #SerenaWilliams | 471 |
| 8 | #serenawilliams | 406 |
| 9 | #sharapova | 322 |
| 10 | #Photo | 312 |
Most Frequent Users
Contains the most frequent distinct users as extracted from the final data. The table shows the top-10 users along with their frequencies.
| # | User | Frequency |
|---|---|---|
| 1 | @NovakDjokovic_i | 2098 |
| 2 | @Sharapova_Team | 794 |
| 3 | @GodLabz | 442 |
| 4 | @adrianaeloca | 367 |
| 5 | @alieujr | 352 |
| 6 | @team_sharapova | 342 |
| 7 | @marac00per | 327 |
| 8 | @alexielsi | 268 |
| 9 | @0l1l2 | 218 |
| 10 | @l5iza | 216 |
Most Frequent Mentions
Contains the most frequent distinct mentions as extracted from the final data. The table shows the top-10 mentions along with their frequencies.
| # | Mention | Frequency |
|---|---|---|
| 1 | @MariaSharapova | 1165 |
| 2 | @Youtube | 243 |
| 3 | @team-sharapova | 204 |
| 4 | @Nike | 181 |
| 5 | @ITF_Tennis | 115 |
| 6 | @AP | 100 |
| 7 | @ESPN | 81 |
| 8 | @serenawilliams | 72 |
| 9 | @USATODAY | 69 |
| 10 | @SportsCenter | 59 |


As part of energy monitoring service ( free commercial trial) I'm working on I would like to install several CT sensors for use later. While I am familar with electrical services, I plan to use a local electrian to open the boxs and install CT sensors (pub has 3 phase supply four panels - quite complex). Ideally the sensors would be clipped onto cables inside electrical panels, labled and left tied up out-side for use by myself as trail system is built ( leaving me with some time to develop system).
I'm using Yhdc SCT-013-000 current transfomer Transient-voltage Suppressor, with EmonTX, Emonbase, Emoncms and may integrate towards Raspberry Pi ( just arrived but thats another story).
Question is about safety, the Yhdc SCT-013-000 has a Transient-voltage Suppressor so I assume this setup should be ok. However I'm still a be worried about leaving these clipped around cables carrying up to 80Amps (worst case) for weeks.
Looking forward to your comments
Cheers
Peter
Re: Current Transformer
PeterN
Don't do that. I think the 'Transient-voltage Suppressor' isn't that specifically, though it will function as such but it won't protect the emonTx input, I think it's only there to prevent dangerously high voltages if there's no connection to the c.t. The best solution would be to leave the c.t.s loose in the panel to be clipped on later. Failing that, short them but make sure the circuit is dead before you remove the short and plug them in to the emonTx, else you'll get 20 V or so at whatever current the c.t. can muster. It might not do you a lot of damage but if it touched the wrong part of the emonTx first, you could easily have a dead emonTx.
Re: Current Transformer
Hi Robert, thanks for comments, I suspected as much. However I had hoped worst case was that I would have to build a dummy CT plug with burden resistor and then swap over to system emontx as they are needed or not. The issue is basically I will use electrician to access the cables within two bespoke panels and would like to be able to connect quite a few CTs to the cable when electrician is present for use as I see fit during trial. The alternatives is to get an electrian back each time I need to connect new CT or else open panel myself once I become more fimilar with this layout.
I had assumed that it would be normal enough to plug in and out of emontx without unclipping from cable (oops done this serveral times already on home system). Would dummy CT plugs terminated with burden resistors be sufficient and be careful pluging into emontx e.g. emontx in battery enclosure would mean they won't touch off other components.
Cheers
Peter
Re: Current Transformer
There would be no real personal safety issue if you left the c.t's open circuit, but for the fact that one of our forum members has a 30A version, which has a built-in burden, and when he received it the soldering was so ropey that the burden was open-circuit. So to avoid damage to the c.t, or anybody else, I'd simply short them until you are ready to connect. I wouldn't even bother with a dummy burden, c.t's are quite happy working into a solid short circuit (just as 'ordinary' voltage transformers are quite happy working into an open circuit). It's open circuits they don't like (they can either be permanently magnetised if it's an iron core, or they'll flash over).
If you could make sure the circuit was unloaded or only lightly loaded when swapping from the shorting socket to the emonTx, there should be no problem, but you only need 18 A to clip the output at 22 V with the zener diodes.
Make sure all the c.t's face the same way when you're installing them - see the notes in Building Blocks, else you'll have some showing +ve power and some -ve!
Re: Current Transformer
Thanks Robert. That's sound good. I'll build a few short cct. jack sockets. I'm sure I can get access during low usage period to add to emontx.
I've been caught out on that before CTs facing wrong way before, giving negative values and now I lable them with permenant marker. Cheers Peter


OptionScanFileArg
| Syntax | ||
| char *OptionScanFileArg(FILE *file); | ||
| Header | ||
| base/option.h | ||
| Library | ||
| opt | ||
| Description | ||
The The option is read from the stream pointed to by the argument fp. Line beginning with the '#' symbol are ignored and leading spaces are ignored. The memory used to store the text string should be freed when it is no longer used. | ||
| Returns | ||
Returns a pointer to a zero terminated text string containing one command line option. On error, NULL is returned. | ||
| Errors | ||
On error, NULL is returned. | ||
| Example | ||
|


public abstract class BitsApp
extends Activity
| Modifier and Type | Field and Description |
|---|---|
static Context |
mAppContext
Default: null
Androids app context. |
static java.lang.String |
mAppName |
static float[] |
mClearColor
Default: {0, 0, 0, 1.0}
Use the static 'setClearColor' method to set the color easily. |
static int |
mGameHeight
Default: 480
Height of the game itself. |
static int |
mGameWidth
Default: 800
Width of the game itself. |
static BitsApp |
mInstance
Default: null
A reference to the BitsApp class instance. |
static int |
mMaxCircleRenderables |
static int |
mMaxCyclesPerSecond
Default: 60
This values defines the cap of the frame rate. |
static int |
mMaxFontCount |
static int |
mMaxImageCount
Default: 32
The max. number of images that will be available in the image pool. |
static int |
mMaxImageRenderables
Default: 64
The max. number of images in the render queues (double buffering). |
static int |
mMaxLineRenderables |
static int |
mMaxRectRenderables |
static int |
mMaxSoundsAtOnce
Default: 10
This value defines how many sound files may be played at the same time. |
static int |
mMaxTouchPointer
Default: 2
The maximum number of fingers that may lie at the same time on the display. |
static int |
mOrientationMode
Default: ORIENTATION_BY_SENSOR
Apps orientation mode. |
static float |
mScaleFactor
Default: 1.0f
Rate of scaling that occurs if the game renders itself. |
static int |
mSleepMode
Default: SLEEP_MODE_ON
This value handles the sleep mode. |
static BitsFont |
mSystemFont
Default: calibri.bff
This is the BitsEngines default font. |
static boolean |
mUseMusic
Default: true
This value defines the usage of music. |
static boolean |
mUseSound
Default: true
This value defines the usage of sounds. |
static int |
mViewportHeight
Default: 1
Height of the render surface. |
static int |
mViewportWidth
Default: 1
Width of the render surface. |
static boolean |
mWantFullscreen
Default: true
Display androids status bar? |
static boolean |
mWantTitleBar
Default: false
Display androids app title bar? |
static int |
ORIENTATION_BY_SENSOR
App will change it's orientation by the internal sensors.
|
static int |
ORIENTATION_LANDSCAPE
App will start in landscape mode and change it's orientation by the internal sensors.
|
static int |
ORIENTATION_PORTRAIT
App will start in portrait mode and change it's orientation by the internal sensors.
|
static boolean |
showFPS
Default: true
If set to 'true' the app will render the frame rate in the upper left corner of the screen. |
static int |
SLEEP_MODE_DIM
App will allow to dim the screen, but not to turn it off.
|
static int |
SLEEP_MODE_OFF
App will keep the screen on.
|
static int |
SLEEP_MODE_ON
App will allow to dim and turn of the display.
|
| Constructor and Description |
|---|
BitsApp() |
| Modifier and Type | Method and Description |
|---|---|
void |
onBackPressed() |
void |
onConfigurationChanged(Configuration config) |
void |
onCreate(Bundle savedInstanceState) |
public static final int ORIENTATION_BY_SENSOR
public static final int ORIENTATION_LANDSCAPE
public static final int ORIENTATION_PORTRAIT
public static final int SLEEP_MODE_ON
public static final int SLEEP_MODE_DIM
public static final int SLEEP_MODE_OFF
public static int mSleepMode
public static Context mAppContext
public static java.lang.String mAppName
public static BitsApp mInstance
public static int mViewportWidth
public static int mViewportHeight
public static int mGameWidth
public static int mGameHeight
public static float mScaleFactor
public static BitsFont mSystemFont
public static boolean mWantTitleBar
public static boolean mWantFullscreen
public static int mOrientationMode
public static int mMaxImageCount
public static int mMaxFontCount
public static int mMaxImageRenderables
public static int mMaxLineRenderables
public static int mMaxRectRenderables
public static int mMaxCircleRenderables
public static int mMaxTouchPointer
public static int mMaxSoundsAtOnce
public static boolean mUseSound
public static boolean mUseMusic
public static int mMaxCyclesPerSecond
public static boolean showFPS
public static float[] mClearColor


Array and Hashes
data containers
The thrust of the Ruby programming language is that it focuses on data input as objects. Ruby instructs some of those objects to interact with other objects by defining the type of object it is and what abilities or skills it posseses in the form of methods. The intent is to take data input and store it according to its identity and function using a specific method to decide where and how the data should be arranged for later use.
When you are working with 'collections' of data objects you treat them differently than individual data objects by managing them inside of special class of 'container' objects. In Ruby, Arrays and Hashes dominate the container class and serve to enable large data storage. Both create, manipulate, and transform collections of data-objects. There are similarities and differences between Arrays and Hashes, and times when one is better suited for a task than the other.
An Array is an ordered collection of data objects with a consistent, consecutive numberical index which dictates how its' objects are stored and retrieved. Arrays will accept an assortment of input objects such as strings, arrays, hashes, classes, true/false, etc... and will also accepte single objects, integers, pairs, and clusters. Then the data can be transformed into a list. And, interestingly, Arrays are used in the design of a hash.
A Hash is a powerful way of storing and retrieving data in pairs. Each pair is identified as a 'key' with a corresponding 'value'. But, unlike the Array, the Hash is more restrictive. Each key in the pair must be unique in that particular Hash. And each key must have a value and confine itself as a pair. The value of the pair, however, does not have to be unique in that Hash, and may be duplicated. In addition, the Hash will remember the order in which the key/value pairs were inserted. Because of this key/value structure a Hash is descriptively associated with a dictionary.
 And Hashes mimic Arrays because their indices can be anything. At times one may also transform into the other. When certain operations of selection or extraction are performed on pairs in a Hash you will get back an Array. Such as turning a flat array ([5, 6, 7, 8]), into, a Hash ({5 => 6, 7 => 8}).
The hierarchy for creation of an Array and a Hash are similar but differ in order of common usages:
CREATING AN ARRAY
CREATING A HASH
#example of an array
grocery_list = ["milk", "eggs", "vodka"]
#example of a hash
phone_numbers = {"Susan" =><PHONE_NUMBER>, "Jeff" =><PHONE_NUMBER>, "emergency" => 911}
Both Array and Hashes are major core container classes that serve objects in Ruby to organize, identitfy, distribute, and manipulate data on a large scale. Both are suited to behave as powerhouse data storage.


The entries in the "Action" column of the tables below specify the default disposition for each signal, as follows:
A process can change the disposition of a signal using sigaction(2) or signal(2). (The latter is less portable when establishing a signal handler; see signal(2) for details.) Using these system calls, a process can elect one of the following behaviors to occur on delivery of the signal: perform the default action; ignore the signal; or catch the signal with a signal handler, a programmer-defined function that is automatically invoked when the signal is delivered. (By default, the signal handler is invoked on the normal process stack. It is possible to arrange that the signal handler uses an alternate stack; see sigaltstack(2) for a discussion of how to do this and when it might be useful.)
The signal disposition is a per-process attribute: in a multithreaded application, the disposition of a particular signal is the same for all threads.
A child created via fork(2) inherits a copy of its parent's signal dispositions. During an execve(2), the dispositions of handled signals are reset to the default; the dispositions of ignored signals are left unchanged.
Each thread in a process has an independent signal mask, which indicates the set of signals that the thread is currently blocking. A thread can manipulate its signal mask using pthread_sigmask(3). In a traditional single-threaded application, sigprocmask(2) can be used to manipulate the signal mask.
A child created via fork(2) inherits a copy of its parent's signal mask; the signal mask is preserved across execve(2).
A signal may be generated (and thus pending) for a process as a whole (e.g., when sent using kill(2)) or for a specific thread (e.g., certain signals, such as SIGSEGV and SIGFPE, generated as a consequence of executing a specific machine-language instruction are thread directed, as are signals targeted at a specific thread using pthread_kill(3)). A process-directed signal may be delivered to any one of the threads that does not currently have the signal blocked. If more than one of the threads has the signal unblocked, then the kernel chooses an arbitrary thread to which to deliver the signal.
A thread can obtain the set of signals that it currently has pending using sigpending(2). This set will consist of the union of the set of pending process-directed signals and the set of signals pending for the calling thread.
A child created via fork(2) initially has an empty pending signal set; the pending signal set is preserved across an execve(2).
First the signals described in the original POSIX.1-1990 standard.
| Signal | Value | Action | Comment |
| or death of controlling process | |||
| SIGINT | 2 | Term | Interrupt from keyboard |
| SIGQUIT | 3 | Core | Quit from keyboard |
| SIGILL | 4 | Core | Illegal Instruction |
| SIGABRT | 6 | Core | Abort signal from abort(3) |
| SIGFPE | 8 | Core | Floating point exception |
| SIGKILL | 9 | Term | Kill signal |
| SIGSEGV | 11 | Core | Invalid memory reference |
| SIGPIPE | 13 | Term | Broken pipe: write to pipe with no |
| readers | |||
| SIGALRM | 14 | Term | Timer signal from alarm(2) |
| SIGTERM | 15 | Term | Termination signal |
| SIGUSR1 | 30,10,16 | Term | User-defined signal 1 |
| SIGUSR2 | 31,12,17 | Term | User-defined signal 2 |
| SIGCHLD | 20,17,18 | Ign | Child stopped or terminated |
| SIGCONT | 19,18,25 | Cont | Continue if stopped |
| SIGSTOP | 17,19,23 | Stop | Stop process |
| SIGTSTP | 18,20,24 | Stop | Stop typed at terminal |
| SIGTTIN | 21,21,26 | Stop | Terminal input for background process |
| SIGTTOU | 22,22,27 | Stop | Terminal output for background process |
The signals SIGKILL and SIGSTOP cannot be caught, blocked, or ignored.
Next the signals not in the POSIX.1-1990 standard but described in SUSv2 and POSIX.1-2001.
| Signal | Value | Action | Comment |
| SIGPOLL | Term | Pollable event (Sys V). | |
| Synonym for SIGIO | |||
| SIGPROF | 27,27,29 | Term | Profiling timer expired |
| SIGSYS | 12,31,12 | Core | Bad argument to routine (SVr4) |
| SIGTRAP | 5 | Core | Trace/breakpoint trap |
| SIGURG | 16,23,21 | Ign | Urgent condition on socket (4.2BSD) |
| SIGVTALRM | 26,26,28 | Term | Virtual alarm clock (4.2BSD) |
| SIGXCPU | 24,24,30 | Core | CPU time limit exceeded (4.2BSD) |
| SIGXFSZ | 25,25,31 | Core | File size limit exceeded (4.2BSD) |
Up to and including Linux 2.2, the default behavior for SIGSYS, SIGXCPU, SIGXFSZ, and (on architectures other than SPARC and MIPS) SIGBUS was to terminate the process (without a core dump). (On some other UNIX systems the default action for SIGXCPU and SIGXFSZ is to terminate the process without a core dump.) Linux 2.4 conforms to the POSIX.1-2001 requirements for these signals, terminating the process with a core dump.
Next various other signals.
| Signal | Value | Action | Comment |
| SIGEMT | 7,-,7 | Term | |
| SIGSTKFLT | -,16,- | Term | Stack fault on coprocessor (unused) |
| SIGIO | 23,29,22 | Term | I/O now possible (4.2BSD) |
| SIGCLD | -,-,18 | Ign | A synonym for SIGCHLD |
| SIGPWR | 29,30,19 | Term | Power failure (System V) |
| SIGINFO | 29,-,- | A synonym for SIGPWR | |
| SIGLOST | -,-,- | Term | File lock lost (unused) |
| SIGWINCH | 28,28,20 | Ign | Window resize signal (4.3BSD, Sun) |
| SIGUNUSED | -,31,- | Core | Synonymous with SIGSYS |
(Signal 29 is SIGINFO / SIGPWR on an alpha but SIGLOST on a sparc.)
SIGEMT is not specified in POSIX.1-2001, but nevertheless appears on most other UNIX systems, where its default action is typically to terminate the process with a core dump.
SIGPWR (which is not specified in POSIX.1-2001) is typically ignored by default on those other UNIX systems where it appears.
SIGIO (which is not specified in POSIX.1-2001) is ignored by default on several other UNIX systems.
Where defined, SIGUNUSED is synonymous with SIGSYS on most architectures.
The Linux kernel supports a range of 32 different real-time signals, numbered 33 to 64. However, the glibc POSIX threads implementation internally uses two (for NPTL) or three (for LinuxThreads) real-time signals (see pthreads(7)), and adjusts the value of SIGRTMIN suitably (to 34 or 35). Because the range of available real-time signals varies according to the glibc threading implementation (and this variation can occur at run time according to the available kernel and glibc), and indeed the range of real-time signals varies across UNIX systems, programs should never refer to real-time signals using hard-coded numbers, but instead should always refer to real-time signals using the notation SIGRTMIN+n, and include suitable (run-time) checks that SIGRTMIN+n does not exceed SIGRTMAX.
Unlike standard signals, real-time signals have no predefined meanings: the entire set of real-time signals can be used for application-defined purposes.
The default action for an unhandled real-time signal is to terminate the receiving process.
Real-time signals are distinguished by the following:
If both standard and real-time signals are pending for a process, POSIX leaves it unspecified which is delivered first. Linux, like many other implementations, gives priority to standard signals in this case.
According to POSIX, an implementation should permit at least _POSIX_SIGQUEUE_MAX (32) real-time signals to be queued to a process. However, Linux does things differently. In kernels up to and including 2.6.7, Linux imposes a system-wide limit on the number of queued real-time signals for all processes. This limit can be viewed and (with privilege) changed via the /proc/sys/kernel/rtsig-max file. A related file, /proc/sys/kernel/rtsig-nr, can be used to find out how many real-time signals are currently queued. In Linux 2.6.8, these /proc interfaces were replaced by the RLIMIT_SIGPENDING resource limit, which specifies a per-user limit for queued signals; see setrlimit(2) for further details.
A signal handler function must be very careful, since processing elsewhere may be interrupted at some arbitrary point in the execution of the program. POSIX has the concept of "safe function". If a signal interrupts the execution of an unsafe function, and handler calls an unsafe function, then the behavior of the program is undefined.
POSIX.1-2004 (also known as POSIX.1-2001 Technical Corrigendum 2) requires an implementation to guarantee that the following functions can be safely called inside a signal handler:
_Exit() _exit() abort() accept() access() aio_error() aio_return() aio_suspend() alarm() bind() cfgetispeed() cfgetospeed() cfsetispeed() cfsetospeed() chdir() chmod() chown() clock_gettime() close() connect() creat() dup() dup2() execle() execve() fchmod() fchown() fcntl() fdatasync() fork() fpathconf() fstat() fsync() ftruncate() getegid() geteuid() getgid() getgroups() getpeername() getpgrp() getpid() getppid() getsockname() getsockopt() getuid() kill() link() listen() lseek() lstat() mkdir() mkfifo() open() pathconf() pause() pipe() poll() posix_trace_event() pselect() raise() read() readlink() recv() recvfrom() recvmsg() rename() rmdir() select() sem_post() send() sendmsg() sendto() setgid() setpgid() setsid() setsockopt() setuid() shutdown() sigaction() sigaddset() sigdelset() sigemptyset() sigfillset() sigismember() signal() sigpause() sigpending() sigprocmask() sigqueue() sigset() sigsuspend() sleep() sockatmark() socket() socketpair() stat() symlink() sysconf() tcdrain() tcflow() tcflush() tcgetattr() tcgetpgrp() tcsendbreak() tcsetattr() tcsetpgrp() time() timer_getoverrun() timer_gettime() timer_settime() times() umask() uname() unlink() utime() wait() waitpid() write()
POSIX.1-2008 removes fpathconf(), pathconf(), and sysconf() from the above list, and adds the following functions:
execl() execv() faccessat() fchmodat() fchownat() fexecve() fstatat() futimens() linkat() mkdirat() mkfifoat() mknod() mknodat() openat() readlinkat() renameat() symlinkat() unlinkat() utimensat() utimes()
Which of these two behaviors occurs depends on the interface and whether or not the signal handler was established using the SA_RESTART flag (see sigaction(2)). The details vary across UNIX systems; below, the details for Linux.
If a blocked call to one of the following interfaces is interrupted by a signal handler, then the call will be automatically restarted after the signal handler returns if the SA_RESTART flag was used; otherwise the call will fail with the error EINTR:
The following interfaces are never restarted after being interrupted by a signal handler, regardless of the use of SA_RESTART; they always fail with the error EINTR when interrupted by a signal handler:
The sleep(3) function is also never restarted if interrupted by a handler, but gives a success return: the number of seconds remaining to sleep.
The Linux interfaces that display this behavior are:


ClipPath()
语法
ClipPath([Flags])概要
Clip the vector drawing output to the area defined by the current vector drawing path. Future drawing operations will only affect areas within the current path. The clipping will be combined with any clipping that previously existed on the drawing output.
By default, the path is reset after calling this function. This can be prevented with the appropriate flags.
参数
Flags (可选) Can be one of the following values: #PB_Path_Default : No special behavior (default value) #PB_Path_Preserve : Don't reset the path after this function
返回值
无.
备注
There is no "UnclipPath()" function: The clipping region of the drawing output can only be made smaller by adding further clipping, it cannot be made larger again. However, the clipping region can be saved and restored using the SaveVectorState() and RestoreVectorState() functions respectively. So in order to apply temporary clipping to the drawing output, first save the drawing state and later restore it to go back to the original clipping regions.
示例
If OpenWindow(0, 0, 0, 400, 200, "VectorDrawing", #PB_Window_SystemMenu | #PB_Window_ScreenCentered) CanvasGadget(0, 0, 0, 400, 200) LoadFont(0, "Times New Roman", 20, #PB_Font_Bold) If StartVectorDrawing(CanvasVectorOutput(0)) ; Setup a complex clipping path with nested ellipses (every second one will be clipped) For i = 10 To 150 Step 5 AddPathEllipse(200, 100, 2*i, i) Next i ClipPath() ; Draw some text with this clipping VectorFont(FontID(0), 150) VectorSourceColor(RGBA(255, 0, 0, 255)) MovePathCursor(50, 25) DrawVectorText("Text") StopVectorDrawing() EndIf Repeat Event = WaitWindowEvent() Until Event = #PB_Event_CloseWindow EndIf
参阅
已支持操作系统
所有


Whoops! Page not found
It's looking like you may have taken a wrong turn. Don't worry... it happens to the best of us. You might want to check your internet connection. Here's a little tip that might help you get back on track.
Back to DashboardIt's looking like you may have taken a wrong turn. Don't worry... it happens to the best of us. You might want to check your internet connection. Here's a little tip that might help you get back on track.
Back to Dashboard