DJSON - ChangeLog
We just updated the extension... check out what's new!!!
v0.6.0 (latest) - 23/03/2019
- Added developer utilities in the popup like hash, encode, time, string, numbers
- Ability to keep the popup in a new tab
v0.5.0 - 17/03/2019
- Added line numbers - you can hide them from the configuration panel
v0.4.5 - 16/03/2019
- MD5 strings from input popup or context menu
- Fixed view json popup since changes on Chrome 72
- Fixed copy value for booleans
v0.4.4 - 24/06/2017
- Option to start with collapsed JSON if the file is big (>1MB)
- Fixed slashed encoding in recognized nested JSON strings in properties value
- Collapse All button will start from the first tree level
v0.4.3 - 05/06/2017
- Simplified the view json flow. Now it will always open a new tab
- Recognize nested JSON strings in properties value
- Start with collapsed JSON will start from the first tree level
v0.4.2 - 02/05/2017
- Added option to show always the number of items in collections
- Option to start with collapsed JSON now has no downsides
- Optimized collapse action
v0.4.1 - 23/04/2017
- Context menu enabled by default
- More context menu functions (copy key, copy value, open selected json)
- Initial support to view selected json using strip slashes
v0.4.0 - 15/04/2017
- Options in a new page
- Context menu for copy JSON path
- Option to start to view the JSON as collapsed


---
layout: post
title: BD running as root
tags: []
status: publish
type: post
published: true
meta: {}
---
David Epler and Jim Dew have posted two solutions to changing the default user account that BD uses to run on a *nix system (namely root!!). You can read up on their solutions here. New Atlanta and the people on the mailing list are truly an amazing bunch.
When you have a moment why not check out David's presentation on an alternative to LAMP: LAMBDA.


{{mailDetailCtrl.mail.email}}
{{mailDetailCtrl.mail.dtReceived | date:'dd.MM.yy'}}
{{mailDetailCtrl.mail.text}}


Vendor Details Information
General Information
Shop Name
Company Name
Representative Name
Company Address
Product Category
Local
International
Main Contact
Name on Card
ID Card Number
Email Address
Phone Number (With Area Code)
Mobile Number
Comission Rate
Category Comission
Product (2%)
Service (10%)
Percentage
Payment Information
Bank Name
Account Number
Name On Bank Account
Paypal ID
Operation Information
Store Location
Store Contact Number
Store Location
Store Contact Number
Next


Coldplay to put touring on hold over environmental concerns
by Wade SheridanNov. 21 (UPI) -- Coldplay frontman Chris Martin announced the band will not be touring in support of their new album Everyday Life, citing how tours impact the environment.
"We're taking time over the next year or two, to work out how our tour can not only be sustainable [but] how can it be actively beneficial," Martin told BBC News on Thursday.
Coldplay will instead be holding two concerts in Jordan starting Friday with the shows being made available on YouTube.
The band last toured in 2016 and 2017 in support of their album A Head Full of Dreams.
"Our next tour will be the best possible version of a tour like that environmentally," Martin said. "We would be disappointed if it's not carbon neutral."
Martin also expressed wanting to have concerts that have no single use plastic and is mainly solar powered.
Everyday Life will include the singles "Daddy" and "Orphans."
Coldplay released on Wednesday an animated music video for "Daddy" that used 2D animation and puppets.


Blacksmith Hilda:
Where should I begin? First I must melt it in the furnace to separate the impurities and extract pure Vacualite. Then, once cooled... It's done!
Here it is! Take this Vacualite to
Klein
.


Hi, my name is Ryan Johnston.
I'm a software developer at Amazon and graduate of the University of Michigan where I studied Computer Science Engineering. I've been coding for over eight years and have had lots of great experience in industry through various internships and research. I also enjoy teaching computer science and had the opportunity to serve as an IA at my alma mater. Most of all I just love coding and enjoy attending hackathons, coding my own side projects and staying up to date on all the latest development. I'm always looking for ways to make the world a better place through computer science.
ResumeLess Proficient
More Proficient
Less Proficient
More Proficient
SlideSync is a lecture web application with main features of synchronized slides, collaborative note taking, and a chat. As part of the MHacks11 Hackathon, my team and I designed this project in 36 hours. We heavily leveraged ReactJS, Google Firebase, and Twilio to create this. I'm particularly proud of how neat the code was kept and how polished the features turned out to be despite this being a hackathon project.
Demo SourceBigChat is a Google chrome extension to bring chat functionality to every site. This project was started at the MHacks12 Hackathon but my team and I are continuing development. We plan to improve the interface as well as add additional sync functionality for sites with video such as Netflix. I'm particularly proud of the low chat latency and custom chat UI. Source
The IoT Asset Tracker is a proof-of-concept decentralized application designed to run on the Ethereum platform. It’s an adaptation on a simple bidding application made to allow IoT device owners to list their data for sale. The front-end was designed with ReactJS and it connects to a custom smart contract written in Solidity. I'm particularly proud of how this project leverages asynchronous calls to accomodate for Ethereum transaction times.
SourceI designed this site from scratch using HTML5/CSS3 and the Bootstrap framework with the goal of making it lightweight and easy to navigate. This site is a continual work-in-progress and I try to update it often with new accomplishments and different design trends that interest me.
Sourcer4 Technologies | Developer Operations Intern | Summer 2016-18
r4 is a data science company leading in cross-enterprise artificial intelligence. For three summers I have worked in developer operations designing and implementing tools for its server infrastructure. Many of my solutions are used daily on production environments. This experience taught me how to effectively automate processes as well as general Linux troubleshooting.
Lunds Tekniska Högskola | Research Assistant | Summer 2018
Lunds Tekniska Högskola (LTH) is a top-ranking University in Sweden. For two months I researched blockchain technology and decentralized applications, specifically with the Ethereum platform. In addition to designing the IoT Asset Tracker described above, my partner and I also automated setup of a private Ethereum network and researched many of the possible use cases and short comings of Ethereum. We presented our findings to the faculty and wrote detailed documentation for further work.
University of Michigan | Instructional Assistant | Fall 2019 - Winter 2020
EECS 485 is a popular upper-level Web Systems course taught at the University of Michigan with over 400 enrolled students. After taking the course, I was selected to become an Instructional Assistant with the responsibility of designing and delivering projects and exams to students. Additionally, I teach a weekly one-hour lab and hold office hours throughout the week.
BNY Mellon | Summer Technology Analyst | Summer 2019
BNY Mellon is the world's largest custodian bank and asset servicer. I worked within the Alternative Investments Technology department with the main goal of designing and building a new testing framework. I learned a lot about object-oriented programming and design patterns as well as behavior-driven testing. This experience also strengthened my knowledge of Selenium and Java.
Amazon | Software Developer | Fall 2020 - Present
University of Michigan | Computer Science B.S.E | 2016-2020


Malaysian Foreign Minister Says Pompeo's Offer for US to Host APEC Summit 'Not Good Idea'
BANGKOK (Sputnik) - Malaysian Foreign Minister Saifuddin Abdullah has rejected US State Secretary Mike Pompeo's suggestion that the Asia-Pacific Economic Cooperation (APEC) summit in January be held in the United States now that Chile had pulled out of its hosting role.
"The US is thinking of hosting APEC somewhere in January in the US but I have informed the American officials while they were in Bangkok that we don't think it is a good idea", Abdullah told reporters, as quoted by The Star news outlet.
The foreign minister did not provide details as to why he rejected the proposal.
The statement comes after Chilean President Sebastian Pinera cancelled the 2-day summit, scheduled to start on 16 November, last week amid ongoing protests in the South American country.
Abdullah said Pompeo had called him while in Bangkok to ask for Malaysia's stance on hosting the event.
Malaysia is due to host next year's APEC summit.
APEC is a regional economic forum that aims to strengthen regional economic integration among its 21 members: Australia, Brunei, Canada, Chile, China, Hong Kong, Indonesia, Japan, South Korea, Malaysia, Mexico, New Zealand, Papua New Guinea, Peru, the Philippines, Russia, Singapore, Taiwan, Thailand, the United States and Vietnam.


Using the power of distributed computing, you can help researchers make a difference in ending terrible diseases, discovering new interesting math principles, and even sending some astronauts to mars!

What new truth could you help uncover today? There is a whole world of computational problems out there ready to be solved. Sign up and get started today!


Created with Raphaël 2.2.0
12
Feb
10
8
7
6
5
4
3
2
30
Jan
29
28
27
26
23
22
18
17
Add LICENSE
master
master
Merge branch 'master' of
https://github.com/bgoonz/web-dev-notes-resource-site
major improvments across the board
...---stable commit
Update README.md
Update README.md
update
Merge branch 'master' of
https://github.com/bgoonz/web-dev-notes-resource-site
asthetic update
Delete
core-site/other-pages/0-projects/react-context/node_modules directory
deploy
Merge branch 'master' of
https://github.com/bgoonz/web-dev-notes-resource-site
tools all of them
been busy
discovered jupnyter (however you
spell it) notebooks
Update README.md
Update README.md
damage control
what a mess
what a mess
lots of commits later
initi:
wubalubalubdub
mid day grind
Merge pull request #124 from
bgoonz/imgbot
wub
[ImgBot] Optimize images
updated content
not initial commit
Add files via upload
gh-pages
gh-pages
Merge pull request #45 from
bgoonz/bgoonz-patch-1
Merge pull request #43 from
bgoonz/imgbot
merge hell
Merge pull request #46 from
bgoonz/bgoonz-patch-2
Create azure.yml
Create jekyll.yml
wubalubadubdub
Merge branch 'master' into imgbot
Merge branch 'master' into backup
backup
backup
hi
please


