I recently created a Bolt CMS extension that adds in HTML5 videos so I could use those in a Gif like animation, or regular videos. While doing this I wanted to use some "stockish" video files and some screen recordings.
I went about converting MP4 videos to Webm. I crashed Firefox for Android's browser on my Nexus Devices (Nexus 5 and 5X). That's no bueno. So I figured out it was the Webm profile that came from my screen recording software. It gave me a webm with a YUV444p profile.
Converting an MP4 to webm is a fairly straightforward process for video services like Cloudinary or gyfcat. Doing it yourself can be a different can o worms. FFmpeg's wiki and the webm project differ in their instructions on how to convert a video. After converting a few videos I wanted a centralized place with a conversion workflow that I knew worked. So here is pretty good process for converting a MP4 to a Webm with VP9, removing audio from files for webm or mp4 for gif like animations and trimming a videos length with FFmpeg.
Tools To Use / Install
There are two (2) tools we can use to optmize our videos. FFmpeg as mentioned above and Handbrake.
Handbrake will be used for our MP4 files since its extremely easy to use. You could also use FFmpeg for the MP4 files to reduce the work load between tools.
For these Examples I'm using a video from Archive.org . Here are the details/properties of this unoptimized MP4 video.
- 1920x1080 (1080p)
- 1 Minute 25 Seconds in duration
- 460 megabytes
With Handbrake I've optimized the MP4 with these settings
- Web Optimized box checked
- Profile: Normal
- Quality: Constant @ 22
- Variable Frame rate
This produces a 45 megabyte MP4
Handbrake Settings
To go over optimizing a video with Handbrake is outside the scope of this post. Luckily Matt Gadient has a post on getting the "best" settings for video optimization with handbrake. It's from 2013 but gives you a very good run down.
- Best Settings Guide For Handbrake By Matt Gadient
- He also has a page comparing x264, x265, VP8, and VP9. Matt Gadient x264, x265, VP8 and VP9 examples
FFmpeg Installation
Here we'll go through on how to nstall FFmpeg on various OS'
FFmpeg on Linux
I'll be using Ubuntu for these Linux examples. FFmpeg on Ubuntu is a confusing hot mess. If you are on an Ubuntu distro >= 15.04 you can install "FFmpeg" like:
apt-get install ffmpeg
If you're on Ubuntu 14.04 - which many are since it's an LTS release, you'll have to do some hoop jumping.
-
Download a Static build: Linux Builds
- Doesn't Support Non Free Codecs
- Compile it: Compile FFmpeg Ubuntu
- Use a PPA: 14.04 LTS MultiMedia PPA: Doug McMahon
FFmpeg on a Mac
I'll preface this with - I don't use a Mac so use this at your own discretion. The easiest way to install FFmpeg on a Mac is through Homebrew and should more than likely be the one you choose to use.
$ brew install ffmpeg
For a full guide see FFmpeg's FFmpeg through Homebrew Guide.
The second way to install FFmpeg is to use a static build . Download the appropriate one for your system, extract the archive
Additionally you can compile it yourself from source: Compile FFmpeg - OSX
FFmpeg on Windows
FFmpeg on Windows can be downloaded two ways. The "simple" way is to just download it and extract the archive.
- Visit FFmpeg Downloads and download the appropriate one for your system.
- Extract it to your computer. Example - Extract to C:\ffmpeg
- If the path isn't automatically added to your path add the bin directory to your Environment Variable Path. Example: C:\ffmpeg\bin
With Ubuntu On Windows for Windows 10 you can also add the PPA mentioned above in the Ubuntu section. This too has all the hoop jumping as Ubuntu.
# add this PPA to your system
sudo add-apt-repository ppa:mc3man/trusty-media
sudo apt-get update
# now install ffmpeg
sudo apt-get install ffmpeg
Now if Ubuntu gets updated to 16.04 on Windows 10 before you update the distro you should purge this PPA to allow for a smooth upgrade.
# Remove this PPA to your system
sudo ppa-purge ppa:mc3man/trusty-media
Note: If you're on Windows and not using a shell replacement (babun, conemu, cygwin etc) you'll need to make a few changes to these commands that will be below.
-
Any Instance of
\
( a back slash ) will need to be replaced with^
( a caret ) -
Replace /dev/null with NUL
- If you're using Bash On Ubuntu On Windows you can keep /dev/null
Converting MP4 To Webm with FFmpeg
Open a terminal / command prompt in the directory of your videos. From here we'll run our commands to convert the video. Webm will benefit from two (2) pass encoding. The first pass gathers data and statistics from the video, and the second will actually encode the video to a file with the data from the null file created in the first pass.
Audio included in a Webm file can be two formats, Vorbis or Opus. Since Microsoft Edge as of Edge 14 supports Webm with Opus audio (currently only in Media Source Extensions) you should use the Opus audio codec. FFmpeg's site's examples use the Vorbis codec so if you want wide Webm support use Opus.
Finding the right settings for good quality and small filesize is almost like fiddling with knobs on a radio. You just keep turning and tweaking until you get a good combination.
If you already know what conversion method you want to use and you're going to be using videos in a giflike animation you can skip down to the giflike animations section below to convert, scale and trim your videos all at once.
Best Quality
This is the "Best quality" FFmpeg commands as recommended by the Webm project. This can be very, and I repeat, VERY SLOW depending on your computer and the length of the video. This will give you the best quality but the file size might be even a little larger than your MP4. Only way you'll really know is if you do it so prepare to set aside some time if you wanna do this one :).
ffmpeg -i your-file.mp4 -c:v libvpx-vp9 -pass 1 -b:v 1000K -threads 1 -speed 4 \
-tile-columns 0 -frame-parallel 0 \
-g 9999 -aq-mode 0 -an -f webm /dev/null
# Once that finishes then run
ffmpeg -i your-file.mp4 -c:v libvpx-vp9 -pass 2 -b:v 1000K -threads 1 -speed 0 \
-tile-columns 0 -frame-parallel 0 -auto-alt-ref 1 -lag-in-frames 25 \
-g 9999 -aq-mode 0 -c:a libopus -b:a 64k -f webm your-file.webm
This gives us an ≈10.2 megabyte file.
Constant Quality
This is the "Constant Quality" settings. Here is where we can adjust the "constant rate factor". For VP9 videos this is a number from 0 to 63. The lower the value the better the quality. In the examples we have 33 for the constant rate factor. Adjust this to get bigger or smaller file size and adjust the quality.
# the "threads" flag recommendation is number of real cores - 1
ffmpeg -i our-file.mp4 -c:v libvpx-vp9 -pass 1 -b:v 0 -crf 33 -threads 8 -speed 4 \
-tile-columns 6 -frame-parallel 1 \
-an -f webm /dev/null
# once that finishes run
ffmpeg -i our-file.mp4 -c:v libvpx-vp9 -pass 2 -b:v 0 -crf 33 -threads 8 -speed 2 \
-tile-columns 6 -frame-parallel 1 -auto-alt-ref 1 -lag-in-frames 25 \
-c:a libopus -b:a 64k -f webm our-file.webm
If you're on an older machine or if this crashes you can run a single pass encode as shown below or remove the '-threads' option from the two pass encode.
ffmpeg -i our-file.mp4 -c:v libvpx-vp9 -crf 33 -b:v 0 -c:a libopus our-file..webm
The constant quality run gives us a webm that is ~19 megabytes. If you adjust the constant rate factor (crf) to 43 we are left with a ≈9 megabyte file with little to almost no difference in quality. You can see those two examples below
Constrained Quality
Constrained quality is useful for bulk encoding of videos where you want all videos to have a consistent quality or look. We can increase quality or decrease quality by adjusting the crf parameters along with the bitrate (-b:v parameter).
FFmpegs wiki suggests using of 1000k and a crf of 10. While The webm project suggests 1400k for the bitrate and 23 for the constant rate factor. You can drastically shrink your file by adjusting those down.
# the "threads" flag recommendation is number of real cores - 1
ffmpeg -i our-file.mp4 -c:v libvpx-vp9 -pass 1 -b:v 1400K -crf 23 -threads 8 -speed 4 \
-tile-columns 6 -frame-parallel 1 \
-an -f webm /dev/null
# once that finishes run
ffmpeg -i our-file.mp4 -c:v libvpx-vp9 -pass 2 -b:v 1400K -crf 23 -threads 8 -speed 2 \
-tile-columns 6 -frame-parallel 1 -auto-alt-ref 1 -lag-in-frames 25 \
-c:a libopus -b:a 64k -f webm our-file.webm
For my reference video I ran one with a bit rate of 1400k and a constant rate factor of 23 and this gave me a 15 megabyte file. Adjusting the bit rate to 800k produced a 9 megabyte file with little difference in perceptible quality.
Webm File Sizes After Conversion
Ok, you read all that but you just wanna know the file size difference. Here you go!
| Conversion Type | Size in MB | Link To Video |
|---|---|---|
| Unoptimized MP4 | ≈461MB | Unoptimized Video (it's BIG) |
| Handbrake Optmized MP4 | ≈44.7MB | Optimized With Handbrake |
| Best | ≈10.2MB | MP4 to Webm Best |
| Constant w/43 crf | ≈8.9MB | MP4 to Webm Constant |
| Constrained 800k bit rate | ≈8.4MB | MP4 to Webm Constrained |
Using Webm and MP4 as 'Gifs'. hard G :)
Our giflike videos won't need to be the full resolution (in this instance 1920x1800). This is a waste and if we scaled the video down we can achieve some pretty small file sizes. Most videos are longer than the animation you'll want so you would only want a portion of the video to be used for the animation. So I'll go over scaling the video to a smaller size and trimming the video length and removing the audio track if it's present since it wont be needed for animations.
Convert MP4 to Webm, Remove Audio & Trim Length
Once you've decided on which method to convert your video to webm you can add the video filter to your command to scale it, remove audio and trim the length. I've chosen the 'constant quality' method with a constant rate factor of 43 for this example.
Here is what has changed from the above 'constant quality' conversion methods to scale, trim and remove audio.
- add in the
-vf
flag for video filter with the scale option - disable audio recording with the
-an
flag - add in the start time I want to trim the video to with
-ss
flag and how much to capture after the start time with the-t
flag.
You can find all the options you can use for scaling at ffmpeg's scaling wiki and the options for trimming the video at ffmpeg's seeking wiki entry .
# remove the '-threads' option if this crashes on you
ffmpeg -i our-file.mp4 -c:v libvpx-vp9 -pass 1 -b:v 0 -crf 43 -threads 8 -speed 4 \
-tile-columns 6 -frame-parallel 1 \
-an -f webm /dev/null
# once that finishes. trim the input video, scale it, and remove the audio
ffmpeg -ss 43 -i our-video.mp4 -t 5 -vf scale=800:-1 -c:v libvpx-vp9 -pass 2 -b:v 0 -crf 43 -speed 2 \
-tile-columns 6 -frame-parallel 1 -auto-alt-ref 1 -lag-in-frames 16 \
-an -f webm our-video-scaled.webm
Scaling, Removing Audio and Trimming already converted videos
To resize videos already in your prefered format(s)
ffmpeg -i input.webm -vf scale=640:-1 output-640.webm
If there is an audio track with the video you can remove it as follows:
ffmpeg -i input.webm -vcodec copy -an output-no-audio.webm
To trim the video that is already converted or in the format you want. The example below grabs the frames at 1 minute in and for 60 seconds after that.
ffmpeg -ss 00:01:00 -i video.webm -t 60 -c copy trimmed.webm
Comparing MP4/Webm to Gif File sizes
I'm by no means a "gif-scientist". So getting good framerates and qualtiy gifs for me a bit like magic. I just keep plugging in things from stackoverflow hoping I get a good quality gif. With that being said, I created a gif from our trimmed MP4 and used giflossy to make it "more-better".
| File Type Type | Size in MB | Link To File |
|---|---|---|
| Unoptimized Gif | ≈37.9MB | Unoptimized Gif |
| GifLossy Optmized Gif | ≈23.0MB | Optimized With giflossy |
| Trimmed MP4 | ≈457KB | MP4 Trimmed, Resized and No Audio |
| Best Trimmed Webm | ≈597KB | Best Webm Trimmed, Resized and No Audio |
| Constant w/43 crf | ≈182KB | Constant Webm Trimmed, Resized and No Audio |
| Constrained 800k bit rate | ≈413KB | Constrained Webm Trimmed, Resized and No Audio |
Visual comparison of the Optimized Gif, MP4 Video and Constant Quality WebM
Bonus! Gif, Animated Webp and Animated PNG
As an added bonus since I already had everything open I decided to convert the Gif to an animated Webp image and an Animated PNG. I've written on converting to an Animated Webp before and if you're comfortable on the command line its pretty easy to create an animated webp. Below is how I converted the Gif to an Animated Webp using Google's gif2webp .
# -q is the quality range from 0 - 100
# -mixed uses mixed compression: from Google's docs:
# "optimize compression of the image by picking either lossy or lossless compression for each frame heuristically"
gif2webp -q 70 -mixed squirrel.gif -o squirrel.mixed.webp
Animated PNG on the other hand is kinda tricky to create. At least find the tools to do so is tricky. Imagemagick doesn't support it currently. GIMP has a plugin for APNG but I can't vouch for how good it is since I've never used it. The tools that I found seem to be... "old" or not updated in a while. I don't know if things have changed a lot in APNG so the "freshness" of the tools may not be an issue. These are the tools to convert to Animated PNG .
For the Gif to Animated PNG conversion I used gif2apng from the above tools to convert APNG link. I also optimized the APNG with the apng optimizer but the file size actually ended up being bigger. Since I'm not familiar with APNG I don't know if I messed up something along the way.
So lets get on with it. Whats the file size difference if any all all these animated image formats?
| File Type Type | Size in MB | Link To File |
|---|---|---|
| Unoptimized Gif | ≈37.9MB | Unoptimized Gif |
| GifLossy Optmized Gif | ≈23.0MB | Optimized With giflossy |
| Animated PNG | ≈29.47MB | Animated PNG (using 7zip) Animation only works in Firefox and Safari |
| Animated Webp | ≈5.7MB | Animated Webp (Mixed Compression) Format only supported in Blink based browsers |


Monta Vista
La Pluma
La Pluma
Home
(current)
Previous Work
Tides Issue
Contact Us
By Esther Jeong
These Sorrowful Tides
By Robert Liu
UNTITLED
By Vardaa Molasi
Marine in the Moonlight
By Cheryl Bai
UNTITLED
By Lara Um
UNTITLED
By Udbhav Venkataraman
Shine Like a Star
By Yeebing Tse
Sapling Amber
By Bhavik Gupta
Me, My Conscience, and the Tides
By Saili Natu
Tide to my Love
By Dhruvika Randad
Rendezvous in Moonlight
By Lavi Sundar
Maybe
By Manasi Ganti
Of Raw Olives and Hershey's Chocolate
By Shivani Madhan
Real Beautiful
By Janya Bhaskar
The Ocean's Wrath


Full-stack Developer with a background in manufacturing who enjoys problem solving and learning new things.
Find Out MoreAlways learning new things. Interested in Javascript, React, and Redux. Interested in learning more about Python, React Native, AWS and Serverless.
My GitHub Profile!


Gameboy.photography extracts Gameboy Camera photos from your save files. Currently, the site requires Javascript


Continually learning. Continually growing.
Current: Ruby, Rails.
Soon: CSS, Javascript, EmberJS, Elixir.


Dear Wife
I would inform you that Brother Martin has arrived here and brought the
pleasing news that our families were well when he left there which greatly
cheered our hearts and revived our spirits. We thank our Heavenly Father for
his goodness unto us and all of you. Martin arrived on Saturday the same week
he left Chagrin having a prosperous time. We are all in good health. Brother
Whitney’s leg is gaining and he thinks he shall be able to perform his
journey so as to get home about the 20th. My situation is a very unpleasant
one although I will endeavor to be contented, the Lord assisting me. I have
visited a grove which is just back of the town almost every day where I can be
secluded from the eyes of any mortal and there give vent to all the feelings
of my heart in meditation and prayer. I have called to mind all the past
moments of my life and am left to mourn and shed tears of sorrow for my folly
in suffering the adversary of my soul to have so much power over me as he has
had in times past, but God is merciful and has forgiven my sins, and I rejoice
that he sendeth forth the comforter unto as many as believe and humbleth
themselves before Him. I was grieved to hear that Hyrum had lost his little
child. I think we can in some degree sympathize with him but we all must be
reconciled to our lots and say the will of the Lord be done. Sister Whitney
wrote a letter to her husband which was very cheering and being unwell at that
time and filled with much anxiety it would have been very consoling to me to
have received a few lines from you, but as you did not take the trouble I will
try to be contented with my lot, knowing that God is my friend. In him I shall
find comfort. I have given my life into his hands. I am prepared to go at his
call


Metadata
Crawler
Try API
API
Sources
Metadata
Crawler
A Service That Harvests
Schema.org-Standard
Structured Biomedical Dataset Metadata & Makes It Accessbile Via An API Powered By
BioThings API
.
Learn more on
Github
Last updated: Jan 2020
TRY IT
Crawled Sources Include:
TRY THE API
Clear
Submit
Select a query
Example Queries
Write My Own Query
Loading


(Deprecated API)
(Deprecated API)
(Deprecated API)
Includes enterprise licensing and support
The Maps Data API allows client applications to view and update maps and map features through the use of Google Data API feeds. These feeds are provided as URLs using the popular Atom standard. You programmatically create, alter and delete data using HTTP requests. The JavaScript client library sits on top of this HTTP protocol and enables API interactions using JavaScript methods.
Maps and map features are stored on Google's servers. A web interface to a user's maps is available through Google My Maps at http://maps.google.com/maps/mm.
Client libraries for other programming languages are also available, and are listed in the Developer's Guide introduction. If you're interested in understanding more about the underlying protocol that these libraries use, see the HTTP Protocol Guide.
This document is intended for JavaScript programmers who wish to interact with the Google Maps Data API to create, update, or delete maps and map features.
For reference information about the classes and methods provided by the client library, see the JSDoc. For general Maps Data API reference information, see the HTTP Protocol Reference.
Using the Maps Data API JavaScript client library requires the following:
We also recommend a JavaScript debugger.
Maps are stored and associated with user IDs attached to a Google Account. If you do not currently have a Google Account, sign up for one here.
The Maps Data API manipulates maps which appear within the My Maps feature on Google Maps. My Maps includes two types of maps: Public, and Unlisted. A sample My Map is shown below:
Figure 1: Google My Maps interface
You can use My Maps within your browser to inspect the state of your map after data updates.
Maps created with the Maps Data API are created as Public maps, meaning they will be indexed and may show up in search results. To change your maps to Unlisted mode, you must edit them through the My Maps web UI.
Before your client can use the client library, the client has to request the client library code from the server. There are two ways of requesting the client library:
google.load()
)Google's JavaScript client libraries for AJAX APIs can be loaded using a
common loader function, named google.load()
. This function is
contained within the jsapi
JavaScript file, which you must
reference from your document's <head>
:
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
<script type="text/javascript">
// Load the latest version of the Google Data JavaScript Client
google.load('gdata', '2.x', {packages: ['maps']});
function onGoogleDataLoad() {
// Put your code here
}
// Call function once the client has loaded
google.setOnLoadCallback(onGoogleDataLoad);
</script>
google.load
is passed three parameters:
'gdata'
."2"
is the second-to-last revision of major
version 2."2.x"
is the latest revision of major version
2."2.s"
is the latest stable revision of
major version 2. We will occasionally declare a certain version of the
client library to be "stable," based on feedback we receive
from developers. However, that version may not have the latest features.
"2.0"
, "1.1"
, etc are
specific versions of the library, with a specified major and minor
revision number.gdata
package(s). For the
Maps Data API, the value is 'maps'
. This parameter is optional,
but is recommended, as it reduces the size of the JavaScript client by
loading only the required packages.google.setOnLoadCallback()
is called once the Google Data
JavaScript client library has been fully loaded. This ensures that the browser
doesn't attempt to execute your code before the library is available. Your
client code must be placed inside the onGoogleDataLoad()
function.
For more information on the common loading mechanism, refer to the Loading the library section of Using the JavaScript Client Library.
The gdata
client library can
also be loaded directly from the Google AJAX API loader without using
google.load
. To do so, add the following tag (removing the
linebreaks) to your document's <head>
:
<script type="text/javascript" src="http://www.google.com/jsapi?autoload= %7B%22modules%22%3A%5B%7B%22name%22%3A%22gdata%22%2C%22version%22%3A%222.x %22%2C%5B%22callback%22%3A%22onLoad%22%2C%22packages%22%3A%5B%22maps%22%5D %5D%7D%5D%7D"></script>
The onLoad
value in the string above
defines the callback function to invoke once the API is loaded. Place your
client code within the onLoad()
function to ensure that the
client library is fully loaded before you attempt to create a new
MapsService
object. More information about autoloading is
available from the Autoloading section of the
AJAX APIs documentation.
The google.gdata.maps.MapsService
class
(reference)
contains the methods necessary for accessing features and maps in the Google
Data API. This class also inherits authentication methods necessary for
OAuth Proxy
authentication for Google Data API gadgets.
To create a MapsService
object:
var service = new google.gdata.maps.MapsService('docs-example');
where docs-example
is the application's name. The application
name is used only as an identifier.
To simplify the code samples included in this document,
the MapsService
object is assumed to have been declared as a
global variable, service
.
Conceptual information about authentication is covered within the HTTP Protocol Guide.
Authentication for a web-based JavaScript client is accomplished through AuthSub for JavaScript. This authentication scheme generates a token that your client application uses to authenticate for each API call.
A simple login function could look like this:
function doLogin() { var token = google.accounts.user.login('http://maps.google.com/maps/feeds'); }
Calling this function directs the user to a Google-hosted login page, where they are given the choice to allow or disallow access to their account from your application. If access is granted, they are directed back to the URL from which the login function was called.
Some additional authentication-related functions:
// Check whether the user is authenticated. function checkLogin() { return google.accounts.user.checkLogin('http://maps.google.com/maps/feeds'); }
// Log the user out. function doLogout() { google.accounts.user.logout(); } // Optionally, include a callback parameter that // gets called once the user is logged out. function doLogoutAndRefresh() { google.accounts.user.logout(function() { window.location.reload(); }); }
The Google Maps Data API JavaScript client also supports authentication using the OAuth Proxy scheme, for use in Google Data API gadgets.
First, add an <OAuth>
element to your gadget's
<ModulePrefs>
section:
<ModulePrefs> ... <OAuth> <Service name="google"> <Access url="https://www.google.com/accounts/OAuthGetAccessToken" method="GET" /> <Request url="https://www.google.com/accounts/OAuthGetRequestToken? scope=http://maps.google.com/maps/feeds/" method="GET" /> <Authorization url="https://www.google.com/accounts/OAuthAuthorizeToken? oauth_callback=http://oauth.gmodules.com/gadgets/oauthcallback" /> </Service> </OAuth> ... </ModulePrefs>
Then, call the useOAuth()
method on the MapsService
object:
var service = new google.gdata.maps.MapsService('docs-example'); service.useOAuth('google');
More information about using the OAuth Proxy in gadgets is available from Writing OAuth Gadgets.
The Google Maps Data API works with the concepts of maps and features.
Maps are containers for any number of features. A map has attributes that include a title, author, and the time this map was last updated, but does not include any geographic information or placemarks.
Features are objects on a map. A feature is associated with only one map, and is defined using KML. A feature is a KML placemark element and can contain geographic information, descriptive information (such as a title, icon, and description balloon contents), and associated geometry, such as lines or polygons.
Figure 2: Four features on a map
When using the Google Maps Data API:
You cannot request a feed of all features across all maps.
The Google Maps Data API can return a list of a user's maps as a feed object, or individual maps can be retrieved if their URL is known.
When retrieving a list of maps, a feed URL must be specified. The feed URL specified which set of the user's maps to return:
http://maps.google.com/maps/feeds/maps/default/owned
returns all maps created by the userhttp://maps.google.com/maps/feeds/maps/default/public
returns all public maps created by the userhttp://maps.google.com/maps/feeds/maps/default/unlisted
returns all unlisted maps created by the userMap feeds are requested by calling getMapFeed()
on the
MapsService
object. getMapFeed()
takes as
parameters:
Upon success, getMapFeed()
passes a feed object to the
continuation function. The list of maps can be accessed from the feed object's
feed
parameter:
function listMaps() { var list = document.createElement('ul'); var mapFeedUrl = 'http://maps.google.com/maps/feeds/maps/default/owned'; service.getMapFeed(mapFeedUrl, function(feedRoot) { var feed = feedRoot.feed; var entries = feed.getEntries(); for (var i = 0; i < entries.length; i++) { var entry = entries[i]; var mapTitle = entry.getTitle().getText(); var listItem = document.createElement('li'); var listText = document.createTextNode(mapTitle); listItem.appendChild(listText); list.appendChild(listItem); } document.body.appendChild(list); }, errorHandler); }
If a map's URL is known, it can be requested directly by calling
getMapEntry()
on the MapsService
object. A single
map's URL has the following structure:
http://maps.google.com/maps/feeds/maps/userID/full/mapID
The URL of a specific map can be obtained from a feed of all maps by calling
getSelfLink().getHref()
on an entry:
var mapFeedUrl = 'http://maps.google.com/maps/feeds/maps/default/owned'; var mapUrl; service.getMapFeed(mapFeedUrl, function(feedRoot) { var feed = feedRoot.feed; var entries = feed.getEntries(); for (var i = 0; i < entries.length; i++) { var entry = entries[i]; if (entry.getTitle().getText() == "Roadtrip 2009") { mapUrl = entry.getSelfLink().getHref(); } } }, errorHandler);
To store all individual map URLs for later access:
// Create an array to hold individual map URLs. var mapUrls = []; var mapFeedUrl = 'http://maps.google.com/maps/feeds/maps/default/owned'; service.getMapFeed(mapFeedUrl, function(feedRoot) { var feed = feedRoot.feed; var entries = feed.getEntries(); for (var i = 0; i < entries.length; i++) { var entry = entries[i]; mapUrls[i] = entry.getSelfLink().getHref(); } }, errorHandler);
Note that the MapEntry
object returned by the
getMapEntry()
method is identical to that returned within a
getMapFeed()
feed.
The following example retrieves a map entry and prints its title as an
h1
element on the page.
service.getMapEntry(mapUrl, function(entryRoot) { var entry = entryRoot.entry; var mapTitle = entry.getTitle().getText(); var titleElement = document.createElement('h1'); var titleText = document.createTextNode(mapTitle); titleElement.appendChild(titleText); document.body.appendChild(titleElement); }, errorHandler);
To create a new map, call insertEntry()
on the map feed. A title
and a summary must be specified; all other properties are optional. The
example below creates a new map with the title 'Roadtrip 2009' and inserts it
into the user's feed.
insertEntry()
takes three parameters:
google.gdata.maps.MapEntry
objectfunction addMap() { var mapFeedUrl = 'http://maps.google.com/maps/feeds/maps/default/owned'; service.getMapFeed(mapFeedUrl, function(feedRoot){ var newMap = new google.gdata.maps.MapEntry(); newMap.setTitle(new google.gdata.atom.Text.create('Roadtrip 2009')); newMap.setSummary(new google.gdata.atom.Text.create('Seattle to San Francisco, and back')); feedRoot.feed.insertEntry(newMap, function() {window.location.reload();}, errorHandler); }, errorHandler); }
A map's fields can be updated by calling updateEntry()
on the map
object. updateEntry()
must be passed a function to be called upon successful update, and a function
to be called if the update is unsuccessful.
function updateMap() { service.getMapEntry(mapUrl, function(entryRoot) { var entry = entryRoot.entry; var newTitle = new google.gdata.atom.Text(); newTitle.setText('An updated title'); entry.setTitle(newTitle); entry.updateEntry(loadMaps, errorHandler); }, errorHandler); }
To delete a map, call deleteEntry()
on the
MapsService
. Provide the URL of the map to be deleted, a function
to be called when the deletion has succeeded, and a function to call if the
deletion is not successful.
function deleteMap(i) { var mapUrl = mapLinks[i]; service.deleteEntry(mapUrl, function() { document.getElementById('app_status').innerHTML = 'Map deleted'; }, errorHandler); }
Caution: Deleting a map also deletes all features associated with that map. There is no way to retrieve a map or its features once the map has been deleted.
Features are the objects that appear on a map. Each feature within the Maps
Data API is defined by a single KML <Placemark>
element;
the Placemark must contain a name
element and one of the
following elements:
The following KML elements are supported and are optional:
<coordinates>
<description>
<fill>
<IconStyle>
<LinearRing>
<LineStyle>
<outerBoundaryIs>
<outline>
<width>
<href>
(within <IconStyle>
)
<color>
(as #AABBGGRR
)
<Icon>
(within <IconStyle>
)
<Style>
All other KML elements are silently removed when the KML is uploaded.
Each map contains a list of zero or more features: the placemarks, lines, and
shapes placed on the map. To retrieve the feed of a map's features, you must
pass the feed URL to the getFeatureFeed
() method on the
MapsService
object.
To obtain the URL of a map's feature feed, call
getContent().getUri()
on a map entry:
var featureFeedUrl; service.getMapEntry(mapUrl, function(entryRoot) { var entry = entryRoot.entry; featureFeedUrl = entry.getContent().getUri(); }, errorHandler);
With this information, you can retrieve a full list of features:
service.getFeatureFeed(featureFeedUrl, function(feedRoot) { var feed = feedRoot.feed; var features = feed.getEntries(); // Create an unordered list to hold // the features' titles and contents. var ul = document.createElement('ul'); for (var i = 0; i < features.length; i++) { var feature = features[i]; var title = feature.getTitle().getText(); var content = feature.getContent().getText(); // Create a list item; add the title. var li = document.createElement('li'); var titleNode = document.createTextNode(title); li.appendChild(titleNode); // Create a pre element; populate with content. // Append the pre to the list item. var pre = document.createElement('pre'); var contentNode = document.createTextNode(content); pre.appendChild(contentNode); li.appendChild(pre); // Add the list item to the unordered list. ul.appendChild(li); } // Add the unordered list to the document body. document.body.appendChild(ul); }, errorHandler);
Individual features can be retrieved with their identifying URLs. The URL can
be obtained from a map's feature feed by calling
getSelfLink().getHref()
on the feature entry:
var featureUrl; service.getFeatureFeed(featureFeedUrl, function(feedRoot) { var feed = feedRoot.feed; var entries = feed.getEntries(); for (var i = 0; i < entries.length; i++) { var entry = entries[i]; if (entry.getTitle().getText() == "A fine feature") { featureUrl = entry.getSelfLink().getHref(); } } }, errorHandler);
Once a feature's URL is known, call getFeatureEntry()
on the
MapsService
object. getFeatureEntry()
takes three
parameters:
service.getFeatureEntry(featureUrl, function(featureRoot) { var entry = featureRoot.entry; var title = entry.getTitle().getText(); var content = entry.getContent().getText(); }, errorHandler);
Features are created by passing a FeatureEntry
object to
insertEntry()
on the feature feed. To create the entry:
google.gdata.maps.FeatureEntry
object.setTitle()
on the
FeatureEntry
object.google.gdata.maps.KmlContent
object.setText()
on the
KmlContent
object.setType()
on the KmlContent
object,
specifying TYPE_APPLICATION_VND_GOOGLE_EARTH_KML_XML
.KmlContent
object as the feature entry's content
using setContent()
.An example is shown below:
service.getFeatureFeed(featureFeedUrl, function(feedRoot) { var newFeature = new google.gdata.maps.FeatureEntry(); // Set the name for this feature. var title = new google.gdata.atom.Text(); title.setText('A new feature'); newFeature.setTitle(title); // Define the content. var kmlContent = new google.gdata.maps.KmlContent(); var kmlString = '<Placemark>' + '<Point>' + '<coordinates>-122.448425,37.802907,0</coordinates>' + '</Point>' + '</Placemark>'; kmlContent.setText(kmlString); kmlContent.setType(google.gdata.maps.KmlContent.TYPE_APPLICATION_VND_GOOGLE_EARTH_KML_XML); // Set the KML as the new feature's content. newFeature.setContent(kmlContent); // Insert the new feature into the feature feed. feedRoot.feed.insertEntry(newFeature, function () {window.location.reload();}, errorHandler); }, errorHandler);
A feature can be updated by calling updateEntry()
on the feature
entry after the object has been updated. updateEntry()
takes a function to call upon successful update, and a function to be called
if the update fails.
<name>
ElementA feature's name, or title, is defined by its <name>
element in KML. However, in the Maps Data API JavaScript client, the
FeatureEntry
uses the entry's title
field instead.
Updates to the <name>
element in the KML will be silently
ignored.
service.getFeatureEntry(featureLink, function(featureRoot) { var entry = featureRoot.entry; var name = new google.gdata.atom.Text(); name = 'Roadtrip 2009, updated'; entry.setTitle(name); entry.updateEntry(function() {window.location.reload()}, errorHandler); }, errorHandler);
All elements other than <name>
must be updated by editing
the feature's KML.
To pass KML to the entry:
google.gdata.maps.KmlContent
object.setText()
.setType()
on the object, specifying
TYPE_APPLICATION_VND_GOOGLE_EARTH_KML_XML
.KmlContent
object as the feature entry's
content
.The following example uses the content of a form (whose textarea
element has the name formInput
) to update a feature entry.
function updateKml(form, featureLink) { service.getFeatureEntry(featureLink, function(featureRoot) { var entry = featureRoot.entry; var kmlContent = new google.gdata.maps.KmlContent(); var updatedKml = form.formInput.value; kmlContent.setText(updatedKml); kmlContent.setType(google.gdata.maps.KmlContent.TYPE_APPLICATION_VND_GOOGLE_EARTH_KML_XML); entry.setContent(kmlContent); entry.updateEntry(function() {window.location.reload()}, errorHandler); }, errorHandler); }
To delete a feature, call deleteEntry()
on the feature entry,
passing a function to be called upon successful deletion of the feature, and a
function to be called if the deletion is unsuccessful.
service.getFeatureEntry(featureLink, function(featureRoot) { var entry = featureRoot.entry; entry.deleteEntry(function() { document.getElementById('app_status').innerHTML = 'Feature deleted'; }, errorHandler); }, errorHandler);
Caution: There is no way to retrieve a feature once it has been deleted.
Controlling access to your maps is important: sometimes you need to keep your data restricted to a small set of people, and other times you'd like your map to be accessible to the entire world. The Maps Data API provides two layers of access control:
api_visible
custom
property defines whether a map can be accessed by non-owners through the Maps Data API.
Using these two layers of control, you can make sure that the correct people have access to your maps.
api_visible
Custom PropertyMaps are always accessible to their owners through the API.
If you'd like your map to be accessible to others through the API (such as
with a web application you create), the map's api_visible
custom
property must be true. The map's
access control list then defines access
levels for non-owners. In this case, users who are not authenticated fall
under the ACL's default
scope.
When api_visible
is false, only a map's owner
can access that map through the API.
A map's api_visible
custom property is set at creation according
to the method of creation:
api_visible
set to
true.api_visible
set to false.Note: All maps created before
December 16th, 2009 were created with api_visible
set to
false.
To update the api_visible
custom property, call
addCustomProperty()
on the map entry, passing it the arguments
show below; then, call updateEntry()
on the map entry, passing it
a function to call upon successful update, and a function to call should the
update fail.
service.getMapEntry(mapUrl, function(entryRoot) { var entry = entryRoot.entry; entry.addCustomProperty({name:'api_visible', value:'1'}); // value:'0' for false. entry.updateEntry(function() {window.location.reload()}, errorHandler); }, errorCB);
The Google Data API provides methods to control access to your maps. Individual users can be granted priviledges, and a default access level can be set for all users not specifically named.
Access control is accomplished using the google.gdata.acl
class.
Each map has one ACL feed, containing one or more ACL entries. Each entry
specifies a scope and a role; the
scope defines the user affected, and the
role defines their access level. All feeds contain an entry
for the default
scope, which applies to all users without their
own entry.
Allowed scopes in the Maps Data API are:
Allowed roles are explained in the table below.
| Role | Map | Features | ACL |
|---|---|---|---|
owner (not valid with default scope) |
View - Edit | View - Add - Edit - Delete | View - Edit |
reader |
View | View | View |
writer |
View - Edit | View - Add - Edit - Delete | View |
appender |
- | Add | - |
readappender |
View | View - Add | View |
default |
Explicitly grants a user the same role as is granted the default scope. | ||
none |
Assigning a role of none to a user will remove
that user's ACL entry. |
The creator of a map always has full permission to the map, its features, and its ACL, regardless of any changes to the owner's ACL entry. A map can only be deleted by its creator.
A map's ACL can be retrieved with its unique URL. This URL can be inferred
from the map entry's id
property, as follows:
var aclFeedURL = mapEntry.getId().$t.replace('feeds\/maps', 'feeds\/acl\/maps') + '\/full';
getAclFeed()
takes the ACL feed URL, a function to be called
upon successful retrieval, and an error handler. Upon success,
getAclFeed()
passes a feedRoot
object to the
continuation function.
service.getAclFeed(aclFeedURL, continuation_func, errorHandler); function continuation_func(feedRoot) { var aclEntries = feedRoot.feed.getEntries(); for (var i = 0; i < aclEntries.length; i++) { var aclEntry = aclEntries[i]; }
An individual ACL entry's feed can be retrieved by calling
getAclEntry()
on the entry's unique URL. This URL can be obtained
by calling getSelfLink().getHref()
on the ACL entry, or can be
constructed by appending the scope type and scope value to the ACL feed URL,
as shown in the following example:
function retrieveAclEntry(aclFeedURL) { var aclEntryURL = aclFeedURL + '/user%3Ajohn%40gmail.com'; // URL-encoded scope_type:scope_value service.getAclEntry(aclEntryURL, showAclEntry, errorHandler); }
getAclEntry()
passes an entryRoot
object to the continuation function:
function showAclEntry(entryRoot) { var entry = entryRoot.entry; var scopeType = entry.getScope().getType(); var scopeValue = entry.getScope().getValue(); var roleValue = entry.getRole().getValue(); alert(scopeType + '\n' + scopeValue + '\n' + roleValue); }
ACL entries are inserted into the ACL feed by calling
insertEntry()
on the MapsService
object.
insertEntry()
in this case takes the following parameters:
google.gdata.acl.AclEntry
object.entryRoot
will be passed to this function.google.gdata.AclEntry
.
function addAclEntry() { var entry = new google.gdata.acl.AclEntry(); var role = new google.gdata.acl.AclRole(); role.setValue('owner'); entry.setRole(role); var scope = new google.gdata.acl.AclScope(); scope.setType('user'); scope.setValue('bob@gmail.com'); entry.setScope(scope); service.insertEntry(aclFeedURL, entry, showNewEntryURL, errorHandler, google.gdata.AclEntry); } function showNewEntryURL(entryRoot) { var entry = entryRoot.entry; var aclEntryURL = entry.getSelfLink().getHref(); alert(aclEntryURL); }
ACL entries can be updated by calling updateEntry()
on the
entry
object. updateEntry()
takes a function to call
upon successful update, and a function to be called if the update fails.
Only the role value of an entry can be changed; scope can not be updated.
function changeRole(aclEntry) { var role = aclEntry.getRole(); role.setValue('appender'); aclEntry.setRole(newRole); aclEntry.updateEntry(displayNewRole, errorHandler); } function displayNewRole(entryRoot) { var entry = entryRoot.entry; var role = entry.getRole().getValue(); alert(role); }
To remove an entry from an ACL, call deleteEntry()
on the
entry
object,passing a function to be called upon successful
deletion of the entry, and a function to be called if the deletion is
unsuccessful.
deleteEntry()
will pass the deleted entry's
entryRoot
object to the continuation function.
function deleteAclEntry(entry) { entry.deleteEntry(notifyDeleted, errorHandler); } function notifyDeleted(entryRoot) { var entry = entryRoot.entry; alert("The " + entry.getScope().getValue() + " scope has been deleted."); }
A JavaScript debugger is highly recommended while developing. Some free debuggers include Firebug for Firefox, Microsoft Script Debugger for IE, and the built-in tools in Safari and Google Chrome.
Many methods call for an error handler function as a parameter. If an error
occurs when calling one of these methods, the browser's Error
object will be passed to your specified error handler. If the error is from an
HTTP response, it will include a cause
parameter. You can use the
information from the Error
object to help troubleshoot your
application.
function errorHandler(e) { var errorDiv = document.createElement('div'); document.body.appendChild(errorDiv); if (e instanceof Error) { errorDiv.innerHTML = 'Error on line ' + e.lineNumber + ' in ' + e.fileName + '\nMessage: ' + e.message; if (e.cause) { errorDiv.innerHTML = errorDiv.innerHTML + '<br />Root cause: HTTP error ' + e.cause.status + ': ' + e.cause.statusText; } } else { alert(e.toString()); } }
More information about the Google Maps Data API and/or the Google Data JavaScript client is available from the following sources:


Write a program to recognize line patterns in a given set of points.
Computer vision involves analyzing patterns in visual images and reconstructing the real-world objects that produced them. The process in often broken up into two phases: feature detection and pattern recognition. Feature detection involves selecting important features of the image; pattern recognition involves discovering patterns in the features. We will investigate a particularly clean pattern recognition problem involving points and line segments. This kind of pattern recognition arises in many other applications such as statistical data analysis.
The problem. Given a set of N distinct points in the plane, draw every (maximal) line segment that connects a subset of 4 or more of the points.
Point data type. Create an immutable data type Point that represents a point in the plane by implementing the following API:
To get started, use the data type Point.java, which implements the constructor and the draw(), drawTo(), and toString() methods. Your job is to add the following components.public class Point implements Comparable<Point> { public final Comparator<Point> SLOPE_ORDER; // compare points by slope to this point public Point(int x, int y) // construct the point (x, y) public void draw() // draw this point public void drawTo(Point that) // draw the line segment from this point to that point public String toString() // string representation public int compareTo(Point that) // is this point lexicographically smaller than that point? public double slopeTo(Point that) // the slope between this point and that point }
Brute force. Write a program Brute.java that examines 4 points at a time and checks whether they all lie on the same line segment, printing out any such line segments to standard output and drawing them using standard drawing. To check whether the 4 points p, q, r, and s are collinear, check whether the slopes between p and q, between p and r, and between p and s are all equal.
The order of growth of the running time of your program should be N4 in the worst case and it should use space proportional to N.
A faster, sorting-based solution. Remarkably, it is possible to solve the problem much faster than the brute-force solution described above. Given a point p, the following method determines whether p participates in a set of 4 or more collinear points.
Write a program Fast.java that implements this algorithm. The order of growth of the running time of your program should be N2 log N in the worst case and it should use space proportional to N.
APIs. Each program should take the name of an input file as a command-line argument, read the input file (in the format specified below), print to standard output the line segments discovered (in the format specified below), and draw to standard draw the line segments discovered (in the format specified below). Here are the APIs.
public class Brute { public static void main(String[] args) } public class Fast { public static void main(String[] args) }
Input format. Read the points from an input file in the following format: An integer N, followed by N pairs of integers (x, y), each between 0 and 32,767. Below are two examples.
% more input6.txt % more input8.txt 6 8 19000 10000 10000 0 18000 10000 0 10000 32000 10000 3000 7000 21000 10000 7000 3000 1234 5678 20000 21000 14000 10000 3000 4000 14000 15000 6000 7000
Output format. Print to standard output the line segments that your program discovers, one per line. Print each line segment as an ordered sequence of its constituent points, separated by " -> ".
Also, draw the points using draw() and draw the line segments using drawTo(). Your programs should call draw() once for each point in the input file and it should call drawTo() once for each line segment discovered. Before drawing, use StdDraw.setXscale(0, 32768) and StdDraw.setYscale(0, 32768) to rescale the coordinate system.% java Brute input6.txt (14000, 10000) -> (18000, 10000) -> (19000, 10000) -> (21000, 10000) (14000, 10000) -> (18000, 10000) -> (19000, 10000) -> (32000, 10000) (14000, 10000) -> (18000, 10000) -> (21000, 10000) -> (32000, 10000) (14000, 10000) -> (19000, 10000) -> (21000, 10000) -> (32000, 10000) (18000, 10000) -> (19000, 10000) -> (21000, 10000) -> (32000, 10000) % java Brute input8.txt (10000, 0) -> (7000, 3000) -> (3000, 7000) -> (0, 10000) (3000, 4000) -> (6000, 7000) -> (14000, 15000) -> (20000, 21000) % java Fast input6.txt (14000, 10000) -> (18000, 10000) -> (19000, 10000) -> (21000, 10000) -> (32000, 10000) % java Fast input8.txt (10000, 0) -> (7000, 3000) -> (3000, 7000) -> (0, 10000) (3000, 4000) -> (6000, 7000) -> (14000, 15000) -> (20000, 21000)
For full credit, do not print permutations of points on a line segment (e.g., if you output p→q→r→s, do not also output either s→r→q→p or p→r→q→s). Also, for full credit in Fast.java, do not print or plot subsegments of a line segment containing 5 or more points (e.g., if you output p→q→r→s→t, do not also output either p→q→s→t or q→r→s→t); you should print out such subsegments in Brute.java.
Deliverables. Submit only Brute.java, Fast.java, and Point.java. We will supply stdlib.jar and algs4.jar. Your may not call any library functions other than those in java.lang, java.util, stdlib.jar, and algs4.jar.
This assignment was developed by Kevin Wayne.


SwitchComponent
public struct SwitchComponent : Component
A collection of resources that create the visual appearance a RealityUI Switch, RUISwitch
.
-
Creates a SwitchComponent using a list of completely optional parameters.
Declaration
Swift
public init( isOn: Bool = false, onColor: Material.Color = .systemGreen, offColor: Material.Color = .lightGray, padding: Float = 0.05, border: Float = 0.05, borderColor: Material.Color = .black, thumbColor: Material.Color = .white )
Parameters
isOn
A Boolean value that determines the off/on state of the switch. Default to
false
, meaning off.onColor
Color of the inner capsule when the switch is set to
on
. DefaultMaterial.Color.systemGreen
offColor
Color of the inner capsule when the switch is set to
off
. DefaultMaterial.Color.lightGray
padding
Padding (in meters) between the thumb and the inner capsule of the switch. Default 0.05.
border
Border (in meters) between the two outer capsules of the switch. No border if set to 0. Default 0.05.
borderColor
Color of the outer border. Default
Material.Color.black
thumbColor
Color of the thumb. Default white.
-
Creates the SwitchComponent with all default styles, only custom colours.
Declaration
Swift
public init(onColor: Material.Color, offColor: Material.Color)
Parameters
onColor
Color of the inner capsule when the switch is set to
on
.offColor
Color of the inner capsule when the switch is set to
off
.


Toggle navigation
Rtcomm HelpDesk Customer
Home
Helpdesk
Dashboard
(current)
Products
Customer Sample Page
Product content goes here...
Video
Disconnect


|
On-screen messages should provide a form of help, as "hints". For example, in "Quake", when approaching a door without the necessary key, the message "You need the (specific) key" appears. Games are unlike most other programs, in that the user is intended to make mistakes. Messages should be straightforward and helpful, or confusing and unhelpful, depending on the situation. But, aiding the user too much will shorten the life-span of the game.
Online help will need to cater for users of widely varying experience and knowledge. Help should be presented to the user in varying stages of complexity, otherwise novices will be lost. More advanced help options should be initially masked from novices. Constantly giving users the feeling that they have a very incomplete picture will quickly disillusion beginners. |


|
RVL
1.0
|
Files | |
| file | adjtest.hh [code] |
| file | blockop.hh [code] |
| file | data.hh [code] |
| file | derivtest.hh [code] |
| file | doc.h [code] |
| file | except.hh [code] |
| file | functional.hh [code] |
| file | gradtest.hh [code] |
| file | linalg.hh [code] |
| file | linop.hh [code] |
| file | linop_apps.hh [code] |
| file | linop_base.hh [code] |
| file | ls.hh [code] |
| file | op.hh [code] |
| file | product.hh [code] |
| file | productdata.hh [code] |
| file | productspace.hh [code] |
| file | scantest.hh [code] |
| file | space.hh [code] |
| file | std_cpp_includes.hh [code] |
| file | utility.hh [code] |
| file | write.hh [code] |


graph(3) - [M_graph] Draw an XY graph
Synopsis
Description
Options
Example
Author
subroutine graph(x,y,ndp,ndl,f,c,nc)
This is an XY graph routine that is intended to be very self-contained and easily ported to various graphics libraries. This version is callable from the M_draw(3f) module.
It is being ported from the LONGLIB public domain library and will be changing. It is recommended that you rename the M_graph(3f) module source to freeze a copy at this point, as new versions will not necessarily be upward compatible. The underlying calls to M_graph(3f) should not require any changes.
graph(3f) is a general routine for plotting lines or scatterplots. Optionally, error bars and symbols can be added. graph(3f) differs in philosophy from other libDL MASTER routines in that plotting options are passed via an option array. The routine is designed to produce a reasonable plot with the option array set to all zeros. The output format is changed by initializing selected array elements to the values described below. This permits simple but flexible specification of the plot format.
The optional error bar specification, when non-zero, changes interpretation of lines. The first line (and every third line) is considered a "center" line. The second line specifies the relative error (to be added to the first line) used for plotting the tops of the error bars. The third line is used similarly to locate the bottoms of the error bars. When the error bar specification is negative the center line points are marked with a special "x" (in addition to any other option). The absolution value of the specification determines the type of error bar according to the following table.
x (R): x input array dimensioned x(ndp,ndl). y (R): y input array dimensioned y(ndp,ndl). ndp (i): number of data points per line ndl (i): number of data lines f (R): option array dimensioned at least f(53) (described below)c (C): array of strings dimensioned C(3+ndl) c(1) : x axis title c(2) : y axis title c(3) : top title c(4) : line 1 legend (optionally used) c(5) : line 2 legend (optionally used) ... ...nc (i): array of string lengths dimensioned nc(3+ndl) nc(1) : number of characters to use in C(1) nc(2) : number of characters to use in C(2) ... ...The array elements of the option array f are interpreted according to the following table. Some parameters have default values (shown in square brackets). These are used when the input value is zero. A simple plot may be produced by setting all the elements of f to zero. Note that user specified input scaling factors should be powers of ten when the log axis specification is selected. An optional legend may be plotted. The legend consists of a column of lines and the labels from n(4:)
array range of index values action for each value------- -------- ------------------------
1 0<=.<=ndp number of points/line to plot [ndp]: 0=ndp used 2 0<=.<=ndl number of lines to plot [nl]: 0=ndl used 3 -1/0/1 x scale: 0=auto,smoothed; 1=auto,nosmooth; -1=user 4 xmin user supplied scale value (used if f(3)<0) 5 xmax user supplied scale value (used if f(3)<0) 6 -1/0/1 y scale: 0=auto,smoothed; 1=auto,nosmooth; -1=user 7 ymin user supplied scale value (used if f(6)<0) 8 ymax user supplied scale value (used if f(6)<0) 9 0/1 x value usage: 0=first line of x data array used for all y lines; 1=lines of x,y paired 10 0/1 connect plotted points: 0=yes; 1=no 11 >=0 symbol plotted every ()th point: 0=no symbols 12 >=0 line symbol size [0.1]: 0=use default 13 >=0 symbol number for first data line, each line then uses next symbol in sequence 14 8<.<8 error bar option (see below): 0=no error bars 16 >=0 error bar size [0.1]: 0=default used 17 0/1 vertical line from points to reference value: 0=no; 1=yes 18 rval reference value 19 -1/0/1 x axis type: 0=linear; 1=log axis, -1=no axis 20 -1/0/1 y axis type: 0=linear; 1=log axis, -1=no axis 21 >=0 x axis length [7.0]: 0=default used 22 >=0 y axis length [5.0]: 0=default used 23 >=0 x axis tick pattern (see axisc_) [7.00]: 0=default 24 >=0 y axis tick pattern (see axisc_) [5.00]: 0=default 25 0/1 x axis title side of axis: 0=below; 1=above 26 0/1 y axis title side of axis: 0=left; 1=right 27 0/1 x axis auto exponent enable: 0=enable; 1=disable 28 0/1 y axis auto exponent enable: 0=enable; 1=disable 29 0/1 x axis tick side: 0=below; 1=above 30 0/1 y axis tick side: 0=left; 1=right 31 0/1 x axis number orientation: 0=horizontal; 1=vertical 32 0/1 y axis number orientation: 0=vertical; 1=horizontal 33 0/1 x axis numbers/title: 0=shown; 1=not shown 34 0/1 y axis numbers/title: 0=shown; 1=not shown 35 0/1 use x=log10(abs(x values)+1.e-34): 0=no; 1=yes 36 0/1 use y=log10(abs(y values)+1.e-34): 0=no; 1=yes 37 -1/0/1 add mirror x axis: 0=no; 1=w/labels; -1:w/o labels 38 -1/0/1 add mirror y axis: 0=no; 1=w/labels; -1:w/o labels (mirrored axes placed on opposite from normal axis) 39 >=0 x axis label size [0.15]: 0=use default 40 >=0 y axis label size [0.15]: 0=use default 41 >=0 top title character size [0.18]: 0=use default 42 0/1/2/3 grid: 0=no grid; 1=solid; 2=dotted; 3=ticked 43 -1/0/1 legend: 0=no legend; 1=right side; -1=user locate 44 xval user specified lower-left corner of legend 45 yval user specified lower-left corner of legend 46 0/1 show plot symbol on legend: 0=no; 1=yes 47 0/1 show line segment on legend: 0=no; 1=yes 48 >=0 legend character height [0.12]: 0=use default 49 >=0 legend line segment length [0.5]: 0=use default 50 -1/0/1 top title justify: 0=center; -1:left; 1:right 51 0/1 plot horizontal reference line: 0=no; 1=yes 52 0/1 use linetype array values: 0=no; 1=yes 53 0/1 use color array values: 0=no; 1=yes 54 >=0 color index #1: 0=color value 1 used 55 >=0 linetype index #1 56 >=0 color index #2: 0=color value 1 used 57 >=0 linetype index #2 ... [char46].. ... etc ...
value type of error bar ------ --------------------------------------------------- 1 line connecting relative errors 2 1 + horizontal bars at relative errs 3 1 + vertical bars at relative errs 4 double line connecting rel. errs+horizontal bars 5 double line connecting rel. errs+vertical bars 6 vertical rectangle w/top and bottom rel. errs 7 rectangle with corners at relative errorsThe color and line type index (when enabled) are used according to the following table.
index # color usage linetype usage --------- ------------- ---------------- 1 x axis x axis 2 x axis numbers y axis 3 x axis title title 4 x axis exponent legend titles 5 y axis reference line 6 y axis numbers error bars 7 y axis title line #1 linetype 8 y axis exponent line #2 linetype 9 title etc. 10 legend titles ... 11 reference line ... 12 grid ... 13 line #1 color ... 14 line #2 color ... ... ... etc. ... ...
Sample program that creates some simple curves and then prompts for index values and values in the options array to allow for testing various options.
program demo_graph use m_graph, only : graph, graph_init use M_drawinteger,parameter :: numlines=3 integer,parameter :: numpts=25 integer,parameter :: nf=255 real :: x(numpts),y(numpts,numlines) character(len=80) :: c(numlines+3) integer :: nc(numlines+3) real :: f(nf) character(len=20) :: device integer :: ixsize integer :: iysize character(len=:),allocatable :: filename integer :: w device=x11 ixsize=1200*.75*0.5 iysize=900*.75*0.5 w=40 if(device.eq.x11)then call prefposition(0,0) call prefsize(ixsize,iysize) else call prefsize(ixsize,iysize) !!call voutput(str(filename,_,int(a),x,int(b),.,device,sep=)) endif call vinit(device) call vsetflush(.false.) call vflush() call linewidth(w)
! fill some arrays with data we can plot DO i20=1,25 X(i20)=i20 Y(i20,1)=i20**2+5.0 Y(i20,2)=i20*20.0 Y(i20,3)=(-3.0)*(i20/4.0)**3 enddo
f=0.0 ! zero out option array ! set up color and linetype in option array do i70=55,nf,2 f(i70)=mod(i70,7) f(i70-1)=mod(i70,7) enddo f(52)=1 f(53)=1
ndp=numpts! number of data points per line ndl=3 ! number of data lines !c ! array of strings dimensioned c(3+numpts) c(1)=X-AXIS ! c(1) : x axis title c(2)=Y-AXIS ! c(2) : y axis title c(3)=TITLE ! c(3) : top title c(4)=LABEL 1 ! c(n) : line N-3 legend (optionally used) c(5)=LABEL 2 ! c(n) : line N-3 legend (optionally used) c(6)=LABEL 3 ! c(n) : line N-3 legend (optionally used) !nc ! array of string lengths in c() dimensioned nc(3+numpts) do i60=1,6 nc(i60)=len_trim(c(i60)) enddo !f(39)= 0.25 !f(40)= 0.25 !f(42)= 3.00 !f(43)=-1.00 ! initialize graphics call graph_init(12.0,9.0, 1.00,1.00, 1.0) INFINITE: do CALL graph(X,Y,NDP,NDL,F,C,NC) call vflush() 888 continue write(*,*)Enter index and value for graph(3f) option array: read(*,*,end=999,err=888)index,value if(index.lt.1)then exit INFINITE elseif(index.gt.nf)then goto 888 else f(index)=value write(*,*)index ,index, now ,value endif call vflush() ! flush graphics buffers call color(7) call clear() call color(0) call vflush() ! flush graphics buffers enddo INFINITE 999 continue call vflush() ! flush graphics buffers call vexit() ! close up plot package stop end program demo_graph
Based on [LONGLIB93.SOURCES.FORTRAN.MASTER]graph.FOR
| ! | WRITTEN: Version 1.0 SEPT. 1987 - DGL Version 2.0 20-JAN-1994 17:13:12.80 Version 3.0 Wed Jun 12 10:34:11 MDT 1996 |
| Nemo Release 3.1 | graph (3) | July 22, 2023 |


SNAKE EYES A film review by Steve Rhodes Copyright 1998 Steve Rhodes RATING (0 TO ****): *
Brian De Palma's SNAKE EYES stars Nicolas Cage's evil twin, who confusingly uses the same stage name as his talented brother. Like a foreign tourist who screams his lines in English to ensure that he will be understood, Cage yells with the ferocity of a man with a bad case of caffeine overload.
De Palma, whose last great film, THE UNTOUCHABLES, was crafted over a decade ago seems to have lost his magic. In SNAKE EYES, he manages to elicit some of the worst performances possible out of a skilled cast. Only Gary Sinise rises slightly above the hackneyed material. The rest of the actors become caricatures in this by-the-numbers thriller.
Ryuichi Sakamoto's atmospheric and melodramatic music dominates almost every scene. Heavy on the long violin notes, its rhythm is punctuated by thunder. (The script by De Palma and LOST WORLD's David Koepp sets the action during a hurricane in an attempt to pump up the adrenaline level and the noise. Only the latter is achieved.)
Cage plays Rick Santoro, a corrupt Atlantic City cop who shakes down criminals to get betting money. The movie takes place over a single evening when a world championship fight is being held.  Spouting cliched and ridiculous dialog, he screams such lines as, "I was made for the sewer, Baby!" Actually the line is more apropos for the movie as a whole.
Sinise plays Kevin Dunne, a naval officer who is in charge of the security for the Secretary of the Navy, who has come to watch the fight. But most people in the film are not who they seem to be, and the thin script makes all of them easy to guess.
The plot, which is told in endless flashbacks, concerns the assassination of the secretary through a scheme set up by some malevolent businessmen – that adjective is, of course, redundant in Hollywood thrillers. The flashbacks become repetitious with the same scene shown again and again, sometimes from a different perspective and sometimes not. Although a Brian De Palma film requires a certain amount of gratuitous violence, this one is remarkably tame for the man who became famous when he made CARRIE.
The movie's outline has some promise, but the movie itself is leaden. The film takes itself all too seriously. At best, it is a 1940s-style B movie. A little humor would have helped the script some, but a complete rewrite would have been better. And, although I hate to say it, a different director would have been the biggest improvement.
SNAKE EYES runs 1:39. It is rated R for violence and would be acceptable for teenagers.
Email<EMAIL_ADDRESS>Web: www.InternetReviews.com
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


Welcome to my site!
I’m an Applied Research Scientist at the Allen Institute for Artificial Intelligence (AI2) in Seattle. I just started so nothing to show yet!
I graduated in 2015 with an MS in Statistics from the University of Washington. Before that, I spent some time as a research assistant at the Institute of Mathematics - Academia Sinica in Taipei and a couple years as a statistician at CDK Global.
You can find examples of some of my work on Github.
I also jointly run a working group with some of my friends from the UW Statistics department. We’re currently interested in reinforcement learning and bandit problems, and you can find some of our code on Github.
Outside of work, I like playing tennis, watching movies, and playing video/tabletop games.
You can contact me at kyleclo-at-uw-dot-edu or on LinkedIn.


Welcome to the Mineral Fish Website!
A website about Mineral Fish.
The Map
A blue dot indicates that that is the Mifernian Republic.


|
IoTivity-Lite
|
Optional group of functions OCF server support. More...
Modules | |
| Collection Support | |
| Optional group of functions to support OCF compliant collections. | |
Typedefs | |
| typedef void(* | oc_con_write_cb_t) (size_t device_index, oc_rep_t *rep) |
| Callback for change notifications from the oic.wk.con resource. More... | |
Functions | |
| bool | oc_add_resource (oc_resource_t *resource) |
| Add a resource to the IoTivity stack. More... | |
| void | oc_delayed_delete_resource (oc_resource_t *resource) |
| Schedule a callback to remove a resource. More... | |
| bool | oc_delete_resource (oc_resource_t *resource) |
| Remove a resource from the IoTivity stack and delete the resource. More... | |
| void | oc_device_bind_resource_type (size_t device, const char *type) |
Add a Resource Type "rt" property to the an /oic/d resource. More... | |
| bool | oc_get_diagnostic_message (oc_client_response_t *response, const char **msg, size_t *size) |
| retrieve the diagnostic payload from a response More... | |
| int | oc_get_query_value (oc_request_t *request, const char *key, char **value) |
| Get a pointer to the start of the value in a URL query parameter key=value pair. More... | |
| bool | oc_get_request_payload_raw (oc_request_t *request, const uint8_t **payload, size_t *size, oc_content_format_t *content_format) |
| retrieve the payload from the request, no processing More... | |
| bool | oc_get_response_payload_raw (oc_client_response_t *response, const uint8_t **payload, size_t *size, oc_content_format_t *content_format) |
| retrieve the response payload, without processing More... | |
| void | oc_ignore_request (oc_request_t *request) |
| Ignore the request. More... | |
| void | oc_indicate_separate_response (oc_request_t *request, oc_separate_response_t *response) |
| Respond to an incoming request asynchronously. More... | |
| void | oc_init_query_iterator (void) |
| This resets the query iterator to the start of the URI query parameter. More... | |
| int | oc_iterate_query (oc_request_t *request, char **key, size_t *key_len, char **value, size_t *value_len) |
| Iterate through the URI query parameters and get each key=value pair. More... | |
| bool | oc_iterate_query_get_values (oc_request_t *request, const char *key, char **value, int *value_len) |
| Iterate though the URI query parameters for a specific key. More... | |
| oc_resource_t * | oc_new_resource (const char *name, const char *uri, uint8_t num_resource_types, size_t device) |
| Allocate and populate a new oc_resource_t. More... | |
| int | oc_notify_observers (oc_resource_t *resource) |
| Notify all observers of a change to a given resource's property. More... | |
| void | oc_process_baseline_interface (oc_resource_t *resource) |
| Helper function used when responding to a GET request to add Common Properties to a GET response. More... | |
| int | oc_query_value_exists (oc_request_t *request, const char *key) |
| Checks if a query parameter 'key' exist in the URL query parameter. More... | |
| void | oc_resource_bind_resource_interface (oc_resource_t *resource, oc_interface_mask_t iface_mask) |
| Add the supported interface(s) to the resource. More... | |
| void | oc_resource_bind_resource_type (oc_resource_t *resource, const char *type) |
| Add a Resource Type "rt" property to the resource. More... | |
| void | oc_resource_make_public (oc_resource_t *resource) |
| Expose unsecured coap:// endpoints (in addition to secured coaps:// endpoints) for this resource in /oic/res. More... | |
| void | oc_resource_set_default_interface (oc_resource_t *resource, oc_interface_mask_t iface_mask) |
| Select the default interface. More... | |
| void | oc_resource_set_discoverable (oc_resource_t *resource, bool state) |
| Specify if a resource can be found using OCF discover mechanisms. More... | |
| void | oc_resource_set_observable (oc_resource_t *resource, bool state) |
| Specify that a resource should notify clients when a property has been modified. More... | |
| void | oc_resource_set_periodic_observable (oc_resource_t *resource, uint16_t seconds) |
| The resource will periodically notify observing clients of is property values. More... | |
| void | oc_resource_set_properties_cbs (oc_resource_t *resource, oc_get_properties_cb_t get_properties, void *get_props_user_data, oc_set_properties_cb_t set_properties, void *set_props_user_data) |
| sets the callback properties for set properties and get properties More... | |
| void | oc_resource_set_request_handler (oc_resource_t *resource, oc_method_t method, oc_request_callback_t callback, void *user_data) |
| Specify a request_callback for GET, PUT, POST, and DELETE methods. More... | |
| void | oc_resource_tag_func_desc (oc_resource_t *resource, oc_enum_t func) |
| Sets the tag value for the relatvie position "tag_func_rel" tag. More... | |
| void | oc_resource_tag_locn (oc_resource_t *resource, oc_enum_t locn) |
| sets the value of the "tag_locn" tag More... | |
| void | oc_resource_tag_pos_desc (oc_resource_t *resource, oc_pos_description_t pos) |
| Sets the tag value for tag "tag-pos-desc" on the resource. More... | |
| void | oc_resource_tag_pos_rel (oc_resource_t *resource, double x, double y, double z) |
| Sets the value for the relative position "tag-pos-rel" tag. More... | |
| void | oc_send_diagnostic_message (oc_request_t *request, const char *msg, size_t msg_len, oc_status_t response_code) |
| send a diagnostic payload More... | |
| void | oc_send_response (oc_request_t *request, oc_status_t response_code) |
| Called after the response to a GET, PUT, POST or DELETE call has been prepared completed. More... | |
| void | oc_send_response_raw (oc_request_t *request, const uint8_t *payload, size_t size, oc_content_format_t content_format, oc_status_t response_code) |
| send the request, no processing More... | |
| void | oc_send_separate_response (oc_separate_response_t *handle, oc_status_t response_code) |
| Called to send the deferred response to a GET, PUT, POST or DELETE request. More... | |
| void | oc_set_con_write_cb (oc_con_write_cb_t callback) |
Sets the callback to receive change notifications for the oic.wk.con resource. More... | |
| void | oc_set_separate_response_buffer (oc_separate_response_t *handle) |
| Set a response buffer for holding the response payload. More... | |
Optional group of functions OCF server support.
| typedef void(* oc_con_write_cb_t) (size_t device_index, oc_rep_t *rep) |
Callback for change notifications from the oic.wk.con resource.
This callback is invoked to notify a change of one or more properties on the oic.wk.con resource. The rep
parameter contains all properties, the function is not invoked for each property.
When the function is invoked, all properties handled by the stack are already updated. The callee can use the invocation to optionally store the new values persistently.
Once the callback returns, the response will be sent to the client and observers will be notified.
| device_index | index of the device to which the change was applied, 0 is the first device |
| rep | list of properties and their new values |
| bool oc_add_resource | ( | oc_resource_t * | resource | ) |
Add a resource to the IoTivity stack.
The resource will be validated then added to the stack.
| [in] | resource | the resource to add to the stack |
| void oc_delayed_delete_resource | ( | oc_resource_t * | resource | ) |
Schedule a callback to remove a resource.
| [in] | resource | the resource to delete |
| bool oc_delete_resource | ( | oc_resource_t * | resource | ) |
Remove a resource from the IoTivity stack and delete the resource.
Any resource observers will automatically be removed.
This will free the memory associated with the resource.
| [in] | resource | the resource to delete |
| void oc_device_bind_resource_type | ( | size_t | device, |
| const char * | type | ||
| ) |
Add a Resource Type "rt" property to the an /oic/d
resource.
This function can be used to bind a new Resource Type to a logical device's /oic/d
resource.
| [in] | device | index of a logical device |
| [in] | type | the Resource type to add to the Resource Type "rt" property |
| bool oc_get_diagnostic_message | ( | oc_client_response_t * | response, |
| const char ** | msg, | ||
| size_t * | size | ||
| ) |
retrieve the diagnostic payload from a response
| response | the response to get the diagnostic payload from |
| msg | the diagnotic payload |
| size | the size of the diagnostic payload |
| int oc_get_query_value | ( | oc_request_t * | request, |
| const char * | key, | ||
| char ** | value | ||
| ) |
Get a pointer to the start of the value in a URL query parameter key=value pair.
| [in] | request | the oc_request_t that contains the query parameters |
| [in] | key | the key being searched for |
| [out] | value | pointer to the value string assigned to the key |
-1
if there are no additional query parameters | bool oc_get_request_payload_raw | ( | oc_request_t * | request, |
| const uint8_t ** | payload, | ||
| size_t * | size, | ||
| oc_content_format_t * | content_format | ||
| ) |
retrieve the payload from the request, no processing
| request | the request |
| payload | the payload of the request |
| size | the size in bytes of the payload |
| content_format | the content format of the payload |
| bool oc_get_response_payload_raw | ( | oc_client_response_t * | response, |
| const uint8_t ** | payload, | ||
| size_t * | size, | ||
| oc_content_format_t * | content_format | ||
| ) |
retrieve the response payload, without processing
| response | the response |
| payload | the payload of the response |
| size | the size of the payload |
| content_format | the content format of the payload |
| void oc_ignore_request | ( | oc_request_t * | request | ) |
Ignore the request.
The GET, PUT, POST or DELETE requests can be ignored. For example a oc_request_callback_t may only want to respond to multicast requests. Thus any request that is not over multicast endpoint could be ignored.
Using oc_ignore(request)
is preferred over oc_send_response(request, OC_IGNORE)
since it does not attempt to fill the response buffer before sending the response.
| [in] | request | the request being responded to |
| void oc_indicate_separate_response | ( | oc_request_t * | request, |
| oc_separate_response_t * | response | ||
| ) |
Respond to an incoming request asynchronously.
If for some reason the response to a request would take a long time or is not immediately available, then this function may be used defer responding to the request.
Example:
| [in] | request | the request that will be responded to as a separate response |
| [in] | response | instance of an internal struct that is used to track the state of the separate response. |
| void oc_init_query_iterator | ( | void | ) |
This resets the query iterator to the start of the URI query parameter.
This is used together with oc_iterate_query_get_values() or oc_iterate_query() to iterate through query parameter of a URI that are part of an oc_request_t
| int oc_iterate_query | ( | oc_request_t * | request, |
| char ** | key, | ||
| size_t * | key_len, | ||
| char ** | value, | ||
| size_t * | value_len | ||
| ) |
Iterate through the URI query parameters and get each key=value pair.
Before calling oc_iterate_query() the first time oc_init_query_iterator() must be called to reset the query iterator to the first query parameter.
Example:
| [in] | request | the oc_request_t that contains the query parameters |
| [out] | key | pointer to the location of the the key of the key=value pair |
| [out] | key_len | the lenght of the key string |
| [out] | value | pointer the location of the value string assigned to the key=value pair |
| [out] | value_len | the length of the value string |
-1
if there are no additional query parameters | bool oc_iterate_query_get_values | ( | oc_request_t * | request, |
| const char * | key, | ||
| char ** | value, | ||
| int * | value_len | ||
| ) |
Iterate though the URI query parameters for a specific key.
Before calling oc_iterate_query_get_values() the first time oc_init_query_iterator() must be called to reset the query iterator to the first query parameter.
Example:
| [in] | request | the oc_request_t that contains the query parameters |
| [in] | key | the key being searched for |
| [out] | value | pointer to the value string for to the key=value pair |
| [out] | value_len | the length of the value string |
| oc_resource_t* oc_new_resource | ( | const char * | name, |
| const char * | uri, | ||
| uint8_t | num_resource_types, | ||
| size_t | device | ||
| ) |
Allocate and populate a new oc_resource_t.
Resources are the primary interface between code and real world devices.
Each resource has a Uniform Resource Identifier (URI) that identifies it. All resources must specify one or more Resource Types to be considered a valid resource. The number of Resource Types is specified by the num_resource_types
the actual Resource Types are added later using the oc_resource_bind_resource_type() function.
The resource is populated with a default interface OC_IF_BASELINE.
Many properties associated with a resource are set or modified after the new resource has been created.
The resource is not added to the device till oc_add_resource() is called.
Example:
| [in] | name | the name of the new resource this will set the property n |
| [in] | uri | the Uniform Resource Identifier for the resource |
| [in] | num_resource_types | the number of Resource Types that will be added/bound to the resource |
| [in] | device | index of the logical device the resource will be added to |
| int oc_notify_observers | ( | oc_resource_t * | resource | ) |
Notify all observers of a change to a given resource's property.
| [in] | resource | the oc_resource_t that has a modified property |
0
on failure could also mean no registered observers | void oc_process_baseline_interface | ( | oc_resource_t * | resource | ) |
Helper function used when responding to a GET request to add Common Properties to a GET response.
This add Common Properties name ("n"), Interface ("if"), and Resource Type ("rt") to a GET response.
Example:
| [in] | resource | the resource the baseline Common Properties will be read from to respond to the GET request |
| int oc_query_value_exists | ( | oc_request_t * | request, |
| const char * | key | ||
| ) |
Checks if a query parameter 'key' exist in the URL query parameter.
| [in] | request | the oc_request_t that contains the query parameters |
| [in] | key | the key being searched for |
| void oc_resource_bind_resource_interface | ( | oc_resource_t * | resource, |
| oc_interface_mask_t | iface_mask | ||
| ) |
Add the supported interface(s) to the resource.
Resource interfaces specify how the code is able to interact with the resource
The iface_mask
is bitwise OR of the following interfaces:
OC_IF_BASELINE
("oic.if.baseline") baseline interface allow GET, PUT/POST, and notify/observe operations.OC_IF_LL
("oic.if.ll") The links list interface is a specifically designed to provide a list of links pointing to other resources. Links list interfaces allow GET, and notify/observe operations.OC_IF_B
("oic.if.b") batch interface. The batch interface is used to interact with a collection of resources at the same time.OC_IF_R
("oic.if.r") a read-only interface. A read-only interface allows GET, and notify/observe operations.OC_IF_RW
("oir.if.rw") a read-write interface. A read-write interface allows GET, PUT/POST, and notify/observe operations.OC_IF_A
("oic.if.a") an actuator interface. An actuator interface allows GET, PUT/POST, and notify/observe operations.OC_IF_S
("oic.if.s") a sensor interface. A sensor interface allows GET, and notify/observe operations.OC_IC_CREATE
("oic.if.create") used to create new resources in a collection.The read-write and actuator interfaces are very similar and sometimes hard to differentiate when one should be used over another. In general an actuator interface is used when it modifies the real world value. e.g. turn on light, increase temperature, open vent.
The read-only and sensor are also very similar in general a sensor value is read directly or indirectly from a real world sensor.
| [in] | resource | the resource that the interface(s) will be added to |
| [in] | iface_mask | a bitwise ORed list of all interfaces supported by the resource. |
| void oc_resource_bind_resource_type | ( | oc_resource_t * | resource, |
| const char * | type | ||
| ) |
Add a Resource Type "rt" property to the resource.
All resources require at least one Resource Type. The number of Resource Types the resource contains is declared when the resource it created using oc_new_resource() function.
Resource Types use a dot "." naming scheme e.g. oic.r.switch.binary
. Resource Types starting with oic
are reserved for a OCF defined Resource Types. Developers are strongly encouraged to try and use an OCF defined Resource Type vs. creating their own. A repository of OCF defined resources can be found on oneiota.org.
Multi-value "rt" Resource means a resource with multiple Resource Types. i.e. oc_resource_bind_resource_type() is called multiple times for a single resource. When using a Mulit-value Resource the different resources properties must not conflict.
| [in] | resource | the resource that the Resource Type will be set on |
| [in] | type | the Resource Type to add to the Resource Type "rt" property |
| void oc_resource_make_public | ( | oc_resource_t * | resource | ) |
Expose unsecured coap:// endpoints (in addition to secured coaps:// endpoints) for this resource in /oic/res.
| [in] | resource | the resource to make public |
| void oc_resource_set_default_interface | ( | oc_resource_t * | resource, |
| oc_interface_mask_t | iface_mask | ||
| ) |
Select the default interface.
The default interface must be one of the resources specified in the oc_resource_bind_resource_interface() function.
If a request to the resource comes in and the interface is not specified then the default interface will be used to service the request.
If the default interface is not set then the OC_IF_BASELINE will be used by the stack.
| [in] | resource | the resource that the default interface will be set on |
| [in] | iface_mask | a single interface that will will be used as the default interface |
| void oc_resource_set_discoverable | ( | oc_resource_t * | resource, |
| bool | state | ||
| ) |
Specify if a resource can be found using OCF discover mechanisms.
| [in] | resource | to specify as discoverable or non-discoverable |
| [in] | state | if true the resource will be discoverable if false the resource will be non-discoverable |
| void oc_resource_set_observable | ( | oc_resource_t * | resource, |
| bool | state | ||
| ) |
Specify that a resource should notify clients when a property has been modified.
| [in] | resource | the resource to specify the observability |
| [in] | state | true to make resource observable, false to make resource unobservable |
| void oc_resource_set_periodic_observable | ( | oc_resource_t * | resource, |
| uint16_t | seconds | ||
| ) |
The resource will periodically notify observing clients of is property values.
The oc_resource_set_observable() function can be used to turn off a periodic observable resource.
Setting a seconds
frequency of zero 0
is invalid and will result in an invalid resource.
| [in] | resource | the resource to specify the periodic observability |
| [in] | seconds | the frequency in seconds that the resource will send out an notification of is property values. |
| void oc_resource_set_properties_cbs | ( | oc_resource_t * | resource, |
| oc_get_properties_cb_t | get_properties, | ||
| void * | get_props_user_data, | ||
| oc_set_properties_cb_t | set_properties, | ||
| void * | set_props_user_data | ||
| ) |
sets the callback properties for set properties and get properties
| resource | the resource for the callback data |
| get_properties | callback function for retrieving the properties |
| get_props_user_data | the user data for the get_properties callback function |
| set_properties | callback function for setting the properties |
| set_props_user_data | the user data for the set_properties callback function |
| void oc_resource_set_request_handler | ( | oc_resource_t * | resource, |
| oc_method_t | method, | ||
| oc_request_callback_t | callback, | ||
| void * | user_data | ||
| ) |
Specify a request_callback for GET, PUT, POST, and DELETE methods.
All resources must provide at least one request handler to be a valid resource.
method types:
OC_GET
the oc_request_callback_t
is responsible for returning the current value of all of the resource properties.OC_PUT
the oc_request_callback_t
is responsible for updating one or more of the resource properties.OC_POST
the oc_request_callback_t
is responsible for updating one or more of the resource properties. The callback may also be responsible for creating new resources.OC_DELETE
the oc_request_callback_t
is responsible for deleting a resource| [in] | resource | the resource the callback handler will be registered to |
| [in] | method | specify if type method the callback is responsible for handling |
| [in] | callback | the callback handler that will be invoked when a the method is called on the resource. |
| [in] | user_data | context pointer that is passed to the oc_request_callback_t. The pointer must remain valid as long as the resource exists. |
| void oc_resource_tag_func_desc | ( | oc_resource_t * | resource, |
| oc_enum_t | func | ||
| ) |
Sets the tag value for the relatvie position "tag_func_rel" tag.
| resource | the resource to apply the tag too. |
| func | the function description |
| void oc_resource_tag_locn | ( | oc_resource_t * | resource, |
| oc_enum_t | locn | ||
| ) |
sets the value of the "tag_locn" tag
| resource | the resource to apply the tag too. |
| locn | the location |
| void oc_resource_tag_pos_desc | ( | oc_resource_t * | resource, |
| oc_pos_description_t | pos | ||
| ) |
Sets the tag value for tag "tag-pos-desc" on the resource.
| resource | the resource |
| pos | the descriptive text for the tag |
| void oc_resource_tag_pos_rel | ( | oc_resource_t * | resource, |
| double | x, | ||
| double | y, | ||
| double | z | ||
| ) |
Sets the value for the relative position "tag-pos-rel" tag.
| resource | the resource to apply the tag too. |
| x | the x value in 3D space |
| y | the y value in 3D space |
| z | the z value in 3D space |
| void oc_send_diagnostic_message | ( | oc_request_t * | request, |
| const char * | msg, | ||
| size_t | msg_len, | ||
| oc_status_t | response_code | ||
| ) |
send a diagnostic payload
| request | the request |
| msg | the message in ascii |
| msg_len | the lenght of the message |
| response_code | the coap response code |
| void oc_send_response | ( | oc_request_t * | request, |
| oc_status_t | response_code | ||
| ) |
Called after the response to a GET, PUT, POST or DELETE call has been prepared completed.
The function oc_send_response is called at the end of a oc_request_callback_t to inform the caller about the status of the requested action.
| [in] | request | the request being responded to |
| [in] | response_code | the status of the response |
| void oc_send_response_raw | ( | oc_request_t * | request, |
| const uint8_t * | payload, | ||
| size_t | size, | ||
| oc_content_format_t | content_format, | ||
| oc_status_t | response_code | ||
| ) |
send the request, no processing
| request | the request to send |
| payload | the payload for the request |
| size | the payload size |
| content_format | the content format |
| response_code | the response code to send |
| void oc_send_separate_response | ( | oc_separate_response_t * | handle, |
| oc_status_t | response_code | ||
| ) |
Called to send the deferred response to a GET, PUT, POST or DELETE request.
The function oc_send_separate_response is called to initiate transfer of the response.
| [in] | handle | instance of the internal struct that was passed to oc_indicate_separate_response() |
| [in] | response_code | the status of the response |
| void oc_set_con_write_cb | ( | oc_con_write_cb_t | callback | ) |
Sets the callback to receive change notifications for the oic.wk.con
resource.
The function can be used to set or unset the callback. Whenever an attribute of the oic.wk.con
resource is changed, the callback will be invoked.
| callback | The callback to register or NULL to unset it. If the function is invoked a second time, then the previously set callback is simply replaced. |
| void oc_set_separate_response_buffer | ( | oc_separate_response_t * | handle | ) |
Set a response buffer for holding the response payload.
When a deferred response is ready, pass in the same oc_separate_response_t
that was handed to oc_indicate_separate_response() for delaying the initial response.
| [in] | handle | instance of the oc_separate_response_t that was passed to the oc_indicate_separate_response() function |


Learning to program at Epicodus
Education: I have an undergraduate degree in mathematics from U.C. Berkeley. I also hold a master's degree and teaching credential in mathematics education from Claremont Graduate University.
Career: I started teaching right out of college and have worked in a variety of environments. I've taught both high school and middle school, at public and private institutions, and in the cities of LA, Oakland, and Seattle.
Future: I am taking a course on programming as a stepping stone to a change in career. I enjoy learning new things and thinking through challenging problems. I'd say, so far so good!


{% extends "layout_argleton.html" %}
{% block page_title %}
Argleton County Council - Apply for an older person's bus pass in Argleton
{% endblock %}
{% block content %}
Enter your date of birth
Warning
You will need to provide proof of age to Argleton council.


--- layout: post date: 2012-03-01 time: "10:00:00" authors: ["Greg Wilson"] title: "Toronto Bootcamp February 2012: How We Did" tags: ["Assessment", "University of Toronto"] ---
Last week's bootcamp at the University of Toronto was not the most successful one we've ever done: quite a few registrants didn't show up, and based on feedback from the instructors, we tried to cover too much, too fast. That said, the learners who stuck with us all the way through to Friday afternoon came away knowing a lot of useful things (or at least knowing that those things existed). We'll gear back a bit for next week's workshop at Indiana U. and see how that goes.


2048
Current Score: {{ ctrl.game.currentScore }}
High Score: {{ ctrl.game.highScore }}
Game over
Try again
You win!
Continue


{% extends "main/base.html" %} {% block title %}Code Jams | Thanks!{% endblock %} {% block og_title %}Code Jams | Thanks!{% endblock %} {% block content %}
Thanks for your application! Just sit back, relax, and we'll let you know whether you've been selected for this code jam when the time comes.
Back to all code jams


| Board232 Project Status | |||
| Project File: | hw3_part_2.xise | Parser Errors: | No Errors |
| Module Name: | Board232 | Implementation State: | New |
| Target Device: | xc3s250e-5cp132 |
|
|
| Product Version: | ISE 12.4 |
|
|
| Design Goal: | Balanced |
|
|
| Design Strategy: | Xilinx Default (unlocked) |
|
|
| Environment: |
|
| Detailed Reports | [-] | |||||
| Report Name | Status | Generated | Errors | Warnings | Infos | |
| Synthesis Report | ||||||
| Translation Report | ||||||
| Map Report | ||||||
| Place and Route Report | ||||||
| Power Report | ||||||
| Post-PAR Static Timing Report | ||||||
| Bitgen Report |
| Secondary Reports | [-] | ||
| Report Name | Status | Generated |


STEP [expr]
Description
Sets the step value for a FOR loop.
Results
Overrides the default step value in a FOR loop with [expr]. Note: if DOWNTO is used, make sure that [expr] is a negative value.
Example
; sum the odd numbers from 1 to 100 sum = 0 for x = 1 to 100 step 2 sum = sum + x next
Back to Keywords


For being part of this special moment on Jennifer and Ringo's Lives We will be updating the site for anything new, But please continue to tag photos with #rinjenph and share those wonderful memories with us.


--- title: fundamentalRegion sidebar: function_reference_sidebar permalink: symmetry.fundamentalRegion.html folder: function_reference toc: false ---
fundamental region in orientation space for a (pair) of symmetries
| cs,cs1,cs2 | symmetry |
| oR | orientationRegion |
| dc | symmetry intersection between cs1 and cs2 |
| nSym | number of disjoined symmetry elements in cs2 * cs1 |
| antipodal | grain exchange symmetry, i.e., mori == inv(mori) |
| LaueGroup | consider only Laue groups (default) |
| pointGroup | consider point groups |


Reported by Sucuri, the HD FLV Player suffers of an Arbitrary File Download vulnerability which is of course considered critical.
The vulnerable code can be found in download.php
:
<?php
$filename = $_GET['f'];
header('Content-disposition: attachment; filename='.basename($filename));
readfile($filename);
?>
Since there is absolutly no check nor filter applied before using the f
parameter passed in the url, this is the perfect backdoor to get almost any file you want on the machine
(depending of the right of the user the server is running). No matter the plugin is enable or not, you simply need to run the install to be exposed.
Here is a POC on my local Wordpress (same result might append with Joomla):
The wierd thing is that the Wordpress and Joomla plugins have been patched but not the archive on HD FLV Player official website, leaving custom installations vulnerable.
Note: As Sucuri said, email.php
should be considered too but the vulnerability is little more tricky.


Visualizing
Climate Change
give some caption
Introduction
Disasters in the US
The COP inspector
Sea Level Increase
Team
Charunethran PG
Maruti D
Pranav Pai


Directories | |
| directory | audio |
| directory | collisions |
| directory | devices |
| directory | display |
| directory | effects |
| directory | files |
| directory | forces |
| directory | graphics |
| directory | lighting |
| directory | materials |
| directory | math |
| directory | resources |
| directory | shaders |
| directory | system |
| directory | timers |
| directory | tools |
| directory | widgets |
| directory | world |
Files | |
| file | chai3d.h [code] |
| CHAI3D main header file. | |


SMD (SOT-23) 3.3v Voltage Regulator 250 mA - VS332
Summary
Name: SMD (SOT-23) 3.3v Voltage Regulator 250 mA
ID: VREG-SO23-X-V33D-AD
Hex ID: VS332
WebPage: https://github.com/oomlout/oomlout-OOMP/wiki/VREG-SO23-X-V33D-AD
Short URL: http://oom.lt/VS332
Revision History: https://github.com/oomlout/oomlout-OOMP/blob/master/parts/VREG-SO23-X-V33D-AD/
| Type |
Size |
Color |
Description |
Index |
VREG Voltage Regulator |
SO23 SMD (SOT-23) |
X
|
V33D 3.3v |
AD 250 mA |
Images
About
This part is awaiting a description.
Specifications
| Info |
Value |
| Type |
Voltage Regulator |
| Size |
SMD (SOT-23) |
| Description |
3.3v |
| Index |
250 mA |
| Package Marking |
662S |
Extra Details
Spotted a mistake, want to add more? Let us know<EMAIL_ADDRESS>All images and resources are licensed [CC BY-SA] unless otherwise stated (ie. the datasheets)