Lake Placid 1/2
Rated on a 4-star scale Screening venue: Odeon (Manchester City Centre) Released in the UK by Fox on March 31, 2000; certificate 15; 82 minutes; country of origin USA; aspect ratio 2.35:1
Directed by Steve Miner; produced by David E. Kelley, Michael Pressman. Written by David E. Kelley. Photographed by Daryn Okada; edited by Marshall Harvey.
CAST..... Bridget Fonda..... Kelly Scott Bill Pullman..... Jack Wells Oliver Platt..... Hector Cyr Brendan Gleeson..... Sheriff Keough Betty White..... Mrs. Bickerman Meredith Salenger..... Deputy Sharon Gare
Our brains need a constant level of the chemical dopamine to stay alert. That's why people can become addicted to smoking -- nicotine gets them used to a dopamine high which their brains have trouble functioning without. I am a non-smoker, but now I have found a movie that made me need a cigarette, by deadening my brain with its unrelenting dullness.
I would have settled for some popcorn, actually, or even a bag of Jelly Babies. Anything to perk me up. But once I'm in the auditorium, the lights go down and the film starts, I always stay put. Trapped, in this case. Agonised. "Lake Placid" runs only 82 minutes and yet feels interminable. It's one of the year's worst films.
It's a monster movie, I guess, although the villain is just a big crocodile who rips people to shreds in a large stretch of water in Maine. For no significant reason, museum researcher Kelly Scott (Bridget Fonda) is sent by her boss to investigate the situation, joining wildlife experts Jack Wells (Bill Pullman) and Hector Cyr (Oliver Platt), and grumpy local cop Sheriff Keough (Brendan Gleeson).
The plot is a silly routine of people venturing into the water, getting munched by the big croc and our heroes solemnly trying to conjure a solution. Gleeson snarls over every development with a phoney New England accent.  And Fonda shrieks and jumps, as attractive airhead heroines are supposed to do in cheesy B-pictures such as this.
Steve Miner, the director of the film, and David E. Kelley, who wrote and produced, clearly think they've made a movie that is so bad it's good.  It contains neither the silly sincerity that makes cheap horror flicks laughable nor the entertaining cheese of films like "Whatever Happened to Harold Smith?", because the filmmakers don't have the courage to go over-the-top -- something that is absolutely necessary to achieve their goal. Most disastrously, there are ironic wisecracks in the dialogue, just to remind us that the film is a comedy. It's as if Miner and Kelley knew their general approach wouldn't work, and so threw in all the comic material they could think up, just to be on the safe side.
 But the film is not funny or hip, it's a miserable waste of time. Even its actors look sluggish and depressed. Unlike us, they got paid to show up.
COPYRIGHT(c) 2000 Ian Waldron-Mantgani http://members.aol.com/ukcritic
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


- abort() - Method in class com.nuix.superutilities.cases.CaseLockedEventInfo
-
- abort() - Method in class com.nuix.superutilities.cases.CaseOpenErrorEvent
-
- abort() - Method in class com.nuix.superutilities.cases.WorkFunctionErrorEvent
-
- abortScan() - Method in class com.nuix.superutilities.regex.RegexScanner
-
When running a scan by providing a Consumer callback, this will signal
that further scanning should be aborted.
- acceptCase(Case, CaseInfo, int, int) - Method in interface com.nuix.superutilities.cases.CaseConsumer
-
- addAllBuiltInEntities() - Method in class com.nuix.superutilities.namedentities.NamedEntityRedactionSettings
-
Adds the names of all the built-in entities as of Nuix 7.8:
company, country, credit-card-num, email, ip-address, money, person, personal-id-num, url and phone-number
- addCaseDirectory(File) - Method in class com.nuix.superutilities.cases.BulkCaseProcessor
-
Adds a case directory to be iterated.
- addCaseDirectory(String) - Method in class com.nuix.superutilities.cases.BulkCaseProcessor
-
Adds a case directory to be iterated.
- addColCriterion(NamedQuery) - Method in class com.nuix.superutilities.reporting.IntersectionReportSheetConfiguration
-
Adds a single
NamedQuery
to the list of primary column criteria.
- addColCriterion(String, String) - Method in class com.nuix.superutilities.reporting.IntersectionReportSheetConfiguration
-
Adds a single
NamedQuery
, constructed from the provided arguments, to the list of primary column criteria.
- addColor(int, int, int) - Method in class com.nuix.superutilities.reporting.ColorRing
-
- addEntityNames(Collection<String>) - Method in class com.nuix.superutilities.namedentities.NamedEntityRedactionSettings
-
Adds entity names to this instance.
- addExpression(String) - Method in class com.nuix.superutilities.annotations.BulkRedactorSettings
-
Adds a regular expression to the list of expressions used to locate text to markup.
- addMatch(PatternInfo, String, boolean, String, String, int, int) - Method in class com.nuix.superutilities.regex.ItemRegexMatchCollection
-
Adds a match to this instance.
- addMonitoredLocation(String, double) - Method in class com.nuix.superutilities.misc.FreeSpaceMonitor
-
Adds a location to be monitored
- addNamedEntity(String) - Method in class com.nuix.superutilities.annotations.BulkRedactorSettings
-
Adds a named entity type to the list of types to be redacted.
- addPattern(String, String) - Method in class com.nuix.superutilities.regex.RegexScanner
-
Adds a regular expression to be part of the scan with a given title.
- addPhrase(String) - Method in class com.nuix.superutilities.annotations.BulkRedactorSettings
-
Adds a phrase to the list of expressions used to find and markup text.
- addPhrases(Collection<String>) - Method in class com.nuix.superutilities.annotations.BulkRedactorSettings
-
Adds multiple phrases to the list of expressions used to find and markup text.
- addRowCriterion(NamedQuery) - Method in class com.nuix.superutilities.reporting.IntersectionReportSheetConfiguration
-
Adds a single
NamedQuery
to the list of row criteria.
- addRowCriterion(String, String) - Method in class com.nuix.superutilities.reporting.IntersectionReportSheetConfiguration
-
Adds a single
NamedQuery
, constructed from the provided arguments, to the list of row criteria.
- addScriptedValueGenerator(String, BiFunction<Case, String, Object>) - Method in class com.nuix.superutilities.reporting.IntersectionReportSheetConfiguration
-
- addTintSeries(Color, int) - Method in class com.nuix.superutilities.reporting.ColorRing
-
Adds the provided base color and series of tinted variations to this instance.
- AnnotationEvent - Class in com.nuix.superutilities.annotations
-
- AnnotationEvent() - Constructor for class com.nuix.superutilities.annotations.AnnotationEvent
-
- AnnotationHistoryRepository - Class in com.nuix.superutilities.annotations
-
Class for recording annotation in a source case and replaying on a destination case.
- AnnotationHistoryRepository(File) - Constructor for class com.nuix.superutilities.annotations.AnnotationHistoryRepository
-
Creates a new instance against the given and database file.
- AnnotationHistoryRepository(String) - Constructor for class com.nuix.superutilities.annotations.AnnotationHistoryRepository
-
Creates a new instance against the given and database file.
- AnnotationHistoryRepositorySummary - Class in com.nuix.superutilities.annotations
-
- AnnotationHistoryRepositorySummary() - Constructor for class com.nuix.superutilities.annotations.AnnotationHistoryRepositorySummary
-
- AnnotationSyncSettings - Class in com.nuix.superutilities.annotations
-
- AnnotationSyncSettings() - Constructor for class com.nuix.superutilities.annotations.AnnotationSyncSettings
-
- appendRow(List<Object>) - Method in class com.nuix.superutilities.reporting.SimpleWorksheet
-
- appendRow(List<Object>, Style) - Method in class com.nuix.superutilities.reporting.SimpleWorksheet
-
- applyHighlight(MarkupSet, Item) - Method in class com.nuix.superutilities.annotations.NuixImageAnnotationRegion
-
Applies a highlight based on the region defined by this instance.
- applyRedaction(MarkupSet, Item) - Method in class com.nuix.superutilities.annotations.NuixImageAnnotationRegion
-
Applies a redaction based on the region defined by this instance.
- AsposeCellsColorHelper - Class in com.nuix.superutilities.reporting
-
A class containing helper methods for working with Aspose Cells colors.
- AsposeCellsColorHelper() - Constructor for class com.nuix.superutilities.reporting.AsposeCellsColorHelper
-
- AsposeCellsStyleHelper - Class in com.nuix.superutilities.reporting
-
A class containing helper methods for working with Aspose Cells Styles.
- AsposeCellsStyleHelper() - Constructor for class com.nuix.superutilities.reporting.AsposeCellsStyleHelper
-
- autoFitColumns() - Method in class com.nuix.superutilities.reporting.SimpleWorksheet
-
- autoFitRow(int) - Method in class com.nuix.superutilities.reporting.SimpleWorksheet
-


Performance optimisation story
with Marcin Wawrzyniak and Ignacio Garcia
1
Quick roadmap
- The problem
- The opportunity
- Solutions
- Future improvements
2 / 21
The problem
The problem is that when the page takes long to load, bounce rate goes up and user satisfaction drops.
First bits of TR showed up after 11 seconds
3 / 21
The opportunity
A redesign of the homepage had to be done, so I asked Ignacio if we could tune up things a little bit...
he said...
4 / 21
* Nacho Libre (2006) IMDB
5 / 21
Problem #1 Too much blocking assets on page load
We loaded a lot of stuff before user could see the page
-
- Blocking (synchronous) JavaScript in head (inline or src)
- Blocking (synchronous) JavaScript in body, placed randomly (inline or src)
- YUI ?
- jQuery ?
- Analytics ?
- Optimizely ?
- IPC includes ?
- Facebook connect?
- Post.it ?
Everytime the tokenizer gets into the <script> tag (without async or defer), it stops
everything, fetches the resource and/or parses the script - then it continues.
6 / 21
The solutions
Minify and concatenate assets to make less requests
Using sfCombine Plugin and YUI Compressor
We load less stuff before the user sees the page using defer and async attributes.
- async >=IE9 - "A script that will be run
asynchronously as soon as it is available", without blocking DOM construction
- defer >=IE8 - "A script that will not run until
after the page has loaded"
7 / 21
Other optimisations we did
- We moved the rest of images to sprites = 5 requests saved
- Combined almost every CSS stylesheet we had = 3 requests saved
- We removed the CSS for print, in two places = 2 requests
- Removed duplicated scripts (facebook...) - are you sure you don't have any ? = 1x304 (Not Modified) saved
- Used trViewKit::jsSlot() -> moved all inline blocking JS to before body end - probably
big impact
- And of course, we made use of async, in three places, wow.
8 / 21
Results
Around 5 seconds of improvement
9 / 21
Problem #2 Complex DOM and huge CSS files
Using tools like Dom Monster and the Firefox 3D preview we could identify pages with complex markup and with too much nested levels
10 / 21
Firefox 3D view
Yeah, Firefox can do that...
Doing a refresh of the site was a good excuse to make a lighter DOM
11 / 21
Make a lighter CSS using SASS
We had a legacy CSS file that had rules for pretty much all sections of the site.
We started splitting things up in smaller CSS files, and section by section of the site. That means that these process could be done gradually.
We went from having a massive file with 1500 lines of CSS to one with 600 lines in it.
The results were really good, and much more than we expected so the site became 1.5 seconds faster
...and also we had a much better organised CSS structure. Things were under control again.
12 / 21
You can also improve the speed of CSS rendering avoiding:
Ancestors like
html div tr td {
...some css
}
Universal selectors like
* {
...some css
}
Github has a great presentation about this. We will provide the links at the end.
13 / 21
Problem #3 Loading things that we don´t need...yet!
Disqus was loading on every content page, but it appears pretty much at the end of it.
So we didn't load it on page load, but we activate it once the user scrolls to a certain position.
See it in action
14 / 21
In plans: 1/3
-
Sharded CDN (cookie-less) domains
- no cookie payload (8kB)
- more
parallel connections
- we would like to serve JS and CSS from static domains yet
15 / 21
In plans: 2/3
We would like to try lazy loading of images on the lists (Echo?)
- Usually out of viewport
- 37 requests to static.trustedreviews.com
- ... these requests delay onload
- ... we can also load image when user scrolls to it
- ... but sharded CDN can be the optimal solution here.
16 / 21
In plans: 3/3
- we would like to try localStorage, and keep there YUI and jquery, and large inline scripts (1kB+) - basket.js
17 / 21
Tips
AKAMAI
When you specify a vary header, other than: Vary: Accept-Encoding AKAMAI won't cache anything!
Other
Use CSS instead of images if possible - buttons? arrows? shadows? borders? gradient? transparency? (CSS Shack - Photoshop for CSS)
18 / 21
The thing is...
"It doesn't matter how fast your website is as long as it is faster than the competition"
19 / 21
Must read
Gone In 60 Frames Per Second: A Pinterest Paint Performance Case Study
Prioritize Your Critical CSS and Images to render site fast
* DevTools Tips and Tricks
* WebPerf Crash Course
Improving Web App Performance With the Chrome DevTools Timeline and Profiles
GitHub's CSS Performance
http://bit.do/trusted
* If you don't have a lot of time, pick these two.
20 / 21
Thanks and happy Valentine's day!
Questions and discussion...


Project One Decoding Cultures of Time-based Media
Description
In my final project I stressed on the elements of Studio Ghibli animation that included immersive realism, run cycle sequences, Fantasy and the coming of age medium.
The first thing every single Studio Ghibli film does is to establish the veracity of its world, even if that world is drastically different from our own. The distinct Ghibli style and the fervent attention to detail Miyazaki and his animators employ help to make even the most fantastical realms real, they create a tactile link to the world we already know, and allow us to make the imaginative leap while barely noticing the transition. It’s a fine balance and not one every storyteller can strike so directly every time (Horton and Horton, 2014).
The studio house’s style is never purely realistic nor fantastical and so I used time to be the main interaction element between the user and my sketch. The camera captures the movement of the user every minute and draws the growth of a flower that adds a petal every second. This resembles the element of immersive realism that strikes a difficult balance between fantasy and reality.
I used functions to create a constant loop for the growth of the flowers and create capture to capture the movements of the user. The flower grows up to one minute with up to 60 petals to represent each second.The addition of petals every second causes the flower to look like it’s growing and therefore establishes the action of blooming which contributes to the coming of age element in every Studio Ghibli film.
The story behind my sketch lies in the studio’s love for growth and the coming of age medium in which I used time to depict the growth and multiplication of the flowers.
Rather than focusing on recreating scenes from the studio with its visual elements and interaction dynamics, I've allowed the visual elements and interaction dynamics to inspire the project.
The studio takes the rules of our world and bend or break them however they wish. That’s part of the magic of animation. But to achieve a level of immersive realism, there must exist an underlying familiarity with the agents and the world where the story takes place. That familiarity comes from the details (Isbrucker, 2017).
The progress I’ve made with processing throughout each week helped me develop deeper insights into emerging aesthetic principles and build algorithmic literacy.
Bibliography:
Isbrucker, A., 2017. The Immersive Realism Of Studio Ghibli. [online] Medium. Available at:
Horton, H. and Horton, H., 2014. The Immersive Realism Of Studio Ghibli. [online] Film School Rejects. Available at:
Return to home page


--- title: "Default Post Tiles" type: tiles module: _includes/archive-tiles.html scss: _assets/stylesheets/_tiles.scss usage: "Default group of post teaser." ---
February 10, 2015
August 29, 2014
August 24, 2014


WWW.GEICO.COM OR CALL 1-888-395-6349, 24 HOURS A DAY
FOR A FREE CAR INSURANCE RATE QUOTE THAT COULD SAVE YOU SUBSTANTIAL MONEY
If you have any comments about our WEB page, you can either write us at the address shown above or e-mail us at<EMAIL_ADDRESS>However, due to the limited number of personnel in our corporate office, we are unable to provide a direct response.
Copyright © 1978-2016 Berkshire Hathaway Inc.


Limits
Continuity
Derivatives
Derivative Applications
Integrals
Fundamental Theorems of Calculus
Integration Methods
Differential Equations
Improper Integrals
Polar and Parametric
Infinite Series
Taylor and Maclaurin Polynomials


Floater Display
-
Normang
On the iTunes page, there is a interesting floater design, however I don't see any options for customizing the look of the floater beyond location, and size. Am I overlooking some obvious feature in the program? Is there a way to make the floater window more interesting than the grayish floater I have now? thanks Norm
-
Greg Hurrell
You're probably looking at a screenshot showing the Growl integration, for which you need Growl:
-
Normang
Thanks, I'll check that out, the pic I was refering to was here..
http://www.apple.com/downloads/macosx/ipod_itunes/synergy.html
Norm
-
Greg Hurrell
Ah, that screenshot is the normal Floater, not Growl. The album cover is pulled across from iTunes, and the rest is turned on and off with checkboxes in the prefs. Size and transparency also. All of the controls are in the same spot (the "General" pane) of the preferences in the same place where the location and size controls are.
-
Normang
So, the grayness that I see in my floater is perhaps because of the level of transparency that I am using? Or if the floater is opaque, does the floater take on some of the characteristics of the album art? I am not at my Mac at the moment to determine if settings change would make the floater look more like it appeared in that web page..
-
Greg Hurrell
Due to the transparency of the Floater it's appearance is influenced by whatever is behind it. So in the case of the screenshot what you're seeing is the desktop picture that was in place behind the Floater at the time.
Reply
This topic is now closed.


404, wolve's not found, your browsers old and can't render object tags. Go back to https://glacier.dog or check out https://twitter.com/Frickle_.


_________________
Marion Robin | Graphic design
Urban, dreamy, perfectionist. Obsessed with turquoise and tattoos, I've got a secret weird passion for distortions, night and oneirology. And if you want to see another aspect of my personality, here is my CV!


Before Change
times *= time / times.max() // Extended through simulation time.
times = torch.ceil(times).long()
print(times.min(), times.max())
// Create spike times tensor.
spikes = torch.zeros(time, size).byte()
for i in range(size):
After Change
:param dt: Simulation time step.
:return: Tensor of shape ``[time, n_1, ..., n_k]`` of rank order-encoded spikes.
assert datum >= 0, "Inputs must be non-negative"
shape, size = datum.shape, datum.numel()
datum = datum.view(-1)
time = int(time / dt)


Preparation time
overnight
Cooking time
1 to 2 hours
Serves
Serves 6-8
Dietary
Dried fruits are soaked in tea to plump them up and add moisture to this simple, tasty cake.
Place the tea bags in a bowl and add 200ml/7fl oz hot water, the brandy, rosewater, honey and dried fruit. Cover and soak overnight, or until the fruit is plump. (If you are short of time, you can cheat a little by warming the ingredients gently to speed up the process).
Preheat the oven to 180C/350F/Gas 4 and line a 450g/1lb loaf tin with baking paper.
When the fruit is plump, strain it and discard the liquid and tea bags.
Sift the flour, baking powder, cinnamon and nutmeg into a large bowl. Add the marmalade and brown sugar. Stir in the egg and melted butter and combine to form a soft dough. Add the fruit and thoroughly mix together.
Transfer the mixture to the prepared loaf tin and bake for 50-60 minutes, or until a wooden skewer comes out clean.
Remove from the oven and leave in the tin for 10 minutes. Turn out and cool on wire rack.
To decorate the cake, brush the cake with marmalade. Cut the marzipan fruits in half and place on top of the cake. Use the gold leaf to gilt the marzipan fruits.


{% extends "account/base.html" %} {% load i18n %} {% block htitle %}SPARCS SSO {% trans "Profile" %}{% endblock %} {% block header %}{% endblock %} {% block content %}
{% trans "You can change your information or connect / disconnect social accounts." %} {% trans "Changed information may not be applied in other SPARCS services." %}
Test accounts CANNOT connect / disconnect to social accounts.
{% else %} {% if profile.kaist_id %}{% trans "You can renew your KAIST SSO information." %}
{% else %}{% trans "You should connect to KAIST SSO if you want to verify your identity as a KAIST member." %}
{% trans "You CANNOT DISCONNECT KAIST SSO from SPARCS SSO once you connect." %}
{% endif %} {% if result_con != -1 %}


{% extends "wagtailadmin/base.html" %} {% load wagtailadmin_tags i18n %} {% block titletag %}{% trans "Create an A/B Test" %} - {{ page.title }}{% endblock %} {% block content %} {% trans "Create an A/B Test" as title %} {% include "wagtailadmin/shared/header.html" with title=title subtitle=page.title icon='people-arrows' tabbed=1 merged=1 %}
{% trans "This will create an A/B test comparing the published version of this page and the draft with the following differences:" %}
{% if differences %} {% include "./includes/comparison.html" %} {% trans "Create this test" %} {% else %}{% trans "There are no differences, please go back and make some changes to set up a new test" %}


|
SideCar
|
Go to the source code of this file.
Data Structures | |
| class | SideCar::GUI::SampleImaging |
| Derivation of the ChannelImaging settings collection class that contains additional settings for OpenGL texture size and sample decimation. More... | |
Namespaces | |
| SideCar | |
| Namespace for all entities specific to the 331 SideCar project. | |
| SideCar::GUI | |
| Namespace for the GUI applications. | |