--- title: "Introduction" author: "Haoming Hu" date: 2020-09-22 bibliography: "references.bib" categories: ["R"] tags: ["R Markdown", "plot", "regression"] ---
My abstract.
We use Wickham et al. (2019).
2020 is a hard year for everybody due to the widespread of the novel virus. In order to raise awareness of the general public, it is a good way to expose them with the propriate data, which indicates some virus-related factors. Specifically, we want to know if variables like gender, age group and so on would affect the possibility of contracting the virus. And actually, they do.
The data set we used is called “COVID-19 Cases in Toronto”, and it is from the Toronto Open Data Portal. Considering the comprehensive imformation it contains about COVID-19 cases in Toronto, we decided to use it in our later analysis.
Above is the data set we are going to use. However, there are many variables we are not using, so we manipulate to our desired data set.
covid19_cases_packages <- search_packages("COVID-19 Cases in Toronto")
covid19_cases_resources <- covid19_cases_packages %>% list_package_resources() # Get the resources that I am interested in
covid19_cases_statistics <- covid19_cases_resources %>% get_resource()
covid19_cases_statistics # Store all the information into the variable and wait for later analysis
## # A tibble: 16,942 x 18
## `_id` Assigned_ID `Outbreak Assoc… `Age Group` `Neighbourhood … FSA
## <int> <int> <chr> <chr> <chr> <chr>
## 1 126705 1 Sporadic 50 to 59 Y… Willowdale East M2N
## 2 126706 2 Sporadic 50 to 59 Y… Willowdale East M2N
## 3 126707 3 Sporadic 20 to 29 Y… Parkwoods-Donal… M3A
## 4 126708 4 Sporadic 60 to 69 Y… Church-Yonge Co… M4W
## 5 126709 5 Sporadic 60 to 69 Y… Church-Yonge Co… M4W
## 6 126710 6 Sporadic 50 to 59 Y… Newtonbrook West M2R
## 7 126711 7 Sporadic 80 to 89 Y… Milliken M1V
## 8 126712 8 Sporadic 60 to 69 Y… Willowdale West M2N
## 9 126713 9 Sporadic 50 to 59 Y… Willowdale East M2N
## 10 126714 10 Sporadic 60 to 69 Y… Henry Farm M2J
## # … with 16,932 more rows, and 12 more variables: `Source of Infection` <chr>,
## # Classification <chr>, `Episode Date` <chr>, `Reported Date` <chr>, `Client
## # Gender` <chr>, Outcome <chr>, `Currently Hospitalized` <chr>, `Currently in
## # ICU` <chr>, `Currently Intubated` <chr>, `Ever Hospitalized` <chr>, `Ever
## # in ICU` <chr>, `Ever Intubated` <chr>
To figure out the relationship between infection rate and age group, we set up data set “Age_set” first.
Age_set <- covid19_cases_statistics %>% group_by(`Age Group`) %>% count()
Age_set<- Age_set %>% mutate(percent = round(100*n/sum(Age_set$n), 1))
Age_set
## # A tibble: 10 x 3
## # Groups: Age Group [10]
## `Age Group` n percent
## <chr> <int> <dbl>
## 1 19 and younger 1200 7.1
## 2 20 to 29 Years 2714 16
## 3 30 to 39 Years 2519 14.9
## 4 40 to 49 Years 2325 13.7
## 5 50 to 59 Years 2616 15.4
## 6 60 to 69 Years 1767 10.4
## 7 70 to 79 Years 1108 6.5
## 8 80 to 89 Years 1550 9.1
## 9 90 and older 1114 6.6
## 10 NaN 29 0.2
Figure 1 illustrates which age groups are more likely to get infected:
# Plot the chart.
pie(Age_set$n, labels = Age_set$percent, main = "Infection rate and Age Group", col = c("#FF0000", "#00FF00", "#0000FF", "#FFFF00", "#00FFFF", "#FF00FF", "#C0C0C0", "#800000", "#008000", "#800080"))
legend("topright", Age_set$`Age Group`, cex = 0.8, fill = c("#FF0000", "#00FF00", "#0000FF", "#FFFF00", "#00FFFF", "#FF00FF", "#C0C0C0", "#800000", "#008000", "#800080"))
According to the graph mentioned above, it is obvious that age groups ‘20 to 29 years’ and ‘50 and 59 years’ tend to test positive. And Generally,
Gender_set <- covid19_cases_statistics %>% group_by(`Client Gender`) %>% count()
Gender_set<- Gender_set %>% mutate(percent = round(100*n/sum(Gender_set$n), 1))
Gender_set
## # A tibble: 5 x 3
## # Groups: Client Gender [5]
## `Client Gender` n percent
## <chr> <int> <dbl>
## 1 FEMALE 8973 53
## 2 MALE 7717 45.5
## 3 OTHER 6 0
## 4 TRANSGENDER 5 0
## 5 UNKNOWN 241 1.4
# Plot the chart.
pie(Gender_set$n, labels = Gender_set$percent, main = "Infection rate and Gender", col = c("#FF0000", "#00FF00", "#0000FF", "#FFFF00", "#00FFFF"))
legend("topright", Gender_set$`Client Gender`, cex = 0.8, fill = c("#FF0000", "#00FF00", "#0000FF", "#FFFF00", "#00FFFF"))
Wickham, Hadley, Mara Averick, Jennifer Bryan, Winston Chang, Lucy D’Agostino McGowan, Romain François, Garrett Grolemund, et al. 2019. “Welcome to the tidyverse.” Journal of Open Source Software 4 (43): 1686. https://doi.org/10.21105/joss.01686.


MetalCube 1008
Home
Our Menu
Contact us
Get the full menu here!
Download Menu
Salad / Soup
Appetizer / Fusion Food
Lunch Selection
Pasta
Chicken
Fish / Pork
Lamb / Beef
Special Combo / Burger
Snack
Kids Meal
Dessert / Cake
Coffee / Fresh Juice
Tea
Milkshake / Smoothies
Cooler
Other Beverages


Lorem Ipsum is simply dummy text of the printing and typesetting industry
It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
emporibus autem quibusdam et aut officiis debitis aut rerum necessitatibus saepe eveniet ut et voluptates.


Login
Get notified when someone says something on IRC without the bloat you'd get on IRCCloud.com
Logout
Reconnect
Reconnecting...
Connections:
Buffers:
Channels:


|
BL3 SDK
0.0.1
Borderlands 3 Class Documentation
|
#include <BL3_OakGame_structs.hpp>
Public Attributes | |
| float | DecalStrength |
| bool | bOverrideDecalStrength |
| unsigned char | UnknownData00 [0x3] |
| struct FLinearColor | DecalColor |
| bool | bOverrideDecalColor |
| unsigned char | UnknownData01 [0x3] |
| struct FLinearColor | DecalColorHighlight |
| bool | bOverrideDecalColorHighlight |
| unsigned char | UnknownData02 [0x7] |
| class UTexture * | Texture_Comp |
| class UTexture * | Texture_Normal |
| class UTexture * | Texture_BaseColor |
| TArray< struct FOakCharacterTexturePair > | Textures |
| Public Attributes inherited from FOakCharacterCustomization | |
| bool | bRandomizeColor |
| unsigned char | UnknownData00 [0x3] |
| struct FColorRandomizer | ColorRandomizer |
| bool bOverrideDecalColor |
| bool bOverrideDecalColorHighlight |
| bool bOverrideDecalStrength |
| struct FLinearColor DecalColor |
| struct FLinearColor DecalColorHighlight |
| float DecalStrength |
| class UTexture* Texture_BaseColor |
| class UTexture* Texture_Comp |
| class UTexture* Texture_Normal |
| TArray<struct FOakCharacterTexturePair> Textures |
| unsigned char UnknownData00[0x3] |
| unsigned char UnknownData01[0x3] |
| unsigned char UnknownData02[0x7] |


DRY
ABOUT DRY SKIN!
Dry Skin does not have the tendency to lock in natural mositure and oils so when you have dry skin, your pores are literally almost invisible. It may seem like you have a rough complexion and red patches as well less elasticity on your skin.
Sometimes your skin can easily crack, peel, flake, or become itchy, but this isn’t always the case. The major key needed to maintain dry skin is moisture, moisture, and lots of moisture.
HOMEMADE TREATMENTS
- Honey Revitalizing Balm
- Traditionally, honey has always been an important part of skin care. It is a natural humectant, so it keeps your skin moisturized. Honey, when used along with beeswax and olive oil, can help combat dry skin and conditions associated with it
- Melt beeswax in a double boiler. After the beeswax is heated, add olive oil and hoeny to it and mix. Pour it in a jar quick before it starts to solidfy.
If you want you can add two tablespoons of orange juice for added skin cleansing benefits.
- Oatmeal Mosturizing Mask
- Oatmeal is one of the most effective home remedies for dry skin on the face. It also has antioxidant and anti-inflammatory properties, which help you deal with the symptoms that dry skin causes
- Warm up milk in a saucepan.Place oatmeal in a bowl, and add the milk to it.
Wait for a few minutes before adding honey. When you finish, apply the face mask and keep it on for at least 20 minutes.
Rins the mask off with cold water.
- Chocolate Pack
- Chocolate, apart from being one of the most sought after confectioneries, also has many benefits for the skin. Lathering molten chocolate onto dry skin makes the skin soft and glowing.
- Mix cocoa powder, honey, maize flour, and mashed avocado thoroughly to make a smooth paste. Apply this pack onto your dry skin and leave it on for half an hour.
After waiting, rinse with lukewarm water.
- Yougurt
- Yogurt is an excellent skin-hydrating agent. Plus, its antioxidant and anti-inflammatory properties help soothe dry and itchy skin. Also, its lactic acid content helps get rid of any germs or bacteria that may cause dryness or itchiness.
- Apply fresh yogurt on your hands, face and legs and gently massaging it into your skin. Leave it on for 10 minutes and then take a bath or shower. The mild exfoliating action of yogurt will remove dry skin and leave your skin refreshed.
PREVENTION
- Petroleum jelly
- petroleum jelly products can heal skin in older adults. Petroleum jelly, also known as mineral oil, covers the skin in a protective layer. It traps moisture underneath. This helps heal dry, irritated skin patches.
- Insulated gloves
- Wearing insulated gloves while doing household chores, or when you’re outside in extreme temperatures can cut down on dry, irritated skin.
- Use a humidifier
- Keeping a humidifier in your home can help minimize the dryness caused by home heating systems.
- Adjust your shower temperature
- While most people tend to take hot showers, these can scald the skin and cause damage. And some soaps that claim to moisturize and repair the skin can cause the opposite effect. They can trigger allergic reactions and make the skin thinner with harsh chemicals. Take short showers with water that’s warm, not hot. And look for soaps that are fragrance-free and gentler on skin than traditional soaps.
- Avoid allergens and irritants
- petroleum jelly products can heal skin in older adults. Petroleum jelly, also known as mineral oil, covers the skin in a protective layer. It traps moisture underneath. This helps heal dry, irritated skin patches.
- Antioxidants
- Foods rich in antioxidants can minimize damage from toxins and help your body make healthy cells. Some of the foods that contribute to skin health include:
blueberries, tomatoes, carrots, beans, peas, avocados, and lentils
- Apply products with hyaluronic acid.
- The other thing that can go on underneath a moisturizer is a hyaluronic acid product. That molecule is very hydroscopic — it pulls water in around it. That would be a great augmenting moisturizer for someone with dry skin.
RECOMMENDATIONS
Aveeno Active Naturals Daily Moisturizing Lotion, $4
Palmers Skin Therapy Oil, $12.50
Derma E Hydrating Serum, $30
First Aid Beauty Ultra Repair Face Moisturizer, $24
Lush's Let the Good Times Roll Cleanser, $12.95
. The Body Shop's Hemp Face Protector, $15
*DISCLAIMER* Most of the information on this page comes from the internet, none of it is necessarily information that the Bloom came up with


