Get Started with xLearn !¶
xLearn is a high-performance, easy-to-use, and scalable machine learning package, which can be used to solve large-scale machine learning problems, especially for the problems on large-scale sparse data, which is very common in scenes like CTR prediction and recommender system. If you are the user of liblinear, libfm, or libffm, now xLearn is your another better choice. This is because xLearn handles all of these models in a uniform platform and provides better performance and scalability compared to its competitors.
This is a quick start tutorial showing snippets for you to quickly try out xLearn on a small demo dataset (Criteo CTR prediction) for a binary classification task.
Link to the Other Helpful Resources¶
- See Installation Guide on how to install xLearn.
- See Command Line Guide on how to use xLearn command line.
- See Python API Guide on how to use xLearn Python API.
- See R API Guide on how to use xLearn R API.
- See Demo Page Learning to use xLearn by Examples.
- See Tutorial on tutorials on specific tasks.
Quick Install¶
The easiest way to install xLearn Python package is to use pip
. The following command will
download the xLearn source code and install python package it locally.
sudo pip install xlearn
The installation process will take a while to complete. And then you can type the following script in your python shell to check whether the xLearn has been installed successfully:
>>> import xlearn as xl
>>> xl.hello()
You will see:
-------------------------------------------------------------------------
_
| |
__ _| | ___ __ _ _ __ _ __
\ \/ / | / _ \/ _` | '__| '_ \
> <| |___| __/ (_| | | | | | |
/_/\_\_____/\___|\__,_|_| |_| |_|
xLearn -- 0.20 Version --
-------------------------------------------------------------------------
If you meet any installation problem, or you want to build the lastest code from github, or you want to use the xLearn command line instead of the python API, you can see how to build xLearn from source code in Installation Guide.
Python Demo¶
Here is a simple Python demo no how to use xLearn:
import xlearn as xl
# Training task
ffm_model = xl.create_ffm()
ffm_model.setTrain("./small_train.txt")
ffm_model.setValidate("./small_test.txt")
param = {'task':'binary', 'lr':0.2,
'lambda':0.002, 'metric':'auc'}
ffm_model.fit(param, "./model.out")
# Prediction task
ffm_model.setTest("./small_test.txt")
# Convert output to 0~1
ffm_model.setSigmoid()
ffm_model.predict("./model.out", "./output.txt")
This example shows how to use field-aware factorizations machine (ffm) to solve a
simple binary classification task. You can check out the demo data
(small_train.txt
and small_test.txt
) from the path demo/classification/criteo_ctr
.


An interface to the software package MARK that constructs input
files for MARK and extracts the output. MARK was developed by Gary White
and is freely available at <http://www.phidot.org/software/mark/downloads/>
but is not open source.
| Version: |
2.2.5 |
| Depends: |
R (≥ 2.13.0) |
| Imports: |
parallel, matrixcalc, msm, coda |
| Suggests: |
lattice, splines, nlme, plotrix |
| Published: |
2018-07-13 |
| Author: |
Jeff Laake with code contributions from Eldar
Rakhimberdiev, Ben Augustine, Daniel Turek and Brett McClintock and example data and analysis
from Bret Collier, Jay Rotella, David Pavlacky, Andrew Paul and Luke Eberhart-
Phillips. |
| Maintainer: |
Jeff Laake <jefflaake at gmail.com> |
| License: |
GPL-2 | GPL-3 [expanded from: GPL (≥ 2)] |
| NeedsCompilation: |
no |
| SystemRequirements: |
notepad.exe, mark.exe (>= 8.0) (or mark32.exe and
mark64.exe) and rel_32.exe (see README.txt) |
| Citation: |
RMark citation info |
| Materials: |
NEWS |
| In views: |
Environmetrics |
| CRAN checks: |
RMark results |


Warehouse Mia:
Well done, adventurer. You have successfully proved your reliability and skill.
I will give you the title of low-level agent using my authority.
Congratulations!
...
If you want to become a mid-level agent, please speak with Warehouse Keeper Kluck...


Stubs
Simplest HTML file
Simplest HTML file
Simplest HTML file
Simplest HTML file
Simplest HTML file
Simplest HTML file
Simplest HTML file
Simplest HTML file
Simplest HTML file
Simplest HTML file
Simplest HTML file


UXL Fetch Client
| Build Status | Statements | Branches | Functions | Lines |
|---|---|---|---|---|
Installation
npm i @uxland/fetch-client
Usage
Configuration
Set Base URL
All relative fetch will use provided url as its own base URL. If using absolute uri when fetching, this will not be taken into account.
import { setBaseUrl } from "@uxland/fetch-client";
setBaseUrl("http://localhost");
Register response handlers
Register a response handler to manipulate result.
import { registerResponseHandler } from "@uxland/fetch-client";
registerResponseHandler((response) => JSON.stringify(response));
Change fetch client configuration
Change configuration globally. All fetch requests will use this configuration.
import { configure } from '@uxland/fetch-client';
configure({mode: 'no-cors',{ headers: {authorization: 'Bearer <token>' }}});
Change fetch client headers
Change headers globally. All fetch requests will use specified headers.
import { setHeaders } from "@uxland/fetch-client";
setHeaders({ authorization: "Bearer <token>" });
Delete specific header
Remove a header from global headers using provided id.
import { removeHeader } from "@uxland/fetch-client";
removeHeader("authorization");
Reset fetch client headers
Reset global headers to default.
import { resetHeaders } from "@uxland/fetch-client";
resetHeaders();
Fetch data
import { doFetch } from "@uxland/fetch-client";
const response = doFetch("/dummy", { mode: "no-cors" }, { foo: "bar" })
.then((r) => r)
.catch((e) => e);
In addition, fetchClient also publishes (via @uxland/event-aggregator
) two events INVALID_CREDENTIALS_EVENT and INVALID_REQUEST_EVENT when credentials are invalid or request has failed.


Preparation time
over 2 hours
Cooking time
30 mins to 1 hour
Serves
Serves 8-10
Dietary
This classic French dessert can be tricky, but it's delicious when it works. You can substitute the apples for plenty of other fruit; pear and prune or quince work beautifully.
Preheat the oven to 250C/500F/Gas 9.
First, make the pastry. In a food processor, mix the flour, butter and icing sugar just until they resemble breadcrumbs. Add the egg yolks and, using the pulse button, mix until it comes together in a dough.
Remove the dough from the mixer bowl and divide into two pieces. Wrap in clingfilm and put in the freezer to chill for at least an hour.
For the filling, place the apple wedges in a bowl, squeeze the lemon juice over them and toss them gently.
Sprinkle 85g/3oz of the sugar in a heavy-bottomed pan and place on the hob over a medium heat, turning the pan frequently and making sure the sugar doesn't burn. Allow the sugar to caramelise a little and become a pale golden brown, then remove from the heat and arrange the drained apple pieces in one layer over the bottom of the pan.
Place the pan in the oven and bake until the apples have softened a bit and started to release some liquid - about 10 minutes.
Remove from the oven and sprinkle over the remaining sugar and dot the butter on top. Remove the pastry from the freezer and, using the coarse side of a cheese grater, grate the pastry with long steady strokes over the apples until it forms an even layer at least 2.5cm/1 inch thick. Do not press down. Return to the oven, turn the heat down to 220C/425F/Gas 7 and bake until the pastry is golden brown - about 20 minutes. Remove from the oven and leave to rest for a minute or two.
Take a heatproof serving dish that is generously larger than the pan on all sides and place over the pan. Protecting your hands with a dry folded tea-towel, and holding the dish and pan firmly together, quickly and carefully flip the pan and the dish so that the pan is on top. Tap the pan sharply a few times all round with a wooden spoon, then lift off. The tart should be left on the serving dish with the apple on top.
Serve warm with double cream, crème fraîche or vanilla ice cream.


Array#to_h converts an array of key-value pairs into a Hash.
Binding#local_variable_get(symbol)
Binding#local_variable_set(symbol, obj)
Binding#local_variable_defined?(symbol)
Enumerable#to_h converts an array of key-value pairs into a Hash.
Exception#cause provides the previous exception which has been caught at where raising the new exception.
Kernel#singleton_method
New methods:
Module#using, which activates refinements of the specified module only in the current class or module definition.
Module#singleton_class? returns true if the receiver is a singleton class or false if it is an ordinary class or module.
extended methods:
Module#refine is no longer experimental.
Module#include and Module#prepend are now public methods.
extended methods:
Numeric#step
allows the limit argument to be omitted, in which case an infinite sequence of numbers is generated. Keyword arguments `to` and `by` are introduced for ease of use.
String#scrub and String#scrub!
verify and fix invalid byte sequence. If you want to use this function with older Ruby, consider to use string-scrub.gem.


--- layout: main title: Hackference 2015 - Sponsors TODO: Text on the to pof the page ---
Without the support of our sponsors, we simply cannot put on such an event as we do. Below is a list of all the amazing sponsors that we have. If you would like to help support us, please visit our sponsorship page to view all of our sponsorship options.
The Microsoft UK Developer Experience team and Microsoft Edge is excited to be partnering with Hackference 2015 in Birmingham. We will be bringing along great content, workshops, hack challenges as well as prizes to the three day event.
Microsoft Edge is our new web browser and will be the default browser in Windows 10. Since Upgrades from Windows 8 and 7 will be free to most users, you can expect there will be a huge influx of Edge users hitting UK sites when it's released this summer. Make sure your site rocks on Microsoft Edge by visiting http://dev.modern.ie/tools/staticscan/.
Hired is a two sided marketplace designed specifically for developers to make hiring, or getting hired, less painful. We believe finding a career should be transparent, unbiased, and controlled by the talent. Our marketplace features vetted and funded companies extending interview requests with salary information upfront, a dedicated Talent Advocate, and a £1,200 signing bonus. You can open the floodgates to Hired's 2,500+ companies across eleven markets, including London, San Francisco and New York City, by making a profile at any time.
At the forefront of the digital payments revolution, PayPal helps millions to send money without sharing financial information and with the flexibility to pay using their PayPal account balances, PayPal Credit, bank accounts, and credit cards. Working alongside PayPal is Braintree, acquired by PayPal in 2013. Braintree’s global platform powers payments for thousands of online and mobile commerce innovators. Merchants in more than 45 countries can accept payments in over 130 currencies. Braintree's v.zero SDK powers PayPal, including One Touch, Apple Pay, Bitcoin across any device. To learn more, visit Braintree at www.braintreepayments.com.
Create interactive, realtime apps in minutes instead of days with Pusher’s hosted API. It’s secure, it scales from 1 to millions of connections instantly, and you won’t need to set up or maintain your own infrastructure. Ever. Finally, it integrates with your technology stack of choice. So you’re in complete control.
Twilio provides a software and cloud-based communications platform that enables developers and businesses to build communications solutions that meet their specific needs. Whether integrating voice, messaging or VoIP capabilities into a web or mobile app or building a complete call center, Twilio removes traditional obstacles to creating effective communications experiences.
Proactive is the “go to” solution for Devs and Designers who need proper help with their accounts and tax returns. And their prices are highly competitive!
Operating strictly as a business to business provider, the team of accountants and book keepers likes to focus on getting things done. They can handle year end accounts, tax returns and VAT returns quickly and cleanly, and with a minimum of fuss.
Proactive has been running a paperless office since 1 April 2008. How did they do that? Well if you’ve met @ProactivePaul you’ll know he’s a coder on the side! Being paperless makes your relationship with the accountant quicker, easier and cheaper, which is surely something you’d be interested in!
JustGiving are delighted to be supporting Hackference again this year. In a world where our platform is helping to power the #apps4good movement, it’s great to be associated with an event that brings the very best software developers together.
SendGrid is a proven cloud-based email platform that successfully delivers over 18 Billion customer engagement emails each month for Internet and mobile-based customers like Pinterest, Airbnb, Pandora, Hubspot, Spotify, Uber, Linkedin and FourSquare, as well as more traditional enterprises like Taco Bell, Walmart, Intuit and Costco.
Majestic has a whole web index, based on link intelligence, with several APIs. The thrill of extracting undiscovered intelligence from the data collected makes Majestic’s API a fantastic resource for Hackathons. A rare chance to hold the web in your hands for a day (and a night).
Entrepreneur First (EF) funds people who want to work on hard problems & build deep technology companies.
We believe that if you’ve got exceptional technical skills, you shouldn’t be employee #200, nor should you be working on projects for other people.
Our intensive six-month programme is designed to give you the best possible support in the first 100 days of your startup’s life. We’re not an accelerator – we select purely on the basis of technical talent, so you can apply before you have a team or an idea.
We've created 40 startups now worth hundreds of millions of dollars. They're funded by some of the most prestigious investors including Y Combinator, Index Ventures, and Octopus Ventures.
If you think you meet the bar, apply now for our March 2016 programme at http://joinef.com/apply
Esri is the world leader in Geographic Information Systems software and services. Esri’s ArcGIS platform allows developers to build applications on top of a rich set of geospatial API & SDKs. Whether you need scalable mapping, geographic data storage, geofence management, multi vehicle routing, geocoding, or spatial analytics, ArcGIS can help kick start your app development.
Box-Security are a Derby based modern technology company that cover anything from web application development to social media strategy and marketing. Designing and developing for ecommerce businesses across the UK and driving businesses forward through digital marketing efforts.


Money Play. How should Red play 65?
pips Red=93 White=80
(CorrectAnswer= 0/0, ErrorScore= 0)
This was a comedy of errors from Battersea.
Firstly Red should double and White should take but the box rolled this 65 and looked at 8/3, 8/2* (which he eventually played) and 11/5, 6/1. He never looked at the correct move, 9/4, 9/3.
The 9-pt can't be part of the prime so it can be released. The checker on the 11-pt acts as a guard against White's 52 and 53. After 9/4, 9/3 if White doesn't escape he should not take Red's double next time.
FYI – after Red's misplay, White hit the shot and won the game.
Firstly Red should double and White should take but the box rolled this 65 and looked at 8/3, 8/2* (which he eventually played) and 11/5, 6/1. He never looked at the correct move, 9/4, 9/3.
The 9-pt can't be part of the prime so it can be released. The checker on the 11-pt acts as a guard against White's 52 and 53. After 9/4, 9/3 if White doesn't escape he should not take Red's double next time.
FYI – after Red's misplay, White hit the shot and won the game.
1. Cubeful 2-ply 9/4 9/3 Eq.: +0.644 0.686 0.020 0.000 - 0.314 0.011 0.000 2. Cubeful 2-ply 11/5 9/4 Eq.: +0.596 (-0.048) 0.672 0.020 0.000 - 0.328 0.009 0.000 3. Cubeful 2-ply 11/5 6/1 Eq.: +0.517 (-0.127) 0.654 0.019 0.000 - 0.346 0.015 0.000 4. Cubeful 2-ply 9/4 8/2* Eq.: +0.367 (-0.277) 0.632 0.031 0.001 - 0.368 0.186 0.011 5. Cubeful 0-ply 8/3 8/2* Eq.: +0.420 (-0.224) 0.659 0.035 0.001 - 0.341 0.082 0.001


{% extends "website_base.html" %} {% load static %} {% load i18n %} {% block content %}
{% trans "The Garden Bar at Jurys Inn Galway is one of the city’s hidden gems. The Garden Bar is Galway’s largest beer garden and is situated adjacent to the River Corrib overlooking the World famous Claddagh and Galway’s Fishery watchtower. This amazing sun trap is the place to be on a summer’s day and often becomes Galway’s main hot spot for a relaxing coffee, a bite to eat or an evening of refreshing drinks. The garden has a capacity of over 150 people with a wide range of garden furniture to enjoy the wonderful surroundings. The area is serviced with a full sound system playing various genres of music to suit the tone of the day. The Garden Bar is the ideal spot for a casual get together or larger party with the hotel offering a full BBQ menu in the summer months with a dedicated Chef to cater for any occasion." %}
{% trans "Spanning nearly 3,000 hectares of mountains, bogs, heaths and woodlands, Connemara National Park is a fantastic spot for walking and hiking There are actually 3 walks to do within the park. The pathways are well marked out and signposted and the walks are planned to suit everyone, from the novice to the well-seasoned walker. You also have the added comfort of having Park Rangers on hand, just in case you get into any difficulties." %}


{% include partials/head.html %}
{% include partials/navbar.html %} {% include partials/breadcrumb.html %} {{ content }} {% include partials/footer.html %}


---
sort_order: 69
tei_id: rdx_191dd.p.idp8511952
annotation_count: 0
images:
small-thumbnail: https://readux.ecds.emory.edu/books/emory:191dd/pages/emory:rffgx/mini-thumbnail/
json: https://readux.ecds.emory.edu/books/emory:191dd/pages/emory:rffgx/info/
full: https://readux.ecds.emory.edu/books/emory:191dd/pages/emory:rffgx/fs/
page: https://readux.ecds.emory.edu/books/emory:191dd/pages/emory:rffgx/single-page/
thumbnail: https://readux.ecds.emory.edu/books/emory:191dd/pages/emory:rffgx/thumbnail/
title: Page 69
number: 69
---
{% raw %}ANOTHER 'VISITOR. C9{% endraw %}
{% raw %}regard to Mr, Mauvais, and am in every way dutiful toward{% endraw %}
{% raw %}you, as long as I live, wUl you not forgive me now, and let{% endraw %}
{% raw %}me see and comfort you whUe you are in this place ? Oh,{% endraw %}
{% raw %}say ' yes!'"{% endraw %}
{% raw %}It was not in the human heart to withstand that perfect{% endraw %}
{% raw %}submission and loving entreaty altogether. The unnatural{% endraw %}
{% raw %}father was checked in his cruel impulses for a moment, but{% endraw %}
{% raw %}only for a moment. The relaxing brow gathered its frown{% endraw %}
{% raw %}again, and the poor, unhappy pleader saw refusal in his face{% endraw %}
{% raw %}before he uttered it.{% endraw %}
{% raw %}" No. I want nothing more to do with you. I have given{% endraw %}
{% raw %}you to Mauvais, and it is to him you are to submit your head¬{% endraw %}
{% raw %}strong wiU. If you desire to obey mc, do as he tells you;{% endraw %}
{% raw %}or, by heaven, I will curse you yet!"{% endraw %}
{% raw %}Alicia did not reply.  Her young life seemed crushed out of her, and{% endraw %}
{% raw %}she felt that the Juggernaut of perpetual despair had already{% endraw %}
{% raw %}gone over her. She had no fear, no resentment, no hope ; all{% endraw %}
{% raw %}was a dull, dead, motionless desolation. In this attitude she{% endraw %}
{% raw %}remained for several minutes, while her father uttered no{% endraw %}
{% raw %}word, and there was no sound in the room except the clank,{% endraw %}
{% raw %}clauk, of the chain on the prisoner's leg, as he moved impa¬{% endraw %}
{% raw %}tiently from time to time.{% endraw %}
{% raw %}The sheriff opened the door and announced that another{% endraw %}
{% raw %}visitor was waiting on the prisoner's leisure. Without{% endraw %}
{% raw %}..nquiriug who the visitor was, Mr. Newcome ordered him to{% endraw %}
{% raw %}be admitted, at the same time commanding the prostrate child{% endraw %}
{% raw %}to rise. Wearily she raised herself to her feet, turning her{% endraw %}
{% raw %}tear-stained face away from the observation of the new-comer.{% endraw %}
{% raw %}But he had already caught a glimpse that revealed to him the{% endraw %}
{% raw %}sorrow imprinted there, and her Ustless attitude betrayed the{% endraw %}
{% raw %}rest. He was too late!{% endraw %}
{% raw %}For a moment, the young man's self-possession -was in{% endraw %}
{% raw %}danger of being altogether lost; but he quickly conquered his{% endraw %}
{% raw %}rising indignation, and addressed himself to AUcia's father, as{% endraw %}
{% raw %}if she were not present, or not plunged in grief aud{% endraw %}
{% raw %}humUiation.{% endraw %}
{% raw %}" Mr. Newcome," said he, as firmly as possible, " I have{% endraw %}
{% raw %}called on you this morning to ask your consent to my{% endraw %}


TabTale games accompany Charlie’s Angels and Jumanji films
After you watch the movies, you can play the mobile games made in Israel for Sony Pictures Entertainment.
by ISRAEL21c StaffIsrael’s TabTale was tapped to create Free to Play (F2P) mobile games to accompany the release of two Sony Pictures Entertainment films: “Charlie’s Angels” (November 15) and “Jumanji: The Next Level” (December 13).
The deals expand on TabTale and Sony Pictures’ previous mobile game collaboration on the “Hotel Transylvania” TV series. Published last December, that game has accumulated over 21 million downloads.
In the “Charlie’s Angels” side-scrolling running F2P game, players try to catch crooks, bust bosses, perform high-speed car chases and fend off enemies.
The “Jumanji” game will enable players to run in four directions as they fight for their lives against enemies — climbing up cliffs, free-falling off waterfalls, and escaping from a horde of hyenas. Players can take on the persona of their favorite character from the movie.
Headquartered in Israel with global offices in China, Macedonia, and Bulgaria, TabTale has more than 2.6 billion mobile game downloads across its Crazy Labs portfolio.
“Prolonging the fun and excitement you experience while watching a movie is gradually becoming a must,” said Sagi Schliesser, CEO and cofounder of TabTale. “We are proud to launch the official games for the movies that will dominate the box office this holiday season.”
More News
-
TytoHome medical exam kit now sold across US at Best Buy
By ISRAEL21c Staff -
Israelis won’t let rockets from Gaza ruin weddings
By Abigail Klein Leichman -
Israeli eatery named one of best 25 restaurants in world
By ISRAEL21c Staff -
Teeth carry clues to mysterious early human Aurignacians
By Daniel Ben Tal -
New route to blocking children’s bone cancer
By ISRAEL21c Staff -
CN Traveler readers vote Israel one of 20 top countries
By Abigail Klein Leichman -
Israeli machine converts air into water for Colombians
By Abigail Klein Leichman -
Firms gather in Israel to share ideas for doing good
By Abigail Klein Leichman -
Movies can be early detection system for autism
By Daniel Ben Tal -
OurCrowd and Toyota Tsusho sign tech scouting agreement
By ISRAEL21c Staff -
Israel’s SpaceIL inspires fun escape room touring America
By Abigail Klein Leichman -
Israel’s REE gets behind wheel with Japan’s Hino Motors
By ISRAEL21c Staff -
Israeli tech sector sees biggest growth in investment and deals since 2013
By Brian Blum -
Israeli antiradiation vest to be tested in outer space
By Abigail Klein Leichman -
12,000 foreigners are pursuing higher education in Israel
By Abigail Klein Leichman -
Young Israeli menswear designer wins Lagerfeld Prize
By Abigail Klein Leichman -
Microsoft technology brings Ben-Gurion’s writings alive
By ISRAEL21c Staff -
Dream Doctors bring healing magic to hurricane-hit Bahamas
By Abigail Klein Leichman -
Prehistoric cave dwellers ‘canned’ marrow to eat later
By Brian Blum


--- layout: layouts/default.html title: Home permalink: / nav_order: 1 tags: page ---
What can I write about myself that doesn't sound like every other writer's tired biography? I love to write for humans and computers, so I made a writing website (which is more programming that Hemingway ever did).
What can I put here to encourage you to read my site?
Yeah, maybe that last one.


Create a regular expression to find all (opening and closing) HTML tags with their attributes.
An example of use:
```js run let regexp = /your regexp/g;
let str = ‘<> ’;
alert( str.match(regexp) ); // ‘’, ‘’, ‘’ ```
Here we assume that tag attributes may not contain <
and >
(inside quotes too), that simplifies things a bit.