National 10000m Outdoor Track Champions for Trinidad and Tobago
Men (37 runnings) 10000m .... not held 26 Jun 2015 Port of Spain 38:05.59 Jameel Cupidore .... not held 22 Jun 2013 Port of Spain 30:58.33 Richard Jones .... not held Jun 2009 Port of Spain 35:07.19 Roland Bartholomew .... not held Jun 2007 Port of Spain Jun 2006 Bacolet Jun 2005 Port of Spain Jun 2004 Port of Spain Jun 2003 Port of Spain Jun 2002 Port of Spain Jun 2001 Port of Spain Jun 2000 Port of Spain 38:11.0 Kavisa Dawson 20 Jun 1999 Port of Spain Jun 1998 Port of Spain Jun 1997 Pointe ŕ Pierre .... not held Jun 1994 Port of Spain 32:26.2 Adesh Seenath Jun 1993 Port of Spain May 1992 Port of Spain 30 Jun 1991 Port of Spain .... not held due to attempted coup d`état 24 Jun 1989 Arima .... not held Jun 1987 Port of Spain Jun 1986 Port of Spain Jul 1985 Port of Spain 33:05.7 Parkinson Musgrove May 1984 Port of Spain Jun 1983 Port of Spain 32:02.3 Moses Ranghell-3 26 Jun 1982 Port of Spain Jun 1981 Arima 33:18.6 Anthony Nero Jun 1980 Arima 33:02.5 Moses Ranghell-2 May 1979 Arima 34:09.2 Moses Ranghell Jun 1978 Arima 32:37.0 Rudy Maraj-4 Jun 1977 Arima 33:06.9 Rudy Maraj-3 Jun 1976 Arima 32:36.3 Bruce Lauckner Jun 1975 Arima 33:05.0 Rudy Maraj-2 Jun 1974 Arima 33:02.5 Rudy Maraj May 1973 Saint Augustine 33:04.6 Ken Jerome-2 Jun 1972 Port of Spain 33:03.0 Ken Jerome .... not held Mar 1970 Scarborough 33:20.4 Felix Frederick 1969 Pointe ŕ Pierre 35:44.9 Max Millington .... not held Jul 1960 San Fernando Glenroy Charles .... not held 6 miles May 1957 Port of Spain 32:44.6 Joseph Roberts-3 Apr 1956 Port of Spain 32:53.0 Joseph Roberts-2 1955 Port of Spain 32:58.0 Joseph Roberts .... not held Mar 1952 Port of Spain 35:11.4 Hector Toussaint
Non-champion winners
2015 30:48.25 Kenneth Rotich Kipyego (KEN)
Notes: For 1946-1962, these championships were organized by the Amateur Athletic Foundation of Trinidad & Tobago which had been founded on 16 Jun 1945. The 1969-1970 championships were organized by the National Athletes Union, founded in 1967. In 1971, the Trinidad & Tibago National Amateur Athletic Association was constituted as the national governing body and has organized these championships since 1972. In 2008, the word amateur was dropped from the name of the NGB.
Most Titles
Men
(1946/date)
4
Rudy Maraj
1974-75,1977-78
Last Updated on 10 Mar 2017
Contributors: Bernard Linley (50), Juraj Gasparovic (4)


|
|||
| About me | My hometown | ||
| Photo Album | My Malaysia | ||
| Links | My Location | ||
View Guestbook 1 | Sign Guestbook 1
View Guestbook 2 |View Guestbook 3| Sign Guestbook 2
Got your own Homepage? Rate your Homepage. Know how good
your website is!
This page hosted by Get your own Free Home Page
Last update : Saturday, May 25, 2002


--- title: Measures keywords: fastai sidebar: home_sidebar summary: "Compute behavioural measures from raw transaction data" description: "Compute behavioural measures from raw transaction data" nb_path: "21_measures.ipynb" ---
A behavioural measure is a number derived from a player's transaction data. This data needs to have specific columns depending on the measure you want to calculate. For example, measures in the bet domain require the bet_size column. For each of the measures you plan to use, make sure that the data you have in the gamba standard format (see check_data
) has the correct values.
Once your data has all of the right columns, the simplest way to get started is to call the create_measures_table
method below, giving it one or more players bets in the gamba standard format.
{% include note.html content='The create_measures_table
method is perhaps the most useful thing in the entire library.' %}
Not all measures need the same data to be computed. The gamba library distinguishes between three primary domains (time, cost, and loss), and includes a final other domain to include everything else.
The time domain consists of behavioural measures that can be computed using only the knowledge of when the bets took place. This means using only values from the bet_time column in the player bet dataframe.
The cost domain contains all behavioural measures which can be computed using additional values from the bet_size column. As such, they describe spending behaviours as opposed to engagement behaviours as above.
The loss domain includes all behavioural measures which require the additional information of the size of the payout received as a result of each bet. This data should be held in the payout_size column if available.
All measures not in the root, bet, or loss domains, require some additional information such as the house edge for each bet, the game being played, etc. These are currently broadly grouped into the 'other' domain' but as the library (and academic)'s capabilities grow, this domain will likely be split further.
The measures module also contains some convenience methods which accept full existing data sets of players bets and compute the collection of behavioural measures used in a given study.
This module also contains a utility function for standardising each of the measures in a measures table, aggregating bets, checking measure data, and other things. It's unlikely that you'll need to use these methods directly in your own work, but are used in some of the higher-level methods in the library.
The measures module also has a method for plotting the position of an individual in the context of the rest of the population. This is useful for exploratory work on outliers and similar things.
{% bibliography --cited %}


Welcome to the Phenomenon Server
"Embedded phenomena" are web-based applications designed to turn classrooms into sites of whole-class inquiry around simulated scientific phenomena that are imagined to occupy and unfold within the physical space of their room. Computers scattered around the room serve as localized "portals" through which students can observe and manipulate these phenomena. Over time, these investigations allow students to collectively construct and use models of the simulated phenomena, with the goal of developing their understandings of the underlying science and the methods by which scientific communities build knowledge.
Our long-term goal is to provide teachers and students with access to a public repository of embedded phenomena for use in their practice. We envision a day when teachers will be able to select and configure embedded phenomena for their specific context, and have them "delivered" through the web and run on the computers in their classrooms. We wish to complement these applications with adaptable lesson plans, teachers' stories of their experiences using embedded phenomena, and research on their impacts on teaching and learning. We hope to attract developers who would like to add to a growing collection of embedded phenomena.
We're not there yet. But we are ready to describe some early examples of embedded phenomena, to share our experiences in enacting science curriculum units utilizing embedded phenomena, and to make available some interactive demos of the embedded phenomena software that we have built. We hope that the resources available on this site can help visitors to get an idea of what embedded phenomena are about, spark interest in their use, and inspire others to envision new embedded phenomena that could become the objects of whole-class scientific inquiry.
Tom Moher
Learning Sciences Research Institute
University of Illinois at Chicago


Directory
{% if isHRManagerRole %} Manage Employees {% endif %}Department
Office
Status
| Name | Department | Branch | Mobile | Status |
|---|


Shanghai, on China’s central coast, is the country's biggest city and a global financial hub. Its heart is the Bund, a famed waterfront promenade lined with colonial-era buildings. Across the Huangpu River rises the Pudong district’s futuristic skyline, including 632m Shanghai Tower and the Oriental Pearl TV Tower, with distinctive pink spheres. Sprawling Yu Garden has traditional pavilions, towers and ponds.
Beijing, China’s massive capital, has history stretching back 3 millennia. Yet it’s known as much for its modern architecture as its ancient sites such as the grand Forbidden City complex, the imperial palace during the Ming and Qing dynasties. Nearby, the massive Tiananmen Square pedestrian plaza is the site of Mao Zedong’s mausoleum and the National Museum of China, displaying a vast collection of cultural relics.
Paris, France's capital, is a major European city and a global center for art, fashion, gastronomy and culture. Its 19th-century cityscape is crisscrossed by wide boulevards and the River Seine. Beyond such landmarks as the Eiffel Tower and the 12th-century, Gothic Notre-Dame cathedral, the city is known for its cafe culture and designer boutiques along the Rue du Faubourg Saint-Honoré.
Rome, Italy’s capital, is a sprawling, cosmopolitan city with nearly 3,000 years of globally influential art, architecture and culture on display. Ancient ruins such as the Forum and the Colosseum evoke the power of the former Roman Empire. Vatican City, headquarters of the Roman Catholic Church, has St. Peter’s Basilica and the Vatican Museums, which house masterpieces such as Michelangelo’s Sistine Chapel frescoes.
Singapore, an island city-state off southern Malaysia, is a global financial center with a tropical climate and multicultural population. Its colonial core centers on the Padang, a cricket field since the 1830s and now flanked by grand buildings such as City Hall, with its 18 Corinthian columns. In Singapore's circa-1820 Chinatown stands the red-and-gold Buddha Tooth Relic Temple, said to house one of Buddha's teeth.


Probe of Boris Johnson's relationship with US woman shelved until after election
The independent police watchdog has delayed its announcement on whether Boris Johnson should face an investigation over his relationship with Jennifer Arcuri
by Keith Perry, https://www.mirror.co.uk/authors/keith-perry/Fury has erupted after it emerged a police inquiry into Boris Johnson's friendship with Jennifer Arcuri will be shelved until after the general election.
The independent police watchdog has delayed its announcement on whether the Prime Minister should face an investigation into possible criminal misconduct until after a new Government is voted in.
The decision caused anger among Westminster politicians and London assembly members who said it appeared a ruling had been “suppressed” to protect Mr Johnson from potentially damaging headlines during the campaign.
It is said the decision was made in a private meeting held before parliament was dissolved last week.
Officials from the Independent Office for Police Conduct (IOPC) agreed not to announce whether they were going to investigate “possible criminality” over allegations about a conflict of interest in Johnson’s dealings while mayor of London with the American technology entrepreneur until after the election, the Observer reported.
Sources close to the investigation claim the watchdog was on the verge of announcing its decision on whether it was proceeding with a criminal investigation.
The IOPC was tasked by the Greater London Authority to establish whether criminal charges should be brought because of the then-mayor’s responsibility for London’s policing.
It is alleged Ms Arcuri received favourable treatment due to her friendship with Mr Johnson, including receiving large sums of public money for her technology firms.
The offence of misconduct in public office carries a maximum term of life imprisonment.
Mr Johnson has denied any impropriety.
Jon Trickett, shadow Cabinet Office minister, said: “This is incredible. It’s a suppression of information which the public is entitled to have.
"Given the fact we’re in a general election there should be maximum transparency.”
He added: “This decision must be reversed immediately.”
Caroline Pidgeon, a Lib Dem member of the London assembly’s oversight committee, said the delay raised the possibility of Downing Street contact with the IOPC before its decision.
“It raises questions over how independent the IOPC really is and whether the prime minister’s lawyers have been exerting undue pressure,” she said.


--- layout: rustwasm title: wasm_bindgen_futures::JsFuture description: wasm_bindgen_futures::JsFuture keyword: wasm_bindgen_futures::JsFuture, wasm_bindgen_futures JsFuture ---
This Struct is used for converting a JavaScript Promise to a Rust Future.
Cargo.toml
.
.
.
[dependencies]
wasm-bindgen-futures = "0.4.7"
.
.
.


Here are some courses I have taken
Course no
Course title
Semester taken
For credit
101
HTML
1
102
AI
2
103
Digital eng
3
Listener
104
Machine learning
4
105
Database
5


| Schema |
All
|
Created
|
Updated
|
Deleted
|
Published
|
Unpublished
|
Archived
|
Restored
|
|
|---|---|---|---|---|---|---|---|---|---|
| {{schema.schema.displayName}} |


--- layout: post title: Best Practices with Screenshots Question date: 2015-01-01 12:39:12.000000000 -08:00 categories: - technical-writing tags: [] status: draft type: post published: false ---
A reader asks:
I searched your site, but couldn't find a best practices for screenshots outside of Flare.
Currently I'm at an organization that uses Snaggit, Word, and Acrobat as the tools, and for some reason the screenshots in the PDF are hideous. I understand the limitations of this tool set, but I have never encountered results as embarrassing as these. I have experimented with the Acrobat settings and with how I paste or inserted the image into Word from Snaggit, but have seen no gain in quality.
How you have any tips or best practices in your archive?
If you want images to look crisp in print and load quickly online on an HTML page and PDF, you'll need two screenshots. For the PDF version, use a TIF format and scale down the image in Word by simply dragging it smaller. This will probably result in a huge file size, so experiment to find the right balance. TIF is a lossless format, meaning it shouldn't drop pixels when you make it smaller.
A typical TIF image might be 2-5 MB or more. For online images, you want them to be much smaller, about 50K to 200K. I'm not sure whether you can play with the image settings in Acrobat to resize the images there.
You could capture screenshots with Snagit and save the file as a .snagit file. Then create two files from that: the TIF (for print) and the PNG (for online).
I'm not sure if Word handles a lot of TIF images well. I imagine if you have 100 TIF images each at 5MG, your Word file is going to load slowly and crash.


{% if displayed_weight == 1 %}
{# I18N: Displayed next to a question. Indicates that the question is worth 1 point. #}
{{ gettext('1 point') }}
{% else %}
{# I18N: Displayed next to a question to indicate its point value. In this particular message, the number of points will be plural. #}
{{ gettext('%(points)s points', points=displayed_weight) }}
{% endif %}


OperationStatus
public class OperationStatus
| Field Summary | |
|---|---|
| string | Date when the operation was finished. |
| boolean | Whether or not the operation has failed. |
| string | Date when the operation was requested. |
| string | Status message. |
| int | Progress indicator. |
| string | Date when the operation was started. |
public string $finishedOn
Date when the operation was finished.
public boolean $hasFailed
Whether or not the operation has failed.
public string $insertedOn
Date when the operation was requested.
public string $message
Status message.
public int $progress
Progress indicator.
public string $startedOn
Date when the operation was started.
Operation status.


They're not aliens, they're Earth…liens! They're not aliens, they're Earth…liens!  Well, go on! Kill me!  Annihilate? No. No violence. I won't stand for it. Not now, not ever, do you understand me?! I'm the Doctor, the Oncoming Storm - and you basically meant beat them in a football match, didn't you?
I'm nobody's taxi service; I'm not gonna be there to catch you every time you feel like jumping out of a spaceship. They're not aliens, they're Earth…liens! You hit me with a cricket bat. Stop talking, brain thinking. Hush.


The C declaration above says s7_for_each_symbol is a C function that returns a boolean, and takes three arguments, an s7_scheme* pointer, a function (symbol_func), and a void* pointer (data). The function passed (symbol_func) also returns a boolean, and takes two arguments, a char* (name), and the same void* pointer that was passed to s7_symbol_for_each. If symbol_func returns true, the outer function immediately returns true, ending the symbol table traversal. Sketched in scheme, it might be:
(define (s7_for_each_symbol s7 symbol_func data) (call-with-exit (lambda (return) (for-each (lambda (symbol-name) (if (symbol_func symbol-name data) (return #t))) (symbol-table)) #f)))
An example is snd-completion.c.
bool s7_is_number(s7_pointer p); char *s7_number_to_string(s7_scheme *sc, s7_pointer obj, s7_int radix); bool s7_is_integer(s7_pointer p); s7_int s7_integer(s7_pointer p); s7_pointer s7_make_integer(s7_scheme *sc, s7_int num); s7_int s7_number_to_integer(s7_scheme *sc, s7_pointer x); s7_int s7_number_to_integer_with_caller(s7_scheme *sc, s7_pointer x, const char *caller); bool s7_is_real(s7_pointer p); s7_double s7_real(s7_pointer p); s7_pointer s7_make_real(s7_scheme *sc, s7_double num); s7_pointer s7_make_mutable_real(s7_scheme *sc, s7_double n); s7_double s7_number_to_real(s7_scheme *sc, s7_pointer x); s7_double s7_number_to_real_with_caller(s7_scheme *sc, s7_pointer x, const char *caller); s7_double s7_number_to_real_with_location(s7_scheme *sc, s7_pointer x, s7_pointer caller); bool s7_is_rational(s7_pointer arg); bool s7_is_ratio(s7_pointer arg); s7_pointer s7_make_ratio(s7_scheme *sc, s7_int a, s7_int b); s7_pointer s7_rationalize(s7_scheme *sc, s7_double x, s7_double error); s7_int s7_numerator(s7_pointer x); s7_int s7_denominator(s7_pointer x); bool s7_is_complex(s7_pointer arg); s7_pointer s7_make_complex(s7_scheme *sc, s7_double a, s7_double b); s7_double s7_real_part(s7_pointer z); s7_double s7_imag_part(s7_pointer z); s7_double s7_random(s7_scheme *sc, s7_pointer state); s7_pointer s7_random_state(s7_scheme *sc, s7_pointer seed); bool s7_is_random_state(s7_pointer p); s7_pointer s7_random_state_to_list(s7_scheme *sc, s7_pointer args); void s7_set_default_random_state(s7_scheme *sc, s7_int seed, s7_int carry); bool s7_is_bignum(s7_pointer obj); mpfr_t *s7_big_real(s7_pointer x); mpz_t *s7_big_integer(s7_pointer x); mpq_t *s7_big_ratio(s7_pointer x); mpc_t *s7_big_complex(s7_pointer x); s7_pointer s7_make_big_integer(s7_scheme *sc, mpz_t *val); s7_pointer s7_make_big_ratio(s7_scheme *sc, mpq_t *val); s7_pointer s7_make_big_real(s7_scheme *sc, mpfr_t *val); s7_pointer s7_make_big_complex(s7_scheme *sc, mpc_t *val);
Most of these correspond to the obvious scheme functions, so I'll only touch on the less-obvious cases. s7_make_mutable_real returns a real number object whose value can be changed directly. In snd-sig.c, for example, we have a C procedure that applies a scheme function to every sound sample in an audio file. We do not want to create a new object for the scheme function's argument list on every call! So, we start by creating the mutable real:
yp = s7_make_slot(s7, e, arg, s7_make_mutable_real(s7, 1.5));
"e" is the let for the evaluation, "arg" is the real's name as a symbol in that let, and we make its initial value 1.5 (for no particular reason). Then on every sample, we call the function:
s7_slot_set_real_value(s7, yp, data[kp]); /* set yp's value to data[kp] */ data[kp] = opt_func(s7, res); /* call opt_func */
s7_number_to_real returns any real number as an s7_double. If it can't convert its argument, it signals an error, which is annoying because it doesn't know where that error occured in scheme. So s7_number_to_real_with_caller gives you a way to tell it at least the caller's name. s7_number_to_real_with_location is the same function, but the caller argument is a s7 symbol or string (this is much faster than using a char*).
For the bignum functions, see Bignums in C.
bool s7_is_pair(s7_pointer p); s7_pointer s7_cons(s7_scheme *sc, s7_pointer a, s7_pointer b); s7_pointer s7_car(s7_pointer p); s7_pointer s7_cdr(s7_pointer p); s7_pointer s7_set_car(s7_pointer p, s7_pointer q); s7_pointer s7_set_cdr(s7_pointer p, s7_pointer q); s7_pointer s7_cadr(s7_pointer p); etc... bool s7_is_list(s7_scheme *sc, s7_pointer p); bool s7_is_proper_list(s7_scheme *sc, s7_pointer p); s7_pointer s7_make_list(s7_scheme *sc, s7_int length, s7_pointer initial_value); s7_int s7_list_length(s7_scheme *sc, s7_pointer a); s7_pointer s7_list(s7_scheme *sc, s7_int num_values, ...); s7_pointer s7_list_nl(s7_scheme *sc, s7_int num_values, ...); s7_pointer s7_array_to_list(s7_scheme *sc, s7_int num_values, s7_pointer *array); s7_pointer s7_list_ref(s7_scheme *sc, s7_pointer lst, s7_int num); s7_pointer s7_list_set(s7_scheme *sc, s7_pointer lst, s7_int num, s7_pointer val); s7_pointer s7_reverse(s7_scheme *sc, s7_pointer a); s7_pointer s7_append(s7_scheme *sc, s7_pointer a, s7_pointer b); s7_pointer s7_assoc(s7_scheme *sc, s7_pointer obj, s7_pointer lst); s7_pointer s7_assq(s7_scheme *sc, s7_pointer obj, s7_pointer x); s7_pointer s7_member(s7_scheme *sc, s7_pointer obj, s7_pointer lst); s7_pointer s7_memq(s7_scheme *sc, s7_pointer obj, s7_pointer x); bool s7_tree_memq(s7_scheme *sc, s7_pointer sym, s7_pointer tree);
These functions are mostly obvious: s7_car corresponds to scheme car, etc. s7_list_nl was added to catch a typo that affected s7_list: the latter would accept trailing, but ignored list values. s7_tree_memq is like s7_memq, but searches an entire tree structure. not just the top-level list. s7_array_to_list takes an array of s7_pointers and returns a list of them (similar to s7_vector_to_list).
s7_pointer s7_make_vector(s7_scheme *sc, s7_int len); s7_pointer s7_make_and_fill_vector(s7_scheme *sc, s7_int len, s7_pointer fill); s7_pointer s7_make_normal_vector(s7_scheme *sc, s7_int len, s7_int dims, s7_int *dim_info); bool s7_is_vector(s7_pointer p); s7_int s7_vector_length(s7_pointer vec); s7_int s7_vector_rank(s7_pointer vect); s7_int s7_vector_dimension(s7_pointer vec, s7_int dim); s7_pointer *s7_vector_elements(s7_pointer vec); s7_int s7_vector_dimensions(s7_pointer vec, s7_int *dims, s7_int dims_size); s7_int s7_vector_offsets(s7_pointer vec, s7_int *offs, s7_int offs_size); void s7_vector_fill(s7_scheme *sc, s7_pointer vec, s7_pointer obj); s7_pointer s7_vector_copy(s7_scheme *sc, s7_pointer old_vect); s7_pointer s7_vector_to_list(s7_scheme *sc, s7_pointer vect); s7_pointer s7_make_int_vector(s7_scheme *sc, s7_int len, s7_int dims, s7_int *dim_info); s7_int *s7_int_vector_elements(s7_pointer vec); bool s7_is_int_vector(s7_pointer p); s7_int s7_int_vector_ref(s7_pointer vec, s7_int index); s7_int s7_int_vector_set(s7_pointer vec, s7_int index, s7_int value); s7_pointer s7_make_float_vector(s7_scheme *sc, s7_int len, s7_int dims, s7_int *dim_info); s7_pointer s7_make_float_vector_wrapper(s7_scheme *sc, s7_int len, s7_double *data, s7_int dims, s7_int *dim_info, bool free_data); s7_double *s7_float_vector_elements(s7_pointer vec); bool s7_is_float_vector(s7_pointer p); s7_double s7_float_vector_ref(s7_pointer vec, s7_int index); s7_double s7_float_vector_set(s7_pointer vec, s7_int index, s7_double value); s7_pointer s7_vector_ref(s7_scheme *sc, s7_pointer vec, s7_int index); s7_pointer s7_vector_set(s7_scheme *sc, s7_pointer vec, s7_int index, s7_pointer a); s7_pointer s7_vector_ref_n(s7_scheme *sc, s7_pointer vector, s7_int indices, ...); s7_pointer s7_vector_set_n(s7_scheme *sc, s7_pointer vector, s7_pointer value, s7_int indices, ...);
s7_make_vector returns a one-dimensional vector of the given length; its elements are initialized to the empty list, (). s7_make_and_fill_vector is similar, but the initial element is set by the "fill" parameter. This value is simply placed in every vector location, not copied, so if you pass a cons, then change its car, that change is reflected in every element of the vector. s7_make_normal_vector returns a possibly multidimensional inhomogenous vector (a "normal" vector, as opposed to an int-vector or a float-vector).
s7_is_vector is the same as vector?, s7_vector_length is length. s7_vector_rank returns the number of dimensions in a vector, and s7_vector_dimension returns the size of the given dimension. s7_vector_elements returns the s7_pointer array that holds that vector's elements. s7_vector_dimensions fills "dims" with the lengths of the corresponding dimensions. s7_vector_offsets does the same for the successive dimensional offsets. In a multidimensional vector, you can get the s7_vector_elements index by summing each index * offset[dimension]. s7_vector_to_list is vector->list. s7_vector_fill is fill! (as applied to a vector of course), and s7_vector_copy is copy.
s7_make_int_vector returns an int-vector. Its elements are s7_ints (int64_t), and the array of s7_ints can be accessed via s7_int_vector_elements. Similarly for float-vectors (the elements are s7_doubles which are C doubles). s7_make_float_vector_wrapper provides a way to pass a C array of doubles through scheme; it wraps up the array as a scheme float-vector. Both s7_make_int_vector and s7_make_float_vector can return multidimensional vectors. The "dims" parameter specifies the number of dimensions, and the "dim_info" parameter the individual dimensions. If dims is 1, dim_info can be NULL. If the s7_make_float_vector_wrapper "free_data" parameter is true, s7 will free the "data" array when the float-vector is garbage-collected. In ffitest.c, the g_block example calls:
v1 = s7_make_float_vector_wrapper(sc, len, g1->data, 1, NULL, false);
when checking if two blocks are equivalent. Since this data is actually being shared with a block object, we don't want s7 to free it when the g_blocks_are_equivalent function is done. g1->data is freed by g_block_free when the c-object is garbage collected.
s7_vector_ref and s7_vector_set apply to one-dimensional vectors; the "_n" cases apply to multidimensional cases. All four functions can be used on any type of vector.
bool s7_is_c_pointer(s7_pointer arg); bool s7_is_c_pointer_of_type(s7_pointer arg, s7_pointer type); void *s7_c_pointer(s7_pointer p); void *s7_c_pointer_with_type(s7_scheme *sc, s7_pointer p, s7_pointer expected_type, const char *caller, s7_int argnum); s7_pointer s7_make_c_pointer(s7_scheme *sc, void *ptr); s7_pointer s7_make_c_pointer_with_type(s7_scheme *sc, void *ptr, s7_pointer type, s7_pointer info); s7_pointer s7_c_pointer_type(s7_pointer p);
These functions are equivalent to s7's c-pointer?, c-pointer, and c-pointer-type. C-pointers in s7 are aimed primarily at passing uninterpreted C pointers through s7 from one C function to another. The "type" field can hold a type indication, useful in debugging. s7_c_pointer_of_type checks that the c-pointer's type field matches the type passed as the second argument. As a convenience, s7_c_pointer_with_type combines s7_c_pointer with s7_is_c_pointer_of_type, calling s7_error if the types don't match. Nothing else in s7 assumes the type field is actually a type symbol, so you can use the type and info fields for any purpose.
bool s7_is_string(s7_pointer p); const char *s7_string(s7_pointer p); s7_pointer s7_make_string(s7_scheme *sc, const char *str); s7_pointer s7_make_string_with_length(s7_scheme *sc, const char *str, s7_int len); s7_pointer s7_make_string_wrapper(s7_scheme *sc, const char *str); s7_pointer s7_make_string_wrapper_with_length(s7_scheme *sc, const char *str, s7_int len); s7_pointer s7_make_permanent_string(s7_scheme *sc, const char *str); s7_pointer s7_make_semipermanent_string(s7_scheme *sc, const char *str); s7_int s7_string_length(s7_pointer str);
These handle s7 strings. s7_is_string corresponds to scheme's string?, and s7_string_length to scheme's string-length. s7_string returns the scheme string's value as a C string. Don't free the returned string! s7_make_string takes a C string, and returns its scheme equivalent. s7_make_string_with_length is the same, but it is faster because you pass the new string's length (s7_make_string has to use strlen). s7_make_permanent_string returns a scheme string that is not in the heap; it will never be GC'd or freed by s7. s7_make_semipermanent_string is similar, but the string will be freed if you call s7_free. s7_make_string_wrapper creates a temporary string. This saves the overhead of getting a free cell from the heap and later GC-ing it, but the string may be reused at any time. It is useful as an argument to s7_call and similar functions where you know no other strings will be needed during that call. s7_make_string_wrapper_with_length is the same but passes in the string length.
bool s7_is_character(s7_pointer p); uint8_t s7_character(s7_pointer p); s7_pointer s7_make_character(s7_scheme *sc, uint8_t c);
s7_is_character is equivalent to character?. s7_character returns the unsigned char held by the s7 object p, and s7_make_character returns an s7 object holding the unsigned char c.
bool s7_is_hash_table(s7_pointer p); s7_pointer s7_make_hash_table(s7_scheme *sc, s7_int size); s7_pointer s7_hash_table_ref(s7_scheme *sc, s7_pointer table, s7_pointer key); s7_pointer s7_hash_table_set(s7_scheme *sc, s7_pointer table, s7_pointer key, s7_pointer value);
These functions are the C-side equivalent of hash-table?, make-hash-table, hash-table-ref, and hash-table-set!.
s7_pointer s7_make_iterator(s7_scheme *sc, s7_pointer e); bool s7_is_iterator(s7_pointer obj); bool s7_iterator_is_at_end(s7_scheme *sc, s7_pointer iter); s7_pointer s7_iterate(s7_scheme *sc, s7_pointer iter);
These are the C equivalents of make-iterator, iterator?, iterator-at-end?, and iterate.
s7_pointer s7_hook_functions(s7_scheme *sc, s7_pointer hook); s7_pointer s7_hook_set_functions(s7_scheme *sc, s7_pointer hook, s7_pointer functions);
These access the list of functions associated with a hook. See hooks for a discussion of hooks, and C and Scheme Hooks for a short example. The scheme equivalent is hook-functions (a dilambda).
s7_pointer s7_f(s7_scheme *sc); s7_pointer s7_t(s7_scheme *sc); s7_pointer s7_nil(s7_scheme *sc); s7_pointer s7_undefined(s7_scheme *sc); s7_pointer s7_unspecified(s7_scheme *sc); s7_pointer s7_eof_object(s7_scheme *sc); bool s7_is_unspecified(s7_scheme *sc, s7_pointer val); bool s7_is_null(s7_scheme *sc, s7_pointer p); bool s7_is_boolean(s7_pointer x); bool s7_boolean(s7_scheme *sc, s7_pointer x); s7_pointer s7_make_boolean(s7_scheme *sc, bool x); bool s7_is_immutable(s7_pointer p); s7_pointer s7_immutable(s7_pointer p);
These return the standard scheme or s7 constants: #f, #t, (), #<undefined>, #<unspecified>, and #<eof>. Also the s7 function unspecified?, and the scheme functions null?, and boolean?. s7_make_boolean returns #t or #f depending on its argument.
s7_immutable makes its argument immutable, and s7_is_immutable returns true if its argument is immutable. They parallel s7's immutable! and immutable?.
typedef s7_double (*s7_d_t)(void); void s7_set_d_function(s7_scheme *sc, s7_pointer f, s7_d_t df); s7_d_t s7_d_function(s7_pointer f); etc... s7_pfunc s7_optimize(s7_scheme *sc, s7_pointer expr);
These functions tell s7 to call a foreign function directly, without any scheme-related overhead. The function to be called in this manner needs to take the form of one of the s7_*_t functions in s7.h. For example, one way to call + is to pass it two s7_double arguments and get an s7_double back. This is the s7_d_dd_t function (the first letter gives the return type, the rest give successive argument types, d=double, i=integer, v=c_object, p=s7_pointer). We tell s7 about it via s7_set_d_dd_function. Whenever s7's optimizer encounters + with two arguments that it (the optimizer) knows are s7_doubles, in a context where an s7_double result is expected, s7 calls the associated s7_d_dd_t function directly without preparing a list of arguments, and without wrapping up the result as an s7 object.
Here is an example of using these functions; more extensive examples are in clm2xen.c in sndlib, and in s7.c.
static s7_pointer g_plus_one(s7_scheme *sc, s7_pointer args) { return(s7_make_integer(sc, s7_integer(s7_car(args)) + 1)); } static s7_int plus_one(s7_int x) {return(x + 1);} s7_define_safe_function(sc, "plus1", g_plus_one, 1, 0, false, ""); s7_set_i_i_function(sc, s7_name_to_value(sc, "plus1"), plus_one);
s7_define_safe_function defines a Scheme function "plus1", telling the optimizer that this function is safe. A safe function does not push anything on the s7 stack, and treats the arglist passed to it as immutable and temporary (that is, it just grabs the arguments from the list). A few s7_* functions are unsafe, and that makes anything that calls them also unsafe. If the optimizer knows a function is safe, it can use prebuilt lists to pass the arguments (saving in the GC), and can combine it in various ways with other stuff. If an unsafe function handles its argument list safely, declare it with s7_define_semisafe_typed_function. If the safe function knows its return and argument types, there is another level of optimization that can call it without setting up an arglist or "unboxing" values, basically a direct call in C. In this example, the s7_set_i_i_function call tells the optimizer that if plus1 is seen in a context where the optimizer knows it is receiving an s7_int argument, and is expected to return an s7_int result, it can call plus_one directly, rather than g_plus_one.
There are more of these functions in s7.c that could be exported via s7.h if you need them.
By the way, to optimize scheme code (for speed), first use functions: the optimizer ignores anything else at the top level. Then perhaps check lint.scm and the profiler.  Use iteration, not recursion. Perhaps take the hot spot and do it in C. callgrind might also be helpful, but it can be hard to map from callgrind output to the original scheme code.
s7_optimize is the third-level optimizer. It is a bit hard to explain,
but basically you pass it some scheme code, and it returns either NULL or a function that can be called
to evaluate that code. There are several examples in snd-sig.c.
Here's an example where we want to call (list 1 2 3)
a bazillion times:
#include <stdlib.h> #include <stdio.h> #include <string.h> #include "s7.h" int main(int argc, char **argv) { s7_scheme *s = s7_init(); s7_pfunc f; s7_pointer body; s7_int gc_loc; int i; body = s7_list_nl(s, 4, s7_make_symbol(s, "list"), s7_make_integer(s, 1), s7_make_integer(s, 2), s7_make_integer(s, 3), NULL); gc_loc = s7_gc_protect(s, body); f = s7_optimize(s, s7_list(s, 1, body)); if (!f) fprintf(stderr, "oops\n"); else for (i = 0; i < 2000000; i++) f(s); s7_gc_unprotect_at(s, gc_loc); }
s7_optimize can also be used to take advantage of the direct C function calls mentioned above:
static s7_pointer g_d_func(s7_scheme *sc, s7_pointer args) { /* a normal C-defined s7 function that simply returns (scheme) 1.0 */ return(s7_make_real(sc, 1.0)); } static s7_double opt_d_func(void) { /* a version of g_d_func that returns (C) 1.0 */ return(1.0); } /* now make it possible to call opt_d_func in place of g_d_func */ s7_float_function func; s7_pointer symbol; symbol = s7_define_safe_function(sc, "d-func", g_d_func, 0, 0, false, "opt func"); s7_set_d_function(sc, s7_name_to_value(sc, "d-func"), opt_d_func); /* and try it (this saves creating an s7 real, accessing its value, and GC-ing it eventually) */ func = s7_float_optimize(sc, s7_list(sc, 1, s7_list(sc, 1, symbol))); fprintf(stderr, "%f\n", func(sc));
s7_scheme *s7_init(void); void s7_quit(s7_scheme *sc); void s7_free(s7_scheme *sc); void s7_repl(s7_scheme *sc); bool s7_is_eq(s7_pointer a, s7_pointer b); bool s7_is_eqv(s7_scheme *sc, s7_pointer a, s7_pointer b); bool s7_is_equal(s7_scheme *sc, s7_pointer a, s7_pointer b); bool s7_is_equivalent(s7_scheme *sc, s7_pointer x, s7_pointer y); void s7_provide(s7_scheme *sc, const char *feature); bool s7_is_provided(s7_scheme *sc, const char *feature); s7_pointer s7_stacktrace(s7_scheme *sc); s7_pointer s7_history(s7_scheme *sc); s7_pointer s7_add_to_history(s7_scheme *sc, s7_pointer entry); bool s7_history_enabled(s7_scheme *sc); bool s7_set_history_enabled(s7_scheme *sc, bool enabled); s7_pointer s7_dynamic_wind(s7_scheme *sc, s7_pointer init, s7_pointer body, s7_pointer finish); s7_pointer s7_make_continuation(s7_scheme *sc); s7_pointer s7_values(s7_scheme *sc, s7_pointer args); bool s7_is_multiple_value(s7_pointer obj); s7_pointer s7_copy(s7_scheme *sc, s7_pointer args); s7_pointer s7_fill(s7_scheme *sc, s7_pointer args); s7_pointer s7_type_of(s7_scheme *sc, s7_pointer arg); bool s7_is_syntax(s7_pointer p); bool s7_is_valid(s7_scheme *sc, s7_pointer arg); void (*s7_begin_hook(s7_scheme *sc))(s7_scheme *sc, bool *val); void s7_set_begin_hook(s7_scheme *sc, void (*hook)(s7_scheme *sc, bool *val));
s7_init creates a scheme interpreter. The returned value is the s7_scheme* used by many of the FFI functions. s7_quit exits the interpreter. The memory allocated for it by s7_init is not freed unless you call s7_free. (s7_free also frees its s7_scheme* argument, you may need to call s7_quit before s7_free to clean up the C stack, and as in multithreaded cases, global variables may need to be reinitialized after calling s7_free). s7_repl fires up a REPL. s7_is_eq and friends correspond to scheme's eq?, eqv?, equal?, and equivalent?. s7_provide and s7_is_provided add a symbol to the *features* list, or check for its presence there.
s7_stacktrace is like stacktrace; it currently ignores (*s7* 'stacktrace). The s7_history functions deal with the (*s7* 'history) buffer. s7_dynamic_wind is dynamic-wind in C. The parameters "init", "body", and "finish" are the same as in scheme (i.e. #f or a thunk). s7_make_continuation is call/cc; there is an example above. s7_values is values, s7_copy is copy, s7_fill is fill!, s7_type_of is type-of, s7_is_syntax is syntax?.
s7_is_multiple_value returns true if its argument (a list) is the result of calling values or s7_values. (values) returns a special object that is eq? to #<unspecified> but not C == to it (that is, there are two things in s7 that represent the unspecified object, one being the result of calling values with no arguments). (values obj) returns obj, which is not considered a multiple-value.
s7_is_valid is a debugging aid; it tries to tell if an arbitrary value is pointing to an s7 object. Set the compile-time switch TRAP_SEGFAULT to 1 before using this function!
Finally, the begin_hook functions are explained above.
An example of s7_values:
static s7_pointer vals(s7_scheme *s, s7_pointer args) { return(s7_values(s, args)); } int main(int argc, char **argv) { s7_scheme *s = s7_init(); s7_define_function(s, "vals", vals, 0, 0, true, NULL); s7_pointer e = s7_eval_c_string(s, "(+ (vals 1 2 3))"); s7_display(s, e, s7_current_output_port(s)); s7_newline(s, s7_current_output_port(s)); }
The s7 tarball includes several scheme files:
libc.scm, libgsl.scm, libm.scm, libdl.scm, notcurses_s7.c, libutf8proc.scm, and libgdbm.scm tie the associated libraries into s7. gdbinit has some gdb commands for s7.
cload.scm defines the macro c-define that reduces the overhead involved in (dynamically) linking C entities into s7.
(c-define c-info (prefix "") (headers ()) (cflags "") (ldflags "") output-name)
For example, (c-define '(double j0 (double)) "m" "math.h")
links the C math library function j0 into s7 under the name m:j0,
passing it a double argument and getting a double result (a real in s7).
prefix is some arbitrary prefix that you want prepended to various names.
headers is a list of headers (as strings) that the c-info relies on, (("math.h") for example).
cflags are any special C compiler flags that are needed ("-I." in particular), and ldflags is the similar case for the loader. output-name is the name of the output C file and associated library. It defaults to "temp-s7-output" followed by a number. In libm.scm, it is set to "libm_s7" to protect it across cload calls. If cload finds an up-to-date output C file and shared library, it simply loads the library, rather than going through all the trouble of writing and compling it.
c-info is a list that describes the C entities that you want to load into s7. It can be either one list describing one entity, or a list of such lists. Each description has the form:
(return-type entity-name-in-C (argument-type...))
where each entry is a symbol, and C names are used throughout. So, in the j0
example above, (double j0 (double))
says we want access to j0, it returns
a C double, and it takes one argument, also a C double. s7 tries to figure out
what the corresponding s7 type is, but in tricky cases, you should tell it
by replacing the bare type name with a list: (C-type underlying-C-type)
. For example,
the Snd function set_graph_style takes an (enum) argument of type graph_style_t.
This is actually an int, so we use (graph_style_t int)
as the type:
(void set_graph_style ((graph_style_t int)))
If the C entity is a constant, then the descriptor list has just two entries,
the C-type and the entity name: (int F_OK)
for example. The entity name can also be a list:
((graph_style_t int) (GRAPH_LINES GRAPH_DOTS GRAPH_FILLED GRAPH_DOTS_AND_LINES GRAPH_LOLLIPOPS))
This defines all the names in the list as integers.
If the C type has a space ("struct tm*"), use (symbol "struct tm*")
to construct the corresponding symbol.
The entity is placed in the current s7 environment under the name (string-append prefix ":" name)
where the ":" is omitted if the prefix is null. So in the j0 example, we get in s7 the function m:j0.
c-define returns #t if it thinks the load worked, and #f otherwise.
There are times when the only straightforward approach is to write the desired C code directly. To insert C code on the fly, use (in-C "code..."). Two more such cases that come up all the time: C-function for linkage to functions written directly in s7 style using in-C, and C-macro for macros in the C header file that need to be wrapped in #ifdefs. Here are some examples:
;;; various math library functions (c-define '((double j0 (double)) (double j1 (double)) (double erf (double)) (double erfc (double)) (double lgamma (double))) "m" "math.h") ;;; getenv and setenv (c-define '(char* getenv (char*))) (c-define '(int setenv (char* char* int))) ;;; file-exists? and delete-file (define file-exists? (let () ; define F_OK and access only within this let (c-define '((int F_OK) (int access (char* int))) "" "unistd.h") (lambda (arg) (= (access arg F_OK) 0)))) (define delete-file (let () (c-define '(int unlink (char*)) "" "unistd.h") (lambda (file) (= (unlink file) 0)))) ; 0=success ;;; examples from Snd: (c-define '(char* version_info ()) "" "snd.h" "-I.") (c-define '(mus_float_t mus_degrees_to_radians (mus_float_t)) "" "snd.h" "-I.") (c-define '(snd_info* any_selected_sound ()) "" "snd.h" "-I.") (c-define '(void select_channel (snd_info* int)) "" "snd.h" "-I.") (c-define '(((graph_style_t int) (GRAPH_LINES GRAPH_DOTS GRAPH_FILLED GRAPH_DOTS_AND_LINES GRAPH_LOLLIPOPS)) (void set_graph_style ((graph_style_t int)))) "" "snd.h" "-I.") ;;; getcwd, strftime (c-define '(char* getcwd (char* size_t)) "" "unistd.h") (c-define (list '(void* calloc (size_t size_t)) '(void free (void*)) '(void time (time_t*)) ; ignore returned value (list (symbol "struct tm*") 'localtime '(time_t*)) (list 'size_t 'strftime (list 'char* 'size_t 'char* (symbol "struct tm*")))) "" "time.h") > (let ((p (calloc 1 8)) (str (make-string 32))) (time p) (strftime str 32 "%a %d-%b-%Y %H:%M %Z" (localtime p)) (free p) str) "Sat 11-Aug-2012 08:55 PDT\x00 " ;;; opendir, read_dir, closedir (c-define '((int closedir (DIR*)) (DIR* opendir (char*)) (in-C "static char *read_dir(DIR *p) \ { \ struct dirent *dirp; \ dirp = readdir(p); \ if (!dirp) return(NULL); \ return(dirp->d_name); \ }") (char* read_dir (DIR*))) "" '("sys/types.h" "dirent.h"))
C-init inserts its string argument into the initialization section of the module. In libgsl.scm, for example,
(C-init "gsl_set_error_handler(g_gsl_error);")
inserts that string (as C code) into libgsl_s7.c toward the beginning of the libgsl_s7_init function (line 42346 or so).
When compiling, for the simple cases above, include "-ldl -Wl,-export-dynamic" in the gcc command. So the first FFI example is built (this is in Linux):
gcc -c s7.c -I. gcc -o ex1 ex1.c s7.o -lm -I. -ldl -Wl,-export-dynamic ex1 > (load "cload.scm") c-define-1 > (c-define '(double j0 (double)) "m" "math.h") #t > (m:j0 0.5) 0.93846980724081
See also r7rs.scm, libc.scm, libgsl.scm, libm.scm, libdl.scm, and libgdbm.scm. libutf8proc.scm exists, but I have not tested it at all.
The default in the lib*.scm files is to use the C name as the Scheme name. This collides with (for example) the widespread use of "-", rather than "_" in Scheme, but I have found it much more straightforward to stick with one name. In cases like libgsl there are thousands of names, all documented at great length by the C name. Anyone who wants to use these functions has to start with the C name. If they are forced to fuss with some annoying Schemely translation of it, the only sane response is: "forget it! I'll do it in C".
(require libc.scm) (define (copy-file in-file out-file) (with-let (sublet *libc* :in-file in-file :out-file out-file) ;; the rest of the function body exists in the *libc* environment, with the ;; function parameters in-file and out-file imported, so, for example, ;; (open ...) below calls the libc function open. (let ((infd (open in-file O_RDONLY 0))) (if (= infd -1) (error 'io-error "can't find ~S~%" in-file) (let ((outfd (creat out-file #o666))) (if (= outfd -1) (begin (close infd) (error 'io-error "can't open ~S~%" out-file)) (let* ((BUF_SIZE 1024) (buf (malloc BUF_SIZE))) (do ((num (read infd buf BUF_SIZE) (read infd buf BUF_SIZE))) ((or (<= num 0) (not (= (write outfd buf num) num))))) (close outfd) (close infd) (free buf) out-file))))))) (define (glob->list pattern) (with-let (sublet *libc* :pattern pattern) (let ((g (glob.make))) (glob pattern 0 g) (let ((res (glob.gl_pathv g))) (globfree g) res)))) ;; now (load "*.scm") is (for-each load (glob->list "*.scm")) ;; a couple regular expression examples (with-let (sublet *libc*) (define rg (regex.make)) (regcomp rg "a.b" 0) (display (regexec rg "acb" 0 0)) (newline) ; 0 = match (regfree rg)) (with-let (sublet *libc*) (define rg (regex.make)) (let ((res (regcomp rg "colou\\?r" 0))) (if (not (zero? res)) (error 'regex-error "~S: ~S~%" "colou\\?r" (regerror res rg))) (set! res (regexec rg "The color green" 1 0)) (display res) (newline) ; #i(4 9) = match start/end (regfree rg)))
(require libgsl.scm) (define (eigenvalues M) (with-let (sublet *libgsl* :M M) (let* ((len (sqrt (length M))) (gm (gsl_matrix_alloc len len)) (m (float-vector->gsl_matrix M gm)) (evl (gsl_vector_complex_alloc len)) (evc (gsl_matrix_complex_alloc len len)) (w (gsl_eigen_nonsymmv_alloc len))) (gsl_eigen_nonsymmv m evl evc w) (gsl_eigen_nonsymmv_free w) (gsl_eigen_nonsymmv_sort evl evc GSL_EIGEN_SORT_ABS_DESC) (let ((vals (make-vector len))) (do ((i 0 (+ i 1))) ((= i len)) (set! (vals i) (gsl_vector_complex_get evl i))) (gsl_matrix_free gm) (gsl_vector_complex_free evl) (gsl_matrix_complex_free evc) vals))))
We can use gdbm (or better yet, mdb), the :readable argument to object->string, and the fallback methods in the environments to create name-spaces (lets) with billions of thread-safe local variables, which can be saved and communicated between s7 runs:
(require libgdbm.scm) (with-let *libgdbm* (define *db* (openlet (inlet :file (gdbm_open "test.gdbm" 1024 GDBM_NEWDB #o664 (lambda (str) (format *stderr* "gdbm error: ~S~%" str))) :let-ref-fallback (lambda (obj sym) (eval-string (gdbm_fetch (obj 'file) (symbol->string sym)))) :let-set-fallback (lambda (obj sym val) (gdbm_store (obj 'file) (symbol->string sym) (object->string val :readable) GDBM_REPLACE) val) :make-iterator (lambda (obj) (let ((key #f) (length (lambda (obj) (expt 2 20)))) (#_make-iterator (let ((+iterator+ #t)) (openlet (lambda () (if key (set! key (gdbm_nextkey (obj 'file) (cdr key))) (set! key (gdbm_firstkey (obj 'file)))) (if (pair? key) (cons (string->symbol (car key)) (eval-string (gdbm_fetch (obj 'file) (car key)))) key)))))))))) (set! (*db* 'str) "123") ; add a variable named 'str with the value "123" (set! (*db* 'int) 432) (with-let *db* (+ int (length str))) ; -> 435 (map values *db*) ; -> '((str . "123") (int . 432)) (gdbm_close (*db* 'file)))
case.scm has case*, a compatible extension of case that includes pattern matching.
(case* selector ((target...) body) ...)
uses equivalent? to match the
selector to the targets, evaluating the body associated with the first matching target.
If a target is a list or vector, the elements are checked item by item.
Each target, or element of a list or vector can be a pattern. Patterns
are of the form #<whatever> (undefined constants from s7's pointer of view).
A pattern can be:
If a label occurs in the result body, the expression it labelled is substituted for it.
(case* x ((3.14) 'pi)) ; returns 'pi if x is 3.14 (case* x ((#<symbol?>))) ; returns #t if x is a symbol (case* x (((+ 1 #<symbol?>)))) ; matches any list of the form '(+ 1 x) or any symbol in place of "x" (case* x (((#<symbol?> #<e1:...> (+ #<e2:...>))) (append #<e1> #<e2>))) ; passed '(a b c d (+ 1 2)), returns '(b c d 1 2) (case* x ((#<"a.b">))) ; matches if x is a string "a.b" where "." matches anything (define (palindrome? x) (case* x ((() (#<>)) #t) (((#<start:> #<middle:...> #<start>)) (palindrome? #<middle>)) (else #f)))
case*'s matching function can be used anywhere.
(let ((match? ((funclet 'case*) 'case*-match?))) ; this is case*'s matcher (match? x '(+ #<symbol?> 1))) ; returns #t if x is of the form '(+ x 1), x any symbol (define match+ (let ((match? ((funclet 'case*) 'case*-match?)) (labels ((funclet 'case*) 'case*-labels))) ; these are the labels and their values (macro (arg) (cond ((null? arg) ()) ((match? arg '(+ #<a:> (+ #<b:...>))) `(+ ,(labels 'a) ,@(cadr (labels 'b)))) ((match? arg '(+ #<> #<>)) `(+ ,@(cdr arg))) (else #f))))) ;; (match+ (+ 1 (+ 2 3))) -> 6
See case.scm and s7test.scm for many more examples, including let and hash-table matching.
debug.scm has various debugging aids, including trace, break, watch, and a C-style stacktrace. The *s7* field 'debug controls when these are active, and to what extent.
(trace func) adds a tracepoint to the start of the function or macro func. (trace) adds such tracing to every subsequently defined function or macro. (untrace) turns off tracing; (untrace func) turns off tracing in func. Similarly (break func) places a breakpoint at the start of func, (unbreak func) removes it. (unbreak) removes all breakpoints. When a breakpoint is encountered, you are placed in a repl at that point; type C-q to continue. To trace a variable, use (watch var). watch reports whenever var is set! and (unwatch var) removes the watchpoint.
These trace, break and watchpoints are active only if (*s7* 'debug) is positive. If 'debug is 1, existing traces and breaks are active, but no new ones are added by s7. If 'debug is 2, s7 adds tracepoints to any subsequently defined (i.e. named) functions and macros. If (*s7* 'debug) is 3, unnamed functions are also traced. If any tracing is enabled, you can get a C-style stacktrace by setting (debug-stack) to a vector, then call (show-debug-stack) to see the calls.
Besides debug-stack, debug.scm also defines the convenience functions debug-function, debug-port, and debug-repl. debug-port is the debugger's output port, debug-repl drops into a repl at a breakpoint, and debug-function provides a way to customize the debugger's behavior. The function debug-frame provides a way to examine local variables.
> (define (g1 x) (+ x 1)) g1 > (trace g1) ; this loads debug.scm unless it's already loaded, and sets (*s7* 'debug) to 1 g1 > (procedure-source g1) ; you can add trace-in explicitly (rather than call trace) (lambda (x) (trace-in (curlet)) (+ x 1)) > (g1 2) (g1 2) ; file/line info is included if relevant -> 3 3 > (break g1) g1 > (g1 3) break: (g1 3), C-q to exit break break> x ; this is a repl started at the breakpoint 3 break> -> 4 ; C-q typed to exit the break 4 > (define var 1) 1 > (watch var) #<lambda (s v ...)> ; this is the new setter for 'var > (set! var 3) var set! to 3 3 > (define lt (inlet 'a 3)) (inlet 'a 3) > (watch (lt 'a)) #<lambda (s v ...)> > (set! (lt 'a) 12) let-set! a to 12 12
s7test.scm has more examples
lint tries to find errors or infelicities in your scheme code. To try it:
(load "lint.scm") (lint "some-code.scm")
There are several variables at the start of lint.scm to control additional output:
*report-unused-parameters* *report-unused-top-level-functions* *report-shadowed-variables* *report-undefined-identifiers* *report-multiply-defined-top-level-functions* *report-nested-if* *report-short-branch* *report-one-armed-if* *report-loaded-files* *report-any-!-as-setter* *report-doc-strings* *report-func-as-arg-arity-mismatch* *report-bad-variable-names* *report-built-in-functions-used-as-variables* *report-forward-functions* *report-sloppy-assoc* *report-bloated-arg* *report-clobbered-function-return-value* *report-boolean-functions-misbehaving* *report-repeated-code-fragments* *report-quasiquote-rewrites* *report-combinable-lets*
See lint.scm for more about these switches. You can also extend lint by adding your own code, or adding your functions to lint's tables, or most simply by defining signatures for your functions. snd-lint.scm performs these tasks for Snd. (lint exports its innards via *lint*). lint is not smart about functions defined outside the current file, so *report-undefined-variables* sometimes gets confused. You'll sometimes get a recommendation from lint that is less than helpful; nobody's perfect. If it's actually wrong, and not just wrong-headed, please let me know. Also in lint.scm are html-lint and C-lint. html-lint reads an HTML file looking for Scheme code. If any is found, it runs s7 and then lint over it, reporting troubles. Similarly C-lint reads a C file looking for s7_eval_c_string and running lint over its string.
There are three or four repls included with s7. repl.scm is a textual interface based on vt-100 codes, and nrepl.scm is an improvement of repl.scm based on the notcurses-core library. I'll treat repl.scm first, then discuss how nrepl differs from it.
repl.scm implements a repl using vt100 codes and libc.scm. It includes
symbol and filename completion, a history buffer, paren matching,
indentation, multi-line edits, and a debugger window.
To move around in the history buffer, use M-p, M-n or M-. (C-p and C-n are used to move the cursor in the current expression).
You can change the keymap or the prompt; all the repl functions are
accessible through the *repl* environment. One field is 'repl-let which
gives you access to all the repl's internal variables and functions.
Another is 'top-level-let, normally (sublet (rootlet)), which is the environment in
which the repl's evaluation takes place. You can reset the repl back to its
starting point with: (set! (*repl* 'top-level-let) (sublet (rootlet)))
.
You can save the current repl state via ((*repl* 'save-repl))
, and
restore it later via ((*repl* 'restore-repl))
. The repl's saved state
is in the file save.repl, or the filename can be passed as an argument to save-repl and restore-repl.
There is one annoying consequence of using (sublet (rootlet)) for the top-level let: if you define something in the repl, then load a file that expects to find that thing in rootlet, it won't:
<1> (define (func x) (+ x 1)) ; func is in (sublet (rootlet)) func <2> (load "use-func.scm") ; file contents: (display (func 3)) error: unbound variable func
To get around this, either load the file into curlet: (load "use-func.scm" (curlet))
,
or use with-let to place the definition in rootlet: (with-let (curlet) (define (func x) (+ x 1)))
.
Meta keys are a problem on the Mac. You can use ESC instead, but that requires super-human capacities. I stared at replacement control keys, and nothing seemed right. If you can think of something, it's easy to define replacements: see repl.scm which has a small table of mappings.
To run the repl, either build s7 with the compiler flag -DWITH_MAIN, or conjure up a wrapper:
#include "s7.h" int main(int argc, char **argv) { s7_scheme *sc = s7_init(); s7_load(sc, "repl.scm"); s7_eval_c_string(sc, "((*repl* 'run))"); return(0); } /* gcc -o r r.c s7.o -Wl,-export-dynamic -lm -I. -ldl */
Besides evaluating s7 expressions, like any repl, you can also type shell commands just as in a shell:
<1> pwd /home/bil/cl <2> cd .. /home/bil <3> date Wed 15-Apr-2015 17:32:24 PDT
In most cases, these are handled through *unbound-variable-hook*, checked using "command -v", then passed to the underlying shell via the system function.
The prompt is set by the function (*repl* 'prompt). It gets one argument, the current line number, and should set the prompt string and its length.
(set! (*repl* 'prompt) (lambda (num) (with-let (*repl* 'repl-let) (set! prompt-string "scheme> ") (set! prompt-length (length prompt-string)))))
or, to use the red lambda example mentioned earlier:
(set! (*repl* 'prompt) (lambda (num) (with-let (*repl* 'repl-let) (set! prompt-string (bold (red (string #\xce #\xbb #\> #\space)))) (set! prompt-length 3)))) ; until we get unicode length calc
The line number provides a quick way to move around in the history buffer. To get a previous line without laboriously typing M-p over and over, simply type the line number (without control or meta bits), then M-. In some CL repls, the special variable '* holds the last value computed. In repl.scm, each value is retained in variables of the form '<n> where n is the number shown in the prompt.
<1> (+ 1 2) 3 <2> (* <1> 2) 6
Here is an example of adding to the keymap:
(set! ((*repl* 'keymap) (integer->char 17)) ; C-q to quit and return to caller (lambda (c) (set! ((*repl* 'repl-let) 'all-done) #t)))
To access the meta keys (in the keymap), use a string:
((*repl* 'keymap) (string #\escape #\p))
; this is Meta-p which normally accesses
the history buffer.
You can call the repl from other code, poke around in the current environment (or whatever), then return to the caller:
(load "repl.scm") (define (drop-into-repl e) (let ((C-q (integer->char 17))) ; we'll use the C-q example above to get out (let ((old-C-q ((*repl* 'keymap) C-q)) (old-top-level (*repl* 'top-level-let))) (dynamic-wind (lambda () (set! (*repl* 'top-level-let) e) (set! ((*repl* 'keymap) C-q) (lambda (c) (set! ((*repl* 'repl-let) 'all-done) #t)))) (lambda () ((*repl* 'run))) ; run the repl (lambda () (set! (*repl* 'top-level-let) old-top-level) (set! ((*repl* 'keymap) C-q) old-C-q)))))) (let ((x 32)) (format *stderr* "x: ~A~%" x) (drop-into-repl (curlet)) (format *stderr* "now x: ~A~%" x))
Now load that code and:
x: 32 <1> x 32 <2> (set! x 91) 91 <3> x 91 <4> now x: 91 ; here I typed C-q at the prompt
Another possibility:
(set! (hook-functions *error-hook*) (list (lambda (hook) (apply format *stderr* (hook 'data)) (newline *stderr*) (drop-into-repl (owlet)))))
See the end of repl.scm for more examples. See nrepl.scm for a better version of repl.scm. Eventually I'll probably retire repl.scm.
Unlike repl, nrepl has support for the mouse, traversable, scrollable, and resizable panes, built-in ties to lint.scm, debug.scm, and profile.scm, and various other enhancements. Since it includes all the libc, notcurses FFI code, and nrepl.scm at compile-time, there are no problems running it anywhere. To build nrepl:
gcc -o nrepl s7.c -O2 -I. -Wl,-export-dynamic -lm -ldl -DWITH_MAIN -DWITH_NOTCURSES -lnotcurses-core
If that is too easy, try:
gcc -c s7.c -O2 -I. -Wl,-export-dynamic -lm -ldl gcc -o nrepl nrepl.c s7.o -lnotcurses-core -lm -I. -ldl
notcurses_s7.c needs version 2.1.6 or later of the notcurses-core library.
When nrepl starts up, you have a prompt at the top of the terminal, and a status box at the bottom. You can move around the pane via C-p and C-n (no need for repl.scm's M-p and M-n), or use the mouse, or the arrow keys. If you set and hit a break point, a new pane is opened in the context of the break. C-q exits the break. At the top pane, C-q exits nrepl.  If you're in an infinite loop, C-c interrupts it. Otherwise C-c exits nrepl.
If you set up a watcher (via watch from debug.scm), the action is displayed in a separate box in the upper right corner. The status box displays all sorts of informative and helpful messages, or at least that is the intent. lint.scm checks each expression you type, and various hooks let you know when things are happening in the background. Function signatures are posted there as well.
You can customize nrepl in basically the same ways as described above for repl.scm. You can also place these in a file named ".nrepl"; if nrepl finds such a file, it loads it automatically at startup.
After months of intense typing, Insanely declares his labors complete. "Ship it!" says Mr Big, and hands him a million stock options. Meanwhile, in the basement behind an old door with the eldritch sign "eep Ou", in a labyrinth of pounding pipes and fluorescent lights, a forgotten shadow types
(lint "insanely-great.scm")
...


|
SideCar
|
Template class that defines a type-safe ring buffer. More...
#include </Users/howes/src/sidecar/Utils/RingBuffer.h>
Public Member Functions | |
| TRingBuffer (int capacity) | |
| Constructor. More... | |
| bool | pushOn (const T &value) |
| Add an object to the buffer. More... | |
| bool | popOff (T &value) |
| Fetch the next object from the buffer. More... | |
| Public Member Functions inherited from Utils::RingBufferBase | |
| RingBufferBase (int capacity) | |
| Constructor. More... | |
| int | getCapacity () const |
| Obtain the capacity of the buffer. More... | |
| int | getSize () const |
| Obtain the number of objects held by the buffer. More... | |
| bool | isEmpty () const |
| Determine if the buffer is empty. More... | |
| bool | isFull () const |
| Determine if the buffer is full. More... | |
Additional Inherited Members | |
| Protected Member Functions inherited from Utils::RingBufferBase | |
| int | getReadOffset () |
| Obtain the current read offset, then increment the offset before returning. More... | |
| int | getWriteOffset () |
| Obtain the current write offset, then increment the offset before returning. More... | |
| void | added () |
| Increment the number of objects in the buffer. | |
| void | removed () |
| Decrement the number of objects in the buffer. | |
Template class that defines a type-safe ring buffer.
Provides methods to add to and take from the buffer. Uses std::vector for the container that holds the objects.
Definition at line 78 of file RingBuffer.h.
|
inline |
Constructor.
| capacity | maximum number of objects in the buffer can hold |
Definition at line 86 of file RingBuffer.h.
|
inline |
Fetch the next object from the buffer.
| value | reference to storage to hold the object |
Definition at line 108 of file RingBuffer.h.
|
inline |
Add an object to the buffer.
| value | the value to add |
Definition at line 94 of file RingBuffer.h.


Assignment 01: 5 in 5
The following is a five-day exploration, where every day research, experimentation,and documentation culminated in a new artwork. Fascinated in learning more about cultures, I used the first location presented by AirBnB.com as a source for guiding my art making practice, sending me to both familiar and unfamiliar locations. Every day resulted in an new discovery, a new interest, and a new idea I would like to continue along with.
An interest in history, language, and the effects of environment on place became key tocuhpoints that navigated my works together.
DAY 01
Goa – Graphic Animation
The AirBnB listing that inspired the following piece.
When I was working in Mumbai, my host showed me a site called the Hinglish project. It’s goal was to show English speakers how to sound out Hindi letters written in the Devangari script. Whilst it may make unfamiliar characters approachable, it does not in fact assist in being able to read Hindi words. This sketch was an exploration is connecting English to Hindi, both distant cousins in the Indo-European language superfamily.
Original Hinglish project: "Namaste."
Working through the Hindi text, and creating new interpretations of the characters."
Link to the interactive protoype
DAY 02
Selat – Bristol Weave
The AirBnB listing that inspired the following piece.
A study in paper folding and thatching techniques. I wanted to spend some time in the 5 in 5 with physical materials. After some unsuccessful folding explorations with Bristol paper, I switched to a classic weave. I found many similar techniques employed in room thatching in balinese homes I studied.
There is something methodical about manufacturing a simple square of woven paper. The body enters a rhythmic trance, becoming calmer and more in tune as techniques and patterns are forged. The material takes shape as the body becomes more accustomed to the process of manufacture.
DAY 03
San Francisco – Laser Cut Maps
The AirBnB listing that inspired the following piece.
I am from the SF Bay Area, and also recently spent the summer working in San Francisco. Out of all of the locations I designed for in this exercise, this is the region I felt most connected to. I was drawn to the distinct neighbourhoods of the city, and wanted to see if their orders reflected the iconic and unique topography of the area. In creating the assets, I found drawing the borders of the neighbourhoods much easier than the topographic segments. Surely this is not coincidence…
I used Adoobe Illustrator to preprare my file.
The final maps. Topography to the left, neighborhoods to the right.
DAY 04
London – Middle English Transcription and Video
The AirBnB listing that inspired the following piece.
Starting to hone in on language, I became interested in translations, intepretations, and change over time. I researched Middle English, and how it borrowed and adapted many French words. I was also fascinated in accents, and how the way a passage is spoken can greatly alter how it wes interpreted.
This piece is an exploration in translations, in new meanings, and in the evolution of the Westen connection to self as a part of a broader society.
The following is a passage from Confessio Amantis by John Gower, written in the 1390's. It is in it's original Middle English spelling. Note how when read, it is quite easy to pick up the meaning behind the piece.
Of hem that written ous toforeThe bokes duelle, and we therfore
Ben tawht of that was write tho:
Forthi good is that we also
In oure tyme among ous hiere
Do wryte of newe som matiere,
Essampled of these olde wyse
So that it myhte in such a wyse,
Whan we ben dede and elleswhere,
Beleve to the worldes eere
In tyme comende after this.
Bot for men sein, and soth it is,
That who that al of wisdom writ
It dulleth ofte a mannes wit
To him that schal it aldai rede,
For thilke cause, if that ye rede,
I wolde go the middel weie
And wryte a bok betwen the tweie,
Somwhat of lust, somewhat of lore,
That of the lasse or of the more
Som man mai lyke of that I wryte:
On location at a Gothic revival church in Manhattan.
Running a slit scan using After Effects on some of the footage captured.
Final output. Or Link.
DAY 05
Ystad – Story and Graphic Comic
The AirBnB listing that inspired the following piece.
My final 5 in 5, I realised I had started to find a theme of translating and retelling aspects of the places I had been assigned by AirBnB. To complete the theme of translation, I had my girlfriend read me a simple Swedish story, which I would try to translate into English. This broken translation was fed sentence by sentence into google image search.
Folksaga efter bröderna Grimm. Det var en gång en rik man, vars hustru blev sjuk och dog. När så mannen gifte om sig hade den nya hustrun två döttrar med sig. De var vackra att se på, men svarta och elaka i hjärtat, de kallade mannens dotter för Askungen.
Landets konung skulle ställa till med en stor bal och prinsen skulle välja sig en brud bland de festande. Askungens styvsystrar skulle gå, men Askungen fick inte gå för styvmodern. Då kom hennes gudmoder och trollade så att hon fick klänning och vagn, men hon var tvungen att lämna slottet innan klockan tolv, för på tolvslaget bröts förtrollningen. I sin hast sprang hon ifrån en glassko.
Prinsen hade tyckt bäst om flickan i glasskon och sökte igenom hela landet för att hitta henne. Till slut fann han Askungen och de gifte sig och fick ett äventyrligt liv tillsammans.
Original Story. Read aloud by Valentina Mikrut
Final comic. I translated the spoekn text as best I could into English, then fed the phrases, sentence-by-sentence, into Google images. Here is the result.


You will find the list of distributors associated with this item below. You can also add a new distributor at any time.


+++ title = "Madrid" lat = 40.419769 lon = -3.702392 +++
Spain's capital and largest city, Madrid is a big yet undaunting place that's located smack-bang in the centre of the country. Madrid was my first stop in España bonita, and in my opinion it provides a great first impression of the country: energetic yet laid-back; historic yet modern; and friendly and easy to acquaint yourself with. Madrid has plenty to offer for those seeking the arts, film and history, as well as even more for the avid party-goer. I came here to celebrate the dawn of 2008, the Latin madrileño way.


There are two ways to create a component:
yo xf:component [name]
that will scaffold a javascript file together with templates for all device typesEvery component should extend XF.Component
that allows general functionality, loading and rendering processes work without your input.
First of all, you will need a JavaScript file which defines component's logic and may override some XF.Component properties to achieve specific behavior.
XF.define(
'MyApp.components.categoryList', // just 'categoryList' is fine as well
XF.Component.extend({
construct: function () {
// will be called on the start of construction
},
initialize: function () {
// this method will be called after component construction
},
// for more flexibility you can define Views in separate files
View: XF.View.extend({
initialize: function () {
}
}),
// for more flexibility you can define Collections in separate files
Collection: XF.Collection.extend({
url: 'books.json',
initialize: function () {
}
})
})
);
This call defines a new component via two arguments: component name and component class.
Component name: used to setup a placeholder (-s) for instance (-s) of the component and should be unique within the application.
Component class: definition is created via XF.[some_base_component].extend() call. Here you should pass properties and methods you want to add to the base class functionality as non-static and static part of a class respectively.
You may add/override properties of the component model, collection and view. Basically you are able to modify everything you see.
Be aware of proper usage Collections and Models. By default XF.Component
has XF.View
and XF.Collection
classes (XF.Component.Model
is not defined). If the component has linkage to Collection and Model classes the collection will be created.
XF.Component
properties:
id
: component idname
: component nameoptions
: component options (defaults merged with passed options for component). Default: {autoload: true, autorender: true, updateOnShow: false}
. autoload
and autorender
will load the data for collection or model with creation of component and then render the template with fetched data.selector
: component selector, e.g. [data-id="componentId"]
Model
: model class for this component. Default: null
.model
: instance of Model
that will be created on the constructing of the component.Collection
: collection class for this component. Default: XF.Collection
.collection
: instance of Model
that will be created on the constructing of the component.View
: view class for this component. Default: XF.View
.view
: instance of View
that will be created on the constructing of the component.XF.Component
methods:
refresh
: refreshes the data (model or collection) and then refreshes the view. Triggers refresh
method for view and collection/model. XF.Component
hooks:
construct
: overwrite it for your own needs. Called on the construction of component.initialize
: overwrite it for your own needs. Called on the initialization of component.


Baseball: Nationals stars Scherzer, Rendon among MLB award finalists
NEW YORK: Washington ace pitcher Max Scherzer and third baseman Anthony Rendon, who helped the Nationals win their first World Series, were among the 2019 Major League Baseball award finalists named Monday.
Scherzer could capture his fourth career Cy Young Award as best pitcher, joining South Korean Ryu Hyun-Jin of the Los Angeles Dodgers and Jacob deGrom of the New York Mets as finalists in the National League.
A fourth Cy Young Award would put Scherzer in elite MLB company with former Atlanta ace Greg Maddux, who won four in a row in the 1990s, and retired 1970s and 1980s Philadelphia ace Steve Carlton.
The only pitchers with more career Cy Young awards are Roger Clemens with a record seven and Randy Johnson, who captured five.
Rendon, meanwhile, was among the NL Most Valuable Player finalists along with Milwaukee's Christian Yelich and Cody Bellinger of the Dodgers.
MVP, Cy Young, Rookie of the Year and Manager of the Year award winners will be announced next week by the Baseball Writers' Association of America.
Voting took place after the end of the regular season, so playoff performance was not a consideration in the media balloting.
The MVPs will be named November 14 with Yelich seeking a repeat in the NL after batting .329 with 44 home runs, 30 stolen bases and 97 runs batted in (RBI) for the Brewers.
Rendon led MLB with 126 RBI, batting .319 with a league-best 44 doubles. He and Houston third baseman Alex Bregman each drove in eight runs in the World Series, in which the Nationals won the first title for Washington in 95 years by taking the best-of-seven series in seven games.
Bregman is a finalist for the American League MVP award along with Los Angeles Angels outfielder Mike Trout and Oakland shortstop Marcus Semien.
AL Cy Young Award finalists included Houston pitchers Gerrit Cole and Justin Verlander and Tampa Bay's Charlie Morton.
Rookie of the Year finalists included Houston's Yordan Alvarez, Tampa Bay's Brandon Lowe and Baltimore pitcher John Means in the AL and Mets first baseman Pete Alonso, Atlanta Pitcher Mike Soroka and San Diego shortstop Fernando Tatis Jr. in the NL.
Manager of the Year finalists in the NL were Milwaukee's Craig Counsell, Atlanta's Brian Snitker and Mike Shildt of St. Louis.
AL managerial finalists were Minnesota's Rocco Baldelli, Tampa Bay's Kevin Cash and Aaron Boone of the New York Yankees.