Hello. My Name is John Koenig, A native of Britain, I have been diagnosed with Oesophageal cancer. It has defied all forms of medical treatment, and right now I have only about a few months to live, according to medical experts. I have not particularly lived my life so well, as I never really cared for anyone (not even myself) but my business. Though I am very rich, I was never generous, I was always hostile to people and only focused on my business as that was the only thing I cared for. But now I regret all this, as I now know that there is more to life than just wanting to have or make all the money in the world. I believe when God gives me a second chance to come to this world I would live my life a different way from how I have lived it. Now that God has called me, I have willed and given most of my property and assets to my immediate and extended family members as well as a few close friends.  So far, I have distributed money to some charity organizations in the U.A.E, Somalia and Malaysia. Now that my health has deteriorated so badly, I cannot do this myself anymore. I once asked members of my family to close one of my accounts and distribute the money, which I have there to charity organization in Bulgaria and Pakistan; they refused and kept the money to themselves. Hence, I do not trust them anymore, as they seem not to be contended with what I have left for them. The last of my money, which no one knows of, is the huge cash deposit of eighteen million three hundred thousand dollars ($18, 300, 000, 00) that I have with a finance House abroad. I will want you to help the world collect this deposit and dispatch it to charity organizations. N/B: Kindly note that 60% of this fund must go to the tsunami and hurricane victims and 40% for your effort and time. Please live right!! Thanks. Mr.John Koenig.


Authentic Burberry White Tee SzS $80.00
skater Skirt lush red $15.00
New Balance 810 $17.00
26" Wig Caramel with Black Roots| Mia $69.00


--- title: Shiny test author: Jonathan Regenstein date: '2017-07-02' slug: shiny-test categories: - R tags: - shiny - R Markdown - plot draft: yes ---
In a previous post, we imported oil data from Quandl and applied a simple model to it. Today, we’ll port that work over to a Shiny app (by way of flexdashboard, of course) that allows a user to choose a commodity (oil, copper or gold), choose a frequency for the time series and choose how many periods ahead to forecast. The app will display the price history and the forecasted price. To see it in action, have a look here:
As with the previous Notebook, the main purpose of this post is to build a nice template where a more sophisticated or proprietary model could be used for forecasting, or indeed several different models could be included at the users option (meaning the different models could be selected as inputs). In other words, we are not as concerned with the modeling as we are with a format that is friendly to both an end user, or any future collaborator that might want to take this app and expand upon it.
Without further adieu, let’s get to it!
In the code chunk below, we are immediately faced with a few important decisions. The first of those is the format of the user input. At the extreme, we could use textInput and simply allow the user to enter the code for the desired data set. The benefit is that we would not limiting the user in any way - he or she could choose any dataset on Quandl; the cost would be that the user would need to know, or go to Quandl and look up, the code for any data set.
For example, to import WTI oil prices, the user would have to type in FRED/DCOILWTICO. That’s no problem if most of the end users know that code, but it’s a big problem if your end users are not familiar with and have no interest in data set codes. We want to emphasize convenience and broad usability, so we are going with selectInput instead of textInput, meaning our app will show a drop-down of a few choices. The user just clicks on “WTI oil” instead of typing FRED/DCOILWTICO, or clicks on “copper” instead of typing ODA/PCOPP_USD. But, if a user wants to work with a data set that we haven’t included, said user is out of luck.
Another big decision is how many choices to give the user. I have included only 3 - oil, gold and copper. In industry, you would probably include several more, perhaps all of the industrial metals, but there is a cutoff somewhere. Or, maybe we prefer one choice, because this app is just for oil analysis. Either way, the number of drop downs is another trade off between usability and flexibility.
The final decision is a bit more nuanced and requires looking ahead to how these inputs will be used further down in the app. Have a peak at the object called dataChoices and you might notice that, in short, we don’t strictly need that object. We could have put the vector of choices as an argument to selectInput, so that our code would have read ‘choices = c(“WTI oil” = “FRED/DCOILWTICO”, …)’ instead of ‘choices = dataChoices’. In that choice assignment, “WTI oil” is called the name and “FRED/DCOILWTICO” is called the value (together we can think of them as a name-value pair). The entire reason for building a separate dataChoices object is that we want the ability to extract either the name or the value of the name-value pair. Usually we would care only about the value, because we want to pass the value to Quandl and import the data, but that name is going to be useful as well (when we label our graph).
The ability to extract names and values will become even more useful when we get to the frequency of the time series and forecasting. For now, let’s look at dataChoices and selectInput.
# Notice a tradeoff here: we're making it easy on our users because they don't need to
# remember the naming conventions. But, we're also forced to severely limit their choices.
# The dataChoices object is going to allow us to add a nicer label to the graph.
# Notice also how easily we can include datasets from different sources, and not worry about
# their formats. Thanks, Quandl!
dataChoices <- c("WTI oil" = "FRED/DCOILWTICO", #oil data from Fred
"Copper" = "ODA/PCOPP_USD", # copper data from ODA
"Gold" = "CHRIS/CME_GC1") # gold data from CME
selectInput("dataSet",
"Commodity",
choices = dataChoices,
selected = "WTI oil")
Alright, we have given the user the ability to choose a commodity. Next we want to ask about the frequency and this gets a bit more complicated. We need to tell Quandl the frequency of the time series to import using the “daily”, “weekly”, “monthly” convention, so we set those to the values. But, further down the app when we want to store the forecast results, we’ll need to use the “days”, “weeks”, “months” phrasing and we’ll need to pull out the names from the name-value pair in frequencyChoices. We knew that this would be necessary because when we built our Notebook for importing, wrangling and testing, we definitely noticed and noted the different conventions and started thinking about how to deal with them in the Shiny context.
# The frequencyChoices object is going to allow us to pass different period conventions
# to different places further down the app.
frequencyChoices <- c("days" = "daily",
"weeks" = "weekly",
"months" = "monthly")
selectInput("frequency",
"freq",
choices = frequencyChoices,
selected = "months")
The remainder of the inputs should look familiar as they are in standard format.
dateRangeInput("dateRange",
"Date range",
start = "1980-01-01",
end = "2016-12-31")
numericInput("periods", "Periods to Forecast", 6, min = 1, max = 100)
Now that we’ve built the sidebar inputs, let’s put them to use. First, we will import the commodity time series data from Quandl. This will be familiar from the Notebook but note in particular that we will use the value from the input$frequency choice because Quandl uses the “daily/weekly/monthly” frequency format.
# Let's pull in the Quandl data.
# Nothing fancy here except we are going to use the reactive inputs.
# We will pass in the value from the input$dataSet key-value pair.
# We will also pass in the value from the input$frequency key-value pair.
commodity <- reactive({
# It might be a good idea to include your quandl api key if this will be used more than 50 times in a day.
Quandl.api_key("your_apikey_here")
commodity <- Quandl(input$dataSet,
start_date = format(input$dateRange[1]),
end_date = format(input$dateRange[2]),
order = "asc",
type = "xts",
collapse = as.character(input$frequency)
)
})
Alright, we have imported a time series object for the dataset, date range and frequency chosen by the user. Now we want to do some forecasting and create a visualization. We’ll first use the forecast()
function, then we’ll combine the forecasted prices and the historical prices into one xts object that can be passed to dygraph. Let’s handle this in one reactive.
First, we’ll call forecast and pass it the periods input from the user.
combined_xts <- reactive({
# Just like the Notebook, except periods is a reactive input.
forecasted <- forecast(commodity(), h = input$periods)
Now we need to combine that forecasted object with the commodity object that was created in a previous code chunk. Here we will finally thank ourselves for thinking about the name-value issue when assigning frequencyChoices. When we create a dataframe to hold the forecasted time series, we buil a ‘date’ column using the seq() function. The column starts on the end date of the historical data (which the user selected with dateRange input) and runs for as many periods as the user chose in the periods input. But, we need to supply a value to the “by = …” argument of the seq() function so that it knows if we want to move 6 days, 6 weeks, 6 monhts etc. To do that, we need to extract the name (“days/weeks/months”) from the frequencyChoices name-value pair and pass it to seq. The way we extract the name is with this selection statement: names(frequencyChoices[frequencyChoices == input$frequency]).
forecast_dataframe <- data.frame(
date = seq(input$dateRange[2],
# The next line is very important and it's the reason we
# created the frequencyChoices object.
by = names(frequencyChoices[frequencyChoices == input$frequency]),
length.out = input$periods),
Forecast = forecasted$mean,
Hi_95 = forecasted$upper[,2],
Lo_95 = forecasted$lower[,2])
Now we convert the forecast_dataframe object to an xts and combine that new object with the commodity xts object. Remember, we imported the commodity data from Quandl in the form of an xts object, which saved us from having to do a conversion. This chunk should look very similar to the Notebook.
forecast_xts <- xts(forecast_dataframe[,-1], order.by = forecast_dataframe[,1])
combined_xts <- cbind(commodity(), forecast_xts)
# Add a nicer name for the first column.
colnames(combined_xts)[1] <- "Actual"
# This is the combined object that will be passed to dygraphs below.
combined_xts
})
Now we will create chart of the actual price history. Nothing fancy here, except again we are going extract the ‘name’ portion of a name-value pair, this time from the dataSet object (the first one we created in the first code chunk). We want to label the graph with ‘WTI oil’ and not the Quandl code so we select the name with names(dataChoices[dataChoices==input$dataSet]).
dygraphOutput("commodity")
output$commodity <- renderDygraph({
dygraph(commodity(),
# We pull out the name of the selected name-value input$dataSet like so:
# names(dataChoices[dataChoices==input$dataSet])
main = paste("Price history of", names(dataChoices[dataChoices==input$dataSet]),
sep = " ")) %>%
dyAxis("y", label = "$") %>%
dyOptions(axisLineWidth = 1.5, fillGraph = TRUE, drawGrid = TRUE)
})
Last but not least, let’s graph the historical and forecasted time series together on one graph. We could have ported the code directly from the Notebook but I couldn’t help tinkering just a bit. I wanted to focus the graph on the time period around where the actual data ends and the forecast begins because that is probably what’s of most interest to the user. To do that, we’ll use the dyRangeSelector() function and pass two values to the dateWindow variable: a start date and end an date. This is pure aesthetics, but I think it’s worth the effort here.
We are going to use seq() and names(frequencyChoices[frequencyChoices == input$frequency]) once again.
dygraphOutput("forecasted")
output$forecasted <- renderDygraph({
# We want the user to be able to see the forecasted area so let's focus in on that.
# by truncating the view of the dygraph.
# We need to give the graph a start date and an end date.
start_date <- tail(seq(input$dateRange[2], by = "-1 months", length = 6), 1)
end_date <- tail(seq(input$dateRange[2],
by = names(frequencyChoices[frequencyChoices == input$frequency]),
length = input$periods), 1)
Now we will supply those date objects to a piped dygraphs chain and that will be a wrap. Have a close look at the chunk below and spot where we again extract the name from the input$dataSet name-value pair.
dygraph(combined_xts(),
# Name about to be extracted!
main = paste(names(dataChoices[dataChoices==input$dataSet]),
": Historical and Forecast", sep = "")) %>%
# Add the actual series.
dySeries("Actual", label = "Actual") %>%
# Add the three forecasted series.
dySeries(c("Lo_95", "Forecast", "Hi_95")) %>%
# A range selector to focus on the where historical data ends and
# foracated data begins.
# Note the user can still use the range selector to zoom out if so desired.
dyRangeSelector(dateWindow = c(start_date, end_date))
})
That’s all for today! We’ve built an app that can be extended in many directions - more data set choices, an input selector so the user can choose different models, more visualizations - and in that sense it can serve as a template for ourselves and anyone that wants to build upon this work.
This app also relies on and highlights one of the tremendous benefits of Quandl: the ability to import datasets from different sources and have them arrive in the IDE in a consistent format. This makes using Quandl with Shiny quite enjoyable after the initial skeleton is built. For example if we or a colleague did want to change this app and substitute in different commodities, there would be no worry beyond the finding the right code on Quandl and adding another name-value pair to dataChoices.
Thanks and see you next time!