http://action.vday.org/site/R?i=J-lxyU_9P6KabArOOUTO-g
http://action.vday.org/site/R?i=HpjFDPye2l_MQHYUGHHdTQ
http://action.vday.org/site/R?i=XyPTEc6AvcLCPEgPn1fwLA
http://action.vday.org/site/R?i=BVmxvL-TPj85zVPOcVH7Gw
http://action.vday.org/site/R?i=TOrx935w3OlvI7FBEcNuRA
http://action.vday.org/site/R?i=rE9aG4f_lXP_-MiScE5k4w
ett Joins Bodies of Revolution: Women
Rising Against the Violence of Police, States & Empire Panel
FGBoR_LogoURLArtists.jpg
JUST ANNOUNCED: Frances Garrett,
http://action.vday.org/site/R?i=oTLt-isXMF6IJFa02hbZAA
Bodies of Revolution: Women Rising Against the Violence of Police,
States & Empire
http://action.vday.org/site/R?i=3Y_8jFuUq5unN6lhjE54lw
panelists on Saturday, 5 Dec at Columbia Law School, NYC.
On 14 August, Fran’s daughter Michelle Cusseaux was killed at close
range by a Phoenix police officer who had been called to escort her to
a mental health facility. Since then, Fran has been involved in calls
for police reform, notably marching her daughter’s casket through
downtown Phoenix weeks after the shooting, calling for an outside
agency to investigate the wrongful death. Her efforts have been met
with reforms on the part of the city of Phoenix, including the
creation of the police department’s mental health advisory board and a
seven-member police unit dedicated to crisis intervention. Ms. Garrett
is currently working with the AAPF to develop the
campaign, a multi-dimensional project focused on resisting police
brutality against Black women.
FG sayher name with ee.jpg
PURCHASE tickets to Bodies of Revolution >
http://action.vday.org/site/R?i=XJ5ly_9hJ9BAx9NlBdo9cw
WATCH Frances speak about seeking justice for her daughter and the
acy Now! >
http://action.vday.org/site/R?i=5nHKPsDWkWKd_AlTk0LHZQ
Eve Ensler and Carl Dix with family members of Michelle Cusseaux,
murdered by Phoenix police in 2014, including her mother Frances
Garrett. (Photo Credit: www.revcom.us)
http://action.vday.org/site/R?i=GoFJnCFVfS3B92KyJ4u_Dw
One Billion Rising: Rise for Revolution Launches Continue
Congo Green 3.jpg
One Billion Rising: Rise for Revolution 2016 launches & events are
happening around the world. Activists are RISING for climate change in
London, for access to safe education for all in the Democratic
Republic of Congo, for marginalized groups in Swaziland, against
displacement, forced migration & state violence in the Philippines
and the US. In India women and men are RISING, dancing and singing to
end all forms of violence against women.
Be sure to follow the movement online to get the latest updates at the
OBR News & Blog page and on Facebook, Twitter and Instagram.
http://action.vday.org/site/R?i=dbmwxj72l_-GpW5wYgvZJQ
http://action.vday.org/site/R?i=5t3KqDBc7-O2m4RJ12urBg
http://action.vday.org/site/R?i=WP8YMO1aP7FiV7Ev3TWldA
http://action.vday.org/site/R?i=Q3Rkiu3Utmr9T1fsYw0ctw
Congo Green 10.jpg
One Billion Rising Revolution Begins in DR Congo >
http://action.vday.org/site/R?i=-XtyqjaRwmxS11ZYgMeAaQ
india OBR .jpeg
OBR at School of Open Learning in Partnership with Delhi Police >
http://action.vday.org/site/R?i=DQG8s6BZPDMnlYX6gwcQwg
Abha india 6.jpg
One Billion Rising: Rise for Revolution India Report >
http://action.vday.org/site/R?i=tp0sOyxN20i9833YlMYdLA
GABUSA logo 2016.jpeg
Rise for Revolution & IDEVAW Events by GABRIELA USA
http://action.vday.org/site/R?i=DHkMHsYFMFMVmcyY90S-TA
>
http://action.vday.org/site/R?i=FaC5gWcyRJVu0uFQQ1uMqw
image1.jpeg
Photo Blog: OBR Swaziland Launch >
http://action.vday.org/site/R?i=kUGEKD1y6uKrETml46vBCw
uk climate march.jpeg
Photo Blog: Rising for Climate Justice in London >
http://action.vday.org/site/R?i=SwZGUukdQrj_PFKj05H4tw
http://action.vday.org/site/R?i=2YwHNzLEFz0iBrQ9lDus9A
http://action.vday.org/site/R?i=PuY6AzBSNEYqDrSu8wOSIw
http://action.vday.org/site/R?i=39pe75SFmnCIv8-1Kain3Q
http://action.vday.org/site/R?i=xu8asYBai_L7REq4l6fttg
http://action.vday.org/site/R?i=a0kbeghSC6zJo7sY1-tu1Q
http://action.vday.org/site/R?i=xTPxshv1PliIOaAWEuO4Pg
http://action.vday.org/site/R?i=tO5oGWvS9VoNdg3rG6NVSA
http://action.vday.org/site/R?i=fnp5OiCIyIyNmbL5kZFNcw
unsubscribe
http://action.vday.org/site/CO?i=uK6xZ3bCaFmMENtOvPkUjg7volJuAyaI&cid=1062
Powered By Blackbaud


