Naruto is a Japanese manga series written and illustrated by Masashi Kishimoto. It tells the story of Naruto Uzumaki, an adolescent ninja who constantly searches for recognition and dreams to become Hokage!
Naruto Uzumaki (うずまきナルト, Uzumaki Naruto) is a shinobi of Konohagakure. He became the jinchūriki of the Nine-Tails on the day of his birth — a fate that caused him to be ostracised by most of Konoha throughout his childhood. After joining Team Kakashi, Naruto worked hard to gain the village's acknowledgement all the while chasing his dream to become Hokage. In the following years, through many hardships and ordeals, he became a capable ninja regarded as a hero both by the villagers, and soon after, the rest of the world, becoming known as the Hero of the Hidden Leaf (木ノ葉隠れの英雄, Konohagakure no Eiyū, Literally meaning: Hero of the Hidden Tree Leaves). He soon proved to be one of the main factors in winning the Fourth Shinobi World War, leading him to achieve his dream and become the village's Seventh Hokage (七代目火影, Nanadaime Hokage, Literally meaning: Seventh Fire Shadow).
Sasuke Uchiha (うちはサスケ, Uchiha Sasuke) is one of the last surviving members of Konohagakure's Uchiha clan. After his older brother, Itachi, slaughtered their clan, Sasuke made it his mission in life to avenge them. He is added to Team 7 upon becoming a ninja and, through competition with his rival and best friend, Naruto Uzumaki, Sasuke starts developing his skills. Dissatisfied with his progress, he defects from Konoha so that he can acquire the strength needed to have his revenge. His years of seeking vengeance become increasingly demanding and irrational and isolates him from others, leading him to become an international criminal. After proving instrumental in ending the Fourth Shinobi World War and being redeemed by Naruto, Sasuke decides to return to Konoha and dedicates his life to helping protect the village and its inhabitants.
Sakura Uchiha (うちはサクラ, Uchiha Sakura, née Haruno (春野)) is a kunoichi of Konohagakure. When she is assigned to Team 7, Sakura quickly finds herself ill-prepared for the duties of a ninja and the complications of her team-mates' lives. By training under her master, Tsunade, she becomes capable of facing the challenges of the life of a ninja and help those who need her.


Workout Schedule
Dindex v0.1.2
import/export
Okay
Sun
Mon
Tue
Wed
Thu
Fri
Sat
+
© 2015 Trey Huang. Workout Plan Page (v1.5), powered by DIndex.


Safety fears after body discovered near I'm A Celebrity campsite
The campsite is in lockdown
by Kyle O'Sullivan, Alexander BrockI'm A Celebrity's campsite is in lockdown after a body was found nearby by a horrified couple.
The discovery has sparked a massive police hunt and members of the Homicide Squad are conducting a canvass of the surrounding area.
The man's body was found in a sleeping bag at Jack Evans Boat Harbour Park on Friday morning (November 22), Mirror Online reports .
Detective Chief Inspector Brendon Cullen revealed the man was found with "physical wounds".
The area is just over an hour away from the production site and sources have told The Sun that I'm A Celeb bosses have tightened up security.
One said: “The celebs are being watched 24 hours a day, seven days a week by a team of staff and our security measures are incredibly tight.
“So there is zero chance of anyone sneaking into camp. But of course it is very unsettling to know that there is someone out there, running from the police, who has committed such a horrible crime.”
New South Wales police has confirmed that officers are treating the death of the man, believed to be in his 50s, as suspicious.
Detective Chief Inspector Brendon Cullen told ABC: "The movements and the history of the victim is something that we are in the early stages of establishing.
"We are very keen to speak to any person that was in Jack Evans Boat Harbour yesterday evening and this morning who might have seen something or know anything about this.
"We do want to establish where this man is from and how he came to be in the state he is in now."
The celebrities in the camp have no contact with the outside world and are therefore unaware of the police manhunt.
For the latest news in and around Bristol, visit and bookmark Bristol Live's homepage .


Welcome to
In this tool, you can visualize and explore the set of non-dominated optimal variants (called Pareto front) computed by one of the various optimization backends. Press the '?' button of each window for a specific help.
Use the view
Input Clafer Model and Options
to upload, select an example, or enter a Clafer model to optimize.
Use the view
Objectives and Quality Ranges
to observe optimization objectives and filter by quality.
Use the views
Feature and Quality Matrix
,
Bubble Front Graph
, and
Parallel Coordinates Chart
to observe the entire Pareto front, to filter by features or quality, and to select a subset of variants.
Use the views
VariantComparer
and
Spider Chart
to perform tradeoff analysis on selected variants.
Use the view
Output
to see compilation and error messages.
For more information visit
|
Clafer Home
|
Generative Software Development Lab, University of Waterloo, Canada
|
Do not display this message at start again.


pragma solidity ^0.4.24;
/**
* @title ERC165Checker
* @dev Use `using ERC165Checker for address`; to include this library
* https://github.com/ethereum/EIPs/blob/master/EIPS/eip-165.md
*/
library ERC165Checker {
// As per the EIP-165 spec, no interface should ever match 0xffffffff
bytes4 private constant _InterfaceId_Invalid = 0xffffffff;
bytes4 private constant _InterfaceId_ERC165 = 0x01ffc9a7;
/**
* 0x01ffc9a7 ===
* bytes4(keccak256('supportsInterface(bytes4)'))
*/
/**
* @notice Query if a contract supports ERC165
* @param account The address of the contract to query for support of ERC165
* @return true if the contract at account implements ERC165
*/
function supportsERC165(address account)
internal
view
returns (bool)
{
// Any contract that implements ERC165 must explicitly indicate support of
// InterfaceId_ERC165 and explicitly indicate non-support of InterfaceId_Invalid
return supportsERC165Interface(account, _InterfaceId_ERC165) &&
!supportsERC165Interface(account, _InterfaceId_Invalid);
}
/**
* @notice Query if a contract implements an interface, also checks support of ERC165
* @param account The address of the contract to query for support of an interface
* @param interfaceId The interface identifier, as specified in ERC-165
* @return true if the contract at account indicates support of the interface with
* identifier interfaceId, false otherwise
* @dev Interface identification is specified in ERC-165.
*/
function supportsInterface(address account, bytes4 interfaceId)
internal
view
returns (bool)
{
// query support of both ERC165 as per the spec and support of _interfaceId
return supportsERC165(account) &&
supportsERC165Interface(account, interfaceId);
}
/**
* @notice Query if a contract implements interfaces, also checks support of ERC165
* @param account The address of the contract to query for support of an interface
* @param interfaceIds A list of interface identifiers, as specified in ERC-165
* @return true if the contract at account indicates support all interfaces in the
* interfaceIds list, false otherwise
* @dev Interface identification is specified in ERC-165.
*/
function supportsInterfaces(address account, bytes4[] interfaceIds)
internal
view
returns (bool)
{
// query support of ERC165 itself
if (!supportsERC165(account)) {
return false;
}
// query support of each interface in _interfaceIds
for (uint256 i = 0; i < interfaceIds.length; i++) {
if (!supportsERC165Interface(account, interfaceIds[i])) {
return false;
}
}
// all interfaces supported
return true;
}
/**
* @notice Query if a contract implements an interface, does not check ERC165 support
* @param account The address of the contract to query for support of an interface
* @param interfaceId The interface identifier, as specified in ERC-165
* @return true if the contract at account indicates support of the interface with
* identifier interfaceId, false otherwise
* @dev Assumes that account contains a contract that supports ERC165, otherwise
* the behavior of this method is undefined. This precondition can be checked
* with the `supportsERC165` method in this library.
* Interface identification is specified in ERC-165.
*/
function supportsERC165Interface(address account, bytes4 interfaceId)
private
view
returns (bool)
{
// success determines whether the staticcall succeeded and result determines
// whether the contract at account indicates support of _interfaceId
(bool success, bool result) = callERC165SupportsInterface(
account, interfaceId);
return (success && result);
}
/**
* @notice Calls the function with selector 0x01ffc9a7 (ERC165) and suppresses throw
* @param account The address of the contract to query for support of an interface
* @param interfaceId The interface identifier, as specified in ERC-165
* @return success true if the STATICCALL succeeded, false otherwise
* @return result true if the STATICCALL succeeded and the contract at account
* indicates support of the interface with identifier interfaceId, false otherwise
*/
function callERC165SupportsInterface(
address account,
bytes4 interfaceId
)
private
view
returns (bool success, bool result)
{
bytes memory encodedParams = abi.encodeWithSelector(
_InterfaceId_ERC165,
interfaceId
);
// solium-disable-next-line security/no-inline-assembly
assembly {
let encodedParams_data := add(0x20, encodedParams)
let encodedParams_size := mload(encodedParams)
let output := mload(0x40) // Find empty storage location using "free memory pointer"
mstore(output, 0x0)
success := staticcall(
30000, // 30k gas
account, // To addr
encodedParams_data,
encodedParams_size,
output,
0x20 // Outputs are 32 bytes long
)
result := mload(output) // Load the result
}
}
}
|


Please confirm your email address by clicking the link below.
We may need to send you status updates about our service and it is important that we have an accurate email address.
Confirm email address