Evaluations
Showing {{getVisibleRowCount()}} evaluations ({{getRemarksCount()}} commented)
Only commented evaluations ({{getRemarksCount()}})
Translation
Original
Translated
Both


the and that health {background margin public {border-style px;} #ffffff;} for []. HIV disease with can response are from our have must not HIV/AIDS effective influenza pandemic px; this {font-family Public font-size has interventions national other pandemics prevent system systems these when United community double; global infectious spread successful AIDS Americaâ€™s But COVID- States after border-color border-width responses solid; there treat were will {font-style {font-weight Health Nor The U.S. York about biomedical bold courier; em; epidemic funding immediate information into made outcomes pt;} reduce their they vaccine without years


|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.muchsoft.util.Sys
This class lets you determine which system your Java application runs on. Furthermore, it offers methods for cross-platform queries for certain paths such as the preferences folder. It is used as follows:
if (Sys.isMacOSX()) { // Mac OS X-specific code goes here... } else { // code for other systems } // store user's configuration data DataOutputStream out = new DataOutputStream( new BufferedOutputStream( new FileOutputStream( new File( Sys.getPrefsDirectory(), "config.dat" ) ))); //...
The latest Sys version can be found at http://www.muchsoft.com/java/.
Copyright 1998-2004 by Thomas Much<EMAIL_ADDRESS>This class is free for commercial and non-commercial use,
as long as you do not distribute modified versions of the source code.
If you have any suggestions, bug reports or feature requests, let me know.
Version History:
Mac
.
| Method Summary | |
static java.lang.String |
getHomeDirectory()
The home directory contains the user's data and applications. |
static java.lang.String |
getJavaHome()
The Java home directory contains the bin subdirectory and is needed to invoke the Java tools
at runtime. |
static java.lang.String |
getLocalPrefsDirectory()
The local preferences directory contains configuration files that are shared by all users on the computer. |
static java.lang.String |
getPrefsDirectory()
The preferences directory contains the user's configuration files. |
static java.lang.String |
getWorkingDirectory()
The directory from which the application was launched is called the working directory. |
static boolean |
isAMac()
|
static boolean |
isLinux()
|
static boolean |
isMacOS()
|
static boolean |
isMacOSX()
|
static boolean |
isOS2()
|
static boolean |
isWindows()
|
static void |
main(java.lang.String[] args)
This is a small test case for all the methods in this class. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public static boolean isMacOS()
true
, if the application is running on Mac OS 8/9, false
otherwisepublic static boolean isMacOSX()
true
, if the application is running on Mac OS X, false
otherwisepublic static boolean isAMac()
true
, if the application is running on a Mac (OS 8, 9 or X), false
otherwisepublic static boolean isLinux()
true
, if the application is running on Linux, false
otherwisepublic static boolean isWindows()
true
, if the application is running on Windows, false
otherwisepublic static boolean isOS2()
true
, if the application is running on OS/2, false
otherwisepublic static java.lang.String getHomeDirectory()
~
and can be queried through the system property user.home
.
public static java.lang.String getWorkingDirectory()
user.dir
.
public static java.lang.String getPrefsDirectory()
~/Library/Preferences
, on all other systems the user's home directory is used.
public static java.lang.String getLocalPrefsDirectory()
/Library/Preferences
, on Linux /etc
. On all
other systems the application's working directory is used.
Please note: There is no guarantee that your application has permission to use this directory!
public static java.lang.String getJavaHome()
bin
subdirectory and is needed to invoke the Java tools
at runtime. It is specified by the environment variable $JAVA_HOME
and can be queried through
the system property java.home
. If the variable is not set properly, this method returns
/Library/Java/Home
on Mac OS X.
public static void main(java.lang.String[] args)
java -classpath .:Sys.jar com.muchsoft.util.Sys
(or java -jar Sys.jar
)
args
- not used
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |


Muddy Paws
0
Browse Products
Cat Harness
$10
Dog Harness
$12
Food and Water Storage Attachment
$5
GPS Tracker Collar
$30


Cyprus water 💦
Quiz
Question
Please wait...
check
Correct Answers
warning
Warning
Please provide an answer.


RAISING ARIZONA A film review by Mark R. Leeper Copyright 1987 Mark R. Leeper
Capsule review: A frantic and funny comedy about an ex-con who steals a baby to have instead of the one his wife cannot have. The BLOOD SIMPLE Coen brothers have made a second great film. It's a screwball comedy filled with screwball characters.
The Coen brothers have made another movie. Two years ago the then 29- year-old director Joel and the then 26-year-old producer Ethan made a superb story of murder and misunderstanding. BLOOD SIMPLE was a great first film and all the more amazing for having come from two unknowns. Joel had been editor on some low-budget horror films, the best known of which was THE EVIL DEAD; Ethan had no film experience. BLOOD SIMPLE was a great film and an outstanding critical success. More recently the Coens had to prove that they had more than just one film in them. Well, RAISING ARIZONA proves that and while it seems less ambitious to make one more comedy in a market full of comedies, RAISING ARIZONA is as unique in its own way as BLOOD SIMPLE was.
Nicholas Cage plays H.I., an ex-con who went through jail terms as often as you go through tubes of toothpaste. Then he married Edwina, an ex-cop who wants to settle down with him and raise a family. One problem. No kids. And as a cigar-chomping doctor gaily explains, there aren't gonna be none, neither. Things look pretty bad until Edwina hears about a furniture chain (Trey Wilson who played in FX and as the base commander in A SOLDIER'S STORY). owner whose wife just had quintuplets. Now, if some folks don't got enough kids and others got too many, the answer is obvious. If H.I.'s so used to stealing.... Well, you get the idea. And what the Coens give us a bringing-up-baby sort of comedy done in a manic Joe-Bob- Briggs style.
I think while he was making this film, the cameraman must have lived on black coffee and motion-sickness pills. In fact, the same might be true of most of the major actors. The Coens have a way of telling a story that is fast and staccato. The camera moves in fast, jerky motions, making the viewer feel as manic as the characters.
The film grinds up biker movies, the prison system, other people's kids, the parents of other people's kids, and just about anything else that gets in its path. The film is fast and it's funny. And it's not like most of the other comedies out there. Rate this one a +2 on the -4 to +4 scale.
Mark R. Leeper ihnp4!mtgzz!leeper<EMAIL_ADDRESS>The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


We have introduced a new approach to search using the open source software, ElasticSearch. This builds upon work we were hoping to implement on the current site and benefits from guidance from experts at independent search consultancy Flax and the Government Digital Service. Again the ‘broad but shallow’ approach has been important here in ensuring there is enough content to provide realistic search results.
We know a good search experience is hugely important to you and your feedback on the search solution you'll find here is invaluable in helping us build a search that works for you.


x
Thanks for writing (typing xD) to us!
You're mail has been sent successfully and it might have already made its way to my Inbox but I've a poor internet connection. And it may also take a while for me to read and respond to your mail, as I have a huge number of fan mails coming in, like 2 or 3 a month (of which 2 are mostly spam). Don't worry, till then get yourself a drink.
Close


Angular Material
Buttons
Toggles
{{toggle.checked}}
React
Angular
Vue
{{group.value}}
React
Angular
Vue
{{groupTwo.value}}
Typography
Text
Text
Text
Text
Mat Headline equivalent to h1
This equivalent to h2
This is quivalent to h3
This is equivalent to h4
This is equivalent to body text
Equivalent to body bold text
Equivalent to caption text
Elements using Typography Class
Text
Text
Text
Text
Icons
grade
grade
grade
Badges
Notifications
Notifications
Notifications
Notifications
Notifications
Progress Bars and Spinners


Please review your GPG data before submitting
Gender pay gap for KPMG Bristol |
||
|---|---|---|
| 1. Difference in mean hourly rate of pay | 30% | |
| 2. Difference in median hourly rate of pay | 75% | |
| 3. Difference in mean bonus pay | 50% | |
| 4. Difference in median bonus pay | ||
|
Male Female |
50% 50% |
|
| 5. Proportion of male and female employees who received bonus pay | ||
|
Lower payband Male Female |
50% 50% |
|
|
Middle payband Male Female |
50% 50% |
|
|
Upper middle payband Male Female |
50% 50% |
|
|
Upper quartile payband Male Female |
50% 50% |
Now send your application
By submitting this notification you are confirming that, to the best of your knowledge, the details you are providing are correct.


About me
Hi. I lead and serve Google as the VP of Product Management, Android Developer. This multi-faceted org includes Product Management, Research, UX Design, Community, and Developer Relations teams. It's a privilege to apply my passion for the developer commumity, love of open source, experience in enterprise software development, and ideas for the future of distributed collaboration alongside my talented colleagues.
Formal Speaking Bio
Conferences often ask for a third person biography and I've found that making it available here is a convenient way to share it.
Long Form Bio
Matthew J. McCullough is VP of Product Management, Android Developer for Google, and leads Product Management, Research, UX Design, Community, and Developer Relations teams. He held the role of SVP of Product at GitHub, is an energetic 20 year veteran of enterprise software development, world-traveling open source educator, and co-founder of a software consultancy. All of these activities provide avenues to share success stories of improving developer experiences for greater collaboration amongst software teams.
Matthew is a co-author to the Version Control with Git, Building and Testing with Gradle and Jenkins: The Definitive Guide O’Reilly books and creator of the Git Master Class series for O’Reilly. Matthew regularly spoke on the No Fluff Just Stuff conference tour, is the author of the DZone Git RefCard, and was founder and a past President of the Denver Open Source Users Group.
Short Form Bio
Matthew is the VP of Product Management, Android Developer at Google and leads teams that shape mobile application dev experiences. As an organization, we facilitate the creation of languages, tools, extensions, libraries, presentations, video training, and documentation that makes the experiences of Android developers more joyful and productive.
Expertise
- Software development lifecycle (SDLC) moderniation and transformation (Several Fortune 500 clients)
- Open source software development (Apache, CodeHaus, SpringSource, Java Community Process, GitHub)
- Agile software team leadership (1 Billion USD market cap firms)
- SaaS software and services sales operations and process design (Web-scale billing systems)
- Web application development strategy (Media, banks, billing and satellite industries)
- Open source conference chairmanship and keynoting (OSCON, NJFS)
History
Software has been my passion since the third grade. I've been seeking and exploring challenging development experiences ever since. Some highlights include:
- Receiving $1000 in Apple equipment for describing the societal uses of computers at age 9
- Programming games in Apple EDASM and APW
- Winning two Microsoft Sitebuilder awards in my teens
- Earning a degree in Computer Science and minor in Mathematics with a 4.0 GPA
- Presenting for 4 years at the invitation of the NFJS conference series
- Keynote presenter at JiveWorld 2014
- Awarded JavaOne 2014 Rock Star title
- Program committee member, then co-chair of OSCON, contributing to 5 years of attendance and revenue growth
- Founding member of the GitHub Training Team
Contact
Feel free to chat with me about how we can keep making Android better for developers, world wide, history of GitHub the company or platform, conference keynotes on collaboration at scale, talks on the future of software development, or new rock climbing adventures. Email<EMAIL_ADDRESS>or Tweet @matthewmccull.
Photo downloads
- Download Matthew’s monochrome large head-shot here.
- Download Matthew’s monochrome medium head-shot here.
Credits
This site's design was inspired by the Incorporated Jekyll theme.


UltiManager
Take the pain out of managing your ultimate Frisbee team.
Sign up for Updates
Sign up to be notified about the release of our beta.
Take the pain out of managing your ultimate Frisbee team.
Sign up to be notified about the release of our beta.


{{end}}
{{/*
A reuseable template for form select fields formatted with bootstrap. The template is
called with a map or struct with the following keys or fields:
id: unique html element id, also index of value field of "dot"
range: index of range field of "dot"
flabel: bootstrap formatting classes for the label part (optional)
finput: bootstrap formatting classes for the input part (optional)
caption: label caption for input field
icon: last part of the bootstrap glyphicon name to be used
dot: the go template . (dot) value of the enclosing template (optional, if value is set)
value: preset value of input field. if value is empty, dot.id is used (optional, if dot is set)
style: additional style attributes (optional)
validate: validation attributes like 'required', 'min', 'pattern' etc. WARNING: this parameter is
escaped with HTMLAttr, so beware of letting user input get into it. This could easily be exploited!
disabled: make input field disabled
default bootstrap formats:
label: $cfl := "control-label col-xs-4 col-sm-2 col-md-2 col-lg-1"
input: $cfi := "col-xs-8 col-sm-4 col-md-4 col-lg-2"
*/}}
{{define "formselect"}}
{{$cfl := "control-label col-xs-4 col-sm-2 col-md-2 col-lg-1"}}
{{$cfi := "col-xs-8 col-sm-4 col-md-4 col-lg-2"}}


In a previous post, I explained why rewriting existing software in Rust could be a good idea. The main point being that you should not rewrite the whole application, but replace the weaker parts without disturbing most of the code, to strengthen the codebase without disruption.
I also provided pointers to projects where other people and I did it succesfully, but without giving too many details. So let's get a real introduction to Rust rewrites now. This article requires a little bit of knowledge about Rust, but you should be able to follow it even as a
beginner.
As a reminder, here are the benefits Rust bring into a rewrite:
- it can easily call C code
- it can easily be called by C code (it can export C compatible functions and structures)
- it does not need a garbage collector
- if you want, it does not even need to handle allocations
- the Rust compiler can produce static and dynamic libraries, and even object files
- the Rust compiler avoids most of the memory vulnerabilities you get in C (yes, I had to mention it)
- Rust is easier to maintain than C (this is discutable, but not the point of this article)
As it turns out, this is more or less the plan to replace C code with Rust:
- import C structures and functions in Rust
- import Rust structures and functions from C
- reuse the host application's memory allocations whenever possible
- write code (yes, we have to do it at some point)
- produce artefacts that can be linked with the host application
- integrate with the build system
We'll see how to apply this with examples from the Rust VLC plugin.
Import C structures and functions in Rust
Rust can easily use C code directly, by writing functions and structures definitions. A lot of the techniques you would use for this come from the "unsafe Rust" chapter of "The Rust Programming Language" book. For the following C code:
[code lang=C]
struct vlc_object_t {
const char *object_type;
char *header;
int flags;
bool force;
libvlc_int_t *libvlc;
vlc_object_t *parent;
};
[/code]
You would get the following Rust structure:
[code lang=C]
extern crate libc;
use libc::c_char;
#[repr(C)]
pub struct vlc_object_t {
pub psz_object_type: *const c_char,
pub psz_header: *mut c_char,
pub i_flags: c_int,
pub b_force: bool,
pub p_libvlc: *mut libvlc_int_t,
pub p_parent: *mut vlc_object_t,
}
[/code]
the #[repr(C)]
tag indicates to the compiler that the structure should have a memory layout similar to the one generated by a C
compiler. We import types from the libc crate, like c_char
. Those types are platform dependent (with their different form already handled in libc). Here, we use a lot of raw pointers (indicated by *
), which means by using this structure directly, we're basically writing C, which is no good! A good approach, as we'll see later, is to write safer wrappers above those C bindings.
Importing C functions is quite straightforward too:
[code lang=C]
ssize_t vlc_stream_Peek(stream_t *, const uint8_t **, size_t);
ssize_t vlc_stream_Read(stream_t *, void *buf, size_t len);
uint64_t vlc_stream_Tell(const stream_t *);
[/code]
These C function declarations would get translated to:
[code lang=C]
#[link(name = "vlccore")]
extern {
pub fn vlc_stream_Peek(stream: *mut stream_t, buf: *mut *const uint8_t, size: size_t) -> ssize_t;
pub fn vlc_stream_Read(stream: *mut stream_t, buf: *const c_void, size: size_t) -> ssize_t;
pub fn vlc_stream_Tell(stream: *const stream_t) -> uint64_t;
}
[/code]
The #[link(name = "vlccore")]
tag indicates to which library we are linking. It is equivalent to passing a -lvlccore
argument to the linker. Libvlccore is a library all VLC plugins must link to. Those functions are declared like regular Rust functions, but like the previous structures, will mainly work on raw pointers.
bindgen
You can always write all your bindings manually like this, but when the amount of code to import is a bit large, it can be a good idea to employ the awesome bindgen tool, that will generate Rust code from C headers.
It can work as a command line tool, but can also work at compile time from a build script. First, add the dependency to your Cargo.toml
file:
[code lang=toml]
[build-dependencies.bindgen]
version = "^0.25"
[/code]
You can then write your build script like this:
[code lang=C]
extern crate bindgen;
use std::fs::File;
use std::io::Write;
use std::path::Path;
fn main() {
let include_arg = concat!("-I", env!("INCLUDE_DIR"));
let vlc_common_path = concat!(env!("INCLUDE_DIR"), "/vlc_common.h");
let _ = bindgen::builder()
.clang_arg(include_arg)
.clang_arg("-include")
.clang_arg(vlc_common_path)
.header(concat!(env!("INCLUDE_DIR"), "/vlc_block.h"))
.hide_type("vlc_object_t")
.whitelist_recursively(true)
.whitelisted_type("block_t")
.whitelisted_function("block_Init")
.raw_line("use ffi::common::vlc_object_t;")
.use_core()
.generate().unwrap()
.write_to_file("src/ffi/block.rs");
}
[/code]
So there's a lot to unpack here, because bindgen is very flexible:
- we use
clang_arg
to pass the include folder path and pre include a header everywhere (vlc_common.h
is included pretty puch everywhere in VLC) - the
header
method specifies the header from which we will import definitions hide_type
prevents redefinition of elements we already defined (liek the ones from the common header)whitelisted_type
andwhitelisted_function
specify types and functions for which bindgen will create definitionsraw_line
writes its argument at the top of the file. I apply it to reuse definitions from other fileswrite_to_file
writes the whole definition to the specified path
You can apply that process to any C header you must import. With the build script, it can run every time the library is compiled, but be careful, generating a lot of headers can take some time. It might be a good idea to pregenerate them and commit the generated files, and update them from time to time.
It is usually a good idea to separate the imported definitions in another crate with the -sys
suffix, and write the safe code in the main crate.
As an example, see the crates openssl and openssl-sys.
Writing safe wrappers
Previously, we imported the C function ssize_t vlc_stream_Read(stream_t *, void *buf, size_t len)
as the Rust version pub fn vlc_stream_Read(stream: *mut stream_t, buf: *const c_void, size: size_t) -> ssize_t
but kept an unsafe interface. Since we want to use those functions safely, we can now make a better wrapper:
[code lang=C]
use ffi;
pub fn stream_Read(stream: *mut stream_t, buf: &mut [u8]) -> ssize_t {
unsafe {
ffi::vlc_stream_Read(stream, buf.as_mut_ptr() as *mut c_void, buf.len())
}
}
[/code]
Here we replaced the raw pointer to memory and the length with a mutable slice. We still use a raw pointer to the stream_t
instance, maybe we can do better:
[code lang=C]
use ffi;
pub struct Stream(*mut stream_t);
pub fn stream_Read(stream: Stream, buf: &mut [u8]) -> ssize_t {
unsafe {
ffi::vlc_stream_Read(stream.0, buf.as_mut_ptr() as *mut c_void, buf.len())
}
}
[/code]
Be careful if you plan to implement Drop
for this type: is the Rust code supposed to free that object? Is there some reference counting involved? Here is an example of Drop
implementation from the openssl crate:
[code lang=C]
pub struct SslContextBuilder(*mut ffi::SSL_CTX);
impl Drop for SslContextBuilder {
fn drop(&mut self) {
unsafe { ffi::SSL_CTX_free(self.as_ptr()) }
}
}
[/code]
Remember that it's likely the host application has a lot of infrastructure to keep track of memory, and as a rule, we should reuse the tools it offers for the code at the interface between Rust and C. See the Rust FFI omnibus for more examples of safe wrappers you can write.
Side note: as of now (2017/07/10) custom allocators are still not stable
Exporting Rust code to be called from C
Since the host application is written in C, it might need to call your code. This is quite easy in Rust: you need to write unsafe wrappers.
Here we will use as example the inverted index library for mobile apps I wrote for a conference. In this library, we have an Index
type that we want to use from Java. Here is its definition:
[code lang=C]
#[repr(C)]
pub struct Index {
pub index: HashMap<String, HashSet<i32>>,
}
[/code]
This type has a few method we want to provide:
[code lang=C]
impl Index {
pub fn new() -> Index {
Index {
index: HashMap::new(),
}
}
pub fn insert(&mut self, id: i32, data: &str) {
[...]
}
pub fn search_word(&self, word: &str) -> Option<&HashSet<i32>> {
self.index.get(word)
}
pub fn search(&self, text: &str) -> HashSet<i32> {
[...]
}
}
[/code]
First, we need to write the functions to allocate and deallocate our index. Every use from C will be wrapped in a Box
.
[code lang=C]
#[no_mangle]
pub extern "C" fn index_create() -> *mut Index {
Box::into_raw(Box::new(Index::new()))
}
[/code]
The Box
type indicates and owns a heap allocation. When the box is dropped, the underlying data is dropped as well and the memory is freed. The following function takes ownership of its argument, so it is dropped at the end.
[code lang=C]
#[no_mangle]
pub extern "C" fn index_free(ptr: *mut Index) {
let _ = unsafe { Box::from_raw(ptr) };
}
[/code]
Now that allocation is handled, we can work on a real method. The following method takes an index, and id for a text, and the text itself, as a C string (ie, terminated by a null character).
Since we're kinda writing C in Rust here, we have to first check if the pointers are null. Then we can transform the C string in a slice. Then we check if it is correctly encoded as UTF-8 before inserting it into our index.
[code lang=C]
#[no_mangle]
pub extern "C" fn index_insert(index: *mut Index, id: i32, raw_text: *const c_char) {
unsafe { if index.is_null() || raw_text.is_null() { return } };
let slice = unsafe { CStr::from_ptr(raw_text).to_bytes() };
if let Ok(text) = str::from_utf8(slice) {
(*index).insert(id, text);
}
}
[/code]
Most of the code for those kinds of wrappers is just there to transform between C and Rust types and checking that the arguments coming from C code are correct. Even if we have to trust the host application, we should program defensively at the boundary.
There are other methods we could implement for the index, we'll leave those as exercise for the reader :)
Now, we need to write the C definitions to import those functions and types:
[code lang=C]
typedef struct Index Index;
Index* index_create();
void index_free(Index* index);
void index_insert(Index* index, int32_t id, char const* raw_text);
[/code]
We defined Index
as an opaque type here. Since Rust structures can be compatible with C structures, we could export the real type, but since it only contains a Rust specific type, HashMap
, it is better to hide it completely and write accessors and wrappers.
Generating bindings with rusty-cheddar
Writing function imports from C to Rust is tedious, so we have bindgen for this. We also have a great tool to go the other way: rusty-cheddar.
In the same way, it can be used from a build script:
[code lang=C]
extern crate cheddar;
fn main() {
cheddar::Cheddar::new().expect("could not read definitions")
.run_build("include/main.h");
cheddar::Cheddar::new().expect("could not read definitions")
.module("index").expect("malformed module path")
.insert_code("#include \"main.h\"")
.run_build("include/index.h");
}
[/code]
Here we run rusty-cheddar a first time without specifying the module: it will default to generate a header for the definitions in src/lib.rs
.
The second run specifies a different module, and can insert a file inclusion at the top.
It can be a good idea to commit the generated headers, since you will see immediately if you changed the interface in a breaking way.
Integrating with the build system
As you might know, we can make dynamic libraries and executables with rustc and cargo. But often, the host application will have its own build system, and it might disagree with the way cargo builds its projects. So we have multiple strategies:
- build Rust code separately, store libraries and headers in Maven or something (don't laugh, I've worked with such a system once, and it was actually great)
- try to let rustc build dynamic libraries from inside the build system. We tried that for VLC and it was not great at all
- build a static library from inside or outside the build system, include it in the libraries at link. This was done in Rusticata
- build an object file and let the build system link it. This is what we ended up doing with VLC
Building a static library is as easy as specifying crate-type = ["staticlib"]
in your Cargo.toml
file. To build an object file, use the command cargo rustc --release -- --emit obj
. You can see how we added it to the autotools usage in VLC.
Unfortunately, for this part we still do not have automated ways to fix the issues. Maybe with some time, people will write scripts for autotools,
CMake and others to handle Rust and Cargo.
Side note on reproducible builds: if you want to fix the set of Rust dependencies used in your project and make them always available, you can use cargo-vendor to store them in a specific folder
As you might have guessed, this is the most complex part, for which I have no good generic answer. I'd recommend that you spend the most time on this during the project's prototyping phase: import very little C code, export very little Rust code, try to make it build entirely from within the host application's build system. Once this is done, extending the project will get much easier. You really don't want to discover this task at the end of your project and try to retrofit your code in there.
Going further
While this article just explores the surface of Rust rewrites, I hope it provides a good starting point on the tools and techniques you can apply.
Any rewrite will be a large and complex project, but the result is worth the effort. The code you will write will be stronger, and Rust's type system will force you to review the assumptions made in the C version. You might even find better ways to write it once you start refactoring your code in a more Rusty way, safely hidden behind your wrappers.


--- layout: default title: Undergrad at Haverford ---
This project was based on samples collected from beaches on the Gulf of Mexico. The White Lab at Haverford regularly collected oil-soaked sand patties from the beaches and brought them back to lab for hydrocarbon analyses. A few of these sand patties grew fungi while in storage which prompted the question: what exactly were the fungi doing? And were they successfully breaking down the oil? My work on this project involved growing isolates of the fungi on plates inoculated with crude oil and taking samples for hydrocarbon analysis on a regular basis. While I was working on the project we were able to tell that the fungi were in fact munching on the crude oil, but we couldn't get too precise because we hadn't figured out the best way to grow the fungi. After I left the work continued and a year after I graduated from Haverford the project was published in Marine Pollution Bulletin.


Yeah, you know no better
O-oh, save that talk for the ones who don't know no better
'Cause baby I know you better
'Cause baby I know no better
Baby I know you better (baby I know)
Baby I know you better
Baby I know you better
Baby I know you better
Baby I know, I know no better
Quavo!

It's not my race (woo!)

Dat way
Yeah, you know no better
Say you different, who you kidding?


Senator Dino Melaye To Make Nollywood Debut
by George OgboluSenator Dino Melaye (PDP-Kogi West) is set to make his Nollywood debut in a movie titled ‘Lemonade’.
Recall that the Independent National Electoral Commission (INEC) has fixed Saturday, November 30, for the conduct of the Kogi West supplementary rerun election.
INEC had declared the Kogi West Senatorial Rerun inconclusive.
The senatorial election which was held last Saturday, November 16, 20019, was contested by twenty-four candidate with the candidate of the Peoples Democratic Party (PDP), Dino Melaye and Smart Adeyemi of the All Progressives Congress (APC) leading as the major candidates.
This online platform reports that the election was marred by violence and ballot box snatching.
Announcing results, the returning officer of the election, Olayinde Lawal, said the margin between the two leading candidates is lesser than the cancelled votes.
Lawal said while Adeyemi polled a total of 80,118 votes, Dino Melaye had 59,548, leaving a margin of 20,570.
He said 43,127 votes were cancelled across the seven LGAs where the election held.
Dino Melaye may already have carved a new career path for himself by joining Nollywood, with the movie set to premiere on December 12, 2019 at the Transcorp Hilton Hotel in Abuja.
Melaye co-stars with Kunle Remi, Joy Idoko, Ayoola Ayobami, Linda Osifo, Mofe Duncan, Real Warri Pikin, Chioma Idigo, Sean King, among others.
Produced by Joy Media Productions and directed by prolific filmmaker, Lummie Edevibe of Filmcorp, the film is the story of a single mum and aspiring writer who finds courage to leave a toxic relationship, and to pursue her dreams on her own.


Relative, Absolute, and Fixed
Maybe it's because I have delusions of grandure when it comes to my spatial reasoning, but when learning HTML, I found myself very frustrated when trying to apply Margin, Border, and Padding. The concepts seem simple enough, but when applying them to format a website. They sometimes interact in ways you don't expect.First, what does Margin, Border, and Padding mean. The graphic below from Girl Develop It serves as a useful reference point.Let's start wtih Border. The Border is what you think it is. It deliniates the outer lines of an element with HTML. However, while the Border of an element is generally left invisible, it can just as easily be used to format a page. For example, a border 10 pixels wide, with "groove" design and the color 98bf21 looks like this:
Per the Girl Develop It diagram, padding can either be used to position cotent within the border (if no color is specified) or it can serve as another frame within the border. We'll use the same code that we did before and notice the difference. Note that 5px corresponds to the top and that the numbers rotate clockwise with the left being padded by 100px. Also note that the padding also affects the size of the border.
Referencing the Girl Develop It diagram again, we'll see the final aspect we'll discuss is the element's margin. Margin is simlar to padding, except you cannot assign color to it and takes place outside fo the border. Margins are commonly used to seperate an element from other components on a page.


Company
2000 LGE Incorporated
Purchase Order Date
7/14/2006
Vendor
116
Purchase Order
1096
Delivery Order
7/14/2006
PO Status
Unreleased
Buyer
1000
Purchase Order Total
$1,056


Event Location:
ISEP
Rua Dr. António Bernardino de Almeida, 431
Porto, Porto, Portugal
Abstract:
Ever ended up with a source system where an old datatype was replaced with a new one so you had to rebuild all your SSIS packages?  Client specifications changed (again) and you had to start all over again building all your packages? We did it all and rebuild 100+ SSIS packages within a day using biml for generating SSIS packages. And with a generator at hand, we were able to absorb a new version of a source system including analysis of the changes made in the source in only two days. And the best of all, BIML is part of BIDSHelper and free to use! Don' t just believe what I say, In my session I will demonstrate where to start. I will show you around in BIML. After the quick basics of BIML I will show you how you can parameterize the BIML script in order to multiply the template to multiple packages over and over again.
Speaker(s): Sander van der hoeff,
Abstract:
A look at the state of the art in database continuous delivery using SQL Server Data Tools (SSDT), Visual Studio Team Services(VSTS), and VSTS Release Management. The features provided by platforms such as TFS and VSTS have been widely adopted by application developers in support of modern software development practices such as continuous delivery. In the world of database development, adoption has been much slower, due to a number of organisational and technical considerations. This session will discuss some of the challenges associated with database continuous delivery, and the ways in which Visual Studio, SQL Server Data Tools and Visual Studio Team Services can help to improve delivery of SQL Server databases.
Speaker(s): Gavin Campbell,
Abstract:
It's understandable that developers love to work in separate code branches, but this can create painful complications if not managed. Do you dread large merge conflicts when integrating code? Continuous Integration is method of working where we merge and fully test our code multiple times a day. This is only possible with a high level of automation. I'll be discussing the tools I use to achieve this automation when developing SQL Server databases. Finding automating the deployment of database changes hard? ReadyRoll is a tool that allows you to test deployments during development. How do you know your database change won’t affect something you haven’t thought of? tSQLt and Pester unit tests can put your mind at rest. Having trouble keeping your test environments in sync with production? Docker enables us to fix this with infrastructure as code You will see how a CI approach to database development can increase team efficiency and reduce the time to go from an ide
Speaker(s): James Anderson,
Abstract:
Query Store is a new feature that got released on SQL Server 2016 version and is being improved over the last cumulative updates and on SQL Server 2017 vNext CTP's versions. It's a very useful and interesting feature that allow DBA's ( and non-DBA's :) ) to easily identify performance issues on queries and also allow us to fix it in a fast and simple way. Just the ability to compare a previous execution plan to a new plan is a huge step towards understanding what may be happening in our instance. We can even tell the optimizer which plan we want it to use. These were all either extremely difficult to do before and in some cases impossible to do. I want with this session to give you the insight and knowledge to get started using this new and wonderful feature that will change the way how you do performance tuning.
Speaker(s): Andre Batista,
Abstract:
SQL Server and Azure are built for each other. New hybrid scenarios between on-premise SQL Server and Azure mean they don't have to exclude each other but instead you can have the best of both worlds. For example, by taking advantage of services like Azure Blob Storage or Azure VMs we can increase the availability of our services or distribute data in smart ways that benefit our performance and decrease cost. In this demo-heavy session, you will learn the strongest use cases for hybrid scenarios between on-premises and the cloud, and open a new horizon of what you can do with your SQL Server infrastructure. SQL Server and Azure are built for each other. New hybrid scenarios between on-premise SQL Server and Azure mean they don't have to exclude each other but instead you can have the best of both worlds.
Speaker(s): Murilo Miranda,
Abstract:
In this session, we’ll see in detail how to create nodes and edges tables designed for graphs traversal in SQL Server 2017. After a summary of the underlying graph theory and its implementation in databases, we’ll see how to create graph tables in SQL Server 2017, and how to query them with the match operator. This session will give you a kickstart on using graphs in SQL Server 2017.
Speaker(s): Rudi Bruchez,
Abstract:
BI teams usually not only deliver features , but also do the ad hoc reports, users support etc This way BI is not a canonical development team and no pure development methodology works "out of the box" . In my talk I would like to share my experience choosing and adjusting one.
Speaker(s): Maryna Popova,
Abstract:
DevScope Sponsor Session
Speaker(s): Ivan Campos,
Abstract:
This session is about how to set up a WordPress website hosted in Azure using Azure Web Apps and Azure Database for MySQL. As a plus, during the session I will share some tricks about how to build a process/pipeline to deploy changes in the website.
Speaker(s): Eduardo Piairo,
Abstract:
In this talk you will learn how to use Power BI to prototype/develop a BI solution in days and then (if needed) evolve it into a fully scalable Azure BI solution.
Speaker(s): Rui Romano,
Abstract:
In this session we will learn: What is "Azure Database for MySQL" and "Azure Database for PostgreSQL", how can we configure them, what to take attention to and what to expect from these new services. What is the difference from these new services and the MySQL and PostgreSQL that we use on our computers or servers. How to take the best advantage of using this databases as PaaS And much more...
Speaker(s): Vitor Pombeiro,
Abstract:
We have an enormous set of tools for analysis and pattern matching in the data ecosystem. Among the most used, we can find solutions that come from the academic world such as R, others integrated as part of productivity solutions such as SQL Server Analysis Services or Excel, as well as cloud based hosted solutions such as Azure Machine Learning and Power BI. In this session, we will use the mentioned tools to analyze a common data set, discovering the compositions, segmentation and patterns present in the data sample.
Speaker(s): Ana Maria Bisbé York,
Abstract:
In this session you will learn the best practices, tips and tricks on how to successfully use Azure SQL Database on production environments. You will learn how to monitor and improve Azure SQL Database query performance. I will cover how Microsoft CSS has been using Query Store, Extended Events, DMVs to help customers monitor and improve query response times when running their databases in the Microsoft Azure cloud. These learnings are fruit of Microsoft CSS support cases, and customer field engagements. This session includes several demos.
Speaker(s): Roberto Cavalcanti,
Abstract:
The right tabular modeling is the cornerstone that allow us to build the best dashboards, control panels and analytical models. In this session we will analyze some scenarios of data modeling by using DAX and Power BI. These scenarios, which come from real projects, can also be adapted to tabular models with SQL Server Analysis Services in SQL Server Data Tools and Power Pivot in Excel.
Speaker(s): Ana Maria Bisbé York,
Abstract:
Natixis Sponsor Session
Speaker(s): Ivan Campos,
Abstract:
Open source is part of the Microsoft strategy. Indeed, you may run SQL Server either on a physical or a virtual machine, and recently on the top of Windows or Linux operation system as well. At the same time, maintaining business continuity service remains a major challenge for customers because it is synonymous with economic competitivity. Fortunately, high availability features for Linux will also be shipped with SQL Server 2017 to address this daily concern. This session will be delivering an overview of what is new and how it is going to change the landscape of your mission-critical scenarios.
Speaker(s): David Barbarin,
Abstract:
Security is unquestionably a major priority for Microsoft. Join me in this session and see what security features Microsoft has released since SQL Server 2016. In this session you will see how Dynamic Data Masking and Row-Level Security works in on-perm and Azure environments and how to use Always Encrypted.
Speaker(s): Ivan Campos,
Abstract:
Following the trends of hot-topic Docker and Containers. We will talk about the newest developments in Docker World and Microsoft's container adoption.
Speaker(s): Pedro Sousa,
Abstract:
Your company implements data access rules and policies to meet compliance with established security standards... How can you ensure and prove at any time that they're being properly followed, without killing your database servers performance while capturing evidence? In this Session I'll talk about SQL Server Audit and demonstrate how easy it is to implement in such a way that suits most companies needs, whithout afecting Server performance. Also some news in SQL Server 2017 regarding this subject!
Speaker(s): Etienne Lopes,
Abstract:
The publication of R Server by Microsoft aims to improve the weaknesses of the R language and its processes of performance, development and operationalization. When we need to analyze very diverse or really large amounts of data, traditional servers may fall short, and this is where R Server over Spark comes to the rescue. How is it implemented in the Microsoft ecosystem? In what scenarios does it help us? How do we configure it? In this session we will answer all these questions and more, with our eyes always on the clouds and thinking big.
Speaker(s): Pau Sempere,
This is a list of speakers from the XML Guidebook records. The details and URLs were valid at the time of the event.
LinkedIn: http://nl.linkedin.com/in/shoeff
Contact: http://www.du-sabot.nl
With over 20 years of experience in automation Sander van der Hoeff knows his way around in the ICT business. Since 2000 Sander is Specialized in business intelligence and data warehousing using the full SQLServer Stack. In 2012 Sander founded his own BI-company: Du Sabot. Nowadays Sander spends his time on several BI- and DWH-projects as an independent professional. Sander combines deep technical knowledge with the capability to explain difficult BI- and DWH-concepts to the non-technical people
LinkedIn: https://pt.linkedin.com/in/jesuspiairo
Contact: http://www.eduardopiairo.com/
Deployment pipeline craftsman always ready to learn new ways to implement Source Control, Continuous Integration and Continuous Delivery for databases, applications and infrastructure. Database administrator with special interest in database changes and data modeling. Operations engineer, DevOps Agent with automation, collaboration and communication as priorities.
LinkedIn: https://pt.linkedin.com/in/pmsousa
Contact: http://www.devscope.net
Pedro Sousa lives in Porto, Portugal and he currently works as a Senior IT Operations Analyst at Basecone. Started working with SQL Server at version 6.5 and although DBA is not his primary role, always had a particular interest for it. Nowadays one of his main focus is Microsoft Azure and integration with on-premises networks, working from the copper wire to the Cloud.
LinkedIn: https://www.linkedin.com/in/robertocavalcanti
Roberto Cavalcanti is an Azure Cloud Solution Architect with the Customer Architecture and Engineering team at Microsoft. He is a database specialist with 20+ years of experience. He focuses on helping customers to be successful in Microsoft's Azure cloud and on improving Microsoft Azure products. Roberto has written many articles about SQL Server/Azure SQL DB for MSDN/TechNet, SQL Magazine, and has been a speaker in events such as TechReady, Microsoft Insights/TechEd, SQL Saturday. He has delivered Azure training in multiple countries in the Americas, and in Europe. Roberto is based on the Microsoft Las Colinas, Texas, USA office.
LinkedIn: https://pt.linkedin.com/in/idcampos
Contact: http://wizarddba.com/
Ivan Campos is currently a database administrator in 3C Payment a fin-tech in Luxembourg. (3CPayment.com). He is Microsoft Most Valuable Professional, active speaker at local community meetings in Portugal and outside Portugal. He is the leader and one of the founders of the community based in the north of Portugal Porto.Data (www.portodata.net) and the organizer of SQLSaturday in Porto Portugal.
LinkedIn: https://pt.linkedin.com/in/ruiromano
Contact: http://ruiromanoblog.wordpress.com/
Rui Romano lives in Portugal and he leads the Business Intelligence team at DevScope. He has been Developing amp; Architecting software solutions since 2003 always focused in the Business Intelligence area.
LinkedIn: https://pt.linkedin.com/in/idcampos
Contact: http://wizarddba.com/
Ivan Campos is currently a database administrator in 3C Payment a fin-tech in Luxembourg. (3CPayment.com). He is Microsoft Most Valuable Professional, active speaker at local community meetings in Portugal and outside Portugal. He is the leader and one of the founders of the community based in the north of Portugal Porto.Data (www.portodata.net) and the organizer of SQLSaturday in Porto Portugal.
Contact: http://www.solidq.com
Pau Sempere S#225;nchez is a Computer Science graduate, working at SolidQ as Data Platform Architect and is member of PASS Spanish Group. He#39;s worked in BI and database projects for top companies in the world, in diverse areas as communications, insurance, retail, transport, banking and automotive. He has been presenting in many Microsoft and community events such as SQL Saturday Madrid and Barcelona, the 12 hours of SQL Server, SolidQ Summit or TechNet Webcasts, and teaching in the SolidQ Master for 6 years in a row
Contact: https://sqland.wordpress.com
Etienne Lopes currently works as a SQL Server DBA at Celfinet. Working with SQL Server since 1997, member of sqlport community (www.sqlport.com), regular speaker since 2012 at SQL Server events such as: SQL Saturday and 24 Hours of Pass. Blog: http://sqland.wordpress.com/
LinkedIn: http://fr.linkedin.com/in/mikedavem/en
Contact: http://www.dbi-services.com/index.php/blog/dbi-bloggers/blogger/listings/dab
David Barbarin is Consultant at dbi services. He has more than ten years of experience in Microsoft solutions. He is specialized in SQL Server technologies and associated topics such as installation, migration, security audits, troubleshooting of performance issues, or high availability architectures etc. David Barbarin is SQL Server MVP (since 2010), Microsoft Certified Master (MCM) for SQL Server, and Microsoft Certified Trainer (MCT).
LinkedIn: http://uk.linkedin.com/in/gavincampbell
Contact: http://arapaima.uk
Gavin Campbell is a recovering Business Intelligence developer specialised in improving working practices in database delivery through the use of tools such as SQL Server Data Tools, tSQLt, Visual Studio Team Services, Git and Jenkins, on platforms such as AWS and Microsoft Azure, and methodologies such as Continuous Delivery and Agile.
LinkedIn: https://www.linkedin.com/in/vitorpombeiro
Azure SQL DB Support Engineer at Microsoft. Working with SQL Server since version 7.0 and before that with SQL Anywhere. Working in the clouds with SQL Server and Azure SQL DB, DW, MySQL and PostgreSQL.
LinkedIn: https://www.linkedin.com/in/ambynet
Contact: http://amby.net/
Partner Microsoft en Power BI. Influencer en Pragmatic Works. Lic. en Cibernetica Economica con Master en Ciencias Economicas, Moscu; 1988. Master en Gestion del Conocimiento y Business Intelligence con tecnologia Microsoft(MS), y Master en Tecnologias de Desarrollo de MS. Colaboro activamente en grupos de usuarios de MS Visual FoxPro. Mantiene un blog personal. Actualmente es Consultora Business Intelligence con tecnologia MS, trabajando tanto en formacion como en proyectos. Ha sido ponente en eventos SQL Saturday, dentro y fuera de Espania, 24H SQL, IT Woman y Encuentros en Microsoft Espania.
I am a Big Data Engineer in a BI team. I have around 4 years of professional expertise in the Information Technologies industry, mainly all around data Engineering and Data Warehousing. I am working on my 3rd BI Project now. All of them are in different business areas and are using different technologies. What is common between them is the willingness to find the most proper development methodology as it is not a canonical development team and no development methodology works "out of the box" . In my talk I would like to share my experience in this area.
LinkedIn: https://fr.linkedin.com/in/rudibruchez
Contact: http://www.babaluga.com/
(same as before)
LinkedIn: https://www.linkedin.com/in/ambynet
Contact: http://amby.net/
Partner Microsoft en Power BI. Influencer en Pragmatic Works. Lic. en Cibernetica Economica con Master en Ciencias Economicas, Moscu; 1988. Master en Gestion del Conocimiento y Business Intelligence con tecnologia Microsoft(MS), y Master en Tecnologias de Desarrollo de MS. Colaboro activamente en grupos de usuarios de MS Visual FoxPro. Mantiene un blog personal. Actualmente es Consultora Business Intelligence con tecnologia MS, trabajando tanto en formacion como en proyectos. Ha sido ponente en eventos SQL Saturday, dentro y fuera de Espania, 24H SQL, IT Woman y Encuentros en Microsoft Espania.
LinkedIn: https://uk.linkedin.com/in/jsbanderson
Contact: http://TheDatabaseAvenger.com
James Anderson is a freelance SQL Server guy in Southampton, UK. He has been working with databases since 2008. The first and worst RDBMS he worked with was Paradox. He quickly moved to using T-SQL in SQL Server 2005 and has worked on every version of the product since. His work ranges from stand-alone systems for simple websites to multi terabyte HA environments that support thousands of sites across Europe. Each have their own challenges.
LinkedIn: http://pt.linkedin.com/pub/andre-batista/9/111/790/
Contact: http://klunkysql.info/
Andre Batista, with academic path in the course of Electronics, Telecommunications and Computers ( ISEL - Lisbon ) is currently in Crossjoin Solutions working as SQL Server DBA, performing functions on the client PT (Portugal Telecom). He is interested in all areas related to SQL Server and particularly in architecture, implementation, maintenance and performance. He is a member of the Portuguese SQL Server User Group, SQLPort (http://www.sqlport.com) and also one of the founders of TUGA.
LinkedIn: https://www.linkedin.com/in/ambynet
Contact: http://amby.net/
Partner Microsoft en Power BI. Influencer en Pragmatic Works. Lic. en Cibernetica Economica con Master en Ciencias Economicas, Moscu; 1988. Master en Gestion del Conocimiento y Business Intelligence con tecnologia Microsoft(MS), y Master en Tecnologias de Desarrollo de MS. Colaboro activamente en grupos de usuarios de MS Visual FoxPro. Mantiene un blog personal. Actualmente es Consultora Business Intelligence con tecnologia MS, trabajando tanto en formacion como en proyectos. Ha sido ponente en eventos SQL Saturday, dentro y fuera de Espania, 24H SQL, IT Woman y Encuentros en Microsoft Espania.
LinkedIn: https://pt.linkedin.com/in/idcampos
Contact: http://wizarddba.com/
Ivan Campos is currently a database administrator in 3C Payment a fin-tech in Luxembourg. (3CPayment.com). He is Microsoft Most Valuable Professional, active speaker at local community meetings in Portugal and outside Portugal. He is the leader and one of the founders of the community based in the north of Portugal Porto.Data (www.portodata.net) and the organizer of SQLSaturday in Porto Portugal.
LinkedIn: http://pt.linkedin.com/in/murilomiranda/
Murilo Miranda is a blogger, speaker and SQL Server MVP from Portugal. Nowadays he#39;s a Cloud Operations Engineer at DataStax. Murilo’s passion for working with people coupled with his honesty have helped him establish effective, meaningful relationships with his clients. When he isn’t working, he can be found enjoying life with his family, watching football and playing Playstation.
The following is a list of sponsors that helped fund the event.
Rumos - Formação e Comunicação, S. A.
Natixis – Sucursal em Portugal


| Home | Tutorials | The Entity Class |
Reminder! To run these examples, you should first start a new session then load the sample database using:"/localvision/samples/general/sample.load" asFileContents evaluate ;Any other files referenced can be read from the /localvision/samples/general/ directory.Note: The sample.load file runs by default on a Unix environment. If you are using a Windows NT platform, this location may be prefixed by a drive and optional path (e.g. d:/visiondb/localvision/samples/general/sample.load). Check with your Vision Administrator for further details.
There are many objects in Vision that you need to access by name. Because Vision allows you to maintain many different classes of information, certain conventions have been established to help keep the names straight. For example, suppose you manage a portfolio for General Motors, analyze the company General Motors, and own the common stock of General Motors. These would represent three distinct objects in Vision. The variable name GM could only be associated with one of these objects. To address this situation, a separate dictionary of names is set up for each entity class. You would access a specific entity object using an expression of the form:
Named Company GMto access the Company object or
Named Account GMto access the Account object. For example, the sample database includes a sector named RETAIL and an industry named RETAIL. The expression:
Named Industry RETAILaccesses the industry and the expression:
Named Sector RETAILaccesses the sector.
Type and execute the expression:
Named Company GMYou should see:
GMNow try accessing a company that does not exist:
Named Company XYZYou should see:
>>> Selector 'XYZ' Not Found <<< NABecause XYZ is not defined as a Company, Vision displays a not found error and returns the value NA (not available) as the result.
To access the latest sales value for GM, execute the expression:
Named Company GM salesYou should see:
101781.00To access GM's price, execute:
Named Company GM priceYou should see:
32.12If you request information that does not exist, you will receive a Selector Not Found message as shown below:
Named Company GM xyzYou should see
>>> Selector 'xyz' Not Found <<< NAThis message informs you that the company GM does not respond to the message xyz. To determine what messages the company does respond to, send the displayMessages message:
Named Company GM displayMessagesYou will see a list of the messages that have been defined for the Company class. Because all instances of a class respond to the same messages, the expression:
Company displayMessagesis identical to the previous expression. To access the earnings per share value for GM, execute:
Named Company GM earningsPerShareproducing the result:
5.03Change GM to IBM as shown below:
Named Company IBM earningsPerShareYou should see:
8.72To better identify what information is being printed, modify the previous program as shown below:
"IBM Earnings Per Share: " print; Named Company IBM earningsPerShareYou should see:
IBM Earnings Per Share: 8.72You can do calculations with the information you access. For example, to compute GM's return on equity, execute the following:
Named Company GM netIncome / Named Company GM commonEquity * 100You should see:
10.76Suppose you want to display several pieces of information for GM in the same program. For example, to look at the components of return on equity followed by the computation, execute:
Named Company GM netIncome print: 10.3 ; Named Company GM commonEquity print: 10.3 ; Named Company GM netIncome / Named Company GM commonEquity * 100You should see:
3550.900 32988.910 10.76To make the results of the last program more presentable, try the following modifications:
"Net Income" print: 30 ; Named Company GM netIncome printNL: 10.3 ; "Common Equity" print: 30 ; Named Company GM commonEquity printNL: 10.3 ; "Return On Equity" print: 30 ; Named Company GM netIncome / Named Company GM commonEquity * 100 printNL: 10.3 ;Your should see:
Net Income 3550.900 Common Equity 32988.910 Return On Equity 10.764The print: 30 message to the strings causes them to be padded with blank spaces so that the labels are all the same length. The printNL: message is used to separate each item into its own row.
By this time, you have probably become tired of typing Named Company GM over and over again. Several techniques are available in Vision to help streamline your programs.
You can create a variable that represents the company GM. To do this type:
!gm <- Named Company GMThe variable gm will remain available until you terminate your session. The expression:
gm salescan now be used to access GM's latest sales value and the program:
"Net Income" print: 30 ; gm netIncome printNL: 10.3 ; "Common Equity" print: 30 ; gm commonEquity printNL: 10.3 ; "Return On Equity" print: 30 ; gm netIncome / gm commonEquity * 100 printNL: 10.3 ;can be used to compute and display GM's return on equity calculation. Variables can be used to save the results of calculations. For example, a variable can be created to store the results of the roe calculation:
!roeGM <- gm netIncome / gm commonEquity * 100 ;The previous program could then be rewritten as:
gm netIncome print: 10.3 ; gm commonEquity print: 10.3 ; roeGMBy creating the variables gm and roeGM you were able to eliminate some typing in the previous examples. Unfortunately, this approach is only useful if you are working the company GM. The do: message provides a more general way to streamline your program.
Type the following:
gm do: [ name print: 30 ; sales print: 10 ; netIncome print: 10 ; ] ;You should see:
General Motors Corp 101781.00 3550.90The do: message can be used to "factor out" the repeated expression in the body of your program, in this case the gm. The do: message requires one parameter. This parameter is enclosed by square brackets [ ]. All expressions inside the brackets are evaluated for the company GM. Any valid Vision expression can be included inside the brackets. The previous example is identical to:
Named Company GM do: [ name print: 30 ; sales print: 10 ; netIncome print: 10 ; ] ;In addition to sales, suppose that you wished to calculate the price-earnings ratio for GM by dividing the price by the earnings per share value. The program:
Named Company GM do: [ name print: 30 ; sales print: 10 ; price / earningsPerShare print:10 ; ] ;produces the result:
General Motors Corp 101781.00 6.39To find the same information for IBM, change GM to IBM as shown below:
Named Company IBM do: [ name print: 30 ; sales print: 10 ; price / earningsPerShare print:10 ; ] ;You should see:
IBM Corp 54217.02 9.26To find the same information for Exxon, change IBM to XON as shown below:
Named Company XON do: [ name print: 30 ; sales print: 10 ; price / earningsPerShare print:10 ; ] ;You should see:
Exxon Corp 76416.00 18.62
You saw in the previous example that the do: message allows you to develop a program for one company and easily modify it to work with another one. By combining this streamlined access mechanism with various formatting techniques, you are ready to build substantial programs.
Start by labeling the items displayed in the previous report:
Named Company GM do: [ "Sales" print: 30 ; sales printNL: 10 ; "Price-Earning Ratio" print: 30 ; price / earningsPerShare printNL: 10 ; ] ;producing the result:
Sales 101781.00 Price-Earning Ratio 6.39
To display net income as the second line item in this report, modify the previous program as follows:
Named Company GM do: [ "Sales" print: 30 ; sales printNL: 10 ; "Net Income" print: 30 ; netIncome printNL: 10 ; "Price-Earning Ratio" print: 30 ; price /earningsPerShare printNL:10 ; ] ;producing the result:
Sales 101781.00 Net Income 3550.90 Price-Earning Ratio 6.39To display the large numbers with commas to make them more readable, modify the program as shown below:
Named Company GM do: [ "Sales" print: 30 ; sales printWithCommasNL: 10 ; "Net Income" print: 30 ; netIncome printWithCommasNL: 10 ; "Price-Earning Ratio" print: 30 ; price /earningsPerShare printNL:10 ; ] ;producing the result:
Sales 101,781.00 Net Income 3,550.90 Price-Earning Ratio 6.39Now modify the program to print the company name centered over the forty columns of the report:
Named Company GM do: [ name centerNL: 40 . print; "Sales" print: 30 ; sales printWithCommasNL: 10 ; "Net Income" print: 30 ; netIncome printWithCommasNL: 10 ; "Price-Earning Ratio" print: 30 ; price /earningsPerShare printNL: 10 ; ] ;producing the result:
General Motors Corp Sales 101,781.00 Net Income 3,550.90 Price-Earning Ratio 6.39Skip an extra line after the company name. As a finishing touch, place a note at the bottom of the output, indicating that you have just completed your first major report:
Named Company GM do: [ name centerNL: 40 . print; newLine print ; "Sales" print: 30 ; sales printWithCommasNL: 10 ; "Net Income" print: 30; netIncome printWithCommasNL: 10 ; "Price-Earning Ratio" print: 30 ; price /earningsPerShare printNL: 10 ; ] ; newLine print ; "--------------------" printNL ; "My First Report" printNL ;producing the result:
General Motors Corp Sales 101,781.00 Net Income 3,550.90 Price-Earning Ratio 6.39 -------------------- My First ReportTo prepare this report for a different company, just change the GM to the company of your choice.
It would now be useful to turn this program into a method that you can run without recalling the program each time. To create a method called "firstReport", execute the following:
Company defineMethod: [ | firstReport | name centerNL: 40 . print; newLine print; "Sales" print: 30 ; sales printWithCommasNL: 10 ; "Net Income" print: 30 ; netIncome printWithCommasNL: 10 ; "Price-Earning Ratio" print: 30 ; price / earningsPerShare printNL: 10 ; newLine print; "--------------------" printNL ; "My First Report Method" printNL ; ] ;To run this method, execute:
Named Company IBM firstReportYou should see:
IBM Corp Sales 54,217.02 Net Income 5,258.00 Price-Earning Ratio 9.26 -------------------- My First Report MethodTo run this report for GM, execute:
Named Company GM firstReportYou should see:
General Motors Corp Sales 101,781.00 Net Income 3,550.90 Price-Earning Ratio 6.39 -------------------- My First Report Method
In the examples so far, you have printed numeric and textual information defined specifically for each company such as name and sales. In Vision, there is no restriction on the type of data you can store for a property. For example, the value for the company GM's industry was defined using the expression:
Named Company GM :industry <- Named Industry AUTO ;In a traditional database, the value of industry would probably be stored as a string or number in a company table. This value would then be used to query an industry table in order to access information about a company's industry. In Vision, the object representing the company's industry is stored directly as the value of the industry property. As a result, the simple expression:
Named Company GM industryreturns an object of the class Industry that responds all the Industry messages including name. The expression:
Named Company GM industry nameaccesses the name of GM's industry. The expression:
Named Company GM industry whatAmIinforms you that the object is of the class Industry and the expression:
Named Company GM industry displayMessagesdisplays the list of messages that are defined for industry objects. Notice that one of the messages is the sector message. In the sample database, the value for the AUTO industry's sector was defined using:
Named Industry AUTO :sector <- Named Sector DUR ;This expression assigns the object representing the Durable Goods sector to the AUTO industry's property. Since all sectors respond to the message name, the expression:
Named Company GM industry sector namedisplays the result:
Durables
| Copyright © 1999 Innovative Systems Techniques, Inc. | Updated January 25, 1999 |


Esther 4:6
So Hatach went forth to Mordecai unto the street of the city, which was before the king's gate.


Easily remove write protection from Microsoft Office files
UnprotectOffice lets you remove any write protection from an Office document with a couple clicks, while keeping its original formatting.
UnprotectOffice supports Word documents and will support PowerPoint and Excel documents soon.
Word (.docx & .docm)
PowerPoint (.pptx & .pptm)
Excel (.xlsx & .xlsm)
How does it look ?
A small description of the unprotecting process
The document is extracted in a temporary directory. The program check for lines enabling write protection in every file where they may appear and deletes them. The document is then compressed back to its original format and the temporary directory is deleted. The old file is replaced by the new, editable one. The old file is either renamed or deleted, depending on which option was chosen.


|
| Page date Tue Mar 8 22:24:45 2011 . | Improve this page |
Synchronisation primitives are required to avoid busy waits; instead of looping until a condition is met, it is far more efficient to put the given task to sleep and to wake it up when the condition is fulfilled.
µOS++ synchronisation primitives are based on Unix sleep/wakeup mechanism; the semantics are more or less preserved, however, in an attempt to increase readability, the functions were renamed to eventWait()/eventNotify().
In addition to the Unix save/restore roots, the design of µOS++ was also inspired by Java Threads, at least the wait/notify names were used. One difference from the Java implementation is that in µOS++ the wait/notify methods are linked only to tasks, not to all objects as in Java.
The wait/notify mechanism does not include any condition that the program is waiting for; i.e. if the waiting task is notified, this does not necessarily mean that the condition was met, and the reverse, if the task was not notified, this does not mean that the condition was not met.
From a more general point of view, the wait/notify mechanism is not a communication mechanism, since it is not designed to carry any information payload between objects in general or not even between tasks in particular.
The wait/notify mechanism is also not a full synchronisation mechanism, since it does not include critical sections or any other mechanisms to protect variables from being accessed simultaneously from multiple tasks.
The eventWait()/eventNotify() methods represent the µOS++ basic bricks for building complete synchronisation objects, like blocked I/O, mutex, event flags, etc.
From the scheduler point of view, the truly basic operations would be yield() and setWaiting(true)/setWaiting(false); these are the absolute minimum requirements for a highly general design; using these and external data structures, any other mechanism could be designed.
However, we decided that implementing the event mechanism outside the scheduler would be less efficient, and trading efficiency for generality would not be worth in an embedded system. Based on the success of the Unix sleep/wakeup mechanism, we considered that it should also be enough for µOS++, and the need for other mechanisms would be quite remote.
Based on the above, we decided to incorporate the event synchronisation mechanism into the task and scheduler classes, so that a task cannot just wait in general, but always wait for an event.
At the first glance, for eventWait(), the behaviour seems quite straightforward, the event is stored in the current task structure, the task is marked as waiting and the CPU is released to other tasks with a yield().
As expected, eventNotify() does the oposite, if the task is waiting and the and the notified event matches the event the ask is waiting for, the task is marked as no longer waiting and it is inserted in the list with active tasks.
When a waiting task is notified, it changes status to active and it is no longer able to receive any further notifications.
So only the first notification is accounted for, all other are silently ignored.
To inform the user that the task was notified, the task method eventNotify() returns 1, otherwise returns 0.
As we can foresee from the above section… nothing happens. The call is silently ignored and eventNotify() returns 0.
Although the mechanism seems straightforward, the Devil is in the details.
The usual scenario when using wait and notify is:
What if, for one reason or another, the first task is interrupted exactly between step 1 and 2, i.e. before having the chance to perform the eventWait()?
The scenario in this case would be the following:
The correct answer is: a possible deadlock. When the eventNotify() is called, since the first task did not have the chance to call the eventWait(), the notified event is ignored. Later on, after the first task calls eventWait(), probably there will be no task to notify it, since the task originating the event already notified the event.
For periodic events, like those generated by a timer, the problem might pass unnoticed if the next tick will notify the task, but the timer precision is affected.
Also for devices that receive streams of bytes and generate interrupts for each byte, the race condition may occur on the first interrupt, but if the byte is buffered, it might also pass unnoticed, the reading task being notified by the next interrupts.
However, this is a potentially serious problem, and well behaved programs should always avoid race conditions, by using critical sections.
The first and simplest solution for the race condition is to include both the test of the condition and the eventWait() in a critical section
os.sched.criticalEnter();
{
if (!isAvailable())
eventWait(event);
}
os.sched.criticalExit();
For applications that decide to squeeze every cycle from the CPU by minimising the critical sections, µOS++ also provides a finer grain access to the eventWait() internals: the eventWaitPrepare() and eventWaitPerform() methods.
The rationale behind this is that within eventWait() only the code required to register the event in the system structures needs to run in a critical section with the code testing the condition; the code that performs the yield() is imune to race conditions.
So, a more elaborate solution for the race condition would look like
bool doWait;
doWait = false;
setEventWaitReturn(OSEventWaitReturn::OS_IMMEDIATELY);
os.sched.criticalEnter();
{
doWait = (!isAvailable()) && eventWaitPrepare(event);
}
os.sched.criticalExit();
if (somethingWrong)
{
eventWaitClear();
return;
}
if (doWait)
eventWaitPerform();
OSEventWaitReturn_t ret;
ret = getEventWaitReturn();
One interesting characteristic of the original Unix sleep/wakeup mechanism was that one single wakeup() call was able to wake multiple threads waiting for the same event.
Although this seems more of a theoretical problem than a practical need, one classical example where multiple tasks should be notified by a single call is the mutex implementation, or any similar synchronisation object used by multiple tasks to serialise access to a common resource. The keyword here is multiple: if several tasks are competing for a common resource, when one releases the resource, it should notify all tasks waiting for the resource.
µOS++ provides such a functionality, in the OSScheduler class. When calling the OSScheduler::eventNotify(), all tasks are enumerated, and those waiting for the given event are notified.
In fact, using OSScheduler::eventNotify() is the recommended way of sending notifications. The alternative of sending notifications directly to the tasks should be used as an optimisation, but only when it is absolutely obvious there is only one task waiting for the given event.
µOS++ implements a special case when a single eventNotify() can be automatically addressed to all waiting tasks. For this case µOS++ reserves a special event code, defined as OSEvent::OS_ALL.
The reasons for notifying all tasks may vary, one of them being the case when there are more than one conditions to wait for, on multiple tasks. Each of the events notify all tasks, and the first task that gets the CPU may acquire a shared resource.
When using this feature, it is recommended to explicitly set the return value to OSEventReturn::OS_ALL.
os.sched.eventNotify(OSEvent::OS_ALL, OSEventReturn::OS_ALL);
Similarly, a task can arrange to be waken by all incoming events. For this, the same OSEvent::OS_ALL can be used.
os.sched.eventWait(OSEvent::OS_ALL);
Obviously, after waking up, the task should check for the condition it is expecting, and if not fulfilled, to loop to eventWait().
However It should be noted that this is not an optimal use of the multitasking mechanisms.
As already mentioned, a returning eventWait() does not guarantee that the condition it was waiting for really occurred. It just means someone called an eventNotify() on the same event, or even worse, called an eventNotify(OSEvent::OS_ALL). Possible reasons for someone to call eventNotify() even when the condition is not true can be timeouts or task cancellation requests.
In order to differentiate between all these possible cases, µOS++ provides an additional argument to eventNotify(event, ret). When the eventNotify() is processed, this value is simply passed as a return value for eventWait(). The default for this value is defined as OSEventReturn::OS_VOID, but it is recommended to duplicate the event as the event return value.
os.sched.eventNotify(event, (OSEventReturn_t)event);
Other special values for OSEventReturn are defined for timeouts (OSEventReturn::OS_TIMEOUT), cancelled tasks (OSEventReturn::OS_CANCELLED and other cases. It is recommended to use these values for similar functionality.
In addition, depending on the application’s specifics, it is recommended to check the value returned by eventWait() and if needed, loop to eventWait().
TODO: this sections needs to be updated, content moved to the API section and here only a short summary kept.
OSEventWaitReturn_t eventWait(OSEvent_t event);
Block the current task and wait for the event to occur (task is put to sleep). The task is removed from the running list and will no longer be scheduled to run until the event occurs. The first notification addressed to the given event will unblock the task and the specified value will be returned (wake up the task).
In addition to application managed return values, it is recommended to consider processing the following special return values:
Return: the value used by the nofitication call.
int eventNotify(OSEvent_t event, OSEventWaitReturn_t ret=OSEventWaitReturn::OS_VOID);
Notifies all tasks waiting on the given event. Notified tasks are inserted into the running list (in the order they were registered to the schedulers) and will wait their turn for the CPU. Only the first notification addresed to a blocked task is significative, i.e. only the ‘ret’ value of the first notification will be returned by corresponding evenWait() functions; all further notifications addressed to a task waiting to run or running will be silently discarded.
A special case is when the event is OSEvent::OS_ALL since all waiting tasks are notified, regardless of the event they are waiting for (in other words, OSEvent::OS_ALL acts like a wildcard matching all events). For a consistent processing, it is recommended to pair this special event with the special return value OSEventWaitReturn::OS_ALL.
Return: the number of tasks notified.


@* * Copyright 2023 HM Revenue & Customs * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *@ @import uk.gov.hmrc.hmrcemailrenderer.templates.ecc.html._ @import uk.gov.hmrc.hmrcemailrenderer.templates.helpers.html._ @import uk.gov.hmrc.hmrcemailrenderer.templates.ecc.html.serviceName @(params: Map[String, Any]) @check_the_service = @{ params.getOrElse("enrolmentKey", "") match { case "HMRC-ATAR-ORG" =>
You can now apply for an:
You can now get a goods movement reference (GMR).
case "HMRC-CTC-ORG" =>You can now submit union transit declarations through NCTS.
case "HMRC-SS-ORG" =>You can now make entry summary declarations.
case "HMRC-CTS-ORG" =>You can now:
You can now report and manage your allowance for Customs Duty waiver claims.
case _ =>You can now use the Customs Declaration Service.
} } @template_main(params, s"${serviceName(params, "a service")}") {@salutationFullName(params)
@check_the_serviceFrom HMRC
}


Go Back
Suggestion box
Please give as much detail as you can and share examples if you have any
Your suggestion has ben placed
Submit


INGREDIENTS 10-12 slices
- 200g self-raising flour
- 200g butter, softened
- 4 medium eggs
- 1 tbsp. baking powder
- 200g caster sugar
- 2 tsp. vanilla extract
- 1/4 tsp. salt
- 2 tbsp. milk
- 100g butter, softened
- 150g icing sugar, sifted
- 1 tsp. vanilla extract
- 2 tbsp. milk
- around 200g of a good-quality strawberry jam.
FOR THE FILLING:
METHOD
Prep time: 10 mins | Cooking time: up to 25 mins
- Preheat the oven to 180C/350F/gas mark 4. Grease two 20cm/8 inch tins and line with baking parchment.
- Cream together the butter, sugar and vanilla essence in a large bowl until they are pale and fluffy.
- Slowly beat in your eggs and gradually sift in the self-raising flour, baking powder and salt into the bowl.
- Fold the flour into the mixture, if necessary add in a few tbsp. of milk.
- Once your batter is at a smooth consistency, divide the mixture between the two tins and gently smooth the surface with a spatula or spoon.
- Bake for around 20-25 mins until golden-brown. The cake's surface should spring back when pressed or alternatively, insert a skewer into the center, if ready it should come out clean.
- Set aside to cool for a few minutes before removing from the tins and leaving to cool completely.
- Whilst your cake is cooling, start on making your filling.
- Beat the softened butter until it is smooth and creamy, then mix in the icing sugar, vanilla extract and milk. Mix the buttercream until pale and fluffy.
- If necessary, level one of your sponges before spreading or piping the buttercream on top.
- Top the buttercream with strawberry jam and place the second sponge on top.
- To serve, dust with a little bit of icing sugar and cut into slices.


Use the contextual classes to provide "meaning through colors": Use the contextual classes to provide "meaning through colors":Use the contextual classes to provide "meaning through colors":Use the contextual classes to provide "meaning through colors":Use the contextual classes to provide "meaning through colors":Use the contextual classes to provide "meaning through colors":Use the contextual classes to provide "meaning through colors":Use the contextual classes to provide "meaning through colors":Use the contextual classes to provide "meaning through colors":Use the contextual classes to provide "meaning through colors".


{% extends 'base_private.html' %} {% block main %}
{{ message }}
Were you redirected to this page, the system is missing some data.
Set the time until retirement. This feature will be made optional.


K_Means_Clustering Class
The K_Means_Clustering class contains all the necessary logic for clustering unsupervised data.
Constructor
K_Means_Clustering
-
args
Parameters:
-
args
ObjectContains all the necessary parameters for K-Means clustering as listed below.
-
random_Init_Count
NumberRequired parameter for how many times to randomly initialize centroids.
-
cluster_count
NumberRequired value to specify how many clusters in total are to be initialized.
-
notify_count
NumberRequired value to execute the iteration_callback after every x number of iterations.
-
iteration_callback
FunctionRequired callback that can be used for getting information for diagnostics.
-
Item Index
Methods
apply_Callback
-
isComplete
-
iterations
This method is reponsible for passing data to the provided callback function for the purpose of diagnostics.
Parameters:
-
isComplete
BooleanThe boolean value to indicate if the clustering is completed.
-
iterations
NumberIs the number of iterations for the K-Means clustering algorithm.
Returns:
info Is the object containing information for diagnostics.
assign_Clusters
-
X
This method contains the logic to assign clusters points to different centroids.
Parameters:
-
X
MatrixThis is the unsupervised input data for clustering.
Returns:
this.clusters This is the matrix containing the clustered data.
distance
-
X
-
u
This method serves as the logic for the calculating distance between centroids and data points.
Parameters:
-
X
MatrixThis is the unsupervised input data for clustering.
-
u
MatrixThis is the centroid from which distance relative to all input data points will be calculated.
Returns:
distance This is a matrix containing the distance of all data points relative to a centroid.
initiate_Centroids
-
X
This method is responsible to randomly initiate centroids for the given data.
Parameters:
-
X
MatrixThis is the unsupervised input data for clustering.
Returns:
this.centroids Are the randomly genrated centroids.
start_Clustering
-
X
This method contains the iterative implementation of the K-Means clustering algorithm.
Parameters:
-
X
MatrixThe matrix to be used as the data input for clustering.
Returns:
defered.promise Returns a promise upon completion.
unique_Random_Val
-
X
This method is reponsible for generating unique random numbers and keeps track of previous random values.
Parameters:
-
X
MatrixThe matrix to be used as the unsupervised data.
Returns:
Returns the unique random value.
update_Centroids
()
Matrix
This method updates each centroid by calculating the mean of the respective clusters.
Returns:
this.centroids Are the updated centroids for the given data.


This paragraph will fade in/out with very fast speed.
This paragraph will fade in/out with default speed.
This paragraph will fade in/out with fast speed.
This paragraph will fade in/out with slow speed.
This paragraph will fade in/out with very slow speed.