Flask: Write to a Database¶
In this chapter we focus on writing data to a SQLite database, using Flask-SQLAlchemy.
We will cover:
Add a new record: Create a complete new entry and add it to the database.
Update a record: Retrieve an existing record and allow the user to edit any part of it, then write the changes to the database.
Delete a selected record.
Resources:
The database¶
We will use the same SQLite database from the chapter Flask: Read from a Database.
The database is named sockmarket.db. It has only one table, named socks. It has seven fields: id, name, style, color, quantity, price, and updated. You will see the table name and the field names later, in the Python code. The image below is a screenshot from the DB Browser for SQLite, showing the top rows of the socks table.
It is essential to get your database connection working without errors before you try to do more with the database and Flask.
Refer to Flask and Databases to test your database connection.
Add new record to database¶
To add a new record to the database as part of a Flask app, you will likely use an HTML form similar to this:
The route: localhost:5000/add_record
Flask forms using Flask-WTF and Flask-Bootstrap4 were introduced in the chapter Flask: Web Forms. See the code for this form below.
App setup¶
The example app we will build here begins with the app completed in the chapter about reading from a database. Now there will be a lot of new imports at the top of the app file:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | """ write to a SQLite database with forms, templates
add new record, delete a record, edit/update a record
"""
from flask import Flask, render_template, request, flash
from flask_sqlalchemy import SQLAlchemy
from flask_bootstrap import Bootstrap
from flask_wtf import FlaskForm
from wtforms import SubmitField, SelectField, RadioField, HiddenField, StringField, IntegerField, FloatField
from wtforms.validators import InputRequired, Length, Regexp, NumberRange
from datetime import date
app = Flask(__name__)
# Flask-WTF requires an enryption key - the string can be anything
app.config['SECRET_KEY'] = 'MLXH243GssUWwKdTWS7FDhdwYF56wPj8'
# Flask-Bootstrap requires this line
Bootstrap(app)
# the name of the database; add path if necessary
db_name = 'sockmarket.db'
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///' + db_name
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = True
# this variable, db, will be used for all SQLAlchemy commands
db = SQLAlchemy(app)
|
Line 5: new imports from Flask —
request
andflash
. You’ll see these in the first new route.Line 10: new form fields you have not seen before, because the form here has a lot more going on than the simple form in the introductory chapter.
Line 11: new form validators to prevent unwanted values going into your database.
Line 12: import to enable Python to insert a date automatically into your database.
Line 17: required by WTForms; covered in the forms chapter.
Everything else above was covered in previous chapters.
Database table setup¶
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | # each table in the database needs a class to be created for it
# db.Model is required - don't change it
# identify all columns by name and data type
class Sock(db.Model):
__tablename__ = 'socks'
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String)
style = db.Column(db.String)
color = db.Column(db.String)
quantity = db.Column(db.Integer)
price = db.Column(db.Float)
updated = db.Column(db.String)
def __init__(self, name, style, color, quantity, price, updated):
self.name = name
self.style = style
self.color = color
self.quantity = quantity
self.price = price
self.updated = updated
|
Lines 35–43 were explained in the chapter about reading from a database. Lines 45–51 were not needed there, but now we need them, or we’ll get an error when we try to write a new record into this table in the database.
__init__()
is a reserved method in Python classes. It is called when an object is created from the class, to initialize the properties of the class. Here, it specifies that when we pass values into a new record in this table, the order of the values will be name, style, color, quantity, price, updated. Note that the order matters! You’ll see this in the first new route. self
represents the new instance of the class, and everywhere you see it, it needs to stay.
Important
If your app needs to write a new record into more than one table, you’ll need to set up each of those tables in this way also.
The form without validators¶
As explained in the web forms chapter, we can vastly simplify the template HTML by defining every aspect of a form in a new class in the app script.
class AddRecord(FlaskForm):
# id used only by update/edit
id_field = HiddenField()
name = StringField('Sock name')
style = SelectField('Choose the sock style',
choices=[ ('', ''), ('ankle', 'Ankle'),
('knee-high', 'Knee-high'),
('mini', 'Mini'),
('other', 'Other') ])
color = StringField('Color')
quantity = IntegerField('Quantity in stock')
price = FloatField('Retail price per pair')
# updated - date - handled in the route function
updated = HiddenField()
submit = SubmitField('Add/Update Record')
Note
Each different field type here was imported from wtforms at the top of the script file.
See a list of all WTForms field types. Note that they are case-sensitive.
The following might be puzzling:
choices=[]
— required for a SelectField. Inside the square brackets are tuples. The first item in a tuple is the value for the database. The second item in a tuple is the text visible in the select menu. These pairs translate into lines like this in the HTML:<option value="ankle">Ankle</option>
HiddenField()
denotes an HTML form element:<input type="hidden">
. This kind of form element is used to pass values that should not be edited or even seen by users, such as a database primary key. Learn more at MDN.
Everything else should be clear if you are familiar with regular HTML forms. Compare the code to the screenshot of the form. The live page is ➡ here.
The form with validators¶
Validators — also imported from wtforms — can get pretty complicated. They can do quite a lot to prevent bad values from being written to your database, though, so it’s worthwhile to learn how to use them.
Below is the same form class with the validators added. This is the class used in the example app.
See a list of all WTForms validators.
class AddRecord(FlaskForm):
# id used only by update/edit
id_field = HiddenField()
name = StringField('Sock name', [ InputRequired(),
Regexp(r'^[A-Za-z\s\-\']+$', message="Invalid sock name"),
Length(min=3, max=25, message="Invalid sock name length")
])
style = SelectField('Choose the sock style', [ InputRequired()],
choices=[ ('', ''), ('ankle', 'Ankle'),
('knee-high', 'Knee-high'),
('mini', 'Mini'),
('other', 'Other') ])
color = StringField('Color', [ InputRequired(),
Regexp(r'^[A-Za-z\s\-\'\/]+$', message="Invalid color"),
Length(min=3, max=25, message="Invalid color length")
])
quantity = IntegerField('Quantity in stock', [ InputRequired(),
NumberRange(min=1, max=999, message="Invalid range")
])
price = FloatField('Retail price per pair', [ InputRequired(),
NumberRange(min=1.00, max=99.99, message="Invalid range")
])
# updated - date - handled in the route function
updated = HiddenField()
submit = SubmitField('Add/Update Record')
InputRequired()
means the field cannot be left empty.Regexp()
is used to provide a regular expression, which is a pattern the entered string needs to match. Learn about regular expressions in Python. Themessage=
value inside the parentheses will appear if the pattern is not matched.Length()
allows us to provide a minimum and maximum length for the string. It also provides amessage=
option.NumberRange()
allows us to provide a minimum and maximum number for an integer or a float.
Note
Each different validator above was imported from wtforms at the top of the script file.
The route function¶
The route — like all the code shown above — is in the app script, write_db.py.
The route add_record renders a template that contains the web form discussed above. In the decorator we add methods=['GET', 'POST']
because this template can legitimately open via a regular HTTP request (get) or via a request with form data attached to it (post).
The function has an if/else to handle two different circumstances:
The form on the page has been submitted, and the form data were all valid. (The
validate_on_submit()
function returns True.) In that case, we want to send the data to the database.No data will be written to the database. That case actually has two possible conditions:
The form has not yet been filled in and submitted.
The form was submitted, but there is invalid data in one or more fields.
First we’ll look at what happens if the data are valid and are written to the database:
114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 | # add a new sock to the database
@app.route('/add_record', methods=['GET', 'POST'])
def add_record():
form1 = AddRecord()
if form1.validate_on_submit():
name = request.form['name']
style = request.form['style']
color = request.form['color']
quantity = request.form['quantity']
price = request.form['price']
# get today's date from function, above all the routes
updated = stringdate()
# the data to be inserted into Sock model - the table, socks
record = Sock(name, style, color, quantity, price, updated)
# Flask-SQLAlchemy magic adds record to database
db.session.add(record)
db.session.commit()
# create a message to send to the template
message = f"The data for sock {name} has been submitted."
return render_template('add_record.html', message=message)
else:
|
Line 117: Using the form class created above, we create an instance of that form and assign it to the variable
form1
.Line 118: The
if
clause runs if the form data were valid. That means we want to write the data to the database.Lines 119–123: Create new variables from the data received from the form.
Line 125: Run a function to create a date string representing today’s date. Assign that string to the new variable
updated
.Line 127: Using the model class created above —
Sock
— we format the data in the manner expected by the database, following the order in the__init__
function. Assign this to a new variable,record
.Lines 129–130: This is SQLAlchemy handling everything to securely write to the database. Note that the variable
record
is used in line 129.db.session.commit()
is necessary to update your database.Line 132: Create a message to pass to the template. Note that this message only exists if the data were sent to the database.
Line 133: Render the template, passing the message to it.
Above, the result of successfully writing to the database renders the template without showing the form. It displays the message, including the name of the sock just submitted.
What happens if data in one or more form fields are invalid when the form is submitted?
Recall that in the form class, validators were added to restrict what can be sent to the database.
Above, you can see the result of invalid data in two of the form fields. The user can correct the errors and submit the form again. Nothing will be written to the database until all fields contain valid data. This is handled in the second part of the route function — the else clause:
134 135 136 137 138 139 140 141 142 143 144 | else:
# show validaton errors
# see https://pythonprogramming.net/flash-flask-tutorial/
for field, errors in form1.errors.items():
for error in errors:
flash("Error in {}: {}".format(
getattr(form1, field).label.text,
error
), 'error')
return render_template('add_record.html', form1=form1)
|
See the Flask Flash Function Tutorial for details about using flash()
and the for-loop in the code above.
Note that the else clause also runs if this page is freshly opened in the browser, with an empty form. In that case, the for-loop runs, but there are no errors — and so no flash()
messages will appear on the page.
The form — form1
— must be passed to the template in the return statement (line 143 above).
The template¶
Because of the flash()
messages, this template is a bit complicated.
The top part (lines 26–34) runs only if the data were just written to the database. This is the case where the form is not on the page and the message says the data have been submitted.
The else clause is discussed below.
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
Add a New Sock

{% if message %}

{{ message }}

Submit another sock.

Return to the index.

{% else %}

Add a new sock to our inventory.

Return to the index.

{% with errors = get_flashed_messages() %}
{% if errors %}
{% for err in errors %}

<button type="button" class="close" data-dismiss="alert" aria-label="Close">×</button>
{{ err }}

{% endfor %}
{% endif %}
{% endwith %}

{{ wtf.quick_form(form1) }}
{% endif %}
|
The key thing to notice in the else clause is that the form is displayed (line 62):
{{ wtf.quick_form(form1) }}
Recall that form1
was passed to the template in the route function.
Lines 49–58 handle the flash()
messages that are written if the form is submitted with invalid data. The way this section of code works is explained in this tutorial.
If the page was just opened and the form is empty, unfilled, then there are no flash()
messages.
Summary: Add new record¶
While that probably seems like a lot, note that there are one form, one route, and one template used to create a new record and add it to the database.
The template and the route in this case handle BOTH the form before it has been submitted AND the submission of the form.
That will not be the same when we delete or update a database record in this app.
Delete or update a record¶
In contrast to adding a new record, either deleting or editing an existing record requires your code to find a specific record that is already in the database. The record must be selected in a way that guarantees only one record will be selected.
In this app, the index page offers an option to select a sock for editing:
Above: / — route; index() — function; index.html — template
The link opens a page showing socks listed alphabetically by name, with a radio button at left to allow selection of just one sock:
Above: /select_record/<letters> — route; select_record(letters) — function; select_record.html — template
The value encoded in the radio button is the unique ID (the primary key) for the sock record in the database. For example:

<input type="radio" name="id" value="44" required>
Evelyn
black multi
The form in the template select_record.html has this action attribute in the form
tag:
action="{{ url_for('edit_or_delete') }}"
As a result, submitting that form calls the route for the edit_or_delete() function:
154 155 156 157 158 159 160 161 162 163 164 | # edit or delete - come here from form in /select_record
@app.route('/edit_or_delete', methods=['POST'])
def edit_or_delete():
id = request.form['id']
choice = request.form['choice']
sock = Sock.query.filter(Sock.id == id).first()
# two forms in this template
form1 = AddRecord()
form2 = DeleteForm()
return render_template('edit_or_delete.html', sock=sock, form1=form1, form2=form2, choice=choice)
|
The unique ID is used in the database query (line 159) to retrieve the selected record from the database.
Note
The difference between ending the database query with .first()
is that it returns only one record, while .all()
returns all matching records as a list. Do not try to loop over a result obtained with .first()
.
The template rendered by that route — edit_or_delete.html — includes an if/else to determine whether to show the form for deleting a record or the form for updating a record. It tests the value of the variable choice
, which came from the form (line 158) and is passed to the template (line 163). The precise record that was selected is retrieved from the database in line 159 (highlighted) and passed to the template in line 163.
If you chose to delete, this is what you’ll see:
Above: /edit_or_delete — route; edit_or_delete() — function; edit_or_delete.html — template
If you chose to edit, you’ll see the form with values filled in from the record that was retrieved from the database.:
Above: /edit_or_delete — route; edit_or_delete() — function; edit_or_delete.html — template
If you opened that route without submitting the form:
Above: /edit_or_delete — route; edit_or_delete() — function; edit_or_delete.html — template
Important
All of the three previous screenshots come from the same route, /edit_or_delete. The template determines whether to show “Delete a Sock” or “Edit a Sock” based on the value of the variable choice
. The third screenshot is an error template (error.html) that renders automatically if the HTTP request was get and not post — because:
@app.route('/edit_or_delete', methods=['POST'])
Deleting¶
By submitting the deletion form that appears in the enter_or_delete.html template, the user causes the deletion to occur. The action in the form is:
action="{{ url_for('delete_result') }}"
And so this route function is called:
165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 | # result of delete - this function deletes the record
@app.route('/delete_result', methods=['POST'])
def delete_result():
id = request.form['id_field']
purpose = request.form['purpose']
sock = Sock.query.filter(Sock.id == id).first()
if purpose == 'delete':
db.session.delete(sock)
db.session.commit()
message = f"The sock {sock.name} has been deleted from the database."
return render_template('result.html', message=message)
else:
# this calls an error handler
abort(405)
|
The record deletion is performed in lines 172–173. The unique ID for the record was obtained from the form. The record was retrieved from the database in line 170. A message will be passed to the template named result.html (line 175), and this is the result:
Editing¶
Alternatively, by submitting the edit/update form that appears in the enter_or_delete.html template, the user causes the record to be changed in the database. The action in the form is:
action="{{ url_for('edit_result') }}"
And so this route function is called:
180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 | # result of edit - this function updates the record
@app.route('/edit_result', methods=['POST'])
def edit_result():
id = request.form['id_field']
# call up the record from the database
sock = Sock.query.filter(Sock.id == id).first()
# update all values
sock.name = request.form['name']
sock.style = request.form['style']
sock.color = request.form['color']
sock.quantity = request.form['quantity']
sock.price = request.form['price']
# get today's date from function, above all the routes
sock.updated = stringdate()
form1 = AddRecord()
if form1.validate_on_submit():
# update database record
db.session.commit()
# create a message to send to the template
message = f"The data for sock {sock.name} has been updated."
return render_template('result.html', message=message)
else:
|
This is a bit more complicated than the deletion function, but recall the way we added a new record, at the start of this chapter. Note that we are in fact using the same form that we used there. We are validating the data in exactly the same way (the else
clause following line 202 is practically the same).
In lines 187–191, we add the form data to sock
— which contains the record retrieved from the database in line 185. However, we do not write the record back to the database unless the form data validates. This is also very similar to the way we added a new record. The most significant difference between this function and that one is that when we add a new record we use db.session.add(record)
and here, we do not. We only commit the changes with:
db.session.commit()
A message will be passed to the template named result.html (line 201), and this is the result:
Important
Both route functions — the one for deleting a record AND the one for editing a record — render the same template, result.html.
Summary: Delete or update (and a diagram)¶
This is a lot, with three different forms and three different templates. Perhaps this diagram will help.
Of course this is not the only way to build it — Flask gives us a lot of freedom to design templates and use routes whatever way is best for the application we need to build.
Conclusion & tips¶
If you’re making changes to a database via a Flask app, you are likely to use HTML forms.
A key fact to remember is that if you use the WTForms/flask_wtf quick_form()
, you do not have a lot of options for that form outside the class you build in the Flask app. See the documentation.
If you want more flexibility, you can encode a form like the two forms in the template edit_or_delete.html — both of those have values assigned to each field. See the complete template here.
For even more flexibility, you can write the entire form from scratch, as seen in the template select_record.html. In that case, you do not need to build a Python class for the form.
If you do not assign an action to a form, it will call the same route again when you submit it. If you want it to call a different route, assign that route as the value of action=
— using Jinja template syntax, like this:
action="{{ url_for('edit_result') }}"
Note
It is always the function name as the argument for url_for()
— never the template name. If the function is named differently from the route URL, be sure to use the function name.
When writing the decorator for a route, consider whether you need to assign ONLY the post method to it, or BOTH post and get. In the socks app, only one route requires both post and get:
@app.route('/add_record', methods=['GET', 'POST'])
Three routes require only post:
@app.route('/edit_or_delete', methods=['POST'])
@app.route('/delete_result', methods=['POST'])
@app.route('/edit_result', methods=['POST'])
The difference is this: for /add_record the user needs to be able to open the unfilled form with a regular link. That is the get method — the default for every regular web page. But when a route runs as the result of a form submission, the method post is required, because only post can convey form data to the server as attached data (not visible in the browser address bar). The /add_record route both opens the (empty) form and processes the form.
The other three routes listed above ONLY run when a form is posted. If you try to open those directly, you’ll see an error message.
.


Hi! This is my personal website for gadgets, art projects, data-visualization, articles, and models and simulations. If you have any questions or comments, please contact me at<EMAIL_ADDRESS>General interests include chronometry, aeromedical devices, ocular biomechanics, health informatics, epistemology, military, data visualization, and flag design.


In the nations of North America, in Australia, in South Africa, and in Brazil, the positive benefit of "telecommuting" was no so much economic as it was environmental. People drove less. The amount of driving was not reduced considerably -- perhaps 10% in all -- but the significant point was that it was reduced. In a civilization choking on its own addiction to gasoline-burning automobiles, this was the great unheralded revolution of fin-de-siècle Earth. It gave everyone connected to the 20th century transportation industry a little breathing space to redesign and refurbish their roads, tunnels, bridges, and other capital investments. And it is giving the EPWV industry time to think things out.
The vCity did not prove any of this out directly, of course. Just as we went to a significant expense to design a mass transit simm, we went to even greater expense to design a complete EPWV infrastructure simm. More on that fantasy some other time. The bottom line is that people didn't really use that either. It's impossible to force people to use it when they can beam. We could have arbitrarily prevented beaming, of course, and forced people to scroll from one part of the city to another via a transit simm, but what good would that have done except to piss vCitizens and tourists off? What good is a simulation, if all it does is reproduce what we insist should happen?
No indeed, it turned out that the anti-medium was the anti-message. There's a reason people don't spend an hour scrolling in a vAutomobile to get from one place to another in the vCity. It's a pain in the tushie. Which is precisely why most people don't want to do it in real life, either.


Hi there! this is just a POC that the Input module can be loaded successfully. Check the console for errors. Errors are bad, no errors are good!


§414D-279 Resignation of registered agent of foreign corporation. The registered agent of a foreign corporation may resign as agent by complying with the requirements of section 425R-10. [L 2001, c 105, pt of §1; am L 2009, c 55, §26]


About us
Our Studio
We’re an interactive agency and scalable web designs and mobile apps,
currently based in New York.
Experties.
- Web applications
- 01. Web sites
- 02. Internet shops
- 03. Special web applications
- Mobile applications
- 01. IOS apps
- 02. Android apps
- 03. React native apps
- Graphic design
- 01. Logo
- 02. Branding
- 03. UI / UX design
Clients.
- Github
- Themeforest
- Monkee
- Graphicriver
- Codrop
- Codecanyon
- Videohive
- Jeku Interactive
- Rafeel Garcia
We are Return


Bolton's lawyer: Client has ‘relevant' new info on Ukraine
But not willing to testify until court compels him
by Ariane de Vogue and Kevin Bohn, CNNWASHINGTON (CNN) - Former national security adviser John Bolton has significant insights into matters being probed by the impeachment investigators, his lawyer said in a letter to congressional leaders on Friday.
But Bolton's attorney said his client will not testify until a court resolves whether a subpoena issued to him must be adhered to.
The letter from lawyer Charles Cooper said, "Ambassador Bolton, who was the National Security Advisor to the President, and who was personally involved in many of the events, meetings, and conversations about which you have already received testimony, as well as many relevant meetings and conversations that have not yet been discussed in the testimonies thus far."
Cooper's letter underscores that he thinks his client could add critical testimony that has not so far been addressed, but that Bolton is unwilling to testify until a court rules that the White House's claim of immunity is invalid.
This story is breaking and will be updated.


{include file="../public/header" /} {include file="../public/left" /} {include file="../public/foot" /}


Extracts a strided slice of a tensor (generalized python array indexing).
tf.compat.v1.strided_slice
tf.compat.v2.strided_slice
tf.strided_slice( input_, begin, end, strides=None, begin_mask=0, end_mask=0, ellipsis_mask=0, new_axis_mask=0, shrink_axis_mask=0, var=None, name=None )
Instead of calling this op directly most users will want to use the
NumPy-style slicing syntax (e.g. tensor[..., 3:4:-1, tf.newaxis, 3]
), which
is supported via tf.Tensor.getitem
and tf.Variable.getitem
.
The interface of this op is a low-level encoding of the slicing syntax.
Roughly speaking, this op extracts a slice of size (end-begin)/stride
from the given input_
tensor. Starting at the location specified by begin
the slice continues by adding stride
to the index until all dimensions are
not less than end
.
Note that a stride can be negative, which causes a reverse slice.
Given a Python slice input[spec0, spec1, ..., specn]
,
this function will be called as follows.
begin
, end
, and strides
will be vectors of length n.
n in general is not equal to the rank of the input_
tensor.
In each mask field (begin_mask
, end_mask
, ellipsis_mask
,
new_axis_mask
, shrink_axis_mask
) the ith bit will correspond to
the ith spec.
If the ith bit of begin_mask
is set, begin[i]
is ignored and
the fullest possible range in that dimension is used instead.
end_mask
works analogously, except with the end range.
foo[5:,:,:3]
on a 7x8x9 tensor is equivalent to foo[5:7,0:8,0:3]
.
foo[::-1]
reverses a tensor with shape 8.
If the ith bit of ellipsis_mask
is set, as many unspecified dimensions
as needed will be inserted between other dimensions. Only one
non-zero bit is allowed in ellipsis_mask
.
For example foo[3:5,...,4:5]
on a shape 10x3x3x10 tensor is
equivalent to foo[3:5,:,:,4:5]
and
foo[3:5,...]
is equivalent to foo[3:5,:,:,:]
.
If the ith bit of new_axis_mask
is set, then begin
,
end
, and stride
are ignored and a new length 1 dimension is
added at this point in the output tensor.
For example,
foo[:4, tf.newaxis, :2]
would produce a shape (4, 1, 2)
tensor.
If the ith bit of shrink_axis_mask
is set, it implies that the ith
specification shrinks the dimensionality by 1, taking on the value at index
begin[i]
. end[i]
and strides[i]
are ignored in this case. For example in
Python one might do foo[:, 3, :]
which would result in shrink_axis_mask
equal to 2.
NOTE: begin
and end
are zero-indexed.
strides
entries must be non-zero.
t = tf.constant([[[1, 1, 1], [2, 2, 2]], [[3, 3, 3], [4, 4, 4]], [[5, 5, 5], [6, 6, 6]]]) tf.strided_slice(t, [1, 0, 0], [2, 1, 3], [1, 1, 1]) # [[[3, 3, 3]]] tf.strided_slice(t, [1, 0, 0], [2, 2, 3], [1, 1, 1]) # [[[3, 3, 3], # [4, 4, 4]]] tf.strided_slice(t, [1, -1, 0], [2, -3, 3], [1, -1, 1]) # [[[4, 4, 4], # [3, 3, 3]]]
input_
: A Tensor
.begin
: An int32
or int64
Tensor
.end
: An int32
or int64
Tensor
.strides
: An int32
or int64
Tensor
.begin_mask
: An int32
mask.end_mask
: An int32
mask.ellipsis_mask
: An int32
mask.new_axis_mask
: An int32
mask.shrink_axis_mask
: An int32
mask.var
: The variable corresponding to input_
or Nonename
: A name for the operation (optional).A Tensor
the same type as input
.


