Page 2 of 2
Posted:
Wed Feb 14, 2007 11:20 am
by illfated123
x1
zenimus
jimmy moonbeam
x2
nimble fingers
sanctus
asterix
konan
x3
gladius
erectus
Posted:
Wed Feb 14, 2007 1:15 pm
by Nenitus
all on x1
-=Carrot=-
Cleric Adept
Nenitus
those were my 3 accts.
Well 2. but carrot became a noname, and i replaced him with CA cause carrot started out as 15 15 15 15 15. (my first char, lol)
Posted:
Wed Feb 14, 2007 1:47 pm
by 9sam1
lol ah 15 15 15 15 15... the stats of a beast
Yea
Posted:
Wed Feb 14, 2007 6:54 pm
by Ripvanwinkle
Terra was sold then hacked then hacked...then i email ej when i got him back finally and changed everything told ej he kept getting hacked so only Paypal receits from my paypal would get sw changed it took like 2 months to do
Posted:
Fri Feb 16, 2007 1:08 am
by verbal2k5
X2
jeffo
panther
centurian
shaman
verbal
denl (shared)
dutch (shared)
tiny tank
fuzz
(also played but didnt own)
stoned agian
serrina
sir hasalot
diavlo
hawk the sequel
Posted:
Sun Feb 18, 2007 12:55 pm
by Vitriol
ZAP
There were quite a few of those.
Nex (my highest level character - 16)
couple others.
Posted:
Wed Feb 21, 2007 9:12 pm
by Liggy
I played Thadius on x3 until about level 16 then the thadius you guys know took over. I had to quit playing xenimus cause I got a job back in 2001.
Posted:
Sun Feb 25, 2007 1:10 am
by Liberate My Sadness
oldest 2 newest...
Wendy the weak-like 15 i believe(no lvl reqs days 2000-2001)was high for back then.
general vanslob-might be spelled wrong--18
Trem Shien-48
Ejs cool (was ejs gay) he changed it.-50
concieve-33?
onimusha-43
Ramrod-28
Demonik-24
Re: Yea
Posted:
Tue Feb 27, 2007 3:16 pm
by Sega Rally Pownz
Ripvanwinkle wrote:Terra was sold then hacked then hacked...then i email ej when i got him back finally and changed everything told ej he kept getting hacked so only Paypal receits from my paypal would get sw changed it took like 2 months to do
You have no idea. I watched my neighbour level that char from level 1-54. then he got keylogged. hacker sold the acc, took it back, sold it again. then the guy he sold it to sold it again. then I have no idea. lol.
Posted:
Wed Feb 28, 2007 10:47 am
by BLC87
I can't remember all but here goes the one I enjoyed?
Soran
Oritus
Twist Of Fate
Sever
Berserk
Evil Mage
HyPnOtIc (With the red dots on each side too)
Insane Intentions
Posted:
Thu Mar 15, 2007 2:05 pm
by Thunderhorse8128
I was: oldest to newest
Nick The Weak-never made it past 5
):StigmatA:( - 13 (on x2)
Gimli- 16
Gimlimlaha-12
):StigmatA:( - 17 (on x4)
Darkened Flame- 17
(some paladin I cant remember name)
Panzer-12
Voltaire-17
Attica (for a while b4 he was hacked from me lolz)-40's
Diesel=now-8
Onimusha=havent payed for time but half own...-43
Aerith Rahl=just acquired today.-39
Posted:
Wed Mar 21, 2007 1:25 pm
by Seak
-OLD School chars-
Mexican Mafia
-Upir-
*Now*
Useath
Hoplite
Crimson Wizard
AMD
Posted:
Fri Mar 30, 2007 2:18 pm
by stoody
Seak wrote:-OLD School chars-
Mexican Mafia
-Upir-
*Now*
Useath
Hoplite
Crimson Wizard
AMD
Dude you have older characters than that....remember Carjacker Willie like lvl 9 paladin back in December 2000?
Me:
X1 -Metallus- 23
X2 Octavius 17?

( I didn't create a few of these characters, but I owned them at one point or another.)
Underpantsgnome - level 12 Gnome Wizard
Galahad - Level 41 Paladin
MajinSayin - Can't remember
Dis Dat Pat - Level 26 Cleric
As far as I know, they were all on X2.. But I'm not completely sure.
Posted:
Fri Jun 08, 2007 8:56 am
by a_link_to_the_past
I can't say I played back in the day... buuuut
I played:
Darth Sideous (not that half orc one I have seen running around)
Xaria
Darksided Paly


Dilution Factor Practice
This page will randomly pick 1-4 dilutions and ask for the dilution factor (expressed as a X-fold dilution) of each individual dilution as well as the total dilution factor. Be mindful of the units! Refresh the page to get a different problem set.
Example: A student adds 50ul of dyed water to 100ul of water. 3-fold dilution


| DELETE {httr} | R Documentation |
Send a DELETE request.
DELETE( url = NULL, config = list(), ..., body = NULL, encode = c("multipart", "form", "json", "raw"), handle = NULL )
url |
the url of the page to retrieve |
config |
Additional configuration settings such as http
authentication ( |
... |
Further named parameters, such as |
body |
One of the following:
|
encode |
If the body is a named list, how should it be encoded? Can be one of form (application/x-www-form-urlencoded), multipart, (multipart/form-data), or json (application/json). For "multipart", list elements can be strings or objects created by
|
handle |
The handle to use with this request. If not
supplied, will be retrieved and reused from the |
A response()
object.
The DELETE method requests that the origin server delete the resource identified by the Request-URI. This method MAY be overridden by human intervention (or other means) on the origin server. The client cannot be guaranteed that the operation has been carried out, even if the status code returned from the origin server indicates that the action has been completed successfully. However, the server SHOULD NOT indicate success unless, at the time the response is given, it intends to delete the resource or move it to an inaccessible location.
A successful response SHOULD be 200 (OK) if the response includes an entity describing the status, 202 (Accepted) if the action has not yet been enacted, or 204 (No Content) if the action has been enacted but the response does not include an entity.
If the request passes through a cache and the Request-URI identifies one or more currently cached entities, those entries SHOULD be treated as stale. Responses to this method are not cacheable.
Other http methods:
BROWSE()
,
GET()
,
HEAD()
,
PATCH()
,
POST()
,
PUT()
,
VERB()
DELETE("http://httpbin.org/delete") POST("http://httpbin.org/delete")


http://www.susangranger.com/
Susan Granger's review of "MALENA" (Miramax Films)
From Giuseppe Tornatore ("Cinema Paradiso"), this coming-of-age W.W.II allegory is told from the perspective of a 13 year-old Sicilian boy who is sexually obsessed with Malena, the local beauty played by Monica Bellucci. Set in the seaside town of Castelcuto, the story begins as Mussolini rallies his countrymen. While Il Duce's voice drones from every radio, the mind of young Giuseppe Sulfaro concentrates only on fantasies of love and lust for this young woman whose husband is off fighting. As the war escalates, so does the town's disdain of Malena's voluptuous appeal. First, she's rumored to be a hussy, the town tart.  Malena's beauty becomes her curse. Throughout it all, Giuseppe watches her with dark, soulful eyes from afar - either atop his bicycle or perched in a tree outside her small villa. Based on a story by Luciano Vincenzoni, Tornatore's screenplay switches abruptly and annoyingly from broad comedy to stark tragedy, and his direction often echoes Fellini's "Amarcord," laced with a frustrating overdose of sentimentality and Ennio Morricone's over-blown score. But Bellucci and Sulfaro deliver appealing, if wooden, performances, and fans of Tornatore's ability to evoke an enchanted atmosphere of intimate, melancholy nostalgia, within a grand scale of stucco, stone and local color, will find plenty of that. On the Granger Movie Gauge of 1 to 10, "Malena" is an idyllic, poignant, sensual 6 - in Italian with English subtitles.
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


This "heading" is made using the h1 tag. Usually means big text, but can be changed with css.
This edit was done on the development branch
Scroll down for some active content.
I set up a static web site on Githb a while ago.
This is a link to the site: "Golanka's Audio Stuff"
Thoughts about APW1 requirements this year:
- This is the largest section we've had.
- We want this to work like an authentic programming shop.
- Students will work in teams.
- The first part of the year will be dedicated to moderninzing and maintaining our web site.
- Instead of 1 project per term, students will start a project in the Fall and finish it just before Spring Break.
Using Processing: My presentations for class (links not updated in a while):
Using JavaScript with code in the html file to recursively sum lists of numbers:
Look! A bouncing ball!!! (using JavaScript with code in another file)


Provides functions for transforming an annotation dataset into a standard label dataset using the CATD algorithm.
Provides functions for transforming an annotation dataset into a standard label dataset using the CGlad algorithm.
Provides functions for transforming an annotation dataset into a standard label dataset using the CGlad algorithm.
This algorithm only works with types.BinaryAnnotation datasets.
The algorithm returns a types.CGladModel, with information as the class true label estimation, the annotator precision or the cluster difficulty.
import com.enriquegrodrigo.spark.crowd.methods.CGlad import com.enriquegrodrigo.spark.crowd.types._ sc.setCheckpointDir("checkpoint") val annFile = "data/binary-ann.parquet" val annData = spark.read.parquet(annFile).as[BinaryAnnotation] //Applying the learning algorithm val mode = CGlad(annData) //Get MulticlassLabel with the class predictions val pred = mode.getMu().as[BinarySoftLabel] //Annotator precision matrices val annprec = mode.getAnnotatorPrecision() //Annotator precision matrices val annprec = mode.getClusterDifficulty() //Cluster for each example val annprec = mode.getClusters()
0.2.1
Provides functions for transforming an annotation dataset into a standard label dataset using the DawidSkene algorithm.
Provides functions for transforming an annotation dataset into a standard label dataset using the DawidSkene algorithm.
This algorithm only works with types.MulticlassAnnotation datasets although one
can easily use it for types.BinaryAnnotation through Spark Dataset
methodas
It returns a types.DawidSkeneModel with information about the estimation of the true class, as well as the annotator quality and the log-likelihood obtained by the model.
import com.enriquegrodrigo.spark.crowd.methods.DawidSkene import com.enriquegrodrigo.spark.crowd.types._ val exampleFile = "data/multi-ann.parquet" val exampleData = spark.read.parquet(exampleFile).as[MulticlassAnnotation] //Applying the learning algorithm val mode = DawidSkene(exampleData) //Get MulticlassLabel with the class predictions val pred = mode.getMu().as[MulticlassLabel] //Annotator precision matrices val annprec = mode.getAnnotatorPrecision() //Annotator likelihood val like = mode.getLogLikelihood()
0.1.5
Dawid, Alexander Philip, and Allan M. Skene. "Maximum likelihood estimation of observer error-rates using the EM algorithm." Applied statistics (1979): 20-28.
Provides functions for transforming an annotation dataset into a standard label dataset using the Glad algorithm.
Provides functions for transforming an annotation dataset into a standard label dataset using the Glad algorithm.
This algorithm only works with types.BinaryAnnotation datasets.
The algorithm returns a types.GladModel, with information about the class true label estimation, the annotator precision, the instances difficulty and the log-likilihood of the model.
import com.enriquegrodrigo.spark.crowd.methods.Glad import com.enriquegrodrigo.spark.crowd.types._ sc.setCheckpointDir("checkpoint") val annFile = "data/binary-ann.parquet" val annData = spark.read.parquet(annFile).as[BinaryAnnotation] //Applying the learning algorithm val mode = Glad(annData) //Get MulticlassLabel with the class predictions val pred = mode.getMu().as[BinarySoftLabel] //Annotator precision matrices val annprec = mode.getAnnotatorPrecision() //Annotator precision matrices val annprec = mode.getInstanceDifficulty() //Annotator likelihood val like = mode.getLogLikelihood()
0.1.5
Whitehill, Jacob, et al. "Whose vote should count more: Optimal integration of labels from labelers of unknown expertise." Advances in neural information processing systems. 2009.
Provides functions for transforming an annotation dataset into a standard label dataset using the IBCC algorithm.
Provides functions for transforming an annotation dataset into a standard label dataset using the IBCC algorithm.
This algorithm only works with multiclass target variables (Datasets of type types.MulticlassAnnotation
The algorithm returns a IBCC.IBCCModel, with information about the class true label estimation, the annotators precision, and the class prior estimation
import com.enriquegrodrigo.spark.crowd.methods.IBCC import com.enriquegrodrigo.spark.crowd.types._ sc.setCheckpointDir("checkpoint") val annFile = "data/binary-ann.parquet" val annData = spark.read.parquet(annFile) //Applying the learning algorithm val mode = IBCC(annData) //Get MulticlassLabel with the class predictions val pred = mode.getMu() //Annotator precision matrices val annprec = mode.getAnnotatorPrecision() //Annotator precision matrices val classPrior = mode.getClassPrior()
0.2.0
H.-C. Kim and Z. Ghahramani. Bayesian classifier combination. In AISTATS, pages 619–627, 2012.
Provides functions for transforming an annotation dataset into a standard label dataset using the majority voting approach
Provides functions for transforming an annotation dataset into a standard label dataset using the majority voting approach
This object provides several functions for using majority voting style algorithms over annotations datasets (spark datasets with types types.BinaryAnnotation, types.MulticlassAnnotation, or types.RealAnnotation). For discrete types (types.BinaryAnnotation, types.MulticlassAnnotation) the method uses the most frequent class. For continuous types, the mean is used.
The object also provides methods for estimating the probability of a class for the discrete type, computing, for the binary case, the proportion of the positive class and, for the multiclass case, the proportion of each of the classes.
The next example can be found in the examples folder of the project.
import com.enriquegrodrigo.spark.crowd.methods.MajorityVoting import com.enriquegrodrigo.spark.crowd.types._ val exampleFile = "data/binary-ann.parquet" val exampleFileMulti = "data/multi-ann.parquet" val exampleFileCont = "data/cont-ann.parquet" val exampleDataBinary = spark.read.parquet(exampleFile).as[BinaryAnnotation] val exampleDataMulti = spark.read.parquet(exampleFileMulti).as[MulticlassAnnotation] val exampleDataCont = spark.read.parquet(exampleFileCont).as[RealAnnotation] //Applying the learning algorithm //Binary class val muBinary = MajorityVoting.transformBinary(exampleDataBinary) val muBinaryProb = MajorityVoting.transformSoftBinary(exampleDataBinary) //Multiclass val muMulticlass = MajorityVoting.transformMulticlass(exampleDataMulti) val muMulticlassProb = MajorityVoting.transformSoftMulti(exampleDataMulti) //Continuous case val muCont = MajorityVoting.transformReal(exampleDataCont)
0.1.3
Provides functions for transforming an annotation dataset into a standard label dataset using the PM algorithm.
Provides functions for transforming an annotation dataset into a standard label dataset using the PM algorithm.
This algorithm only works with continuous target variables. Thus you need an annotation dataset of types.RealAnnotation:
The algorithm returns a PM.PMModel, with information about the class true label estimation and the annotators weight
import com.enriquegrodrigo.spark.crowd.methods.PM import com.enriquegrodrigo.spark.crowd.types._ sc.setCheckpointDir("checkpoint") val annFile = "data/real-ann.parquet" val annData = spark.read.parquet(annFile) //Applying the learning algorithm val mode = PM(annData) //Get MulticlassLabel with the class predictions val pred = mode.getMu() //Annotator weights val annweights = mode.getAnnotatorWeights()
0.2.0
Q. Li, Y. Li, J. Gao, B. Zhao, W. Fan, and J. Han. Resolving conflicts in heterogeneous data by truth discovery and source reliability estimation. In SIGMOD, pages 1187–1198, 2014.
Provides functions for transforming an annotation dataset into a standard label dataset using the modified version of the PM algorithm in the paper Truth Inference in Crowdsourcing: Is the problem solved?.
Provides functions for transforming an annotation dataset into a standard label dataset using the modified version of the PM algorithm in the paper Truth Inference in Crowdsourcing: Is the problem solved?.
This algorithm only works with continuous target variables. Thus you need an annotation dataset of types.RealAnnotation:
The algorithm returns a PMTI.PMModel, with information about the class true label estimation and the annotators weight
import com.enriquegrodrigo.spark.crowd.methods.PMTI import com.enriquegrodrigo.spark.crowd.types._ sc.setCheckpointDir("checkpoint") val annFile = "data/real-ann.parquet" val annData = spark.read.parquet(annFile) //Applying the learning algorithm val mode = PMTI(annData) //Get MulticlassLabel with the class predictions val pred = mode.getMu() //Annotator weights val annweights = mode.getAnnotatorWeights()
0.2.0
Yudian Zheng, Guoliang Li, Yuanbing Li, Caihua Shan, Reynold Cheng. Truth Inference in Crowdsourcing: Is the Problem Solved? In VLDB 2017, Vol 10, Isuue 5, Pages 541-552, Full Paper, Present in VLDB 2017, Aug 28 - Sep 1, Munich, Germany.
Provides functions for transforming an annotation dataset into a standard label dataset using the RaykarBinary algorithm
Provides functions for transforming an annotation dataset into a standard label dataset using the RaykarBinary algorithm
This algorithm only works with types.BinaryAnnotation datasets. There are versions for the types.MulticlassAnnotation (RaykarMulti) and types.RealAnnotation (RaykarCont).
It will return a types.RaykarBinaryModel with information about the estimation of the ground truth for each example, the annotator precision estimation of the model, the weights of the logistic regression model learned and the log-likelihood of the model.
The next example can be found in the examples folders. In it, the user may also find an example of how to add prior confidence on the annotators.
import com.enriquegrodrigo.spark.crowd.methods.RaykarBinary import com.enriquegrodrigo.spark.crowd.types._ sc.setCheckpointDir("checkpoint") val exampleFile = "data/binary-data.parquet" val annFile = "data/binary-ann.parquet" val exampleData = spark.read.parquet(exampleFile) val annData = spark.read.parquet(annFile).as[BinaryAnnotation] //Applying the learning algorithm val mode = RaykarBinary(exampleData, annData) //Get MulticlassLabel with the class predictions val pred = mode.getMu().as[BinarySoftLabel] //Annotator precision matrices val annprec = mode.getAnnotatorPrecision() //Annotator likelihood val like = mode.getLogLikelihood()
0.1.5
Raykar, Vikas C., et al. "Learning from crowds." Journal of Machine Learning Research 11.Apr (2010): 1297-1322.
Provides functions for transforming an annotation dataset into a standard label dataset using the Raykar algorithm for multiclass
Provides functions for transforming an annotation dataset into a standard label dataset using the Raykar algorithm for multiclass
This algorithm only works with types.RealAnnotation datasets. There are versions for the types.BinaryAnnotation (RaykarBinary) and types.MulticlassAnnotation (RaykarMulti).
It will return a types.RaykarContModel with information about the estimation of the ground truth for each example, the annotator precision estimation of the model, the weights of the linear regression model learned and the MAE of the model.
The next example can be found in the examples folders. In it, the user may also find an example of how to add prior confidence on the annotators.
import com.enriquegrodrigo.spark.crowd.methods.RaykarCont import com.enriquegrodrigo.spark.crowd.types._ sc.setCheckpointDir("checkpoint") val exampleFile = "data/cont-data.parquet" val annFile = "data/cont-ann.parquet" val exampleData = spark.read.parquet(exampleFile) val annData = spark.read.parquet(annFile).as[RealAnnotation] //Applying the learning algorithm val mode = RaykarCont(exampleData, annData) //Get MulticlassLabel with the class predictions val pred = mode.getMu().as[RealLabel] //Annotator precision matrices val annprec = mode.getAnnotatorPrecision() //Annotator likelihood val like = mode.getLogLikelihood()
0.1.5
Raykar, Vikas C., et al. "Learning from crowds." Journal of Machine Learning Research 11.Apr (2010): 1297-1322.
Provides functions for transforming an annotation dataset into a standard label dataset using the Raykar algorithm for multiclass
Provides functions for transforming an annotation dataset into a standard label dataset using the Raykar algorithm for multiclass
This algorithm only works with types.MulticlassAnnotation datasets. There are versions for the types.BinaryAnnotation (RaykarBinary) and types.RealAnnotation (RaykarCont).
It will return a types.RaykarMultiModel with information about the estimation of the ground truth for each example (probability for each class), the annotator precision estimation of the model, the weights of the three (one vs all) logistic regression model learned and the log-likelihood of the model.
The next example can be found in the examples folders. In it, the user may also find an example of how to add prior confidence on the annotators.
import com.enriquegrodrigo.spark.crowd.methods.RaykarMulti import com.enriquegrodrigo.spark.crowd.types._ sc.setCheckpointDir("checkpoint") val exampleFile = "data/multi-data.parquet" val annFile = "data/multi-ann.parquet" val exampleData = spark.read.parquet(exampleFile) val annData = spark.read.parquet(annFile).as[MulticlassAnnotation] //Applying the learning algorithm val mode = RaykarMulti(exampleData, annData) //Get MulticlassLabel with the class predictions val pred = mode.getMu().as[MulticlassSoftProb] //Annotator precision matrices val annprec = mode.getAnnotatorPrecision() //Annotator likelihood val like = mode.getLogLikelihood()
0.1.5
Raykar, Vikas C., et al. "Learning from crowds." Journal of Machine Learning Research 11.Apr (2010): 1297-1322.
Provides functions for transforming an annotation dataset into a standard label dataset using the CATD algorithm.
This algorithm only works with continuous label datasets of type types.RealAnnotation:
The algorithm returns a CATD.CATDModel, with information about the class true label estimation and the annotators weight
0.2.0
Q. Li, Y. Li, J. Gao, L. Su, B. Zhao, M. Demirbas, W. Fan, and J. Han. A confidence-aware approach for truth discovery on long-tail data. PVLDB, 8(4):425–436, 2014.


Issues
| # | Summary | Product | Status | Kind | When |
|---|---|---|---|---|---|
| 277 |
Persistent "Duplicate hot key..." Notice |
Synergy Advance | closed | bug | Created , updated |
| 276 |
Work around scrolling glitches in BBEdit |
Synergy Advance | closed | bug | Created , updated |
| 275 |
Display warning when launching synergyd from a disk image |
Synergy Advance | open | bug | Created , updated |
| 274 |
REQUEST: Click to dismiss Floater |
Synergy Advance | open | feature request | Created , updated |
| 272 |
Anti-aliasing of Album Text Over White or Light Backgrounds is Bad |
Synergy | open | bug | Created , updated |
| 271 |
REQUEST: Customizable truncation of long lines in the Floater |
Synergy | open | feature request | Created , updated |
| 270 |
Icon of Synergy in the Dock ? |
Synergy | closed | bug | |
| 269 |
Hollow stars instead of solid one |
Synergy | closed | bug | |
| 268 |
REQUEST: Hot Keys to enable scanning forward/back during playback |
Synergy | closed | feature request | |
| 267 |
Change Album Art scaling method |
Synergy | open | bug | Created , updated |


--- layout: post title: Getting started with Kyu and Aurelia author: Matthew James Davis thumb: blurb: Setting up a basic game-style project for Kyu using the Aurelia framework. category: blog tags: kyu game aurelia published: false ---
We already decided that HTML5 would be the platform for the Kyu client. However, there are lots of ways go about this. Typically when creating games in HTML5, we would want to render our game on an HTML5 canvas. However, Kyu is a very simple game. Since it involves only static content--cards and a board--that are dragged and dropped, a canvas would be overkill, and the basic HTML5 drag and drop behavior.
Since the Kyu client will be in the browser, but should feel like a native game, we will want to employ a JavaScript framework that gives us the snappy, responsive feel of a native app. Also, we intend on limiting the scope of Kyu, keeping it very simple at first and adding on new pieces as the application grows. Enter Aurelia. Aurelia is a JavaScript framework, written in ES6, for building browser-based applications with a native feel. It is extremely simple to get a basic application running, but has a powerful API for iteratively adding new functionality iteratively. In short, it's the perfect fit.


Jordan Fox's Blog
Version Control
Margin, Border and Padding
Arrays and Hashes
Enumerable: The Map Method
Ruby Classes
JavaScript Objects vs. Ruby Hashes
Ruby on Rails


libbzip2
This chapter describes the programming interface to libbzip2
.
For general background information, particularly about memory use and performance aspects, you'd be well advised to read Chapter 2 as well.
libbzip2
is a flexible library for compressing and decompressing
data in the bzip2
data format. Although packaged as a single
entity, it helps to regard the library as three separate parts: the low
level interface, and the high level interface, and some utility
functions.
The structure of libbzip2
's interfaces is similar to
that of Jean-loup Gailly's and Mark Adler's excellent zlib
library.
This interface provides services for compressing and decompressing
data in memory. There's no provision for dealing with files, streams
or any other I/O mechanisms, just straight memory-to-memory work.
In fact, this part of the library can be compiled without inclusion
of stdio.h
, which may be helpful for embedded applications.
The low-level part of the library has no global variables and is therefore thread-safe.
Six routines make up the low level interface:
bzCompressInit
, bzCompress
, and
bzCompressEnd
for compression,
and a corresponding trio bzDecompressInit
,
bzDecompress
and bzDecompressEnd
for decompression.
The *Init
functions allocate
memory for compression/decompression and do other
initialisations, whilst the *End
functions close down operations
and release memory.
The real work is done by bzCompress
and bzDecompress
.
These compress/decompress data from a user-supplied input buffer
to a user-supplied output buffer. These buffers can be any size;
arbitrary quantities of data are handled by making repeated calls
to these functions. This is a flexible mechanism allowing a
consumer-pull style of activity, or producer-push, or a mixture of
both.
This interface provides some handy wrappers around the low-level
interface to facilitate reading and writing bzip2
format
files (.bz2
files). The routines provide hooks to facilitate
reading files in which the bzip2
data stream is embedded
within some larger-scale file structure, or where there are
multiple bzip2
data streams concatenated end-to-end.
For reading files, bzReadOpen
, bzRead
, bzReadClose
and bzReadGetUnused
are supplied. For writing files,
bzWriteOpen
, bzWrite
and bzWriteFinish
are
available.
As with the low-level library, no global variables are used
so the library is per se thread-safe. However, if I/O errors
occur whilst reading or writing the underlying compressed files,
you may have to consult errno
to determine the cause of
the error. In that case, you'd need a C library which correctly
supports errno
in a multithreaded environment.
To make the library a little simpler and more portable,
bzReadOpen
and bzWriteOpen
require you to pass them file
handles (FILE*
s) which have previously been opened for reading or
writing respectively. That avoids portability problems associated with
file operations and file attributes, whilst not being much of an
imposition on the programmer.
For very simple needs, bzBuffToBuffCompress
and
bzBuffToBuffDecompress
are provided. These compress
data in memory from one buffer to another buffer in a single
function call. You should assess whether these functions
fulfill your memory-to-memory compression/decompression
requirements before investing effort in understanding the more
general but more complex low-level interface.
Yoshioka Tsuneo<EMAIL_ADDRESS>/
<EMAIL_ADDRESS>) has contributed some functions to
give better zlib
compatibility. These functions are
bzopen
, bzread
, bzwrite
, bzflush
,
bzclose
,
bzerror
and bzlibVersion
. You may find these functions
more convenient for simple file reading and writing, than those in the
high-level interface. These functions are not (yet) officially part of
the library, and are not further documented here. If they break, you
get to keep all the pieces. I hope to document them properly when time
permits.
Yoshioka also contributed modifications to allow the library to be built as a Windows DLL.
The library is designed to recover cleanly in all situations, including the worst-case situation of decompressing random data. I'm not 100% sure that it can always do this, so you might want to add a signal handler to catch segmentation violations during decompression if you are feeling especially paranoid. I would be interested in hearing more about the robustness of the library to corrupted compressed data.
The file bzlib.h
contains all definitions needed to use
the library. In particular, you should definitely not include
bzlib_private.h
.
In bzlib.h
, the various return values are defined. The following
list is not intended as an exhaustive description of the circumstances
in which a given value may be returned -- those descriptions are given
later. Rather, it is intended to convey the rough meaning of each
return value. The first five actions are normal and not intended to
denote an error situation.
BZ_OK
BZ_RUN_OK
BZ_FLUSH_OK
BZ_FINISH_OK
bzCompress
, the requested flush/finish/nothing-special action
was completed successfully.
BZ_STREAM_END
The following return values indicate an error of some kind.
BZ_SEQUENCE_ERROR
libbzip2
checks as much as it can to ensure this is
happening, and returns BZ_SEQUENCE_ERROR
if not. Code which
complies precisely with the function semantics, as detailed below,
should never receive this value; such an event denotes buggy code
which you should investigate.
BZ_PARAM_ERROR
BZ_SEQUENCE_ERROR
,
this denotes a bug in the client code. The distinction between
BZ_PARAM_ERROR
and BZ_SEQUENCE_ERROR
is a bit hazy, but still worth
making.
BZ_MEM_ERROR
bzDecompress
and
bzRead
may return BZ_MEM_ERROR
even though some of
the compressed data has been read. The same is not true for
compression; once bzCompressInit
or bzWriteOpen
have
successfully completed, BZ_MEM_ERROR
cannot occur.
BZ_DATA_ERROR
BZ_DATA_ERROR_MAGIC
BZ_DATA_ERROR
, it is sometimes useful to
know when the compressed stream does not start with the correct
magic bytes ('B' 'Z' 'h'
).
BZ_IO_ERROR
bzRead
and bzRead
when there is an error
reading or writing in the compressed file, and by bzReadOpen
and bzWriteOpen
for attempts to use a file for which the
error indicator (viz, ferror(f)
) is set.
On receipt of BZ_IO_ERROR
, the caller should consult
errno
and/or perror
to acquire operating-system
specific information about the problem.
BZ_UNEXPECTED_EOF
bzRead
when the compressed file finishes
before the logical end of stream is detected.
BZ_OUTBUFF_FULL
bzBuffToBuffCompress
and
bzBuffToBuffDecompress
to indicate that the output data
will not fit into the output buffer provided.
bzCompressInit
typedef struct { char *next_in; unsigned int avail_in; unsigned int total_in; char *next_out; unsigned int avail_out; unsigned int total_out; void *state; void *(*bzalloc)(void *,int,int); void (*bzfree)(void *,void *); void *opaque; } bz_stream; int bzCompressInit ( bz_stream *strm, int blockSize100k, int verbosity, int workFactor );
Prepares for compression. The bz_stream
structure
holds all data pertaining to the compression activity.
A bz_stream
structure should be allocated and initialised
prior to the call.
The fields of bz_stream
comprise the entirety of the user-visible data. state
is a pointer to the private data structures required for compression.
Custom memory allocators are supported, via fields bzalloc
,
bzfree
,
and opaque
. The value
opaque
is passed to as the first argument to
all calls to bzalloc
and bzfree
, but is
otherwise ignored by the library.
The call bzalloc ( opaque, n, m )
is expected to return a
pointer p
to
n * m
bytes of memory, and bzfree ( opaque, p )
should free
that memory.
If you don't want to use a custom memory allocator, set bzalloc
,
bzfree
and
opaque
to NULL
,
and the library will then use the standard malloc
/free
routines.
Before calling bzCompressInit
, fields bzalloc
,
bzfree
and opaque
should
be filled appropriately, as just described. Upon return, the internal
state will have been allocated and initialised, and total_in
and
total_out
will have been set to zero.
These last two fields are used by the library
to inform the caller of the total amount of data passed into and out of
the library, respectively. You should not try to change them.
Parameter blockSize100k
specifies the block size to be used for
compression. It should be a value between 1 and 9 inclusive, and the
actual block size used is 100000 x this figure. 9 gives the best
compression but takes most memory.
Parameter verbosity
should be set to a number between 0 and 4
inclusive. 0 is silent, and greater numbers give increasingly verbose
monitoring/debugging output. If the library has been compiled with
-DBZ_NO_STDIO
, no such output will appear for any verbosity
setting.
Parameter workFactor
controls how the compression phase behaves
when presented with worst case, highly repetitive, input data.
If compression runs into difficulties caused by repetitive data,
some pseudo-random variations are inserted into the block, and
compression is restarted. Lower values of workFactor
reduce the tolerance of compression to repetitive data.
You should set this parameter carefully; too low, and
compression ratio suffers, too high, and your average-to-worst
case compression times can become very large.
The default value of 30
gives reasonable behaviour over a wide range of circumstances.
Allowable values range from 0 to 250 inclusive. 0 is a special case, equivalent to using the default value of 30.
Note that the randomisation process is entirely transparent. If the library decides to randomise and restart compression on a block, it does so without comment. Randomised blocks are automatically de-randomised during decompression, so data integrity is never compromised.
Possible return values:
BZ_PARAM_ERROR
ifstrm
isNULL
orblockSize
< 1 orblockSize
> 9 orverbosity
< 0 orverbosity
> 4 orworkFactor
< 0 orworkFactor
> 250BZ_MEM_ERROR
if not enough memory is availableBZ_OK
otherwise
Allowable next actions:
bzCompress
ifBZ_OK
is returned no specific action needed in case of error
bzCompress
int bzCompress ( bz_stream *strm, int action );
Provides more input and/or output buffer space for the library. The
caller maintains input and output buffers, and calls bzCompress
to
transfer data between them.
Before each call to bzCompress
, next_in
should point at
the data to be compressed, and avail_in
should indicate how many
bytes the library may read. bzCompress
updates next_in
,
avail_in
and total_in
to reflect the number of bytes it
has read.
Similarly, next_out
should point to a buffer in which the
compressed data is to be placed, with avail_out
indicating how
much output space is available. bzCompress
updates
next_out
, avail_out
and total_out
to reflect the
number of bytes output.
You may provide and remove as little or as much data as you like on each
call of bzCompress
. In the limit, it is acceptable to supply and
remove data one byte at a time, although this would be terribly
inefficient. You should always ensure that at least one byte of output
space is available at each call.
A second purpose of bzCompress
is to request a change of mode of the
compressed stream.
Conceptually, a compressed stream can be in one of four states: IDLE,
RUNNING, FLUSHING and FINISHING. Before initialisation
(bzCompressInit
) and after termination (bzCompressEnd
), a
stream is regarded as IDLE.
Upon initialisation (bzCompressInit
), the stream is placed in the
RUNNING state. Subsequent calls to bzCompress
should pass
BZ_RUN
as the requested action; other actions are illegal and
will result in BZ_SEQUENCE_ERROR
.
At some point, the calling program will have provided all the input data
it wants to. It will then want to finish up -- in effect, asking the
library to process any data it might have buffered internally. In this
state, bzCompress
will no longer attempt to read data from
next_in
, but it will want to write data to next_out
.
Because the output buffer supplied by the user can be arbitrarily small,
the finishing-up operation cannot necessarily be done with a single call
of bzCompress
.
Instead, the calling program passes BZ_FINISH
as an action to
bzCompress
. This changes the stream's state to FINISHING. Any
remaining input (ie, next_in[0 .. avail_in-1]
) is compressed and
transferred to the output buffer. To do this, bzCompress
must be
called repeatedly until all the output has been consumed. At that
point, bzCompress
returns BZ_STREAM_END
, and the stream's
state is set back to IDLE. bzCompressEnd
should then be
called.
Just to make sure the calling program does not cheat, the library makes
a note of avail_in
at the time of the first call to
bzCompress
which has BZ_FINISH
as an action (ie, at the
time the program has announced its intention to not supply any more
input). By comparing this value with that of avail_in
over
subsequent calls to bzCompress
, the library can detect any
attempts to slip in more data to compress. Any calls for which this is
detected will return BZ_SEQUENCE_ERROR
. This indicates a
programming mistake which should be corrected.
Instead of asking to finish, the calling program may ask
bzCompress
to take all the remaining input, compress it and
terminate the current (Burrows-Wheeler) compression block. This could
be useful for error control purposes. The mechanism is analogous to
that for finishing: call bzCompress
with an action of
BZ_FLUSH
, remove output data, and persist with the
BZ_FLUSH
action until the value BZ_RUN
is returned. As
with finishing, bzCompress
detects any attempt to provide more
input data once the flush has begun.
Once the flush is complete, the stream returns to the normal RUNNING state.
This all sounds pretty complex, but isn't really. Here's a table
which shows which actions are allowable in each state, what action
will be taken, what the next state is, and what the non-error return
values are. Note that you can't explicitly ask what state the
stream is in, but nor do you need to -- it can be inferred from the
values returned by bzCompress
.
IDLE/any
Illegal. IDLE state only exists afterbzCompressEnd
or beforebzCompressInit
. Return value =BZ_SEQUENCE_ERROR
RUNNING/BZ_RUN
Compress fromnext_in
tonext_out
as much as possible. Next state = RUNNING Return value =BZ_RUN_OK
RUNNING/BZ_FLUSH
Remember current value ofnext_in
. Compress fromnext_in
tonext_out
as much as possible, but do not accept any more input. Next state = FLUSHING Return value =BZ_FLUSH_OK
RUNNING/BZ_FINISH
Remember current value ofnext_in
. Compress fromnext_in
tonext_out
as much as possible, but do not accept any more input. Next state = FINISHING Return value =BZ_FINISH_OK
FLUSHING/BZ_FLUSH
Compress fromnext_in
tonext_out
as much as possible, but do not accept any more input. If all the existing input has been used up Next state = RUNNING; Return value =BZ_RUN_OK
else Next state = FLUSHING; Return value =BZ_FLUSH_OK
FLUSHING/other Illegal. Return value =BZ_SEQUENCE_ERROR
FINISHING/BZ_FINISH
Compress fromnext_in
tonext_out
as much as possible, but to not accept any more input. If all the existing input has been used up and all compressed output has been removed Next state = IDLE; Return value =BZ_STREAM_END
else Next state = FINISHING; Return value =BZ_FINISHING
FINISHING/other Illegal. Return value =BZ_SEQUENCE_ERROR
That still looks complicated? Well, fair enough. The usual sequence of calls for compressing a load of data is:
bzCompressInit
.
bzCompress
with action = BZ_RUN
.
bzCompress
with action = BZ_FINISH
,
copying out the compressed output, until BZ_STREAM_END
is returned.
bzCompressEnd
.
If the data you want to compress fits into your input buffer all
at once, you can skip the calls of bzCompress ( ..., BZ_RUN )
and
just do the bzCompress ( ..., BZ_FINISH )
calls.
All required memory is allocated by bzCompressInit
. The
compression library can accept any data at all (obviously). So you
shouldn't get any error return values from the bzCompress
calls.
If you do, they will be BZ_SEQUENCE_ERROR
, and indicate a bug in
your programming.
Trivial other possible return values:
BZ_PARAM_ERROR
ifstrm
isNULL
, orstrm->s
isNULL
bzCompressEnd
int bzCompressEnd ( bz_stream *strm );
Releases all memory associated with a compression stream.
Possible return values:
BZ_PARAM_ERROR
ifstrm
isNULL
orstrm->s
isNULL
BZ_OK
otherwise
bzDecompressInit
int bzDecompressInit ( bz_stream *strm, int verbosity, int small );
Prepares for decompression. As with bzCompressInit
, a
bz_stream
record should be allocated and initialised before the
call. Fields bzalloc
, bzfree
and opaque
should be
set if a custom memory allocator is required, or made NULL
for
the normal malloc
/free
routines. Upon return, the internal
state will have been initialised, and total_in
and
total_out
will be zero.
For the meaning of parameter verbosity
, see bzCompressInit
.
If small
is nonzero, the library will use an alternative
decompression algorithm which uses less memory but at the cost of
decompressing more slowly (roughly speaking, half the speed, but the
maximum memory requirement drops to around 2300k). See Chapter 2 for
more information on memory management.
Note that the amount of memory needed to decompress
a stream cannot be determined until the stream's header has been read,
so even if bzDecompressInit
succeeds, a subsequent
bzDecompress
could fail with BZ_MEM_ERROR
.
Possible return values:
BZ_PARAM_ERROR
if(small != 0 && small != 1)
or(verbosity < 0 || verbosity > 4)
BZ_MEM_ERROR
if insufficient memory is available
Allowable next actions:
bzDecompress
ifBZ_OK
was returned no specific action required in case of error
bzDecompress
int bzDecompress ( bz_stream *strm );
Provides more input and/out output buffer space for the library. The
caller maintains input and output buffers, and uses bzDecompress
to transfer data between them.
Before each call to bzDecompress
, next_in
should point at the compressed data,
and avail_in
should indicate how many bytes the library
may read. bzDecompress
updates next_in
, avail_in
and total_in
to reflect the number of bytes it has read.
Similarly, next_out
should point to a buffer in which the uncompressed
output is to be placed, with avail_out
indicating how much output space
is available. bzCompress
updates next_out
,
avail_out
and total_out
to reflect
the number of bytes output.
You may provide and remove as little or as much data as you like on
each call of bzDecompress
.
In the limit, it is acceptable to
supply and remove data one byte at a time, although this would be
terribly inefficient. You should always ensure that at least one
byte of output space is available at each call.
Use of bzDecompress
is simpler than bzCompress
.
You should provide input and remove output as described above, and
repeatedly call bzDecompress
until BZ_STREAM_END
is
returned. Appearance of BZ_STREAM_END
denotes that
bzDecompress
has detected the logical end of the compressed
stream. bzDecompress
will not produce BZ_STREAM_END
until
all output data has been placed into the output buffer, so once
BZ_STREAM_END
appears, you are guaranteed to have available all
the decompressed output, and bzDecompressEnd
can safely be
called.
If case of an error return value, you should call bzDecompressEnd
to clean up and release memory.
Possible return values:
BZ_PARAM_ERROR
ifstrm
isNULL
orstrm->s
isNULL
orstrm->avail_out < 1
BZ_DATA_ERROR
if a data integrity error is detected in the compressed streamBZ_DATA_ERROR_MAGIC
if the compressed stream doesn't begin with the right magic bytesBZ_MEM_ERROR
if there wasn't enough memory availableBZ_STREAM_END
if the logical end of the data stream was detected and all output in has been consumed, egs->avail_out > 0
BZ_OK
otherwise
Allowable next actions:
bzDecompress
ifBZ_OK
was returnedbzDecompressEnd
otherwise
bzDecompressEnd
int bzDecompressEnd ( bz_stream *strm );
Releases all memory associated with a decompression stream.
Possible return values:
BZ_PARAM_ERROR
ifstrm
isNULL
orstrm->s
isNULL
BZ_OK
otherwise
Allowable next actions:
None.
This interface provides functions for reading and writing
bzip2
format files. First, some general points.
int*
first argument,
bzerror
.
After each call, bzerror
should be consulted first to determine
the outcome of the call. If bzerror
is BZ_OK
,
the call completed
successfully, and only then should the return value of the function
(if any) be consulted. If bzerror
is BZ_IO_ERROR
,
there was an error
reading/writing the underlying compressed file, and you should
then consult errno
/perror
to determine the
cause of the difficulty.
bzerror
may also be set to various other values; precise details are
given on a per-function basis below.
bzerror
indicates an error
(ie, anything except BZ_OK
and BZ_STREAM_END
),
you should immediately call bzReadClose
(or bzWriteClose
,
depending on whether you are attempting to read or to write)
to free up all resources associated
with the stream. Once an error has been indicated, behaviour of all calls
except bzReadClose
(bzWriteClose
) is undefined.
The implication is that (1) bzerror
should
be checked after each call, and (2) if bzerror
indicates an error,
bzReadClose
(bzWriteClose
) should then be called to clean up.
FILE*
arguments passed to
bzReadOpen
/bzWriteOpen
should be set to binary mode.
Most Unix systems will do this by default, but other platforms,
including Windows and Mac, will not. If you omit this, you may
encounter problems when moving code to new platforms.
malloc
/free
.
At present
there is no facility for user-defined memory allocators in the file I/O
functions (could easily be added, though).
bzReadOpen
typedef void BZFILE; BZFILE *bzReadOpen ( int *bzerror, FILE *f, int small, int verbosity, void *unused, int nUnused );
Prepare to read compressed data from file handle f
. f
should refer to a file which has been opened for reading, and for which
the error indicator (ferror(f)
)is not set. If small
is 1,
the library will try to decompress using less memory, at the expense of
speed.
For reasons explained below, bzRead
will decompress the
nUnused
bytes starting at unused
, before starting to read
from the file f
. At most BZ_MAX_UNUSED
bytes may be
supplied like this. If this facility is not required, you should pass
NULL
and 0
for unused
and nUnused
respectively.
For the meaning of parameters small
and verbosity
,
see bzDecompressInit
.
The amount of memory needed to decompress a file cannot be determined
until the file's header has been read. So it is possible that
bzReadOpen
returns BZ_OK
but a subsequent call of
bzRead
will return BZ_MEM_ERROR
.
Possible assignments to bzerror
:
BZ_PARAM_ERROR
iff
isNULL
orsmall
is neither0
nor1
or(unused == NULL && nUnused != 0)
or(unused != NULL && !(0 <= nUnused <= BZ_MAX_UNUSED))
BZ_IO_ERROR
ifferror(f)
is nonzeroBZ_MEM_ERROR
if insufficient memory is availableBZ_OK
otherwise.
Possible return values:
Pointer to an abstractBZFILE
ifbzerror
isBZ_OK
NULL
otherwise
Allowable next actions:
bzRead
ifbzerror
isBZ_OK
bzClose
otherwise
bzRead
int bzRead ( int *bzerror, BZFILE *b, void *buf, int len );
Reads up to len
(uncompressed) bytes from the compressed file
b
into
the buffer buf
. If the read was successful,
bzerror
is set to BZ_OK
and the number of bytes read is returned. If the logical end-of-stream
was detected, bzerror
will be set to BZ_STREAM_END
,
and the number
of bytes read is returned. All other bzerror
values denote an error.
bzRead
will supply len
bytes,
unless the logical stream end is detected
or an error occurs. Because of this, it is possible to detect the
stream end by observing when the number of bytes returned is
less than the number
requested. Nevertheless, this is regarded as inadvisable; you should
instead check bzerror
after every call and watch out for
BZ_STREAM_END
.
Internally, bzRead
copies data from the compressed file in chunks
of size BZ_MAX_UNUSED
bytes
before decompressing it. If the file contains more bytes than strictly
needed to reach the logical end-of-stream, bzRead
will almost certainly
read some of the trailing data before signalling BZ_SEQUENCE_END
.
To collect the read but unused data once BZ_SEQUENCE_END
has
appeared, call bzReadGetUnused
immediately before bzReadClose
.
Possible assignments to bzerror
:
BZ_PARAM_ERROR
ifb
isNULL
orbuf
isNULL
orlen < 0
BZ_SEQUENCE_ERROR
ifb
was opened withbzWriteOpen
BZ_IO_ERROR
if there is an error reading from the compressed fileBZ_UNEXPECTED_EOF
if the compressed file ended before the logical end-of-stream was detectedBZ_DATA_ERROR
if a data integrity error was detected in the compressed streamBZ_DATA_ERROR_MAGIC
if the stream does not begin with the requisite header bytes (ie, is not abzip2
data file). This is really a special case ofBZ_DATA_ERROR
.BZ_MEM_ERROR
if insufficient memory was availableBZ_STREAM_END
if the logical end of stream was detected.BZ_OK
otherwise.
Possible return values:
number of bytes read ifbzerror
isBZ_OK
orBZ_STREAM_END
undefined otherwise
Allowable next actions:
collect data frombuf
, thenbzRead
orbzReadClose
ifbzerror
isBZ_OK
collect data frombuf
, thenbzReadClose
orbzReadGetUnused
ifbzerror
isBZ_SEQUENCE_END
bzReadClose
otherwise
bzReadGetUnused
void bzReadGetUnused ( int* bzerror, BZFILE *b, void** unused, int* nUnused );
Returns data which was read from the compressed file but was not needed
to get to the logical end-of-stream. *unused
is set to the address
of the data, and *nUnused
to the number of bytes. *nUnused
will
be set to a value between 0
and BZ_MAX_UNUSED
inclusive.
This function may only be called once bzRead
has signalled
BZ_STREAM_END
but before bzReadClose
.
Possible assignments to bzerror
:
BZ_PARAM_ERROR
ifb
isNULL
orunused
isNULL
ornUnused
isNULL
BZ_SEQUENCE_ERROR
ifBZ_STREAM_END
has not been signalled or ifb
was opened withbzWriteOpen
BZ_OK
otherwise
Allowable next actions:
bzReadClose
bzReadClose
void bzReadClose ( int *bzerror, BZFILE *b );
Releases all memory pertaining to the compressed file b
.
bzReadClose
does not call fclose
on the underlying file
handle, so you should do that yourself if appropriate.
bzReadClose
should be called to clean up after all error
situations.
Possible assignments to bzerror
:
BZ_SEQUENCE_ERROR
ifb
was opened withbzOpenWrite
BZ_OK
otherwise
Allowable next actions:
none
bzWriteOpen
BZFILE *bzWriteOpen ( int *bzerror, FILE *f, int blockSize100k, int verbosity, int workFactor );
Prepare to write compressed data to file handle f
.
f
should refer to
a file which has been opened for writing, and for which the error
indicator (ferror(f)
)is not set.
For the meaning of parameters blockSize100k
,
verbosity
and workFactor
, see
bzCompressInit
.
All required memory is allocated at this stage, so if the call
completes successfully, BZ_MEM_ERROR
cannot be signalled by a
subsequent call to bzWrite
.
Possible assignments to bzerror
:
BZ_PARAM_ERROR
iff
isNULL
orblockSize100k < 1
orblockSize100k > 9
BZ_IO_ERROR
ifferror(f)
is nonzeroBZ_MEM_ERROR
if insufficient memory is availableBZ_OK
otherwise
Possible return values:
Pointer to an abstractBZFILE
ifbzerror
isBZ_OK
NULL
otherwise
Allowable next actions:
bzWrite
ifbzerror
isBZ_OK
(you could go directly tobzWriteClose
, but this would be pretty pointless)bzWriteClose
otherwise
bzWrite
void bzWrite ( int *bzerror, BZFILE *b, void *buf, int len );
Absorbs len
bytes from the buffer buf
, eventually to be
compressed and written to the file.
Possible assignments to bzerror
:
BZ_PARAM_ERROR
ifb
isNULL
orbuf
isNULL
orlen < 0
BZ_SEQUENCE_ERROR
if b was opened withbzReadOpen
BZ_IO_ERROR
if there is an error writing the compressed file.BZ_OK
otherwise
bzWriteClose
int bzWriteClose ( int *bzerror, BZFILE* f, int abandon, unsigned int* nbytes_in, unsigned int* nbytes_out );
Compresses and flushes to the compressed file all data so far supplied
by bzWrite
. The logical end-of-stream markers are also written, so
subsequent calls to bzWrite
are illegal. All memory associated
with the compressed file b
is released.
fflush
is called on the
compressed file, but it is not fclose
'd.
If bzWriteClose
is called to clean up after an error, the only
action is to release the memory. The library records the error codes
issued by previous calls, so this situation will be detected
automatically. There is no attempt to complete the compression
operation, nor to fflush
the compressed file. You can force this
behaviour to happen even in the case of no error, by passing a nonzero
value to abandon
.
If nbytes_in
is non-null, *nbytes_in
will be set to be the
total volume of uncompressed data handled. Similarly, nbytes_out
will be set to the total volume of compressed data written.
Possible assignments to bzerror
:
BZ_SEQUENCE_ERROR
ifb
was opened withbzReadOpen
BZ_IO_ERROR
if there is an error writing the compressed fileBZ_OK
otherwise
The high-level library facilitates use of
bzip2
data streams which form some part of a surrounding, larger
data stream.
fflush
es it but does not fclose
it.
The calling application can write its own data before and after the
compressed data stream, using that same file handle.
bzRead
reads from the compressed file in blocks of size
BZ_MAX_UNUSED
bytes, and in doing so probably will overshoot
the logical end of compressed stream.
To recover this data once decompression has
ended, call bzReadGetUnused
after the last call of bzRead
(the one returning BZ_STREAM_END
) but before calling
bzReadClose
.
This mechanism makes it easy to decompress multiple bzip2
streams placed end-to-end. As the end of one stream, when bzRead
returns BZ_STREAM_END
, call bzReadGetUnused
to collect the
unused data (copy it into your own buffer somewhere).
That data forms the start of the next compressed stream.
To start uncompressing that next stream, call bzReadOpen
again,
feeding in the unused data via the unused
/nUnused
parameters.
Keep doing this until BZ_STREAM_END
return coincides with the
physical end of file (feof(f)
). In this situation
bzReadGetUnused
will of course return no data.
This should give some feel for how the high-level interface can be used. If you require extra flexibility, you'll have to bite the bullet and get to grips with the low-level interface.
Here's how you'd write data to a compressed file:
FILE* f; BZFILE* b; int nBuf; char buf[ /* whatever size you like */ ]; int bzerror; int nWritten; f = fopen ( "myfile.bz2", "w" ); if (!f) { /* handle error */ } b = bzWriteOpen ( &bzerror, f, 9 ); if (bzerror != BZ_OK) { bzWriteClose ( b ); /* handle error */ } while ( /* condition */ ) { /* get data to write into buf, and set nBuf appropriately */ nWritten = bzWrite ( &bzerror, b, buf, nBuf ); if (bzerror == BZ_IO_ERROR) { bzWriteClose ( &bzerror, b ); /* handle error */ } } bzWriteClose ( &bzerror, b ); if (bzerror == BZ_IO_ERROR) { /* handle error */ }
And to read from a compressed file:
FILE* f; BZFILE* b; int nBuf; char buf[ /* whatever size you like */ ]; int bzerror; int nWritten; f = fopen ( "myfile.bz2", "r" ); if (!f) { /* handle error */ } b = bzReadOpen ( &bzerror, f, 0, NULL, 0 ); if (bzerror != BZ_OK) { bzReadClose ( &bzerror, b ); /* handle error */ } bzerror = BZ_OK; while (bzerror == BZ_OK && /* arbitrary other conditions */) { nBuf = bzRead ( &bzerror, b, buf, /* size of buf */ ); if (bzerror == BZ_OK) { /* do something with buf[0 .. nBuf-1] */ } } if (bzerror != BZ_STREAM_END) { bzReadClose ( &bzerror, b ); /* handle error */ } else { bzReadClose ( &bzerror ); }
bzBuffToBuffCompress
int bzBuffToBuffCompress( char* dest, unsigned int* destLen, char* source, unsigned int sourceLen, int blockSize100k, int verbosity, int workFactor );
Attempts to compress the data in source[0 .. sourceLen-1]
into the destination buffer, dest[0 .. *destLen-1]
.
If the destination buffer is big enough, *destLen
is
set to the size of the compressed data, and BZ_OK
is
returned. If the compressed data won't fit, *destLen
is unchanged, and BZ_OUTBUFF_FULL
is returned.
Compression in this manner is a one-shot event, done with a single call
to this function. The resulting compressed data is a complete
bzip2
format data stream. There is no mechanism for making
additional calls to provide extra input data. If you want that kind of
mechanism, use the low-level interface.
For the meaning of parameters blockSize100k
, verbosity
and workFactor
,
see bzCompressInit
.
To guarantee that the compressed data will fit in its buffer, allocate an output buffer of size 1% larger than the uncompressed data, plus fifty bytes.
bzBuffToBuffDecompress
will not write data at or
beyond dest[*destLen]
, even in case of buffer overflow.
Possible return values:
BZ_PARAM_ERROR
ifdest
isNULL
ordestLen
isNULL
orblockSize100k < 1
orblockSize100k > 9
orverbosity < 0
orverbosity > 4
orworkFactor < 0
orworkFactor > 250
BZ_MEM_ERROR
if insufficient memory is availableBZ_OUTBUFF_FULL
if the size of the compressed data exceeds*destLen
BZ_OK
otherwise
bzBuffToBuffDecompress
int bzBuffToBuffDecompress ( char* dest, unsigned int* destLen, char* source, unsigned int sourceLen, int small, int verbosity );
Attempts to decompress the data in source[0 .. sourceLen-1]
into the destination buffer, dest[0 .. *destLen-1]
.
If the destination buffer is big enough, *destLen
is
set to the size of the uncompressed data, and BZ_OK
is
returned. If the compressed data won't fit, *destLen
is unchanged, and BZ_OUTBUFF_FULL
is returned.
source
is assumed to hold a complete bzip2
format
data stream. bzBuffToBuffDecompress
tries to decompress
the entirety of the stream into the output buffer.
For the meaning of parameters small
and verbosity
,
see bzDecompressInit
.
Because the compression ratio of the compressed data cannot be known in advance, there is no easy way to guarantee that the output buffer will be big enough. You may of course make arrangements in your code to record the size of the uncompressed data, but such a mechanism is beyond the scope of this library.
bzBuffToBuffDecompress
will not write data at or
beyond dest[*destLen]
, even in case of buffer overflow.
Possible return values:
BZ_PARAM_ERROR
ifdest
isNULL
ordestLen
isNULL
orsmall != 0 && small != 1
orverbosity < 0
orverbosity > 4
BZ_MEM_ERROR
if insufficient memory is availableBZ_OUTBUFF_FULL
if the size of the compressed data exceeds*destLen
BZ_DATA_ERROR
if a data integrity error was detected in the compressed dataBZ_DATA_ERROR_MAGIC
if the compressed data doesn't begin with the right magic bytesBZ_UNEXPECTED_EOF
if the compressed data ends unexpectedlyBZ_OK
otherwise
stdio
-free environmentstdio
In a deeply embedded application, you might want to use just
the memory-to-memory functions. You can do this conveniently
by compiling the library with preprocessor symbol BZ_NO_STDIO
defined. Doing this gives you a library containing only the following
eight functions:
bzCompressInit
, bzCompress
, bzCompressEnd
bzDecompressInit
, bzDecompress
, bzDecompressEnd
bzBuffToBuffCompress
, bzBuffToBuffDecompress
When compiled like this, all functions will ignore verbosity
settings.
libbzip2
contains a number of internal assertion checks which
should, needless to say, never be activated. Nevertheless, if an
assertion should fail, behaviour depends on whether or not the library
was compiled with BZ_NO_STDIO
set.
For a normal compile, an assertion failure yields the message
bzip2/libbzip2, v0.9.0: internal error number N. This is a bug in bzip2/libbzip2, v0.9.0. Please report it to me at<EMAIL_ADDRESS>If this happened when you were using some program which uses libbzip2 as a component, you should also report this bug to the author(s) of that program. Please make an effort to report this bug; timely and accurate bug reports eventually lead to higher quality software. Thx. Julian Seward, 27 June 1998.
where N
is some error code number. exit(3)
is then called.
For a stdio
-free library, assertion failures result
in a call to a function declared as:
extern void bz_internal_error ( int errcode );
The relevant code is passed as a parameter. You should supply such a function.
In either case, once an assertion failure has occurred, any
bz_stream
records involved can be regarded as invalid.
You should not attempt to resume normal operation with them.
You may, of course, change critical error handling to suit your needs. As I said above, critical errors indicate bugs in the library and should not occur. All "normal" error situations are indicated via error return codes from functions, and can be recovered from.
Everything related to Windows has been contributed by Yoshioka Tsuneo
<EMAIL_ADDRESS>/
<EMAIL_ADDRESS>), so you should send your queries to
him (but perhaps Cc: me<EMAIL_ADDRESS>).
My vague understanding of what to do is: using Visual C++ 5.0,
open the project file libbz2.dsp
, and build. That's all.
If you can't
open the project file for some reason, make a new one, naming these files:
blocksort.c
, bzlib.c
, compress.c
,
crctable.c
, decompress.c
, huffman.c
,
randtable.c
and libbz2.def
. You might also need
to name the header files bzlib.h
and bzlib_private.h
.
If you don't use VC++, you may need to define the proprocessor symbol
_WIN32
.
Finally, dlltest.c
is a sample program using the DLL. It has a
project file, dlltest.dsp
.
I haven't tried any of this stuff myself, but it all looks plausible.
Go to the first, previous, next, last section, table of contents.


This is text c261d78b-d0f5-43cd-93a6-a9eece65bea3 This is link a52c9e66-464e-4b8f-b061-3884a7db89e9
This is text b1d11c5a-2e4e-454a-a09b-3b8cd36d757a This is text 391b1205-f362-4dc4-b6b2-9ed3ddb8d170


Compare and contrast these two snaps. One shows a trio of carvings from an “Indian cemetery” (reportedly), taken in 1900. The second shows a trio of Channel 4 newsreaders performing a musical number at a charity event (reportedly), taken last week.
Dullwits and dunderpates would say “Well, Mr Key, so what? The only thing the two photographs have in common is that they show three figures. You could find thousands, nay, millions of similar snaps. What point are you trying to make?”
The point I am trying to make is that this is the first, albeit flimsy, evidence I have discovered of the cult surrounding bumptious newsreader Krishnan Guru-Murthy. Oh, there are flaws in my reasoning, many, many flaws. But I implore those of you who think I am talking twaddle to watch “KrishGM” (as he likes to be known… why???) very, very carefully in the coming months. The cult has something planned, I am sure of it.
[Indian cemetery snap from Dull Tool Dim Bulb. Cult offering from Channel 4 News.]


Primary!
This is a primary alert—check it out!
This is a primary alert—check it out!
Secondary!
This is a secondary alert—check it out!
This is a secondary alert—check it out!
Success!
You successfully read this important alert message.
You successfully read this important alert message.
Info!
This alert needs your attention, but it's not super important.
This alert needs your attention, but it's not super important.
Warning!
Better check yourself, you're not looking too good.
Better check yourself, you're not looking too good.
Danger!
Change a few things up and try submitting again.
Change a few things up and try submitting again.
Well done!
You successfully read this important alert message.
You successfully read this important alert message.
Well done!
You successfully read this important alert message.
You successfully read this important alert message.
Primary!
This is a primary alert—check it out!
This is a primary alert—check it out!
Secondary!
This is a secondary alert—check it out!
This is a secondary alert—check it out!
Success!
You successfully read this important alert message.
You successfully read this important alert message.
Info!
This alert needs your attention, but it's not super important.
This alert needs your attention, but it's not super important.
Warning!
Better check yourself, you're not looking too good.
Better check yourself, you're not looking too good.
Danger!
Change a few things up and try submitting again.
Change a few things up and try submitting again.
Well done!
You successfully read this important alert message.
You successfully read this important alert message.
Well done!
You successfully read this important alert message.
You successfully read this important alert message.
Hello!
Aww yeah, you successfully read this important alert message. This example text is going to run a bit longer so that you can see how spacing within an alert works with this kind of content.
Hello!
Aww yeah, you successfully read this important alert message. This example text is going to run a bit longer so that you can see how spacing within an alert works with this kind of content.
Are you sure?


Student Info
-
Program
{{info.program}}
-
Name of Student
{{info.name}}
-
Student Id
{{info.stid}}
-
Enrollment
{{info.enrollment}}
-
Batch
{{info.batch}}
Academic Result of : {{sel_semester}}
| Course Code | Course Title | Credit | Grade | Grade Point |
|---|---|---|---|---|
| {{course_code}} | {{course_title}} | {{Credit}} | {{Grade}} | {{Grade_Point}} |


Air chief Bhadauria flies sortie in India-made HTT-40 trainer aircraft
The plane is still under development by the HAL. The IAF chief has been associated with the indigenous trainer aircraft project for a long period now
by ANIShowing strong support for indigenisation, IAF Chief, Air Chief Marshal Rakesh Kumar Singh Bhadauria on Thursday flew in the under development HTT-40 trainer aircraft.
"ACM RKS Bhadauria, CAS flew HTT40, tested its flying capabilities for one hour. First serving Air Chief to fly in prototype as Chief of Air Force," Hindustan Aeronautics Limited (HAL) said in a tweet.
HAL also tweeted some pictures and videos from the incident.
The plane is still under development by the HAL. The IAF chief has been associated with the indigenous trainer aircraft project for a long period now as he had assured full support to it since he was the deputy chief of air staff.
The Air Force is also planning to order a sizeable number of these planes from the HAL for its training fleet which is using the Swiss Pilatus planes at the moment.
Now with a ban on dealing with the Swiss aircraft firm due to the corruption allegations against it, the future of the indigenous aircraft in the Air Force would be brighter.


Successful software engineer offering 4+ years of experience in demanding environments focused on producing cutting-edge systems. Skilled in directing development with a creative and performance-oriented approach. Well-organized and customer-focused with proven skills in project management and team leadership.
After completing my BSc in IT, I worked in Courtyard By Marriott Surat as a software engineer. After then I went to pursue MSc in IT from one of the reputed colleges affiliated with the university where I learned advanced programming skills.
I have finished my BSc in IT from Auro University which is one of the reputed academic institutes in Surat. During this time, I have learned various programming fundamentals.


Redesigned tv schedule on comcast is taller/wider than it was. Doesn't play nicely with my small monitor at home. <Frowns>
10/27/2008, 5:59:57 PM
Favs: 0
Retweets: 0
link--- layout: tweet ---
Redesigned tv schedule on comcast is taller/wider than it was. Doesn't play nicely with my small monitor at home. <Frowns>
10/27/2008, 5:59:57 PM
Favs: 0
Retweets: 0
link


Simple Map
just a simple boilerplate for using React with Esri's JavaScript API.
loading...
Simple Map
just a simple boilerplate for using React with Esri's JavaScript API.
loading...


| Class and Description |
|---|
| ArchivaRestServiceException |
| Class and Description |
|---|
| ArchivaAdministrationService |
| ArchivaRestServiceException |
| ArchivaRuntimeConfigurationService |
| BrowseService |
| CommonServices
contains some "free" services (i18n)
|
| ManagedRepositoriesService |
| MergeRepositoriesService
provide REST services on the top of stage merge repository plugin
|
| NetworkProxyService |
| PingService |
| PluginsService
contains some services for plugins
|
| ProxyConnectorRuleService
No update method for changing pattern as id is pattern, use delete then add.
|
| ProxyConnectorService
No update method for changing source and target here as id is : sourceRepoId and targetRepoId, use delete then add.
|
| RedbackRuntimeConfigurationService |
| RemoteRepositoriesService |
| ReportRepositoriesService
ReportRepositoriesService
|
| RepositoriesService |
| RepositoryGroupService |
| SearchService |
| SystemStatusService |
| Class and Description |
|---|
| ArchivaRestServiceException |
| Class and Description |
|---|
| ArchivaRestServiceException |
Copyright © 2006–2019 The Apache Software Foundation. All rights reserved.


by
Betty Latta Kitchen
My husband, Don, and I visited the Morris-Latta
property in Monroe County, OH, on October 20, 2002, that is currently owned by
my cousin Don Latta and myself. John Christman who operates the dairy
farm through which we have access (32600 Miltonsburg-Calais Road, Woodsfield,
OH 44793) escorted us to the cemetery site. Although Don and I had tried to
find it on the 62 acres three times previously, it was always in summer; and
the vegetation made it impossible to find. John hiked us up the hill behind his
house, then down and across the hollow onto our property. He showed us the
spring, the springhouse (only one front wall is now standing), and the location
of where the house and the barn used to be. Two tall but now scraggly pines
indicate the site of the house. The overgrowth of the thorny florabunda roses,
the challenge of the barbed wire fences, the steepness of the hills, and the
unsure footing because of ruts made by the cows all contributed to the
difficulty of the 40-minute trek to the cemetery. John kept his eyes peeled for
the saddle between the hills where the cemetery was laid. On the way back
down, Don and I went straight down the dry wash from the cemetery to the
holler, a creek, or sometimes just a dry wash, that leads back toward the
road. At one time a road followed the creek bed, on around the Morris property,
and back out the other side. Photos of
the John Copeland and Mary Jane (Morris) Latta home around 1940 show a mailbox
and an auto. There is no evidence of
that road now.
Before this 2002 trip, we had three sets of
pictures--a black and white set, a color set printed from slides taken in the
1940 s by the Latta s, and two snapshots taken by Elizabeth Hinton and Beulah
Crawford (Morris relatives) in 1974. Since
originally writing this, we've taken another set of pictures in 2004.
In the 1974 picture there is a rounded, partially
above the ground, stone crevice that we thought was part of the cemetery.
However, John Christman, at a later date, said this was part of the spring
house not the cemetery. Some of the
fencing around the cemetery can still be seen. Most of the ground in the
cemetery area is covered with a dark green myrtle, and there is a locust grove.
Lilies are spread throughout the area. Now all the taller (approximately 2
feet) tombstones, except one, are laying flat. The 9 - 10 inch (above ground)
stone of T.J. Morris is also standing. There are several very short stones that
appear to be markers. They still protrude vertically about six inches above the
ground, but no inscribing can be seen. Some have initials.
Mary Belle Latta, daughter of Mary Jane Morris and
John Copeland Latta lived in the house on the property until around 1948. This picture contrasts the overall look of
the cemetery around 1940 and then in a picture I took in 2002.
Below I will try to describe what I could make out
on the stones in 2002.
T.J. Morris, the last person to my knowledge buried
in this cemetery, had a stone about 12 feet from the main line of the rest of
the family. About 10 x 14 inches showed above the ground. It was still
standing.
The biggest stone of all in the earliest pictures
was that of Henry Gusler Morris. Although
the picture was identified, no recording of the inscriptions, other than the
name, has been found to date. The
biggest one now, which I assume is his, was flat and broken. No writing at all
could be discerned. It appeared that praying hands might have been at the top.
It was on the left.
The stone of Henry Morris, the son of the above, was
laying flat. It was approximately 20 inches x 16. The engraving was clear. It
was a rectangle that was rounded at the top with his name following the curve
of the arc and covering about l/3 of the length of the stone.
At an angle and
four to six feet behind the row was the only taller standing stone, that of
baby Rachel N. Leaning against that stone but not secured was the stone of her
mother, also Rachel. Both were rectangular and about 20 x 14 or so.
Her mother Rachel's stone, the one slightly to the
right in the picture from the link below, was not in very good condition. It appeared to be inscribed as follows:
Located maybe 12
feet from the main group was the stone of Rachel Minerva. In the 1870 census,
there was a Rachel Carpenter listed with the family of Henry G. Morris, age 8.
At that time Phoebe, age 30, was listed as keeping house for her father Henry
since his wife was dead. Phoebe had a son Charles, age 7, in this census. I
thought perhaps Rachel was another of Phoebe s children, but we really do not
know how she relates. We do not know the name of Charles' father either,
although we have been able to follow his descendants. We do know that people by the name of Carpenter owned the land to
the north and east of the Morris property. The stone was about 20 x 14 inches
and again a rectangle rounded at the top, with her name following the arc of
the rounded stone almost l/2 way around.
Rest in peaceful slumber,
rest.
Nancy s was
approximately in the middle of her parents. Hers again was the rectangular type
with the rounded top, but only NANCY went around the rounded edge. Below hers
were two small stones, maybe 8 inches x 6 inches showing. One had just B. M. Another stone said, B.N.M. I assume these to be
babies, and perhaps the B.N.M. stands for Baby Nancy Morris. There was a Nancy Morris, age 9 months,
in the 1860 census in the Henry G. Morris household. The only girls listed old
enough to have a baby of that age in the household were Mary J., age 22, and
Phoebe, age 21. The born-around-1860 Nancy does not appear in the 1870 census
so perhaps this B.N.M. is that Nancy, but we do not know. Here is the engraving
for the older Nancy, daughter of Henry G. and Mary.
crowned with mercy O how sweet
Beside Nancy was the stone of her mother, Mary
Kinkade Morris, daughter of David Rebecca Kinkade. Her stone was rectangular.
A stone not
found until 2004 was that of C. (or G.) Stauch. Thomas Jefferson Morris' raised his family on adjoining
property. One of his daughters, Anna
Belle, married Charles Stauch. Perhaps
this is one of their children.
There were other
people supposedly buried in this cemetery, some of which were not even family.
 The two youngest sons of
John Copeland Latta and his wife (the Mary Jane noted above), Henry Harvey who
died 24 Sep 1865 and his brother Samuel Seymore who died two days later, both
of cholera, could be among the dozen or more other smaller stones that were
there. I was told that Mary Jane s youngest sister, Sarah (Morris) Somers, who
died shortly after her marriage about 1878, was also there.
Directions
to the Morris-Latta Cemetery: Directions from
Calais: take Monroe County Road #2 (Miltonsburg-Calais Road) east about 5
or 6 miles or Directions from Miltonsburg: take Monroe County
Road #2 west about 2 miles, to 32600 Miltonsburg-Calais Road Property. The cemetery is a few hundred yards north of
Christman's home and perhaps 100 yards west.
Note: The cemetery is on
land-locked acreage. It would be necessary to get the permission of Mr.
John Christman to cross his property.
Submitted by
Betty (Latta) Kitchen
8455 Meadow Drive
Brownsburg, Indiana 46112
phone:<PHONE_NUMBER>
email: Betty
Kitchen
Last modified July 12, 2012
by BK.
Click here for the Short-Cut Table of Contents


Bracket
Select a mode:
Quick
Bracket
Number of Players:
Players per team:
1
2
3
4
5
6
7
8
9
10
Number of teams:
Next
Bracket
Quick Team Assigment
Picture
Quick
List
Bracket
Take a picture to assign a team!
Next
Bracket
Click to assign a player!
Assign Player
Next
Bracket
List Assignment
Bracket
Verify Teams
Create Bracket
Bracket
Verify Bracket Round Robin:
Single Elimination:
View Bracket
Bracket
Finished Bracket


Reading Lists
We're sorry but the ReproducibiliTea Reading Lists website doesn't work properly without JavaScript enabled. Please enable it to continue.


@(connections: Seq[(presenters.ConnectionPresenter, Seq[presenters.ConnectionPathSegmentPresenter])]) @if(connections.isEmpty) { No Connections found } else {
| ConnectionId | Description | Status | |
|---|---|---|---|
|
@_connectionDetails(connection, segments)
|
@connection.connectionId | @connection.description.getOrElse("-") | @connection.status |


--- layout: post tags: [Languages, F#] date: 2012-07-20 05:26:12 UTC title: "FizzBuzz kata in F#: stage 1" description: "A walk-through of stage 1 of the FizzBuzz kata done in F#." permalink: /2012/07/20/FizzBuzzkatainFstage1 --- {% include JB/setup %}
In previous posts I've walked through the Bank OCR kata in F#. In this post, I will do the same for the first stage of the very simple FizzBuzz kata. This is a very simple kata, so if you already know F#, there will be nothing new to see here. On the other hand, if you've yet to be exposed to F#, this is a good place to start - I'll attempt to walk you through the code assuming that you don't know F# yet.
Since I developed the solution using Test-Driven Development, I started by writing a single Parameterized Test:
[<Theory>] [<InlineData(1, "1")>] [<InlineData(2, "2")>] [<InlineData(3, "Fizz")>] [<InlineData(4, "4")>] [<InlineData(5, "Buzz")>] [<InlineData(6, "Fizz")>] [<InlineData(7, "7")>] [<InlineData(8, "8")>] [<InlineData(9, "Fizz")>] [<InlineData(10, "Buzz")>] [<InlineData(11, "11")>] [<InlineData(12, "Fizz")>] [<InlineData(13, "13")>] [<InlineData(14, "14")>] [<InlineData(15, "FizzBuzz")>] [<InlineData(16, "16")>] [<InlineData(17, "17")>] [<InlineData(18, "Fizz")>] [<InlineData(19, "19")>] [<InlineData(20, "Buzz")>] let FizzBuzzReturnsCorrectResult number expected = number |> FizzBuzz |> should equal expected
This test uses xUnit.net data theories to provide a set of test data in the form of an integer as input and an expected string.
The number input variable is piped to the FizzBuzz function, using F#'s pipe operator |>. This is just another way of writing
FizzBuzz number
The pipe operator simply takes the data being piped and uses it as the last input parameter to the function being piped. In this case, the number integer variable is the data being piped, so it's used as the last input parameter to the FizzBuzz function, which only takes a single paramter.
The result of invoking the FizzBuzz function is a string. This result is again piped to the should method, which is defined by the FsUnit module. The should method is an assertion function that takes three input parameters. The first two parameters are supplied as part of the function invokation as equal expected, but since the pipe operator is being used, the third and final parameter value is the result of invoking the FizzBuzz function.
In all, the test states that when the FizzBuzz function is called with number, the result should be equal to the expected string.
The FizzBuzz implementation is really simple:
let FizzBuzz number = match number with | i when i % 3 = 0 && i % 5 = 0 -> "FizzBuzz" | i when i % 3 = 0 -> "Fizz" | i when i % 5 = 0 -> "Buzz" | _ -> number.ToString()
All it does is to use pattern matching against the number input argument. In all cases except the last one, the value of number is matched against any number, but with a condition. The first condition is that the number should be divible by both 3 and 5. If this is the case, the result to the right of the -> operator is returned from the function ("FizzBuzz").
The last line of the match block uses an underscore as the match pattern. This is a catch-all pattern that's being triggered if none of the other patterns are matched. In this case, the number input argument is converted to a string and returned.
The kata requires me to print the output for all numbers from 1 to 100. The astute reader may have noticed that the FizzBuzz function doesn't do that - it only converts a single integer to a string. However, printing all numbers fizzed and buzzed is easy:
[1..100]
|> List.map FizzBuzz
|> List.reduce (sprintf "%s\r\n%s")
The first line defines a list of numbers from 1 to 100. The next line pipes this list of integers into the List.map function, which applies the FizzBuzz function to each integer. The output of this function call is another list of strings ["1"; "2"; "Fizz"; "4"; "Buzz"; etc.]. This list of strings is piped into the List.reduce function, which in this case uses the sprintf function to concatenate the strings and add a line break after each element, so that it formats correctly.
The List.reduce function applies a function to pairwise elements in a list in order to produce a new element of the same type. Consider the beginning of the list of strings ["1"; "2"; "Fizz"; "4"; "Buzz"; etc.]. The List.reduce function starts with "1" and "2" and applies a function in order to produce a new string from those two strings. That function is the sprintf function, which is similar to the more well-known String.Format method in the BCL. In this case, the template is to take the two strings and insert a line break between them. Thus, when applied to "1" and "2", the result is
1
2
(notice the line break). Now, the List.reduce function takes that string and the next string in the list ("Fizz") and applies the funtion again, giving this result:
1 2 Fizz
It now takes this string and the next value ("4") and applies the sprintf function once more, etc. This is how the final list is being printed.
In a future post I'll walk you through stage 2 of the kata.
Comments


This is the log-in page where you and your fellow residents will be able to securely log-in to your association's website. We use the same technology that banks use to secure their log-in information This also means that search engines cannot reach your data and it will never show up in search results. For the sake of the demonstration site, you can simply log-in by clicking the button below. Usually an email address and password is required.


Classes
The following classes are available globally.
-
Undocumented
See more
-
Autolayout supported modal view that overlays root view controller
See moreDeclaration
Swift
class Popsicle: UIViewController
-
Undocumented
See more
-
Undocumented
See more
-
Undocumented
See more
-
Undocumented
See more
-
Undocumented
See more
-
Undocumented
See more
-
Undocumented
See more
-
Undocumented
See more
-
Undocumented
See more
-
Undocumented
See more
-
Undocumented
See more
-
Undocumented
See more
-
Undocumented
See more
-
Undocumented
See more
-
Undocumented
See more
-
Undocumented
See more


title=Getting Started with jBPM and Spring date=2008-09-22 type=post tags=blog status=published ~~~~~~
My first article for TheServerSide.com. I am very excited to have this finally happen, and am frankly really looking forward to doing some more. The article is a discussion on setting up an architecture using worklists that depends on jBPM and Spring.
Any ideas? Suggestion? Leave a comment!


--- layout: default title: About ---
I like to take pictures, but sometimes it takes me a while to upload them...


vignettes/transitioning-from-RForcecom.Rmd
transitioning-from-RForcecom.Rmd
While writing the {salesforcer} package we were keenly aware that many folks were already using the {RForcecom} package to connect to Salesforce. In order to foster adoption and switching between the packages {salesforcer} replicates the functionality of many {RForcecom} functions so that you will only need to swap out library(RForcecom)
for library(salesforcer)
and still have production scripts perform as expected.
As of June 9, 2021, the {RForcecom} package was removed from CRAN. You can still use it by installing from the archive, but we strongly recommend using {salesforcer} instead. The existing functionality in {RForcecom} has been further optimized within {salesforcer} and new functionality has been added too.
Basic authentication (password and security token) will no longer work since Salesforce announced that all customers will be migrated to MFA beginning February 1st, 2022 (link). As a result, the basic authentication routine used {RForcecom} and the legacy, compatibility method written into {salesforcer} will no longer work. Please migrate to {salesforcer} and use sf_auth()
to generate an OAuth 2.0 token. The examples below will no longer work.
{salesforcer} supports OAuth 2.0 authentication which is preferred, but for backward compatibility provides the username-password authentication routine implemented by {RForcecom}. Here is an example running the function from each of the packages side-by-side and producing the same result.
First, authenticate and load any required packages for your analysis.
# Beginning February 1, 2022, basic authentication will no longer work. You must
# log in to Salesforce using MFA (generating an OAuth 2.0 token typically from
# the browser).
# the RForcecom way
# RForcecom::rforcecom.login(username, paste0(password, security_token),
# apiVersion=getOption("salesforcer.api_version"))
# replicated in salesforcer package
session <- salesforcer::rforcecom.login(username,
paste0(password, security_token),
apiVersion = getOption("salesforcer.api_version"))
session['sessionID'] <- "{MASKED}"
session
Note that we must set the API version here because calls to session will not create a new sessionId
and then we are stuck with version 35.0 (the default from RForcecom::rforcecom.login()
). Some functions in {salesforcer} implement API calls that are only available after version 35.0.
“CRUD” operations (Create, Retrieve, Update, Delete) in the {RForcecom} package only operate on one record at a time. One benefit to using the {salesforcer} package is that these operations will accept a named vector (one record) or an entire data.frame
or tbl_df
of records to churn through. However, rest assured that the replicated functions behave exactly the same way if you are hesitant to making the switch.
Here is an example showing the reduction in code of using {salesforcer} if you would like to create multiple records.
n <- 2
new_contacts <- tibble(FirstName = rep("Test", n),
LastName = paste0("Contact-Create-", 1:n))
# the RForcecom way (requires a loop)
# rforcecom_results <- NULL
# for(i in 1:nrow(new_contacts)){
# temp <- RForcecom::rforcecom.create(session,
# objectName = "Contact",
# fields = unlist(slice(new_contacts,i)))
# rforcecom_results <- bind_rows(rforcecom_results, temp)
# }
# the better way in salesforcer to do multiple records
salesforcer_results <- sf_create(new_contacts, object_name="Contact")
salesforcer_results
#> # A tibble: 2 × 2
#> id success
#> <chr> <lgl>
#> 1 0033s00001BXHtnAAH TRUE
#> 2 0033s00001BXHtoAAH TRUE
{salesforcer} also has better printing and type-casting when returning query result thanks to features of the {readr} package.
this_soql <- "SELECT Id, Email FROM Contact LIMIT 5"
# the RForcecom way
# RForcecom::rforcecom.query(session, soqlQuery = this_soql)
# the better way in salesforcer to query
salesforcer_results <- sf_query(this_soql)
salesforcer_results
#> # A tibble: 5 × 2
#> Id Email
#> <chr> <chr>
#> 1 0033s000014B3IZAA0<EMAIL_ADDRESS>#> 2 0033s000014B3IaAAK<EMAIL_ADDRESS>#> 3 0033s000014B3IbAAK<EMAIL_ADDRESS>#> 4 0033s000012Nd6FAAS<EMAIL_ADDRESS>#> 5 0033s000012NdARAA0<EMAIL_ADDRESS>The {RForcecom} package has the function rforcecom.getObjectDescription()
which returns a data.frame
with one row per field on an object. The same function in {salesforcer} is named sf_describe_object_fields()
and also has better printing and datatype casting by using tibbles.
# the RForcecom way
# RForcecom::rforcecom.getObjectDescription(session, objectName='Account')
# the better way in salesforcer to get object fields
result2 <- salesforcer::sf_describe_object_fields('Account')
result2
#> # A tibble: 68 × 39
#> aggregatable aiPredictionField autoNumber byteLength calculated caseSensitive
#> <chr> <chr> <chr> <chr> <chr> <chr>
#> 1 true false false 18 false false
#> 2 false false false 0 false false
#> 3 true false false 18 false false
#> 4 true false false 765 false false
#> 5 true false false 765 false false
#> # … with 63 more rows, and 33 more variables: compoundFieldName <chr>,
#> # createable <chr>, custom <chr>, defaultedOnCreate <chr>,
#> # defaultValue <list>, deprecatedAndHidden <chr>, digits <chr>,
#> # externalId <chr>, extraTypeInfo <chr>, filterable <chr>, groupable <chr>,
#> # idLookup <chr>, label <chr>, length <chr>, name <chr>, nameField <chr>,
#> # namePointing <chr>, nillable <chr>, permissionable <chr>,
#> # picklistValues <list>, polymorphicForeignKey <chr>, precision <chr>, …


Preparation time
less than 30 mins
Cooking time
1 to 2 hours
Serves
Serves 4-6
Dietary
Get perfect results every time with this quick and easy pavlova recipe. Top with whatever delicious fruits you have to hand.
Preheat the oven to 180C/350F/Gas4. Line a baking tray with greaseproof paper. Draw a 20cm/8inch circle on the paper.
Whisk the egg whites with half the sugar and the salt in a clean bowl until soft peaks form. Continue beating while adding the remaining sugar until stiff and shiny. Sprinkle over the cornflour, cream of tartar, vinegar and vanilla essence and fold in gently with a metal spoon.
Mould the egg white mix onto the paper within the circle. Flatten the top and smooth the sides. Place in the oven and immediately reduce the heat to 150C/300F/Gas 2 and cook for 1¼ hours.
Turn off the oven, leave the door slightly ajar and allow to cool completely. Invert 'Pav' onto a plate, gently push down the meringue then pile on the cream and dress with the tropical fruit.


The atom-view shows the atom data of the selected frame (of the selected movie). The outline-view displays the atom data in tabular form. Atoms can be grouped together into hierarchical data. An outline view is a type of table which lets the user expand or collapse rows that contain hierarchical data.
The visibility per atom can be switched on and off using the visibility check-box. To set/unset all the checkboxes of the outlineview hold the option key when pressing any of the checkboxes. The contextual menu (right-mouseclick) shows symmetry operations, changing the visiblity to match the selection (i.e. all selected atoms are made visible, all others invisible), and scrolling the view to selected atoms, or top and bottom.


Jo Swinson fights on as key Lib Dem candidate stands down
The party leader visited a boxing gym in north London.
Liberal Democrat leader Jo Swinson has insisted she is not losing control of party candidates after a standard bearer stood down in a key marginal.
The comments came after Tim Walker said he would not contest Labour-held Canterbury because he did not want to split the Remain vote.
Ms Swinson insisted the Lib Dems would field another candidate in the Kent seat.
She said the party would also continue to stand against former Tory Cabinet minister David Gauke despite his outspoken criticism of Prime Minister Boris Johnson.
Asked if she was losing control of Lib Dem candidates, Ms Swinson told the PA news agency: “No. Clearly as Liberal Democrats we are committed to stopping Brexit.
“We have a healthy debate within the party and some candidates have made their own decisions.”
At the Total Boxer centre in Crouch End, Ms Swinson was shown punching moves by an instructor in a boxing ring.
For the boxing class, the Lib Dem leader sported a T-shirt with a spider on it and the words “Girly Swot”.
Ms Swinson told PA the spider was a tribute to Supreme Court judge Lady Hale who wore a spider broach when she delivered a judgment that proroguing Parliament in September had been unlawful.
Ms Swinson said she was “reclaiming” the phrase “girly swot”.
She said: “I was looking for a T-shirt for the ring and I thought it would do the job.”
Mr Johnson used the phrase to refer to ex-PM David Cameron.
Mr Walker was due to contest Labour-held Canterbury but said he had asked his local party to withdraw his nomination papers as he wanted “no part” in allowing a Tory Brexiteer to win the seat.
Guy Kiddey, Lib Dem candidate in the High Peak constituency, said he will stand down and resign his membership of the party unless Mr Walker receives an apology.
In a statement on Twitter, Mr Kiddey wrote: “Many Lib Dem candidates are standing in marginal seats. We are all as torn as Tim Walker, but none of us is as noble.
“I’ve never met Mr Walker but, as a distant colleague, I stand by him and his decision to stand down.
“I know that, if I campaign hard in High Peak, I will split the vote and the Tory will win.
“Though I could probably achieve the party’s best-ever result up here, perhaps increasing the Lib Dem vote share five-fold compared to 2017, a mere happy statistic is a definite second to keeping a Tory party that threatens to be worse than Margaret Thatcher’s out of office.”
Mr Kiddey said he received an email from James Gurling, chairman of the Lib Dem election campaign, who said he was writing to inform candidates that “disciplinary action” had been instigated against Mr Walker.
“I was, and am, appalled at this response. So is my now former election agent, who has resigned from the Lib Dems.
“This means that I am, in the absence of a replacement, not legally able to stand as a candidate in High Peak in the coming election, as I do not wish to be my own agent.
“I will not seek this replacement unless the party retracts its implicit threat to candidates, drops its intended disciplinary proceedings against Mr Walker, and apologises unreservedly.
“I doubt it will, in which case I too will stand down and resign my membership, and I will vote Labour,” he said.


Create ansi colors by passing the open and close codes.
Install with npm
$ npm i ansi-wrap --save
var wrap = require('ansi-wrap');
Example
Pass codes for ansi magenta background:
console.log(wrap(45, 49, 'This is a message...'));
//=> '\u001b[45mfoo\u001b[49m'
Which prints out...
This is used in these projects:
Install dev dependencies:
$ npm i -d && npm test
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue
Jon Schlinkert
Copyright © 2015 Jon Schlinkert Released under the MIT license.
This file was generated by verb-cli on May 21, 2015.


Why machine learning?
Useful for
- Predicting new information from historic data
- Automation of processes in your business
- Having the information needed to take better decisions
- Generating new opportunities
Without the common downsides!
Do it yourself!
- Easily
- Quickly
- Cheaply!


Thank you for purchasing INSPINIA admin theme. If you have any questions about the template, please feel free to contact us via email<EMAIL_ADDRESS>Thanks very much!
Inspinia Laravel 5 Seed Project is a special starter project for all users who want's to start developing
with Laravel and don't want to wait for full version. It is a core Inspinia project with layout, example views and styles.
If you plan to work on Laravel then this project should save you some time on initial integration work.
This documentation provide simple instruction how you can run the project.
Please note that in future I will provide full version for Laravel 5 and this documentation will be upgraded with more detailed description.
Project is build like a standard Laravel project with npm and artisan and gulp.
Once you unzip the archive please install all dependencies:
npm install
php composer.phar install
To run the project you just need to run artisan server:
php artisan serve
The whole project files are located under app/ and resource folder.
The structure is easy. Main view components are located in resource/views/ folder.
You can find main layout file: app.blade.php as well as footer.blade.php and navigation files.
In the resource/assets/ folder I place the main Inspinia and vendor files (css and js files).
Next important folder is app/Http/Controllers.
In this folder you can find all controller I use for example to add two views.
routes/ folder has a web.php file where you can find definition for routes.
Other folders are core Laravel project folders
Please note that this is a starter project so it is no a full version. It should help you start with Inspinia and Laravel and save you some time on initial integration. If you will find any issues or bugs please report it on my support email and if you will have any questions also feel free to write to me anytime.