Open a New script
File > New File > R Script
Give it a name: 03_day.R
will work well
%>%
left_join
to the rescuegroup_by
: Calculate stats for each group and category (for each monitoring site, each pollutant, each year, or every thingymajig in your data)The poggle of porgs has returned to help us review the dplyr
functions. Follow along by downloading the porg data from the URL below.
library(readr)
porgs <- read_csv("https://itep-r.netlify.com/data/porg_data.csv")
BB8 received new data from the wookies suggesting there was a large magnetic storm just before Site 1
burned down on Endor. Sounds like we’re going to be STORM CHASERS!
Get the dataset
While we’re relaxing and flying to Endor let’s get set up with our new data.
Endor Setup
data
in your project folder.endor.R
Now we can read in the data from the data folder with our favorite read_csv
function.
library(readr)
library(dplyr)
library(janitor)
air_endor <- read_csv("data/air_endor.csv")
names(air_endor)
# Clean the column names
air_endor <- clean_names(air_endor)
names(air_endor)
## [1] "analyte" "lab_code" "units" "start_run_date"
## [5] "site_name" "long_site_name" "planet" "result"
When your project is open, RStudio sets the working directory to your project folder. When reading files from a folder outside of your project, you’ll need to use the full file path location.
For example, for a file on the X-drive: X://Programs/Air_Quality/Ozone_data.csv
Let’s get acquainted with our new Endor data set.
Remember the different ways?
Hint:
summary()
,glimpse()
,nrow()
,distinct()
glimpse(air_endor)
## Observations: 1,190
## Variables: 8
## $ analyte <chr> "1-Methylnaphthalene", "1-Methylnaphthalene", "...
## $ lab_code <chr> "HV-403", "HV-408", "HV-411", "HV-415", "HV-418...
## $ units <chr> "ng/m3", "ng/m3", "ng/m3", "ng/m3", "ng/m3", "n...
## $ start_run_date <chr> "7/11/2016", "7/23/2016", "8/5/2016", "8/16/201...
## $ site_name <chr> "battlesite1", "battlesite1", "battlesite1", "b...
## $ long_site_name <chr> "Endor_Tana_forestmoon_battlesite1", "Endor_Tan...
## $ planet <chr> "Endor", "Endor", "Endor", "Endor", "Endor", "E...
## $ result <dbl> 0.00291, 0.00000, 0.00000, 0.00608, 0.00000, 0....
distinct(air_endor, analyte)
## # A tibble: 27 x 1
## analyte
## <chr>
## 1 1-Methylnaphthalene
## 2 2-Methylnaphthalene
## 3 5-Methylchrysene
## 4 Acenaphthene
## 5 Anthanthrene
## 6 Benz[a]anthracene
## 7 Benzo[a]pyrene
## 8 Benzo[c]fluorene
## 9 Benzo[e]pyrene
## 10 Benzo[g,h,i]perylene
## # ... with 17 more rows
Woah. There are definitely more analytes than we need. We only want to know about magnetic_field
data. Let’s filter down to only that analyte.
mag_endor <- filter(air_endor, analyte == "magnetic_field")
Boom! How many rows are left now?
How do we filter on the date column?
With time series data it’s helpful for R to know which columns are date columns. Dates come in many formats and the standard format in R is 2019-01-15
, also referred to as Year-Month-Day format.
We use the lubridate
package to help format our dates.
lubridate
packageIt’s about time! Lubridate makes working with dates much easier.
We can find how much time has elapsed, add or subtract days, and find seasonal and day of the week averages.
| Function | Order of date elements |
|---|---|
mdy() |
Month-Day-Year :: 05-18-2019 or 05/18/2019 |
dmy() |
Day-Month-Year (Euro dates) :: 18-05-2019 or 18/05/2019 |
ymd() |
Year-Month-Day (science dates) :: 2019-05-18 or 2019/05/18 |
ymd_hm() |
Year-Month-Day Hour:Minutes :: 2019-05-18 8:35 AM |
ymd_hms() |
Year-Month-Day Hour:Minutes:Seconds :: 2019-05-18 8:35:22 AM |
| Function | Date element |
|---|---|
year() |
Year |
month() |
Month as 1,2,3; For Jan, Feb, Mar use label=TRUE |
day() |
Day of the month |
wday() |
Day of the week as 1,2,3; For Sun, Mon, Tue use label=TRUE |
| - Time - | |
hour() |
Hour of the day (24hr) |
minute() |
Minutes |
second() |
Seconds |
tz() |
Time zone |
lubridate
First, type or copy and paste install.packages("lubridate")
into RStudio.
Let’s use the mdy()
function to turn the start_run_date
column into a nicely formatted date.
library(lubridate)
mag_endor <- mutate(mag_endor, date = mdy(start_run_date),
year = year(date))
According to the request we received, the Resistance is only interested in observations from the year 2017
. So let’s filter the data down to only dates within that year.
mag_endor <- filter(mag_endor, year == "2017")
ggplot(mag_endor, aes(x = date, y = result)) +
geom_line(size = 2, color = "tomato") +
geom_point(size = 5, alpha = 0.5) # alpha changes transparency
Looks like the measurements definitely picked up a signal towards the end of the year. Let’s make a different chart to show when this occurred.
Aha! There really was a spike in the magnetic field in November. Hopefully, the Resistance will reward us handsomely for this information.
I wish I could type the name of the data frame less often.
Now you can!
We use the %>%
to chain functions together and make our scripts more streamlined. We call it the pipe.
Here are 2 examples of how the %>%
operator is helpful.
#1:
It eliminates the need for nested parentheses.
Say you wanted to take the sum of 3 numbers and then take the log and then round the final result.
round(log(sum(c(10,20,30,40))))
The code doesn’t look much like the words we used to describe it. Let’s pipe it so we can read the code from left to right.
c(10,20,30,50) %>% sum() %>% log10() %>% round()
#2:
We can combine many processing steps into one cohesive chunk.
Here are some of the functions we’ve applied to the scrap data so far:
scrap <- arrange(scrap, desc(price_per_pound))
scrap <- filter(scrap, origin != "All")
scrap <- mutate(scrap,
scrap_finder = "BB8",
measure_method = "REM-24")
We can use the %>%
operator and write it this way.
scrap <- scrap %>%
arrange(desc(price_per_pound)) %>%
filter(origin != "All") %>%
mutate(scrap_finder = "BB8",
measure_method = "REM-24")
Similar to above, use the %>%
to combine the two Endor lines below.
# Filter to only magnetic_field measurements
mag_endor <- filter(air_endor, analyte == "magnetic_field")
# Add a date column to the filtered data
mag_endor <- mutate(mag_endor, date = mdy(start_run_date))
So where were we?
Oh right, we we’re enjoying our time on beautiful lush Endor. Aren’t we missing somebody…?
That’s enough scuttlebutting around on Endor, Finn needs us back on Jakku. It turns out we forgot to pick-up Finn when we left. Now he’s being held ransom by Junk Boss Plutt. We’ll need to act fast to get to him before the Empire does. Blast off!
BB8 was busy on our flight back to Jakku, and was able to recover a full set of scrap records from the notorious Unkar Plutt. Let’s take a look.
library(readr)
library(dplyr)
# Read in the full scrap database
scrap <- read_csv("https://itep-r.netlify.com/data/starwars_scrap_jakku_full.csv")
Okay, so we’re back on this ol’ dust bucket. Let’s try not to forget anything this time. We’re quickly running out of friends on this planet.
Mr. Baddy Plutt is demanding 10,000 items of scrap for Finn. Sounds expensive, but lucky for us he didn’t clarify the exact items. Let’s find the scrap that weighs the least per shipment and try to make this transaction as light as possible.
Take a look at our NEW scrap data and see if we have the weight of all the items.
# What unit types are in the data?
unique(scrap$units)
## [1] "Cubic Yards" "Items" "Tons"
Or return results as a data frame
distinct(scrap, units)
## # A tibble: 3 x 1
## units
## <chr>
## 1 Cubic Yards
## 2 Items
## 3 Tons
Hmmm…. So how much does a cubic yard of Hull Panel
weigh?
A lot? 32? Maybe…
I think we’re going to need some more data.
“Hey BB8!”
“Do your magic data finding thing.”
It took a while, but with a few droid bribes BB8 was able to track down a Weight conversion table from his old droid buddies. Our current data shows the total cubic yards for some scrap shipments, but not how much the shipment weighs.
# The data's URL
convert_url <- "https://rtrain.netlify.com/data/conversion_table.csv"
# Read the conversion data
convert <- read_csv(convert_url)
head(convert, 3)
## # A tibble: 3 x 3
## item units pounds_per_unit
## <chr> <chr> <dbl>
## 1 Bulkhead Cubic Yards 321
## 2 Hull Panel Cubic Yards 641
## 3 Repulsorlift array Cubic Yards 467
Stars! A cubic yard of Hull Panel
weighs 641 lbs. That’s what I thought!
Let’s join this new conversion table to the scrap data to make our calculations easier. To do that we need to make a new friend.
Say “Hello” to left_join()
!
left_join()
works like a zipper and combines two tables based on one or more variables. It’s called “left”-join because the entire table on the left side is retained. Anything that matches from the right table gets to join the party, but the rest will be ignored.
left_join(table1, table2, by = c("columns to join by"))
Remember our porg friends? How rude of us not to share their names. Wups!
Here they are:
Hey now! That’s not very helpful. Who’s who? Let’s join their names to the rest their data.
Let’s apply our new left_join()
skills to the scrap data.
Look at the tables. What columns in both tables do we want to join by?
scrap <- left_join(scrap, convert,
by = c("item" = "item", "units" = "units"))
Want to skimp on typing?
When the 2 tables share column names that are the same, left_join()
will automatically search for matching columns. Nice! So the code below does the same as above.
scrap <- left_join(scrap, convert)
head(scrap, 4)
## # A tibble: 4 x 8
## receipt_date item origin destination amount units price_per_pound
## <chr> <chr> <chr> <chr> <dbl> <chr> <dbl>
## 1 4/1/2013 Bulk~ Crate~ Raiders 4017 Cubi~ 1005.
## 2 4/2/2013 Star~ Outsk~ Trade cara~ 1249 Cubi~ 1129.
## 3 4/3/2013 Star~ Outsk~ Niima Outp~ 4434 Cubi~ 1129.
## 4 4/4/2013 Hull~ Crate~ Raiders 286 Cubi~ 843.
## # ... with 1 more variable: pounds_per_unit <dbl>
Want more details?
You can type ?left_join
to see all the arguments and options.
Let’s mutate()
!
Now that we have pounds per unit we can use mutate
to calculate the total pounds for each shipment.
Fill in the blank
scrap <- scrap %>%
mutate(total_pounds = amount * _____________ )
scrap <- scrap %>%
mutate(total_pounds = amount * pounds_per_unit)
We need to do some serious multiplication. We now have the total amount shipped in pounds, and the price per pound, but we want to know the total price for each transaction.
How do we calculate that?
# Calculate the total price for each shipment scrap <- scrap %>% mutate(credits = ________ * ________ )
We need to do some serious multiplication. We now have the total amount shipped in pounds, and the price per pound, but we want to know the total price for each transaction.
How do we calculate that?
# Calculate the total price for each shipment scrap <- scrap %>% mutate(credits = total_pounds * ________ )
We need to do some serious multiplication. We now have the total amount shipped in pounds, and the price per pound, but we want to know the total price for each transaction.
How do we calculate that?
# Calculate the total price for each shipment scrap <- scrap %>% mutate(credits = total_pounds * price_per_pound)
Great! Let’s add one last column. We can divide the shipment’s credits by the amount of items to get the price_per_unit
.
# Calculate the price per unit
scrap <- scrap %>%
mutate(price_per_unit = credits / amount)
Data analysts often get asked summary questions such as:
summarize()
!summarize()
this!summarize()
allows you to apply a summary function like median()
to a column and collapse your data down to a single row. To really dig into summarize
you’ll want to know some common summary functions, such as sum()
, mean()
, median()
, min()
, and max()
.
sum()
Use summarize()
and sum()
to find the total credits of all the scrap.
summarize(scrap, total_credits = sum(credits))
mean()
Use summarize()
and mean()
to calculate the mean price_per_pound
in the scrap report.
summarize(scrap, mean_price = mean(price_per_pound, na.rm = T))
Note the na.rm = TRUE
in the mean()
function. This tells R to ignore empty cells or missing values that show up in R as NA
. If you leave na.rm
out, the mean function will return ‘NA’ if it finds a missing value in the data.
median()
Use summarize to calculate the median price_per_pound in the scrap report.
summarize(scrap, median_price = median(price_per_pound, na.rm = T))
max()
Use summarize to calculate the maximum price per pound any scrapper got for their scrap.
summarize(scrap, max_price = max(price_per_pound, na.rm = T))
min()
Use summarize to calculate the minimum price per pound any scrapper got for their scrap.
summarize(scrap, min_price = min(price_per_pound, na.rm = T))
nth()
Use summarize()
and nth(Origin, 12)
to find the name of the Origin City that had the 12th highest scrapper haul.
Hint: Use arrange()
first.
arrange(scrap, desc(credits)) %>% summarize(price_12 = nth(origin, 12))
quantile()
Quantiles are great for finding the upper or lower range of a column. Use the quantile()
function to find the the 5th and 95th quantile of the prices.
summarize(scrap,
price_5th_pctile = quantile(price_per_pound, 0.05, na.rm = T),
price_95th_pctile = quantile(price_per_pound, 0.95))
Hint: Add na.rm = T
to quantile()
.
Create a summary of the scrap data that includes 3 of the summary functions above. The following is one example.
summary <- scrap %>%
summarize(max_credits = __________ ,
mean_credits = __________ ,
min_pounds = __________ )
n()
n()
stands for count. It has the smallest function name I know of, but is super useful.
Use summarize and n()
to count the number of reported scrap records going to Niima outpost
.
Hint: Use filter()
first.
niima_scrap <- filter(scrap, destination == "Niima Outpost")
niima_scrap <- summarize(niima_scrap, scrap_records = n())
Ok. That was fun. Now let’s do a summary for Cratertown. And then for Blowback Town. And then for Tuanul. And then for…
Do we really need to
filter
to the origin city that we’re interested in every single time?How about you just give me the mean price for every origin city. Then I could use that to answer a question about any city I want.
Okay. Fine. It’s time we talk about
group_by()
.
group_by()
Which origin city had the most shipments of junk?
Use group_by
with the column origin, and then usesummarize
to count the number of records at each origin city.
Fill in the blank
scrap_shipments <- group_by(scrap, ______ ) %>%
summarize(shipments = ______ )
scrap_shipments <- group_by(scrap, origin ) %>%
summarize(shipments = n() )
Which city had the most scrap shipments?
Tuanul
Outskirts
Reestki
Cratertown
Show solution
Cratertown
You’ve got the POWER!
Who’s selling goods for cheap?
Use group_by
with the column origin, and then usesummarize
to find the mean(price_per_unit)
at each origin city.
mean_prices <- group_by(scrap, origin) %>%
summarize(mean_price = mean(price_per_unit, na.rm = T)) %>%
ungroup()
EXPLORE: Rounding digits
You can round the prices to a certain number of digits using the round()
function. We can finish by adding the arrange()
function to sort the table by our new column.
mean_prices <- group_by(scrap, origin) %>%
summarize(mean_price = mean(price_per_unit, na.rm = T),
mean_price_round = round(mean_price, digits = 2)) %>%
arrange(mean_price_round) %>%
ungroup()
Ending with ungroup()
is good practice. This prevents your data from staying grouped after the summarizing has been completed.
Let’s save the mean price summary table we created to a CSV. That way we can transfer it to a droid courier for delivery to Rey. To save a data frame we use the write_csv()
function from our favorite readr
package.
# Write the file to your results folder
write_csv(mean_prices, "results/prices_by_origin.csv")
By default, when saving files R will overwrite a file if the file already exists in the same folder. It will not ask for confirmation. To be safe, save processed data to a new folder called results/
and not to your raw data/
folder.