Developing Golang functions
Golang function template structure
When you create a Golang function using the kn func
CLI, the project directory looks like a typical Go project, with the exception of an additional func.yaml
configuration file. Both http
and event
trigger functions have the same template structure:
fn
├── README.md
├── func.yaml (1)
├── go.mod
├── go.sum
├── handle.go
└── handle_test.go
| 1 | The func.yaml configuration file is used to determine the image name and registry. |
Golang functions have very few restrictions. The only requirement is that your project must be defined in a function
module and exports the function Handle()
.
Dependencies
You can add any required dependencies to the go.mod
file, which can include additional local Golang files. When the project is built for deployment, these dependencies will be included in the resulting runtime container image.
go get<EMAIL_ADDRESS>Invoking a function
When using the kn func
CLI to create a function project you can generate a project that responds to CloudEvents, or one that responds to simple HTTP requests. CloudEvents in Knative are transported over HTTP as a POST request, so both function types will listen and respond to incoming HTTP events.
Function triggered by HTTP request
When an incoming HTTP request is received, your function will be invoked with a standard Golang Context as the first parameter, followed by two more parameters:
You can use standard Golang techniques to access the request, and set a proper HTTP response of your function.
func Handle(ctx context.Context, res http.ResponseWriter, req *http.Request) {
// Read body
body, err := ioutil.ReadAll(req.Body)
defer req.Body.Close()
if err != nil {
http.Error(res, err.Error(), 500)
return
}
// Process body and function logic
// ...
}
Function triggered by CloudEvent
When an incoming CloudEvent is received, the event is invoked by the CloudEvents Golang SDK and the Event
type as a parameter.
You can leverage the Golang Context as an optional parameter in the function contract, as shown in the list of supported function signatures:
Handle()
Handle() error
Handle(context.Context)
Handle(context.Context) error
Handle(cloudevents.Event)
Handle(cloudevents.Event) error
Handle(context.Context, cloudevents.Event)
Handle(context.Context, cloudevents.Event) error
Handle(cloudevents.Event) *cloudevents.Event
Handle(cloudevents.Event) (*cloudevents.Event, error)
Handle(context.Context, cloudevents.Event) *cloudevents.Event
Handle(context.Context, cloudevents.Event) (*cloudevents.Event, error)
-
A CloudEvent is received which contains a JSON string in its data property:
{ "customerId": "0123456", "productId": "6543210" }
-
To access this data, you must define a structure which maps properties in the CloudEvent data, and retrieves the data from the incoming event. This example uses the
Purchase
structure:type Purchase struct { CustomerId string `json:"customerId"` ProductId string `json:"productId"` } func Handle(ctx context.Context, event cloudevents.Event) err error { purchase := &Purchase{} if err = cloudevents.DataAs(purchase); err != nil { fmt.Fprintf(os.Stderr, "failed to parse incoming CloudEvent %s\n", err) return } // ... }
-
Optional: Alternatively, you can use the Golang
encoding/json
package to access the CloudEvent directly as JSON in the form of a bytes array:func Handle(ctx context.Context, event cloudevents.Event) { bytes, err := json.Marshal(event) // ... }
Return values
HTTP triggered functions can set the response directly by using the Golang http.ResponseWriter.
func Handle(ctx context.Context, res http.ResponseWriter, req *http.Request) {
// Set response
res.Header().Add("Content-Type", "text/plain")
res.Header().Add("Content-Length", "3")
res.WriteHeader(200)
_, err := fmt.Fprintf(res, "OK\n")
if err != nil {
fmt.Fprintf(os.Stderr, "error or response write: %v", err)
}
}
Functions triggered by a CloudEvent may return nothing, error
, or CloudEvent
in order to push events into the Knative eventing system. In this case, you must set a unique ID
, proper Source
and a Type
for the CloudEvent. The data can be populated from a defined structure, or from a map
.
func Handle(ctx context.Context, event cloudevents.Event) (resp *cloudevents.Event, err error) {
// ...
response := cloudevents.NewEvent()
response.SetID("example-uuid-32943bac6fea")
response.SetSource("purchase/getter")
response.SetType("purchase")
// Set the data from Purchase type
response.SetData(cloudevents.ApplicationJSON, Purchase{
CustomerId: custId,
ProductId: prodId,
})
// OR set the data directly from map
response.SetData(cloudevents.ApplicationJSON, map[string]string{"customerId": custId, "productId": prodId})
// Validate the response
resp = &response
if err = resp.Validate(); err != nil {
fmt.Printf("invalid event created. %v", err)
}
return
}
Testing a Golang function locally
Golang functions can be tested locally on your computer. In the default project that is created when you create a function using kn func create
, there is a handle_test.go
file which contains some basic tests. These tests can be extended as needed.
-
Run the test:
$ go test


MIYA'S DREAMS OF SUSTAINABLE SUSHI FOR 6 | MIYA'S SUSHI | $360
Enjoy a meal of the best original sushi recipes carefully selected by Miya's creative director, Bun Lai, that will drive your palate wild (no pun intended) and change the world one sustainable, nutritious bite at a time. Ever since its establishment in 1982 as the first sushi restaurant in CT, Miya’s has been featured in a variety of publications including National Geographic, Eating Well Magazine, and Time which applauds Miya’s as a “pioneer in the sustainable food movement”.
KOREAN BBQ NIGHT FOR 10 | WOOKIE HONG & SARAH KIM | $120
Are you a fan of the fresh flavors of Korean barbecue? Of course you are! Sadly, there aren't many Korean BBQ options in New Haven. Join us over a tabletop grill with enough marinated beef, pork, fresh veggies, fruit, rice and alcohol (soju) to feed you and 9 more of your friends.
ITALIAN FEAST FOR 8 | MARK & ANNA MERCURIO | $150
Italian feast for 8 guests to be cooked and served at the Mercurio household in Branford. Includes optional walk on the beach and unlimited playing time with the dogs (very therapeutic for stressed out students). Transportation provided if necessary.
A NIGHT UNDER THE STARS FOR 6 | MICHAEL CAPLAN & JoANNE BURGER | Starting: $150
Gourmet dinner for 6 at the Caplan-Burger Observatory that will be complimented by a guided tour of the night sky featuring stunning views through a really big telescope.
DINNER AT ZINC FOR 8 | STATUS OF WOMEN IN MEDICINE COMMITTEE | $200
Senior faculty members from the SWIM (Status of Women in Medicine) Committee will treat 8 to dinner at one of the best restaurants in New Haven. Come for stimulating discussion on the role of women in medicine, and the best ways to affect change to achieve equity for women in the medical field.
WINE AND DINE FOR 6 | BOB ALPERN & PAT PREISIG | $200
Not only do you get to see one of the most beautiful wine cellars in Connecticut, you get to drink from it! 6 students can spend an evening chatting, imbibing, and dining with Dean Alpern and his wife.
SAIL THE THIMBLE ISLANDS FOR 4 | RICHARD H. MATTSON | $100
A weekend afternoon sail on a 20' sloop, the Serendipity, from Sachem's Head Yacht Club in Guilford, CT. 3-4 guests /"crew" are optimal. Snacks and beverages provided as well as a turn at the tiller. 3-4 hours duration. Available June through Sept.
DINNER PARTY ON LINCOLN ST FOR 6 | SUSAN FORSTER | $150
What better way than to brush off those winter blues by spending an evening at Dr. Forster’s house (to be scheduled in March/April 2016). Winners can chose to spend time at the within-walking-distance home in New Haven or at the Connecticut River home in East Haddam.
BOW TIE | BILL STEWART | $300
An item that requires no description. The subject of folklore, tall tale, and urban legend. Worn in the lab, but not too often.
BEEF & BOOZE FOR 8 | BILL STEWART | $200
Martinis, focaccia, blue cheese, lambics, mashed potatoes, roasted asparagus, filet, rib eyes, cheesecake, cookie pie, and single malts. Need we say more?
WINE & INDIAN FOOD FOR 6 | SHANTA & CYRUS KAPADIA | $150
A lovely evening at the residence of Drs. Kapadia. Enough food and drink to fill your pockets.
PATIENT CENTERED CRUISING FOR 6 | AUGUSTE FORTIN | $150
A 3-hour cruise around beautiful New Haven Harbor with Captain Fortin. "Pax", a 42 foot sloop fits up to 6 sailers who want to have many patient-centered conversations. So no scurvy sets in, pizza, beer, wine, and sodas will be provided.
I’M ON A BOAT FOR 5 | JAMES JAMIESON | $100
An unforgettable sailing experience with lunch, free drugs, and a Captain who can officiate a legal marriage - fully reversible upon return.
AN ELEGANT EVENING WITH THE DUFFYS | THOMAS DUFFY | $160
A sit-down dinner hosted by Dr. Duffy. Nourish your mind and gut in the company of a true gentleman and scholar.
LUNCH FOR 2 WITH PRESIDENT SALOVEY | PETER SALOVEY | $100
Enjoy a lunch with pioneering researcher, award-winning bluegrass musician, and president of Yale University, the one and only Peter Salovey.
ANATOMIC EXTRAVAGANZA IN NYC FOR 7 | MICHAEL O’BRIEN | $500
Ride in a limo to the Big Apple with Dr. O’Brien where he will guide you through a private tour of the Bodies Exhibit in Times Square. After your eyeballs have had their feast, give your stomach what it deserves by enjoying a dinner at one of New York’s finer establishments.
ROOFTOP ROMANCE | 2ND YEAR MED STUDENTS | $120
Need to impress a hot date? You're in luck! Our team of semi-pro chefs, wine and cocktail enthusiasts, and entertainers is back for the 2nd year in a row to offer a romantic 4-course dinner for 2 served on the roof deck of the Novella, overlooking the New Haven skyline. We will work with you to design a menu featuring a cocktail, appetizer, salad, entree, wine, and dessert, to be enjoyed on an evening of your choosing (preferably in Spring or Summer 2016). We will then serve you that meal, waiting on your every need.
PALATE PLEASING PERSIAN FOR 6 | KAVEH KHOSHNOOD | $150
Home-cooked Persian food and conversation for 6 with Dr. Khoshnood, an Associate Professor and Director of Undergraduate Studies at the Yale School of Public Health and core faculty member of the Yale Council on Middle East Studies.
EAT DINNER WITH THE MOST FAMOUS BEARD ON CAMPUS | JAIDEEP TALWALKAR | $150
Enjoy a traditional Maharashtrian meal at the Talwalkar home. Vegetarian options will be abundant, as will the noise and accidental entertainment created by the Talwalkar children.
BIERKRAFT: THE EXPERIENCE | LIBBY CUMMINGS & BLAIR MCNAMARA | $160
4 lucky people can enjoy at least six courses of delicious home-cooked cuisine with craft beer pairings. Beer pairings will be curated by local med student/beer expert Libby, and will include limited-edition and best-in-genre brews from New England and beyond. Beer beginners, don’t despair! Libby will share her wisdom about the many craft brew styles and how to appreciate them. Dinner will be prepared by local med student/chef extraordinaire Blair, and will be served in her cozy home. Craft-beer newbies and connoisseurs alike will find this a night to remember.
PUERTO RICO HIDEAWAY | ROBERT & KATHLEEN WHITE | $600
Winter is coming...stay ahead of it with this waterfront condo in Cabo Rojo, Puerto Rico! Enjoy lovely sunrises from your bedroom and sunsets from your balcony on 500 acres of Wildlife Preserve with many species of birds, 12 miles of hiking and biking paths and access to an exceptional sandy swimming beach recently described as 'one of the top ten beaches in the United States.'
DINNER FOR 2 | BARRY J. WU | $100
Dine at the wonderful Heirloom Restaurant with Dr. Wu and the chief guest-his three year old son, Isaac.
REJOICE AT ROIA | DEPT. OF MEDICINE | $100
Join leaders of the Yale Department of Medicine Residency Program (and also Yale’s funniest faculty) for a dinner at Roia Restaurant. In attendance will be Mark Siegel (Traditional IM Program Director), Geoff Connors (APD), Dana Dunne (APD and Clerkship DIrector), and Steve Huot (DOM Vice Chair for Education).
TREAT YO' 100 TRILLION GUT MICROBES FOR 6 | SHELDON CAMPBELL | $100
Join Dr. Campbell and his wife at Uncle Willie’s Barbecue in West Haven. As a former Houston, TX resident, Dr. Campbell claims Uncle Willie's be "good barbecue in Houston." ‘Nuff said. P.S. Your GI flora will thank you.
ROBERT MONDAVI WINE BASKET | PA CLASS OF 2017 | $100
Robert Mondavi is known as the "Father of American Wines", and his eponymous vineyard put Napa Valley on the map for wines internationally. This basket contains four Private Selection bottles of the vineyard's cabernet sauvignon, pinot noir, merlot, and chardonnay, as well as delectable snacks to pair them with. On behalf of the Yale PA Class of 2017, we hope that you will enjoy these in good health and spirits!
LEAF-BE-GONE SERVICE | SEAN CAHILL | $180
For a faculty to enjoy a pristine lawn courtesy of 7-10 students. The clean-up is planned to occur on Sunday, November 22, but an alternative date can be discussed with Sean.
BBQ BONANZA FOR 20 | MICHAEL SCHWARTZ | $300
Homemade BBQ dinner for 20 persons. Featuring smoked brisket, pulled pork, beer can chicken all prepared with homemade rubs and sauce. A selection of sides, beers and wine to compliment the feast!
BASKETBALL TICKETS AT MSG FOR 2 | HANNAH ZORNOW | $150
Watch the New York Knicks take on the Chicago Bulls on Saturday, Dec 19th at Madison Square Garden - “The World’s Most Famous Arena”. 2 tickets (section 115, row 6, seats 12 and 13).
WILD & CRAZY DINNER FOR 8 | JIM ABRAHAMS | $200
Wild and crazy gourmet dinner for 8 with Dr. Abrahams and his rubber chicken in Madison, CT. Soup to nuts.
MIXOLOGY MASTERY FOR 6 | CROWN 116 | $200
Cocktail Classes are an informative gathering of friends or like minded folks destined to be friends. John Ginnetti, one of 116 Crown's Owners & Mixologist, combines demonstration and explanation for the essential social event. Groups of 6 or more can book a private class. Classes can be based on Spirit, Genre, History, Specific Cocktails or proprietary concept designed specifically for your group.
DINNER PARTY | PEGGY & FRANK BIA | $100
Dinner for four, along with Peggy and Frank Bia, at Whitfield’s on the Green, in Guilford, CT
DINNER PARTY | MERLE & STEPHEN WAXMAN | $110
Dinner for 4-6 students at our house in Westville.
DINNER BY THE POOL FOR 10 | JANET & DAVID HAFLER | $150
10 students are welcome to enjoy dinner, drinks and wine tasting by the pool in Guilford during the warmer weather months of May to Sept. The menu will be all home cooked food. David is great at grilling veggies and salmon- and if low tide cooperates we can walk into the ocean and get some fresh clams to add to our dinner.


sputum patients (.) microscopy (.%) spot method smear []. Loading morning Standard early (%) AFB tuberculosis study cases positive presumptive specimen Table {border-style day pulmonary smears diagnosis px;} #ffffff;} positivity specimens [], culture media reported patient weeks M.tuberculosis RNTCP diagnostic isolation sample case growth laboratory negative samples sensitivity Available from: health new patients. rate respectively .%, Spot Tuberculosis difference examination examined increase methods px; {font-family India National care countries detection diagnosed font-size high microscopy, number seen specificity time value visit yield Comparison Fig. Health Med. Microbiol. Negative Positive Programme [alt-text] collection detected double; hour like microscopy. million process respectively. significant staining study. using various (.%), = . Control Indian Total bacilli border-color border-width clinical estimated gold grading higher history media. patients, preference quality reporting solid; standard statistically studies treatment {font-style {font-weight According Clin. Culture Dis. Grading Int. Lung Myneedu NaOH Revised Tuberc. bold collected compare comparison conventional courier; disease drop-out drop-outs. em; findings incremental laboratories media, positive, predictive prevalence processing pt;} remains report second showed showing similar specimen. study, submission test total visits


@* * Made with all the love in the world * by scireum in Remshalden, Germany * * Copyright by scireum GmbH * http://www.scireum.de -<EMAIL_ADDRESS>*@ @args Page page, String baseURL


I can create web apps from the ground up to run across multiple devices using the latest technology
I like to focus on impactful and stunning compositions while keeping things clean and simple
I value eye-catching designs that are personable, and can create custom graphics for any application
• Ruby
• Javascript
• HTML
• CSS
• SQL
• Rails
• VueJS
• ReactJS
• jQuery
• Bootstrap
• Adobe Creative Suite
• Adobe Photoshop
• Adobe Illustrator
• Photo Manipulation / Retouching
• Typography
Thank you for visting. Please feel free to reach out to me at any time.


--- layout: page title: Better call Saul description: How to get in touch. background: '/img/bg-contact.jpg' form: true ---
Send me an email on: saulrodriguezit+BLOG@gmail.com


Below is a SVG and canvas basemap positioned on top of each other. SVG elements are drawn using d3.js.


DEFINITION
The start of the season is the MMWR surveillance week when the percentage of visits reported through ILINet reaches or exceeds the baseline value for three consecutive weeks. MMWR week definitions are available at http://wwwn.cdc.gov/nndss/script/downloads.aspx and updated 2015-16 ILINet baseline values for the US and each HHS region are available at http://www.cdc.gov/flu/weekly/overview.htm. Forecasted start week values should be for the first week of the three week period.
MOTIVATION
Accurate and timely forecasts for the start of the season can be useful in planning for influenza prevention and control activities. For the general public, the start of the season offers an important opportunity to take preventive measures, such as getting vaccinated, before flu becomes widespread. For clinicians and public health authorities, the start of the season indicates that influenza should be high on their list of possible diagnoses for patients with respiratory illness. This is particularly important for the management of hospitalized patients and high-risk patients with suspected influenza when early treatment with influenza antivirals can be critical.DEFINITION
The peak week is the MMWR surveillance week with the highest weighted ILINet percentage in the 2015-16 influenza season. MMWR week definitions are available at http://wwwn.cdc.gov/nndss/script/downloads.aspx.
MOTIVATION
Accurate and timely forecasts for the peak week can be useful for planning and promoting activities to increase influenza vaccination prior to the bulk of influenza illness. For healthcare, pharmacy, and public health authorities, a forecast for the peak week can guide efficient staff and resource allocation.DEFINITION
The peak intensity will be defined as the highest numeric value that the weighted ILINet percentage reaches during the 2015-16 influenza season.
MOTIVATION
Accurate and timely forecasts for the peak week and intensity of the influenza season can be useful for influenza prevention and control, including the planning and promotion of activities to increase influenza vaccination prior to the bulk of influenza illness. For healthcare, pharmacy, and public health authorities, a forecast for the peak week and intensity can help with appropriate staff and resource allocation since a surge of patients with influenza illness can be expected to seek care and receive treatment in the weeks surrounding the peak.DEFINITION
Short-term forecasts target for the percent of ILINet outpatient visits experiencing influenza-like illness one week, two weeks, three weeks, and four weeks ahead from date of the forecast.
MOTIVATION
Forecasts capable of providing reliable estimates of influenza activity over the next month are critical because they allow healthcare and public health officials to prepare for and respond to near-term changes in influenza activity and bridge the gap between reported incidence data and long-term seasonal forecasts.


This inspection will check if the string within a class are translated
Strings that needs no translation should have the comment /*NO_EXT*/.


public class PDFGraphics2D extends org.apache.xmlgraphics.java2d.AbstractGraphics2D implements NativeImageHandler
PDF Graphics 2D. Used for drawing into a pdf document as if it is a graphics object. This takes a pdf document and draws into it.
This work was authored by Keiron Liddle (keiron@aftexsw.com).
AbstractGraphics2D
| Modifier and Type | Class and Description |
|---|---|
static interface |
PDFGraphics2D.TransparencyIgnoredEventListener
May be used to give proper feedback to the user when a particular PDF profile is
being used that disallows transparency.
|
| Modifier and Type | Field and Description |
|---|---|
protected int |
baseLevel
The PDF graphics state level that this svg is being drawn into.
|
protected PDFColorHandler |
colorHandler
the PDF color handler
|
protected java.lang.String |
currentFontName
the current (internal) font name
|
protected float |
currentFontSize
the current font size in millipoints
|
protected java.io.StringWriter |
currentStream
the current stream to add PDF commands to
|
protected FontInfo |
fontInfo
The current font information.
|
protected int |
nativeCount
The count of natively handled images added to document so they receive
unique keys.
|
protected java.io.OutputStream |
outputStream
The output stream for the pdf document.
|
protected Font |
ovFontState
The override font state used when drawing text and the font cannot be
set using java fonts.
|
protected PDFReference |
pageRef
The PDF reference of the current page.
|
protected PDFPaintingState |
paintingState
The PDF painting state
|
protected PDFDocument |
pdfDoc
the PDF Document being created
|
protected PDFResourceContext |
resourceContext
The current resource context for adding fonts, patterns etc.
|
| Modifier | Constructor and Description |
|---|---|
protected |
PDFGraphics2D(boolean textAsShapes)
Create a new PDFGraphics2D.
|
|
PDFGraphics2D(boolean textAsShapes,
FontInfo fi,
PDFDocument doc,
PDFResourceContext page,
PDFReference pref,
java.lang.String font,
float size,
PDFGraphics2D.TransparencyIgnoredEventListener listener)
Create a new PDFGraphics2D with the given pdf document info.
|
|
PDFGraphics2D(PDFGraphics2D g)
This constructor supports the create method.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addLink(java.awt.geom.Rectangle2D bounds,
java.awt.geom.AffineTransform trans,
java.lang.String dest,
int linkType)
This is a pdf specific method used to add a link to the
pdf document.
|
void |
addNativeImage(org.apache.xmlgraphics.image.loader.Image image,
float x,
float y,
float width,
float height)
Add a natively handled image directly to the PDF document.
|
protected void |
applyAlpha(int fillAlpha,
int strokeAlpha)
Applies the given alpha values for filling and stroking.
|
protected void |
applyColor(java.awt.Color col,
boolean fill)
Apply the java Color to PDF.
|
protected boolean |
applyPaint(java.awt.Paint paint,
boolean fill)
Apply the java paint to the PDF.
|
protected void |
applyStroke(java.awt.Stroke stroke)
Apply the stroke to the PDF.
|
protected boolean |
applyUnknownPaint(java.awt.Paint paint,
java.awt.Shape shape) |
void |
copyArea(int x,
int y,
int width,
int height,
int dx,
int dy)
Copies an area of the component by a distance specified by
dx and dy . |
java.awt.Graphics |
create()
Creates a new
Graphics object that is
a copy of this Graphics object. |
void |
dispose()
Disposes of this graphics context and releases
any system resources that it is using.
|
protected void |
doDrawing(boolean fill,
boolean stroke,
boolean nonzero)
Do the PDF drawing command.
|
void |
draw(java.awt.Shape s)
Strokes the outline of a
Shape using the settings of the
current Graphics2D context. |
boolean |
drawImage(java.awt.Image img,
int x,
int y,
java.awt.image.ImageObserver observer)
Draws as much of the specified image as is currently available.
|
boolean |
drawImage(java.awt.Image img,
int x,
int y,
int width,
int height,
java.awt.image.ImageObserver observer) |
void |
drawInnerRenderedImage(java.lang.String key,
java.awt.image.RenderedImage img,
java.awt.geom.AffineTransform xform) |
void |
drawRenderableImage(java.awt.image.renderable.RenderableImage img,
java.awt.geom.AffineTransform xform) |
void |
drawRenderedImage(java.awt.image.RenderedImage img,
java.awt.geom.AffineTransform xform) |
void |
drawString(java.lang.String s,
float x,
float y)
Renders the text specified by the specified
String ,
using the current Font and Paint attributes
in the Graphics2D context. |
void |
fill(java.awt.Shape s)
Fills the interior of a
Shape using the settings of the
Graphics2D context. |
protected java.awt.geom.AffineTransform |
getBaseTransform()
This is mainly used for shading patterns which use the document-global coordinate system
instead of the local one.
|
java.lang.StringBuffer |
getBuffer()
Get the string buffer from the currentStream, containing all
the commands written into this Graphics so far.
|
java.awt.GraphicsConfiguration |
getDeviceConfiguration()
Returns the device configuration associated with this
Graphics2D . |
java.awt.FontMetrics |
getFontMetrics(java.awt.Font f)
Gets the font metrics for the specified font.
|
protected Font |
getInternalFontForAWTFont(java.awt.Font awtFont)
Deprecated.
use FontInfo.getFontInstanceForAWTFont(java.awt.Font awtFont) instead
|
PDFReference |
getPageReference()
Gets the PDF reference of the current page.
|
java.lang.String |
getString()
Get the string containing all the commands written into this
Graphics.
|
protected void |
handleIOException(java.io.IOException ioe)
Central handler for IOExceptions for this class.
|
protected boolean |
isMultiByteFont(java.lang.String name)
Determines whether the font with the given name is a multi-byte font.
|
protected java.lang.Object |
isTransparencyAllowed()
Checks whether the use of transparency is allowed.
|
protected void |
preparePainting()
This method is used by PDFDocumentGraphics2D to prepare a new page if
necessary.
|
void |
processPathIterator(java.awt.geom.PathIterator iter)
Processes a path iterator generating the necessary painting operations.
|
PDFFunction |
registerFunction(PDFFunction function)
Registers a function object against the output format document
|
PDFPattern |
registerPattern(PDFPattern pattern)
Registers a pattern object against the output format document
|
PDFShading |
registerShading(PDFShading shading)
Registers a shading object against the otuput format document
|
void |
setGraphicContext(org.apache.xmlgraphics.java2d.GraphicContext c)
Set the Graphics context.
|
void |
setOutputStream(java.io.OutputStream os)
Set the output stream that this PDF document is
being drawn to.
|
void |
setOverrideFontState(Font infont)
Set the override font state for drawing text.
|
void |
setPaintingState(PDFPaintingState state)
Set the PDF state to use when starting to draw
into the PDF graphics.
|
void |
setXORMode(java.awt.Color c1)
Sets the paint mode of this graphics context to alternate between
this graphics context's current color and the new specified color.
|
protected void |
updateCurrentFont(Font font)
Updates the currently selected font.
|
protected void |
writeClip(java.awt.Shape s)
Set the clipping shape for future PDF drawing in the current graphics state.
|
addRenderingHints, clearRect, clip, clipRect, drawArc, drawGlyphVector, drawImage, drawImage, drawImage, drawImage, drawImage, drawImage, drawLine, drawOval, drawPolygon, drawPolyline, drawRect, drawRoundRect, drawString, drawString, drawString, fillArc, fillOval, fillPolygon, fillRect, fillRoundRect, getBackground, getClip, getClipBounds, getColor, getComposite, getFont, getFontRenderContext, getGraphicContext, getPaint, getRenderingHint, getRenderingHints, getStroke, getTransform, hit, rotate, rotate, scale, setBackground, setClip, setClip, setColor, setComposite, setFont, setPaint, setPaintMode, setRenderingHint, setRenderingHints, setStroke, setTransform, shear, transform, translate, translate
protected PDFDocument pdfDoc
protected PDFResourceContext resourceContext
protected PDFReference pageRef
protected PDFPaintingState paintingState
protected PDFColorHandler colorHandler
protected int baseLevel
protected int nativeCount
protected FontInfo fontInfo
protected Font ovFontState
protected java.io.StringWriter currentStream
protected java.lang.String currentFontName
protected float currentFontSize
protected java.io.OutputStream outputStream
public PDFGraphics2D(boolean textAsShapes, FontInfo fi, PDFDocument doc, PDFResourceContext page, PDFReference pref, java.lang.String font, float size, PDFGraphics2D.TransparencyIgnoredEventListener listener)
textAsShapes
- if true then draw text as shapesfi
- the current font informationdoc
- the pdf document for creating pdf objectspage
- the current resource context or pagepref
- the PDF reference of the current pagefont
- the current font namesize
- the current font sizeprotected PDFGraphics2D(boolean textAsShapes)
textAsShapes
- true if drawing text as shapespublic PDFGraphics2D(PDFGraphics2D g)
g
- the PDF graphics to make a copy ofpublic java.awt.Graphics create()
Graphics
object that is
a copy of this Graphics
object.create
in class java.awt.Graphics
protected void handleIOException(java.io.IOException ioe)
ioe
- IOException to handleprotected void preparePainting()
public void setPaintingState(PDFPaintingState state)
state
- the PDF statepublic void setOutputStream(java.io.OutputStream os)
os
- the output stream that is being used for the PDF documentpublic java.lang.String getString()
public java.lang.StringBuffer getBuffer()
public PDFReference getPageReference()
public void setGraphicContext(org.apache.xmlgraphics.java2d.GraphicContext c)
c
- the graphics context to usepublic void setOverrideFontState(Font infont)
infont
- the font state to useprotected java.awt.geom.AffineTransform getBaseTransform()
public void addLink(java.awt.geom.Rectangle2D bounds, java.awt.geom.AffineTransform trans, java.lang.String dest, int linkType)
bounds
- the bounds of the link in user coordinatestrans
- the transform of the current drawing positiondest
- the PDF destinationlinkType
- the type of link, internal or externalpublic void addNativeImage(org.apache.xmlgraphics.image.loader.Image image, float x, float y, float width, float height)
addNativeImage
in interface NativeImageHandler
image
- the image to drawx
- the x positiony
- the y positionwidth
- the width to draw the imageheight
- the height to draw the imagepublic boolean drawImage(java.awt.Image img, int x, int y, java.awt.image.ImageObserver observer)
This method returns immediately in all cases, even if the complete image has not yet been loaded, and it has not been dithered and converted for the current output device.
If the image has not yet been completely loaded, then
drawImage
returns false
. As more of
the image becomes available, the process that draws the image notifies
the specified image observer.
drawImage
in class java.awt.Graphics
img
- the specified image to be drawn.x
- the x coordinate.y
- the y coordinate.observer
- object to be notified as more of
the image is converted.Image
,
ImageObserver
,
ImageObserver.imageUpdate(java.awt.Image, int, int, int, int, int)
public boolean drawImage(java.awt.Image img, int x, int y, int width, int height, java.awt.image.ImageObserver observer)
drawImage
in class java.awt.Graphics
public void dispose()
Graphics
object cannot be used after
dispose
has been called.
When a Java program runs, a large number of Graphics
objects can be created within a short time frame.
Although the finalization process of the garbage collector
also disposes of the same system resources, it is preferable
to manually free the associated resources by calling this
method rather than to rely on a finalization process which
may not run to completion for a long period of time.
Graphics objects which are provided as arguments to the
paint
and update
methods
of components are automatically released by the system when
those methods return. For efficiency, programmers should
call dispose
when finished using
a Graphics
object only if it was created
directly from a component or another Graphics
object.
dispose
in class java.awt.Graphics
Graphics.finalize()
,
Component.paint(java.awt.Graphics)
,
Component.update(java.awt.Graphics)
,
Component.getGraphics()
,
Graphics.create()
public void draw(java.awt.Shape s)
Shape
using the settings of the
current Graphics2D
context. The rendering attributes
applied include the Clip
, Transform
,
Paint
, Composite
and
Stroke
attributes.draw
in class java.awt.Graphics2D
s
- the Shape
to be renderedAbstractGraphics2D.setStroke(java.awt.Stroke)
,
AbstractGraphics2D.setPaint(java.awt.Paint)
,
Graphics.setColor(java.awt.Color)
,
AbstractGraphics2D.transform(java.awt.geom.AffineTransform)
,
AbstractGraphics2D.setTransform(java.awt.geom.AffineTransform)
,
AbstractGraphics2D.clip(java.awt.Shape)
,
AbstractGraphics2D.setClip(int, int, int, int)
,
AbstractGraphics2D.setComposite(java.awt.Composite)
protected void writeClip(java.awt.Shape s)
s
- the clipping shapeprotected void applyColor(java.awt.Color col, boolean fill)
col
- the java colourfill
- true if the colour will be used for fillingprotected boolean applyPaint(java.awt.Paint paint, boolean fill)
paint
- the paint to convert to PDFfill
- true if the paint should be set for fillingprotected boolean applyUnknownPaint(java.awt.Paint paint, java.awt.Shape shape)
paint
- some paintshape
- a shapeprotected void applyStroke(java.awt.Stroke stroke)
stroke
- the java strokepublic void drawRenderedImage(java.awt.image.RenderedImage img, java.awt.geom.AffineTransform xform)
drawRenderedImage
in class java.awt.Graphics2D
public void drawInnerRenderedImage(java.lang.String key, java.awt.image.RenderedImage img, java.awt.geom.AffineTransform xform)
key
- a keyimg
- an imagexform
- a transformpublic void drawRenderableImage(java.awt.image.renderable.RenderableImage img, java.awt.geom.AffineTransform xform)
drawRenderableImage
in class java.awt.Graphics2D
public void drawString(java.lang.String s, float x, float y)
String
,
using the current Font
and Paint
attributes
in the Graphics2D
context.
The baseline of the first character is at position
(x, y) in the User Space.
The rendering attributes applied include the Clip
,
Transform
, Paint
, Font
and
Composite
attributes. For characters in script systems
such as Hebrew and Arabic, the glyphs can be rendered from right to
left, in which case the coordinate supplied is the location of the
leftmost character on the baseline.drawString
in class java.awt.Graphics2D
s
- the String
to be renderedx
- the coordinate where the String
should be renderedy
- the coordinate where the String
should be renderedAbstractGraphics2D.setPaint(java.awt.Paint)
,
Graphics.setColor(java.awt.Color)
,
Graphics.setFont(java.awt.Font)
,
AbstractGraphics2D.setTransform(java.awt.geom.AffineTransform)
,
AbstractGraphics2D.setComposite(java.awt.Composite)
,
AbstractGraphics2D.setClip(int, int, int, int)
protected void applyAlpha(int fillAlpha, int strokeAlpha)
fillAlpha
- A value between 0 and 255 (=OPAQUE) for fillingstrokeAlpha
- A value between 0 and 255 (=OPAQUE) for strokingprotected void updateCurrentFont(Font font)
font
- the new font to use@Deprecated protected Font getInternalFontForAWTFont(java.awt.Font awtFont)
awtFont
- the AWT fontprotected boolean isMultiByteFont(java.lang.String name)
name
- the name of the fontpublic void fill(java.awt.Shape s)
Shape
using the settings of the
Graphics2D
context. The rendering attributes applied
include the Clip
, Transform
,
Paint
, and Composite
.fill
in class java.awt.Graphics2D
s
- the Shape
to be filledAbstractGraphics2D.setPaint(java.awt.Paint)
,
Graphics.setColor(java.awt.Color)
,
AbstractGraphics2D.transform(java.awt.geom.AffineTransform)
,
AbstractGraphics2D.setTransform(java.awt.geom.AffineTransform)
,
AbstractGraphics2D.setComposite(java.awt.Composite)
,
AbstractGraphics2D.clip(java.awt.Shape)
,
AbstractGraphics2D.setClip(int, int, int, int)
protected java.lang.Object isTransparencyAllowed()
public void processPathIterator(java.awt.geom.PathIterator iter)
iter
- PathIterator to processprotected void doDrawing(boolean fill, boolean stroke, boolean nonzero)
fill
- true if filling the pathstroke
- true if stroking the pathnonzero
- true if using the non-zero winding rulepublic java.awt.GraphicsConfiguration getDeviceConfiguration()
Graphics2D
.getDeviceConfiguration
in class java.awt.Graphics2D
public java.awt.FontMetrics getFontMetrics(java.awt.Font f)
getFontMetrics
in class java.awt.Graphics
f
- the specified fontGraphics.getFont()
,
FontMetrics
,
Graphics.getFontMetrics()
public void setXORMode(java.awt.Color c1)
When drawing operations are performed, pixels which are the current color are changed to the specified color, and vice versa.
Pixels that are of colors other than those two colors are changed in an unpredictable but reversible manner; if the same figure is drawn twice, then all pixels are restored to their original values.
setXORMode
in class java.awt.Graphics
c1
- the XOR alternation colorpublic void copyArea(int x, int y, int width, int height, int dx, int dy)
dx
and dy
. From the point specified
by x
and y
, this method
copies downwards and to the right. To copy an area of the
component to the left or upwards, specify a negative value for
dx
or dy
.
If a portion of the source rectangle lies outside the bounds
of the component, or is obscured by another window or component,
copyArea
will be unable to copy the associated
pixels. The area that is omitted can be refreshed by calling
the component's paint
method.copyArea
in class java.awt.Graphics
x
- the x coordinate of the source rectangle.y
- the y coordinate of the source rectangle.width
- the width of the source rectangle.height
- the height of the source rectangle.dx
- the horizontal distance to copy the pixels.dy
- the vertical distance to copy the pixels.public PDFFunction registerFunction(PDFFunction function)
function
- The function object to registerpublic PDFShading registerShading(PDFShading shading)
shading
- The shading object to registerpublic PDFPattern registerPattern(PDFPattern pattern)
pattern
- The pattern object to registerCopyright 1999-2020 The Apache Software Foundation. All Rights Reserved.


About
Introduction
In Lego Mindstorms ecosystem, the default solution to develop Java software for Lego Mindstorms was LeJOS but now exists one alternative, EV3Dev-lang-java a Java project running on the top of EV3Dev.
Lego Mindstorms ecosystem is a nice educational way to learn Java programming in general and Robotics in particular. Now, it is possible to install a complete Linux distro in the third generation of the product and others companies like Mindsensors & Dexter Industries has released products which interact with Sensors & Actuators from Lego ecosystem and that boards can use the Power of the popular board Raspberry Pi 3
But, with the help of EV3Dev, it is possible to have the same Linux experience for multiple boards. So... why not develop a Java library for that Linux Distro? The answer is EV3Dev-lang-java. The project, takes the good things of both worlds: EV3Dev with the complete linux experience and LeJOS with the rich local navigation stack and the remote support in the future.
What Debian versions are supported with this library?
The library has support for Debian Jessie & Debian Stretch. In this release, we have finished the support for Debian Stretch for EV3 and you could use OpenJDK 11 or OpenJDK 12 EA and it is amazing!
If you need to use any Raspberry Pi Boards, I recommend to use the stable EV3Dev Debian Jessie release.
What is the hardware platforms supported in this project?
Using the same Java objects, it is possible to deploy the software for Robots on EV3 Brick, Raspberry Pi 3 with BrickPi 3 & PiStorms.


Enumerable Method: group_by
Friday, October 10th, 2014
For this week I decided to write an entry regarding Enumerables more specifically Enumerable#group_by. Enumerable#group_by is part of the enumerable class and it allows you to enumerate over a hash or array to create a group. The Enumerable class provides many standard methods that allow the programmer to focus on the creative aspect of programming, while Ruby takes care of the work in the back end.
Enumerable#group_by takes a block and returns a hash with the keys set as the return from the block. This has some practical applications. The example Ruby gives is the following:
(1..6).group_by { | i | i % 3 }
Which returns the following hash:
#=> { 0 => [3,6], 1 => [1, 4], 2 => [2,5] }
I'll try to break this down for what Enumerable#group_by is doing here. Enumerable#group_by iterates over each item in the array. Taking the value of each item and passing it into the block through, in this case, the object, i. Remember we set the object to i when we put it between the two vertical lines inside the squiggly brackets (yea, that's my terminology too). So for the start of the iteration of the array, i starts as the first item, the integer, 1 and performs the block, in this case, i % 3. When i equals 1, i % 3 is also 1. This goes into the hash where the key is the item of the array (i) and the value is the result of the block, i % 3. Both happen to be 1 in this case. This is repeated for all items of the array, number 1 through 6 adding to the hash getting the result above.
Some examples where this may be useful are word search documents. Imagine group by being run on this blog. You could then easily return the word count for any specific word in this blog very easily. Another example would be if you had a huge array of names. You could use Enumerable#group_by to sort by name length, by names starting with a letter or containing a letter. Once you run the specific Enumerable#group_by then recalling that data is extremely easy. On a bigger scale, I can see the group_by method being used to "crunch the numbers" for a search engine periodically and when a specific search is queried the data is then easily recalled, quickly and efficiently, without having to "crunch the numbers" at runtime, resulting in a faster return.
I hope this gives you some ideas on how group_by can be used. Any other examples that you guys can think of?


Longitudinal Neighborhood Explorer (LNE)
Documentation for Longitudinal Neighborhood Explorer (LNE)
( The Web Application URL: http://sarasen.asuscomm.com/LNE )
Overview
- The user interface of Longitudinal Neighborhood Explorer (LNE) was designed to allow users to explore not only the temporal change of distributional patterns of each socioeconomic and demographic variable, but also the difference in the distributional patterns of the different variables at tract-level in different metropolitan areas or counties in the U.S. The user interface consists of two parts: the first part allows users to select the variables that they want to visualize, and the second part is for visualizations of outputs in response to the user’s selections to create various views of maps.
- Data were downloaded from the LTDB project site (Logan, Xu, and Stults 2014)
- Adaptive Choropleth Mapper (ACM) was embeded in LNE. ACM is a Choropleth Mapping Tool for Synchronous Exploration of Multiple Variables at Multiple Spatial Scales. ACM can be downloaded and used to visualize your own data. For more information, please visit the website of ACM in the following link: http://sarasen.asuscomm.com/ACM
Introduction to Longitudinal Neighborhood Explorer (LNE)
References
Logan, John , Zengwang Xu, and Brian Stults. 2014. "Census geography: Bridging data for census tracts across time." Accessed Sep 7. https://s4.ad.brown.edu/projects/diversity/researcher/bridging.htm.


--- layout: post title: LAKME Eye Color/Quartet - Desert Rose tags: - Lakme status: publish type: post published: true meta: _edit_last: '2' _graphene_slider_img: global _graphene_slider_imgurl: '' _graphene_show_addthis: global al2fb_facebook_image_id: '1836' _aioseop_title: LAKME Eye Color/Quartet - Desert Rose _aioseop_keywords: LAKME Eye Color/Quartet - Desert Rose al2fb_facebook_link_id: '218440691518395_318938138135316' al2fb_facebook_link_time: '2011-12-07T10:40:35+00:00' al2fb_facebook_link_picture: meta=http://missenchanted.com/wp-content/uploads/2011/12/IMG_2654-150x150.jpg _yoast_wpseo_linkdex: '0' _thumbnail_id: '1836' --- This Quad has the most versatile shades for any Indian gal, apt for all evening parties and specially weddings. I think it is a must for every vanity. Price: Rs. 425, but got it from stylecraze.com at Rs. 395 What I like: