6.3. Steel Frame: Bayesian Calibration¶
Problem files |
In this example, Bayesian estimation is used to estimate column stiffnesses of a simple steel frame, given data about it’s mode shapes and frequencies.
Provided by Professor Joel Conte and his doctoral students Maitreya Kurumbhati and Mukesh Ramancha from UC San Diego, this example looks at the following simplified finite element model of a steel building.
Each floor slab of the building is made of composite metal deck and is supported on four steel columns. The story heights are measured at \(10'\) and in plan the side lengths measure \(33'-4"\) by \(30'\). Properties of the steel columns are taken deterministically with an elastic modulus of \(29,000 \mathrm{ksi}\), area of \(110 \mathrm{in}^2\), and principal moment of inertial (\(I_{yy}\)) of \(1190 \mathrm{ in}^4\). For modelling purposes, the four columns are assumed fixed at the base and the beams connecting them are assumed to be rigid. The first two vibration periods of the structure are determined to be \(0.19 \mathrm{sec}\) and \(0.09 \mathrm{sec}\).
Using these properties, the following set of mode shapes and frequencies are generated by applying random perturbations to the analytic modal properties in order to simulate field data that might be obtained using a method for structural system identification.
Our goal will be to reobtain the original column moments of inertia from this data using a conventional calibration procedure.
The unknown quantities of interest are the moments of inertia for the
first and second story columns (Ic1
and Ic2
respectively), on
which we impose the the following bounds and initial estimates:
First story column moment of inertia,
Ic1
: ContinuousDesign distribution with a initial point \((X_0)\) of \(1500.0\), lower bound \((L_B)\) of \(500.0\), upper bound \((U_B)\) of \(2000.0\),Second story column moment of inertia,
Ic2
: ContinuousDesign distribution with a initial point \((X_0)\) of \(500.0\), lower bound \((L_B)\) of \(500.0\), upper bound \((U_B)\) of \(2000.0\),
The exercise requires a single OpenSees script file. The user is required to download this file and place it in a NEW folder. The file:
# units kips, in
set numMeasurements 5
set measuredLambdas {1025.21 1138.11 1099.39 1002.41 1052.69}
set sigmaLambda 54.203
set measuredPhis {1.53 1.24 1.38 1.50 1.35}
set sigmaPhi 0.0705
set PI 3.14159
#
# some paramaters
#
set m1 0.52
set m2 0.26
set L 400.0
set h 120.0
set E 29000.0
set Ac 110.0
pset Ic1 1190.0
pset Ic2 1190.0
set Ib 10e+8
set Ab 10e+8
#
# build the model
#
model BasicBuilder -ndm 2 -ndf 3
# nodes
node 1 0. 0. ;
node 2 $L 0. ;
node 3 0. $h -mass [expr $m1/4.] 0 0
node 4 $L $h -mass [expr $m1/4.0] 0 0
node 5 0. [expr 2*$h] -mass [expr $m2/4.0] 0 0
node 6 $L [expr 2*$h] -mass [expr $m2/4.0] 0 0
# constraints
fix 1 1 1 1;
fix 2 1 1 1;
equalDOF 3 4 1;
equalDOF 5 6 1
# elements
set TransfTag 1;
geomTransf Linear $TransfTag ;
element elasticBeamColumn 1 1 3 $Ac $E $Ic1 $TransfTag;
element elasticBeamColumn 2 3 5 $Ac $E $Ic2 $TransfTag;
element elasticBeamColumn 3 2 4 $Ac $E $Ic1 $TransfTag;
element elasticBeamColumn 4 4 6 $Ac $E $Ic2 $TransfTag;
element elasticBeamColumn 5 3 4 $Ab $E $Ib $TransfTag;
element elasticBeamColumn 6 5 6 $Ab $E $Ib $TransfTag;
# calculate eigenvalues
set numModes 2
set eigenValues [eigen -fullGenLapack $numModes]
set phi [expr [nodeEigenvector 5 1 1] / [nodeEigenvector 3 1 1]]
set lambda [lindex $eigenValues 0]
set error {}
for {set m 0} {$m < $numMeasurements} {incr m 1} {
lappend error [expr ([lindex $measuredLambdas $m] - $lambda) / $sigmaLambda]
}
for {set m 0} {$m < $numMeasurements} {incr m 1} {
lappend error [expr ([lindex $measuredPhis $m] - $phi) / $sigmaPhi]
}
# create results file
set outFile [open "results.out" w]
puts $outFile "$error"
close $outFile
Note
The tcl script when it runs creates a
results.out
. As a consequence, no postprocessing script is needed.
Warning
Do not place the files in your root, downloads, or desktop folder as when the application runs it will copy the contents on the directories and subdirectories containing these files multiple times. If you are like me, your root, Downloads or Documents folders contains and awful lot of files.
The steps involved:
Start the application and the UQ Selection will be highlighted. In the panel for the UQ selection, keep the UQ engine as that selected, i.e. Dakota. In the UQ Method category drop down menu change the category to Inverse Problem, the method as DREAM, and the remaining parameters as shown in the figure.
Next select the FEM tab from the input panel selection. This will default to the OpenSees FEM engine. For the main script copy the path name to the
fem.tcl
file or select choose and navigate to the file.
Note
As discussed but it is worth noting again, because the script generates a results.out
file, no postprocessing script is needed for this example. This might not always be the case for some of your problems.
Next select the RV tab from the input panel. This should be prepopulated with two random variables with same names as those having
pset
in the tcl script, i.e.Ic1
andIc2
. For each variable, from the drop down menu change them from having a constant distribution to a continuous design one and then provide the lower bounds and upper bounds shown in the figure below.
Next select the QoI panel. Here enter 10 variable names. The following figure shows the first nine names used; the tenth entry used, which does not show up in the image was
eps_p5
.
Note
For this particular problem setup in which the user is not using a postprocessing script, the user may specify any names for the QoI variables. They are only being used by Dakota to return information on the errors.
Next click on the Run button. This will cause the backend application to launch Dakota. When done the RES tab will be selected and the results will be displayed as shown in the figure below. The figure shows Dakota returned, for inputs provided, estimates of our unknown parameters,
Ic1
andIc2
are 1168.83 and 1211.25 respectively.


NOTE: This demo is for the WAC 1.0 (JIL 1.2.x) platform so be sure to switch to it if you have not already.
This widget is intended to get you familiar with the Ripple environment. Click an option below to explore various features.
What would you like to play with today?
All of this code is available here.


Personal Blog
Home
About Me
Contact
Introduction
This is my first post.
Posted by:
Chris Cuevo
2 comments
Like this story!


H. B. Woodrose & Alcohol
Had my first experience with H.B. Woodrose last night. It is a pretty intense trip, not so full on as acid, but still wicked fun (and much easier to get also!)
On an empty stomach (3 hours since I last ate) and completely sober I ate half a metoclopramide tablet, a very effective anti-nausea drug 30mins before eating the crushed up seeds. It was about 8 when I ate the crushed seeds, washed down with a bit of water. They tasted pretty good to me, just like cracked pepper. They took along time to take effect, and come on slowly as they do. I sat around watching a rugby game on T.V. with some other guys. I just wasn't interested, and the yelling and the noise of the commentary was really irritating. I wanted to do something more mellow.
Fortunately I went off to a party with a good friend who was not on woodrose and the walk there calmed me down a bit. There was a little bit of nasuea for the first hour but by the time we walking my appetite had come back. My mood picked up on the 30 minute walk and when we arrived (about 9:30) the trip came on strong, as soon as Soph opened the door. The visuals initially weren't that strong but I felt a bit strange and euphoric.  At times, it felt a bit like ecstasy, because touching my head and neck felt really good, and talking one-on-one with people is a good experience, and I could really 'see' the emotion in people.
The best parts of my trip was when I went to the bathroom, where I would stare at my own reflection and trip out, letting my mind run free and turning my features into a wolf or asian face. But I always felt that sense of control, so I knew if things were getting to out of hand I could pull myself back to reality. I spent alot of time in there I think, and only left cause I felt guilty about hogging it from needy bladders.
I didn't drink much over the night, a few beers, some punch, and wine, but only maybe 6 or 7 drinks in total which really had no effect at all, except I was very dehydrated today. Should of had some water somewhere along the way. When the vibe at the party got a bit bitchy toward me, I went for a walk down the lane on my own. It was cool and tripping can be fun on my own because I don't have to concentrate on a conversation or other people, and am free to let my mind free and think. Overall, I was in a cheery mood, and got on well with most people I met (I knew hardly no-one at this party) but I think it could be more fun to do with a few friends around to watch out for each other, and laugh at interesting patterns.
The party started winding down about 1pm. And me and my friend left with a few others to go out at about 2pm. I ordered a red bull which was good to bring me back up to tripping and sat there on a couch watching the lights above the dance floor till me and Chris left about 3pm. Quick walk home and we sat up watching TV (infomercials) till about 4:30, would of slept well, but very cold.
Today I felt good in spite of only having slept 5 hours. It was a beautiful day, and I've been on walks, played some soccer, and have been very contemplative, and I can still a feel a bit of the trip factor in my system.
MORE FACTS....
Like LSD, it is a looooonnnnggg trip. So I was very glad I took it at 8. Cause it lasted for about 7 hours. I made the mistake of taking acid at 11pm once, big mistake! But sleeping isn't as difficult on H.Woodrose, because I feel more mellow most of the time, it is a bit like being stoned when I am talking to people and playing it straight.
Experience Reports are the writings and opinions of the individual authors who submit them.
Some of the activities described are dangerous and/or illegal and none are recommended by Erowid.


We're working hard to finish the development of JohnPoon.online. Stay Tune for something awesome!
Powered by


Welcome To
User Authentication Manager...
HOME PAGE --- {{user.username}} ---
LogOut
--
Password Change
--
Profile
Thank you {{user.first_name}} {{user.last_name}}
welcome back to our site.


Math Class
Extends the JavaScript built-in object that has properties and methods for mathematical constants and functions. See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math
Index
Show:


Asuka is a Discord bot to add Slack like entry control. This bot will allow you to set a domain to which users entering your server will have to prove they possess an email matching. After which, they will be allowed to browse the server like any other user.
The bot will have to get a verification through email to show that it is actually a user that joins and not a fake user. This prevents from a lot of spamming by fake users.
A configurable web dashboard. You can easily add the bot through here. You can do the rest on your discord server.
To get started with Asuka, login with discord and select the server that you would like to setup.
Login With Discord


Fantasy Football Prediction Collection
agkna,sdnfa,ksdnfja
Grundle Me This
Auction League
Lynn Family League
PB League
Data Sources and Crawled Data
ROS Valuations
Weekly Tiers
QB
RB
WR
FLEX
Streaming Rankings
Defenses
Kickers


--- layout: post title: "No Title" ---
And it’s important to make sure that we’re celebrating the end of his own lifelong crime spree, not that we killed him in order to end it.Marco Arment explains his (and my) uneasiness with the celebration of murder.


{% extends "layout.html" %} {% block page_title %} DBS Prototype {% endblock %} {% block content %} Section 2 of 9 Included at launch? Available in web service? Have you ever identified as another gender? If you select yes, we'll use the sensitive application process so your previous name and gender won't show on the DBS certificate. Yes No Previous surname Previous forename(s) Previous gender Female Male Date from For example, 03 1980 Month Year Date to For example, 03 2014 Month Year Add another {% endblock %}
If you select yes, we'll use the sensitive application process so your previous name and gender won't show on the DBS certificate.
For example, 03 1980
For example, 03 2014


Hello Chute Team!
Please take 2 seconds to complete this completely unbiased survey.
Should we call Danielle in for an interview?


Upgrade
If you don't have the latest version of
features
There are two ways to download the latest version
The
- Go to the
- Click Download Now and follow the instructions.
From
- Select Help | Check for Updates
- Select Update Now
- Follow the on-screen instructions
Learn all about all the leatest fetures. Visit.
Additional Upgrade Information
Was this article helpful? Yes No
Thanks for your feedback!
Tell us why this article wasn't helpful?


Developed by: John O’ Sullivan
As a final year project for: BSc(Hons) Multimedia Applications Development at Waterford's Institute of Technology Panellists: Ian Downey Patrick McInerney Michael McMahon Jacqui Woods O’Brien


The Free Republic of Liberland is the newest sovereign country in the world, 3x larger than Monaco and with 100k+ future citizens.
Located on the Danube river between Serbia and Croatia, and just 20km away from Hungary
The Chamber of Commerce is the gateway to the numerous business opportunities of the Free Republic of Liberland
Association of all types of businesses around the Liberland phenomena
Represents all businesses and promotes their interest
Voluntary membership and voluntary fee
Companies of all sizes and individuals doing business anywhere in the world
Willing to do business with other Liberland-related companies
May, but don’t have to be registered in Liberland
No restrictions on industry, company size or turnover
Apply for membership in
the Chamber of Commerce
Move or expand your current business production
to free trade zone Apatin
Create your company in Liberland jurisdiction
with voluntary corporate tax


Upkar samiti is a Non government organizastion working for the welfare of Minority womens, Unemployed youth,
Traning to Handicraft Artisans and Empowering house hold womens.
organizastion is registered in year of 1996 under Registrar of socities act 1860 from Minsitry of Human resource devleopment.
Organizastion Mainly works from Handicraft department, Minsitry of Textiles, Govt of India and takes Projects like Ambedkar protsahan Yojana, Technical trainig for
Youths, Gandhi shilp Bazar, Exhibitions and many more. Organizastion also works with Minority department and works on projects like Uataad, Nai Roshinin, Minority scholarship.
We are looking for above kind of projects from MNCs, Government and International Fundings.
If you want to join our team, register now!Work with us


{% extends 'forum/base.html' %} {% block content %}
You are free to look around, but please register or sign in if you wish to start a discussion!


Even more ecosystem problems, now with working forms.
After yesterday's post I was going to dig into the UI side straight away but I got distracted by something shinny instead. I had run into several shallow guides to testing an asp.net application in my readings, and I thought it seemed like a good time to start adding tests.
Now I think this project is a perfect example of where Test Driven Development makes no sense. To write tests you first need a place to put them. You need some infrastructure to build, run, and report them. Most importantly you need something coherent to build tests against. Thus far my primary test focus has been "does all this work", and my testing has consisted of Intellisense prompts and building/running the app.
Since I am starting to have some structure emerge from the haze though I would like to have tests inform development moving forward. First though I had some cleanup to do. I had seen a pattern pop up a number of times in yesterday's readings, and thinking about testing I could really feel it's motivations. In the code I posted yesterday I had the controller code coupled directly to the Entity Framework code, which means in testing I would need to either provide a fake EF implementation, or provide EF with a fake DB to make anything work.
The pattern I used to decouple the controller from the EF-DB is called repository. It involves wrapping your data access layer in a simple collection interface.
This is another case where I really feel handcuffed by static typing. Because I need to declare what type of thing I pass to my controller I then need to pass something of the correct type in my tests. In Python you don't need all that ceremony, you just pass in an object that has the expected methods/attributes and who cares what it is. I do actually like the formal specification provided by interfaces, but really it is just a list of required members - not a type.
Anyway, here are the changes I made:
namespace JobLogger.Controllers
{
public class HomeController : Controller
{
// The references to the DbContext and UserManager are
// replaced by the new repo interface
private readonly ILogRepository _logRepository;
public HomeController(ILogRepository logRepository)
{
_logRepository = logRepository;
}
public async Task<IActionResult> Index()
{
// The current user is one dependency I couldn't unravel
// though I think the controller context can be mocked in testing
return View(await _logRepository.JobLogsAsync(HttpContext.User));
}
}
}
// In LogRepository.cs
namespace JobLogger.Models
{
public interface ILogRepository
{
Task<IEnumerable<BaseLog>> JobLogsAsync(IPrincipal user);
}
public class LogRepository : ILogRepository
{
// The LogRepository implementation now bears the burden of
// data layer coupling
private readonly UserManager<ApplicationUser> _userManager;
public LogRepository(UserManager<ApplicationUser> userManager)
{
_userManager = userManager;
}
// Here user log access just looks like requesting a list from somewhere
public async Task<IEnumerable<BaseLog>> JobLogsAsync(IPrincipal user)
{
var cuser = await _userManager.GetUserAsync((ClaimsPrincipal)user);
if (cuser != null)
{
var logs = cuser.JobLogs;
if (logs != null) return logs.ToList();
}
return new List<BaseLog>();
}
// Other methods will be added for other CRUD operations
public void Add(BaseLog log, IPrincipal user){}
}
}
// In Startup.cs
namespace JobLogger
{
public class Startup
{
...
// In the Starup.Configureservices method is were the Dependency
// Injection magic happens, just adding our "service" is enough
// to get it populated for the controller
public void ConfigureServices(IServiceCollection services)
{
...
// Add application services.
services.AddScoped<ILogRepository, LogRepository>();
...
}
...
}
}
I think it cleaned up pretty nicely. I am annoyed at how the user argument is conjured inside the Index method. Since the user is only known by the context at runtime though I couldn't really pull it out of the controller. It all looks pretty simple, but it did take some research and mental gymnastics to get into shape.
With that sorted I turned to writing tests. Or at least I would have. I spent hours reading the Internet, and tried no less than six times to get some testing configuration that would work. All the tutorials (including the MS Documentation) were wrong, none of the frameworks or templates worked, there was no configuration that would just work. Even after I restructured the whole project, rebuilt the whole thing from scratch, nothing worked.
After wasting so much time on that pointless pursuit I only had the late hours of the night to play with the UI. And oh surprise, despite the lack of test evidence, every thing did in fact work. Playing with Bootstrap is fun, and the results are reasonably attractive. It is Friday today, and I still believe I can have something usable by Monday (first day I need to record my log).
I will have to try again some time, but right now I am tired of wrestling with the MS morass.


The UCM Standard
The UCM Standard defines a consistent hardware and software interface for the most widely used microcontroller peripherals. Universal Compute Modules are based on the 200 pin SO-DIMM form factor. They adhere to a standard pinout across models making it easy to change modules to adapt to the needs of your product.
When designing a product, consider following thee UCM standard pinout. This will make your design compatible with any of the UCM modules.
Software also becomes more portable with the UCM standard. For example, our TinyCLR OS provides a library to automatically map the UCM standard names to the underlying system so that your program can use the UCM standard names only, making changing to a different module very easy.
The SO-DIMM Socket
All of our UCMs use the same 200 pin SO-DIMM socket that was originally made for DDR2 memory modules. The fastest way to get started with UCMs is by using the optional boards and displays described on the UCM Development Options page. You can also incorporate any of our UCMs into your own custom design by adding the appropriate SO-DIMM socket to your circuit board.
Tip
Make sure to expose the required pins in your design. Specific pins are needed for device programming, updates, recovery, and Wi-Fi firmware updates. See device specifications for details.
SO-DIMM stands for Small Outline Dual Inline Memory Module. There are two different 200 pin SO-DIMM sockets, those made for DDR memory and those made for DDR2 memory. They are identical except for the orientation notch which is in a slightly different position. These sockets are not interchangeable. There is also a 204 pin SO-DIMM socket for DDR3 memory with the notch positioned closer to the center of the module.
Note
Our UCMs are only compatible with DDR2 type 200 pin SO-DIMM sockets.
Here is a link to the manufacturer's web page for the connector we use on our boards: EMBOSS ASSY DDR2 SODIMM SOCKET 200P 5.2H
Peripherals
| Peripheral | Up to Max |
|---|---|
| UART (Universal Asynchronous Receiver/Transmitter) | 4 |
| UART HS (Handshaking) | 2 |
| I2C (Inter-Integrated Circuit) | 2 |
| SPI (Serial Peripheral Interface) | 2 |
| CAN (Controller Area Network) | 2 |
| SDIO (SD Card) | 1 |
| ADC (Analog to Digital Converter) | 8 |
| PWM (Pulse Width Modulation) | 8 |
| GPIO (General Purpose Input/Output) | 12 |
| IRQ (Interrupt Request Capable GPIO) | 4 |
| USB Client | 1 |
| USB Host | 1 |
| LCD (TFT Controller - 16bpp or 24bpp) | 1 |
| Ethernet PHY (Ethernet Physical Layer) | 1 |
| DCMI (Digital Camera Interface) | 1 |
| VBAT (Battery Backup for RTC) | 1 |
| JTAG (Debug Serial Port) | 1 |
*Available peripherals vary by model
Note that the system defines 12 GPIOs that are free from any other functions but most other peripheral pins also support GPIO, giving the user several more GPIO pin options -- keep in mind the standard does not guarantee this though.
Tip
The TinyCLR tutorials are a good resource on using these peripherals.
UART (Universal Asynchronous Receiver Transmitter)
UART is used to implement moderate speed full duplex asynchronous serial communication. It is usually used for peer to peer communication between only two devices. It can transfer data using only one wire for each direction if both devices share a common ground.
UART HS (Handshaking)
UART with handshaking is a configuration which allows the host and client to negotiate data transfer via Ready to Send (RTS) and Clear to Send (CTS) signals (two additional wires) to prevent missed data.
I2C (Inter-Integrated Circuit)
I2C is a multi-master, multi-slave, packet switched, half duplex serial communication bus typically used for attaching peripheral ICs to processors and microcontrollers in short-distance, intra-board communication. It uses two wires and has a slower maximum speed than SPI.
SPI (Serial Peripheral Interface)
SPI is a synchronous serial communication interface used for short distance communication. It uses a master-slave protocol. When using TinyCLR, the processor running TinyCLR is always configured as the master. SPI needs at least three wires and usually needs an additional line (chip select) for each slave. It can communicate much faster than either UART or I2C.
CAN (Controller Area Network)
A robust bus standard that originated in the automotive field and works very well in high noise environments. It allows microcontrollers and devices to communicate with each other in applications without a host computer. It is a message-based multi-master protocol and generally uses only two wires. Speed is up to one megabit per second but limited by bus length.
SDIO (SD Card)
SDIO (Secure Digital Input Output) is an interface used for reading from and writing to SD cards.
ADC (Analog to Digital Converter)
ADCs are used to measure an analog voltage level by converting it to a digital value.
PWM (Pulse Width Modulation)
PWM is a method of generating a square wave signal of uniform frequency with variable duty cycle. PWM is often used to generate analog voltages, but has many other uses such as generating digital pulses for driving servo motors or driving infrared LEDs for communication.
GPIO (General Purpose Input/Output)
GPIOs are the digital I/O pins that allow the user to interface with basic devices such as buttons (input) or LEDs (output). GPIOs are very versatile and can also be used to perform more advanced communication and control duties.
IRQ (Interrupt Request Capable GPIO)
IRQ capable GPIO pins can be programmed to interrupt a program when the input to the pin changes. For example, an IRQ could be used by a Wi-Fi module to tell the processor that the Wi-Fi module is receiving data. The processor would then stop what it is doing to get the data from the WiFi module.
USB Client
Used to communicate with a USB host. Often used to program and debug embedded devices.
USB Host
Used to communicate with one or more USB clients. Typically used to communicate with various devices such as a mouse, keyboard, camera, etc.
LCD (TFT Controller - 16bpp or 24bpp)
An interface providing communication with a TFT LCD (thin-film-transistor liquid-crystal display). The number of data lines connected determines the number of bits per pixel (bpp), which determines the number of colors that can be displayed.
Ethernet PHY
Ethernet PHY is the Ethernet physical (hardware) layer. It provides the Tx and Rx signals for the Ethernet connector.
DCMI (Digital Camera Interface)
A standard interface for compatible digital cameras.
VBAT (Battery Backup for RTC)
VBAT is used to provide battery voltage to a microcontroller's real time clock. It allows the microcontroller to keep the correct time when the main power to the controller is disconnected (the device is turned off).
JTAG
JTAG is a serial interface which allows communication between the processor and a host computer. It is built into the microcontroller and provides a means of software debugging including the ability to stop program execution, single step through program instructions, and read and write to memory and processor registers.
Pin Assignments
| SO-DIMM Pin | Universal Compute Standard |
|---|---|
| 1 | AGND |
| 2 | Ethernet TX- |
| 3 | Module Specific 1 |
| 4 | Ethernet TX+ |
| 5 | Analog VREF- |
| 6 | Ethernet RX- |
| 7 | Reserved |
| 8 | Ethernet RX+ |
| 9 | Reserved |
| 10 | Indicator A |
| 11 | Indicator B |
| 12 | Reserved |
| 13 | GND |
| 14 | DCMI D0 |
| 15 | DCMI D1 |
| 16 | DCMI D2 |
| 17 | DCMI D3 |
| 18 | DCMI D4 |
| 19 | DCMI D5 |
| 20 | Analog 3.3V |
| 21 | DCMI D6 |
| 22 | DCMI D7 |
| 23 | DCMI VSYNC |
| 24 | DCMI HSYNC |
| 25 | DCMI PIXCLK |
| 26 | DCMI XCLK |
| 27 | GND |
| 28 | PWM E |
| 29 | PWM F |
| 30 | PWM G |
| 31 | PWM H |
| 32 | Analog VREF+ |
| 33 | Reserved |
| 34 | 5V |
| 35 | Module Specific 4 |
| 36 | Module Specific 5 |
| 37 | Module Specific 6 |
| 38 | Module Specific 7 |
| 39 | Module Specific 8 |
| 40 | GND |
| 41 | GND |
| 42 | LCD 24bpp R0 |
| 43 | LCD 24bpp R1 |
| 44 | LCD 24bpp R2 |
| 45 | LCD 24bpp G0 |
| 46 | 3.3V |
| 47 | LCD 24bpp G1 |
| 48 | LCD 24bpp B0 |
| 49 | LCD 24bpp B1 |
| 50 | LCD 24bpp B2 |
| 51 | GND |
| 52 | Module Specific 9 |
| 53 | Reserved |
| 54 | Reserved |
| 55 | Reserved |
| 56 | 5V |
| 57 | IRQ A |
| 58 | IRQ B |
| 59 | IRQ C |
| 60 | 3.3V |
| 61 | IRQ D |
| 62 | GPIO A |
| 63 | GPIO B |
| 64 | GPIO C |
| 65 | GND |
| 66 | GPIO D |
| 67 | GPIO E |
| 68 | GPIO F |
| 69 | GPIO G |
| 70 | 5V |
| 71 | Reserved |
| 72 | 3.3V |
| 73 | I2C B SDA |
| 74 | I2C B SCL |
| 75 | UART C TX |
| 76 | UART C RX |
| 77 | UART D TX |
| 78 | UART D RX |
| 79 | GND |
| 80 | Reserved |
| 81 | Reserved |
| 82 | Reserved |
| 83 | Reserved |
| 84 | Reserved |
| 85 | Reserved |
| 86 | 5V |
| 87 | USB Device ID |
| 88 | 3.3V |
| 89 | UART B TX |
| 90 | UART B RX |
| 91 | ADC A |
| 92 | GPIO H |
| 93 | SPI B MISO |
| 94 | SPI B MOSI |
| 95 | GND |
| 96 | SPI B SCK |
| 97 | ADC B |
| 98 | CAN A TD |
| 99 | CAN A RD |
| 100 | CAN B TD |
| 101 | CAN B RD |
| 102 | UART HS A TX |
| 103 | UART HS A RX |
| 104 | ADC C |
| 105 | PWM A |
| 106 | 3.3V |
| 107 | SYS A |
| 108 | Module Specific 2 |
| 109 | Module Specific 3 |
| 110 | ADC D |
| 111 | SYS C |
| 112 | PWM B |
| 113 | GND |
| 114 | ADC E |
| 115 | I2C A SDA |
| 116 | I2C A SCL |
| 117 | UART A RX |
| 118 | UART A TX |
| 119 | GPIO I |
| 120 | UART HS A RTS |
| 121 | UART HS A CTS |
| 122 | GPIO J |
| 123 | SD Card D0 |
| 124 | 3.3V |
| 125 | SD Card CMD |
| 126 | SD Card CLK |
| 127 | SD Card D1 |
| 128 | SD Card D2 |
| 129 | SD Card D3 |
| 130 | PWM C |
| 131 | GND |
| 132 | GPIO K |
| 133 | PWM D |
| 134 | SYS B |
| 135 | SYS D |
| 136 | GPIO L |
| 137 | Module Specific 10 |
| 138 | UART HS B RTS |
| 139 | UART HS B CTS |
| 140 | UART HS B TX |
| 141 | UART HS B RX |
| 142 | 3.3V |
| 143 | LCD VSYNC |
| 144 | LCD HSYNC |
| 145 | LCD CLK |
| 146 | LCD DE |
| 147 | Module Specific 11 |
| 148 | SD Card CD |
| 149 | Module Specific 12 |
| 150 | Reserved |
| 151 | GND |
| 152 | LCD B3 |
| 153 | LCD B4 |
| 154 | LCD B5 |
| 155 | LCD B6 |
| 156 | LCD B7 |
| 157 | ADC F |
| 158 | ADC G |
| 159 | ADC H |
| 160 | 3.3V |
| 161 | LCD G2 |
| 162 | LCD G3 |
| 163 | LCD G4 |
| 164 | LCD G5 |
| 165 | LCD G6 |
| 166 | Module Specific 13 |
| 167 | Indicator C |
| 168 | LCD R7 |
| 169 | GND |
| 170 | LCD G7 |
| 171 | LCD R3 |
| 172 | LCD R4 |
| 173 | LCD R5 |
| 174 | LCD R6 |
| 175 | SPI A SCK |
| 176 | SPI A MISO |
| 177 | Module Specific 14 |
| 178 | SPI A MOSI |
| 179 | Module Specific 15 |
| 180 | 3.3V |
| 181 | Module Specific 16 |
| 182 | Module Specific 17 |
| 183 | VBAT |
| 184 | Module Specific 18 |
| 185 | GND |
| 186 | GND |
| 187 | RESET |
| 188 | USB Host D+ |
| 189 | JTAG RTCK |
| 190 | USB Host D- |
| 191 | JTAG TDO |
| 192 | 3.3V |
| 193 | JTAG NTRST |
| 194 | USB Device D+ |
| 195 | JTAG TDI |
| 196 | USB Device D- |
| 197 | JTAG TCK (SWCLK) |
| 198 | GND |
| 199 | JTAG TMS (SWDIO) |
| 200 | Indicator D |
Want to quickly build your prototype? Check out the UCM Development Options.
You can also visit our main website at www.ghielectronics.com and our community forums at forums.ghielectronics.com.


Browser Paint
In-browser paint app
About Me
My name is Martin, and I make clean, responsive websites. I live with my girlfriend of 5 years in Bergen, Norway. My introduction to web-development first came when my sister (and shortly after, a colleague) asked me if I could make a website for them because they "figured it would be something you'd be good at". My interest was piqued, and after a little bit of practice with HTML and CSS, I was hooked.
Although I'm still at the beginning of my web-developer journey, I take every day as a learning opportunity to become that little bit better. When I'm away from a computer and my night-time work at a local bakery, I spend my days listening to music and watching Liverpool matches. I go skiing in the winter, I go hiking in the summer, and I watch movies in between. Also, I love cats. Cats are cool (the movie, not so much).


| backendServer/__init__.py |
0 |
0 |
0 |
100% |
| backendServer/settings.py |
22 |
0 |
0 |
100% |
| backendServer/urls.py |
5 |
0 |
0 |
100% |
| backendServer/wsgi.py |
4 |
4 |
0 |
0% |
| manage.py |
9 |
2 |
0 |
78% |
| requestHandler/__init__.py |
0 |
0 |
0 |
100% |
| requestHandler/admin.py |
5 |
0 |
0 |
100% |
| requestHandler/apps.py |
3 |
3 |
0 |
0% |
| requestHandler/forms.py |
10 |
0 |
0 |
100% |
| requestHandler/migrations/0001_initial.py |
7 |
0 |
0 |
100% |
| requestHandler/migrations/0002_auto_20181028_0308.py |
4 |
0 |
0 |
100% |
| requestHandler/migrations/0003_auto_20181028_0328.py |
4 |
0 |
0 |
100% |
| requestHandler/migrations/0004_auto_20181028_0342.py |
4 |
0 |
0 |
100% |
| requestHandler/migrations/0005_auto_20181028_0417.py |
4 |
0 |
0 |
100% |
| requestHandler/migrations/0006_auto_20181029_0233.py |
5 |
0 |
0 |
100% |
| requestHandler/migrations/0007_auto_20181029_0257.py |
4 |
0 |
0 |
100% |
| requestHandler/migrations/0008_auto_20181126_0212.py |
4 |
0 |
0 |
100% |
| requestHandler/migrations/0009_systemsettings.py |
4 |
0 |
0 |
100% |
| requestHandler/migrations/0010_auto_20181214_1902.py |
4 |
0 |
0 |
100% |
| requestHandler/migrations/0011_systemsettings_defaultsong.py |
5 |
0 |
0 |
100% |
| requestHandler/migrations/0012_auto_20181214_2136.py |
5 |
0 |
0 |
100% |
| requestHandler/migrations/0013_auto_20181215_0125.py |
4 |
0 |
0 |
100% |
| requestHandler/migrations/0014_auto_20181215_1947.py |
5 |
0 |
0 |
100% |
| requestHandler/migrations/__init__.py |
0 |
0 |
0 |
100% |
| requestHandler/models.py |
35 |
3 |
0 |
91% |
| requestHandler/test_data.py |
9 |
0 |
0 |
100% |
| requestHandler/tests.py |
95 |
0 |
0 |
100% |
| requestHandler/urls.py |
3 |
0 |
0 |
100% |
| requestHandler/views.py |
81 |
18 |
0 |
78% |
| userRegistration/__init__.py |
0 |
0 |
0 |
100% |
| userRegistration/admin.py |
1 |
0 |
0 |
100% |
| userRegistration/apps.py |
3 |
3 |
0 |
0% |
| userRegistration/forms.py |
16 |
5 |
0 |
69% |
| userRegistration/migrations/__init__.py |
0 |
0 |
0 |
100% |
| userRegistration/models.py |
1 |
0 |
0 |
100% |
| userRegistration/tests.py |
20 |
0 |
0 |
100% |
| userRegistration/urls.py |
3 |
0 |
0 |
100% |
| userRegistration/views.py |
18 |
7 |
0 |
61% |


The dataset and maps used in this post are motivated by a recent article by Vivek Patil, where he showed various ways to generate and animate choropleth maps from R.
In this post, I will demonstrate a step-by-step approach to creating an animated, interactive choropleth map using rMaps and DataMaps. I will also show how the entire sequence of steps can be combined into a simple function, that would allow the same choropleth to be generated with a single line of R code!
Before we go ahead, here is what we are shooting for.
Crime Rates (per 100, 000) by State across Years
Get Data
The first step to creating any visualization is getting the data. Let us fetch time-series data on violet crime in the US, from Quandl, which is an excellent source of fascinating datasets. I would strongly recommend that you check it out, if you haven't already :).
library(Quandl)
vcData = Quandl("FBI_UCR/USCRIME_TYPE_VIOLENTCRIMERATE")
kable(head(vcData[,1:9]), format = 'html', table.attr = "class=nofluid")
| Year | Alabama | Alaska | Arizona | Arkansas | California | Colorado | Connecticut | Delaware |
|---|---|---|---|---|---|---|---|---|
| 2010-12-31 | 377.8 | 638.8 | 408.1 | 505.3 | 440.6 | 320.8 | 281.4 | 620.9 |
| 2009-12-31 | 450.1 | 633.4 | 426.5 | 515.8 | 473.3 | 338.8 | 300.9 | 645.4 |
| 2008-12-31 | 451.3 | 650.9 | 481.2 | 504.6 | 506.2 | 347.1 | 306.5 | 706.1 |
| 2007-12-31 | 447.9 | 662.3 | 514.5 | 532.6 | 522.6 | 350.6 | 301.1 | 711.5 |
| 2006-12-31 | 425.2 | 686.8 | 545.4 | 557.2 | 533.3 | 394.8 | 298.6 | 701.0 |
| 2005-12-31 | 433.0 | 632.0 | 512.0 | 528.0 | 526.0 | 397.0 | 273.0 | 633.0 |
Now that we have our data, we need to process it so that it is in the right shape for us to visualize it. In my (limited) experience, this step of getting the data in the right shape is the most challenging part of the visualization process, and can easily consume 50-60% of the overall effort.
Reshape Data
Our dataset is in the wide-form. So, our first step is to convert it into the long-form, as it is usually more convenient for visualization purposes. Additionally, we remove data for the US as a whole, as well as for DC, so that the crime rates across entities (states) are comparable.
library(reshape2)
datm <- melt(vcData, 'Year',
variable.name = 'State',
value.name = 'Crime'
)
datm <- subset(na.omit(datm),
!(State %in% c("United States", "District of Columbia"))
)
kable(head(datm), format = 'html', table.attr = "class=nofluid")
| Year | State | Crime |
|---|---|---|
| 2010-12-31 | Alabama | 377.8 |
| 2009-12-31 | Alabama | 450.1 |
| 2008-12-31 | Alabama | 451.3 |
| 2007-12-31 | Alabama | 447.9 |
| 2006-12-31 | Alabama | 425.2 |
| 2005-12-31 | Alabama | 433.0 |
Discretize Crime Rates
Crime rates are continuous numbers and so we first need to discretize them. One way to do this is to divide them into sextiles.
datm2 <- transform(datm,
State = state.abb[match(as.character(State), state.name)],
fillKey = cut(Crime, quantile(Crime, seq(0, 1, 1/5)), labels = LETTERS[1:5]),
Year = as.numeric(substr(Year, 1, 4))
)
kable(head(datm2), format = 'html', table.attr = "class=nofluid")
| Year | State | Crime | fillKey |
|---|---|---|---|
| 2010 | AL | 377.8 | C |
| 2009 | AL | 450.1 | D |
| 2008 | AL | 451.3 | D |
| 2007 | AL | 447.9 | D |
| 2006 | AL | 425.2 | D |
| 2005 | AL | 433.0 | D |
Now that we have discretized crime rates, we need to associate each sextile with a fill color chosen from a palette.
Associate Fill Colors
We use the excellent colorbrewer palettes provided by the RColorBrewer package!. The colors are mapped to the fillKey
that we created earlier. We also set a defaultFill
, which is used by datamaps
to fill entities with no fillKey
data.
fills = setNames(
c(RColorBrewer::brewer.pal(5, 'YlOrRd'), 'white'),
c(LETTERS[1:5], 'defaultFill')
)
We have one final step before we can start visualizing the data.
Create Payload for DataMaps
The data frame needs to be converted into a list of lists, as it is the default data structure that the DataMaps library accepts. Thanks to Hadley's plyr
package, this only requires a few lines of code.
library(plyr); library(rMaps)
dat2 <- dlply(na.omit(datm2), "Year", function(x){
y = toJSONArray2(x, json = F)
names(y) = lapply(y, '[[', 'State')
return(y)
})
After all the hard work (phew!), we are finally ready to start visualizing our data.
Create Simple Choropleth
Let us first create a simple choropleth map of crime rates for a given year. We use the Datamaps
reference class, which provides us with simple bindings to the DataMaps library. The code below is fairly self-explanatory.
options(rcharts.cdn = TRUE)
map <- Datamaps$new()
map$set(
dom = 'chart_1',
scope = 'usa',
fills = fills,
data = dat2[[1]],
legend = TRUE,
labels = TRUE
)
map
Having visualized the data for a specific year, the challenge now is to be able to visualize the entire time series. We have several options to do this. One option is to throw this into a Shiny application, which controls the visualization from the server side. The other option is to integrate this with an MVC framework like AngularJS so that all interactivity occurs on the client (read browser!) side. We will explore the second option.
Animated Choropleth
The next few lines of code might look very cryptic to those of you who are not familiar with javascript. But bear with me, and I will try my best to explain it in simpler terms.
Our first step here is to add the requisite javascript files to the page and designate it as an AngularJS application, to be controlled by a javascript function named rChartsCtrl
.
map2 = map$copy()
map2$set(
bodyattrs = "ng-app ng-controller='rChartsCtrl'"
)
map2$addAssets(
jshead = "http://cdnjs.cloudflare.com/ajax/libs/angular.js/1.2.1/angular.min.js"
)
We then invoke the setTemplate
method to modify the default layout in the rCharts template. There are two parts to the modified layout. The first is a div
container to hold the map and a slider to control the year. Second, is an rChartsCtrl
function that specifies how to update the map when the user interacts the the slider.
map2$setTemplate(chartDiv = "

<input id='slider' type='range' min=1960 max=2010 ng-model='year' width=200>

"
)
AngularJS makes it really easy to create two-way data bindings. Let me explain how this code works. The input
element on the page is a slider input, whose value is bound to the variable year
. rChartsCtrl
identifies this variable as $scope.year
and they are always in sync.
When the user slides the slider, the value of year
changes. rChartsCtrl
watches for changes in value of year
and when it does change, it calls the updateChoropleth
function to update the map.
map2$set(newData = dat2)
map2
Note that you can easily modify my code to display the year controls as a dropdown menu or select button group dropdown menu of the years, or display them as select button groups. You can also get very fancy and use an enhanced slider like this one here.
Dropdown
Button Groups
AutoPlay
Now suppose, we want to provide the user with a play button that would automatically animate the choropleth map. We can use a bit of AngularJS magic again and achieve this using the code below. In short, we create an animateMap
function that automatically updates the year
every 1000 milliseconds, and also updates the choropleth. I added a few more enhancements (not shown in the code) to get the nice play button and continuous legend on top.
map3 = map2$copy()
map3$setTemplate(chartDiv = "

<button ng-click='animateMap()'>Play</button>

"
)
map3
Now you might be thinking that while all this is nice, it still involves writing a lot of code, and more importantly being able to write code in javascript. My primary intention behind presenting all these steps was to show you the flexibility of rMaps, in being able to absorb custom js code. However, it is easy to wrap all of what I did into a simple ichoropleth
function that can do all of this in one line of R code.
source('ichoropleth.R')
ichoropleth(Crime ~ State,
data = datm2[,1:3],
pal = 'PuRd',
ncuts = 5,
animate = 'Year'
)


WDV321 Advanced Javascript
Dynamic Form Structure - Assignment
Use this page as the basis for your assignment. Given the drop down list provided on this page please do the following things.
- When Complaints are selected please dynamically create and display a new drop down list that includes at least four options of your choice.
- When Technical Problems are selected please dynamically create and display at least four types of problems with an associated checkbox.
- When Product Issues aer selected please dynamically create and display at least four types options as a grouped set of radio buttons.
- When a new option is selected your script should remove any of the dynamic content.


Documentation
Documentation
Coverage Report
Coverage Report
Accessibility - Restaurant-App
Accessibility Report Before
Accessibility Report After


Node.js
Created and maintained by WeTransfer
Big news: on 2018-09-25 we released a new version (V2) of our API - introducing the Transfer & Board APIs.
If you're looking for documentation for V2 you can find that here.
Welcome to WeTransfer's public API! You can use our API to create transfer links and share files and love all over the world.
First, we have to make sure you’re fully authorized to create a new transfer. You do this by sending two authentication headers with the authorize request.
Next up, we create an empty transfer object and tell it what items to expect in the next step. This is also where we retrieve the URL for the transfer itself.
Then for each file part you request an upload URL that will show you where on Amazon to put it. Repeat until you’ve uploaded all parts and move on to next file.
We make them, you use (and contribute to) them: WeTransfer made SDKs!
Created and maintained by WeTransfer
Created and maintained by WeTransfer
Created and maintained by WeTransfer
You make them, we present them: community made SDKs!
Created and maintained by Arkaitz Garro
Created and maintained by Tim Faber
Created and maintained by André Steffens
Created and maintained by Andreas Strikos
To be able to use our APIs, you must provide a secret api key on every request. You can create a key on our Developer Portal. Please make sure that you keep your API key in a secret place, and it's not shared on CVS repositories or client side code.
Our APIs expect the API key to be included as a header on every API requests. Please provide the API key using x-api-key
header, like in the following example:
We also require a Content-Type: application/json
header on every request, otherwise you will receive an "Unsupported Media Type" error.
Besides the API Key and the Content-Type header, a JSON Web Token (JWT) must be included on subsequent requests. To retrieve a JWT, send a request, including your API token to the following endpoint:
curl -X POST \
https://dev.wetransfer.com/v1/authorize \
-H "Content-Type: application/json" \
-H "x-api-key: your_api_key"
require 'we_transfer_client'
# Please keep in mind that authorization is performed when the client is initialized.
client = WeTransferClient.new(api_key: '# YOUR PRIVATE API KEY GOES HERE'))
const createWTClient = require('@wetransfer/js-sdk');
// Please keep in mind that authorization is performed when the client is initialized.
const apiClient = await createWTClient('/* YOUR PRIVATE API KEY GOES HERE */');
// When using the SDK, there is no need to call authorize manually.
// The method is available though, in case you need to access the JWT.
const auth = await apiClient.authorize();
<?php
\WeTransfer\Client::setApiKey(getenv['WT_API_KEY']);
// When using the SDK, there is no need to call authorize manually.
// The method is available though, in case you need to access the JWT.
$token = \WeTransfer\Client::authorize();
| name | type | required | description |
|---|---|---|---|
x-api-key |
String | Yes | Private API key |
Content-Type |
String | Yes | must be application/json |
{
"success": true,
"token": "A valid JWT token here"
}
| name | type | description |
|---|---|---|
success |
Boolean | Successful request, or not. |
token |
String | A JWT token valid for one year, if authorization went well |
Transfers can be created with or without items. Once the transfer has been created, items can be added at any time.
curl https://dev.wetransfer.com/v1/transfers \
-H "Content-Type: application/json" \
-H "x-api-key: your_api_key" \
-H "Authorization: Bearer jwt_token" \
-d '{"name": "My very first transfer!"}'
transfer = client.create_transfer(name: 'My very first transfer!', description: 'Something about cats, most probably.') do |builder|
builder.add_file(name: File.basename(__FILE__), io: File.open(__FILE__, 'rb'))
builder.add_file(name: 'cat-picture.jpg', io: StringIO.new('cat-picture'))
builder.add_file(name: 'README.txt', io: File.open('/path/to/local/readme.txt', 'rb'))
builder.add_file_at(path: __FILE__)
end
const transfer = await apiClient.transfer.create({
name: 'My very first transfer!',
description: 'Something about cats, most probably.'
});
<?php
$transfer = \WeTransfer\Transfer::create(
'My very first transfer!',
'Something about cats, most probably.'
);
| name | type | required | description |
|---|---|---|---|
x-api-key |
String | Yes | Private API key |
Authorization |
String | Yes | Bearer JWT authorization token |
Content-Type |
String | Yes | must be application/json |
| name | type | required | description |
|---|---|---|---|
name |
String | Yes | Something about cats or coffee, most probably |
description |
String | No | A description, if needed |
{
"id": "random-hash",
"version_identifier": null,
"state": "uploading",
"shortened_url": "https://we.tl/s-random-hash",
"name": "Little kittens",
"description": null,
"size": 0,
"total_items": 0,
"items": []
}
Creates a new empty transfer.
👉🏻 Note: the shortened_url
in the response is the URL you will use to access the transfer you create! It is not returned at the end of the upload flow, rather when you create the empty transfer. 👈🏻
Once a transfer has been created you can then add items to it.
curl https://dev.wetransfer.com/v1/transfers/{transfer_id}/items \
-H "x-api-key: your_api_key" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer jwt_token" \
-d '{"items": [{"local_identifier": "delightful-cat", "content_identifier": "file", "filename": "kittie.gif", "filesize": 1024}, {"local_identifier":"favourite-site", content_identifier: "web_content", "url":"https://developers.wetransfer.com", "meta":{"title":"My Favourite Developers Portal!"}}]}'
const fileItems = await apiClient.transfer.addFiles(transfer, [{
filename: 'kittie.gif',
filesize: 1024
}]);
const linkItems = await apiClient.transfer.addLinks(transfer, [{
url: 'https://wetransfer.com',
meta: {
title: 'WeTransfer'
},
}]);
<?php
\WeTransfer\Transfer::addLinks($transfer, [
[
'url' => 'https://en.wikipedia.org/wiki/Japan',
'meta' => [
'title' => 'Japan'
]
]
]);
\WeTransfer\Transfer::addFiles($transfer, [
[
'filename' => 'Japan-01.jpg',
'filesize' => 13370099
]
]);
| name | type | required | description |
|---|---|---|---|
x-api-key |
String | Yes | Private API key |
Authorization |
String | Yes | Bearer JWT authorization token |
Content-Type |
String | Yes | must be application/json |
| name | type | required | description |
|---|---|---|---|
items |
Array(Item) | Yes | A list of items to send to an existing transfer |
An item can be either a file or an URL.
File object
| name | type | required | description |
|---|---|---|---|
filename |
String | Yes | The name of the file you want to show on the items list. Must be less than 255 characters! |
filesize |
Integer | Yes | File size in bytes. Must be accurate. No fooling. Don't let us down. |
content_identifier |
String | Yes | Must be "file". |
local_identifier |
String | Yes | Unique identifier to identify the item locally (to your system). Must be less than 36 characters! |
URL object
| name | type | required | description |
|---|---|---|---|
url |
String | Yes | A complete URL. Must be less than 2000 characters! |
content_identifier |
String | Yes | Must be "web_content". |
local_identifier |
String | Yes | Unique identifier to identify the item locally (to your system). Must be less than 36 char`acters! |
meta |
Object | Yes | You can use this to store the metadata of the URL. For example: "meta": {"title":"The Best URL EVER!"} The complete meta string Must be less than 3000 characters! |
[{
"id": "random-hash",
"content_identifier": "file",
"local_identifier": "delightful-cat",
"meta": {
"multipart_parts": 3,
"multipart_upload_id": "some.random-id--"
},
"name": "kittie.gif",
"size": 195906,
"upload_id": "more.random-ids--",
"upload_expires_at":<PHONE_NUMBER>
},
{
"id": "random-hash",
"content_identifier": "web_content",
"meta": {
"title": "WeTransfer"
},
"url": "https://wetransfer.com"
}]
It will return an object for each item you want to add to the transfer. Each item must be split into chunks, and uploaded to a pre-signed S3 URL, provided by the following endpoint.
Important Chunks must be 6 megabytes in size, except for the very last chunk, which can be smaller. Sending too much or too little data will result in a 400 Bad Request error when you finalize the file.
To be able to upload a file, it must be split into chunks, and uploaded to different presigned URLs. This route can be used to fetch presigned upload URLS for each of a file's parts.
curl "https://dev.wetransfer.com/v1/files/{file_id}/uploads/{part_number}/{multipart_upload_id}" \
-H "Content-Type: application/json" \
-H "x-api-key: your_api_key" \
-H "Authorization: Bearer jwt_token"
| name | type | required | description |
|---|---|---|---|
x-api-key |
String | Yes | Private API key |
Authorization |
String | Yes | Bearer JWT authorization token |
Content-Type |
String | Yes | must be application/json |
| name | type | required | description |
|---|---|---|---|
file_id |
String | Yes | The public ID of the file to upload, returned when adding items. |
part_number |
Number | Yes | Which part number of the file you want to upload. It will be limited to the maximum multipart_parts response. |
multipart_upload_id |
Number | Yes | The upload ID issued by AWS S3. |
{
"upload_url": "https://presigned-s3-put-url",
"part_number": 1,
"upload_id": "an-s3-issued-multipart-upload-id",
"upload_expires_at":<PHONE_NUMBER>
}
The Response Body contains the upload_url
, part_number
, upload_id
, and upload_expires_at
.
If the requester tries to request an upload URL for a file that is not in one of the requester's transfers, we will respond with 401 UNAUTHORIZED.
If a request is made for a part, but no multipart_upload_id
is provided; we will respond with a 400 BAD REQUEST as all consecutive parts must be uploaded with the same multipart_upload_id
.
Please note: errors returned from S3 will be sent as XML, not JSON. If your response parser is expecting a JSON response it may throw an error here. Please see AWS' S3 documentation for more details about specific responses.
curl -T "./path/to/kittie.gif" "https://signed-s3-upload-url"
// Depending on your application, you will read the file using fs.readFile
// or it will be a file uploaded to your service.
const files = [[/* Buffer */], [/* Buffer */]];
await Promise.all(transferItems.map((item, index) => {
return apiClient.transfer.uploadFile(item, files[index]);
}));
<?php
foreach($transfer->getFiles() as $file) {
\WeTransfer\File::upload($file, fopen(realpath('./path/to/your/files.jpg'), 'r'));
}
After the file upload is successful, the file must be marked as complete.
curl -X https://dev.wetransfer.com/v1/files/{file_id}/uploads/complete \
-H "Content-Type: application/json" \
-H "x-api-key: your_api_key" \
-H "Authorization: Bearer jwt_token"
| name | type | required | description |
|---|---|---|---|
x-api-key |
String | Yes | Private API key |
Authorization |
String | Yes | Bearer JWT authorization token |
Content-Type |
String | Yes | must be application/json |
| name | type | required | description |
|---|---|---|---|
file_id |
String | Yes | The public ID of the file to upload, returned when adding items. |
In working with the WeTransfer API you might come across some errors. Here are some of the most common, and what you can do about them.
| Error | Message | Explanation | Solution |
|---|---|---|---|
| Missing Authentication Token | {"message":"Missing Authentication Token"} |
Despite what you might think, this actually just means that you're hitting an endpoint that doesn't exist. | Check that you've spelled the endpoint correctly, and remember that our API is versioned - dev.wetransfer.com/authorize won't work, but dev.wetransfer.com/v1/authorize will. |
| Forbidden | {"message":"Forbidden"} |
You've forgotten to send us your API key, or it's being improperly sent. | Make sure that you're sending your API key with each request - see the example code, or add a header like so: X-API-KEY: <your api key> . |
| Unsupported Media Type | {"message":"Unsupported Media Type"} |
You've sent a request to the API without a Content-Type set, or incorrectly set. |
Make sure that you're sending a Content-Type: application/json header with each request. |
| Unsupported HTTP Method | {"message":"Unsupported HTTP method"} |
You've sent a request to an endpoint using the wrong HTTP method. For example, you've sent a POST request to an endpoint that expects a GET. | Make sure that you're using the correct HTTP verb for each endpoint. |
| API Rate Limit | {"message":"Limit Exceeded Exception"} or a 429 response |
You've exceeded your rate limit. | Try again but with fewer requests in a given time period, wait until tomorrow, or even better: email us<EMAIL_ADDRESS>and we can talk extending the limit. |
| Expected X to be Y | {"message":"Expected 1200 to be 3243214"} |
If the size of the file you send does not match the size of the file you told us to expect, you'll see this message when you send a /complete request. | Check that you're properly computing the size of the file, or that you're uploading all the required chunks (before sending the complete call). |
Because file uploads go directly to S3, any errors during this step of the process will be returned in XML. Please see the official S3 documentation for details of individual AWS S3 responses.
The WeTransfer API uses the following conventional error codes:
| Code | Meaning |
|---|---|
400 |
Bad Request -- Your request is invalid. |
403 |
Forbidden -- Your API key is wrong. |
404 |
Not Found -- The specified resource could not be found. |
405 |
Method Not Allowed -- You tried to access a transfer with an invalid method. |
406 |
Not Acceptable -- You requested a format that isn't json. |
410 |
Gone -- The transfer requested has been removed from our servers. |
418 |
I'm a teapot. |
429 |
Too Many Requests -- You're requesting too many things! Slow down! |
500 |
Internal Server Error -- We had a problem with our server. Try again later. |
503 |
Service Unavailable -- We're temporarily offline for maintenance. Please try again later. |
| date | change | api / portal / documentation |
|---|---|---|
| 2018-07-25 | Clarify shortened_url, copy fixes | documentation |
| 2018-07-24 | Add PHP code snippets | documentation |
| 2018-07-18 | Clarify a couple of required params and add errors documentation | documentation |
| 2018-07-10 | Deprecate TLS 1.0 and 1.1 on developers portal | portal |
| 2018-07-06 | Add changelog to documentation | documentation |
| 2018-06-22 | Add ability for users to create multiple keys | portal |
| 2018-05-30 | Add HSTS header to API endpoints | api and portal |
| 2018-05-14 | Release initial version of API to the world | all |


The Winslow Boy
Hitchcock would never claim to be an actor's director. His emphasis was in letting the casting do the work, and was far more interested in the structure of the film, with each of the actors being used as pawns.
David Mamet once wrote that his style is built on the same premise. Never mind with emoting or getting into character, or finding the person's interior motivation. Whooey. Come up with an ingenius screenplay, an intricate puzzle, and cast actors who you trust will be believable from the get-go.
To say David Mamet's name is to conjure up some of his great works. Not only is he an accomplished playwright (_Speed-the-Plow_,_GlenGarry Glen Ross_) and screenwriter (_The Untouchables_) but he has two movies in his repertoire that would have made Hitchcock proud. _House of Games_ and last year's _The Spanish Prisoner_. If you haven't seen them yet, do so.
So it is with this anticipation that I went to see _The Winslow Boy_, his latest. It is altogether unique that it is the first film I've known in a long, long, while that is rated G, but the film is really for adults. The foul-mouthed characters of his R-rated films must be giggling somewhere.
Want a simple plot? Pre-teen Ronnie Winslow has just been expelled from military school, with accusations that he has stolen a postal order. He claims innocence. His father believes in him, and spends his estate's riches to prove so. That's _it_.
 This film has all the components of a Hitchcock film, only without Hitchcock. You have the premise of the wrongly accused, only to not follow it up with who actually did it. We don't even see the too much of the courtroom, and the triumphant climax is performed off-screen.
Instead, Mamet is far more concerned with the tensions within the family. The patriarch (played effortlessly by Nigel Hawthorne), is quirky and dignified, tough, caring, but a little reckless. So the daughter (Rebecca Pidgeon) has no dowry for her engagement. So the elder son (Matthew Pidgeon) can't go to college.
Okay, fine. But if false expectations can ruin a film, it certainly does so here. The film is passable, but I long for the bite of the earlier Mamet. This has nothing to do with the G rating. It has to do with showing scenes that I expected to see.
Back to the actors-as-pawns directing methodology. Such a style works as far as the actors themselves are well cast. Hawthorne--brilliant. Jeremy Northam--fabulous. Rebecca Pidgeon--huh?
The poor girl just plain can't act. It would have been better if her words were annunciated by a monotone voice-emulator than for her to say her lines. I gave her the benefit of the doubt in _Prisoner_, only because I just didn't know who she was. But here she is, at the beginnings of the suffrage movement, angry that she cannot marry, and she has the same, pause, utterance-of-lines-and-no-more schtick.
I can enjoy period pieces as the next guy, and I can appreciate it when the director goes out on a limb to try something new. However, _The Winslow Boy_ bored me.
Nick Scale (1 to 10): 6
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


Pat's famous secret family recipe for Salmon Cookies guarantees flavor in every bite.
Whenever we have our afternoon tea my chums and I absolutely must have Salmon Cookies. Such delicious little crumpets! They pair quite nicely with a good English tea and a dash of honey. Everything is better with a dollop of honey, actually. Nevertheless, it is quite the treat, ho ho! Do try it out.
Bro, if you want to make some mad gains you gotta supplement with Salmon Cookies. It's got them proteeeiinz that gets you gainz for dayz brah.
Our family pretended to be normal for this picture. Karen almost looks sober here. God, what happened to us? We used to get along, we used to have fun together, laugh and love. Then we had the kids and got a mortgage and car payments. Karen had to quit her job, I've been working 2 shifts - I can't remember the last time we had a real conversation, let alone had an intimate moment. Life, man, am I right? Oh. Yeah, Salmon Cookies are alright.


AirS the device: used to Intensify water using physical method and seprate the salt from the water to give us pure water , there are two main uses of this pure water in our AirS Desvice , first it can be used for drinking and second using a chemical ,physics and mechanical methods.
after we created AirS device we cretaed a system that utilizes the usage of this device
AirS the system: is a website that use API to collect historical data about selected climate conditions and using precalculated equations to Determine the best geographical location to instal and use AirS device
Carry AirS with you every where and have pure drinking water all the time at no expence using only humidity and sunligth..
Using the salt extracted from the humidty and sunligth-again- you can have a cooling device for your own convenient..
AirS system help you to decide the best geographical place to instal AirS device
AirS device functionalty can be implented for many useges , for a short list of examples: refridgrader , air conditionr , water self filling tank for farmers , self cooling mug , self Plant irrigation
Wesal madani
@Wesal_md
physics
Nimah Ahmad Alyamani
Physics suction
@n_cmew
Dhaffaf Fayez Kamfar
Computer Science
@DhaffafKamfar
https://www.linkedin.com/in/dhaffaf-kamfar
Bayan mohammed madani
Phsics suction
@of_writer
http://linkedin.com/in/aljwharah-alkhammash-62b031103
Aljwharah Alkhammash
Computer Engineering
Sumayah Abualkhair
https://www.linkedin.com/in/sumayah-abualkhair-6738769a/
web developer
lujain alharbi
linkedin.com/in/lujain-alharbi
web developer
Amal Khotani
linkedin.com/?_mSplash=1#you
Application Programmer


What is the mean interval between trains?
You can check the mean interval between trains, for all the lines, in the following link:
Train frequency


This is an interactive overview—we'll be showing you live searches on your own data in Splunk. So, you'll need to log in first.


To Do
...
Learn HTML
Learn CSS
+ Add another card
Doing
...
prepare resume
+ Add another card
Done
...
+ Add card
+ Add card


I'm A Celebrity: The real reason Adele Roberts has a photo of Loose Women's Jane McDonald
Adele's girlfriend has explained why
by Richard BellAdele Roberts' girlfriend has revealed the real reason the DJ brought a photo of Jane McDonald on I'm A Celebrity... Get Me Out Of Here! as her luxury item.
Former Big Brother contestant Adele, 40, surprised her campmates, fans and viewers by taking a framed picture of singer and Loose Women presenter Jane, 56, into the jungle.
She told the other celebs on the show she liked having Jane there for inspiration, but some of them, including DJ Roman Kemp, didn't understand the decision.
Read more: Jane McDonald responds to being Adele Roberts' luxury item on I'm A Celebrity
Now, Adele's girlfriend Kate Holderness has set the record straight once and for all.
Taking to Twitter, the actress explained exactly why Adele decided to bring a pic of Jane McDonald, telling her followers: "Hahaaaa! Right, I can clear this up! All the campmates have to have different luxury items, they're not allowed to double up on anything."
Adele first choice of luxury item, Kate said, was a family photo, but that option was already taken.
"She didn't mind because she knew there'd be campmates who'd love a pic of their children in there with them. Second choice, a pillow, was another goner as it's usually the most requested item. Pretty much everything she wanted after that was already taken too."
Kate explained that the brief from the I'm A Celeb team called for 'something to make you happy'.
She continued: "[Adele] chose something that never fails to cheer her up and something that reminds her of early morning Radio 1 listeners – it's a bit of a long running feature on Adele's show, when they're having a bit of a slump and feeling down a listener will request 'a bit of Jane' to get them through the day."
Speaking further, Kate reminded her followers that as Adele presents BBC Radio 1's early breakfast show, many of her decisions "are made at 2am" and so "make perfect sense [at] that time".
Read more: I'm A Celebrity's Kate Garraway on 'forcing herself to have sex with husband every day'
Fans of the show might have been surprised to see the photo of Jane initially, but it appears they're now full behind the decision - so much so that they're even calling for Jane to get involved.
Viewers are desperate for the singer to be the one to meet Adele on the bridge when she eventually leaves the jungle.
Leave us a comment on our Facebook page @EntertainmentDailyFix and let us know what you think of this story.


INTRO
The bpe module contains a subset of BPMN 2.0 API for controlling processes with parallel gateways, hierarchical traces and scheduler. Also BPE supports XML BPMN format out of the box. Can be used with Camunda BPMN modeler.
SERVICE
load(string()) -> #process{}
Loads the process from the database. This function should be protected against admin authorization.
start(#process{}, list(), #procMonitor{}) -> {ok,pid()} | {error,any()}.
Starts the process in the context of process monitor — a supervised process group. This function is matching against current user tasks and roles.
start(#process{}, list()) -> {ok, pid()} | {error, any()}.
Starts the process in the runtime with no process group. This function is matching against current user tasks and roles.
CONTEXT
proc(pid()) -> #process{}.
Retrieves current process state (if running) from the runtime. This function should be protected against admin authorization.
next(pid()) -> {complete, any()}.
Invokes BPMN 2.0 process shcheduler tick.
next(any(), pid()) -> {complete, any()}.
Invokes BPMN 2.0 process shcheduler tick on particular flow (if allowed).
complete(pid()) -> {complete, any()}.
Invokes BPMN 1.0 process shcheduler tick.
complete(any(), pid()) -> {complete, any()}.
Invokes BPMN 1.0 process shcheduler tick on particular flow (if allowed).
amend(pid(), any()) -> {complete, any()}.
Invokes BPMN 2.0 process shcheduler tick with additional document in the state as an argument.
discard(pid(), any()) -> {complete, any()}.
Invokes BPMN 2.0 process shcheduler tick with additional document removal from the the state.
append(pid(), any()) -> {complete, any()}.
Modifies current state of the process with additional document.
remove(pid(), any()) -> {complete, any()}.
Modifies current state of the process with document removal.
event(pid(), any()) -> {complete, any()}.
Sends the sync event to the runtime process.
hist(pid()) -> list(#hist{}).
Retrieves the process history.
ENV
task(Name::list(), #process{}) -> [tuple()] | tuple().
Retrieves the task from process definition.
doc(Record::tuple(), #process{}) -> [tuple()] | tuple().
Searches for the documents in the process environment.
tasks(#process{}) -> list().
Retrieves the tasks from process definition.
flows(#process{}) -> list().
Retrieves the flows from process definition.
docs(#process{}) -> list().
Retrieves the documents from process definition.
events(#process{}) -> list().
Retrieves the events from process definition.
This module may refer to: TASK


val target: TTarget
The target for this cases set of features.
target - The target for this cases set of features.
target


EXAM: MR Right Shoulder. MR Right Shoulder Arthrogram.
TECHNIQUE: Axial, oblique coronal, and oblique sagittal long TR images of the right shoulder were obtained. Axial, oblique coronal, and oblique sagittal long TR and coronal T1 images of the right shoulder were obtained. Axial, oblique sagittal, & oblique coronal long TR and axial & oblique coronal short TR images were obtained after the fluoroscopically guided injection of dilute intra-articular gadolinium.
Shoulder pain.
None.
There is no complete or bursal/articular sided partial rotator cuff tear. The subscapularis constituent of the rotator cuff is intact.
No bursal effusion or thickening is seen.
There is no muscular tear, contusion, or atrophy.
There are mild degenerative changes of the acromioclavicular joint. A type 2 acromion configuration is noted. There is no anterior or lateral acromial downsloping.
There are no fractures or regions of abnormal bone marrow signal intensity.
The biceps tendon is normally situated within the bicipital groove. No complete or partial biceps tendon tear is present.
There is no glenohumeral joint effusion.
No focal hyaline cartilage defects are noted. No Hill-Sachs, reverse Hill-Sachs, or bony Bankart lesions are seen.
There are no SLAP or soft tissue Bankart lesions. No paralabral cysts are seen.
No capsular or ligamentous abnormality is seen.
1.
2.
3.


This tutorial shows you how to control Seneca’s logging output. Clone the main Seneca repository from github, and open the _doc/examples_folder.
You’ll use the Sales Tax example code. This code shows you how to handle sales tax rules using Seneca. Take a look at the main README for details. For this tutorial, you’ll focus on the logging output.
Here’s some code to calculate sales tax. It won’t work, because you haven’t actually told Seneca how to do that yet.
var seneca = require('seneca')()
seneca.act({cmd: 'salestax', net: 100}, function (err, result) {
if (err) return console.error(err)
console.log(result.total)
})
This invokes a Seneca action that, hopefully, calculates sales tax. Arbitrarily you’re using the property cmd
to
indicate what you want done (calculate sales tax), and net
is net price before tax. The callback
function returns
the total price, and uses the standard Node.js signature (error object as first parameter).
Let’s try to run this code, even though it will fail. In the examples folder, this code is saved in the file sales-tax-error.js
. Run this file using Node.js, and you’ll see the following output:
$ node sales-tax-error.js
[-isodate-] INFO init start
[-isodate-] INFO init end
[-isodate-] ERROR fail seneca/act_not_found
Seneca: act(args,cb):
action not found for args = {"cmd":"salestax","net":100}
{ [Error: ...] }
Seneca outputs some logging information so you can track what’s going
on. The INIT
entries log the start and end of the initialization phase, when Seneca loads plugins.
The ERROR
entry tells you what went wrong: no action pattern matched the input args in the JSON document:
{"cmd":"salestax","net":100}
. The code also prints the JavaScript Error object to the console. That’s the line:
if( err ) return console.error(err);
You can fix this by defining an action:
seneca.add( {cmd:'salestax'}, function(args,callback){
var rate= 0.23
var total = args.net * (1+rate)
callback(null,{total:total})
})
The file sales-tax.js
in the examples folder contains the new code. Run it:
$ node sales-tax.js
[-isodate-] INFO init start
[-isodate-] INFO init end
123
Well that worked! 23% sales tax on a price of $100 gives a total of $123. Fabulous!
You might find that logging output annoying. Turn it off with:
$ node sales-tax.js --seneca.log.quiet
123
Or you might be a logging freak, in which case, here’s the all-you-can-eat version:.
node sales-tax.js --seneca.log.print
[-isodate-] INFO init start
... lots of init stuff ...
[-isodate-] INFO init end
[-isodate-] INFO add {cmd=salestax}
[-isodate-] DEBUG act in 90xkee {cmd=salestax,net=100}
[-isodate-] DEBUG act out 90xkee {total=123}
123
So you might be wondering how to get finer-grained logging output. Logging can be filtered on:
level
: DEBUG
, INFO
, WARN
, ERROR
, FATAL
type
: short string code, examples: init
, plugin
, error
, …plugin
: the names of the plugintag
: an identifier tag, used when you have multiple instances of the same pluginLet do that now:
node sales-tax.js --seneca.log=type:act
[-isodate-] DEBUG act in actid0 {cmd=salestax,net=100}
[-isodate-] DEBUG act out actid0 {total=123}
123
The command line argument --seneca.log
accepts a
comma-separated list of filters. The filter type:act
means only
output the log entries of type act
. The type
is the third
field. The act
entries are very low level debugging logs
showing the operation of individual actions. The logs show the input
arguments, in
, and the eventual output of the
action out
. Because these can be separated in time, a random
action identifier (above: actid0
) is generated for each action, so that you
can match up the input and output.
Let’s turn the sales tax calculator into a plugin. This plugin accepts two configuration options. You can specify the tax rate, and the country which applies that rate (using two letter country codes).
Here’s the client code, in the file sales-tax-log.js
:
var seneca = require('seneca')()
seneca.use('sales-tax-plugin', {country: 'IE', rate: 0.23})
seneca.use('sales-tax-plugin', {country: 'UK', rate: 0.20})
seneca.ready(function (err) {
if (err) return process.exit(!console.error(err))
seneca.act({role: 'shop', cmd: 'salestax', country: 'IE', net: 100})
seneca.act({role: 'shop', cmd: 'salestax', country: 'UK', net: 200})
seneca.act({role: 'shop', cmd: 'salestax', country: 'UK', net: 300})
})
Since you’re using log files to trace the commands, you can drop the
callback function from the act
method call.
Now you need a plugin - that’s in the sales-tax-plugin.js
file:
module.exports = function (options) {
var seneca = this
var plugin = 'shop'
var country = options.country || 'IE'
var rate = options.rate || 0.23
var calc = function (net) {
return net * (1 + rate)
}
seneca.add({ role: plugin, cmd: 'salestax', country: country }, function (args, callback) {
var total = calc(parseFloat(args.net, 10))
seneca.log.debug('apply-tax', args.net, total, rate, country)
callback(null, { total: total })
})
seneca.add({ role: plugin, cmd: 'salestax' }, function (args, callback) {
var total = calc(parseFloat(args.net, 10))
seneca.log.debug('apply-tax', args.net, total, rate, country)
callback(null, { total: total })
})
seneca.act({ role: 'web', use: {
prefix: 'shop/',
pin: { role: 'shop', cmd: '*' },
map: {
salestax: { GET: true }
}
}})
return {
name: plugin
}
}
The plugin creates a separate instance of the salestax
object
for each country and one instance that matches a call with no country. This object stores the country rate, country code,
and the number of times that sales tax for that country is calculated
(hit count).
This plugin follows the standard format for Seneca plugins. You provide a function that takes
a set of options and it’s called in the Seneca context (eg the this
object). Using the Seneca instance, you add some actions, and
return a plugin object:
module.exports = function (options) {
var seneca = this
seneca.add( { ... }, function (args, callback) {
...
})
return {
name: 'plugin-name'
}
}
Run this code, and filter the log to show only debug output from the sales-tax plugin:
$ node sales-tax-log.js --seneca.log=plugin:shop
[-isodate-] DEBUG plugin sales-tax IE annv4h
net: 100 total: 123 tax: {hits=1,rate=0.23,country=IE}
[-isodate-] DEBUG plugin sales-tax UK 3rkaa2
net: 200 total: 240 tax: {hits=1,rate=0.2,country=UK}
[-isodate-] DEBUG plugin sales-tax UK cwxcts
net: 300 total: 360 tax: {hits=2,rate=0.2,country=UK}
These logs appear because the plugin calls seneca.log.debug
and provides the information about the sales tax calculation:
seneca.add({ role: plugin, cmd: 'salestax', country: country }, function (args, callback) {
var total = calc(parseFloat(args.net, 10))
seneca.log.debug('apply-tax', args.net, total, rate, country)
callback(null, { total: total })
})
The object seneca.log
has convenience functions for the built-in log levels:
These functions concatenate all their arguments into an array, which is the content of the log message. This array is then formatted for display or storage by a handler function (which you can provide). To minimize impact on performance, log data is only evaluated if a matching log filter is active. The last argument to the logging function can be a function (which should return an array of values), which again is only executed if a logging filter matches.
Here’s another example. This time, you filter on the act
log
entry type. This allows you to see the data passing into and out of
actions:
$ node sales-tax-log.js --seneca.log=type:act
[-isodate-] DEBUG act in uk74hd {cmd=salestax,country=IE,net=100}
[-isodate-] DEBUG act out uk74hd {total=123}
[-isodate-] DEBUG act in qv5sts {cmd=salestax,country=UK,net=200}
[-isodate-] DEBUG act out qv5sts {total=240}
[-isodate-] DEBUG act in 7j9q4a {cmd=salestax,country=UK,net=300}
[-isodate-] DEBUG act out 7j9q4a {total=360}
You can see two entries for each action, in
and out
. Each entry shows the JSON document data being passed
into Seneca, and out of, Seneca. You can also see that each pair has the same action identifier, such as uk74hd
.
Let’s put this all together.  The
action identifiers, which you can get using args.actid$
inside
an action function.You need to specify two --seneca.log
filters, as the type is plugin
for one, and act
for the
other.
The tag
filter can be used to focus on a specific, tagged, plugin instance. Here’s how you look at UK sales tax
operations only:
$ node sales-tax-log.js --seneca.log=plugin:sales-tax,tag:UK
[-isodate-] DEBUG plugin sales-tax UK i2r7wn
net: 200 total: 240 tax: {hits=1,rate=0.2,country=UK}
[-isodate-] DEBUG plugin sales-tax UK 8ir490
net: 300 total: 360 tax: {hits=2,rate=0.2,country=UK}
Console logs are fun, but live logs in your web browser are awesome! Seneca can do this too:
You’ll need to create an app that provides a sales-tax calculation HTTP JSON API. Using the
web
plugin this is easy. This plugin accepts JSON documents from remote clients
over HTTP and submits them to the local Seneca instance.
Here the code, in sales-tax-app.js
, that sets up the app:
var connect = require('connect')
var connect_query = require('connect-query')
var body_parser = require('body-parser')
var seneca = require('seneca')()
seneca.use('sales-tax-plugin', {country: 'IE', rate: 0.23})
seneca.use('sales-tax-plugin', {country: 'UK', rate: 0.20})
seneca.use('sales-tax-plugin', {country: '*', rate: 0.25})
var app = connect()
app.use(connect_query())
app.use(body_parser.json())
app.use(seneca.export('web'))
app.listen(3000)
seneca.use('data-editor')
seneca.use('admin', {server: app, local: true})
The script sets up a simple HTTP server, using the Node.js connect
module. The web
plugin is preloaded by Seneca and
works locally without any configuration, so all you have to do is hook it as a connect or express middleware, or directly with the standard HTTP API:
var app = connect()
app.use(seneca.export('web'))
app.listen(3000)
The admin
and data-editor
plugins together provide a web administration interface for
Seneca. It uses web sockets, so you need to provide a reference to the
http server object in the plugin options. To expose the
administration web interface locally without requiring a password,
use the local:true
option:
seneca.use('data-editor')
seneca.use('admin', {server: app, local: true})
Run this app, and open localhost:3000/admin. You can still use command line logging - you can have multiple separate logging channels.
$ node sales-tax-app.js --seneca.log=plugin:shop
The administration interface let’s you set filtering options. They work the same way as the command line options. There’s nothing to log yet, so let’s generate some sales tax calculations!
The file sales-tax-app-client.js
contains the client
code. We’re using the standard Node HTTP client here:
var http = require('http')
http.get({
hostname: 'localhost',
port: 3000,
path: '/shop/salestax?net=100&country=UK'
}, function (res) {
res.on('data', function (chunk) {
console.log(JSON.parse(chunk.toString()))
})
})
But you can also test it with cUrl:
$ curl -S 'http://localhost:3000/shop/salestax?net=100&country=UK'
$ {"total":120}
The sales tax operations code is as before. This is the key idea behind Seneca - your business logic code stays the same, but you can move around and reconfigure where it happens without worrying about refactoring your code.
With the app up and running, run the client: you’ll see log entries in the web interface.
You can define your own log handlers programmatically when you setup Seneca. The file
sales-tax-log-handler.js
shows you how to do this:
var seneca = require('seneca')
// need this to get a reference to seneca.loghandler
seneca = seneca({
log: {
map: [
{plugin: 'shop', handler: 'print'},
{level: 'all', handler: seneca.loghandler.file('shop.log')}
]
}
})
seneca.use('sales-tax-plugin', {rate: 0.23})
seneca.ready(function (err) {
if (err) return process.exit(!console.error(err))
seneca.act({role: 'shop', cmd: 'salestax', net: 100})
seneca.act({role: 'shop', cmd: 'salestax', net: 200})
seneca.act({role: 'shop', cmd: 'salestax', net: 300})
})
Running this script will output log entries both to the console (only where plugin is “shop” ), and
to a log file shop.log
, which gets everything. In production you mostly just want to output to the console and use
the operating system tools for file redirection. The file handler is mostly for creating special log files.
The logging map allows you to send log entries to multiple locations based on the filters you specify. You can still use the
command line argument --seneca.log=...
to add further filters.
The built-in handlers are:
seneca.loghandler.print
: logs to the consoleseneca.loghandler.file(filepath)
: logs to a fileseneca.loghandler.stream(WriteStream)
: logs to a streamseneca.loghandler.emitter(EventEmitter)
: logs using eventsYou can write your own handler. It’s just a function that takes the log entry as first argument. The log entry is an array of values.
Here’s an example using the LogEntries.com service. This is cloud logging service that
stores your logs and makes them searchable. I wrote their Node.js API module :) - $ npm install node-logentries
.
This example is in the file sales-tax-logentries.js
:
var logentries = require('node-logentries')
var log = logentries.logger({
token: 'YOUR_TOKEN',
// redefine log levels to match the ones seneca uses
levels: {debug: 0, info: 1, warn: 2, error: 3, fatal: 4}
})
var seneca = require('seneca')({
log: {
map: [
{level: 'all', handler: function () {
log.log(arguments[1], Array.prototype.join.call(arguments, '\t'))
}}
]
}
})
seneca.use('sales-tax-plugin', {rate: 0.23})
seneca.ready(function (err) {
if (err) return process.exit(!console.error(err))
seneca.act({role: 'shop', cmd: 'salestax', net: 100})
seneca.act({role: 'shop', cmd: 'salestax', net: 200})
seneca.act({role: 'shop', cmd: 'salestax', net: 300})
})
You’ll need to register a LogEntries.com account and get a token for this to work.
You can use custom handler functions to send logs anywhere you want, and process them anyway you need.
Log filters are dynamic. You can add new ones at runtime using the seneca.logroute
method:
seneca.logroute( {level:'all', handler:seneca.handler.print} )
If you omit the handler, any previous filter is removed. If you add multiple handlers for the same filter, the logs will be sent to all the handlers.This feature enables the administration web site to dynamically modify the filters at runtime.
That’s all folks!
Issues? From spelling errors to broken tutorials and everything in between, report them here.


Class: Aws::SSM::Types::PutParameterRequest
| Relationships & Source Files | |
| Super Chains via Extension / Inclusion / Inheritance | |
|
Class Chain:
self,
Struct
|
|
|
Instance Chain:
self,
::Aws::Structure ,
Struct
|
|
| Inherits: |
Struct
|
| Defined in: | gems/aws-sdk-ssm/lib/aws-sdk-ssm/types.rb |
Overview
Constant Summary
Instance Attribute Summary
-
#allowed_pattern ⇒ String
rw
A regular expression used to validate the parameter value.
-
#data_type ⇒ String
rw
The data type for a
String
parameter. -
#description ⇒ String
rw
Information about the parameter that you want to add to the system.
-
#key_id ⇒ String
rw
The Key Management Service (KMS) ID that you want to use to encrypt a parameter.
-
#name ⇒ String
rw
The fully qualified name of the parameter that you want to add to the system.
-
#overwrite ⇒ Boolean
rw
Overwrite an existing parameter.
-
#policies ⇒ String
rw
One or more policies to apply to a parameter.
-
#tags ⇒ Array<Types::Tag>
rw
Optional metadata that you assign to a resource.
-
#tier ⇒ String
rw
The parameter tier to assign to a parameter.
-
#type ⇒ String
rw
The type of parameter that you want to add to the system.
-
#value ⇒ String
rw
The parameter value that you want to add to the system.
Instance Method Summary
::Aws::Structure
- Included
| #to_hash | Alias for Aws::Structure#to_h. |
Instance Attribute Details
#allowed_pattern ⇒ String
(rw)
A regular expression used to validate the parameter value. For example, for String types with values restricted to numbers, you can specify the following: AllowedPattern=^\d+$
#data_type ⇒ String
(rw)
The data type for a String
parameter. Supported data types include
plain text and Amazon Machine Image (AMI) IDs.
The following data type values are supported.
text
aws:ec2:image
aws:ssm:integration
When you create a String
parameter and specify aws:ec2:image
,
Amazon Web Services Systems Manager validates the parameter value is
in the required format, such as ami-12345abcdeEXAMPLE
, and that
the specified AMI is available in your Amazon Web Services account.
PutParameter
call for all
cases except for data type aws:ec2:image
. If you call
PutParameter
with aws:ec2:image
data type, a successful HTTP 200
response does not guarantee that your parameter was successfully
created or updated. The aws:ec2:image
value is validated
asynchronously, and the PutParameter
call returns before the
validation is complete. If you submit an invalid AMI value, the
PutParameter operation will return success, but the asynchronous
validation will fail and the parameter will not be created or
updated. To monitor whether your aws:ec2:image
parameters are
created successfully, see Setting up notifications or trigger
actions based on Parameter
Store events. For more information
about AMI format validation , see Native parameter support for
Amazon Machine Image (AMI) IDs.
#description ⇒ String
(rw)
Information about the parameter that you want to add to the system. Optional but recommended.
Don't enter personally identifiable information in this field.
#key_id ⇒ String
(rw)
The Key Management Service (KMS) ID that you want to use to encrypt
a parameter. Use a custom key for better security. Required for
parameters that use the SecureString
data type.
If you don't specify a key ID, the system uses the default key associated with your Amazon Web Services account which is not as secure as using a custom key.
- To use a custom
::Aws::KMS
key, choose theSecureString
data type with theKey ID
parameter.
^
#name ⇒ String
(rw)
The fully qualified name of the parameter that you want to add to
the system. The fully qualified name includes the complete hierarchy
of the parameter path and name. For parameters in a hierarchy, you
must include a leading forward slash character (/) when you create
or reference a parameter. For example:
/Dev/DBServer/MySQL/db-string13
Naming Constraints:
Parameter
names are case sensitive.A parameter name must be unique within an Amazon Web Services Region
A parameter name can't be prefixed with "
aws
" or "ssm
" (case-insensitive).Parameter
names can include only the following symbols and letters:a-zA-Z0-9_.-
In addition, the slash character ( / ) is used to delineate
hierarchies in parameter names. For example:
/Dev/Production/East/Project-ABC/MyParameter
A parameter name can't include spaces.
Parameter
hierarchies are limited to a maximum depth of fifteen levels.
For additional information about valid values for parameter names, see Creating Systems Manager parameters in the Amazon Web Services Systems Manager User Guide.
::Aws::ARN
that
precede the name you specify, such as
arn:aws:ssm:us-east-2:111122223333:parameter/
.
#overwrite ⇒ Boolean
(rw)
Overwrite an existing parameter. The default value is false
.
#policies ⇒ String
(rw)
One or more policies to apply to a parameter. This operation takes a
JSON array. Parameter
Store, a capability of Amazon Web Services
Systems Manager supports the following policy types:
Expiration: This policy deletes the parameter after it expires. When
you create the policy, you specify the expiration date. You can
update the expiration date and time by updating the policy. Updating
the parameter doesn't affect the expiration date and time. When
the expiration time is reached, Parameter
Store deletes the
parameter.
ExpirationNotification: This policy initiates an event in Amazon
::Aws::CloudWatch
Events that notifies you about the expiration. By using
this policy, you can receive notification before or after the
expiration time is reached, in units of days or hours.
NoChangeNotification: This policy initiates a ::Aws::CloudWatch
Events
event if a parameter hasn't been modified for a specified period of
time. This policy type is useful when, for example, a secret needs
to be changed within a period of time, but it hasn't been changed.
All existing policies are preserved until you send new policies or an empty policy. For more information about parameter policies, see Assigning parameter policies.
#tags ⇒ Array
<Types::Tag> (rw)
Optional metadata that you assign to a resource. Tags enable you to categorize a resource in different ways, such as by purpose, owner, or environment. For example, you might want to tag a Systems Manager parameter to identify the type of resource to which it applies, the environment, or the type of configuration data referenced by the parameter. In this case, you could specify the following key-value pairs:
Key=Resource,Value=S3bucket
Key=OS,Value=Windows
Key=ParameterType,Value=LicenseKey
#tier ⇒ String
(rw)
The parameter tier to assign to a parameter.
Parameter
Store offers a standard tier and an advanced tier for
parameters. Standard parameters have a content size limit of 4 KB
and can't be configured to use parameter policies. You can create a
maximum of 10,000 standard parameters for each Region in an Amazon
Web Services account. Standard parameters are offered at no
additional cost.
Advanced parameters have a content size limit of 8 KB and can be configured to use parameter policies. You can create a maximum of 100,000 advanced parameters for each Region in an Amazon Web Services account. Advanced parameters incur a charge. For more information, see Standard and advanced parameter tiers in the Amazon Web Services Systems Manager User Guide.
You can change a standard parameter to an advanced parameter any time. But you can't revert an advanced parameter to a standard parameter. Reverting an advanced parameter to a standard parameter would result in data loss because the system would truncate the size of the parameter from 8 KB to 4 KB. Reverting would also remove any policies attached to the parameter. Lastly, advanced parameters use a different form of encryption than standard parameters.
If you no longer need an advanced parameter, or if you no longer want to incur charges for an advanced parameter, you must delete it and recreate it as a new standard parameter.
Using the Default Tier Configuration
In PutParameter
requests, you can specify the tier to create the
parameter in. Whenever you specify a tier in the request, Parameter
Store creates or updates the parameter according to that request.
However, if you don't specify a tier in a request, Parameter
Store
assigns the tier based on the current Parameter
Store default tier
configuration.
The default tier when you begin using Parameter
Store is the
standard-parameter tier. If you use the advanced-parameter tier, you
can specify one of the following as the default:
Advanced: With this option,
Parameter
Store evaluates all requests as advanced parameters.Intelligent-Tiering: With this option,
Parameter
Store evaluates each request to determine if the parameter is standard or advanced.
If the request doesn't include any options that require an advanced parameter, the parameter is created in the standard-parameter tier. If one or more options requiring an advanced parameter are included in the request, Parameter Store create a parameter in the advanced-parameter tier.
This approach helps control your parameter-related costs by always creating standard parameters unless an advanced parameter is necessary.
Options that require an advanced parameter include the following:
The content size of the parameter is more than 4 KB.
The parameter uses a parameter policy.

For more information about configuring the default tier option, see Specifying a default parameter tier in the Amazon Web Services Systems Manager User Guide.
#type ⇒ String
(rw)
The type of parameter that you want to add to the system.
SecureString
isn't currently supported for ::Aws::CloudFormation
templates.
Items in a StringList
must be separated by a comma (,). You can't
use other punctuation or special character to escape items in the
list. If you have a parameter value that requires a comma, then use
the String
data type.
Specifying a parameter type isn't required when updating a parameter. You must specify a parameter type when creating a parameter.
#value ⇒ String
(rw)
The parameter value that you want to add to the system. Standard parameters have a value limit of 4 KB. Advanced parameters have a value limit of 8 KB.
\{\{\}\}
or
\{\{ssm:parameter-name\}\}
in a parameter value.