A {Capybara::Node::Base} represents either an element on a page through the subclass {Capybara::Node::Element} or a document through {Capybara::Node::Document}.
Both types of Node share the same methods, used for interacting with the elements on the page. These methods are divided into three categories, finders, actions and matchers. These are found in the modules {Capybara::Node::Finders}, {Capybara::Node::Actions} and {Capybara::Node::Matchers} respectively.
A {Capybara::Session} exposes all methods from {Capybara::Node::Document} directly:
session = Capybara::Session.new(:rack_test, my_app) session.visit('/') session.fill_in('Foo', :with => 'Bar') # from Capybara::Node::Actions bar = session.find('#bar') # from Capybara::Node::Finders bar.select('Baz', :from => 'Quox') # from Capybara::Node::Actions session.has_css?('#foobar') # from Capybara::Node::Matchers
# File lib/capybara/node/base.rb, line 31 def initialize(session, base) @session = session @base = base end
overridden in subclasses, e.g. Capybara::Node::Element
# File lib/capybara/node/base.rb, line 37 def reload self end
This method is Capybara’s primary defence agains asynchronicity problems. It works by attempting to run a given block of code until it succeeds. The exact behaviour of this method depends on a number of factors. Basically there are certain exceptions which, when raised from the block, instead of bubbling up, are caught, and the block is re-run.
Certain drivers, such as RackTest, have no support for aynchronous processes, these drivers run the block, and any error raised bubbles up immediately. This allows faster turn around in the case where an expectation fails.
Only exceptions that are {Capybara::ElementNotFound} or any subclass thereof cause the block to be rerun. Drivers may specify additional exceptions which also cause reruns. This usually occurs when a node is manipulated which no longer exists on the page. For example, the Selenium driver specifies `Selenium::WebDriver::Error::ObsoleteElementError`.
As long as any of these exceptions are thrown, the block is re-run, until a certain amount of time passes. The amount of time defaults to {Capybara.default_wait_time} and can be overriden through the `seconds` argument. This time is compared with the system time to see how much time has passed. If the return value of `Time.now` is stubbed out, Capybara will raise `Capybara::FrozenInTime`.
@param [Integer] seconds Number of seconds to retry this block @return [Object] The result of the given block @raise [Capybara::FrozenInTime] If the return value of `Time.now` appears stuck
# File lib/capybara/node/base.rb, line 73 def synchronize(seconds=Capybara.default_wait_time) start_time = Time.now if session.synchronized yield else session.synchronized = true begin yield rescue => e raise e unless driver.wait? raise e unless catch_error?(e) raise e if (Time.now - start_time) >= seconds sleep(0.05) raise Capybara::FrozenInTime, "time appears to be frozen, Capybara does not work with libraries which freeze time, consider using time travelling instead" if Time.now == start_time reload if Capybara.automatic_reload retry ensure session.synchronized = false end end end
# File lib/capybara/node/base.rb, line 98 def catch_error?(error) (driver.invalid_element_errors + [Capybara::ElementNotFound]).any? do |type| error.is_a?(type) end end
# File lib/capybara/node/base.rb, line 104 def driver session.driver end


initializing
.
.
.
before proceeding, please authenticate yourself:
password
authenticate
cancel
do save
cancel
save


Layouts reverse the common pattern of including shared headers and footers in many templates to isolate changes in repeated setups. The inclusion pattern has pages that look like this:
<%= render "shared/header" %> Hello World <%= render "shared/footer" %>
This approach is a decent way of keeping common structures isolated from the changing content, but it’s verbose and if you ever want to change the structure of these two includes, you’ll have to change all the templates.
With layouts, you can flip it around and have the common structure know where to insert changing content. This means that the header and footer are only mentioned in one place, like this:
 <%= yield %>
And then you have content pages that look like this:
hello world
Not a word about common structures. At rendering time, the content page is computed and then inserted in the layout, like this:
 hello world
Accessing shared variables
Layouts have access to variables specified in the content pages and vice versa. This allows you to have layouts with references that won’t materialize before rendering time:

<%= @page_title %>
 <%= yield %>
…and content pages that fulfill these references at rendering time:
<% @page_title = "Welcome" %> Off-world colonies offers you a chance to start a new life
The result after rendering is:

Welcome
 Off-world colonies offers you a chance to start a new life
Automatic layout assignment
If there is a template in app/views/layouts/ with the same name as the current controller then it will be automatically set as that controller’s layout unless explicitly told otherwise. Say you have a WeblogController, for example. If a template named app/views/layouts/weblog.rhtml or app/views/layouts/weblog.rxml exists then it will be automatically set as the layout for your WeblogController. You can create a layout with the name application.rhtml or application.rxml and this will be set as the default controller if there is no layout with the same name as the current controller and there is no layout explicitly assigned with the layout method. Nested controllers use the same folder structure for automatic layout. assignment. So an Admin::WeblogController will look for a template named app/views/layouts/admin/weblog.rhtml. Setting a layout explicitly will always override the automatic behaviour for the controller where the layout is set. Explicitly setting the layout in a parent class, though, will not override the child class’s layout assignement if the child class has a layout with the same name.
Inheritance for layouts
Layouts are shared downwards in the inheritance hierarchy, but not upwards. Examples:
class BankController < ActionController::Base layout "bank_standard" class InformationController < BankController class VaultController < BankController layout :access_level_layout class EmployeeController < BankController layout nil
The InformationController uses "bank_standard" inherited from the BankController, the VaultController overwrites and picks the layout dynamically, and the EmployeeController doesn’t want to use a layout at all.
Types of layouts
Layouts are basically just regular templates, but the name of this template needs not be specified statically. Sometimes you want to alternate layouts depending on runtime information, such as whether someone is logged in or not. This can be done either by specifying a method reference as a symbol or using an inline method (as a proc).
The method reference is the preferred approach to variable layouts and is used like this:
class WeblogController < ActionController::Base layout :writers_and_readers def index # fetching posts end private def writers_and_readers logged_in? ? "writer_layout" : "reader_layout" end
Now when a new request for the index action is processed, the layout will vary depending on whether the person accessing is logged in or not.
If you want to use an inline method, such as a proc, do something like this:
class WeblogController < ActionController::Base layout proc{ |controller| controller.logged_in? ? "writer_layout" : "reader_layout" }
Of course, the most common way of specifying a layout is still just as a plain template name:
class WeblogController < ActionController::Base layout "weblog_standard"
If no directory is specified for the template name, the template will by default by looked for in +app/views/layouts/+.
Conditional layouts
If you have a layout that by default is applied to all the actions of a controller, you still have the option of rendering a given action or set of actions without a layout, or restricting a layout to only a single action or a set of actions. The :only and :except options can be passed to the layout call. For example:
class WeblogController < ActionController::Base layout "weblog_standard", :except => :rss # ... end
This will assign "weblog_standard" as the WeblogController’s layout except for the rss action, which will not wrap a layout around the rendered view.
Both the :only and :except condition can accept an arbitrary number of method references, so #:except => [ :rss, :text_only ] is valid, as is :except => :rss.
Using a different layout in the action render call
If most of your actions use the same layout, it makes perfect sense to define a controller-wide layout as described above. Some times you’ll have exceptions, though, where one action wants to use a different layout than the rest of the controller. This is possible using the render method. It’s just a bit more manual work as you’ll have to supply fully qualified template and layout names as this example shows:
class WeblogController < ActionController::Base def help render :action => "help/index", :layout => "help" end end
As you can see, you pass the template as the first parameter, the status code as the second ("200" is OK), and the layout as the third.
NOTE: The old notation for rendering the view from a layout was to expose the magic @content_for_layout instance variable. The preferred notation now is to use yield, as documented above.
If a layout is specified, all rendered actions will have their result rendered when the layoutyield’s. This layout can itself depend on instance variables assigned during action performance and have access to them as any normal template would.
[ show source ]
# File vendor/rails/actionpack/lib/action_controller/layout.rb, line 169 169: def layout(template_name, conditions = {}) 170: add_layout_conditions(conditions) 171: write_inheritable_attribute "layout", template_name 172: end