RUBI RESTAURANT
menu
about
awards
*We Deleiver<PHONE_NUMBER>
border="2"
border="2"
©Rubi Restaurant 2021


(October 2014 — June 2017)
(May 2013 — September 2014)
(Summer 2011)
(Summer 2010)
(Fall 2010, Fall 2011)
(Fall 2009 — Summer 2010)
Ranked by experience:
Notable Classes:
I have been learning UI design. Checking out my startup work for more examples (see Entrepreneurship).
I also have a strong discrete math background and some leadership experience.


Sleep Calculator
What time do you have to wake up?
The average human takes 15 minutes to fall asleep.
To wake up
refreshed at {{clockInput}}, you need go to sleep at one of the following
times:
If you wake up at one of these times, you’ll rise in between 90-minute sleep cycles. A good night’s sleep consists of 5-6 complete sleep cycles.


---
sort_order: 103
tei_id: rdx_191dd.p.idp17690432
annotation_count: 0
images:
small-thumbnail: https://readux.ecds.emory.edu/books/emory:191dd/pages/emory:rfgnq/mini-thumbnail/
json: https://readux.ecds.emory.edu/books/emory:191dd/pages/emory:rfgnq/info/
full: https://readux.ecds.emory.edu/books/emory:191dd/pages/emory:rfgnq/fs/
page: https://readux.ecds.emory.edu/books/emory:191dd/pages/emory:rfgnq/single-page/
thumbnail: https://readux.ecds.emory.edu/books/emory:191dd/pages/emory:rfgnq/thumbnail/
title: Page 103
number: 103
---
{% raw %}ALICIA'S GRIEF. 1D5{% endraw %}
{% raw %}The quivering voice and significant acc<int told all.{% endraw %}
{% raw %}" My father is dead!" gasped Alicia, becoming ghastly{% endraw %}
{% raw %}white. " Oh, Mrs. Wyman, my father is dead!" and she{% endraw %}
{% raw %}clung to ber friend for support.{% endraw %}
{% raw %}" Be as calm as you can, dear. Your father has gone to{% endraw %}
{% raw %}his Lord, who has shown him how good a daughter you{% endraw %}
{% raw %}were, and now he is reconciled with you. Let that comfort{% endraw %}
{% raw %}you, to feel that he is reconciled at last. Come, dear, let{% endraw %}
{% raw %}us go,"{% endraw %}
{% raw %}She meant to give her something to do ; she did not want{% endraw %}
{% raw %}to grant her au opportunity to give way to sorrow at first;{% endraw %}
{% raw %}so she put her arm about her and drew ber to the door, where{% endraw %}
{% raw %}Alien was waiting."{% endraw %}
{% raw %}" We are all ready," she said to him, with a glance of{% endraw %}
{% raw %}intelligence. " Help Alicia iu first, if you please."{% endraw %}
{% raw %}" Allen took her up in his arms, as he had done the even¬{% endraw %}
{% raw %}ing before, and placed her in the carriage.  She did not see, as Mrs. Wyman did, the{% endraw %}
{% raw %}blackened ruins where were lying the charred remains of{% endraw %}
{% raw %}her father. As if she knew instinctively the manner of his{% endraw %}
{% raw %}death, she did not even look in that direction, nor uncover{% endraw %}
{% raw %}her eyes until they reached home.{% endraw %}
{% raw %}But that day, a memorable one in the history of Fairview,{% endraw %}
{% raw %}enough was told her to confirm the horrible idea ■n'hich{% endraw %}
{% raw %}haunted her—enough to quite scare away all efforts at com¬{% endraw %}
{% raw %}posure, and sink her at last in a happy insensibUity that{% endraw %}
{% raw %}lasted for hours.{% endraw %}


--- layout: post title: "FizzBuzz kata in Clojure" description: "This post describes my first experience with doing the FizzBuzz kata in Clojure." date: 2013-04-11 06:20 UTC tags: [Languages] --- {% include JB/setup %}
{{ page.description }}
After having looked at Clojure for some time, I finally had a bit of time to play with it, so I decided to do the FizzBuzz kata in Clojure.
Clojure has a built-in testing framework, so I wrote a Parameterized Test for a single fizzbuzz function. Using TDD, I added test cases a little at a time, attempting to follow the Transformation Priority Premise, but the end result is this:
(ns fizzbuzz.core-test (:use clojure.test fizzbuzz.core)) (deftest fizzbuzz-test (are [expected i] (= expected (fizzbuzz i)) "1" 1 "2" 2 "Fizz" 3 "4" 4 "Buzz" 5 "Fizz" 6 "7" 7 "8" 8 "Fizz" 9 "Buzz" 10 "11" 11 "Fizz" 12 "13" 13 "14" 14 "FizzBuzz" 15 "FizzBuzz" 30))
Clojure syntax is somewhat backwards from what I'm normally used to, but the are macro expands into a collection of tests that each evaluate whether the result of invoking the fizzbuzz function with i
is equal to expected
.
Through a series of transformations of the SUT, I ended up with this implementation of the fizzbuzz function:
(ns fizzbuzz.core) (defn fizzbuzz [i] (cond (= 0 (mod i 15)) "FizzBuzz" (= 0 (mod i 3)) "Fizz" (= 0 (mod i 5)) "Buzz" :else (str i)))
This defines a function called fizzbuzz taking a single argument i
. The cond macro evaluates each test and returns the expression associated with the first test that evauluates to true. The first test checks if i
is divisible with 15 and returns "FizzBuzz" if this is the case; the next test checks if i
is divisible with 3 and returns "Fizz" if this is true, and so on.
The task defined by the kata is to print all FizzBuzz values from 1 to 100, so the above function is't the final solution. The next step I took was to write a test that defines a version of the fizzbuzz function taking two parameters:
(def acceptance-expected "1 2 Fizz 4 Buzz Fizz 7 8 Fizz Buzz 11 Fizz 13 14 FizzBuzz 16 17 Fizz 19 Buzz Fizz 22 23 Fizz Buzz 26 Fizz 28 29 FizzBuzz 31 32 Fizz 34 Buzz Fizz 37 38 Fizz Buzz 41 Fizz 43 44 FizzBuzz 46 47 Fizz 49 Buzz Fizz 52 53 Fizz Buzz 56 Fizz 58 59 FizzBuzz 61 62 Fizz 64 Buzz Fizz 67 68 Fizz Buzz 71 Fizz 73 74 FizzBuzz 76 77 Fizz 79 Buzz Fizz 82 83 Fizz Buzz 86 Fizz 88 89 FizzBuzz 91 92 Fizz 94 Buzz Fizz 97 98 Fizz Buzz") (deftest acceptance-test (is (= acceptance-expected (fizzbuzz 1 101))))
I decided to define the acceptance-expected
value outside of the test case itself, as I thought that made the test a bit more readable. The test case is defined by the is macro and states that the expected value is acceptance-expected
and the actual value is the result of invoking the fizzbuzz function with two arguments: 1 as the (inclusive) start value, and 101 as the (exclusive) end value. The above code listing of fizzbuzz only accept one argument, but the new test case requires two arguments, so I added an overload to the function:
(defn fizzbuzz ([i] (cond (= 0 (mod i 15)) "FizzBuzz" (= 0 (mod i 3)) "Fizz" (= 0 (mod i 5)) "Buzz" :else (str i))) ([start end] (apply str (interpose "\n" (map fizzbuzz (range start end))))))
The previous implementation is still there, now contained within the overload taking a single argument i
, but now there's also a new overload taking two arguments: start
and end
.
This overload generates a sequence of integers from start
to end
using the range function. It then maps that sequence of integers into a sequence of strings by mapping each integer to a string with the fizzbuzz function. That gives you a sequence of strings such as ("1" "2" "Fizz" "4" "Buzz")
.
In order to print all the FizzBuzz strings, I need to interpose a newline character between each string, which produces a new sequence of strings such as ("1" "\n" "2" "\n" "Fizz" "\n" "4" "\n" "Buzz")
. To concatenate all these strings, I apply the str function to the sequence.
The requirements of the kata is to print all FizzBuzz values from 1 to 100, and the code already does this. However, I interpret the kata as requiring a single function that takes no parameters, so I added an acceptance test case:
(deftest acceptance-test (is (= acceptance-expected (fizzbuzz 1 101))) (is (= acceptance-expected (fizzbuzz))))
Notice the second test case in the last line of code that invokes the fizzbuzz function without any parameters. It's easily resolved by adding a third overload:
(defn fizzbuzz ([] (fizzbuzz 1 101)) ([i] (cond (= 0 (mod i 15)) "FizzBuzz" (= 0 (mod i 3)) "Fizz" (= 0 (mod i 5)) "Buzz" :else (str i))) ([start end] (apply str (interpose "\n" (map fizzbuzz (range start end))))))
As you can see, the first overload takes no parameters and simply invokes the previously desribed overload with the start
and end
arguments.
FWIW, this entire solution is structurally similar to my implementation of FizzBuzz in F#.


Definition 5.6.7. Frequency Table. A frequency table lists each of the distinct values in a data set followed by the frequency of that value - the number of times that it appears in the data set.


Logo
About
Store
Contacts
0
Your Shopping Cart
Nike Air Max 200
0
Empty Shopping Cart
Finish Shopping
Nike Air Max 200
AQ2568-005
Size
40
38
39
40
41
42
43
44
45
Quantity
We only have 5 items in stock.
add to cart


BatchToSpace for N-D tensors of type T.
tf.compat.v2.batch_to_space
tf.batch_to_space( input, block_shape, crops, name=None )
This operation reshapes the "batch" dimension 0 into M + 1
dimensions of
shape block_shape + [batch]
, interleaves these blocks back into the grid
defined by the spatial dimensions [1, ..., M]
, to obtain a result with the
same rank as the input. The spatial dimensions of this intermediate result
are then optionally cropped according to crops
to produce the output. This
is the reverse of SpaceToBatch. See below for a precise description.
input
: A Tensor
. N-D with shape input_shape = [batch] + spatial_shape +
remaining_shape
, where spatial_shape has M dimensions.block_shape
: A Tensor
. Must be one of the following types: int32
,
int64
. 1-D with shape [M]
, all values must be >= 1. For backwards
compatibility with TF 1.0, this parameter may be an int, in which case it
is converted to numpy.array([block_shape, block_shape],
dtype=numpy.int64)
.crops
: A Tensor
. Must be one of the following types: int32
, int64
. 2-D
with shape [M, 2]
, all values must be >= 0. crops[i] = [crop_start,
crop_end]
specifies the amount to crop from input dimension i + 1
,
which corresponds to spatial dimension i
. It is required that
crop_start[i] + crop_end[i] <= block_shape[i] * input_shape[i + 1]
.
This operation is equivalent to the following steps:input
to reshaped
of shape: [block_shape[0], ...,
block_shape[M-1], batch / prod(block_shape), input_shape[1], ...,
input_shape[N-1]] 2. Permute dimensions of reshaped
to produce
permuted
of shape [batch / prod(block_shape), input_shape[1],
block_shape[0], ..., input_shape[M], block_shape[M-1],
input_shape[M+1], ..., input_shape[N-1]] 3. Reshape permuted
to
produce reshaped_permuted
of shape [batch / prod(block_shape),
input_shape[1] * block_shape[0], ..., input_shape[M] * block_shape[M-1],
input_shape[M+1], ..., input_shape[N-1]] 4. Crop the start and end of
dimensions [1, ..., M]
of reshaped_permuted
according to crops
to
produce the
output of shape: [batch / prod(block_shape), input_shape[1] *
block_shape[0] - crops[0,0] - crops[0,1], ..., input_shape[M] *
block_shape[M-1] - crops[M-1,0] - crops[M-1,1], input_shape[M+1],
..., input_shape[N-1]]
Some examples: (1) For the following input of shape [4, 1, 1, 1]
,
block_shape = [2, 2]
, and crops = [[0, 0], [0, 0]]
: [[[[1]]],
[[[2]]], [[[3]]], [[[4]]]]
The output tensor has shape [1, 2, 2, 1]
and value: x = [[[[1],
[2]], [[3], [4]]]]
(2) For the following input of shape [4, 1, 1,
3]
,
block_shape = [2, 2]
, and crops = [[0, 0], [0, 0]]
: [[[1, 2,
3]], [[4, 5, 6]], [[7, 8, 9]], [[10, 11, 12]]]
The output tensor has shape [1, 2, 2, 3]
and value: x = [[[[1, 2,
3], [4, 5, 6]], [[7, 8, 9], [10, 11, 12]]]]
(3) For the following
input of shape [4, 2, 2, 1]
,
block_shape = [2, 2]
, and crops = [[0, 0], [0, 0]]
: x =
[[[[1], [3]], [[9], [11]]], [[[2], [4]], [[10], [12]]], [[[5], [7]],
[[13], [15]]], [[[6], [8]], [[14], [16]]]]
The output tensor has shape [1, 4, 4, 1]
and value: x = [[[1],
[2], [3], [4]], [[5], [6], [7], [8]], [[9], [10], [11], [12]],
[[13], [14], [15], [16]]]
(4) For the following input of shape
[8, 1, 3, 1]
,
block_shape = [2, 2]
, and crops = [[0, 0], [2, 0]]
: x =
[[[[0], [1], [3]]], [[[0], [9], [11]]], [[[0], [2], [4]]], [[[0],
[10], [12]]], [[[0], [5], [7]]], [[[0], [13], [15]]], [[[0], [6],
[8]]], [[[0], [14], [16]]]]
The output tensor has shape [2, 2, 4, 1]
and value: x = [[[[1],
[2], [3], [4]], [[5], [6], [7], [8]]], [[[9], [10], [11], [12]],
[[13], [14], [15], [16]]]]
name
: A name for the operation (optional).A Tensor
. Has the same type as input
.


Unfortunately the page you're looking for was not found.
Zilker Elementary Sunday's @ 10am 1900 Bluebonnet Lane Austin, TX 78704
3005 S. Lamar Blvd., Ste. D109 #305 Austin, TX 78704
512.660.7901 Austin, TX 78704


Breadcrumbs
This component has been deprecated
See the Breadcrumb
component in Garden's @zendeskgarden/react-breadcrumbs
package for the latest updates.
The .c-breadcrumb
component classes are used to style breadcrumb navigation. Use
Bedrock CSS
to reset styling for embedded anchor tags.
Basic Structure
The breadcrumb CSS classes correspond with the following canonical structure.
-

-

-
Link
-
- etc.
-

Current
-
WAI-ARIA authoring practices indicate that this breadcrumb trail should be contained within a labeled navigation landmark region. See the playground example below for details.


{{< layout}} {{$pageTitle}}{{/pageTitle}} {{$propositionHeader}}{{/propositionHeader}} {{$content}}
A damaged passport is one that isn't in a condition to be used as proof of identity.
Your passport is damaged if:
You may not be allowed to leave or enter the UK if you travel with a damaged passport.


Neuroplasticity is the lifetime process of the brain reorganising itself by forming, strengthening and pruning neural connections. Changing concentrations of neurotransmitters result in a change in the connections between neurons, which can then eventually result in structural changes to the brain. The best driver of neuroplastic change is behaviour; practicing something will result in stronger neural pathways, while stopping practice will result in these pathways being pruned.
Understanding that the brain continues to reorganise itself according to your behaviour, thoughts and emotions is empowering.  This knowledge can help empower people to actively shape their brain's future development by establishing better habits and learning patterns.
There are multiple ways in which to take control of the power of neuroplasticity:
Individuals with a growth mindset believe that their abilities (e.g. intelligence, personality) can be grown through hard work and motivation. This allows them to take on challenges, rather than shy away from them. By constantly striving to learn and grow, they are able to increase their skills.
Individuals with a fixed mindset believe that their abilities are static; that these are traits they are born with which cannot be changed. This causes them to worry about the adequacy of these traits, and drives a need for validation and to prove themselves.
"Why waste time proving over and over how great you are when you could be getting better?"
I will integrate a growth mindset into my learning by sinking into challenges rather than shying away from them, with the knowledge that struggle means progress, and that my neural networks are growing. I will also help prime my brain for learning by ensuring I get at least 8 hours of sleep per night, engaging in regular exercise, and practicing self-care daily.


Server-Side Rendering
- faster time to first contentful paint
- crawlable by search engines
- enables social media previews
- works when JavaScript is disabled in the browser
- needs a powerful server
- must be written in a way which handles missing browser APIs


Keyboard (c) 2019-2020 || Keegan Livermore
This project provides a computer keyboard with all Sahaptin/Ichishkíin letters (including alternate characters using the ALT button) as well as a mobile keyboard for both Android and iOS that features a full layout with all characters visible with "alternate" versions (accented and hard) on key-hold options.


