Title
??? From above
Author
Harold Ancell
Status
??? the draft/final/withdrawn status of the SRFI, information on how
to subscribe to its mailing list, and important dates in its history.
The editor will add this section.
Abstract
??? abstract, preferably shorter than 200 words. Please outline the
need for, and design of, the proposal.
Issues
??? Optional section that may point out things to be resolved. This
will not appear in the final SRFI.
Rationale
??? detailed rationale. This should be 200-500 words long. Please
explain why the proposal should be incorporated as a standard feature
in Scheme implementations. List related standards and SRFIs,
including dependencies, conflicts, and replacements. If there are
other standards which this proposal will replace or with which it will
compete, please explain why the present proposal is a substantial
improvement.
Specification
??? detailed specification. This should be detailed enough that a
conforming implementation could be completely created from this
description.
Implementation
??? explanation of how it meets the sample implementation
requirement (see process), and the
code, if possible, or a link to it
Source for the sample implementation.
Acknowledgements
??? credit where it is due
Copyright
Copyright © ??? (201?).
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation files
(the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice (including the
next paragraph) shall be included in all copies or substantial
portions of the Software.
 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Editor: Arthur A. Gleckler


|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Represents the generic interface to an N-Gram language model.
Note that all probabilities are in LogMath log base, except as otherwise noted.
| Field Summary | |
static java.lang.String |
PROP_DICTIONARY
The Sphinx Property specifying the dictionary to use |
static java.lang.String |
PROP_FORMAT
The SphinxProperty specifying the format of the language model. |
static java.lang.String |
PROP_FORMAT_DEFAULT
The default value of PROP_FORMAT. |
static java.lang.String |
PROP_LOCATION
The Sphinx Property specifying the location of the language model. |
static java.lang.String |
PROP_LOCATION_DEFAULT
The default value of PROP_LOCATION. |
static java.lang.String |
PROP_MAX_DEPTH
The Sphinx Property specifying the maximum depth reported by the language model (from a getMaxDepth()) call. |
static int |
PROP_MAX_DEPTH_DEFAULT
The default value for PROP_MAX_DEPTH. |
static java.lang.String |
PROP_UNIGRAM_WEIGHT
The Sphinx Property specifying the unigram weight |
static float |
PROP_UNIGRAM_WEIGHT_DEFAULT
The default value for PROP_UNIGRAM_WEIGHT |
| Method Summary | |
void |
allocate()
Create the language model |
void |
deallocate()
Deallocate resources allocated to this language model |
int |
getMaxDepth()
Returns the maximum depth of the language model |
float |
getProbability(WordSequence wordSequence)
Gets the ngram probability of the word sequence represented by the word list |
float |
getSmear(WordSequence wordSequence)
Gets the smear term for the given wordSequence |
java.util.Set |
getVocabulary()
Returns the set of words in the lanaguage model. |
void |
start()
Called before a recognition |
void |
stop()
Called after a recognition |
| Methods inherited from interface edu.cmu.sphinx.util.props.Configurable |
getName, newProperties, register |
| Field Detail |
public static final java.lang.String PROP_FORMAT
public static final java.lang.String PROP_FORMAT_DEFAULT
public static final java.lang.String PROP_LOCATION
public static final java.lang.String PROP_LOCATION_DEFAULT
public static final java.lang.String PROP_UNIGRAM_WEIGHT
public static final float PROP_UNIGRAM_WEIGHT_DEFAULT
public static final java.lang.String PROP_MAX_DEPTH
public static final int PROP_MAX_DEPTH_DEFAULT
public static final java.lang.String PROP_DICTIONARY
| Method Detail |
public void allocate() throws java.io.IOException
java.io.IOException
public void deallocate()
public void start()
public void stop()
public float getProbability(WordSequence wordSequence)
wordSequence
- the wordSequence
public float getSmear(WordSequence wordSequence)
wordSequence
- the word sequence
public java.util.Set getVocabulary()
public int getMaxDepth()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |


/** * @author Ed Spencer * * Represents a single read or write operation performed by a {@link Ext.data.proxy.Proxy Proxy}. Operation objects are * used to enable communication between Stores and Proxies. Application developers should rarely need to interact with * Operation objects directly. * * Note that when you define an Operation directly, you need to specify at least the {@link #model} configuration. * * Several Operations can be batched together in a {@link Ext.data.Batch batch}. */ Ext.define('Ext.data.Operation', { config: { /** * @cfg {Boolean} synchronous * True if this Operation is to be executed synchronously. This property is inspected by a * {@link Ext.data.Batch Batch} to see if a series of Operations can be executed in parallel or not. * @accessor */ synchronous: true, /** * @cfg {String} action * The action being performed by this Operation. Should be one of 'create', 'read', 'update' or 'destroy'. * @accessor */ action: null, /** * @cfg {Ext.util.Filter[]} filters * Optional array of filter objects. Only applies to 'read' actions. * @accessor */ filters: null, /** * @cfg {Ext.util.Sorter[]} sorters * Optional array of sorter objects. Only applies to 'read' actions. * @accessor */ sorters: null, /** * @cfg {Ext.util.Grouper} grouper * Optional grouping configuration. Only applies to 'read' actions where grouping is desired. * @accessor */ grouper: null, /** * @cfg {Number} start * The start index (offset), used in paging when running a 'read' action. * @accessor */ start: null, /** * @cfg {Number} limit * The number of records to load. Used on 'read' actions when paging is being used. * @accessor */ limit: null, /** * @cfg {Ext.data.Batch} batch * The batch that this Operation is a part of. * @accessor */ batch: null, /** * @cfg {Function} callback * Function to execute when operation completed. * @cfg {Ext.data.Model[]} callback.records Array of records. * @cfg {Ext.data.Operation} callback.operation The Operation itself. * @accessor */ callback: null, /** * @cfg {Object} scope * Scope for the {@link #callback} function. * @accessor */ scope: null, /** * @cfg {Ext.data.ResultSet} resultSet * The ResultSet for this operation. * @accessor */ resultSet: null, /** * @cfg {Array} records * The records associated to this operation. Before an operation starts, these * are the records you are updating, creating, or destroying. After an operation * is completed, a Proxy usually sets these records on the Operation to become * the processed records. If you don't set these records on your operation in * your proxy, then the getter will return the ones defined on the {@link #resultSet} * @accessor */ records: null, /** * @cfg {Ext.data.Request} request * The request used for this Operation. Operations don't usually care about Request and Response data, but in the * ServerProxy and any of its subclasses they may be useful for further processing. * @accessor */ request: null, /** * @cfg {Object} response * The response that was gotten from the server if there was one. * @accessor */ response: null, /** * @cfg {Boolean} withCredentials * This field is necessary when using cross-origin resource sharing. * @accessor */ withCredentials: null, /** * @cfg {Object} params * The params send along with this operation. These usually apply to a Server proxy if you are * creating your own custom proxy, * @accessor */ params: null, url: null, page: null, node: null, /** * @cfg {Ext.data.Model} model * The Model that this Operation will be dealing with. This configuration is required when defining any Operation. * Since Operations take care of creating, updating, destroying and reading records, it needs access to the Model. * @accessor */ model: undefined, addRecords: false }, /** * @property {Boolean} started * Property tracking the start status of this Operation. Use {@link #isStarted}. * @private * @readonly */ started: false, /** * @property {Boolean} running * Property tracking the run status of this Operation. Use {@link #isRunning}. * @private * @readonly */ running: false, /** * @property {Boolean} complete * Property tracking the completion status of this Operation. Use {@link #isComplete}. * @private * @readonly */ complete: false, /** * @property {Boolean} success * Property tracking whether the Operation was successful or not. This starts as undefined and is set to `true` * or `false` by the Proxy that is executing the Operation. It is also set to false by {@link #setException}. Use * {@link #wasSuccessful} to query success status. * @private * @readonly */ success: undefined, /** * @property {Boolean} exception * Property tracking the exception status of this Operation. Use {@link #hasException} and see {@link #getError}. * @private * @readonly */ exception: false, /** * @property {String/Object} error * The error object passed when {@link #setException} was called. This could be any object or primitive. * @private */ error: undefined, /** * Creates new Operation object. * @param {Object} config (optional) Config object. */ constructor: function(config) { this.initConfig(config); }, applyModel: function(model) { if (typeof model == 'string') { model = Ext.data.ModelManager.getModel(model); if (!model) { Ext.Logger.error('Model with name ' + arguments[0] + ' doesnt exist.'); } } if (model && !model.prototype.isModel && Ext.isObject(model)) { model = Ext.data.ModelManager.registerType(model.storeId || model.id || Ext.id(), model); } // <debug> if (!model) { Ext.Logger.warn('Unless you define your model using metadata, an Operation needs to have a model defined.'); } // </debug> return model; }, getRecords: function() { var resultSet = this.getResultSet(); return this._records || (resultSet ? resultSet.getRecords() : []); }, /** * Marks the Operation as started. */ setStarted: function() { this.started = true; this.running = true; }, /** * Marks the Operation as completed. */ setCompleted: function() { this.complete = true; this.running = false; }, /** * Marks the Operation as successful. */ setSuccessful: function() { this.success = true; }, /** * Marks the Operation as having experienced an exception. Can be supplied with an option error message/object. * @param {String/Object} error (optional) error string/object */ setException: function(error) { this.exception = true; this.success = false; this.running = false; this.error = error; }, /** * Returns `true` if this Operation encountered an exception (see also {@link #getError}). * @return {Boolean} `true` if there was an exception. */ hasException: function() { return this.exception === true; }, /** * Returns the error string or object that was set using {@link #setException}. * @return {String/Object} The error object. */ getError: function() { return this.error; }, /** * Returns `true` if the Operation has been started. Note that the Operation may have started AND completed, see * {@link #isRunning} to test if the Operation is currently running. * @return {Boolean} `true` if the Operation has started */ isStarted: function() { return this.started === true; }, /** * Returns `true` if the Operation has been started but has not yet completed. * @return {Boolean} `true` if the Operation is currently running */ isRunning: function() { return this.running === true; }, /** * Returns `true` if the Operation has been completed * @return {Boolean} `true` if the Operation is complete */ isComplete: function() { return this.complete === true; }, /** * Returns `true` if the Operation has completed and was successful * @return {Boolean} `true` if successful */ wasSuccessful: function() { return this.isComplete() && this.success === true; }, /** * Checks whether this operation should cause writing to occur. * @return {Boolean} Whether the operation should cause a write to occur. */ allowWrite: function() { return this.getAction() != 'read'; }, process: function(action, resultSet, request, response) { if (resultSet.getSuccess() !== false) { this.setResponse(response); this.setResultSet(resultSet); this.setCompleted(); this.setSuccessful(); } else { this.setResponse(response); this.setResultSet(resultSet); return false; } return this['process' + Ext.String.capitalize(action)].call(this, resultSet, request, response); }, processRead: function(resultSet) { var records = resultSet.getRecords(), processedRecords = [], Model = this.getModel(), ln = records.length, i, record; for (i = 0; i < ln; i++) { record = records[i]; processedRecords.push(new Model(record.data, record.id, record.node)); } this.setRecords(processedRecords); resultSet.setRecords(processedRecords); return true; }, processCreate: function(resultSet) { var updatedRecords = resultSet.getRecords(), currentRecords = this.getRecords(), ln = updatedRecords.length, i, currentRecord, updatedRecord; for (i = 0; i < ln; i++) { updatedRecord = updatedRecords[i]; if (updatedRecord.clientId === null && currentRecords.length == 1 && updatedRecords.length == 1) { currentRecord = currentRecords[i]; } else { currentRecord = this.findCurrentRecord(updatedRecord.clientId); } if (currentRecord) { this.updateRecord(currentRecord, updatedRecord); } // <debug> else { Ext.Logger.warn('Unable to match the record that came back from the server.'); } // </debug> } return true; }, processUpdate: function(resultSet) { var updatedRecords = resultSet.getRecords(), currentRecords = this.getRecords(), ln = updatedRecords.length, i, currentRecord, updatedRecord; for (i = 0; i < ln; i++) { updatedRecord = updatedRecords[i]; currentRecord = currentRecords[i]; if (currentRecord) { this.updateRecord(currentRecord, updatedRecord); } // <debug> else { Ext.Logger.warn('Unable to match the updated record that came back from the server.'); } // </debug> } return true; }, processDestroy: function(resultSet) { var updatedRecords = resultSet.getRecords(), ln = updatedRecords.length, i, currentRecord, updatedRecord; for (i = 0; i < ln; i++) { updatedRecord = updatedRecords[i]; currentRecord = this.findCurrentRecord(updatedRecord.id); if (currentRecord) { currentRecord.setIsErased(true); currentRecord.notifyStores('afterErase', currentRecord); } // <debug> else { Ext.Logger.warn('Unable to match the destroyed record that came back from the server.'); } // </debug> } }, findCurrentRecord: function(clientId) { var currentRecords = this.getRecords(), ln = currentRecords.length, i, currentRecord; for (i = 0; i < ln; i++) { currentRecord = currentRecords[i]; if (currentRecord.getId() === clientId) { return currentRecord; } } }, updateRecord: function(currentRecord, updatedRecord) { var recordData = updatedRecord.data, recordId = updatedRecord.id; currentRecord.beginEdit(); currentRecord.set(recordData); if (recordId !== null) { currentRecord.setId(recordId); } // We call endEdit with silent: true because the commit below already makes // sure any store is notified of the record being updated. currentRecord.endEdit(true); currentRecord.commit(); } // <deprecated product=touch since=2.0> }, function() { /** * @member Ext.data.Operation * @cfg {Boolean} group * @inheritdoc Ext.data.Operation#grouper * @deprecated 2.0.0 Please use {@link #grouper} instead. */ Ext.deprecateProperty(this, 'group', 'grouper'); // </deprecated> });


Class represents CLI client.
More...
#include <cli.h>
|
| static void * | reader (void *) |
| | Method for console interaction (running in separate thread) More...
|
| |
Class represents CLI client.
Definition at line 51 of file cli.h.
| CLI::CLI |
( |
bool |
standalone = true , |
|
|
int |
bufferSize = 1024 |
|
) |
| |
Constructor of class CLI.
- Parameters
-
| bool | standalone |
| int | buffersize |
Definition at line 14 of file cli.cpp.
Add event to events.
- Returns
- CLIEvent
Definition at line 89 of file cli.h.
| void CLI::addMessage |
( |
string |
message | ) |
|
|
inline |
Add message to queue.
- Parameters
-
Definition at line 78 of file cli.h.
| void CLI::connectToHost |
( |
string |
hostname = "localhost" , |
|
|
int |
port = 32890 |
|
) |
| |
Method for connecting to the remote host.
- Parameters
-
Definition at line 55 of file cli.cpp.
| int CLI::getClientCount |
( |
| ) |
|
|
inline |
Get count of clients.
- Returns
- int
Definition at line 99 of file cli.h.
| vector<Client> CLI::getClients |
( |
| ) |
|
|
inline |
Get clients.
- Returns
- vector<Client>
Definition at line 104 of file cli.h.
| Client* CLI::getCurrentClient |
( |
| ) |
|
|
inline |
Get current client.
- Returns
- Client*
Definition at line 109 of file cli.h.
| Game* CLI::getCurrentGame |
( |
| ) |
|
|
inline |
Get current game.
- Returns
- Game*
Definition at line 124 of file cli.h.
Getter for attribute CLIEvent.
- Parameters
-
Definition at line 84 of file cli.h.
Get count of events.
- Returns
- int
Definition at line 94 of file cli.h.
| vector<string> CLI::getGames |
( |
| ) |
|
|
inline |
Get list of available games.
- Returns
- vector<string>
Definition at line 129 of file cli.h.
| int CLI::getInvitedBy |
( |
| ) |
|
|
inline |
Get UID of host.
- Returns
- int
Definition at line 114 of file cli.h.
| string CLI::getMessage |
( |
| ) |
|
|
inline |
Get message.
- Returns
- string
Definition at line 119 of file cli.h.
| void * CLI::reader |
( |
void * |
args | ) |
|
|
static |
Method for console interaction (running in separate thread)
- Parameters
-
- Returns
- void*
Definition at line 407 of file cli.cpp.
| void CLI::setBufferSize |
( |
int |
bufferSize | ) |
|
|
inline |
Setter for port attribute bufferSize.
- Parameters
-
Definition at line 73 of file cli.h.
| void CLI::setHostname |
( |
string |
hostname = "localhost" | ) |
|
|
inline |
Setter for attribute hostname.
- Parameters
-
Definition at line 63 of file cli.h.
| void CLI::setPort |
( |
int |
port = 32890 | ) |
|
|
inline |
Setter for attribute port.
- Parameters
-
Definition at line 68 of file cli.h.
The documentation for this class was generated from the following files:


Get Nissan Leaf E+ Tekna 62 Kwh Pictures. | the 2020 nissan leaf plus is equipped with a larger 62 kwh battery. Nissan leaf e+ tekna (2019) exterior and interior.
Nissan leaf 62 kwh road trip to bergen and stavanger part 2. 4figures quoted for 40kwh (leaf) and 62kwh (leaf e+) batteries. Rapidgate beim neuen nissan leaf e+ (2019) auf 500km fahrt | 62 vs.
| the 2020 nissan leaf plus is equipped with a larger 62 kwh battery.
| the 2020 nissan leaf plus is equipped with a larger 62 kwh battery. Book a test drive today. 4) a közölt értékek 40kwh és 62kwh akkumulátorokra vonatkoznak. It has a posted driving range of 363 kms or 225 miles, but.


"Light Makes Right"
September 11, 1988
Volume 1, Number 9
Compiled by
All contents are copyright (c) 1988, all rights reserved by the individual authors
Archive locations: anonymous FTP at
ftp://ftp-graphics.stanford.edu/pub/Graphics/RTNews/,
wuarchive.wustl.edu:/graphics/graphics/RTNews, and many others.
You may also want to check out the Ray Tracing News issue guide and the ray tracing FAQ.
I had hoped to talk with Tim Kay about a project he proposed at the ray tracing roundtable at SIGGRAPH this year, but he's in New York until the 20th. The kernel of the idea that he proposed was setting up ftp space on one of the Caltech computers and letting people check in their test ray-tracers there.
In the meantime this issue quickly filled up with biographical sketches and the winnowings of USENET, especially Mark VandeWettering's efforts. His ray tracer looks fairly nice, doing much more than spheres - check it out!
-- Eric
back to contents
Greetings! I am a candidate from the Reformed Radiosity party. My campaign pledge: I will not be satisfied until computer generated images are indistinguishable from photographs. Like all right-thinking Americans, I believe ray tracing is the means to this end. Better images at better runtimes! And I strenuously deny allegations that I spend too much time working with stochastic textures - every modern life needs balance.  Thank you!
______________
A few more new people have joined our ranks since last issue.
# Tom Palmer - applied ray tracing: realism & modeling for molecular graphics
# National Cancer Institute
# P.O. Box B Bldg 430
# Frederick, MD 21701
#<PHONE_NUMBER>
alias tom_palmer<EMAIL_ADDRESS>I'm currently interested in vectorizing ray-object intersection calculations. However, my primary interest is in applied ray tracing. The wide variety of primitives and the realistic rendering make ray tracing an ideal (if slow) method for creating images of extremely complex molecular models. I'm currently working with a (chemist) collaborator experimenting with visualizing electon density, electrostatic potential, molecular orbitals, etc. via ray tracing primitives.
A note from Tom Palmer:
Doug Turner has left UNC and is now with Apple in Cupertino doing ray casting and textures on their Cray. I would guess his email address to be<EMAIL_ADDRESS>but don't hold me to it.
______________
# Phillip Getto - Real-time radiant energy simulation :-), sampling,
# object-oriented rendering, efficient intersections calcs.
# CII 7309
# Center for Interactive Computer Graphics
# Rensselaer Polytechnic Institute
# 110 8th St.
# Troy, NY 12180-3590
#<PHONE_NUMBER>
alias phil_getto<EMAIL_ADDRESS>______________
# George Kyriazis - parallel ray-tracing
# ECSE Dept., JEC,
# R.P.I.,
# Troy, NY 12180
# e-mail<EMAIL_ADDRESS>#<EMAIL_ADDRESS>alias george_kyriazis<EMAIL_ADDRESS>I will (pretty soon) be parallelizing a ray tracer to work with an AT&T Pixel Machine. One of the problems there will be sharing pixels when doing anti-aliasing. Stochastic sampling may be considered. Also implementing algorithms for high hit/miss ratio in intersection calculations.
______________
# Stephen Spencer - accurate diffuse light calculation, antialiasing
# The Ohio State University Advanced Computing Center for the Arts and Design
# 1224 Kinnear Road
# Columbus Ohio 43212
#<PHONE_NUMBER>
alias stephen_spencer<EMAIL_ADDRESS>Currently employed by The Ohio State University Advanced Computing Center for the Arts and Design as a Graphics Research Specialist I designing graphics software for research and instructional use by students and staff working in computer animation and industrial design. Graphics interests include ray- tracing (somewhat obviously) and radiosity, and improving the realism of computer-generated images in general.
______________
# Greg Turk - rendering equation & tracing from lights
# UNC at Chapel Hill
# P.O. Box 26
# Chapel Hill, NC 27514
#<PHONE_NUMBER>
alias greg_turk<EMAIL_ADDRESS>I'm currently looking at ways to speed up collision detection for complex objects. I'm betting that collision detection can be made fast enough to be useful for interactive graphics applications, and I plan to see how far I can get on Pixel-planes, my favorite one-of-a-kind graphics engine.
______________
# Roy Hall
# Program of Computer Graphics
# 120 Rand Hall
# Cornell University
# Ithaca, NY 14853
#<PHONE_NUMBER>
alias roy_hall<EMAIL_ADDRESS>I've been writing renderer's commercially for some time and have been concentrating on efficiency and eas of use. Recently I returned to academics as faculty at Cornell. I expect to be pursuing research for a variety of rendering techniques, ray tracing being high on the list. Just finished a book "Illumination and Color in Computer Generated Imagery" - pub. by Springer-Verlag - should be out Sept or Oct. In addition to graphics research I'm teaching architecture classes in lighting and acoustics, and computer applications to architecture.
______________
# Mark VandeWettering
# Master's Student
# University of Oregon Computer And Information Sciences
#<EMAIL_ADDRESS>alias mark_vandewettering<EMAIL_ADDRESS>I am currently interested in most aspects of raytracing, radiosity and realistic image synthesis. I am the author of a public domain raytracer that has been distributed via USENET and is available from me via e-mail and via anonymous ftp. I am interested in developing a "library" of public domain code for doing image synthesis, and learning as much as I can in the mean time.
To download my raytracer, ftp to drizzle.cs.uoregon.edu (<IP_ADDRESS>) and login as ftp, with your name as a password. The README file in the pub directory can guide you further.
[by way of introduction, attached is Mark's reply to some of my comments about his ray tracer]
I would be pleased to see my raytracer compared to other raytracers. I am not a "serious" graphics person, my Master's thesis work is in functional programming languages and parallelism, but I do seem to spend alot of my off hours trying to hack graphics stuff.
I chose Kajiya/Kay bounding volumes because they seemed much simpler than octree methods, and still offered good speed.
As for all your suggestions:
- The `t' option is not mentioned the `?' options list. [This option prints out a `.' after each scan-line is computed]
Thanks, will include it. I just hacked -t in to get some idea of how fast the raytracer was...
- how does your implementation of Kay/Kajiya work? That is, what sorting algorithm is going on with insert/delete that ensures you of getting the lowest key at the beginning of the list? It's been but 10 years since I last studied sorting algorithms, so I am not up-to-date on what your scheme is all about (the powers of two comparisons and swaps).
I use a simple heap implementation and use it as a priority queue. I forget which data structures book I hauled it out of, but it isn't the most efficient in the world. But then again, when I profiled it, it wasn't in the "Top Ten Most Deadly" list either, so I guess its okay for now. The next release will try to document it better.
- More comments throughout the code would be a plus. If you spend an hour or two now, you'll save us all a lot of time. Most of the stuff looks fairly straightforward, but stuff like the Kay queue sort could use at least a reference as to where to go next.
Guilty as charged. That is why I didn't try to post it to comp.sources.unix. The next release will be cleaned up, commented, and have a better Makefile.
You comments on the lighting model are good, the lighting model needs to be reworked at least slightly, and probably a lot more than slightly. I haven't got to it yet, but it is coming.
Compilation and link problems: I have a much more generic Makefile for it, but I accidently distributed my "totally hacked one". The next release will probably be configurable to a wider variety of systems.
I have already received mail from a person at Tek Research Labs who is possibly thinking of adapting my raytracer to their new Motorola 88000 based workstation as a demo. I said he could send me one if it sold any :-) I am glad to see my effort so warmly received, and treated with some level of enthusiasm. Nobody has come back and said "Gosh, how stupid" so I will probably wish to extend some further effort to keep it up.
back to contents
I encourage anyone who has some interesting programs to contribute to send me mail. Unfortunately, I cannot allow people to upload directly, because our space is VERY tight here (the anonymous ftp login puts you in a subdirectory of mine, and I have a puny quota), but I would like to maintain a library of freely distributable source code for computer graphic applications. I hope to have viewers for sun and X11 soon, as well as an imagen printer dump. Anyone working on such things, write me if you would like to have your work distributed.
Anyway, here is the current contents of the directory ~/pub on drizzle.cs.uoregon.edu (<IP_ADDRESS>):
-cut-cut-cut-cut-cut-cut-cut-cut-cut-cut-cut-cut-cut-cut-cut-cut-cut-cut
This directory contains:
raytrace.shar my raytracer as it was posted to usenet's comp.graphics group
rpi-tracer.shar A raytracer written by George Kyriazis, posted to comp.graphics.
teapot.nff.Z compressed nff file of the famous "teapot", as patches for the above raytracer.
mini-ray.shar The winner to paul heckbert's minimal raytracing contest. Wow! Fits on a screen, once it has been "raped".
ohta-tracer.shar A REALLY FAST spheres only raytracer. Was originally posted to comp.graphics.
haines.shar A slightly out of date version of Eric Haines' NFF Standard Procedural Database stuff. I am working on getting the latest and greatest from netlib, but they seem to be slow.
Any questions or bugs with this software can be send to<EMAIL_ADDRESS>Thank you,
Mark
back to contents
[Mark's public domain RT was posted to USENET a week or two ago. This is a note he posted to USENET just recently.]
First of all thanks to everyone who has expressed an interest in my raytracer. I wish to address some questions globally rather than to each individual.
Q: The raytracer seems to work, but how do I display it on my XXX brand workstation?
A: Well, there are many answers to this.
What I do is take the output of this raytracer, and pipe it through a program to convert it to the Utah Raster Toolkit format that we use here at the U of O. We have several programs to display these files on a wide variety of devices. The utah Raster Toolkit is available via anonymous FTP from cs.utah.edu, or you can send them some amount of money, and they can make you a tape (I don't have exact details here).
The only problem with this is the guts of my conversion program are not original, they consist of some code that Eugene Miya posted to this group awhile ago (never write what you can beg, borrow or steal!), and I would have to contact him before I distributed said program. Also you would have to get the Utah Raster stuff as well.
If I get enough mail to warrant posting this stuff, and if I can verify it with Eugene Miya, I will post my programs.
My advice: Don't bother hacking pic.c too much. Write a program to display general raster images of an rgb bitmap to whatever device you have on hand.  And then POST such programs, so that others can use/improve them.
Q: Where can I get Eric Haines' NFF package?
A: Simple: I will be reposting it right after this message.
Q: Does anyone have any nifty NFF file objects to trace?
A: Well, I just converted the teapot to NFF file format (using faceted polygons) but it is pretty big. If someone can suggest an anonymous FTP site where I could put some of these, as well as other revisions to my programs, I would make them available from there.
Q: What else am I working on?
Well, I would like to add motion blur, and statistically optimized anti-aliasing. I added code so that you can specify colors by name rather than by guessing colors. Parametric patches, tori, and surfaces of revolution would be nice to add too. As soon as I feel the raytracer has been significantly extended, I will repost.
Finally, a bug fix (courtesy of Cameron Elliot):
Your program will crash on some machines unless you do the following... (The buf array was too small.)
Modify screen.c:
/* Was before cam...
Keep the mail coming!
Mark VandeWettering
back to contents
In article<EMAIL_ADDRESS><EMAIL_ADDRESS>(Mark VandeWettering) writes:
> My advice: Don't bother hacking pic.c too much. Write a
> program to display general raster images of an rgb bitmap to
> whatever device you have on hand.  And then POST such programs, so that others
> can use/improve them.
This is a posting of two programs which convert the output of the raytracing program to Sun rasterfile format.
Ray2sun maps to greyscale.
Cray2sun maps to color (3 bit red, 3 bit green and 2 bit blue)
The program Ray2sun works fine, but Cray2sun should be much smarter to produce better quality pictures. (E.g. use dithering...)
Tom
Tom Vijlbrief TNO Institute for Perception P.O. Box 23 Phone: +31 34 63 62 77 3769 DE Soesterberg E-mail<EMAIL_ADDRESS>The Netherlands or: uunet!mcvax!tnosoes!tom
[Code is 200+ lines, so is left out. Either check USENET or write Tom or me for the code. - Eric]
back to contents
Eric's first note:
- Note that Kay/Kajiya sorting is unnecessary for shadow rays. This is because you don't care about the closest object, but rather whether any object blocks the light. As soon as you get a shadow test hit, you can skip the rest of the intersection test - you're done.
________________
Mark's reply:
Is this totally correct? What we want to know is if there is a shadow between the light source and the point we hit. If we sort the list, we can stop when we find the first item, but we can also stop when the bounding volumes or the intersection are greater than the distance to the shadow (the point isn't shadowed) Because the heap insertion/deletion routines take so little time, it would seem that this would be a good optimization. But yes, I agree that some optimization of shadow rays could be made.
________________
Eric's response:
The way a sorted list is created is to intersect a BV, get its distance, and put its children on the list using this distance as a key. For shadowing, the distance to the light acts as the maximum cutoff from the start. So, when a BV is intersected it is either beyond the light or not. If beyond, its children are not put on the candidate list. If not beyond, the children can be placed anywhere within the candidate list (since we want any intersection). Essentially, there should never be anything on the candidate list which is keyed as having a distance beyond the light. Only when you actually test the candidate can you tell if it is beyond, at which point you throw it out. So, there should never be a point where you can say "all these candidates are beyond the light", as such candidates should not be on the test list, no matter whether the list is sorted or not. QED, the sorting is unneeded. I should mention that Jeff Goldsmith also figured this out independently - has anyone else noticed that sorting is unnecessary for shadowing?
Kay/Kajiya is something of a Catch-22 (but a great method, nonetheless), since the sort key is the candidate's parent's distance, and what we really would like is to have the sort key be the candidate's distance. To get this distance we intersect the candidate. Now we have the distance (if any) we would have liked to used to sort the candidate, but it's too late: we've intersected the candidate and so taken it off the candidate list (possibly replacing it with its children).
However, there might actually be a slight gain in practice if the list is sorted by distance for shadow rays. Say you have two bounding volumes, each with N objects. If both BV's are intersected, and the further bounding volume contains the light, then it's probably worth intersecting the objects in the closer BV first. This is because the further bounding volume probably contains objects which are beyond the light, while the closer one has objects more or less between the light and the test point. I believe this gain is negated by the following counter-argument: what if the closer BV contains the intersection point, and the further does not contain the light or the intersection point? By the previous logic, we should intersect the further BV's children first. "Scene dependence" seems to be the key phrase here: are your shadowing objects closer to the intersection point (e.g. a board with a bunch of nails pounded into it seems worth testing the closer nails first), or closer to the light source (e.g. the light source has a lampshade).
In light (ho ho) of this, I maintain that Kay & Kajiya sorting is unnecessary for shadow rays. However, there are certainly other interesting sorting strategies worth considering for shadow rays. Some possibilities:
- Object complexity (i.e. if you have a choice, try intersecting the sphere before trying the spline surface). - Object size (big objects cast big shadows. This idea actually helps enhance "shadow caching", where the last object to shadow a light is then tested first for the next shadow ray for that light. A big object will have more shadow coherence and so will result in less having to find another shadowing object. Say a light is blocked by both a sphere and a fine mesh of polygons. The sphere will have much more shadow coherence than each polygon, resulting in many fewer misses). - Function sorting. I haven't thought about this much, but one might be able to come up with a function which simulates the probability that a given object will be intersected. The function could be based on the closest intersection distance, or the farthest, or some of each. One possible theory: BV's which neither overlap the light or the intersection point have a higher probability of containing a shadowing object, for the reasons given earlier.
Anyway, just some thoughts. - Eric Haines
________________
Mark's response:
> The way a sorted list is created is to intersect a BV,
> get its distance, and put its children on the list using
> this distance as a key.
This isn't the way it is currently implemented in my raytracer, and glancing back at Kay/Kajiya, it seems contrary to their intent as well. If I intersect the parent volume, I intersect with the bounding volume of each of the children, and use THAT distance as the key for insertion. This does seem to require alot more bounding box intersections, but still has exactly the same number of ray/object intersections.
> Kay/Kajiya is something of a Catch-22 (but a great method,
> nonetheless), since the sort key is the candidate's parent's distance,
> and what we really would like is to have the sort key be the
> candidate's distance. To get this distance we intersect the
> candidate. Now we have the distance (if any) we would have liked to
> used to sort the candidate, but it's too late: we've intersected the
> candidate and so taken it off the candidate list (possibly replacing it
> with its children).
I think that this argument falls in light of my correction above. Each time an object is queued, it is keyed by the actual distance to its own bounding volume, not the distance to the parent.
My feeling is that if you add the proper cutoffs, that Kajiya/Kay testing for shadows is still just about the same cost as not bothering to sort. I actually implemented early cutoffs within the framework of Kajiya/Kay BVs, and it only gave an improvement of 2% on average for the Standard Procedural Database objects. This DOESN'T mean that it is correct, because I am uncertain just how "typical" the SPD stuff is, but it would seem to be that for certain objects, the gain is small.
________________
Eric's response: Well, I made a semantic error. Kay/Kajiya calls a "candidate" an object (real or BV) whose bounding volume has been hit and whose children have not been intersected. So, you're right in that the algorithm does put an intersected BV on the list as a candidate, and not its children. In practical terms this will mean less sorting: you only have to insert the intersected BV into the list, and not all its children (all of which have the same key). My confusion arose from the fact that Kay/Kajiya puts a bounding volume around every object, which I don't (a simple triangle or a sphere is about the same to intersect than a bounding box, and a BV around a sphere (which is a BV, after all), seems excessive).
Interestingly enough, looking over the original paper, I now have to agree with you: sorting on shadow rays using their original algorithm makes sense. However, I have found that there is an inefficiency in the Kay/Kajiya algorithm as presented at SIGGRAPH (which I never noticed before): in their figure 7, where they outline the algorithm, (page 275 of the SIGGRAPH '86 proceedings) it is stated, "if the ray hits the BV, insert the child into the heap". Then when they get to the "while" loop they state that "while heap is non-empty and distance to top node < t" the loop should be performed. Seems to me that they are inserting children which could be immediately culled. I believe a faster algorithm results from:
If the ray hits the bounding volume and distance < t Insert the child into the heap
In other words, if the distance to the BV is greater than the present t (which is the closest intersection distance of a real object), its child can immediately be discarded (instead of inserting it into the heap).
Using this slight modification of Kay/Kajiya now means that sorting is unnecessary. In the original, it was worth checking the distance because objects which were beyond the present t distance (for shadowing, the distance to the light) were actually inserted on the heap. By realizing that these children have no business on the heap (they're beyond the light, right?) and not inserting them in the first place, there is then no reason to sort what is then actually put on the heap.
[This is where things stand for now. My original mistake of misreading Kay and Kajiya was partly due to my using a more efficient algorithm: not adding to the heap if the child cannot possibly be hit. I had never noticed that this was not how they wrote it up, as I assumed they would compare all intersections against the closest real intersection distance. - Eric]
back to contents
From<EMAIL_ADDRESS>(Thomas Palmer) Newsgroups: comp.graphics
This is a summary of the replies I received to my query regarding vectorizing ray-object intersection calculations.
________________
>From<EMAIL_ADDRESS>(Dave Plunkett)
You might try any of:
"The Vectorization of a Ray Tracing Program for Image Generation", with J.M. Cychosz and M.J. Bailey. Cyber 200 Applications Seminar, NASA Goddard, October 1983.
"Ray Tracing on a Cyber 205", Conference Proceedings VIM-40, San Francisco, CA, April 1984.
"A Vectorized Ray Tracing Algorithm", Masters Thesis, Purdue University, West Lafayette, IN. August 1984.
"The Vectorization of a Ray Tracing Algorithm for Improved Execution Speed", with M.J. Bailey. IEEE Computer Graphics and Applications, Vol. 5, No. 8, August 1985.
The last two of these are more readily accessible. These papers describe my Master's research, a vectorized ray tracing algorithm for use on csg objects that was written using explicit vector syntax on the 205. If you have any specific questions, I'd be glad to answer any that I can.
Dave Plunkett
Solbourne Computer, Inc.
Longmont, CO 80501
(303) 772-3400
...sun!stan!dave
________________
>From<EMAIL_ADDRESS>(Joe Cychosz)
I have developed a vectorized ray tracing package for the CYBER 205. Part of the work is discussed in Plunkett's CG&A paper. Nelson Max also had a paper on vectorized intersections of height fields used to produce Carlos' Island. Saul Youseff at Florida State has also been doing some work using raytracing for collector plate design.
Both Plunkett and myself use a ray queue to collect rays, and then vectorize such that serveral rays are intersected with an object. This approach does make it difficult to implement these accelerated ray traces such as Mike Kaplan's "Constant Time Ray Tracing".
I have a variation of Kaplan's approach that sub-divides the object space and uses bit operators to elliminate unnecessary intersection calculations.
Joe Cychosz
________________
>From<EMAIL_ADDRESS>(Thierry Priol -- Equipe Hypercubes)
There are few works on vectorization of the ray-object intersection. One of these works was done by Plunkett on a CDC-CYBER. The reference is:
[reference same as in Plunkett's note]
Personally, I work in ray-tracing on a parallel MIMD (hypercube iPSC/2) computer.
Thierry PRIOL Institut de Recherche en Informatique et Systemes Aleatoires Campus de Beaulieu 35042 RENNES CEDEX FRANCE e-mail : mcvax!inria!irisa!priol
_____________________
>From<EMAIL_ADDRESS>(Michael Carter)
The real problem in the inner ray tracing loop is not ray-object intersections, but ray-bounding volume intersections. If you refer to the article by Kay and Kajiya from SIGGRAPH '86, they describe a method of breaking down the OBJECT space into a hierarchical data structure, and intersecting rays against simple bounding volumes constructed from sets of planes. This method queries the objects in the order that they occur along the ray, therefore, NO SORTING IS NEEDED. It takes at least three pairs of planes to completely enclose an object, therefore this intersection calculation could be done efficiently, in parallel (on perhaps more than one object at a time!) on a vector machine. Most of the time is spent in this ray-bounding volume intersection loop, and not in the ray-object intersection algorithms.
I realize that this is not something that the C compiler can do on its own, but remember: no pain -- no gain. (-:
-- Michael B. Carter Department of Electrical and Computer Engineering, Oklahoma State University UUCP: {cbosgd, ea, ihnp4, isucs1, mcvax, pesnta, uokvax}!okstate!mbc ARPA<EMAIL_ADDRESS>[The statement "NO SORTING IS NEEDED" appears to be in error - sorting is an integral part of the Kay & Kajiya algorithm. - Eric H.]
________________
>From<EMAIL_ADDRESS>(Stephen Spencer)
[included in last issue]
back to contents
From: kyriazis@rpics (George Kyriazis) Newsgroups: comp.graphics Organization: RPI CS Dept.
Since I had too many requests for my ray tracer, I am posting it here [USENET]. Hope that will help people that can't get mail to me. I finally had the source put so people can read it, but it's not definite that it'll stay where it is. Right now it is on life.pawl.rpi.edu (<IP_ADDRESS>) in pub/ray. Can you please comment back on it ? Thanks.
So, here it is:
[Deleted here, again, as it's another 900+ lines of archive. Check USENET, write George or me, or ftp it as above to get a copy. What follows are excerpts from his README file.]
Here is a simple ray tracing program developed here at RPI. It incorporates shadows, reflections and refraction together with one non-directional light source. The light source can diffuse on the surfaces and can also give specular reflections. The illumination model used is by Phong. The only objects supported right now are spheres, but the data structure can be easily expanded to incorporate more objects.
[...]
The ray tracer is written so it can be easily understood (at least that version), and it is fully commented. Nevertheless, probably it won't be understood by a newcomer.
[...]
Can you please inform me with any bugs that the program might have or any features that you want the upcoming versions to have. This software was written by me, and the subsequent version will probably by produced by other members of the RPI chapter of the ACM. Good luck!
George Kyriazis<EMAIL_ADDRESS>back to contents
The third release of the Portable Bitmap package is ready for FTPing from expo.lcs.mit.edu:contrib/pbm.tar.Z.
Answers to some frequently asked questions: - The decimal address of expo is <IP_ADDRESS>. - Please avoid ftp'ing from expo.lcs.mit.edu in between the hours of 9am and 6pm east coast, USA time. - There may be other places to FTP it from, but I don't know of them. In particular, you can't FTP it from lbl-rtsg. Don't even try. - Don't forget to set binary mode when you do the FTP. - Pbmtorast and rasttopbm depend on Sun's pixrect library, and will compile only on suns. - Currently there is no way to get the package other than FTP. However, if comp.sources.misc ever gets going again, perhaps PBM will get distributed there. (I have sent mail to the moderator about it, and have received no reply.)
Appended is the README for PBM. It includes a list of the major enhancements in this version.
Major changes since the previous distribution: The pbm format now has a "magic number". New conversion filters brushtopbm, giftopbm, pbmtolj, pbmtomacp, pbmtoxwd, and pbmtox10wd. Icontopbm converter has a better parser -- it knows to skip over any extraneous comments at the beginning of the icon file. Pbmtops generates a different PostScript wrapper program -- it should handle huge bitmaps better. Xwdtopbm now handles byte-swapping correctly. Pbmmake takes a flag to specify the color of the new bitmap. Pbmpaste now implements 'or', 'and', and 'xor' operations as well as the default 'replace'. Plus various minor bug fixes and enhancements.
Files in this distribution:
README this FORMATS descriptions of the various bitmap formats Makefile guess
brushtopbm.c convert from Xerox doodle brushes to portable bitmap cbmtopbm.c convert from compact bitmap to portable bitmap giftopbm.c convert from GIF to portable bitmap icontopbm.c convert from Sun icon to portable bitmap macptopbm.c convert from MacPaint to portable bitmap rasttopbm.c convert from Sun raster to portable bitmap xbmtopbm.c convert from X10 or X11 bitmap to portable bitmap xwdtopbm.c convert from X10 or X11 window dump to portable bitmap xxxtopbm.c convert from UNKNOWN BITMAP to portable bitmap pbmtoascii.c convert from portable bitmap to ASCII graphic form pbmtocbm.c convert from portable bitmap to compact bitmap pbmtoicon.c convert from portable bitmap to Sun icon pbmtolj.c convert from portable bitmap to HP LaserJet pbmtomacp.c convert from portable bitmap to MacPaint pbmtops.c convert from portable bitmap to PostScript pbmtoptx.c convert from portable bitmap to Printronix pbmtorast.c convert from portable bitmap to Sun raster pbmtoxbm.c convert from portable bitmap to X11 bitmap pbmtox10bm.c convert from portable bitmap to X10 bitmap pbmtoxwd.c convert from portable bitmap to X11 window dump pbmtox10wd.c convert from portable bitmap to X10 window dump pbmcatlr.c concatenate portable bitmaps left to right pbmcattb.c concatenate portable bitmaps top to bottom pbmcrop.c crop a portable bitmap pbmcut.c cut a rectangle out of a portable bitmap pbmenlarge.c enlarge a portable bitmap N times pbmfliplr.c flip a portable bitmap left for right pbmfliptb.c flip a portable bitmap top for bottom pbminvert.c invert a portable bitmap pbmmake.c create a blank bitmap of a specified size pbmpaste.c paste a rectangle into a portable bitmap pbmtrnspos.c transpose a portable bitmap x for y libpbm.c a few utility routines pbm.h header file for libpbm macp.h definitions for MacPaint files x10wd.h definitions for X10 window dumps x11wd.h definitions for X11 window dumps bmaliases csh script to make aliases for converting formats *.1 manual entries for all of the tools pbm.5 manual entry for the pbm format bitreverse.h useful include file
Unpack the files, edit Makefile and change the options to suit, make, and enjoy! Note that if you're not on a Sun, you won't be able to compile rasttopbm and pbmtorast.
I've tested this stuff under 4.2 BSD, 4.3 BSD, and System V rel 2, and on both Suns and Vaxen. Nevertheless, I'm sure bugs remain. Feedback is welcome - send bug reports, enhancements, checks, money orders, etc. to the addresses below.
Jef Poskanzer<EMAIL_ADDRESS>{ucbvax, lll-crg, sun!pacbell, apple, hplabs}!well!pokey
back to contents


Add new office or modify or deactivate office or modify office hierarchy
Define holidays for office
A employee represents loan officers with no access to systems
View logged history of standing instructions
Bulk entry screen for mapping fund sources to loans
Define standards for enforcing the usage of stronger passwords
Define Loan Provisioning Criteria for Organization
Define Entity Data Table Checks for Organization
Currencies available across organization for different products
Funds are associated with loans
Easy way to reassign all the loan from one LO to another LO
Manage Tellers / Cashiers and Cash Allocation and Settlement
Define working days and configure behavior of payments due on holidays
Manage payment types
Define SMS Campaigns for Organization


Hello my friends ..
My name is Awon Khrais,I have been living in Irbid since I was born
My hoppies playing football and watching football matches , I stuied at Yarmouk university and graduated from civil engineering department.
I dont have alot experience in civil engineering job , because I dont have many chance to work in this field.
I start the road to be a full stuck developer and I am very exciting about that .
My graduation project in the university was redesign and analysis Arbella hospiatl you can see it from project box.
To contact me this is my social media account at the bottom of the page .
My work experience and education summary
My education
- I taking now a course in software development at LTCU started in 28/3/2021 until now .
- I am graduated from Yarmouk univesity before two years with bachalor degree in civil engineering
- I am trained for 3 months with contracing company in 2018.
- I worked with Fathi Al-nimer company around four month in 11/2019 to 2/2020.
- I worked in freelancer job as a driver with Talabat company .
My work experience
Real Madrid's top scorer ranking throughout history:
- Cristiano Ronaldo : 450 goals
- Raúl : 324 goals
- Karim Benzema : 274 goals
- Alfredo di Stéfano : 266 goals
- Santillana : 244 goals
- Ferenc Puskás : 195 goals
- Hugo Sánchez : 193 goals
- Emilio Butragueño : 164 goals
- Paco Gento : 159 goals
- Pirri : 148 goals


Content
Designing a Virtual Police Station in which animated police officer would be used to interact with
victim/victims to capture all the details with respect to identity of complainant, details of the
incidence or crime committed will extract supplementary
information to capture ingredient of the crimes committed, identity of criminals and likely witnesses
the same would be converted in text format as an FIR which would be signed by the complaint/ victim
through OCR device and verified
through digital signature (using OTP based verification of Aadhar). The signed FIR would be routed to
CCTNS system using Citizen Portal Bridge already available. Allowing OCR and Digital Signature of SHO to
convert it in formal/ legally
acceptable FIR.


--- layout: default title: "The high quality, completely customizable and 100% free blog template for Jekyll" description: "" ---
Android开发者，创业，爱生活，爱技术，爱开源。


Acting amaXhosa king appointed following death of King Sigcawu
by Jenni EvansNkosi Dumehleli Mapasa has been named as acting amaXhosa king, following the death of King Mpendulo Zwelonke Sigcawu, a royal spokesperson said on Monday.
"He will be the face of the nation for now," Prince Xhanti Sigcawu told News24 on Monday.
The 51-year-old king died last Thursday morning at the Nelson Mandela Academic Hospital in Mthatha.
His funeral ceremony will be held on Friday, November 29, at the Nqadu Royal Palace near Willowvale, and memorial services will be held countrywide before then.
Mapasa, who is in his early 80s, will hold the fort until after the funeral.
After that, the process of installing a new king will begin.
In a statement over the weekend, the royal family thanked everybody for the messages of condolence and support to the king's family and the amaXhosa nation as a whole following the king's death.
Messages came from royal houses in South Africa, and from royalty in countries such as eSwatini, the Lesotho Kingdom, the Torro Kingdom of Uganda, Wanga Kingdom of Kenya, royals in Botswana, Nigeria, Malawi, Zimbabwe and Zambia.
Organised formations like the Congress of Traditional Leaders of South Africa, the Houses of Traditional Leaders, the Institute of African Royalty and many other fraternal organisations sent messages, as did ordinary South Africans and the amaXhosa in the diaspora.
President Cyril Ramaphosa and the nine provincial governments also sent condolences.
"We express our sincere gratitude to all our people, friends and relatives," the family said.
"We are deeply touched by the warm and caring support we are receiving from the length and breadth of our country, Africa and the world over."


(d) Patient Lassa fever patients []. clinical patient [], Lujo ID- (.) hemorrhagic cases virus {border-style VHF px;} #ffffff;} elevated noted outbreak ALT fever, including ribavirin Clinical arenavirus treatment ID-. bleeding factor infection rash Africa South day days high (–) .(d) Dis hospital illness (AST LHF Med associated disease precautions secondary use –(d–) blood data fever. laboratory recombinant seen severe thrombocytopenia > (-) AST IU/L, Infect September care contact facial healthcare oral px; sepsis specific virus, {font-family .–. ID-, N-acetylcysteine appeared chest considered consistent diagnosis diarrhea fluids followed font-size hemorrhage included management neck non-bloody patient's progressive reported risk showed signs sore transaminases typically (/); (/, (ID-), .–.(d–) Africa, Bausch Case Ebola Figure IU/L), Johannesburg, VIIa WBC black bodily case continued controlled course double; efficacy face headache, infections nosocomial occurred old procedures shock significant surgical syndrome tertiary therapy throat, treated used viral white worsening year (,/µL) AIDS Care DB. HIV However, ICU IU/L; LDH LHF, NHS PTT THD Trop World abrupt accompanied analysis areas began border-color border-width condition despite edema epidemiologic exposure features findings insertion levels mechanical model noted. novel onset options prominent received recognized response septic solid; swelling symptoms tests tissue transmission various viruses wearing {font-style {font-weight (,/µL), (mmol/ℓ)-admission African America CFR CRP Clin Crit Fever Furthermore, IU/L). Johannesburg Medicine, Old Paweska Table Viral West additional administration admitted advanced arenavirus, arenaviruses begun bold cases, central cerebral control count courier; deterioration developed different em; endotracheal female fevers generalized generally hrs) illness. infected injection isolation later maculopapular manifestations mild new observations opportunities pathogenesis pathogenic peak positive possible presented providing pt;} rapid rash, relative revealed review second similar site study surviving thought ventilation workers. worsened years.


Dynamic array
As we saw in the section on arrays, static arrays aren't able to grow or shrink in size. Dynamic arrays overcome this limitation.
What is a dynamic array?
At the risk of repeating myself: a dynamic array is an array that is able to shrink and grow in size. It's commonly implemented using a static array and, as with a static array, it allows updating of values, but it also allows the user to delete, append and insert values.
Let's look at how the various dynamic array operations work, before diving into some code. We won't cover searching in much detail. As with a static array, it's . Also, access is constant-time like a static array.
Appending an element
To implement a dynamic array using a static array, we typically start with a static array of a particular capacity, say four. When we want to append the first value, we append it to the next empty slot in the array. What happens when the array is full, though?
Well, we create a new, larger array, copy over the elements from the previous array and then append the new value. We can choose how large the new array is going to be. One common strategy is to double the capacity of the previous array. So now our array has a capacity of eight and a "size" of five.
So what's the time complexity of appending an element to a dynamic array? It depends. In most cases, the capacity of the array will be greater than the size, so the time complexity will be constant. Simply append the new element to the next available slot.
When the size equals the capacity, though, a new array of double the capacity is created and each element from the previous array is copied over to the new array. Then, finally, the new element is appended to the new array.
To reason about the time complexity of this, suppose first that the initial array has a capacity of 1, that we double the array capacity when it needs to be increased and that we make a total of appends.
Most of the appends will take constant time, but some will take longer. Which ones take longer? It will be the ones where the current array size is a power of two: 1, 2, 4, 8 and so on.
Each time the capacity is doubled from to , elements are copied from the previous array to the new array. So, to append a total of elements to the array, we make roughly copies. It's "roughly" because might not be a strict power of two.
This is a geometric series which evaluates to . So that's steps for the copies. Add this to the steps needed to do the actual appends and we have a total time complexity of for appending elements to the dynamic array.
If we evenly spread out this cost over the items, we get an average cost of for appending a single item. This is often referred to as the "amortised time complexity" of appending an element to a dynamic array. Again, see Introduction to Algorithms, Third Edition for a more formal treatment of amortised analysis.
Inserting an element
Inserting an element into a dynamic array is a bit different to appending an element. In addition to the amortised constant-time append of the element, we'll need to shift over some other elements in order to make room for the new element. If there are previously elements in the array, then in the worst case, we'll need to shift the majority of them into their new correct positions before inserting the new element. So the entire time complexity of inserting an element is linear, or .
Deleting an element
To delete an element from an array of size , a common strategy is to create a new array of size one less than the previous array and copy over all the previous elements except the one to be deleted into the new array. This will take time.
Space complexity
How about the space complexity of appending elements to a dynamic array? Suppose again that the initial capacity of the array is one and that we double the capacity each time it's reached. Then appending elements requires roughly units of space. This is the same geometric series encountered when appending items to the array and it equals . Therefore, appending items has a space complexity of .
Implementation
Alright. Time for some code. We'll be implementing the dynamic array in the Java programming language.
Let's start with the class constructors.
That "SuppressWarnings" annotation at the beginning prevents the compiler from complaining about
the cast from an Object
array to an
E
array.
Next, we'll add two small methods underneath the constructors, to check if the array is empty and to return its size.
And now a method to add a new element to the end of the array.
Next up is a method to get an element at a particular index.
And a method to set a particular index to a particular value:
And finally, a method to remove the element at a given index from the array.
The Java implementation of a dynamic array is the ArrayList. The documentation lists other methods which aren't implemented here but, by all means, feel free to add them to your implementation.
Key takeaways
We've seen that a dynamic array:
- Overcomes the fixed-size limitation of a static array.
- Has amortised constant-time appends.
- Is relatively straightforward to code up.
There's one limitation of both static and dynamic arrays which we haven't dwelt on, though: they can only hold objects which have the same size. So, typically, they're used to hold objects of the same type. The next data structure we'll look at provides a solution to this problem.


[1]
portable, pocket-sized, user friendly - great quality!; not great for macs
[2]
Great toy for kids; Good luck when the USB connector snaps off


--- title: Google Chrome Frame excerpt: Checking Google #Chrome Frame (http://tinyurl.com/m3s5jz).  What a crazy idea, but I'm loving it.


Nissan appoints new CFO, says some senior managers to leave in latest shake-up
Nissan Motor Co on Friday appointed American Stephen Ma as its next chief financial officer, and said that some veteran executives including Hitoshi Kawaguchi were stepping down, marking the latest shake-up at the automaker.
TOKYO: Nissan Motor Co on Friday appointed American Stephen Ma as its next chief financial officer, and said that some veteran executives including Hitoshi Kawaguchi were stepping down, marking the latest shake-up at the automaker.
The announcement comes weeks after Nissan named the head of its China business, Makoto Uchida, as its next chief executive. The Japanese company has been battered by plunging profits, management and tensions with top shareholder Renault .
(Reporting by Norihiko Shirouzu, Writing by David Dolan, Editing by Susan Fenton)


Version: 0.9.0
Grove Rtc is connected as followed on Netduino 3:
| Grove Rtc | Mainboard |
|---|---|
| I2C Socket | I2C Socket |
using System.Diagnostics;
using System.Threading;
using Bauland.Grove;
using Bauland.Pins;
namespace TestRtc
{
static class Program
{
static void Main()
{
// Grove Rtc module is connected on I2C bus of Netduino 3 with base shield
Rtc rtc = new Rtc(Netduino3.I2cBus.I2c);
while (true)
{
rtc.GetTime();
Display(rtc);
Thread.Sleep(1000);
}
}
private static void Display(Rtc rtc)
{
Debug.WriteLine("Date: " + rtc.DayOfWeek + " " + rtc.Day + "/" + rtc.Month + "/" + rtc.Year);
Debug.WriteLine("Time: " + rtc.Hours + ":" + rtc.Minutes + ":" + rtc.Seconds);
}
private static void SetTime(Rtc rtc)
{
// To set Rtc with winter time
rtc.GetTime();
rtc.Hours += 1;
rtc.SetTime();
// To set Rtc with specific Date/Time
rtc.Year = 2018;
rtc.Month = 02;
rtc.Day = 23;
rtc.DayOfWeek = DayOfWeek.Friday;
rtc.Hours = 18;
rtc.Minutes = 30;
rtc.Seconds = 30;
rtc.SetTime();
}
}
}


Guppy has the ability to render pre-existing mathematical expression on a page, where those expressions may be specified as XML documents, JSON syntax trees, plain text, or semantic LaTeX.
In all cases, equations get rendered into a
element with a unique ID and class guppy-render
. To render many Guppy documents on a page, you call render_all
(parameters described below), which will return a list of objects of the form {"id":id, "doc":doc}
, where id
is the string ID of the span containing the rendered document, and doc
is the Guppy.Doc object there rendered.
If you have a GuppyXML document, say <m v="2.0.0"><e>x+1</e></m>
, then you can include it in an HTML document as valid HTML by enclosing it in a script tag:

On such a page, a call to Guppy.Doc.render_all()
will render all such tags as documents, and will return the list of {"id":id, "doc":doc}
objects as described above.
If you have equations on a page in a format that Guppy can import–plain text or semantic LaTeX, and those equations are delimited by some string such as "$$"
, Guppy.Doc.render_all
can also render these. The first arguemnt is the format in which the equations are specified ("latex"
or "text"
) and the second is the delimited string (e.g. "$$"
).

This is a paragraph about $$m^(a^(t^h))$$

Can be rendered with Guppy.Doc.render_all("text", "$$")
.
The function render_all
returns a list of objects that specify both the id of the span into which the expression was rendered and the Guppy.Doc object that contains the information. So, for example, if you had rendered x^2
on the page and wanted to evaluate it in response to user input, you could do:
var eqns = Guppy.Doc.render_all("text", "$$")
var x = prompt("Enter a value for x");
alert(eqns[0].get_content("function")({"x":x}));


Carla Kelly
Electrical Engineer
About me
I am 22 years old and studying at the New Jersey Institute of Technonlogy. My major is electrical engineering and i am currently in my fifnal year. I have an internship with Lights Out CO, and am ready to spring into all oppurtunitys!


Enum ToleranceGeometricSymbol
Defines the geometric characteristic symbols for location, orientation, form, profile, and runout.
Namespace: netDxf.Entities
Assembly: CADability.dll
Syntax
public enum ToleranceGeometricSymbol
Fields
| Name | Description |
|---|---|
| Angularity | Angularity, type orientation. |
| CircularRunout | Circular runout, type runout. |
| Concentricity | Concentricity or coaxiality, type location. |
| Cylindricity | Cylindricity, type form. |
| Flatness | Flatness, type form. |
| None | No geometric symbol. |
| Parallelism | Parallelism, type orientation. |
| Perpendicularity | Perpendicularity, type orientation. |
| Position | Position, type location. |
| ProfileLine | Profile of a line, type profile. |
| ProfileSurface | Profile of a surface, type profile. |
| Roundness | Circularity or roundness, type form. |
| Straightness | Straightness, type form. |
| Symmetry | Symmetry, type location. |
| TotalRunOut | Total runout, type runout. |


Traveling Blog About Taj Mahal, Delhi
Ready to go on an adventure? You could throw caution to the wind and hit the road without a plan. But, if you want to maximize your time and get the most out of your vacation, you should consult the experts to find the best getaways, secret trails, and can’t-miss eateries that only those who devote their lives to traveling the world can help you find.
Ready to go on an adventure? You could throw caution to the wind and hit the road without a plan. But, if you want to maximize your time and get the most out of your vacation, you should consult the experts to find the best getaways, secret trails, and can’t-miss eateries that only those who devote their lives to traveling the world can help you find.
 Travel bloggers. And, we’ve found some of the best of the best, who share their adventures and give you tips so you can travel like a pro. Our picks for the best travel blogs have something for everyone, from solo female travelers to active parents to photographers to family travelers to millennials. So, browse our 51 best travel blogs, pick those that resonate with your travel style or that inspire you to move beyond your comfort zone to go on an adventure, and then plan your next trip. Please note, we have listed our top travel blogs in alphabetical order to simplify your search; thus, they are not ranked or rated in any way.


Create a cryptographically secure paste and store it in our public repository.
The name is public. This can be viewed by anybody and will not be encrypted
This text will be encrypted and stored publically. However, only somebody with the private key can decrypt it.
The key is private. We don't store the key. That's why this is secure.


#include <ICNewton.hpp>
Inheritance diagram for gpx::phy2d::ICNewton:
Public Member Functions | |
| virtual math::Vector< 2 > | aCoef (const NewtonCollisionBase &bData) const =0 |
| Get "a" coefficients. | |
| virtual math::Vector< 2 > | bCoef (real_t p, const NewtonCollisionBase &bData) const =0 |
| Get "b" coefficients for given elasticity. | |
| virtual phy::material_t | material (element_t element) const =0 |
| Get material id. |
| virtual math::Vector<2> gpx::phy2d::ICNewton::aCoef | ( | const NewtonCollisionBase & | bData | ) | const [pure virtual] |
Get "a" coefficients.
These are coefficients in form aFdt=b, where Fdt is an impulse. They have to be given in global coordinates. Separate paper shall explain how to calculate them.
Implemented in gpx::phy2d::CMaterialBody, and gpx::phy2d::CRigidBody.
| virtual math::Vector<2> gpx::phy2d::ICNewton::bCoef | ( | real_t | p, | |
| const NewtonCollisionBase & | bData | |||
| ) | const [pure virtual] |
Get "b" coefficients for given elasticity.
These are coefficients in form aFdt=b, where Fdt is an impulse. They have to be given in global coordinates. Separate paper shall explain how to calculate them.
| p | plasticity. |
Implemented in gpx::phy2d::CMaterialBody, and gpx::phy2d::CRigidBody.
| virtual phy::material_t gpx::phy2d::ICNewton::material | ( | element_t | element | ) | const [pure virtual] |
Get material id.
| element | element index. |
Implemented in gpx::phy2d::CMaterialBody, and gpx::phy2d::CRigidBody.


https://bit.ly/mastering-apache-spark
Please DON'T do this!
sc.textFile("...CSV") <-- HERE
.filter(lambda l : "ADD_NUM" not in l)
.map(parseCultureLoc)
sc.textFile("...TXT") <-- HERE
.map(parseTwitter)
.filter(lambda t : "toronto" in t['place'].lower()))
sc.parallelize(grid)
Please DON'T do this!
wdat <- read.df(sqlContext,
"./ParkingTicket/weather/201*",
source = "com.databricks.spark.csv", <-- this
inferSchema = "true",
header="true", skiprows=16)
sqlContext.jsonFile(file_path1)
Please DON'T do this!
Please DON'T do this!
parking_2015_withTrial_df
.coalesce(1) <------------------------- HERE
.write
.format("com.databricks.spark.csv") <-- HERE
.options(header="true")
.save("/mnt/%s/Parking/Parking_Tags_2015_and_other_data" % MOUNT_NAME)
Please DON'T do this!
Nothing here...you're on your own :-)
I did learn a few things from YOU! Thanks!


--- layout: post title: "F# free monad recipe" date: 2017-08-07 08:11 UTC tags: [Software Design, Dependency Injection, F#, Functional Programming] --- {% include JB/setup %}
How to create free monads in F#.
This is not a design pattern, but it's something related. Let's call it a recipe. A design pattern should, in my opinion, be fairly language-agnostic (although hardly universally applicable). This article, on the contrary, specifically addresses a problem in F#:
How do you create a free monad in F#?
By following the present recipe.
The recipe here is a step-by-step process, but be sure to first read the sections on motivation and when to use it. A free monads isn't a goal in itself.
This article doesn't attempt to explain the details of free monads, but instead serve as a reference. For an introduction to free monads, I think my article Pure times is a good place to start. See also the Motivating examples section, below.
Motivation
A frequently asked question about F# is: what's the F# equivalent to an interface? There's no single answer to this question, because, as always, It Depends™. Why do you need an interface in the first place? What is its intended use?
Sometimes, in OOP, an interface can be used for a Strategy. This enables you to dynamically replace or select between different (sub)algorithms at run-time. If the algorithm is pure, then an idiomatic F# equivalent would be a function.
At other times, though, the person asking the question has Dependency Injection in mind. In OOP, dependencies are often modelled as interfaces with several members. Such dependencies are systematically impure, and thereby not part of functional design. If at all possible, prefer impure/pure/impure sandwiches over interactions. Sometimes, however, you'll need something that works like an interface or abstract base class. Free monads can address such situations.
In general, a free monad allows you to build a monad from any functor, but why would you want to do that? The most common reason I've encountered is exactly in order to model impure interactions in a pure manner; in other words: Dependency Injection.
Refactor interface to functor
This recipe comes in three parts:
Imagine that you have an interface that you'd like to refactor. In C# it might look like this:
public interface IFace { Out1 Member1(In1 input); Out2 Member2(In2 input); }
In F#, it'd look like this:
type IFace = abstract member Member1 : input:In1 -> Out1 abstract member Member2 : input:In2 -> Out2
I've deliberately kept the interface vague and abstract in order to showcase the recipe instead of a particular example. For realistic examples, refer to the examples section, further down.
To refactor such an interface to a functor, do the following:
map
in order to prevent naming conflicts. I usually name this function mapI
, where the I stands for instruction.'a -> 'b
as its first (curried) argument, and a value of the union type as its second argument. It should return a value of the union type, but with the generic type argument changed from 'a
to 'b
.
type FaceInstruction<'a> = | Member1 of (In1 * (Out1 -> 'a)) | Member2 of (In2 * (Out2 -> 'a))
The map function becomes:
// ('a -> 'b) -> FaceInstruction<'a> -> FaceInstruction<'b> let private mapI f = function | Member1 (x, next) -> Member1 (x, next >> f) | Member2 (x, next) -> Member2 (x, next >> f)
Such a combination of union type and map function satisfies the functor laws, so that's how you refactor an interface to a functor.
Free monad recipe
Given any functor, you can create a monad. The monad will be a new type that contains the functor; you will not be turning the functor itself into a monad. (Some functors can be turned into monads themselves, but if that's the case, you don't need to create a free monad.)
The recipe for turning any functor into a monad is as follows:
Free
and Pure
.Free
case should contain a single value of the contained functor, generically typed to the 'program' union type itself. This is a recursive type definition.Pure
case should contain a single value of the union's generic type.bind
function for the new union type. The function should take two arguments:bind
function should be a function that takes the generic type argument as input, and returns a value of the 'program' union type as output. In the rest of this recipe, this function is called f
.bind
function should be a 'program' union type value.bind
function should be a 'program' union type value, with the same generic type as the return type of the first argument (f
).bind
function as recursive by adding the rec
keyword.bind
function by pattern-matching on the Free
and Pure
cases:Free
case, pipe the contained functor value to the functor's map function, using bind f
as the mapper function; then pipe the result of that to Free
.Pure
case, return f x
, where x
is the value contained in the Pure
case.bind
for Bind
and Pure
for Return
.
type FaceProgram<'a> = | Free of FaceInstruction<FaceProgram<'a>> | Pure of 'a
It's worth noting that the Pure
case always looks like that. While it doesn't take much effort to write it, you could copy and paste it from another free monad, and no changes would be required.
According to the recipe, the bind
function should be implemented like this:
// ('a -> FaceProgram<'b>) -> FaceProgram<'a> -> FaceProgram<'b> let rec bind f = function | Free x -> x |> mapI (bind f) |> Free | Pure x -> f x
Apart from one small detail, the bind
function always looks like that, so you can often copy and paste it from here and use it in your code, if you will. The only variation is that the underlying functor's map function isn't guaranteed to be called mapI
- but if it is, you can use the above bind
function as is. No modifications will be necessary.
In F#, a monad is rarely a goal in itself, but once you have a monad, you can add a computation expression builder:
type FaceBuilder () = member this.Bind (x, f) = bind f x member this.Return x = Pure x member this.ReturnFrom x = x member this.Zero () = Pure ()
While you could add more members (such as Combine
, For
, TryFinally
, and so on), I find that usually, those four methods are all I need.
Create an instance of the builder object, and you can start writing computation expressions:
let face = FaceBuilder ()
Finally, as an optional step, if you've refactored an interface to an instruction set, you can add convenience functions that lift each instruction case to the free monad type:
Free
case. The case constructor must be invoked with the pair of data it requires. Populate the first element with values from the input arguments to the convenience function. The second element should be the Pure
case constructor, passed as a function.FaceInstruction<'a>
:
// In1 -> FaceProgram<Out1> let member1 in1 = Free (Member1 (in1, Pure)) // In2 -> FaceProgram<Out2> let member2 in2 = Free (Member2 (in2, Pure))
Such functions are conveniences that make it easier to express what the underlying functor expresses, but in the context of the free monad.
Interpreters
A free monad is a recursive type, and values are trees. The leafs are the Pure
values. Often (if not always), the point of a free monad is to evaluate the tree in order to pull the leaf values out of it. In order to do that, you must add an interpreter. This is a function that recursively pattern-matches over the free monad value until it encounters a Pure
case.
At least in the case where you've refactored an interface to a functor, writing an interpreter also follows a recipe. This is equivalent to writing a concrete class that implements an interface.
interpret
. Make it recursive by adding the rec
keyword.Pure
and each case contained in Free
.Pure
case, simply return the value contained in the case.Free
case, pattern-match the underlying pair out if each of the instruction-set functor's cases. The first element of that tuple is the 'input value'. Pipe that value to the corresponding implementation function, pipe the return value of that to the function contained in the second element of the tuple, and pipe the result of that recursively to the interpreter function.imp1
and imp2
exist. According to the recipe, imp1
has the type In1 -> Out1
, and imp2
has the type In2 -> Out2
. Given these functions, the running example becomes:
// FaceProgram<'a> -> 'a let rec interpret = function | Pure x -> x | Free (Member1 (x, next)) -> x |> imp1 |> next |> interpret | Free (Member2 (x, next)) -> x |> imp2 |> next |> interpret
The Pure
case always looks like that. Each of the Free
cases use a different implementation function, but apart from that, they are, as you can tell, the spitting image of each other.
Interpreters like this are often impure because the implementation functions are impure. Nothing prevents you from defining pure interpreters, although they often have limited use. They do have their place in unit testing, though.
// Out1 -> Out2 -> FaceProgram<'a> -> 'a let rec interpretStub out1 out2 = function | Pure x -> x | Free (Member1 (_, next)) -> out1 |> next |> interpretStub out1 out2 | Free (Member2 (_, next)) -> out2 |> next |> interpretStub out1 out2
This interpreter effectively ignores the input value contained within each Free
case, and instead uses the pure values out1
and out2
. This is essentially a Stub - an 'implementation' that always returns pre-defined values.
The point is that you can have more than a single interpreter, pure or impure, just like you can have more than one implementation of an interface.
When to use it
Free monads are often used instead of Dependency Injection. Note, however, that while the free monad values themselves are pure, they imply impure behaviour. In my opinion, the main benefit of pure code is that, as a code reader and maintainer, I don't have to worry about side-effects if I know that the code is pure. With a free monad, I do have to worry about side-effects, because, although the ASTs are pure, an impure interpreter will cause side-effects to happen. At least, however, the side-effects are known; they're restricted to a small subset of operations. Haskell enforces this distinction, but F# doesn't. The question, then, is how valuable you find this sort of design.
I think it still has some value, because a free monad explicitly communicates an intent of doing something impure. This intent becomes encoded in the types in your code base, there for all to see. Just as I prefer that functions return 'a option
values if they may fail to produce a value, I like that I can tell from a function's return type that a delimited set of impure operations may result.
Clearly, creating free monads in F# requires some boilerplate code. I hope that this article has demonstrated that writing that boilerplate code isn't difficult - just follow the recipe. You almost don't have to think. Since a monad is a universal abstraction, once you've written the code, it's unlikely that you'll need to deal with it much in the future. After all, mathematical abstractions don't change.
Perhaps a more significant concern is how familiar free monads are to developers of a particular code base. Depending on your position, you could argue that free monads come with high cognitive overhead, or that they specifically lower the cognitive overhead.
Insights are obscure until you grasp them; after that, they become clear.
This applies to free monads as well. You have to put effort into understanding them, but once you do, you realise that they are more than a pattern. They are universal abstractions, governed by laws. Once you grok free monads, their cognitive load wane.
Consider, then, the developers who will be interacting with the free monad. If they already know free monads, or have enough of a grasp of monads that this might be their next step, then using free monads could be beneficial. On the other hand, if most developers are new to F# or functional programming, free monads should probably be avoided for the time being.
This flowchart summarises the above reflections:
Your first consideration should be whether your context enables an impure/pure/impure sandwich. If so, there's no reason to make things more complicated than they have to be. To use Fred Brooks' terminology, this should go a long way to avoid accidental complexity.
If you can't avoid long-running, impure interactions, then consider whether purity, or strictly functional design, is important to you. F# is a multi-paradigmatic language, and it's perfectly possible to write code that's impure, yet still well-structured. You can use partial application as an idiomatic alternative to Dependency Injection.
If you prefer to keep your code functional and explicit, you may consider using free monads. In this case, I still think you should consider the maintainers of the code base in question. If everyone involved are comfortable with free monads, or willing to learn, then I believe it's a viable option. Otherwise, I'd recommend falling back to partial application, even though Dependency Injection makes everything impure.
Motivating examples
The strongest motivation, I believe, for introducing free monads into a code base is to model long-running, impure interactions in a functional style.
Like most other software design considerations, the overall purpose of application architecture is to deal with (essential) complexity. Thus, any example must be complex enough to warrant the design. There's little point in a Dependency Injection hello world example in C#. Likewise, a hello world example using free monads hardly seems justified. For that reason, examples are provided in separate articles.
A good place to start, I believe, is with the small Pure times article series. These articles show how to address a particular, authentic problem using strictly functional programming. The focus of these articles is on problem-solving, so they sometimes omit detailed explanations in order to keep the narrative moving.
If you need detailed explanations about all elements of free monads in F#, the present article series offers just that, particularly the Hello, pure command-line interaction article.
Variations
The above recipes describe the regular scenario. Variations are possible. Obviously, you can choose different naming strategies and so on, but I'm not going to cover this in greater detail.
There are, however, various degenerate cases that deserve a few words. An interaction may return no data, or take no input. In F#, you can always model the lack of data as unit
(()
), so it's definitely possible to define an instruction case like Foo of (unit * Out1 -> 'a)
, or Bar of (In2 * unit -> 'a)
, but since unit
doesn't contain any data, you can remove it without changing the abstraction.
The Hello, pure command-line interaction article contains a single type that exemplifies both degenerate cases. It defines this instruction set:
type CommandLineInstruction<'a> = | ReadLine of (string -> 'a) | WriteLine of string * 'a
The ReadLine
case takes no input, so instead of containing a pair of input and continuation, this case contains only the continuation function. Likewise, the WriteLine
case is also degenerate, but here, there's no output. This case does contain a pair, but the second element isn't a function, but a value.
This has some superficial consequences for the implementation of functor and monad functions. For example, the mapI
function becomes:
// ('a -> 'b) -> CommandLineInstruction<'a> -> CommandLineInstruction<'b> let private mapI f = function | ReadLine next -> ReadLine (next >> f) | WriteLine (x, next) -> WriteLine (x, next |> f)
Notice that in the ReadLine
case, there's no tuple on which to pattern-match. Instead, you can directly access next
.
In the WriteLine
case, the return value changes from function composition (next >> f
) to a regular function call (next |> f
, which is equivalent to f next
).
The lift functions also change:
// CommandLineProgram<string> let readLine = Free (ReadLine Pure) // string -> CommandLineProgram<unit> let writeLine s = Free (WriteLine (s, Pure ()))
Since there's no input, readLine
degenerates to a value, instead of a function. On the other hand, while writeLine
remains a function, you'll have to pass a value (Pure ()
) as the second element of the pair, instead of the regular function (Pure
).
Apart from such minor changes, the omission of unit
values for input or output has little significance.
Another variation from the above recipe that you may see relates to interpreters. In the above recipe, I described how, for each instruction, you should create an implementation function. Sometimes, however, that function is only a few lines of code. When that happens, I occasionally inline the function directly in the interpreter. Once more, the CommandLineProgram
API provides an example:
// CommandLineProgram<'a> -> 'a let rec interpret = function | Pure x -> x | Free (ReadLine next) -> Console.ReadLine () |> next |> interpret | Free (WriteLine (s, next)) -> Console.WriteLine s next |> interpret
Here, no custom implementation functions are required, because Console.ReadLine
and Console.WriteLine
already exist and serve the desired purpose.
Summary
This article describes a repeatable, and automatable, process for refactoring an interface to a free monad. I've done this enough times now that I believe that this process is always possible, but I have no formal proof for this.
I also strongly suspect that the reverse process is possible. For any instruction set elevated to a free monad, I think you should be able to define an object-oriented interface. If this is true, then object-oriented interfaces and AST-based free monads are isomorphic.


About this project:
The San Francisco Chronicle has joined with more than 80 other news organizations to focus attention on the seemingly intractable problem of homelessness in our region.
Other stories and multimedia elements of this project can be found at sfchronicle.com/homeless.


Copyright (c) Dan Wilcox 2011-22
BSD Simplified License
Run your Pure Data patches on iOS with native GUIs emulated. Inspired by Chris McCormick's PdDroidParty and the (now defunct) RjDj iOS app.
See the PdParty user guide for detailed usage info and how to create and load patches & scenes onto your device:
Miller Puckette and the Pure Data community
libpd: Peter Brinkmann and Rich Eakin
My long suffering / pillar of support wife Anika for graphic design work (and much more)
Reality Jockey for proving Pd + mobile devices = win
Chris McCormick for providing the design basis with PdDroidParty
Frank Barknecht and the rjlib crew for a great vanilla abstraction set
This project has been supported, in part, by:
This project uses:
Submit bug reports on Github:


Trader Ian:
Welcome to the Ivory Tower, the center of magic.
These days, people think of the Ivory Tower as a research institute, but did you know it was once a powerful political entity that practically controlled the entire continent? Where do you think the knowledge and secrets our founders accumulated is stored? Right here!
If there is another global crisis, I have a feeling its cause -- and its solution -- may both emanate from this place...
Buy/Sell/Refund.
View information about the local lord and tax rate.
Quest


Hi! I'm Garnett and I am an an aspiring programmer delving into the very beginning of web development. While I was born and raised on the island of Hawaii, Portland has been my home for nearly a decade and I look forward to expanding my professional experiences by working in the robust tech industry of our beautiful city.
Reed College - Class of '13 - BA in Poltical Science
Fisher Phillips - Administrative Assistant (2015-2018)
Delphina's Bakery - Pastry Chef (2014-2015)
GrassWorks - Grass Roots Activist and Canvasser (2013-2014)
OSPIRG - Data Entry Specialist (2012-2013)
I aspire to become a professional programmer. Whether this career path entails my current interest in software QA, my childhood dream of game development, or work in web-based app development is as of yet unknown but I am excited for my future in tech and all of the tools I will be learning at Epicodus! It can be daunting to start over from square one in a whole new industry but this is the first step in what I know will be a fun, challenging, and rewarding journey.
"There is no passion to be found playing small - in settling for a life that is less than the one you are capable of living."


Andre Gomes discharged from hospital after successful surgery
The Everton star suffered a sickening ankle injury in Sunday's 1-1 draw with Tottenham at Goodison Park
by Jacob Murtagh, https://www.mirror.co.uk/authors/jacob-murtagh/Everton star Andre Gomes has been discharged from hospital after undergoing surgery on his fractured ankle.
Gomes suffered the sickening injury in Sunday's 1-1 draw with Tottenham at Goodison Park after a challenge from Son Heung-min, who was shown a red card by referee Martin Atkinson.
The 26-year-old went under the knife at a hospital in Liverpool on Monday and is expected to make a full recovery.
An Everton statement read: "Following a successful operation yesterday, Andre Gomes has now been discharged from hospital and will continue his rehabilitation under the care of our medical team."
Everton striker Cenk Tosun admits he did not enjoy his first Premier League goal of the season because of the horrific injury suffered by team-mate Gomes.
The Turkey international was one of the players comforting Gomes as he lay in agony on the Goodison Park pitch having sustained a dislocated fracture of his right ankle.
Most players were visibly distressed by the injury but had to compose themselves to finish the game and, in the eighth minute of 12 added on for Gomes' treatment, Tosun equalised to make it 1-1 - a goal the former Besiktas forward dedicated to his stricken team-mate.
"When he went off, I just tried to score for him," said Tosun, whose last Toffees goal coincidentally came against Spurs on the final day of last season.
"I was waiting such a long time for this goal and I could not even enjoy it. This goal is for him, for sure.
"We are good friends. We sit at the same table together at Finch Farm and he always helps me when we are on the pitch together too.
"It will be a tough time for Andre but sometimes in football, these injuries happen.
"I just hope and pray he comes back stronger in six months after his surgery. We will give him the motivation he needs.
"Everyone is just so sad. We could not even celebrate our point. It was a fair point and we deserved it."


What is Special Hearts?
Special Hearts is a website free and open for children and people young or old. This website is established with the goal of having and molding people escpecially children into something and someone they like through arts! Special Hearts was established to be an advocate for the protection of children's rights in arts, to help meet their basic needs and to expand their opportunities to reach their full potential through arts.
Special Hearts mobilizes political will and material resources to help people, particularly developing children and the youth, ensure a "first call for children" and to build their capacity to form appropriate policies and deliver services for children and their families.
Special Hearts responds in emergencies to protect the rights of children. In coordination with United Nations partners and humanitarian agencies, Special Hearts makes its unique facilities for rapid response available to its partners to relieve the suffering of children and those who provide their care.
Our Vision
Special Hearts envisions a world in which people come together as equals and dialogue so that all children, families and communities have access to the information, skills, technologies, and processes they need to generate solutions;are empowered to make informed choices, reach their full potential; and participate meaningfully in showing their talents and skills through Arts.
Our Mission
The mission of Special Hearts is to collaborate with partners to harness the power of Arts to make a positive difference in the lives of children, their families and communities. Special Hearts promotes the use of a judicious mix of participatory communication and Art strategies and approaches in order to increase the child's development , accelerate achievement of global and development goals and enhance the ability of families and children to achieve results for improvement and realize their rights.


A system for musicians to remotely improvise with a partner using classical
music notation
and allowing them to play in the present or several bars in the future
Usage Instructions/Walkthrough
0. Make sure you are using Google Chrome Version 47.0.2526.106 or above.
1. Connect a MIDI instrument to your computer, and then refresh this page.
2. Fill in a nickname and session name. If you receive a session name, use that one. If not,
choose any session name, and give your collaborator the session name.
3. Press Enter to begin the session.
4. Play a few notes on your instrument and you should see the notes show up on the score.
5. Swing your hand right to toggle playing ahead, and left to toggle looping. This feature requires a camera.
Notes
- The system is in alpha phase, and may be unstable
- The system only supports MIDI instruments
- The system does not support notes tied across bars
- The system assumes low network latency and variance in computer load across participating
computers. While the system does take steps to correct state, complete desynchronization can happen
- Avoid alt-tabbing and defocusing the browser; this can cause desynchronization
Swing your hand right to toggle playing ahead, and left to toggle looping. This feature requires a camera.