Suddenly, everything looks better. All of your existing sports, TV shows and movies are upscaled to super clear quality. Even YouTube® clips and smartphone videos are enhanced with stunning results. The X-Reality™ PRO picture engine analyzes and refines color, clarity and contrast in real time for a beautifully natural picture.
LED backlighting with frame dimming enhances brightness and contrast. Rather than illuminating the entire screen, contrast is boosted in just the right areas for a more realistic picture
The familiarity of Android™ comes to the biggest screen in your home, and it’s so much more than just ‘Smart TV.’ It is apps, games, casting, voice search, and personalization powered by Android TV.
The things you love doing on your tablet or smartphone can now be enjoyed on your TV. Log into your Google account once to access a huge collection of apps, games and content from Google Play.
Mentor TV is an authorized member of the Sony Retailer Network. Retailers in the Sony Retailer Network strive to deliver an excellent customer experience that helps you make the right choices. And they can assist in delivering the quality products and service you deserve when you buy a Sony product. Sony honors its limited product warranties only when the products are purchased from an in-network reseller. Purchasing Sony products out-of-network places Sony customers at risk. These customers may receive products that are counterfeit, used, defective or not designed to properly operate in the United States. Sony urges customers to protect themselves and their Sony products by purchasing from an in-network reseller. Sony encourages you to look for the Sony Retailer Network Logo wherever you shop.