Contributing an article
If you’re contributing an article, please read these instructions on how to write and post an article on this blog.
##Using Markdown
All articles are written in markdown with minimal formatting necessary. To a first approximation your article should simply be a plain text file. Here’s the basic template your article should use:
---
layout: post
title: Using markdown
date: 2015-12-01 9:00:00
summary: Learn to write a post in markdown
author: Your name
visible: False
---
Articles are written in markdown (kramdown).
Please use minimal formatting for your article.
This is a single paragraph. It is separated by newlines.
No need for html tags.
A single line break does not start a new paragraph.
This is a another paragraph.
You can place subsections as follows.
## Using maths
You can use math as you would in latex. Let $n>2$ be an integer.
Consider the equation:
\[
a^n + b^n = c^n
\]
Wiles proved the following theorem.
> **Theorem** (Fermat's Last Theorem).
> The above equation has no solution in the positive integers.
## Links and images
You can place a link like [this](http://wikipedia.org).

There really isn't more you need to know.
The post would appear like this on the web. If you need more than what is in the above example, check out this kramdown reference. You may also use any valid HTML tag in your article, but please try to avoid this.
##Submitting an article
The blog lives in this github repository. If you are a regular contributor and your github account has admin access to the repository, you can add an article like this from your command line:
git clone https://github.com/offconvex/offconvex.github.io.git
cd offconvex.github.io/_posts
cp 2015-12-01-template.md 2015-12-01-your-post-tile.md
git add 2015-12-01-your-post-tile.md
# edit the article using your favorite editor
git commit -m "my post"
git push -u origin master
If after that you make more changes you can upload them as follows:
git commit -am "new changes"
git pull
git push
If you don’t have admin access, you can either create a pull request (assuming you’re comfortable with git) or send any regular contributor the article in markdown. If so, please start from this template and follow the above.


Too Hungry to travel ?
FoodMania is here to satisfy your tastebuds !
Enjoy delicious food delivered
at your doorstep !
** Order online Now **
Create an account to get 10% off on your first 3 Orders.
T&C Applied.
A balanced diet is a cookie in each hand.
You can't just eat good food, you've got to talk about it too.
Laughter is brightest where food is best.
Life is a combination of magic and pasta.
Age and glasses of wine should never be counted😉
Life is uncertain. Eat dessert first.


ITCB_Device_Protocol
public protocol ITCB_Device_Protocol
This just has a couple of common properties.
-
This is the device name.
Declaration
Swift
var name: String { get }
-
This is any errors that may have occurred. It may be nil.
Declaration
Swift
var error: ITCB_Errors! { get }
-
This is a “faux Equatable” method. It allows us to compare something that is expressed only as a protocol instance with ourselves, without the need to be Equatable.
The reason for doing this, is that I don’t want to have to conform to the whole Equatable protocol. We just need a quick identity test, and this will give it to us without requiring anything too fancy.
Declaration
Swift
func amIThisDevice(_ inDevice: ITCB_Device_Protocol) -> Bool
Parameters
inDevice
The device that we are comparing.
Return Value
True, if we are the device.
-
This allows the user of an SDK to reject a connection attempt by another device (either a question or an answer).
The reason that we have this, as opposed to a function return from the observer, is because I think observer should be one-way. Outgoing only.
Declaration
Swift
func rejectConnectionBecause(_ reason: ITCB_RejectionReason!)
Parameters
reason
The reason for the rejection. It may be nil. If nil, .unkownError is assumed, with no error associated value.


Popovers can contain any arbitrary HTML, Angular bindings and even directives!
Simply enclose desired content in the <bs-popover>
element.
If you want to add arbitrary HTML to the header use the tag <header>
.
To use Popovers with input you will need to pass the #referenceId
to the <bs-popover>
You can easily override open and close event triggers by specifying event names
using showEvent
and hideEvent
Alternatively you can take full manual control over popover opening / closing events.


{% extends base %}
{% block title %}Decision Tree Visualizer{% endblock %}
{% block postamble %}
{% endblock %}
{% block contents %}
Decision Tree Visualizer
We are a group of undergraduate students working on a research project. The main goal of the project is to design and develop visual techniques to explain a small set of popular ML algorithms.
Our first stop is Decision Trees apparently.
Datasets used in the tree:
Lenses - Mushrooms


Center for Healthy Communities at UC Riverside
Collaborating With Communities to Improve the Lives of the People of Inland Southern California
The Center for Healthy Communities (CHC) at the University of California, Riverside promotes research to improve the health of the culturally and economically diverse communities in Inland Southern California, especially those that are medically underserved.
The center fosters collaborations between UCR faculty, community-based organizations, grass-roots community leaders, and investigators at RAND and UCLA. Although the center is housed in the UCR School of Medicine, the intention is for it to be of benefit to all UCR faculty and programs and to community-based partners.
Get Connected: Join our ListServ
The ListServ of the Center for Healthy Communities connects people who are interested in community-based and community-partnered research in Inland Southern California. Members include investigators from other universities and institutions, faculty and staff at UCR, individuals associated with health service systems, members of community-based-organizations, and grass roots advocates and citizens interested in issues related to public health.
- To join the ListServ, email<EMAIL_ADDRESS>Have a Question?
For inquiries about the Center for Healthy Communities, call<PHONE_NUMBER> or e-mail chc@medsch.ucr.edu.


“Avoiding success at all cost” is the informal motto behinds Haskell. It could be parenthesized in two ways, either “Avoiding (success at all cost)” or “(Avoiding sucess) (at all cost)”.
I’m not going to interpret them directly but rather to share some thoughts on “the success vs. costs” basing on my very own understanding and experience.
The success vs. cost of language design
There’re always trade offs (or compromises) in any software design, and programming language design has no exceptions.
In other words, all language design decision that made them “successful” i.e. being popular and widely-used in industry or education for some reasons, all comes with their own “costs”: being unsafe, limited expressiveness, or having bad performance, etc.
Whether or not the “cost” is a problem really depends on scenarios, or their goals. For instances, Python/JavaScript are both very expressive and beginner-friendly by being dynamically-typed, sacrifing the type safety and performance. Java, in constrast, uses a much safer and optimization-friendly type system but being much less expressive. Another typicial comparison would be memory management in programming languages, where languages that are “managed” (by either ARC or Gabage Collector) could be much easier and safer (in terms of memory) for most programmers but also considerred slower than languages that are “closer to the metal”.
None of these “costs”, or “differences”, really prevent them from being immortally popular.
For Haskell, the story becomes quite different: being research-oriented means the goal of this language is to pursue some “ultimate” things: the “ultimate” simplicity of intermediate representation, the “ultimate” type system where safety and expressiveness can coexist, the “ultimate” compilation speed and runtime performance, the “ultimate” concise and elegant concrete syntax, the “ultimate”…I don’t know. But it has to be some “ultimate” things that is very difficult, probably endless and impossible, to achieve.
This, as a result, made all language decisions in Haskell became very hard and slow, because almost nothing can be scarified. That’s why Haskell insisted to be lazy to “guard” the purity regardless of some problems of being “call-by-need”; a decent IO mechanisms is missing in the first 4 yrs after the project’s start until P Walder found Monad; and the Type Class, which is first proposed in P Walder’s 1989 paper, spent yrs long to implement and popularize.
As a side note though, it doesn’t mean there is no compromise in Haskell at all. It’s just as minimized as it could be during its progress. When one audience asking why we have Haskell and OCaml, which’re quite similar in very high level, both survived, SPJ replies:
There’s just a different set of compromises.
The success vs. cost of language design process
Another common but extremely controversial (if not the most) topics of programming language design is about its design process: Would you prefer dictatorship or a committee (in other words, a dictatorship of many?)? Would you prefer being proprietary or standardized? In which form would you write the standards, in human nature language, pseudo code, or formal semantics? How many and how frequently breaking changes dare you make? Would you let open source community involve in?
Again, I think there is no THE answer for all those questions. Majority of popular programming languages came and are still on going with very different paths.
Python, whose creater, Guido van Rossum, known as the “Benevolent Dictator For Life” (BDFL), i.e. good kind of dictator, still play the central role (until July 2018) of the Python’s development after Python getting popular and adapt a open source and community-based development model. This factor direcly contribute to the fact that Python 3, as a breaking (not completely backward-compatible and not easy to port) but good (in terms of language design and consistency) revision of the language can still be landed, despite of many communities’ pressures. There’re many language (Ruby, Perl, Elm) also choose to follow this route.
JavaScript, widely known as being created by Brendan Eich in 10 days, in comparision, quickly involved into a committee (TC39) and standardized (ECMAScript) language due to both the open nature of the Web and fast adoption of itself. But Brendan, as the creater, wasn’t even powerful enough to push the committee landing ES4, which is also a breaking but much better revision, but ended up with the ES5 (Harmony), a backward-compatible, yet much less ambitious version due to many political “fights” between different parties (e.g. Mozilla, Microsoft, Yahoo etc.) thus the history wasn’t changed. Even the latest rising and yearly releasing of the “modern” JavaScript (ES6 or ES2015, 2016, 2017…) are mainly driven by the new generation of committee parties (+ Google, Facebook, Airbnb etc.) and still in a very open and standardized way.
As you can see here, even the history and progress of two rather similar languages can be so different, not to mention more proprietary languages such as Java from Sun/Oracle, C# from Microsoft, OC/Swift from Apple (though the latter was open sourced) or more academia and standardized language like SML and Scheme which both has a standard written in formal semantics.
So it’s not not obvious that Haskell, also chose its own unique process to suit its unique goal. Although it backs on academia, it chose a rather practical/less-formal approach to define the language, i.e. the compiler implementation over standardization (plus many “formal” fragments among papers though), which is more like C++/OCaml from this point of view. It has a committee, but instead of being very open and conservative, it’s more dictatorial (in terms of average users) and super aggressive in terms of making breaking changes. As a result however, it trained a group of very change-tolerant people in its community…All of these quirks and odds combined works very well and avoid the Haskell “becoming too success too quickly”.
End thoughts
To be fair, Haskell has alreay been very “successful” nowdays, in particular academia (for education, sexy type laboratory etc.) but also industry, either being used in real business or being very reputable among programmers (as being both hard and fun).
I am not confident and qualified to say Haskell is success in the right degree at the right time. But it’s great to see it, after more than 20 and now almost 30 yrs, slowly figure out its very own way, to “Escape from the Ivory Tower”, and keep going beyond.


ETAPAS- Use Case2
TUG report through R1 platform
This report is a result of the Use Case 2 in ETAPAS European project. The Use Case focuses on robot-mediated rehabilitation applied in the context of high intensity and repetitive therapy based on the TUG (Timed Up and Go) exercise.
The autonomous platform will be evaluated in terms of:
- correspondence between traditional TUG test with data acquired by the therapists by mean of a stopwatch and data acquired by R1
- correspondence between traditional TUG test with data acquired by commercial IMU and data acquired by R1
- correspondence between kinematic data acquired by commercial IMU and by R1 during TUG
- perception of use of R1 robot for TUG test, both from therapists and from healthy subjects participating in this trial, in terms of usability, acceptance and perceived usefulness through questionnaires.
***********************************************************************************************************************************
| Subject ID: |
{{subject_id}} |
| # trial: |
{{num_trial}} |
| Date: |
{{date}} |
***********************************************************************************************************************************
Full TUG metrics:
| # Steps: |
{{full_steps}} |
| Walking time: |
{{full_walking_time}} s |
| TUG time: |
{{full_TUG_time}} s |
| Mean step length: |
{{mean_step_length}} m |
| Mean step width: |
{{mean_step_width}} m |
| Frequency: |
{{full_frequency}} steps/s |
| Velocity: |
{{full_speed}} m/s |
| Acceleration: |
{{full_acceleration}} m/s^2 |
| Velocity in z-axis: |
{{full_speed_z}} m/s |
| Acceleration in z-axis: |
{{full_acceleration_z}} m/s^2 |
|
|
|
***********************************************************************************************************************************
In the following tables, a detailed analysis of each TUG phase is provided.
Standing phase:
| Execution time: |
{{standing_time}} s |
| Velocity in z-axis: |
{{standing_speed_z}} m/s |
| Acceleration in z-axis: |
{{standing_acceleration_z}} m/s^2 |
|
Sitting phase:
| Execution time: |
{{sitting_time}} s |
| Velocity in z-axis: |
{{sitting_speed_z}} m/s |
| Acceleration in z-axis: |
{{sitting_acceleration_z}} m/s^2 |
|
Walking forward phase:
| # Steps: |
{{walk_f_steps}} |
| Execution time: |
{{walk_f_time}} s |
| Frequency: |
{{walk_f_frequency}} steps/s |
| Velocity: |
{{walk_f_speed}} m/s |
| Acceleration: |
{{walk_f_acceleration}} m/s^2 |
| Velocity in z-axis: |
{{walk_f_speed_z}} m/s |
| Acceleration in z-axis: |
{{walk_f_acceleration_z}} m/s^2 |
|
Walking backward phase:
| # Steps: |
{{walk_b_steps}} |
| Execution time: |
{{walk_b_time}} s |
| Frequency: |
{{walk_b_frequency}} steps/s |
| Velocity: |
{{walk_b_speed}} m/s |
| Acceleration: |
{{walk_b_acceleration}} m/s^2 |
| Velocity in z-axis: |
{{walk_b_speed_z}} m/s |
| Acceleration in z-axis: |
{{walk_b_acceleration_z}} m/s^2 |
|
Turning-1 phase:
| # Steps: |
{{turn1_steps}} |
| Execution time: |
{{turn1_time}} s |
| Frequency: |
{{turn1_frequency}} steps/s |
| Velocity: |
{{turn1_speed}} m/s |
| Acceleration: |
{{turn1_acceleration}} m/s^2 |
| Velocity in z-axis: |
{{turn1_speed_z}} m/s |
| Acceleration in z-axis: |
{{turn1_acceleration_z}} m/s^2 |
|
Turning-2 phase:
| # Steps: |
{{turn2_steps}} |
| Execution time: |
{{turn2_time}} s |
| Frequency: |
{{turn2_frequency}} steps/s |
| Velocity: |
{{turn2_speed}} m/s |
| Acceleration: |
{{turn2_acceleration}} m/s^2 |
| Velocity in z-axis: |
{{turn2_speed_z}} m/s |
| Acceleration in z-axis: |
{{turn2_acceleration_z}} m/s^2 |
|


Boy Scouts
Troop 112
Washington CH, Ohio
X
Home
Welcome to Troop 112
Oath & Law
Quiz
Ranks
Resources
WCH Scout Portal


1 : /*
2 : * jchuff.c
3 : *
4 : * Copyright (C) 1991-1997, Thomas G. Lane.
5 : * This file is part of the Independent JPEG Group's software.
6 : * For conditions of distribution and use, see the accompanying README file.
7 : *
8 : * This file contains Huffman entropy encoding routines.
9 : *
10 : * Much of the complexity here has to do with supporting output suspension.
11 : * If the data destination module demands suspension, we want to be able to
12 : * back up to the start of the current MCU. To do this, we copy state
13 : * variables into local working storage, and update them back to the
14 : * permanent JPEG objects only upon successful completion of an MCU.
15 : */
16 :
17 : #define JPEG_INTERNALS
18 : #include "jinclude.h"
19 : #include "jpeglib.h"
20 : #include "jchuff.h" /* Declarations shared with jcphuff.c */
21 :
22 :
23 : /* Expanded entropy encoder object for Huffman encoding.
24 : *
25 : * The savable_state subrecord contains fields that change within an MCU,
26 : * but must not be updated permanently until we complete the MCU.
27 : */
28 :
29 : typedef struct {
30 : INT32 put_buffer; /* current bit-accumulation buffer */
31 : int put_bits; /* # of bits now in it */
32 : int last_dc_val[MAX_COMPS_IN_SCAN]; /* last DC coef for each component */
33 : } savable_state;
34 :
35 : /* This macro is to work around compilers with missing or broken
36 : * structure assignment. You'll need to fix this code if you have
37 : * such a compiler and you change MAX_COMPS_IN_SCAN.
38 : */
39 :
40 : #ifndef NO_STRUCT_ASSIGN
41 : #define ASSIGN_STATE(dest,src) ((dest) = (src))
42 : #else
43 : #if MAX_COMPS_IN_SCAN == 4
44 : #define ASSIGN_STATE(dest,src) \
45 : ((dest).put_buffer = (src).put_buffer, \
46 : (dest).put_bits = (src).put_bits, \
47 : (dest).last_dc_val[0] = (src).last_dc_val[0], \
48 : (dest).last_dc_val[1] = (src).last_dc_val[1], \
49 : (dest).last_dc_val[2] = (src).last_dc_val[2], \
50 : (dest).last_dc_val[3] = (src).last_dc_val[3])
51 : #endif
52 : #endif
53 :
54 :
55 : typedef struct {
56 : struct jpeg_entropy_encoder pub; /* public fields */
57 :
58 : savable_state saved; /* Bit buffer & DC state at start of MCU */
59 :
60 : /* These fields are NOT loaded into local working state. */
61 : unsigned int restarts_to_go; /* MCUs left in this restart interval */
62 : int next_restart_num; /* next restart number to write (0-7) */
63 :
64 : /* Pointers to derived tables (these workspaces have image lifespan) */
65 : c_derived_tbl * dc_derived_tbls[NUM_HUFF_TBLS];
66 : c_derived_tbl * ac_derived_tbls[NUM_HUFF_TBLS];
67 :
68 : #ifdef ENTROPY_OPT_SUPPORTED /* Statistics tables for optimization */
69 : long * dc_count_ptrs[NUM_HUFF_TBLS];
70 : long * ac_count_ptrs[NUM_HUFF_TBLS];
71 : #endif
72 : } huff_entropy_encoder;
73 :
74 : typedef huff_entropy_encoder * huff_entropy_ptr;
75 :
76 : /* Working state while writing an MCU.
77 : * This struct contains all the fields that are needed by subroutines.
78 : */
79 :
80 : typedef struct {
81 : JOCTET * next_output_byte; /* => next byte to write in buffer */
82 : size_t free_in_buffer; /* # of byte spaces remaining in buffer */
83 : savable_state cur; /* Current bit buffer & DC state */
84 : j_compress_ptr cinfo; /* dump_buffer needs access to this */
85 : } working_state;
86 :
87 :
88 : /* Forward declarations */
89 : METHODDEF(boolean) encode_mcu_huff JPP((j_compress_ptr cinfo,
90 : JBLOCKROW *MCU_data));
91 : METHODDEF(void) finish_pass_huff JPP((j_compress_ptr cinfo));
92 : #ifdef ENTROPY_OPT_SUPPORTED
93 : METHODDEF(boolean) encode_mcu_gather JPP((j_compress_ptr cinfo,
94 : JBLOCKROW *MCU_data));
95 : METHODDEF(void) finish_pass_gather JPP((j_compress_ptr cinfo));
96 : #endif
97 :
98 :
99 : /*
100 : * Initialize for a Huffman-compressed scan.
101 : * If gather_statistics is TRUE, we do not output anything during the scan,
102 : * just count the Huffman symbols used and generate Huffman code tables.
103 : */
104 :
105 : METHODDEF(void)
106 4479: start_pass_huff (j_compress_ptr cinfo, boolean gather_statistics)
107 : {
108 4479: huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
109 : int ci, dctbl, actbl;
110 : jpeg_component_info * compptr;
111 :
0: branch 0 not taken
4479: branch 1 taken
112 4479: if (gather_statistics) {
113 : #ifdef ENTROPY_OPT_SUPPORTED
114 0: entropy->pub.encode_mcu = encode_mcu_gather;
115 0: entropy->pub.finish_pass = finish_pass_gather;
116 : #else
117 : ERREXIT(cinfo, JERR_NOT_COMPILED);
118 : #endif
119 : } else {
120 4479: entropy->pub.encode_mcu = encode_mcu_huff;
121 4479: entropy->pub.finish_pass = finish_pass_huff;
122 : }
123 :
11339: branch 0 taken
4479: branch 1 taken
124 15818: for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
125 11339: compptr = cinfo->cur_comp_info[ci];
126 11339: dctbl = compptr->dc_tbl_no;
127 11339: actbl = compptr->ac_tbl_no;
0: branch 0 not taken
11339: branch 1 taken
128 11339: if (gather_statistics) {
129 : #ifdef ENTROPY_OPT_SUPPORTED
130 : /* Check for invalid table indexes */
131 : /* (make_c_derived_tbl does this in the other path) */
0: branch 0 not taken
0: branch 1 not taken
0: branch 2 not taken
0: branch 3 not taken
132 0: if (dctbl < 0 || dctbl >= NUM_HUFF_TBLS)
133 0: ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, dctbl);
0: branch 0 not taken
0: branch 1 not taken
0: branch 2 not taken
0: branch 3 not taken
134 0: if (actbl < 0 || actbl >= NUM_HUFF_TBLS)
135 0: ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, actbl);
136 : /* Allocate and zero the statistics tables */
137 : /* Note that jpeg_gen_optimal_table expects 257 entries in each table! */
0: branch 0 not taken
0: branch 1 not taken
138 0: if (entropy->dc_count_ptrs[dctbl] == NULL)
139 0: entropy->dc_count_ptrs[dctbl] = (long *)
140 0: (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
141 : 257 * SIZEOF(long));
142 0: MEMZERO(entropy->dc_count_ptrs[dctbl], 257 * SIZEOF(long));
0: branch 0 not taken
0: branch 1 not taken
143 0: if (entropy->ac_count_ptrs[actbl] == NULL)
144 0: entropy->ac_count_ptrs[actbl] = (long *)
145 0: (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
146 : 257 * SIZEOF(long));
147 0: MEMZERO(entropy->ac_count_ptrs[actbl], 257 * SIZEOF(long));
148 : #endif
149 : } else {
150 : /* Compute derived values for Huffman tables */
151 : /* We may do this more than once for a table, but it's not expensive */
152 11339: jpeg_make_c_derived_tbl(cinfo, TRUE, dctbl,
153 : & entropy->dc_derived_tbls[dctbl]);
154 11339: jpeg_make_c_derived_tbl(cinfo, FALSE, actbl,
155 : & entropy->ac_derived_tbls[actbl]);
156 : }
157 : /* Initialize DC predictions to 0 */
158 11339: entropy->saved.last_dc_val[ci] = 0;
159 : }
160 :
161 : /* Initialize bit buffer to empty */
162 4479: entropy->saved.put_buffer = 0;
163 4479: entropy->saved.put_bits = 0;
164 :
165 : /* Initialize restart stuff */
166 4479: entropy->restarts_to_go = cinfo->restart_interval;
167 4479: entropy->next_restart_num = 0;
168 4479: }
169 :
170 :
171 : /*
172 : * Compute the derived values for a Huffman table.
173 : * This routine also performs some validation checks on the table.
174 : *
175 : * Note this is also used by jcphuff.c.
176 : */
177 :
178 : GLOBAL(void)
179 22678: jpeg_make_c_derived_tbl (j_compress_ptr cinfo, boolean isDC, int tblno,
180 : c_derived_tbl ** pdtbl)
181 : {
182 : JHUFF_TBL *htbl;
183 : c_derived_tbl *dtbl;
184 : int p, i, l, lastp, si, maxsymbol;
185 : char huffsize[257];
186 : unsigned int huffcode[257];
187 : unsigned int code;
188 :
189 : /* Note that huffsize[] and huffcode[] are filled in code-length order,
190 : * paralleling the order of the symbols themselves in htbl->huffval[].
191 : */
192 :
193 : /* Find the input Huffman table */
22678: branch 0 taken
0: branch 1 not taken
0: branch 2 not taken
22678: branch 3 taken
194 22678: if (tblno < 0 || tblno >= NUM_HUFF_TBLS)
195 0: ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tblno);
196 22678: htbl =
11339: branch 0 taken
11339: branch 1 taken
197 22678: isDC ? cinfo->dc_huff_tbl_ptrs[tblno] : cinfo->ac_huff_tbl_ptrs[tblno];
0: branch 0 not taken
22678: branch 1 taken
198 22678: if (htbl == NULL)
199 0: ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tblno);
200 :
201 : /* Allocate a workspace if we haven't already done so. */
15818: branch 0 taken
6860: branch 1 taken
202 22678: if (*pdtbl == NULL)
203 15818: *pdtbl = (c_derived_tbl *)
204 15818: (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
205 : SIZEOF(c_derived_tbl));
206 22678: dtbl = *pdtbl;
207 :
208 : /* Figure C.1: make table of Huffman code length for each symbol */
209 :
210 22678: p = 0;
362848: branch 0 taken
22678: branch 1 taken
211 385526: for (l = 1; l <= 16; l++) {
212 362848: i = (int) htbl->bits[l];
362848: branch 0 taken
0: branch 1 not taken
0: branch 2 not taken
362848: branch 3 taken
213 362848: if (i < 0 || p + i > 256) /* protect against table overrun */
214 0: ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);
1972986: branch 0 taken
362848: branch 1 taken
215 2698682: while (i--)
216 1972986: huffsize[p++] = (char) l;
217 : }
218 22678: huffsize[p] = 0;
219 22678: lastp = p;
220 :
221 : /* Figure C.2: generate the codes themselves */
222 : /* We also validate that the counts represent a legal Huffman code tree. */
223 :
224 22678: code = 0;
225 22678: si = huffsize[0];
226 22678: p = 0;
274517: branch 0 taken
22678: branch 1 taken
227 319873: while (huffsize[p]) {
1972986: branch 0 taken
274517: branch 1 taken
228 2522020: while (((int) huffsize[p]) == si) {
229 1972986: huffcode[p++] = code;
230 1972986: code++;
231 : }
232 : /* code is now 1 more than the last code used for codelength si; but
233 : * it must still fit in si bits, since no code is allowed to be all ones.
234 : */
0: branch 0 not taken
274517: branch 1 taken
235 274517: if (((INT32) code) >= (((INT32) 1) << si))
236 0: ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);
237 274517: code <<= 1;
238 274517: si++;
239 : }
240 :
241 : /* Figure C.3: generate encoding tables */
242 : /* These are code and size indexed by symbol value */
243 :
244 : /* Set all codeless symbols to have code length 0;
245 : * this lets us detect duplicate VAL entries here, and later
246 : * allows emit_bits to detect any attempt to emit such symbols.
247 : */
248 22678: MEMZERO(dtbl->ehufsi, SIZEOF(dtbl->ehufsi));
249 :
250 : /* This is also a convenient place to check for out-of-range
251 : * and duplicated VAL entries. We allow 0..255 for AC symbols
252 : * but only 0..15 for DC. (We could constrain them further
253 : * based on data depth and mode, but this seems enough.)
254 : */
11339: branch 0 taken
11339: branch 1 taken
255 22678: maxsymbol = isDC ? 15 : 255;
256 :
1972986: branch 0 taken
22678: branch 1 taken
257 1995664: for (p = 0; p < lastp; p++) {
258 1972986: i = htbl->huffval[p];
1972986: branch 0 taken
0: branch 1 not taken
1972986: branch 2 taken
0: branch 3 not taken
0: branch 4 not taken
1972986: branch 5 taken
259 1972986: if (i < 0 || i > maxsymbol || dtbl->ehufsi[i])
260 0: ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);
261 1972986: dtbl->ehufco[i] = huffcode[p];
262 1972986: dtbl->ehufsi[i] = huffsize[p];
263 : }
264 22678: }
265 :
266 :
267 : /* Outputting bytes to the file */
268 :
269 : /* Emit a byte, taking 'action' if must suspend. */
270 : #define emit_byte(state,val,action) \
271 : { *(state)->next_output_byte++ = (JOCTET) (val); \
272 : if (--(state)->free_in_buffer == 0) \
273 : if (! dump_buffer(state)) \
274 : { action; } }
275 :
276 :
277 : LOCAL(boolean)
278 0: dump_buffer (working_state * state)
279 : /* Empty the output buffer; return TRUE if successful, FALSE if must suspend */
280 : {
281 0: struct jpeg_destination_mgr * dest = state->cinfo->dest;
282 :
0: branch 1 not taken
0: branch 2 not taken
283 0: if (! (*dest->empty_output_buffer) (state->cinfo))
284 0: return FALSE;
285 : /* After a successful buffer dump, must reset buffer pointers */
286 0: state->next_output_byte = dest->next_output_byte;
287 0: state->free_in_buffer = dest->free_in_buffer;
288 0: return TRUE;
289 : }
290 :
291 :
292 : /* Outputting bits to the file */
293 :
294 : /* Only the right 24 bits of put_buffer are used; the valid bits are
295 : * left-justified in this part. At most 16 bits can be passed to emit_bits
296 : * in one call, and we never retain more than 7 bits in put_buffer
297 : * between calls, so 24 bits are sufficient.
298 : */
299 :
300 : INLINE
301 : LOCAL(boolean)
302 651516: emit_bits (working_state * state, unsigned int code, int size)
303 : /* Emit some bits; return TRUE if successful, FALSE if must suspend */
304 : {
305 : /* This routine is heavily used, so it's worth coding tightly. */
306 651516: register INT32 put_buffer = (INT32) code;
307 651516: register int put_bits = state->cur.put_bits;
308 :
309 : /* if size is 0, caller used an invalid Huffman table entry */
0: branch 0 not taken
651516: branch 1 taken
310 651516: if (size == 0)
311 0: ERREXIT(state->cinfo, JERR_HUFF_MISSING_CODE);
312 :
313 651516: put_buffer &= (((INT32) 1)<<size) - 1; /* mask off any extra bits in code */
314 :
315 651516: put_bits += size; /* new number of bits in buffer */
316 :
317 651516: put_buffer <<= 24 - put_bits; /* align incoming bits */
318 :
319 651516: put_buffer |= state->cur.put_buffer; /* and merge with old buffer contents */
320 :
238314: branch 0 taken
651516: branch 1 taken
321 1541346: while (put_bits >= 8) {
322 238314: int c = (int) ((put_buffer >> 16) & 0xFF);
323 :
0: branch 0 not taken
238314: branch 1 taken
0: branch 3 not taken
0: branch 4 not taken
324 238314: emit_byte(state, c, return FALSE);
2709: branch 0 taken
235605: branch 1 taken
325 238314: if (c == 0xFF) { /* need to stuff a zero byte? */
0: branch 0 not taken
2709: branch 1 taken
0: branch 3 not taken
0: branch 4 not taken
326 2709: emit_byte(state, 0, return FALSE);
327 : }
328 238314: put_buffer <<= 8;
329 238314: put_bits -= 8;
330 : }
331 :
332 651516: state->cur.put_buffer = put_buffer; /* update state variables */
333 651516: state->cur.put_bits = put_bits;
334 :
335 651516: return TRUE;
336 : }
337 :
338 :
339 : LOCAL(boolean)
340 2518: flush_bits (working_state * state)
341 : {
0: branch 1 not taken
2518: branch 2 taken
342 2518: if (! emit_bits(state, 0x7F, 7)) /* fill any partial byte with ones */
343 0: return FALSE;
344 2518: state->cur.put_buffer = 0; /* and reset bit-buffer to empty */
345 2518: state->cur.put_bits = 0;
346 2518: return TRUE;
347 : }
348 :
349 :
350 : /* Encode a single block's worth of coefficients */
351 :
352 : LOCAL(boolean)
353 204906: encode_one_block (working_state * state, JCOEFPTR block, int last_dc_val,
354 : c_derived_tbl *dctbl, c_derived_tbl *actbl)
355 : {
356 : register int temp, temp2;
357 : register int nbits;
358 : register int k, r, i;
359 :
360 : /* Encode the DC coefficient difference per section F.1.2.1 */
361 :
362 204906: temp = temp2 = block[0] - last_dc_val;
363 :
4370: branch 0 taken
200536: branch 1 taken
364 204906: if (temp < 0) {
365 4370: temp = -temp; /* temp is abs value of input */
366 : /* For a negative input, want temp2 = bitwise complement of abs(input) */
367 : /* This code assumes we are on a two's complement machine */
368 4370: temp2--;
369 : }
370 :
371 : /* Find the number of bits needed for the magnitude of the coefficient */
372 204906: nbits = 0;
49637: branch 0 taken
204906: branch 1 taken
373 459449: while (temp) {
374 49637: nbits++;
375 49637: temp >>= 1;
376 : }
377 : /* Check for out-of-range coefficient values.
378 : * Since we're encoding a difference, the range limit is twice as much.
379 : */
0: branch 0 not taken
204906: branch 1 taken
380 204906: if (nbits > MAX_COEF_BITS+1)
381 0: ERREXIT(state->cinfo, JERR_BAD_DCT_COEF);
382 :
383 : /* Emit the Huffman-coded symbol for the number of bits */
0: branch 1 not taken
204906: branch 2 taken
384 204906: if (! emit_bits(state, dctbl->ehufco[nbits], dctbl->ehufsi[nbits]))
385 0: return FALSE;
386 :
387 : /* Emit that number of bits of the value, if positive, */
388 : /* or the complement of its magnitude, if negative. */
11067: branch 0 taken
193839: branch 1 taken
389 204906: if (nbits) /* emit_bits rejects calls with size 0 */
0: branch 1 not taken
11067: branch 2 taken
390 11067: if (! emit_bits(state, (unsigned int) temp2, nbits))
391 0: return FALSE;
392 :
393 : /* Encode the AC coefficients per section F.1.2.2 */
394 :
395 204906: r = 0; /* r = run length of zeros */
396 :
12909078: branch 0 taken
204906: branch 1 taken
397 13113984: for (k = 1; k < DCTSIZE2; k++) {
12795002: branch 0 taken
114076: branch 1 taken
398 12909078: if ((temp = block[jpeg_natural_order[k]]) == 0) {
399 12795002: r++;
400 : } else {
401 : /* if run length > 15, must emit special run-length-16 codes (0xF0) */
436: branch 0 taken
114076: branch 1 taken
402 228588: while (r > 15) {
0: branch 1 not taken
436: branch 2 taken
403 436: if (! emit_bits(state, actbl->ehufco[0xF0], actbl->ehufsi[0xF0]))
404 0: return FALSE;
405 436: r -= 16;
406 : }
407 :
408 114076: temp2 = temp;
57905: branch 0 taken
56171: branch 1 taken
409 114076: if (temp < 0) {
410 57905: temp = -temp; /* temp is abs value of input */
411 : /* This code assumes we are on a two's complement machine */
412 57905: temp2--;
413 : }
414 :
415 : /* Find the number of bits needed for the magnitude of the coefficient */
416 114076: nbits = 1; /* there must be at least one 1 bit */
136991: branch 0 taken
114076: branch 1 taken
417 365143: while ((temp >>= 1))
418 136991: nbits++;
419 : /* Check for out-of-range coefficient values */
0: branch 0 not taken
114076: branch 1 taken
420 114076: if (nbits > MAX_COEF_BITS)
421 0: ERREXIT(state->cinfo, JERR_BAD_DCT_COEF);
422 :
423 : /* Emit Huffman symbol for run length / number of bits */
424 114076: i = (r << 4) + nbits;
0: branch 1 not taken
114076: branch 2 taken
425 114076: if (! emit_bits(state, actbl->ehufco[i], actbl->ehufsi[i]))
426 0: return FALSE;
427 :
428 : /* Emit that number of bits of the value, if positive, */
429 : /* or the complement of its magnitude, if negative. */
0: branch 1 not taken
114076: branch 2 taken
430 114076: if (! emit_bits(state, (unsigned int) temp2, nbits))
431 0: return FALSE;
432 :
433 114076: r = 0;
434 : }
435 : }
436 :
437 : /* If the last coef(s) were zero, emit an end-of-block code */
204437: branch 0 taken
469: branch 1 taken
438 204906: if (r > 0)
0: branch 1 not taken
204437: branch 2 taken
439 204437: if (! emit_bits(state, actbl->ehufco[0], actbl->ehufsi[0]))
440 0: return FALSE;
441 :
442 204906: return TRUE;
443 : }
444 :
445 :
446 : /*
447 : * Emit a restart marker & resynchronize predictions.
448 : */
449 :
450 : LOCAL(boolean)
451 0: emit_restart (working_state * state, int restart_num)
452 : {
453 : int ci;
454 :
0: branch 1 not taken
0: branch 2 not taken
455 0: if (! flush_bits(state))
456 0: return FALSE;
457 :
0: branch 0 not taken
0: branch 1 not taken
0: branch 3 not taken
0: branch 4 not taken
458 0: emit_byte(state, 0xFF, return FALSE);
0: branch 0 not taken
0: branch 1 not taken
0: branch 3 not taken
0: branch 4 not taken
459 0: emit_byte(state, JPEG_RST0 + restart_num, return FALSE);
460 :
461 : /* Re-initialize DC predictions to 0 */
0: branch 0 not taken
0: branch 1 not taken
462 0: for (ci = 0; ci < state->cinfo->comps_in_scan; ci++)
463 0: state->cur.last_dc_val[ci] = 0;
464 :
465 : /* The restart counter is not updated until we successfully write the MCU. */
466 :
467 0: return TRUE;
468 : }
469 :
470 :
471 : /*
472 : * Encode and output one MCU's worth of Huffman-compressed coefficients.
473 : */
474 :
475 : METHODDEF(boolean)
476 36561: encode_mcu_huff (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
477 : {
478 36561: huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
479 : working_state state;
480 : int blkn, ci;
481 : jpeg_component_info * compptr;
482 :
483 : /* Load up working state */
484 36561: state.next_output_byte = cinfo->dest->next_output_byte;
485 36561: state.free_in_buffer = cinfo->dest->free_in_buffer;
486 36561: ASSIGN_STATE(state.cur, entropy->saved);
487 36561: state.cinfo = cinfo;
488 :
489 : /* Emit restart marker if needed */
0: branch 0 not taken
36561: branch 1 taken
490 36561: if (cinfo->restart_interval) {
0: branch 0 not taken
0: branch 1 not taken
491 0: if (entropy->restarts_to_go == 0)
0: branch 1 not taken
0: branch 2 not taken
492 0: if (! emit_restart(&state, entropy->next_restart_num))
493 0: return FALSE;
494 : }
495 :
496 : /* Encode the MCU data blocks */
204906: branch 0 taken
36561: branch 1 taken
497 241467: for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
498 204906: ci = cinfo->MCU_membership[blkn];
499 204906: compptr = cinfo->cur_comp_info[ci];
0: branch 1 not taken
204906: branch 2 taken
500 614718: if (! encode_one_block(&state,
501 204906: MCU_data[blkn][0], state.cur.last_dc_val[ci],
502 204906: entropy->dc_derived_tbls[compptr->dc_tbl_no],
503 204906: entropy->ac_derived_tbls[compptr->ac_tbl_no]))
504 0: return FALSE;
505 : /* Update last_dc_val */
506 204906: state.cur.last_dc_val[ci] = MCU_data[blkn][0][0];
507 : }
508 :
509 : /* Completed MCU, so update state */
510 36561: cinfo->dest->next_output_byte = state.next_output_byte;
511 36561: cinfo->dest->free_in_buffer = state.free_in_buffer;
512 36561: ASSIGN_STATE(entropy->saved, state.cur);
513 :
514 : /* Update restart-interval state too */
0: branch 0 not taken
36561: branch 1 taken
515 36561: if (cinfo->restart_interval) {
0: branch 0 not taken
0: branch 1 not taken
516 0: if (entropy->restarts_to_go == 0) {
517 0: entropy->restarts_to_go = cinfo->restart_interval;
518 0: entropy->next_restart_num++;
519 0: entropy->next_restart_num &= 7;
520 : }
521 0: entropy->restarts_to_go--;
522 : }
523 :
524 36561: return TRUE;
525 : }
526 :
527 :
528 : /*
529 : * Finish up at the end of a Huffman-compressed scan.
530 : */
531 :
532 : METHODDEF(void)
533 2518: finish_pass_huff (j_compress_ptr cinfo)
534 : {
535 2518: huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
536 : working_state state;
537 :
538 : /* Load up working state ... flush_bits needs it */
539 2518: state.next_output_byte = cinfo->dest->next_output_byte;
540 2518: state.free_in_buffer = cinfo->dest->free_in_buffer;
541 2518: ASSIGN_STATE(state.cur, entropy->saved);
542 2518: state.cinfo = cinfo;
543 :
544 : /* Flush out the last data */
0: branch 1 not taken
2518: branch 2 taken
545 2518: if (! flush_bits(&state))
546 0: ERREXIT(cinfo, JERR_CANT_SUSPEND);
547 :
548 : /* Update state */
549 2518: cinfo->dest->next_output_byte = state.next_output_byte;
550 2518: cinfo->dest->free_in_buffer = state.free_in_buffer;
551 2518: ASSIGN_STATE(entropy->saved, state.cur);
552 2518: }
553 :
554 :
555 : /*
556 : * Huffman coding optimization.
557 : *
558 : * We first scan the supplied data and count the number of uses of each symbol
559 : * that is to be Huffman-coded. (This process MUST agree with the code above.)
560 : * Then we build a Huffman coding tree for the observed counts.
561 : * Symbols which are not needed at all for the particular image are not
562 : * assigned any code, which saves space in the DHT marker as well as in
563 : * the compressed data.
564 : */
565 :
566 : #ifdef ENTROPY_OPT_SUPPORTED
567 :
568 :
569 : /* Process a single block's worth of coefficients */
570 :
571 : LOCAL(void)
572 0: htest_one_block (j_compress_ptr cinfo, JCOEFPTR block, int last_dc_val,
573 : long dc_counts[], long ac_counts[])
574 : {
575 : register int temp;
576 : register int nbits;
577 : register int k, r;
578 :
579 : /* Encode the DC coefficient difference per section F.1.2.1 */
580 :
581 0: temp = block[0] - last_dc_val;
0: branch 0 not taken
0: branch 1 not taken
582 0: if (temp < 0)
583 0: temp = -temp;
584 :
585 : /* Find the number of bits needed for the magnitude of the coefficient */
586 0: nbits = 0;
0: branch 0 not taken
0: branch 1 not taken
587 0: while (temp) {
588 0: nbits++;
589 0: temp >>= 1;
590 : }
591 : /* Check for out-of-range coefficient values.
592 : * Since we're encoding a difference, the range limit is twice as much.
593 : */
0: branch 0 not taken
0: branch 1 not taken
594 0: if (nbits > MAX_COEF_BITS+1)
595 0: ERREXIT(cinfo, JERR_BAD_DCT_COEF);
596 :
597 : /* Count the Huffman symbol for the number of bits */
598 0: dc_counts[nbits]++;
599 :
600 : /* Encode the AC coefficients per section F.1.2.2 */
601 :
602 0: r = 0; /* r = run length of zeros */
603 :
0: branch 0 not taken
0: branch 1 not taken
604 0: for (k = 1; k < DCTSIZE2; k++) {
0: branch 0 not taken
0: branch 1 not taken
605 0: if ((temp = block[jpeg_natural_order[k]]) == 0) {
606 0: r++;
607 : } else {
608 : /* if run length > 15, must emit special run-length-16 codes (0xF0) */
0: branch 0 not taken
0: branch 1 not taken
609 0: while (r > 15) {
610 0: ac_counts[0xF0]++;
611 0: r -= 16;
612 : }
613 :
614 : /* Find the number of bits needed for the magnitude of the coefficient */
0: branch 0 not taken
0: branch 1 not taken
615 0: if (temp < 0)
616 0: temp = -temp;
617 :
618 : /* Find the number of bits needed for the magnitude of the coefficient */
619 0: nbits = 1; /* there must be at least one 1 bit */
0: branch 0 not taken
0: branch 1 not taken
620 0: while ((temp >>= 1))
621 0: nbits++;
622 : /* Check for out-of-range coefficient values */
0: branch 0 not taken
0: branch 1 not taken
623 0: if (nbits > MAX_COEF_BITS)
624 0: ERREXIT(cinfo, JERR_BAD_DCT_COEF);
625 :
626 : /* Count Huffman symbol for run length / number of bits */
627 0: ac_counts[(r << 4) + nbits]++;
628 :
629 0: r = 0;
630 : }
631 : }
632 :
633 : /* If the last coef(s) were zero, emit an end-of-block code */
0: branch 0 not taken
0: branch 1 not taken
634 0: if (r > 0)
635 0: ac_counts[0]++;
636 0: }
637 :
638 :
639 : /*
640 : * Trial-encode one MCU's worth of Huffman-compressed coefficients.
641 : * No data is actually output, so no suspension return is possible.
642 : */
643 :
644 : METHODDEF(boolean)
645 0: encode_mcu_gather (j_compress_ptr cinfo, JBLOCKROW *MCU_data)
646 : {
647 0: huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
648 : int blkn, ci;
649 : jpeg_component_info * compptr;
650 :
651 : /* Take care of restart intervals if needed */
0: branch 0 not taken
0: branch 1 not taken
652 0: if (cinfo->restart_interval) {
0: branch 0 not taken
0: branch 1 not taken
653 0: if (entropy->restarts_to_go == 0) {
654 : /* Re-initialize DC predictions to 0 */
0: branch 0 not taken
0: branch 1 not taken
655 0: for (ci = 0; ci < cinfo->comps_in_scan; ci++)
656 0: entropy->saved.last_dc_val[ci] = 0;
657 : /* Update restart state */
658 0: entropy->restarts_to_go = cinfo->restart_interval;
659 : }
660 0: entropy->restarts_to_go--;
661 : }
662 :
0: branch 0 not taken
0: branch 1 not taken
663 0: for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
664 0: ci = cinfo->MCU_membership[blkn];
665 0: compptr = cinfo->cur_comp_info[ci];
666 0: htest_one_block(cinfo, MCU_data[blkn][0], entropy->saved.last_dc_val[ci],
667 0: entropy->dc_count_ptrs[compptr->dc_tbl_no],
668 0: entropy->ac_count_ptrs[compptr->ac_tbl_no]);
669 0: entropy->saved.last_dc_val[ci] = MCU_data[blkn][0][0];
670 : }
671 :
672 0: return TRUE;
673 : }
674 :
675 :
676 : /*
677 : * Generate the best Huffman code table for the given counts, fill htbl.
678 : * Note this is also used by jcphuff.c.
679 : *
680 : * The JPEG standard requires that no symbol be assigned a codeword of all
681 : * one bits (so that padding bits added at the end of a compressed segment
682 : * can't look like a valid code). Because of the canonical ordering of
683 : * codewords, this just means that there must be an unused slot in the
684 : * longest codeword length category. Section K.2 of the JPEG spec suggests
685 : * reserving such a slot by pretending that symbol 256 is a valid symbol
686 : * with count 1. In theory that's not optimal; giving it count zero but
687 : * including it in the symbol set anyway should give a better Huffman code.
688 : * But the theoretically better code actually seems to come out worse in
689 : * practice, because it produces more all-ones bytes (which incur stuffed
690 : * zero bytes in the final file). In any case the difference is tiny.
691 : *
692 : * The JPEG standard requires Huffman codes to be no more than 16 bits long.
693 : * If some symbols have a very small but nonzero probability, the Huffman tree
694 : * must be adjusted to meet the code length restriction. We currently use
695 : * the adjustment method suggested in JPEG section K.2. This method is *not*
696 : * optimal; it may not choose the best possible limited-length code. But
697 : * typically only very-low-frequency symbols will be given less-than-optimal
698 : * lengths, so the code is almost optimal. Experimental comparisons against
699 : * an optimal limited-length-code algorithm indicate that the difference is
700 : * microscopic --- usually less than a hundredth of a percent of total size.
701 : * So the extra complexity of an optimal algorithm doesn't seem worthwhile.
702 : */
703 :
704 : GLOBAL(void)
705 0: jpeg_gen_optimal_table (j_compress_ptr cinfo, JHUFF_TBL * htbl, long freq[])
706 : {
707 : #define MAX_CLEN 32 /* assumed maximum initial code length */
708 : UINT8 bits[MAX_CLEN+1]; /* bits[k] = # of symbols with code length k */
709 : int codesize[257]; /* codesize[k] = code length of symbol k */
710 : int others[257]; /* next symbol in current branch of tree */
711 : int c1, c2;
712 : int p, i, j;
713 : long v;
714 :
715 : /* This algorithm is explained in section K.2 of the JPEG standard */
716 :
717 0: MEMZERO(bits, SIZEOF(bits));
718 0: MEMZERO(codesize, SIZEOF(codesize));
0: branch 0 not taken
0: branch 1 not taken
719 0: for (i = 0; i < 257; i++)
720 0: others[i] = -1; /* init links to empty */
721 :
722 0: freq[256] = 1; /* make sure 256 has a nonzero count */
723 : /* Including the pseudo-symbol 256 in the Huffman procedure guarantees
724 : * that no real symbol is given code-value of all ones, because 256
725 : * will be placed last in the largest codeword category.
726 : */
727 :
728 : /* Huffman's basic algorithm to assign optimal code lengths to symbols */
729 :
730 : for (;;) {
731 : /* Find the smallest nonzero frequency, set c1 = its symbol */
732 : /* In case of ties, take the larger symbol number */
733 0: c1 = -1;
734 0: v =<PHONE_NUMBER>L;
0: branch 0 not taken
0: branch 1 not taken
735 0: for (i = 0; i <= 256; i++) {
0: branch 0 not taken
0: branch 1 not taken
0: branch 2 not taken
0: branch 3 not taken
736 0: if (freq[i] && freq[i] <= v) {
737 0: v = freq[i];
738 0: c1 = i;
739 : }
740 : }
741 :
742 : /* Find the next smallest nonzero frequency, set c2 = its symbol */
743 : /* In case of ties, take the larger symbol number */
744 0: c2 = -1;
745 0: v =<PHONE_NUMBER>L;
0: branch 0 not taken
0: branch 1 not taken
746 0: for (i = 0; i <= 256; i++) {
0: branch 0 not taken
0: branch 1 not taken
0: branch 2 not taken
0: branch 3 not taken
0: branch 4 not taken
0: branch 5 not taken
747 0: if (freq[i] && freq[i] <= v && i != c1) {
748 0: v = freq[i];
749 0: c2 = i;
750 : }
751 : }
752 :
753 : /* Done if we've merged everything into one frequency */
0: branch 0 not taken
0: branch 1 not taken
754 0: if (c2 < 0)
755 0: break;
756 :
757 : /* Else merge the two counts/trees */
758 0: freq[c1] += freq[c2];
759 0: freq[c2] = 0;
760 :
761 : /* Increment the codesize of everything in c1's tree branch */
762 0: codesize[c1]++;
0: branch 0 not taken
0: branch 1 not taken
763 0: while (others[c1] >= 0) {
764 0: c1 = others[c1];
765 0: codesize[c1]++;
766 : }
767 :
768 0: others[c1] = c2; /* chain c2 onto c1's tree branch */
769 :
770 : /* Increment the codesize of everything in c2's tree branch */
771 0: codesize[c2]++;
0: branch 0 not taken
0: branch 1 not taken
772 0: while (others[c2] >= 0) {
773 0: c2 = others[c2];
774 0: codesize[c2]++;
775 : }
776 0: }
777 :
778 : /* Now count the number of symbols of each code length */
0: branch 0 not taken
0: branch 1 not taken
779 0: for (i = 0; i <= 256; i++) {
0: branch 0 not taken
0: branch 1 not taken
780 0: if (codesize[i]) {
781 : /* The JPEG standard seems to think that this can't happen, */
782 : /* but I'm paranoid... */
0: branch 0 not taken
0: branch 1 not taken
783 0: if (codesize[i] > MAX_CLEN)
784 0: ERREXIT(cinfo, JERR_HUFF_CLEN_OVERFLOW);
785 :
786 0: bits[codesize[i]]++;
787 : }
788 : }
789 :
790 : /* JPEG doesn't allow symbols with code lengths over 16 bits, so if the pure
791 : * Huffman procedure assigned any such lengths, we must adjust the coding.
792 : * Here is what the JPEG spec says about how this next bit works:
793 : * Since symbols are paired for the longest Huffman code, the symbols are
794 : * removed from this length category two at a time. The prefix for the pair
795 : * (which is one bit shorter) is allocated to one of the pair; then,
796 : * skipping the BITS entry for that prefix length, a code word from the next
797 : * shortest nonzero BITS entry is converted into a prefix for two code words
798 : * one bit longer.
799 : */
800 :
0: branch 0 not taken
0: branch 1 not taken
801 0: for (i = MAX_CLEN; i > 16; i--) {
0: branch 0 not taken
0: branch 1 not taken
802 0: while (bits[i] > 0) {
803 0: j = i - 2; /* find length of new prefix to be used */
0: branch 0 not taken
0: branch 1 not taken
804 0: while (bits[j] == 0)
805 0: j--;
806 :
807 0: bits[i] -= 2; /* remove two symbols */
808 0: bits[i-1]++; /* one goes in this length */
809 0: bits[j+1] += 2; /* two new symbols in this length */
810 0: bits[j]--; /* symbol of this length is now a prefix */
811 : }
812 : }
813 :
814 : /* Remove the count for the pseudo-symbol 256 from the largest codelength */
0: branch 0 not taken
0: branch 1 not taken
815 0: while (bits[i] == 0) /* find largest codelength still in use */
816 0: i--;
817 0: bits[i]--;
818 :
819 : /* Return final symbol counts (only for lengths 0..16) */
820 0: MEMCOPY(htbl->bits, bits, SIZEOF(htbl->bits));
821 :
822 : /* Return a list of the symbols sorted by code length */
823 : /* It's not real clear to me why we don't need to consider the codelength
824 : * changes made above, but the JPEG spec seems to think this works.
825 : */
826 0: p = 0;
0: branch 0 not taken
0: branch 1 not taken
827 0: for (i = 1; i <= MAX_CLEN; i++) {
0: branch 0 not taken
0: branch 1 not taken
828 0: for (j = 0; j <= 255; j++) {
0: branch 0 not taken
0: branch 1 not taken
829 0: if (codesize[j] == i) {
830 0: htbl->huffval[p] = (UINT8) j;
831 0: p++;
832 : }
833 : }
834 : }
835 :
836 : /* Set sent_table FALSE so updated table will be written to JPEG file. */
837 0: htbl->sent_table = FALSE;
838 0: }
839 :
840 :
841 : /*
842 : * Finish up a statistics-gathering pass and create the new Huffman tables.
843 : */
844 :
845 : METHODDEF(void)
846 0: finish_pass_gather (j_compress_ptr cinfo)
847 : {
848 0: huff_entropy_ptr entropy = (huff_entropy_ptr) cinfo->entropy;
849 : int ci, dctbl, actbl;
850 : jpeg_component_info * compptr;
851 : JHUFF_TBL **htblptr;
852 : boolean did_dc[NUM_HUFF_TBLS];
853 : boolean did_ac[NUM_HUFF_TBLS];
854 :
855 : /* It's important not to apply jpeg_gen_optimal_table more than once
856 : * per table, because it clobbers the input frequency counts!
857 : */
858 0: MEMZERO(did_dc, SIZEOF(did_dc));
859 0: MEMZERO(did_ac, SIZEOF(did_ac));
860 :
0: branch 0 not taken
0: branch 1 not taken
861 0: for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
862 0: compptr = cinfo->cur_comp_info[ci];
863 0: dctbl = compptr->dc_tbl_no;
864 0: actbl = compptr->ac_tbl_no;
0: branch 0 not taken
0: branch 1 not taken
865 0: if (! did_dc[dctbl]) {
866 0: htblptr = & cinfo->dc_huff_tbl_ptrs[dctbl];
0: branch 0 not taken
0: branch 1 not taken
867 0: if (*htblptr == NULL)
868 0: *htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo);
869 0: jpeg_gen_optimal_table(cinfo, *htblptr, entropy->dc_count_ptrs[dctbl]);
870 0: did_dc[dctbl] = TRUE;
871 : }
0: branch 0 not taken
0: branch 1 not taken
872 0: if (! did_ac[actbl]) {
873 0: htblptr = & cinfo->ac_huff_tbl_ptrs[actbl];
0: branch 0 not taken
0: branch 1 not taken
874 0: if (*htblptr == NULL)
875 0: *htblptr = jpeg_alloc_huff_table((j_common_ptr) cinfo);
876 0: jpeg_gen_optimal_table(cinfo, *htblptr, entropy->ac_count_ptrs[actbl]);
877 0: did_ac[actbl] = TRUE;
878 : }
879 : }
880 0: }
881 :
882 :
883 : #endif /* ENTROPY_OPT_SUPPORTED */
884 :
885 :
886 : /*
887 : * Module initialization routine for Huffman entropy encoding.
888 : */
889 :
890 : GLOBAL(void)
891 4479: jinit_huff_encoder (j_compress_ptr cinfo)
892 : {
893 : huff_entropy_ptr entropy;
894 : int i;
895 :
896 4479: entropy = (huff_entropy_ptr)
897 4479: (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
898 : SIZEOF(huff_entropy_encoder));
899 4479: cinfo->entropy = (struct jpeg_entropy_encoder *) entropy;
900 4479: entropy->pub.start_pass = start_pass_huff;
901 :
902 : /* Mark tables unallocated */
17916: branch 0 taken
4479: branch 1 taken
903 22395: for (i = 0; i < NUM_HUFF_TBLS; i++) {
904 17916: entropy->dc_derived_tbls[i] = entropy->ac_derived_tbls[i] = NULL;
905 : #ifdef ENTROPY_OPT_SUPPORTED
906 17916: entropy->dc_count_ptrs[i] = entropy->ac_count_ptrs[i] = NULL;
907 : #endif
908 : }
909 4479: }
Generated: 2016-04-07 18:20 by zcov


Instruction:
1. Just use Left/Right to ride the car.
2. You need avoid the rain.
Loading ... {{loadProgressInPercent}} %
Pause
- Just use Left/Right to ride the car.
- You need avoid the rain.
Menu
Resume
Level Complete
Got scores: {{score}}
To store scores you need be login to game by Facebook account
Menu
Map
Next
Life: {{life}}
Score: {{score}}


{% extends "guide.html" %} {% block guide_content %}
The best way to get to know Chicago Boss is to spend an evening together. That's why we've written a brand-new guide that encourages you to do just that:
We have lots of ideas for second dates and will post them here soon.
{% endblock %}