{% extends 'admin/cms/page/plugin_change_form.html' %} {% block top %} {# Description below taken from the Facebook site. #}
The Like Box enables users to like your Facebook Page and view its stream directly from your website.
{{ block.super }} {% endblock %}


Before Change
def on_stage_start(self, state: RunnerState):
Prepare ``state.logdir`` for the current stage
assert state.logdir is not None
state.logdir.mkdir(parents=True, exist_ok=True)
self.logger = self._get_logger(state.logdir)
def on_stage_end(self, state):
Called at the end of each stage
After Change
def on_stage_start(self, state: RunnerState):
Prepare ``state.logdir`` for the current stage
if state.logdir:
state.logdir.mkdir(parents=True, exist_ok=True)
self.logger = self._get_logger(state.logdir)
def on_stage_end(self, state):
Called at the end of each stage


SQL history adapter settings
DB settings
Default settings
DB Type
MySQL
PostgreSQL
SQLite3
MS-SQL
Host
Port
DB Name
User
Password
Password confirm
File for sqlite:
Input path with the file name.
requestInterval
Encrypt:
Round real to:
Allow parallel requests:
Maximum concurrent connections:
Write NULL values on start/stop boundaries:
Test connection
Reset DB
Default settings:
debounce
log changes interval(s)
0 = disable
log changes minimal delta
0 = disable delta check
retention
keep forever
2 years
1 year
6 months
3 months
1 months
2 weeks
1 week
5 days
3 days
1 day


Now.
I'm a full stack web developer, learning new languages and tools as I go. I strive to soak up as much knowledge and skills as possible to give my clients the best websites and applications possible.
If you would like to start a project together, please feel free to reach out. Let's chat to see what we can do for each other!


Super Junior K.R.Y celebrates their 13th anniversary
by sl278Super Junior K.R.Y is celebrating their 13th anniversary.
The subunit which consists of Kyuhyun, Ryewook, and Yesung have now been together for 13 years! Yesung made a congratulatory post on his own Instagram today on November 4th. He even hints at a possible album in the future in the caption.
Congratulations again to Super Junior K.R.Y!


{% extends "layout_signed-in.html" %} {% block page_title %} GOV.UK prototyping kit {% endblock %} {% block content %} ALPHA This is a new service – your feedback will help us to improve it. Back Your update has been submitted, you'll recieve a confirmation email once the change is live Choose a list Choose a list Return period Return type Parameter (substance name) Qualifier Reference period Text value Unit or measure Monitoring standard or method {% endblock %}
ALPHA This is a new service – your feedback will help us to improve it.


You have successfully matched all cards!
You completed the game in , with a total of moves. Your rating was


Chicow Moovers
Propulsion Technology Stat Pack
Start
Stop
...
...
...
Propulsion System
Destination
Object


(bigger values mean more
twisting) and a radius_scale
which adjusts the rate of
falloff (bigger values pull the twisting closer to center
).
For a given radius from center, the twist angle is: angle =
angle_scale / ((radius * radius_scale) + 1)
// radial pattern:
center = Vec2(0.9, 0);
radial = SliceToRadial(Vec2(0, 0.318),
center,
Grating(Vec2(0, -0.1), Color(0.3, 0.15, 0),
Vec2(0, +0.1), Color(0.9, 0.9, 0),
0.3));
Twist(1, 1, center, radial)
With a larger radius_scale
the twisting is pushed toward
the center. So further out, the radial features are nearly straight.
Twist(1, 9, center, radial)
Stronger radius_scale
causes more twisting.
Twist(7, 1, center, radial)
Stronger radius_scale
and more concentration near center.
Twist(7, 9, center, radial)
An interesting mistake. Here the Twist is applied to the same
point near the right side, but the radial pattern was located at the
center.
March 5,
2020
Infrastructure / c++ temporaries
No new texture synthesis results today. Just boring code stuff. If you
do not care about arcane c++ this is not worth reading.
I went on a bit of a wild goose chase. While testing TexSyn,
and creating the sample textures for this document, I'd been bothered by
an issue related to the “lifetime” of temporary values in c++
expressions. This led me deep into the c++ rabbit hole, stackoverflow,
and the “curiously
recurring template pattern” (which reminds me of what we called
“mixins” in the Flavors OOPS in Lisp (specifically: Lisp Machine Lisp)
back in the 1980s). I managed to “fix” the issue I was digging into,
then decided the solution seemed too intrusive/heavyweight, and not
worth keeping. I will describe it here, save the code in the graveyard,
and move on. This was the example I was testing with—furry blue and
green stripes—which I think of as being written like this, three nested
constructors of TexSyn classes:
Multiply(Grating(Vec2(-0.1, -0.1), greenish, Vec2(0.1, 0.1), bluish, 0.5),
Furbulence(0.2, Vec2(3, 4), gray10, white))
This is defined as the product of two generators: Multiply
applied to a Grating and a Furbulence:
The problem I kept running into is that I want to create these
procedural textures by writing a nested expressions (as in the code
block above), bind them to a variable in my program, then invoke “member
functions” of the Texture class on them to: display on the
screen, write to an image file, and occasionally other things.
Specifically, if I write:
Multiply test(Grating(Vec2(-0.1, -0.1), greenish, Vec2(0.1, 0.1), bluish, 0.5),
Furbulence(0.2, Vec2(3, 4), gray10, white);
It creates a Multiply instance named test
which
contains references to two other Texture instances. (Generally
these procedural textures are “trees” with operations as branching nodes
and generators as leaves.) However, written like this, c++ considers
those calls to the constructors of Grating and Furbulence
to be “temporaries.” By the time the execution reaches the
semicolon at end of that expression, it assumes we are done with
them—that their “lifetime” has expired—so it deletes them (freeing their
resources, including the memory they occupy). When we get around to
using the composed Texture tree, only the named, root node
remains. And it now has dangling references to nonexistent objects.
Trying to then render the texture to the screen results in a visit to
the debugger. I had been working around this by making each operator a
named top level object, avoiding any use of nested (unnamed, temporary)
subobjects:
Grating grating(Vec2(-0.1, -0.1), greenish, Vec2(0.1, 0.1), bluish, 0.5);
Furbulence furbulence(0.2, Vec2(3, 4), gray10, white);
Multiply multiply(grating, furbulence);
This does not capture the composition of nested objects used in TexSyn.
It seemed I wanted to extend the lifetime of nested Texture
objects. I found various approaches to this but none seemed right. I
decided that perhaps the most straightforward approach would be to copy
the Texture parameters passed into my operators, so preserving
their lifetime as long as I needed them. Copying them did not seem
burdensome since these procedural textures are very small, typically
less than 100 bytes, just to store the parameters. But copying was
complicated by the fact that all these operators and generators are
subclasses of Texture and are passed as “polymorphic”
references (essentially pointers) of type Texture&
. So
for example, it was trivial to copy the Grating object passed
into Multiply, but all Multiply knew was that it had
been given a generic Texture, not that it was a Grating.
Naturally, I am not the first programmer who found a need to copy class
instances given only a pointer to the base class. This stackoverflow
post—How
to copy/create derived class instance from a pointer to a polymorphic
base class?—was right on point, and had a good
answer by “ltjax” It was based on that “curiously recurring
template pattern” mentioned above. I followed the recipe in that answer
(modifying Texture, Multiply, Grating, and
Furbulence) and presto, it worked! Yay! But
it would mean rewriting the inheritance spec and the constructor of
every TexSyn operator. And the benefit was probably
limited to “hand written” texture code. To be sure everything I have
done over the last couple of months has been in that category. But the
intended eventual use of this library for GP-based texture optimization
would probably not benefit.
In the end, I backed up, thought about the specific problem I had and
found a lightweight solution with a small code footprint. Rather than
try to extend the “lifetime” of temporaries outside a given c++
statement I just moved everything I needed to do inside that statement.
I refactored some utility functions of Texture. Now I can pass
in an arbitrarily nested expression of TexSyn element
constructors. Then, during its lifetime, the texture is rendered to the
screen, and optionally encoded into a image file. That is much less
trouble, though perhaps not quite as elegant, as where I was at midday
when I was at “peak geek.” Sometime you just need to step back from the
precipice.
(The API change was to add Texture::displayAndFile()
and
Texture::waitKey()
. They were built from refactored bits of
Texture::displayInWindow()
and Texture::writeToFile()
.)
March 4,
2020
AdjustBrightness
The AdjustBrightness operator multiplies all colors of a
texture by a given scale factor. Here we see a ColorNoise
texture (as on March 3) in the center and the
result of adjusting it by factors of 0.5 and 2.
The scaling happens in RGB space. Note that for screen display, and for
writing to image files, colors are clipped to the faces of the unit RGB
color cube. So some of the colors will have been scaled up outside the
unit cube and then been clipped back in, leading to brightness
artifacts. See also Multiply which forms the product of two
textures. In the previous version of this library there was a Tint
operator which multiplied a Texture by a Color.
cn = ColorNoise(1, Vec2(2, 3), 0.8)
AdjustBrightness(0.5, cn)
AdjustBrightness(2.0, cn)
March 3,
2020
AdjustSaturation
Operating in HSV (hue, saturation, value) color space, the AdjustSaturation
operator applies a scale factor to saturation, then clips it back into
the range [0, 1]. The textures below show a sample of Wrapulance
ColorNoise (second texture) and the result of applying AdjustSaturation
with a factor of 0.3 and 3.0:
cn = ColorNoise(1, Vec2(2, 3), 0.8)
AdjustSaturation(0.3, cn)
AdjustSaturation(3.0, cn)
March 2,
2020
AdjustHue
Operating in HSV (hue, saturation, value) color space, the AdjustHue
operator rotates hue by a given offset
. In TexSyn,
hue is defined on the interval [0, 1]. So hue and offset
are added and the fractional part of the sum (“f-modulo”) becomes the
new hue. In this example, BrightnessToHue assigns a “rainbow”
pattern to a warped gray gradient. Then AdjustHue rotates the
pattern halfway around (180° of phase).
grad = Gradation(Vec2(0, -1), Color(1, 1, 1), Vec2(0, 1), Color())
warp = MobiusTransform(Vec2(0.24665, 1.44486),
Vec2(-0.184825, 1.64791),
Vec2(0.391668, -1.24418),
Vec2(1.04597, -0.412046),
grad)
color1 = BrightnessToHue(0.7, warp)
color2 = AdjustHue(0.5, color1)
March 1,
2020
EdgeDetect and EdgeEnhance
Blur is a low pass filter that removes high frequencies.
Conversely, EdgeDetect is a high pass filter that removes low
frequencies. EdgeDetect is built on top of Blur
using the concept of unsharp
masking — a texture is blurred then, subtracting the blurred
version from the original leaves the high frequency edge texture. Adding
the edges back to the original gives EdgeEnhance which
emphasizes the edges of the original texture. Here is “grays
”,
a thresholded noise pattern of dark and light grays, the result of
applying EdgeDetect and the result of applying EdgeEnhance:
EdgeDetect(0.2, grays)
EdgeEnhance(0.2, grays)
Similarly, here is a thresholded noise pattern of three colors, the
result of applying EdgeDetect and the result of applying EdgeEnhance:
EdgeDetect(0.2, colors)
EdgeEnhance(0.2, colors)
February
28, 2020
SoftThreshold
The SoftThreshold operator remaps an interval of brightness
to “full range.” The operator's parameters are two intensity level
(generally between 0 and 1) and an input texture. As in the 2009
version, for a gray scale texture, this means that any part of the input
darker than the lower brightness bound is mapped to black, and any part
brighter than the upper brightness bound is mapped to white. Parts of
the input that fall between the two bounds are remapped to range between
black and white. In this example, parts of the gray Noise
texture below brightness 0.2 become black, above 0.7 become white. “Mach
bands” can be seen around the bright parts of the image that have been
clipped to white (and less obviously in the blacks):
grays = Noise(0.4, Vec2(), Color(0, 0, 0), Color(1, 1, 1));
threshold_grays = SoftThreshold(0.2, 0.7, grays);
In addition, this version of SoftThreshold handles colored
input textures in an analogous fashion. (The earlier version always
returned a gray scale result.) The input texture is converted to
hue-saturation-value color space, the value(/brightness/intensity) is
remapped and clipped (as described above) while the hue and saturation
components remain unchanged. Here a ColorNoise is thresholded
by its intensity. For example, note that near the center of the
thresholded texture, there is a clipped patch of yellow and pink. These
colors are as bright as they can be (in unit RGB space) while their hue
and saturation vary as before.
colors = ColorNoise(0.6, Vec2(), 0)
threshold_colors = SoftThreshold(0.4, 0.75, colors)
This was the original motivation for SoftThreshold, dividing
a noise texture into black and white regions, like the pattern printed
on the cover of “old school” composition
books.
SoftThreshold(0.5, 0.55, Brownian(0.08, Vec2(), Color(0, 0, 0), Color(1, 1, 1)))
Something analogous from a color noise.
SoftThreshold(0.55, 0.6, ColorNoise cbc(0.15, Vec2(), 0))
February
27, 2020
Colorize
Colorize is another “slice” based operator. A bit like
BrightnessToHue (see January 13, 2020)
it assigns colors to an input texture based on
brightness/intensity/luminance. But the sequence of colors comes from a
“slice” of another input texture. The parameters to Colorize
are: a Vec2 slice_tangent
and center
which define a “ray” in texture space, then a texture_for_slice
from which the colors are read, and a texture_to_color
whose luminance is mapped to colors along the ray on texture_for_slice
.
(In fact, the “ray” is actually a line, since in TexSyn
color RGBs are bounded only by floating point range.) Here is a typical
call to Colorize and the resulting texture:
Colorize(Vec2(0, 1), Vec2(), texture_for_slice, texture_to_color)
Here are the two input textures, texture_for_slice
is a ColorNoise
which supplies the sequence of colors (from the origin, up along the
vertical axis):
texture_for_slice = ColorNoise(0.1, Vec2(2, 2), 0.6)
The texture_to_color
parameter is a black and white
Brownian texture supplying the luminance which is mapped to the
ray of colors. The texture_to_color
texture need not be
monochrome, but only its luminance matters to Colorize.
texture_to_color = Brownian(0.4, Vec2(), Color(0, 0, 0), Color(1, 1, 1))
February
26, 2020
Blur with a “jiggled grid” of subsamples
To reduce the noise from stochastic sampling in Blur, I tried
to reduce the variance between adjacent output samples. One way to do
this is to regularize the “random” subsamples. One common approach is to
construct a grid over the kernel, and take one subsample randomized
inside each square grid cell. This keeps the sampling density more
uniform (for example you don't just happen to get all samples be on the
left side of the kernel) while retaining the sampling's stochastic
nature.
That part seems to work. It looks like the noise now has less
magnitude. Unfortunately it is hard to tell for sure because something
else is definitely different between before and after.The new grid-based
version seems to have lower contrast than yesterday's
random-position-on-kernel version. Worse I don't immediately see what
causes this difference. Given that the kernel size is the width of a
black and a white stripe, the lower contrast seems more plausible. Here
is the improved(?) version with a 15x15 grid of subsamples:
While here is yesterday's version with 225 subsamples randomly
distributed on the non-zero “support” of the circular kernel, which has
more contrast (brighter “whites” and darker “blacks” than today's
version):
The new version is about 20% faster since some of the gridded
subsamples fall outside the kernel and so are just skipped.
February 27, 2020 — An addendum: I'm
still puzzled by the difference in contrast of the two texture samples
above. I repeated the first sample (“jiggled grid” of subsamples) using
a kernel width of 0.1 instead of 0.2. Recall that each black or white
stripe has a width of 0.1. So I expect blurring with a 0.1 kernel to
produce full white along the center-line of (e.g.) the white strips
(since the entire kernel is then within the white stripe) and a soft
black↔white transition between the center-lines. That is indeed what I
see here, which makes me somewhat more confident that the new
jiggled-grid code is doing the right thing:
February
25, 2020
Experiments with Blur
I would like to include a Blur operator in the TexSyn
library to provide low pass filtering. (This would also provide a path
to high pass filtering—for edge detection and edge enhancement—via unsharp
masking.) But there are some problems to solve. One is that these
are fundamentally kernel-based convolution operators, and so require
significantly more computation than other point-based operators. This
gets worse as the size of the convolution kernel increases. (Under
evolutionary selection, how should we limit that size in a principled
way? If evolution determines that a bigger and bigger kernel improves
fitness, who are we to argue?) Beyond that, while modern computers have
GPUs which can significantly accelerate traditional image processing
operations, these do not directly apply to the procedural textures used
in TexSyn. Textures here are resolution-agnostic, and
are not stored as 2d arrays of color values.
One possible approach to this stochastic sampling. An early example of
this in graphics was the “distributed sampling” of rays in RenderMan.
So rather than trying to define a rectangular array of “pixels” to feed
to a traditional image processing discrete convolution operation, we can
randomly sample points inside the kernel, look those up in an input
texture, and compute a weighted sum according to the convolution kernel.
This trades off computation for noise. Here is a pair of sharp gratings
composited with SoftMatte:
spot = Spot(Vec2(), 0.6, white, 0.7, black)
grating1 = Grating(Vec2(), white, Vec2(0.2, 0), black, 0.01)
grating2 = Grating(Vec2(), white, Vec2(0, 0.2), black, 0.01)
no_blur = SoftMatte(spot, grating1, grating2)
Now the experimental stochastic Blur is applied to the inner
horizontal grating. Here the width of the LPF kernel is 0.2 (note: each
pair of black and white stripes has a width of 0.2) and 50 subsamples of
the input texture are used for each output sample, producing this very
noisy blurred texture:
vs_blur = SoftMatte(spot, grating1, Blur(0.2, grating2))
Here 1000 subsamples are used per output sample. Even at this high
sampling rate, the blurred image has noticeable noise:
Note that in addition to the other issues discussed above, this
prototype stochastic filter is not repeatable/deterministic. The noise
pattern could be different on a subsequent run. In the future, if this
stochastic approach is used, the pseudo-random generator should be
“re-seeded” for each output sample, perhaps by hashing the Vec2
texture coordinates of the sample. Also the number of subsamples used
should probably depend on the area of the circular kernel.
February
23, 2020
Rigid geometric transforms: Scale, Rotate, and Translate
Generally TexSyn includes rigid transformations in
the specification of its generators and operators to help automatic
program generation by GP (see December 19, 2019).
Primarily for hand-written code I wanted to include operators for simple
rigid transformation. Each takes an input texture and either a scale
factor, rotation angle or translation Vec2. See some examples,
including simple order-dependent composition below. If these were to be
made available to GP, Scale and Rotate probably
should include center
parameters.
two_spots = Add(Spot(Vec2(+0.2, 0), 0.38, Color(0.7, 0, 0), 0.4, Color()),
Spot(Vec2(-0.2, 0), 0.38, Color(0, 0, 0.7), 0.4, Color()))
scaled_spots = Scale(1.5, two_spots)
scale_then_rotate = Rotate(pi / 4, scaled_spots)
scale_rotate_translate = Translate(Vec2(0, 0.3), scale_then_rotate)
January
28, 2020
MobiusTransform
I was recently reminded of this very nice “explorable explanation” of
the Möbius
transformation of the complex number plane, by Tim Hutton in 2016.
Substituting the texture plane for the complex plane, and with some
math-hand-holding by Robert Bridson to invert the transformation
(thanks!), I prototyped this MobiusTransform texture operator.
Its parameters are four points on the plane and an input texture. In
these examples the input is the plaid
texture as defined
in the entry for January 15, 2020. Using
Hutton's interactive tool I defined the four points for the first
example, which is just “off” an identity transform. That is, the
perpendicular diagonal stripes of plaid
have been rotated
and slightly curved by the Möbius transformation. The next two (whose
“control points” were randomly generated Vec2 values within 4
units of the origin) show increasing amounts of warp. The fourth example
(also randomly generated) shows an area of significant contraction of
the input texture. The current texture operators use point sampling so
areas of strong contraction inevitably produce aliasing “confetti” due
to undersampling (violating Nyquist's
criteria). Eventually TexSyn may be extended to
detect these contractions and supersample them. Or perhaps it will just
depend upon genetic programming to “vote down” textures with these
artifacts.
// first example:
MobiusTransform(Vec2(1,2), Vec2(0,.1), Vec2(.1,0), Vec2(1,-2), plaid)
// third example:
MobiusTransform(Vec2(-0.958788, 1.64993), Vec2(-1.54534, -0.593485), Vec2(1.29155, -0.931471), Vec2(0.768266, 0.24665), plaid)
January
24, 2020
SliceToRadial
SliceToRadial maps a “slice” of its input texture—specified by
a tangent
vector and center
point—to rays
emanating from the center
point. The three examples below
use the same color noise texture defined in the January
23 entry. This operator introduces a discontinuity along the -tangent
direction. In the first two examples that can be seen diagonally from
the center to the lower left, and in the third example from the center
to the left.
SliceToRadial(Vec2(1, 1), Vec2(0, 0), cn);
SliceToRadial(Vec2(1, 1), Vec2(0.5, 0.5), cn);
SliceToRadial(Vec2(1, 0), Vec2(0.5, 0.5), cn);
January
23, 2020
Texture “slices” and SliceGrating
As in an earlier version of this library, the term “slice” of a texture
refers to the pattern of colors along a line in texture space. This
could also be called a “1d texture” or a “transit.” Several operators in
this library take a texture as an input, then ignore all but one slice
of it. The slice is normally specified by a tangent vector and a point.
The magnitude of the tangent serves as a parameter of the operator.
So for example, SliceGrating takes a slice and “sweeps” it
perpendicular to the tangent. The slice is specified by two Vec2
parameters: slice_tangent
and center
. The
length of slice_tangent
becomes a scale factor along the
slice, relative to the center
. Here we see the input
texture, then three SliceGratings made from it, each with a
different scale. In all three examples, the center
of the
transform is in the upper right at (0.5, 0.5).
cn = ColorNoise(0.6, Vec2(5, -2), 0.6);
SliceGrating(Vec2(1, 2) * 2.0, Vec2(0.5, 0.5), cn);
SliceGrating(Vec2(1, 2) * 1.0, Vec2(0.5, 0.5), cn);
SliceGrating(Vec2(1, 2) * 0.5, Vec2(0.5, 0.5), cn);
January
21, 2020
Stretch
This Stretch operator scales its input texture along a given
direction by a given factor (“anisotropic scaling”). Two
before-and-after examples are shown below.
First, a texture called color_noise
, and the result of
stretching it by a factor of 0.2 at a 45° angle, with the transformation
centered at the origin. If you trace along the diameter from lower left
to upper right you might be able to see the same color pattern.
Stretch(Vec2(0.2, 0).rotate(pi / 4), Vec2(0, 0), color_noise)
Second, a texture called three_spots
, and the result of
stretching it by a factor of 2, with the transformation centered at the
cyan spot's center (called p2
) along the direction from
there to the origin. As a result, the original cyan spot and the
stretched cyan ellipse share the same center. The center of the yellow
and magenta spots have been displaced by the stretch.
Stretch((-p2).normalize() * 2, p2, three_spots)
January
20, 2020
ColorNoise
Like MultiNoise, the ColorNoise generator takes
parameters float scale
, Vec2 center
, and a
float “which
” to select among the types of noise
generators. It creates three “analogous” but uncorrelated noise textures
which are used as the red, green, and blue color components. The three ColorNoise
examples below are a low frequency basic Perlin Noise, a Wrapulence
at twice that frequency, and a higher frequency (12.5⨉) Furbulence.
ColorNoise(1, Vec2(-7, 4), 0);
ColorNoise(0.5, Vec2(-18, -20), 0.8);
ColorNoise(0.08, Vec2(15, -12), 0.6);
January
19, 2020
Texture diff tool
I made a debugging tool—Texture::diff()
—that does a “diff”
of two textures, prints some numerical metrics, then displays the two
inputs and diff textures for visual comparison. The tool uses a new
texture operator called AbsDiff that simply takes the absolute
value (norm) of the difference between corresponding points on the two
input textures. This “abs of diff” is applied to the three RGB
components independently. This is a test of the diff utility on two
completely different textures:
n = Noise(0.2, Vec2(), Color(1, 0, 0), Color(1, 1, 0));
g = Grating(Vec2(), Color(0, 1, 1), Vec2(0.1, 0.1), Color(0, 0, 1), 0.5);
Texture::diff(n, g);
I used this diff tool to test a change to Texture::rasterizeDisk()
and while trying to come up with a closed form inverse mapping for
contraction in StretchSpot. A black third panel would indicate
the new code was equivalent to the old code. These colored fringes
indicate a mismatch:
January
16, 2020
StretchSpot
StretchSpot makes a “fish eye” bulge of enlargement within a
given circular area of an input texture. Or, if the scale factor is less
than 1, makes a zone of contraction within the circular area. The code
below corresponds to the first image. The second is the same except for
the signs on the dist
values specifying the centers of
stretch. Each is a series of four applications of StretchSpot
applied sequentially, two enlarging and two contracting. The input
texture is the same plaid
example used below in the January
15 entry.
radius = 0.8
dist = 0.65
StretchSpot(4.0,
radius,
Vec2(+dist, -dist),
StretchSpot(0.2,
radius,
Vec2(-dist, -dist),
StretchSpot(0.2,
radius,
Vec2(-dist, +dist),
StretchSpot(4.0,
radius,
Vec2(+dist, +dist),
plaid))))
January
15, 2020
Wrap
Texture operator Wrap takes a half-plane of its input texture
and wraps it radially around a given point. The wrapping is defined by
three parameters: a float width
that determines how much
of the half plane is used in the wrap, the Vec2d center
point of the wrap, and a Vec2d fixed_ray
from
the center that will remain unchanged by the wrap. A “strip” of the half
plane (width/2
on both sides of fixed_ray
) is
transformed radially around center
. (That is, a series of
rays parallel to fixed_ray
, and displaced perpendicular to
it, become radial rays emanating from the center
point.
This is related to a rectangular-(Cartesian)-to-polar transform.) Wrap
leads to a discontinuity in the direction of -fixed_ray
where the two edges of the “strip” become adjacent in the resulting
wrapped texture.
In the example below we see a test pattern called “plaid” and its image
under two applications of the Wrap operator. In wrap1
,
the center is at the origin and fixed_ray
points straight
up. In wrap2
, the center is at (0.2, 0.2) and fixed_ray
points along the main diagonal (1, 1). There is a discontinuity in wrap2
along (-1, -1) while wrap1
just happens to match up and
appear continuous. In both cases aliasing from point sampling is
apparent near the center of wrap.
plaid = Add(Grating(Vec2(0, 0), Color(1, 0, 0),
Vec2(0.1, 0.1), Color(0.3, 0, 0), 0.3),
Grating(Vec2(0, 0), Color(0, 1, 0),
Vec2(-0.1, 0.1), Color(0, 0.3, 0), 0.3))
wrap1 = Wrap(5, Vec2(0, 0), Vec2(0, 1), plaid)
wrap2 = Wrap(5, Vec2(0.2, 0.2), Vec2(1, 1), plaid)
January
13, 2020
BrightnessToHue
The BrightnessToHue operator takes a texture and a hue_phase.
It maps luminance values on [0, 1] to hue. Luminance values 0 and 1 both
map to hue_phase and pass through all other hues in between. Here we
define a gray scale pattern called “gray_gratings” and colorize it with
BrightnessToHue. We see two version, with hue_phase of 0.0 and
0.5, which are 180° out of phase. So for example, those 8 spots
horizontally across the middle are red in one and cyan (“anti-red”) in
the other.
gray_gratings = Add(Grating(Vec2(), black, Vec2(0, 2), gray50, 1),
Add(Grating(-basis1, black, basis1, gray25, 1),
Grating(-basis2, black, basis2, gray25, 1)))
BrightnessToHue(0.0, gray_gratings)
BrightnessToHue(0.5, gray_gratings)
January
12, 2020
GP considerations and MultiNoise
Thinking ahead to use with genetic programming, I added an alternate
version of the noise textures. MultiNoise has the same
parameters as the other noise texture generators, plus one additional
number between 0 and 1 which selects between the five noise generators.
This serves two purposes. (I think, although it remains to be seen.)
First, this selection parameter is subject to “jiggle” mutation,
allowing the type of noise (e.g. Turbulence versus Furbulence)
to vary under the control of evolutionary selection pressure. In
addition, I was concerned about letting noise textures “dominate” the
function set by having two many variations. This effects the choices
made during GP's initial construction of random programs, which in turn
influences the rest of the run. On the other hand, it may make more
sense to explicitly control this by giving each GP function a
“likelihood of being chosen for random program construction” parameter.
If so, that value could be set lower for the five varieties of noise
generators. The program for this demo texture is perhaps a little too
fiddly, but roughly:
noise = MultiNoise(scale, center, black, magenta, 0.0);
brownian = MultiNoise(scale, center, black, red, 0.2);
turbulence = MultiNoise(scale, center, black, yellow, 0.4);
furbulence = MultiNoise(scale, center, black, green, 0.6);
wrapulence = MultiNoise(scale, center, black, cyan, 0.8);
auto spot = [&](float r){return Spot(center, r, black, r+0.05, white);};
SoftMatte(spot(0.2),
wrapulence,
SoftMatte(spot(0.4),
furbulence,
SoftMatte(spot(0.6),
turbulence,
SoftMatte(spot(0.8),
brownian,
noise))))
January
11, 2020
“Wrapulence”
Wrapulence is my name for yet another variation on Turbulence.
Here, each octave of the basic noise signal is scaled up in brightness
then “wrapped” down into the range [0, 1] using something like an floor()
or fmod()
. The result is that the sharp stepwise changes
in intensity, wrapping from bright to dark, happen “at all scales.” (Or
at least at several scales. Recall that these multi-octave, 1/f fractal
noise generators use 10 levels of recursion.)
Wrapulence(0.9, Vec2(-2, -9), Color(0, 0, 0), Color(1, 0.6, 0))
January
10, 2020
“Furbulence”
Furbulence is my name for a variation on Turbulence.
Like Brownian, each are 1/f fractal noise. Perlin's Turbulence
introduces sharp features at the bottom (dark) end of the noise signal,
using an absolute value to fold the negative parts of the signal up into
the positive range. Similarly, Furbulence uses two
absolute values, one to fold the dark end up, and one to fold the bright
end down (with the scaling and shifting needed to make that work). The
result is that there are sharp discontinuities at the dark and
bright ends of the Furbulence signal. In this example there
are sharp hair-like features in the bright and dark regions of the
texture, here colored reddish blue and bluish red.
Furbulence(0.25, Vec2(-1, 2), Color(1, .1, .3), Color(.3, .1, 1))
Just a comparison of Furbulence and Turbulence. The
inner Furbulence can be seen to have sharp features in both
white and yellow. The outer Turbulence has soft cloud-like
patches of blue broken by sharp black cracks.
SoftMatte(Spot(Vec2(0, 0),
0.1, Color(0, 0, 0),
0.9, Color(1, 1, 1)),
Furbulence(0.1, Vec2(1, 2),
Color(1, 1, 1), Color(.7, .7, 0)),
Turbulence(0.2, Vec2(-5, 7),
Color(0, 0, 0), Color(.3, .3, 1)))
January
6, 2020
Turbulence
Turbulence is a variation on noise presented in Ken Perlin's
groundbreaking original SIGGRAPH 1985 paper: An
Image Synthesizer. Like Brownian noise, Turbulence
is composed of multiple octaves. At each level, the negative-going part
of the basic noise signal is “folded up” with an absolute value
operator. This produces soft/rounded features in the bright part of the
texture and sharp/discontinuous features in the dark parts of the
texture. In the example below, the sharp “valleys” are colored in dark
magenta, while the soft cloud-like highlights are colored orange.
Turbulence(0.3, Vec2(2, -5), Color(0.3, 0, 0.3), Color(1, 0.6, 0))
January 4,
2020
Brownian — fractal 1/f Perlin noise
This is 10 layers (octaves) of Perlin noise. The base layer is as shown
on January 3. Each subsequent octave is scaled
down by half in amplitude and size (doubling its frequency). Subsequent
octaves are also rotated by 2.0 radians to dis-align it with the other
layers.
Brownian(0.20, Vec2(3, 5), Color(0, 1, 0), Color(0.3, 0.3, 0.3))
January 3,
2020
Perlin Noise
This is a TexSyn generator wrapped around the basic
Perlin noise()
function as described in his SIGGRAPH
2002 paper Improving Noise. The parameters are a scale
factor, a center/translation, and two colors.
Update: this “two point” approach was implemented on May 31: (Design note: I
don't like that the noise pattern is always “axis aligned” in this
formulation. I could add a rotation angle. But I am leaning toward
changing to a specification with two points (Vec2s)—like used
in Gradation—or a point and a basis vector to specify a
whole transform: translation, rotation, and scale.)
Noise(0.1, Vec2(3, 5), Color(0, 0, 1), Color(1, 1, 0))
January
1, 2020
Catching up: Max and Min
The Max and Min operators compose two textures
together. Each point's color comes from whichever input texture has the
Max (or Min) luminance/brightness at the
corresponding point. These examples show the result with the same two Gratings
used in the SoftMatte example. In the first image, the white
parts of the vertical Grating push to the front and the black parts push
to the back. They are covered by the horizontal Grating.  The second image is the same code with Min
instead.
Max(Grating(Vec2(-0.2, 0), Color(0, 0, 0),
Vec2( 0.2, 0), Color(1, 1, 1), 1),
Grating(Vec2(0, -0.1), Color(1, 0, 1),
Vec2(0, 0.1), Color(0, 0, 1), 0.2))
January
1, 2020
Catching up: SoftMatte
The SoftMatte Operator take three Textures as parameters. The
first is interpreted as the “matte.” When it's luminance value is zero,
the result is taken from the second Texture. When the matte's luminance
value is one, the result is taken from the third Texture. Matte values
in between result in a linear interpolation between the other Textures.
In this example the matte Texture is a Spot. The outer dark
part of the Spot takes the second texture, a sinusoid Gradient
of vertical black and white bands. The inner bright part of the spot
takes the third texture, a “slightly soft square wave” Gradient
of horizontal magenta and blue stripes.
SoftMatte(Spot(Vec2(0, 0),
0.2, Color(1, 1, 1),
0.8, Color(0, 0, 0)),
Grating(Vec2(-0.2, 0), Color(0, 0, 0),
Vec2( 0.2, 0), Color(1, 1, 1), 1),
Grating(Vec2(0, -0.1), Color(1, 0, 1),
Vec2(0, 0.1), Color(0, 0, 1), 0.2))
January
1, 2020
Catching up: Grating
The Grating generator creates a swept stripe pattern whose
cross-sectional “slice” is a periodic waveform. The parameters to Grating
include:
- two Vec2 positions, the endpoints of a line segment, which
define the orientation and spacing (wavelength) of the stripe pattern
- two Colors for the striped pattern
- a “softness” parameter were 0 means square wave and 1 means sine
wave (so in this example, 30% of the way from square to sinusoid).
Grating(Vec2(0.1, 0.1), Color(0, 0.8, 0),
Vec2(0.5, 0.3), Color(0.85, 0.85, 0),
0.3)
January
1, 2020
Catching up: Gradation
Having installed a modern version of OpenCV and
integrated it into TexSyn, I can now see the textures
that before I could only verify with unit tests.
The Gradation generator defines two colored “half planes”
with a smooth (sinusoidal) transition between them. The parameters to Gradation
are two “colored positions.” The line segment between the two points
defines the orientation and width of the transition region. Outside the
transition region the texture is uniformly the nearest of the two
colors.
Gradation(Vec2(0.4, -0.2), Color(0.9, 0.0, 0.0),
Vec2(-0.4, 0.2), Color(0.9, 0.9, 0.9));
December
30, 2019
“First light” and the Spot operator
These are the first textures displayed by TexSyn
captured as screen shots. They show the result of the Spot
texture generator. The first one was tiny and was missing its center
constant-color region. The OpenCV utility cv::imshow()
is used to rasterize and display the procedural texture. The first image
used a 24 bit (three 8 bit unsigned integers) RGB representation, called
CV_8UC3
in OpenCV. A bug caused “full
brightness” colors to wrap around to zero, causing the black center. I
fixed the bug and switched to an image format with three 32 bit floating
point number per stored pixel (CV_32FC3
). Later I may
switch to four channel images to accommodate alpha matting.
TexSyn's Texture
class supports
arbitrary resolution—so there is no static storage of pixels—all color
values are computed procedurally “on the fly” represented as three
32-bit floating point values. The OpenCV images (cv::mat
class) are used only at the output end, before displaying a texture on
the screen, or writing it to an image file.
This Spot Texture has been specified to be centered at the
origin, with an inner radius of 0.2 and an inner color of white. Its
outer radius is 0.6 and outer color is black. Between 0.2 and 0.6 there
is a soft sinusoidal transition between the inner and outer colors:
Spot(Vec2(0, 0),
0.2, Color(1, 1, 1),
0.6, Color(0, 0, 0));
December
29, 2019
Infrastructure
From December 15 through December 28 the basic infrastructure was
constructed. This included:
- Basic
c++
classes for Texsyn:
Texture
(base class for all types of textures)
Generator
(creates a texture from primitive values)
Operator
(combines one or more input textures (and
primitive values) to produce a new texture)
- Primitive values to parameter textures:
Vec2
(a position on the infinite 2D texture plane)
Color
(very generalized representation of a point
in color space, defined as RGB values over the entire floating
point range. During texture composition, these values range over
[-∞, +∞] but are clipped to [0, 1] for display. Includes
conversion to hue/saturation/value color space and luminance.)
- A Utilities package to support interpolation,
clipping, remapping, randomization, and noise.
- A suite of unit tests to verify the correct
operation of primitives, texture generators, and operators.
- An interface to the OpenCV library to provide:
- Basic utilities such as displaying rasterized textures in windows
on the screen, and writing them to standard image file formats.
- Eventually help with implementing some operators, and particularly
to provide access to acceleration on GPU or other hardware.
For more details, see the code
and the git
commit history.
December
19, 2019
Designing for genetic programming
Most software libraries are, of course, intended for use by human
programmers.There is a design aesthetic (“design pattern”?) that leans
toward minimal functionality (where a function should “do just one
thing”) and conversely duplication should be avoided. More complicated
functionality arise from composing the minimal units of a library.
In contrast, TexSyn is intended primarily for use by
a genetic programming system. GP is a type of automatic programming
technique, driven by evolutionary optimization. My experience has been
that this suggests different “best practices” for library design. This
will be revisited in future posts, but here is an example to give a
sense of this issue.
Imagine a texture generator called Spot, a disk of one color
on a field of another color. A minimalist design might define a spot
with a default diameter (say 1) at a default location (say the origin),
and default colors (a white spot on a black background). As such, this
minimalist Spot could have zero parameters. That was the
initial approach taken in 2008 for the previous version of this library.
Using standard techniques of composition of software operators, a
programmer might use a Scale operator to adjust the spot's
diameter, a Translation operator to change its position, and
perhaps a SoftMatte operation to use the basic
black-and-white pattern to modulate other colors or textures.
This suggests a requirement for context in the composition of functions
when writing programs with this library. If we are going to call Spot,
we will, in general, need to surround it with calls to Scale,
Translate, etc. A human programmer would understand how to
handle this. An automated programming system would not, or at least
would need to be augmented to supply the required context. In random
programs constructed by GP, without that context, we would expect to see
a bias toward Spot often exhibiting its default radius and
position, because it did not happen to be modified by Scale, Translate,
etc. An alternative to declaring and maintaining this context, is to
make these transformations part of the basic Spot definition.
So for example Spot could have several parameters, such as a
center position, a radius, and the two colors to use.
TexSyn will use this this approach, often giving
texture generators and operators additional parameters to establish
context. This makes it explicit to the genetic programming system that,
for example, a Spot always needs a position to be specified
because it is a required parameter to Spot. This removes the
need to add extra complexity related to required context.
December
15, 2019
A new library
Today I created Texsyn,
a new repository on GitHub, part of a project about
adversarial evolutionary texture synthesis.
TexSyn is a library for procedural texture synthesis.
It is intended for use by a genetic programming (“GP”) system,
a type of genetic algorithm. The GP system performs simulated
evolution on a population of individual programs,
according to a fitness function (also known as a fitness
metric, utility function, or a loss function
in machine learning.) In this application to texture synthesis, the
programs are compositions of functions from the TexSyn
library. When executed they describe a color texture, an image.
This is a re-implementation and update to the TextureSynthesisTest
library as described in Texture
Synthesis Diary and used as the basis of the 2011 paper Interactive
Evolution of Camouflage.
(Note: as of May
6, 2020 an incompatible change was made to improve gamma handling.
For entries dated before then, the given TexSyn code, if re-rendered
anew, will produce a texture that looks different from the one shown in
the doc. It will generally be brighter and less saturated.)
This page, and the software it describes, by Craig
Reynolds


| peek_vars {tidyselect} | R Documentation |
peek_vars()
returns the vector of names of the variables
currently available for selection.
peek_data()
returns the whole input vector (only available with
eval_select()
).
Read the Get started for
examples of how to create selection helpers with peek_vars()
.
The variable names in a selection context are registered
automatically by eval_select()
and eval_rename()
for the
duration of the evaluation. peek_vars()
is the glue that connects
selection helpers to the current selection
context.
peek_vars(..., fn = NULL) peek_data(..., fn = NULL)
... |
These dots are for future extensions and must be empty. |
fn |
The name of the function to use in error messages when the helper is used in the wrong context. If not supplied, a generic error message is used instead. |


is a dependency only for some classes from this other module
Such class could be moved into the module on which it depends.
Because this inspection requires global code analysis it is only available for Analyze|Inspect Code or
Analyze|Run Inspection by Name and it will not report in the editor.


Teaching and Talks
2022
Seminar "GEDI: GEnerative and DIscriminative Training for Self-Supervised Learning"
KU Leuven, Computer Science
Video
Talk "LSB: Local Self-Balancing MCMC in Discrete Spaces"
Baltimore, ICML
Video
2019
Keynote "Coulomb Autoencoders"
British Computer Society
BMVA symposium on generative models
Video
2017
Seminar "Generative Adversarial Networks"
University of Trento, DISI
Slides. PDF
Demo. Code
2016
Computer Vision
University of Trento
M.Sc. in Telecommunications Engineering - Code 140266
M.Sc. in Mechatronics Engineering - Code 140474
Material:
Building a binary classifier using neural networks. PDF
Learning neural networks with few labels. PDF
Solution - assignment 1 (derivation of backprop). PDF
Solution - assignment 2 (programming). Code
2015
Multimedia Networking
University of Trento
M.Sc. in Telecommunications Engineering - Code 140151
Material:
Motion estimation. Code


| US Ind Prodn - MoM (%) | ||||||
| Release Dt | For Month | Market Expectation | Kshitij Expectation | Previous | Released | Revision |
| 15-Dec-17 | Nov-17 | 0.30 | - | 1.72 | 0.28 | 0.28 |
| 17-Jan-18 | Dec-17 | 0.30 | 0.29 | 0.28 | 0.94 | 0.37 |
| 15-Feb-18 | Jan-18 | 0.20 | - | 0.37 | -0.09 | - |
| 16-Mar-18 | Feb-18 | - | - | -0.09 | - | - |
| Copyright: Kshitij Consultancy Services |


WITNESS LIST
General Revenue Dedicated Accounts, Interim Committee
November 8, 2012 - 1:00 PM
General Revenue Dedicated Accounts
On:
Brymer, David (Tx Commission on Environmental Quality)
Day, Liz (TCEQ)
Reed, Cyrus (Lone Star Chapter, Sierra Club)
Seaton, Beth (TCEQ)
GRD Accounts: 0655 Petroleum Storage Tank Remediation
On:
Minick, Stephen (Texas Assoc. of Business)
GRD Accounts: 5000 Solid Waste Disposal Fees
On:
Biliski, Carolyn (Houston Galveston Area Council & Texas Assiociation of Regional
Councils)
Lott, Earl (TCEQ)
Pitts, Maurice (Capitol Area Council of Governments & Texas Association of Regional
Councils)
Weaver, Thoms (Alamo Area Council of Governments (AACOG) - Texas Association of
Regional Councils)
GRD Accounts: 5071 Emissions Reduction Plan
On:
Brymer, David (TCEQ)
Hendler, Elizabeth (8-Hour Ozone SIP Coalition)
Smith, Tom Smitty (Public Citizen's Texas Members)
Volz, Carl (Caterpillar Inc.)
1


or guessing colors 🎨 with AI.
Take a selfie and see if AI can guess the colors!
It is a simple way to explore limits and biases in our contemporary artificial intelligence algorithms.
Psst... Nothing is real, and these images are not saved ✨!


A selection of my creative and journalistic work is included here- full portfolio on request. Copy writing references for a range of B2B and B2C brands available from Brian and Jess at JB Web Analytics


SplitPanel
is a container divided into two areas, its horizontal or vertical size can be
adjusted by moving the separator.
split
container must contain two nested containers or components. They will be displayed astride
the separator.
split
attributes:
orientation
- defines component orientation. horizontal
-
nested components are aligned horizontally, vertical
- they are aligned
vertically.
pos
- an integer number defining percentage of the first component area compared to
the second one. For example, pos="30"
means that the areas ration is 30/70.
By default the areas are divided 50/50.


Sign-in
User type
Student
Faculty
Division
A
B
Subject
Algorithms
Database Management Systems
Digital Communication Networks
Data Structures


The International Afterlife of Broadway Musicals
Follow Broadway musical titles through their lifetimes, their Broadway performances, and international touring across continents to explore the dynamics of cultural transmission and the motivation behind this global distribution.


|
Halide
12.0.0
|
A builder to help create Exprs representing halide_buffer_t structs (e.g. More...
#include <IROperator.h>
Public Member Functions | |
| Expr | build () const |
Public Attributes | |
| Expr | buffer_memory |
| Expr | shape_memory |
| Expr | host |
| Expr | device |
| Expr | device_interface |
| Type | type |
| int | dimensions = 0 |
| std::vector< Expr > | mins |
| std::vector< Expr > | extents |
| std::vector< Expr > | strides |
| Expr | host_dirty |
| Expr | device_dirty |
A builder to help create Exprs representing halide_buffer_t structs (e.g.
foo.buffer) via calls to halide_buffer_init. Fill out the fields and then call build. The resulting Expr will be a call to halide_buffer_init with the struct members as arguments. If the buffer_memory field is undefined, it uses a call to alloca to make some stack memory for the buffer. If the shape_memory field is undefined, it similarly uses stack memory for the shape. If the shape_memory field is null, it uses the dim field already in the buffer. Other unitialized fields will take on a value of zero in the constructed buffer.
Definition at line 207 of file IROperator.h.
| Expr Halide::Internal::BufferBuilder::build | ( | ) | const |
| Expr Halide::Internal::BufferBuilder::buffer_memory |
Definition at line 208 of file IROperator.h.
| Expr Halide::Internal::BufferBuilder::shape_memory |
Definition at line 208 of file IROperator.h.
| Expr Halide::Internal::BufferBuilder::host |
Definition at line 209 of file IROperator.h.
| Expr Halide::Internal::BufferBuilder::device |
Definition at line 209 of file IROperator.h.
| Expr Halide::Internal::BufferBuilder::device_interface |
Definition at line 209 of file IROperator.h.
| Type Halide::Internal::BufferBuilder::type |
Definition at line 210 of file IROperator.h.
| int Halide::Internal::BufferBuilder::dimensions = 0 |
Definition at line 211 of file IROperator.h.
| std::vector<Expr> Halide::Internal::BufferBuilder::mins |
Definition at line 212 of file IROperator.h.
| std::vector<Expr> Halide::Internal::BufferBuilder::extents |
Definition at line 212 of file IROperator.h.
| std::vector<Expr> Halide::Internal::BufferBuilder::strides |
Definition at line 212 of file IROperator.h.
| Expr Halide::Internal::BufferBuilder::host_dirty |
Definition at line 213 of file IROperator.h.
| Expr Halide::Internal::BufferBuilder::device_dirty |
Definition at line 213 of file IROperator.h.


Runs PHPStan to find code problems.
The inspection requires PHPStan to be properly installed and set up in the IDE under Settings/Preferences | Languages & Frameworks | PHP |
Quality Tools | PHPStan.
It is recommended to install PHPStan either as a Composer dependency or globally. For more information, see:
https://github.com/phpstan/phpstan#installation


|
NAME |
AUTHOR |
DATE MODIFIED |
WORK COMPLETED |
STATUS |
|---|---|---|---|---|
| {{ item.name }} | {{ item.author }} | {{ item.date }} |
|
|
|
Name
|
Author
|
Date Modified
|
Work Completed
|
Status |
|---|---|---|---|---|
| {{ item.name }} | {{ item.author }} | {{ item.date }} |
|
|
Column sorting can be added to a table by applying the uxColumnSorting
directive to the
tr
element and adding the ux-column-sorting
component in the th
of any columns that are sortable.
The component will be exported as ux-column-sorting
.
NoSort
, Ascending
or
Descending
. When manually setting this value it is the responsibility of the application to ensure
that the table sort state matches the column sort state.
NoSort
state. If set to false
this will
toggle between the Ascending
and Descending
states when changing the sort direction.
NoSort
, Ascending
and Descending
.
This returns an array of objects for each column being sorted containing key: string
and state:
ColumnSortingState
.
State can be used to find the current sorting state of the column eg. (state ===
ColumnSortingState.Ascending)
.
The ColumnSortingOrder
interface has been provided for objects in the array.
NoSort
, Ascending
or Descending
.
The .column-sorting-header
class can be used to align the sorting icon to the right of the table header
as seen in the example above.
The code used for the above example is shown below:


The Brooklyn Outdoor Film Festival is a fun event for the whole family...and completely free! Now a regular summer event, the festival is in it's fourth year running, and is made possible by the generous support from both the Bourough of Brooklyn, and the Brooklyn Bridge Park. With a selection of some of the best family films, the Brooklyn Outdoor Film Festival is a great place to bring friends and family together. Grab a blanket and some popcorn, and join us for a fun night out under the summer stars!
Brooklyn Vibes Event Co was established in 2012 by Jennifer Viala. Operating from the heart of Brooklyn, our mission is to provide fun and unique event experiences for the community. Want to see some of our past events? Do you have an idea for an event that you would love to see in Brooklyn? We'd love to hear from you!
One of the best events of the summer, I wouldn't miss it for the world!
The Brooklyn Outdoor Film Festival is magical. There's nothing like a night under the stars.
A fantastic selection of films that the whole family is sure to enjoy.
The festival opens on Thursday August 5 and runs until Sunday August 8. Each night the first film will start at 6pm, and the last film will finish by 12am. It is recommended that you arrive 30 min prior to the start of your film, to allow time to get through check-in and find a spot to settle down.
Admission to this event is completely free! You may come for as many films as you wish to see, and we highly recommend registering for them in advance. Prority for admission will be given to those on the registration list. You are however, welcome to come without registering. Any available or unclaimed spaces will then be given out on a first come first serve basis at the check-in desk, 10 minutes prior to the beginning of each film.
A few tips to help you have a great time at the festival:
It is recommended that you bring folding chairs or a lawn blanket, as seating is not provided.
There will be concessions available in the park, but you are welcome to bring your own snacks and drinks as well.
Due to limited space, pets are not allowed at the festival.
BROOKLYN BRIDGE PARK
334 Furman St, Brooklyn NY, 11201 USA
The park entrance is located off of Furman St, and the check-in desk for the festival will be visible from there.
The park is easily accessible from Brooklyn Bridge Stn, NYC Ferry and Citi Bike Pier 2.