This is my website. There are many like it, but this one is mine.
It would not have been possible without Wikipedia the Omniscient.
The data itself is available here: data/deaths.json
The buttons allow one to filter the data. To see the whole list, press "Reset".
P.S. I actually have no idea why the tables have disappeared, it happened by accident after a minor "push". I still think it's nice, even though it makes reading a bit harder.
| Birth | Name | Profession | Death |
|---|
Total unique visitors: 123456


--- layout: default title: Home ---
How could increased adoption of open data standards help cities? This project explored several cases to try to understand and demonstrate the value — beyond common examples like GTFS. Read more in our explanatory blog post [add link].
Created by Andrew Yaspan, a 2017 Open Cities Fellow at the Sunlight Foundation.
Mapping points from datasets containing the same type of information from multiple cities within a region.
Creating a map and some basic graph visualizations for any dataset following a particular data standard to discover trends particular to that city.
Designing a visualization made for the express purpose of viewing the data of cities in a context that provides insight on trends based on similarities or differences between the cities.


Why is JavaScript so popular in web development?
Date: March 19, 2014
A symptom of JavaScript's popularity is its widespread compatibility. Every modern browser and virtually every device from computer, smartphone to tablet can run JavaScript. But why is it so popular?
Javascript started out as the language for Netscape Navigator, which was a major browser back in the day. It was a tool that enabled websites to be more interactive, with popup windows and more.
In today's world, JavaScript doesn't require access to a database or compiler in order to work, which makes its easy to implement on a website. This means you can just put the JavaScript on your page and it'll work, just like that. Without the need to set up anything extra to interpret the code.
JavaScript also eases server load. In terms of webpages, interaction used to be based on sending the server requests and relaying information between the browser and the server. With JavaScript, once the page loads, then many of the interactive features can be handled by the browser instead of having to do further back and forth.
Macromedia Flash also uses JavaScript in it's animation technology, and various other technologies have also incorporated JavaScript.
Another thing that makes Javascript popular are Javascript libraries, such as jQuery. JavaScript can be very time consuming to code.  Instead of having to start from scratch and code something complicated, you can use a JavaScript library if it matches your needs. Another important point is that using a JavaScript library may eliminate the frustration of coding with different browsers in mind, because that is already included!
In terms of JavaScript Libraries, jQuery is popular for web development because it combines the interactivity of JavaScript in a library that is easy to use, and it also uses the same selectors as in CSS. This makes it easy to incorporate into web development.
In terms of 'how', it's hard to track the process of how JavaScript became so popular. But in terms of 'why,' in today's world JavaScript is widely supported, easy to implement and is a cornerstone for making dynamic web applications.


Comet parameter: fragment_bin_offset
- This parameter controls how each fragment bin of size fragment_bin_tol
is defined in terms of where each bin starts.
- For example, assume a fragment_bin_tol of 1.0. Most intuitively,
the fragment bins would be 0.0 to 1.0, 1.0 to 2.0, 2.0 to 3.0, etc.
This set of bins corresponds to a fragment_bin_offset of 0.0. However,
consider if we set fragment_bin_offset to 0.5; this would cause the
bins to be 0.5 to 1.5, 1.5 to 2.5, 2.5 to 3.5, etc.
- So this fragment_bin_offset gives one a mechanism to define
where each bin starts and is centered.
- For ion trap data with a fragment_bin_tol of 1.0005,
it is recommended to set fragment_bin_offset to 0.4.
- For high-res MS/MS data, one might use a fragment_bin_tol of 0.02
and a corresponding fragment_bin_offset of 0.0.
- Allowed values are between 0.0 and 1.0. The actual offset value is
scaled by the fragment_bin_tol value.
- I know this is esoteric and any normal user should not give this
parameter any thought beyond using the recommended settings.
- The default value is "0.4" if this parameter is missing.
Example:
fragment_bin_offset = 0.4
fragment_bin_offset = 0.0


prjct
All projects, with their next action items:
2015-08-30 submit medical expenses through +8285527 Canada Inc
2015-08-08 . +Amy's_Irish_Passport @someday h:1 +travel
—
2016-04-12 download +APEGA_Mentoring event materials url:https://unroll.me/a/rollup/2016-04-12/email/4466322307
2014-02-27 write dogecoin/bitcoin arbitrage script +Biz_Ideas +Bitcoin_Arbitage
2014-02-27 write dogecoin/bitcoin arbitrage script +Biz_Ideas +Bitcoin_Arbitage
(E) 2014-07-02 redesign +blog to match Minchin.ca redesign
(C) 2015-11-28 email WISE about school fundraiser +Burst_Energy
2016-04-18 convert multi-page TIFFs to PDFs +Burst_Energy_Accounting
2016-04-18 create affiliate for Sierra's campaign +Burst_Energy_Advertising
(W) 2016-02-22 convert quote sheet to Excel +Burst_Energy_Assistant
2016-04-12 Blog about Alberta Electrcity prices +Burst_Energy_Blog url:http://www.theglobeandmail.com/opinion/albertas-electricity-debate-needs-a-surge-of-reality/article29577604/
2016-04-18 figure out employee buy-in plan +Burst_Energy_Employees
2016-04-23 check that the bad debt is showing on someone's statement due:2016-04-30 +Burst_Energy_Payroll
(C) 2016-04-18 call Randy James +Burst_Energy_Sales
2016-04-13 review how to generate more website traffic +Burst_Energy_Website url:http://vocus.io/link?id=6de2a025-e36c-4b8a-b104-35e3aae12f16
2016-04-18 switch van to summer tires +car
—
—
2015-07-26 allow conversion of colors to YIQ, HSL, and HSV via colorsys +colourettu +Python
2016-03-25 download DayOne 2 for free +computer +Love_Me url:http://www.imore.com/get-journaling-app-day-one-2-free-through-apple-store-app-until-may-1 due:2016-5-1
2015-12-25 +download 'The Other Wiseman' (church short)
2015-08-08 . +Education h:1
—
2015-12-22 catch up with Courtney Beamish https://ca.linkedin.com/in/court-beamish-739186bb +Job_Search +Engineering
—
(C) 2016-03-09 install AC router in front room +house +Ethernet
2016-02-11 set up call with Lorie +ETP
2015-08-08 . +Friends h:1
(D) 2016-04-18 send details of McCover line back to Margaret +genealogy
2015-08-08 . +gigabit_internet @someday h:1
2014-01-06 install Git server on my +server +git http://www.jeremyskinner.co.uk/2010/07/31/hosting-a-git-server-under-apache-on-windows/
—
(E) 2013-12-07 use cleaned version of 2012-04 & 2012-05 +GPX_processor
2015-08-08 . +GTD h:1
2015-08-08 . +Hair_Station_Website h:1
2015-04-26 write blog post of costs +heater
2016-02-05 add calls to entries for Leadership Specialist calls +jrnl +Higher_Laws
2016-04-18 write +Python code for travel heatmap camera +Love_Marcy +Home_Automation
(C) 2013-12-06 add +house numbers on garage
2013-12-22 check PlacePro for Jobs +Job_Search
2016-02-05 add calls to entries for Leadership Specialist calls +jrnl +Higher_Laws
2016-04-05 report +Kodi colour problems url:http://forum.kodi.tv/showthread.php?tid=261105
2016-04-05 report +Kodi colour problems url:http://forum.kodi.tv/showthread.php?tid=261105
2015-08-08 . +Learn_to_Sail @someday h:1
(W) 2013-12-12 lent two baby books to Heather and +Love_Alex
2015-08-08 . +Love_Amy h:1
2015-08-08 . +Love_Campbell h:1
2015-08-08 . +Love_Dad h:1
2016-03-24 send Dad 3 more photos of our family +Love_Grandma_Minchin
2015-08-08 . +Love_Greg h:1
2015-08-08 . +Love_In-laws h:1
2015-03-09 install kitchen LED lights +house +Love_Marcy
2016-03-25 got to the Temple +Love_Me due:2016-04-25 rec:1m
2015-08-08 . +Love_Mom h:1
2015-08-08 . +Love_Sarah h:1
(D) 2015-08-24 test +MetaLibrary documentation generation in Sphinx +Minchin.ca
(D) 2015-08-24 test +MetaLibrary documentation generation in Sphinx +Minchin.ca
(E) yard switches +Model_RR
(C) 2015-11-28 budget -- new hard drive to me +money
2015-08-08 . +Move_to_Normandie @someday h:1
—
—
2015-08-08 . +WmDOT +OpenTTD @someday h:1
(N) draw sewage treatment plant +OpenTTD_House_Set
2015-08-08 . +paxton h:1
2014-10-05 pelican-autostatic to pelican-plugins +Python +pelican https://github.com/AlexJF/pelican-autostatic
—
(W) 2014-08-31 get check from Naomi for 4 accounts +Vivint +People_that_Own_Me_Money
2014-02-24 list projects without todo items +prjct
(N) 2013-12-07 update +Progressive_Rail_Set as per +Progressive_Trainset
(E) 2013-11-30 consolidate to single stream +Progressive_Trainset @computer
2014-01-06 write a script to test for available three letter domains .com .ca .ie .eu +Python
(C) 2016-04-18 write basic story line for +Python_Pelican_Presentation
(N) 2013-12-19 read 'The Personal MBA' +reading_list
2015-08-08 . +Real_Estate_Can h:1
2015-08-08 . +Real_Estate_Edm h:1
2016-04-25 file IRS form 966 within 30 days +Real_Estate_FL due:2016-05-25
2015-08-08 . +Real_Estate_IL h:1
2015-08-08 . +Real_Estate_Steve_Martel h:1
2015-08-08 . +Real_Estate_UT h:1
—
2013-12-12 add to +RSS_Reader http://mike.tig.as/blog/
2015-08-08 . +Ruby h:1
—
2014-01-06 install Git server on my +server +git http://www.jeremyskinner.co.uk/2010/07/31/hosting-a-git-server-under-apache-on-windows/
(N) 2013-12-07 create +Steamship_AI - split off water parts of +WmDOT
2015-07-14 write 'The Drums of War' +story
(N) 2013-12-07 split off streetcar parts of +WmDOT +Streetcar_AI
2014-06-20 add to lease that the tenant is responsible for court costs if I have to apply to evict them +suite
2015-08-08 . +taxes h:1
—
2013-11-24 add philosophy section (to remind me how to best use this) +todo-cli @computer
(D) 2016-04-18 add filter to hide 'h' tagged items +topydo
2015-07-26 paint frame +trailer
2015-08-08 . +Amy's_Irish_Passport @someday h:1 +travel
2013-12-12 . +Turkey_space_story h:1
(E) 2013-12-12 +Vancouver_story chapter 4
(W) 2014-08-31 get check from Naomi for 4 accounts +Vivint +People_that_Own_Me_Money
2014-01-18 SMS/VoIP provider? - https://www.nexmo.com +VoIP
2015-08-08 . +VOIP_reseller @someday h:1
2015-08-08 . +WindMeridian h:1
(D) 2014-11-05 get +WindMeridian.com back up and running
(N) 2013-12-07 create +Steamship_AI - split off water parts of +WmDOT
2015-08-08 . +workspace h:1
2015-08-08 . +write_will h:1
2015-08-08 . +XBMC h:1


Classes vs. Modules
Posted October 2, 2014
This week I've started learning about Object Oriented Design. This is a complex topic, and I'm just starting to scratch the surface. I hope to be able to share a little of what I've learned here by explaining the difference between classes and modules in Ruby.
First I'm going to talk about what modules and classes are used for. They are both used to store groups of methods. Here's an example of a module.
module Me def Me.name puts "My name is Bill" end LASTNAME = "My last name is Gallagher" end Me.name "My name is Bill" puts Me::LASTNAME "My last name is Gallagher "
Here's how you could do something similar with a class:
class Me attr_reader :last_name def initialize @last_name = "My last name is Gallagher" end def name puts "My name is Bill" end end bill = Me.new bill.name "My name is Bill" p bill.last_name "My last name is Gallagher"
So how are the two of these different? Well to start, I'm going to borrow a table from fullstackwebdev.com. This table lays out the differences between modules and classes. I know it uses a lot of ugly scary words, but we're going to focus on a few of the important elements and break them down.
Probably the most important difference is at the very top of the table. Classes can be instantiated, and modules cannot. You're probably scratching your head right now and asking "but what does that mean?" Its not as scary as it sounds. All it means is that classes can be used to create unique objects, and modules cannot. So above, when I made bill = Me.new, I was creating a new object called bill, that was of the Me class. I can then make another object like this: steve = Me.new, and we now have two seperate objects with similar properties.(Right now it will stay Steve's name is Bill, but you get the idea).
Next we're going to jump down a bit on the table to inclusion. You can see that classes cannot be included, while modules can by using the include command. Lets take a look at this in some code:
module TestModule def display puts "This is from the module" end end class TestClass include TestModule end sample = TestClass.new sample.display "This is from the module"
Here you can see that we didn't actually define any methods in our class, but we included our module, and so its methods could be called on our object. If we replace TestModule with a class, then we would get an error.
I know theres a lot more on that table, but I hit some of the more important bits. If you remember that classes are used to create objects and modules are not, and that you can include a module in a class but not vice versa, you're off to a good start. Now go forth and code!


magneticalc.Metric_Presets.Metric_Presets
class documentationmagneticalc.Metric_Presets
(View In Hierarchy)
Metric_Presets class.
| Class Variable | Magnitude | Undocumented |
| Class Variable | MagnitudeXY | Undocumented |
| Class Variable | MagnitudeX | Undocumented |
| Class Variable | MagnitudeY | Undocumented |
| Class Variable | MagnitudeZ | Undocumented |
| Class Variable | MagnitudeXZ | Undocumented |
| Class Variable | MagnitudeYZ | Undocumented |
| Class Variable | Divergence | Undocumented |
| Class Variable | NegDivergence | Undocumented |
| Class Variable | PosDivergence | Undocumented |
| Class Variable | LogMagnitude | Undocumented |
| Class Variable | LogMagnitudeX | Undocumented |
| Class Variable | LogMagnitudeY | Undocumented |
| Class Variable | LogMagnitudeZ | Undocumented |
| Class Variable | LogMagnitudeXY | Undocumented |
| Class Variable | LogMagnitudeXZ | Undocumented |
| Class Variable | LogMagnitudeYZ | Undocumented |
| Class Variable | LogDivergence | Undocumented |
| Class Variable | PosLogDivergence | Undocumented |
| Class Variable | NegLogDivergence | Undocumented |
| Class Variable | AngleXY | Undocumented |
| Class Variable | AngleXZ | Undocumented |
| Class Variable | AngleYZ | Undocumented |
| Class Variable | List | Undocumented |
| Static Method | get_by_id | Selects a preset by name. |


Sales Information
Sales Data by Location
Add a Store
Location:
Minimum Customers per Hour:
Maximum Customers per Hour:
Average Customers per Hour:
Add Store


Handling AJAX Calls With Node.js and Express (part 5)
Articles in the series:
- Part 1: Scraping Craigslist
- Part 2: Adding Handlebars
- Part 3: User Authentication with Passport and MongoDB
- Part 4: Refactoring, Adding styles
- Part 5: Saving Jobs « CURRENT
Last time we refactored our code to make it more modular as well as added some styles. This time we’ll add our next feature: The ability to save jobs so that users can apply to them later.
Contents
- User Workflow
- Add a save button
- Client Side Javascript
- Server Side Javascript
- Update Mongo
- Client Side Javascript Redux
User Workflow
From an end user’s perspective, after logging in and then searching for jobs, one can simply click a button next to each job to save the job to a new Mongo collection. That job is then removed from the list of jobs retrieved from the search. Let’s start with that.
What do we need to do?
- Add a “save” button next to each job.
- Develop the necessary code to “grab” the job when the button is clicked, sending it to the server side.
- Create a new collection in the database.
- Insert the data in the newly created Mongo collection.
- Use jQuery to remove the job from the DOM and alert the user that job has been added.
Let’s get started.
Add a save button
Start by adding the “save” button to the Handlebars template:

Moving right along …
Client Side Javascript
Next, let’s add an event handler to main.js that captures the button when clicked:
$('.save-btn').on('click', function() {
console.log("whee!")
});
Your file should now look like this:
$(function(){
var source = $("#search-results").html();
var dataTemplate = Handlebars.compile(source);
$results = $('#results')
$('#search').on('keyup', function(e){
if(e.keyCode === 13) {
var parameters = { search: $(this).val() };
$.get('/searching', parameters, function(data){
if (data instanceof Array) {
$results.html(dataTemplate({resultsArray:data}));
} else {
$results.html(data);
};
});
};
});
$('.save-btn').on('click', function() {
console.log("whee!")
});
});
Do a quick sanity check. Fire up the server. Login. Search for some jobs. You should see the “save” button next to each job. Open up your Javascript console so you can see the console log when it fires. Now try to click a button.
Nothing. Right? What’s going on? We have the right selector. The event is a click. It should be working.
The problem is fairly simple: On the initial loading of the DOM, those selectors - .save-btn
- are not present. In fact, they only become present after we append all the jobs to the DOM. Since the selectors are not present to begin with though, our event handler in its current state won’t find them. Fortunately, this is an easy fix.
We can simply attach a listener to a parent element, then once the event is fired, it will search for the child selector, .save-btn
. It will obviously only find that selector once it exists in the DOM.
This is called event delegation. If interested, check this article out for more info.
Update the code:
$('#results').on('click', '.save-btn', function() {
console.log("whee!")
});
So, the listener is set to the #results
selector, which when fired (by the button click), searches the DOM for the child selector, .save-btn
. Test it out. It should work.
Next, instead of just outputting the text “whee!”, we need to grab the job title and URL by replacing the current console log with:
var jobTitle = $(this).next('a').text()
var jobURL = $(this).next('a').attr('href')
console.log(jobTitle, jobURL)
Notice the this
keyword? It’s extremely powerful yet it can be difficult to use. In this case, it refers to the DOM element that the event handler is triggered on.
Don’t believe me? Test it out: update the console.log()
to console.log($(this))
. Test it out.
To learn more about this
, check out What is this? and the Javascript docs.
Now what happens when you click the save button?
Finally, we need to pass the data to the server.
var parameters = { title: jobTitle, url: jobURL };
console.log(parameters)
$.get( '/save', parameters, function(data) {
console.log("whee!")
});
You should remember how to do this, and understand what’s happening here. If not, review Part 1 of this series.
Server Side Javascript
On the server side, we need to setup a /save
route. Again, if you have questions on this, check out Part 1.
Update app.js
:
app.get('/save', ensureAuthenticated, routes.save)
Now update the routes file, index.js
:
exports.save = function(req, res){
var title = req.query.title;
var url = req.query.url;
console.log(title, url);
};
Test this out. You should see:
Update Mongo
Now that we have the data in our possession, let’s add it to the database.
Add a new schema
Create a new file in the “models” directory called job.js, then add the following code to the file:
var mongoose = require('mongoose');
var config = require('../config');
console.log(config);
// create a job model
var userSchema = new mongoose.Schema({
title: String,
url: String,
});
module.exports = mongoose.model('Job', jobSchema);
Insert Data
With the schema set up, we can now add our data to the Mongo collection. Within your routes, add the following code to the /save
route:
exports.save = function(req, res){
var title = req.query.title;
var url = req.query.url;
console.log(title, url);
var newJob = new job();
newJob.title = title;
newJob.url = url;
console.log(newJob);
newJob.save(function(err){
if(err){
throw err;
}
console.log("New job, " + newJob.title + ", was added to mongo");
});
};
Here, we are simply creating a new record assigned to the variable newJob
, then adding the appropriate data, and finally saving the job to our job collection within Mongo.
Make sure to require the config and Mongoose schema files:
var config = require('../config');
var job = require('../models/job');
Test it out!
Now check out the results in Mongo:
Before moving on, let’s add a line of code to search the Mongo collection to see if a job exists, then within a conditional we can setup logic for only adding a job if it doesn’t already exist in the collection:
exports.save = function(req, res){
var title = req.query.title;
var url = req.query.url;
console.log(title, url);
var newJob = new job();
job.findOne({'title': title}, function (err, job) {
if (job) {
console.log('Job already in database.');
} else {
newJob.title = title;
newJob.url = url;
console.log(newJob);
newJob.save(function(err){
if(err){
throw err;
}
console.log("New job, " + newJob.title + ", was added to mongo");
});
};
});
};
So, we search the database for the job - job.findOne({'title': title}
- then if it’s found we output a message to the console - console.log('Job already in database.');
. And if it’s not found, we obviously add the data to the database. We should alert the user if a job is already in the database in a more direct way than just a message to the console.  We’ll address that in a bit. Right now, let’s finish with Mongo first.
One to Many Relationship
We need set up a one to many relationship (one user, many jobs) using document references within Mongo to associate a job to a user. This takes literally two lines of code.
Update the jobs schema:
var user = require('../models/user');
var jobSchema = new mongoose.Schema({
title: String,
url: String,
user: {type: mongoose.Schema.Types.ObjectId, ref: user}
});
Then updated index.js so that when you add a job it includes the currently logged in user:
newJob.title = title;
newJob.url = url;
newJob.user = req.user._id
console.log(newJob);
newJob.save(function(err){
if(err){
throw err;
}
Test this out, then check out the object in Mongo:
{ "user" : ObjectId("534cb94fd4b72d7618000001"), "url" : "http://sfbay.craigslist.org/sfc/eng/4423216760.html", "title" : "Principal Web Engineer", "_id" : ObjectId("5351f3a1cc6813119e000001"), "__v" : 0 }
The object now includes the user id.
Client Side Javascript Redux
Okay. Back on the client side, we need to do three things before we’re finally done:
- Remove the job the user saved
- Display messages from the server side, indicating whether the job was added to the database or not
- Display all saved jobs to the user
Remove job from the DOM
Add the following line of code to main.js right before we send the data to the server side:
$(this).parent().remove()
Updated code:
$('#results').on('click', '.save-btn', function() {
var jobTitle = $(this).next('a').text()
var jobURL = $(this).next('a').attr('href')
var parameters = { title: jobTitle, url: jobURL };
console.log(parameters)
$(this).parent().remove()
$.get( '/save', parameters, function(data) {
console.log('test',data)
});
});
Display Messages
First, within index.js update the following two lines of code.
From:
console.log('Job already in database.');
console.log("New job, " + newJob.title + ", was added to mongo");
To:
res.send('Job already in database.');
res.send("New job, " + newJob.title + ", was added to mongo");
Updated function:
exports.save = function(req, res){
var title = req.query.title;
var url = req.query.url;
console.log(title, url);
var newJob = new job();
job.findOne({'title': title}, function (err, job) {
if (job) {
res.send('Job already in database.');
} else {
newJob.title = title;
newJob.url = url;
console.log(newJob);
newJob.save(function(err){
if(err){
throw err;
}
res.send("New job, " + newJob.title + ", was added to mongo");
});
};
});
};
The res.send()
method is used to send a response back to the client side. You can read more here. Now, we need to capture that response and append the actual message to the DOM.
First, add a new element, p#alert
, to search.jade where you want the message to go:
extends layout
block content
h1 Search SF Jobs
.lead Welcome, #{user}
form(METHOD="LINK", ACTION="logout")
input(type="submit", value="Logout", class='btn btn-sm btn-primary')
br
br
p#alert
input#search(type="search", placeholder="search...")
br
br
ul#results
include template.html
script(src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.0.3/jquery.min.js")
script(src="//cdnjs.cloudflare.com/ajax/libs/handlebars.js/1.0.0/handlebars.min.js")
script(src="/javascripts/main.js")
Next update main.js:
$.get( '/save', parameters, function(data) {
$('#alert').html(data)
console.log(data)
});
$('#alert').html(data)
adds the message to the DOM between the

tags that have the id “results”.
Check it out live.
Display saved jobs
This is actually a fairly large task, so we’ll tackle this in the next part, along with re-organizing the entire search page and adding some more styles.
You can grab the code here.
See you next time!


FlexJS is a new summit track that shows where FlexJS is today and lays out the future for the FlexJS project. It is aimed at existing Apache Flex and new Apache FlexJS developers, designers, and users. Hosted along side the ApacheCon event, participants have a wonderful opportunity to discover new projects and exchange ideas.
Miami is a wonderful travel destination with something for everyone. Consider extending your stay a day or two to enjoy the beach and sun.
The summit is being hosted at ApacheCon, so attendees will be registering to attend ApacheCon.
The earlier you register, the more you save, so get your tickets early.
The latest Apache FlexJS features
Hear from users and contributors


These Website Standard Terms and Conditions written on this webpage shall manage your use of our website, https://recordlist.github.io accessible at https://recordlist.github.io.
These Terms will be applied fully and affect to your use of this Website. By using this Website, you agreed to accept all terms and conditions written in here. You must not use this Website if you disagree with any of these Website Standard Terms and Conditions.
Minors or people below 18 years old are not allowed to use this Website.
Please note that used records at this website are sold "as is," and due to the nature of the product, might contain scratches or defects that may affect playback. We have graded all second-hand records to the best of our abilities according the Goldmine Grading Standard, however, we cannot guarantee complete accuracy and uninterrupted playback.
All rates are in euros, including VAT.
Absolutely perfect in every way. Certainly never been played, possibly even still sealed. Should be used sparingly as a grade, if at all.
A nearly perfect record. A NM- record has more than likely never been played, and the vinyl will play perfectly, with no imperfections during playback.  The record should show no obvious signs of wear. A 45 RPM or EP sleeve should have no more than the most minor defects, such as any sign of slight handling. An LP cover should have no creases, folds, seam splits, cut-out holes, or other noticeable similar defects. The same should be true of any other inserts, such as posters, lyric sleeves, etc.
Generally worth 50% of the Near Mint value. A Very Good Plus record will show some signs that it was played and otherwise handled by a previous owner who took good care of it. Defects should be more of a cosmetic nature, not affecting the actual playback as a whole. Record surfaces may show some signs of wear and may have slight scuffs or very light scratches that don't affect one's listening experiences. Slight warps that do not affect the sound are "OK". The label may have some ring wear or discoloration, but it should be barely noticeable. Spindle marks may be present. Picture sleeves and inner sleeves will have some slight wear, slightly turned-up corners, or a slight seam split. An LP cover may have slight signs of wear, and may be marred by a cut-out hole, indentation, or cut corner. In general, if not for a couple of minor things wrong with it, this would be Near Mint.
Generally worth 25% of Near Mint value. Many of the defects found in a VG+ record will be more pronounced in a VG disc. Surface noise will be evident upon playing, especially in soft passages and during a song's intro and fade, but will not overpower the music otherwise. Groove wear will start to be noticeable, as with light scratches (deep enough to feel with a fingernail) that will affect the sound. Labels may be marred by writing, or have tape or stickers (or their residue) attached. The same will be true of picture sleeves or LP covers. However, it will not have all of these problems at the same time. Goldmine price guides with more than one price will list Very Good as the lowest price.
Generally worth 10-15% of the Near Mint value. A record in Good or Good Plus condition can be played through without skipping. But it will have significant surface noise, scratches, and visible groove wear. A cover or sleeve will have seam splits, especially at the bottom or on the spine. Tape, writing, ring wear, or other defects will be present. While the record will be playable without skipping, noticeable surface noise and "ticks" will almost certainly accompany the playback.
Generally worth 0-5% of the Near Mint price. The record is cracked, badly warped, and won't play through without skipping or repeating. The picture sleeve is water damaged, split on all three seams and heavily marred by wear and writing. The LP cover barely keeps the LP inside it. Inner sleeves are fully split, crinkled, and written upon.
Other than the content you own, under these Terms, https://recordlist.github.io and/or its licensors own all the intellectual property rights and materials contained in this Website.
You are granted limited license only for purposes of viewing the material contained on this Website.
You are specifically restricted from all of the following:
Certain areas of this Website are restricted from being access by you and https://recordlist.github.io may further restrict access by you to any areas of this Website, at any time, in absolute discretion. Any user ID and password you may have for this Website are confidential and you must maintain confidentiality as well.
In these Website Standard Terms and Conditions, "Your Content" shall mean any audio, video text, images or other material you choose to display on this Website.
Your Content must be your own and must not be invading any third-party’s rights. https://recordlist.github.io reserves the right to remove any of Your Content from this Website at any time without notice.
Please read Privacy Policy.
This Website is provided "as is," with all faults, and https://recordlist.github.io express no representations or warranties, of any kind related to this Website or the materials contained on this Website. Also, nothing contained on this Website shall be interpreted as advising you.
In no event shall https://recordlist.github.io, nor any of its officers, directors and employees, shall be held liable for anything arising out of or in any way connected with your use of this Website whether such liability is under contract. https://recordlist.github.io, including its officers, directors and employees shall not be held liable for any indirect, consequential or special liability arising out of or in any way related to your use of this Website.
You hereby indemnify to the fullest extent https://recordlist.github.io from and against any and/or all liabilities, costs, demands, causes of action, damages and expenses arising in any way related to your breach of any of the provisions of these Terms.
If any provision of these Terms is found to be invalid under any applicable law, such provisions shall be deleted without affecting the remaining provisions herein.
https://recordlist.github.io is permitted to revise these Terms at any time as it sees fit, and by using this Website you are expected to review these Terms on a regular basis.
The https://recordlist.github.io is allowed to assign, transfer, and subcontract its rights and/or obligations under these Terms without any notification. However, you are not allowed to assign, transfer, or subcontract any of your rights and/or obligations under these Terms.
These Terms constitute the entire agreement between https://recordlist.github.io and you in relation to your use of this Website, and supersede all prior agreements and understandings.
These Terms will be governed by and interpreted in accordance with the laws of the State of de, and you submit to the non-exclusive jurisdiction of the state and federal courts located in de for the resolution of any disputes.


Throbber in Javascript
Your browser does not support the HTML5 canvas tag.
Line count
Line width
Line height
Line offset
Speed
Clockwise
Color


Table of Contents
Questions & Feedback
Found a typo or an error?
Want to improve this document? Edit it.
Need support or have a technical question?
Post to the user mailing-list.
Master Symfony2 fundamentals
Symfony hosting done right
Discover the SensioLabs Support
Creating Pages in Symfony2
Creating Pages in Symfony2¶
Creating a new page in Symfony2 is a simple two-step process:
- Create a route: A route defines the URL (e.g.
/about
) to your page and specifies a controller (which is a PHP function) that Symfony2 should execute when the URL of an incoming request matches the route pattern; - Create a controller: A controller is a PHP function that takes the incoming
request and transforms it into the Symfony2
Response
object that's returned to the user.
This simple approach is beautiful because it matches the way that the Web works. Every interaction on the Web is initiated by an HTTP request. The job of your application is simply to interpret the request and return the appropriate HTTP response.
Symfony2 follows this philosophy and provides you with tools and conventions to keep your application organized as it grows in users and complexity.
The "Hello Symfony!" Page¶
Start by building a spin-off of the classic "Hello World!" application. When you're finished, the user will be able to get a personal greeting (e.g. "Hello Symfony") by going to the following URL:
1 | http://localhost/app_dev.php/hello/Symfony
|
Actually, you'll be able to replace Symfony
with any other name to be
greeted. To create the page, follow the simple two-step process.
Note
The tutorial assumes that you've already downloaded Symfony2 and configured
your webserver. The above URL assumes that localhost
points to the
web
directory of your new Symfony2 project. For detailed information
on this process, see the documentation on the web server you are using.
Here's the relevant documentation page for some web server you might be using:
- For Apache HTTP Server, refer to Apache's DirectoryIndex documentation
- For Nginx, refer to Nginx HttpCoreModule location documentation
Before you begin: Create the Bundle¶
Before you begin, you'll need to create a bundle. In Symfony2, a bundle is like a plugin, except that all of the code in your application will live inside a bundle.
A bundle is nothing more than a directory that houses everything related to a specific feature, including PHP classes, configuration, and even stylesheets and Javascript files (see The Bundle System).
To create a bundle called AcmeHelloBundle
(a play bundle that you'll
build in this chapter), run the following command and follow the on-screen
instructions (use all of the default options):
1 | $ php app/console generate:bundle --namespace=Acme/HelloBundle --format=yml
|
Behind the scenes, a directory is created for the bundle at src/Acme/HelloBundle
.
A line is also automatically added to the app/AppKernel.php
file so that
the bundle is registered with the kernel:
1 2 3 4 5 6 7 8 9 10 11 | // app/AppKernel.php
public function registerBundles()
{
$bundles = array(
...,
new Acme\HelloBundle\AcmeHelloBundle(),
);
// ...
return $bundles;
}
|
Now that you have a bundle setup, you can begin building your application inside the bundle.
Step 1: Create the Route¶
By default, the routing configuration file in a Symfony2 application is
located at app/config/routing.yml
. Like all configuration in Symfony2,
you can also choose to use XML or PHP out of the box to configure routes.
If you look at the main routing file, you'll see that Symfony already added
an entry when you generated the AcmeHelloBundle
:
- YAML
1 2 3 4
# app/config/routing.yml acme_hello: resource<EMAIL_ADDRESS>prefix: /
- XML
1 2 3 4 5 6 7 8 9
 <?xml version="1.0" encoding="UTF-8" ?> <routes xmlns="http://symfony.com/schema/routing" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symfony.com/schema/routing http://symfony.com/schema/routing/routing-1.0.xsd"> <import<EMAIL_ADDRESS>prefix="/" /> </routes>
- PHP
1 2 3 4 5 6 7 8 9 10 11
// app/config/routing.php use Symfony\Component\Routing\RouteCollection; use Symfony\Component\Routing\Route; $collection = new RouteCollection(); $collection->addCollection( $loader->import('@AcmeHelloBundle/Resources/config/routing.php'), '/', ); return $collection;
This entry is pretty basic: it tells Symfony to load routing configuration
from the Resources/config/routing.yml
file that lives inside the AcmeHelloBundle
.
This means that you place routing configuration directly in app/config/routing.yml
or organize your routes throughout your application, and import them from here.
Now that the routing.yml
file from the bundle is being imported, add
the new route that defines the URL of the page that you're about to create:
- YAML
1 2 3 4
# src/Acme/HelloBundle/Resources/config/routing.yml hello: pattern: /hello/{name} defaults: { _controller: AcmeHelloBundle:Hello:index }
- XML
1 2 3 4 5 6 7 8 9 10 11
 <?xml version="1.0" encoding="UTF-8" ?> <routes xmlns="http://symfony.com/schema/routing" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symfony.com/schema/routing http://symfony.com/schema/routing/routing-1.0.xsd"> <route id="hello" pattern="/hello/{name}"> <default key="_controller">AcmeHelloBundle:Hello:index</default> </route> </routes>
- PHP
1 2 3 4 5 6 7 8 9 10
// src/Acme/HelloBundle/Resources/config/routing.php use Symfony\Component\Routing\RouteCollection; use Symfony\Component\Routing\Route; $collection = new RouteCollection(); $collection->add('hello', new Route('/hello/{name}', array( '_controller' => 'AcmeHelloBundle:Hello:index', ))); return $collection;
The routing consists of two basic pieces: the pattern
, which is the URL
that this route will match, and a defaults
array, which specifies the
controller that should be executed. The placeholder syntax in the pattern
({name}
) is a wildcard. It means that /hello/Ryan
, /hello/Fabien
or any other similar URL will match this route. The {name}
placeholder
parameter will also be passed to the controller so that you can use its value
to personally greet the user.
Note
The routing system has many more great features for creating flexible and powerful URL structures in your application. For more details, see the chapter all about Routing.
Step 2: Create the Controller¶
When a URL such as /hello/Ryan
is handled by the application, the hello
route is matched and the AcmeHelloBundle:Hello:index
controller is executed
by the framework. The second step of the page-creation process is to create
that controller.
The controller - AcmeHelloBundle:Hello:index
is the logical name of
the controller, and it maps to the indexAction
method of a PHP class
called Acme\HelloBundle\Controller\HelloController
. Start by creating this file
inside your AcmeHelloBundle
:
1 2 3 4 5 6 | // src/Acme/HelloBundle/Controller/HelloController.php
namespace Acme\HelloBundle\Controller;
class HelloController
{
}
|
In reality, the controller is nothing more than a PHP method that you create
and Symfony executes. This is where your code uses information from the request
to build and prepare the resource being requested. Except in some advanced
cases, the end product of a controller is always the same: a Symfony2 Response
object.
Create the indexAction
method that Symfony will execute when the hello
route is matched:
1 2 3 4 5 6 7 8 9 10 11 12 | // src/Acme/HelloBundle/Controller/HelloController.php
namespace Acme\HelloBundle\Controller;
use Symfony\Component\HttpFoundation\Response;
class HelloController
{
public function indexAction($name)
{
return new Response('Hello '.$name.'!');
}
}
|
The controller is simple: it creates a new Response
object, whose first
argument is the content that should be used in the response (a small HTML
page in this example).
Congratulations! After creating only a route and a controller, you already have a fully-functional page! If you've setup everything correctly, your application should greet you:
1 | http://localhost/app_dev.php/hello/Ryan
|
Tip
You can also view your app in the "prod" environment by visiting:
1 | http://localhost/app.php/hello/Ryan
|
If you get an error, it's likely because you need to clear your cache by running:
1 | $ php app/console cache:clear --env=prod --no-debug
|
An optional, but common, third step in the process is to create a template.
Note
Controllers are the main entry point for your code and a key ingredient when creating pages. Much more information can be found in the Controller Chapter.
Optional Step 3: Create the Template¶
Templates allow you to move all of the presentation (e.g. HTML code) into a separate file and reuse different portions of the page layout. Instead of writing the HTML inside the controller, render a template instead:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | // src/Acme/HelloBundle/Controller/HelloController.php
namespace Acme\HelloBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
class HelloController extends Controller
{
public function indexAction($name)
{
return $this->render(
'AcmeHelloBundle:Hello:index.html.twig',
array('name' => $name)
);
// render a PHP template instead
// return $this->render(
// 'AcmeHelloBundle:Hello:index.html.php',
// array('name' => $name)
// );
}
}
|
Note
In order to use the render()
method, your controller must extend the
Controller
class,
which adds shortcuts for tasks that are common inside controllers. This
is done in the above example by adding the use
statement on line 4
and then extending Controller
on line 6.
The render()
method creates a Response
object filled with the content
of the given, rendered template. Like any other controller, you will ultimately
return that Response
object.
Notice that there are two different examples for rendering the template. By default, Symfony2 supports two different templating languages: classic PHP templates and the succinct but powerful Twig templates. Don't be alarmed - you're free to choose either or even both in the same project.
The controller renders the AcmeHelloBundle:Hello:index.html.twig
template,
which uses the following naming convention:
BundleName:ControllerName:TemplateName
This is the logical name of the template, which is mapped to a physical location using the following convention.
/path/to/BundleName/Resources/views/ControllerName/TemplateName
In this case, AcmeHelloBundle
is the bundle name, Hello
is the
controller, and index.html.twig
the template:
- Twig
1 2 3 4 5 6
{# src/Acme/HelloBundle/Resources/views/Hello/index.html.twig #} {% extends '::base.html.twig' %} {% block body %} Hello {{ name }}! {% endblock %}
- PHP
1 2 3 4
 <?php $view->extend('::base.html.php') ?> Hello <?php echo $view->escape($name) ?>!
Step through the Twig template line-by-line:
- line 2: The
extends
token defines a parent template. The template explicitly defines a layout file inside of which it will be placed. - line 4: The
block
token says that everything inside should be placed inside a block calledbody
. As you'll see, it's the responsibility of the parent template (base.html.twig
) to ultimately render the block calledbody
.
The parent template, ::base.html.twig
, is missing both the BundleName
and ControllerName portions of its name (hence the double colon (::
)
at the beginning). This means that the template lives outside of the bundles
and in the app
directory:
- Twig
1 2 3 4 5 6 7 8 9 10 11 12 13 14
{# app/Resources/views/base.html.twig #} <!DOCTYPE html>   <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>{% block title %}Welcome!{% endblock %}</title> {% block stylesheets %}{% endblock %} <link rel="shortcut icon" href="{{ asset('favicon.ico') }}" />   {% block body %}{% endblock %} {% block javascripts %}{% endblock %}
- PHP
1 2 3 4 5 6 7 8 9 10 11 12 13 14
 <!DOCTYPE html>   <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title><?php $view['slots']->output('title', 'Welcome!') ?></title> <?php $view['slots']->output('stylesheets') ?> <link rel="shortcut icon" href="<?php echo $view['assets']->getUrl('favicon.ico') ?>" />   <?php $view['slots']->output('_content') ?> <?php $view['slots']->output('javascripts') ?>
The base template file defines the HTML layout and renders the body
block
that you defined in the index.html.twig
template. It also renders a title
block, which you could choose to define in the index.html.twig
template.
Since you did not define the title
block in the child template, it defaults
to "Welcome!".
Templates are a powerful way to render and organize the content for your page. A template can render anything, from HTML markup, to CSS code, or anything else that the controller may need to return.
In the lifecycle of handling a request, the templating engine is simply
an optional tool. Recall that the goal of each controller is to return a
Response
object. Templates are a powerful, but optional, tool for creating
the content for that Response
object.
The Directory Structure¶
After just a few short sections, you already understand the philosophy behind creating and rendering pages in Symfony2. You've also already begun to see how Symfony2 projects are structured and organized. By the end of this section, you'll know where to find and put different types of files and why.
Though entirely flexible, by default, each Symfony application has the same basic and recommended directory structure:
app/
: This directory contains the application configuration;src/
: All the project PHP code is stored under this directory;vendor/
: Any vendor libraries are placed here by convention;web/
: This is the web root directory and contains any publicly accessible files;
The Web Directory¶
The web root directory is the home of all public and static files including images, stylesheets, and JavaScript files. It is also where each front controller lives:
1 2 3 4 5 6 7 8 9 | // web/app.php
require_once __DIR__.'/../app/bootstrap.php.cache';
require_once __DIR__.'/../app/AppKernel.php';
use Symfony\Component\HttpFoundation\Request;
$kernel = new AppKernel('prod', false);
$kernel->loadClassCache();
$kernel->handle(Request::createFromGlobals())->send();
|
The front controller file (app.php
in this example) is the actual PHP
file that's executed when using a Symfony2 application and its job is to
use a Kernel class, AppKernel
, to bootstrap the application.
Tip
Having a front controller means different and more flexible URLs than are used in a typical flat PHP application. When using a front controller, URLs are formatted in the following way:
1 | http://localhost/app.php/hello/Ryan
|
The front controller, app.php
, is executed and the "internal:" URL
/hello/Ryan
is routed internally using the routing configuration.
By using Apache mod_rewrite
rules, you can force the app.php
file
to be executed without needing to specify it in the URL:
1 | http://localhost/hello/Ryan
|
Though front controllers are essential in handling every request, you'll rarely need to modify or even think about them. They'll be mentioned again briefly in the Environments section.
The Application (app
) Directory¶
As you saw in the front controller, the AppKernel
class is the main entry
point of the application and is responsible for all configuration. As such,
it is stored in the app/
directory.
This class must implement two methods that define everything that Symfony needs to know about your application. You don't even need to worry about these methods when starting - Symfony fills them in for you with sensible defaults.
registerBundles()
: Returns an array of all bundles needed to run the application (see The Bundle System);registerContainerConfiguration()
: Loads the main application configuration resource file (see the Application Configuration section).
In day-to-day development, you'll mostly use the app/
directory to modify
configuration and routing files in the app/config/
directory (see
Application Configuration). It also contains the application cache
directory (app/cache
), a log directory (app/logs
) and a directory
for application-level resource files, such as templates (app/Resources
).
You'll learn more about each of these directories in later chapters.
The Source (src
) Directory¶
Put simply, the src/
directory contains all of the actual code (PHP code,
templates, configuration files, stylesheets, etc) that drives your application.
When developing, the vast majority of your work will be done inside one or
more bundles that you create in this directory.
But what exactly is a bundle?
The Bundle System¶
A bundle is similar to a plugin in other software, but even better. The key difference is that everything is a bundle in Symfony2, including both the core framework functionality and the code written for your application. Bundles are first-class citizens in Symfony2. This gives you the flexibility to use pre-built features packaged in third-party bundles or to distribute your own bundles. It makes it easy to pick and choose which features to enable in your application and to optimize them the way you want.
Note
While you'll learn the basics here, an entire cookbook entry is devoted to the organization and best practices of bundles.
A bundle is simply a structured set of files within a directory that implement
a single feature. You might create a BlogBundle
, a ForumBundle
or
a bundle for user management (many of these exist already as open source
bundles). Each directory contains everything related to that feature, including
PHP files, templates, stylesheets, JavaScripts, tests and anything else.
Every aspect of a feature exists in a bundle and every feature lives in a
bundle.
An application is made up of bundles as defined in the registerBundles()
method of the AppKernel
class:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | // app/AppKernel.php
public function registerBundles()
{
$bundles = array(
new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
new Symfony\Bundle\SecurityBundle\SecurityBundle(),
new Symfony\Bundle\TwigBundle\TwigBundle(),
new Symfony\Bundle\MonologBundle\MonologBundle(),
new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
new Symfony\Bundle\DoctrineBundle\DoctrineBundle(),
new Symfony\Bundle\AsseticBundle\AsseticBundle(),
new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
new JMS\SecurityExtraBundle\JMSSecurityExtraBundle(),
);
if (in_array($this->getEnvironment(), array('dev', 'test'))) {
$bundles[] = new Acme\DemoBundle\AcmeDemoBundle();
$bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
$bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle();
$bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();
}
return $bundles;
}
|
With the registerBundles()
method, you have total control over which bundles
are used by your application (including the core Symfony bundles).
Tip
A bundle can live anywhere as long as it can be autoloaded (via the
autoloader configured at app/autoload.php
).
Creating a Bundle¶
The Symfony Standard Edition comes with a handy task that creates a fully-functional bundle for you. Of course, creating a bundle by hand is pretty easy as well.
To show you how simple the bundle system is, create a new bundle called
AcmeTestBundle
and enable it.
Tip
The Acme
portion is just a dummy name that should be replaced by
some "vendor" name that represents you or your organization (e.g. ABCTestBundle
for some company named ABC
).
Start by creating a src/Acme/TestBundle/
directory and adding a new file
called AcmeTestBundle.php
:
1 2 3 4 5 6 7 8 | // src/Acme/TestBundle/AcmeTestBundle.php
namespace Acme\TestBundle;
use Symfony\Component\HttpKernel\Bundle\Bundle;
class AcmeTestBundle extends Bundle
{
}
|
Tip
The name AcmeTestBundle
follows the standard Bundle naming conventions.
You could also choose to shorten the name of the bundle to simply TestBundle
by naming this class TestBundle
(and naming the file TestBundle.php
).
This empty class is the only piece you need to create the new bundle. Though commonly empty, this class is powerful and can be used to customize the behavior of the bundle.
Now that you've created the bundle, enable it via the AppKernel
class:
1 2 3 4 5 6 7 8 9 10 11 12 | // app/AppKernel.php
public function registerBundles()
{
$bundles = array(
...,
// register your bundles
new Acme\TestBundle\AcmeTestBundle(),
);
// ...
return $bundles;
}
|
And while it doesn't do anything yet, AcmeTestBundle
is now ready to
be used.
And as easy as this is, Symfony also provides a command-line interface for generating a basic bundle skeleton:
1 | $ php app/console generate:bundle --namespace=Acme/TestBundle
|
The bundle skeleton generates with a basic controller, template and routing resource that can be customized. You'll learn more about Symfony2's command-line tools later.
Tip
Whenever creating a new bundle or using a third-party bundle, always make
sure the bundle has been enabled in registerBundles()
. When using
the generate:bundle
command, this is done for you.
Bundle Directory Structure¶
The directory structure of a bundle is simple and flexible. By default, the
bundle system follows a set of conventions that help to keep code consistent
between all Symfony2 bundles. Take a look at AcmeHelloBundle
, as it contains
some of the most common elements of a bundle:
Controller/
contains the controllers of the bundle (e.g.HelloController.php
);DependencyInjection/
holds certain dependency injection extension classes, which may import service configuration, register compiler passes or more (this directory is not necessary);Resources/config/
houses configuration, including routing configuration (e.g.routing.yml
);Resources/views/
holds templates organized by controller name (e.g.Hello/index.html.twig
);Resources/public/
contains web assets (images, stylesheets, etc) and is copied or symbolically linked into the projectweb/
directory via theassets:install
console command;Tests/
holds all tests for the bundle.
A bundle can be as small or large as the feature it implements. It contains only the files you need and nothing else.
As you move through the book, you'll learn how to persist objects to a database, create and validate forms, create translations for your application, write tests and much more. Each of these has their own place and role within the bundle.
Application Configuration¶
An application consists of a collection of bundles representing all of the
features and capabilities of your application. Each bundle can be customized
via configuration files written in YAML, XML or PHP. By default, the main
configuration file lives in the app/config/
directory and is called
either config.yml
, config.xml
or config.php
depending on which
format you prefer:
- YAML
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
# app/config/config.yml imports: - { resource: parameters.yml } - { resource: security.yml } framework: secret: "%secret%" router: { resource: "%kernel.root_dir%/config/routing.yml" } # ... # Twig Configuration twig: debug: "%kernel.debug%" strict_variables: "%kernel.debug%" # ...
- XML
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
 <imports> <import resource="parameters.yml" /> <import resource="security.yml" /> </imports> <framework:config secret="%secret%"> <framework:router resource="%kernel.root_dir%/config/routing.xml" />  </framework:config>  <twig:config debug="%kernel.debug%" strict-variables="%kernel.debug%" />
- PHP
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
$this->import('parameters.yml'); $this->import('security.yml'); $container->loadFromExtension('framework', array( 'secret' => '%secret%', 'router' => array('resource' => '%kernel.root_dir%/config/routing.php'), // ... ), )); // Twig Configuration $container->loadFromExtension('twig', array( 'debug' => '%kernel.debug%', 'strict_variables' => '%kernel.debug%', )); // ...
Note
You'll learn exactly how to load each file/format in the next section Environments.
Each top-level entry like framework
or twig
defines the configuration
for a particular bundle. For example, the framework
key defines the configuration
for the core Symfony FrameworkBundle
and includes configuration for the
routing, templating, and other core systems.
For now, don't worry about the specific configuration options in each section. The configuration file ships with sensible defaults. As you read more and explore each part of Symfony2, you'll learn about the specific configuration options of each feature.
Default Configuration Dump¶
New in version 2.1: The config:dump-reference
command was added in Symfony 2.1
You can dump the default configuration for a bundle in yaml to the console using
the config:dump-reference
command. Here is an example of dumping the default
FrameworkBundle configuration:
1 | app/console config:dump-reference FrameworkBundle
|
The extension alias (configuration key) can also be used:
1 | app/console config:dump-reference framework
|
Note
See the cookbook article: How to expose a Semantic Configuration for a Bundle for information on adding configuration for your own bundle.
Environments¶
An application can run in various environments. The different environments
share the same PHP code (apart from the front controller), but use different
configuration. For instance, a dev
environment will log warnings and
errors, while a prod
environment will only log errors. Some files are
rebuilt on each request in the dev
environment (for the developer's convenience),
but cached in the prod
environment. All environments live together on
the same machine and execute the same application.
A Symfony2 project generally begins with three environments (dev
, test
and prod
), though creating new environments is easy. You can view your
application in different environments simply by changing the front controller
in your browser. To see the application in the dev
environment, access
the application via the development front controller:
1 | http://localhost/app_dev.php/hello/Ryan
|
If you'd like to see how your application will behave in the production environment,
call the prod
front controller instead:
1 | http://localhost/app.php/hello/Ryan
|
Since the prod
environment is optimized for speed; the configuration,
routing and Twig templates are compiled into flat PHP classes and cached.
When viewing changes in the prod
environment, you'll need to clear these
cached files and allow them to rebuild:
1 | $ php app/console cache:clear --env=prod --no-debug
|
Note
If you open the web/app.php
file, you'll find that it's configured explicitly
to use the prod
environment:
1 | $kernel = new AppKernel('prod', false);
|
You can create a new front controller for a new environment by copying
this file and changing prod
to some other value.
Note
The test
environment is used when running automated tests and cannot
be accessed directly through the browser. See the testing chapter
for more details.
Environment Configuration¶
The AppKernel
class is responsible for actually loading the configuration
file of your choice:
1 2 3 4 5 6 7 | // app/AppKernel.php
public function registerContainerConfiguration(LoaderInterface $loader)
{
$loader->load(
__DIR__.'/config/config_'.$this->getEnvironment().'.yml'
);
}
|
You already know that the .yml
extension can be changed to .xml
or
.php
if you prefer to use either XML or PHP to write your configuration.
Notice also that each environment loads its own configuration file. Consider
the configuration file for the dev
environment.
- YAML
1 2 3 4 5 6 7 8 9
# app/config/config_dev.yml imports: - { resource: config.yml } framework: router: { resource: "%kernel.root_dir%/config/routing_dev.yml" } profiler: { only_exceptions: false } # ...
- XML
1 2 3 4 5 6 7 8 9 10 11
 <imports> <import resource="config.xml" /> </imports> <framework:config> <framework:router resource="%kernel.root_dir%/config/routing_dev.xml" /> <framework:profiler only-exceptions="false" /> </framework:config>
- PHP
1 2 3 4 5 6 7 8 9
// app/config/config_dev.php $loader->import('config.php'); $container->loadFromExtension('framework', array( 'router' => array('resource' => '%kernel.root_dir%/config/routing_dev.php'), 'profiler' => array('only-exceptions' => false), )); // ...
The imports
key is similar to a PHP include
statement and guarantees
that the main configuration file (config.yml
) is loaded first. The rest
of the file tweaks the default configuration for increased logging and other
settings conducive to a development environment.
Both the prod
and test
environments follow the same model: each environment
imports the base configuration file and then modifies its configuration values
to fit the needs of the specific environment. This is just a convention,
but one that allows you to reuse most of your configuration and customize
just pieces of it between environments.
Summary¶
Congratulations! You've now seen every fundamental aspect of Symfony2 and have hopefully discovered how easy and flexible it can be. And while there are a lot of features still to come, be sure to keep the following basic points in mind:
- Creating a page is a three-step process involving a route, a controller and (optionally) a template;
- Each project contains just a few main directories:
web/
(web assets and the front controllers),app/
(configuration),src/
(your bundles), andvendor/
(third-party code) (there's also abin/
directory that's used to help updated vendor libraries); - Each feature in Symfony2 (including the Symfony2 framework core) is organized into a bundle, which is a structured set of files for that feature;
- The configuration for each bundle lives in the
Resources/config
directory of the bundle and can be specified in YAML, XML or PHP; - The global application configuration lives in the
app/config
directory; - Each environment is accessible via a different front controller (e.g.
app.php
andapp_dev.php
) and loads a different configuration file.
From here, each chapter will introduce you to more and more powerful tools and advanced concepts. The more you know about Symfony2, the more you'll appreciate the flexibility of its architecture and the power it gives you to rapidly develop applications.


Online voting System
Registration
Upload image
Select your role:
Voter
Group
Register
Already user?
Login here


Questions 1 & 2 deal with the Pressing Issues. Very rarely do I ever ask someone if they would like to have a courageous conversation. I simply realize that there is a problem because someone is either acting hurt or trying to get me to understand their viewpoint. When I see that a conversation is turning combustible because I don’t feel understood or the other person is frustrated, it dawns on me that I need to humble myself and esteem the others need to be heard as greater than my own. This is the third beatitude of Jesus: “God blesses the humble, for they will inherit the whole earth.” I will simply say, “What I hear you saying is that your most pressing issue is…” or I will say “What I hear you saying is…, which of these is the most pressing issue?”


Class: Redstruct::Lock
- Inherits:
-
Factory::Object
- Object
- Factory::Object
- Redstruct::Lock
- Includes:
- Utils::Coercion, Utils::Scriptable
- Defined in:
- lib/redstruct/lock.rb
Overview
Implementation of a simple binary lock (locked/not locked), with option to block and wait for the lock. Uses two redis structures: a string for the lease, and a list for blocking operations.
Constant Summary
- DEFAULT_EXPIRY =
The default expiry on the underlying redis keys, in seconds; can be between 0 and 1 as a float for milliseconds
1
- DEFAULT_TIMEOUT =
The default timeout when blocking, in seconds
nil
Instance Attribute Summary collapse
-
#expiry ⇒ Float, Integer
readonly
The expiry of the underlying redis structure in seconds.
-
#resource ⇒ String
readonly
The resource name (or ID of the lock).
-
#timeout ⇒ Integer
readonly
If greater than 0, will block until timeout is reached or the lock is acquired.
-
#token ⇒ String
readonly
The current token.
Instance Method Summary collapse
-
#acquire ⇒ Boolean
Attempts to acquire the lock.
-
#blocking? ⇒ Boolean
Whether or not the lock will block when attempting to acquire it.
-
#delete ⇒ Boolean
Deletes all traces of this lock.
-
#initialize(resource, expiry: DEFAULT_EXPIRY, timeout: DEFAULT_TIMEOUT, **options) ⇒ Lock
constructor
A new instance of Lock.
-
#locked { ... } ⇒ Object
Executes the given block if the lock can be acquired.
-
#release ⇒ Boolean
Releases the lock only if the current token is the value of the lease.
Constructor Details
#initialize(resource, expiry: DEFAULT_EXPIRY, timeout: DEFAULT_TIMEOUT, **options) ⇒ Lock
Returns a new instance of Lock
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/redstruct/lock.rb', line 37 def initialize(resource, expiry: DEFAULT_EXPIRY, timeout: DEFAULT_TIMEOUT, **) super(**) @resource = resource @token = nil @expiry = expiry @acquired = Redstruct::Utils::AtomicCounter.new @timeout = case timeout when nil then nil when Float::INFINITY then 0 else timeout.to_i end factory = @factory.factory(@resource) @lease = factory.string('lease') @tokens = factory.list('tokens') end |
Instance Attribute Details
#expiry ⇒ Float, Integer (readonly)
Returns the expiry of the underlying redis structure in seconds
29 30 31 |
# File 'lib/redstruct/lock.rb', line 29 def expiry @expiry end |
#resource ⇒ String (readonly)
Returns the resource name (or ID of the lock)
23 24 25 |
# File 'lib/redstruct/lock.rb', line 23 def resource @resource end |
#timeout ⇒ Integer (readonly)
Returns if greater than 0, will block until timeout is reached or the lock is acquired
32 33 34 |
# File 'lib/redstruct/lock.rb', line 32 def timeout @timeout end |
#token ⇒ String (readonly)
Returns the current token
26 27 28 |
# File 'lib/redstruct/lock.rb', line 26 def token @token end |
Instance Method Details
#acquire ⇒ Boolean
Attempts to acquire the lock. First attempts to grab the lease (a redis string). If the current token is already the lease token, the lock is considered acquired. If there is no current lease, then sets it to the current token. If there is a current lease that is not the current token, then:
1) If this not a blocking lock (see Lock#blocking?), return false
2) If this is a blocking lock, block and wait for the next token to be pushed on the tokens list
3) If a token was pushed, set it as our token and refresh the expiry
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
# File 'lib/redstruct/lock.rb', line 93 def acquire acquired = false token = non_blocking_acquire token = blocking_acquire if token.nil? && blocking? unless token.nil? @lease.expire(@expiry) @token = token @acquired.increment acquired = true end return acquired end |
#blocking? ⇒ Boolean
Whether or not the lock will block when attempting to acquire it
81 82 83 |
# File 'lib/redstruct/lock.rb', line 81 def blocking? return<EMAIL_ADDRESS>end |
#delete ⇒ Boolean
Deletes all traces of this lock
59 60 61 |
# File 'lib/redstruct/lock.rb', line 59 def delete return coerce_bool(delete_script(keys<EMAIL_ADDRESS>@tokens.key])) end |
#locked { ... } ⇒ Object
Executes the given block if the lock can be acquired
65 66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/redstruct/lock.rb', line 65 def locked Thread.handle_interrupt(Exception => :never) do begin if acquire Thread.handle_interrupt(Exception => :immediate) do yield end end ensure release end end end |
#release ⇒ Boolean
Releases the lock only if the current token is the value of the lease. If the lock is a blocking lock (see Lock#blocking?), push the next token on the tokens list.
113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 |
# File 'lib/redstruct/lock.rb', line 113 def release return false if @token.nil? released = true if @acquired.decrement.zero? keys =<EMAIL_ADDRESS>@tokens.key] argv = [@token, generate_token, (@expiry.to_f * 1000).floor] released = coerce_bool(release_script(keys: keys, argv: argv)) @token = nil end return released end |


Welcome, Mike!
Home
Search
Saved Recipes
Shopping List
Edit Profile
App Settings
About App
Edit Profile
Change Profile Picture
File
Edit Detials
First Name
Last Name
Email
Confirm Email
Change Password
Password
Confirm Password
Save Changes
Reset


In an earlier post on this website, we told the story of Richmond, California, a small city with big plans to end its foreclosure crisis via a novel use of eminent domain. If successful, this plan could set a nationwide precedent, and Strike Debt Bay Area (@StrikedebtBA), among other groups, is fighting to push it through, against pressure from big banks and big government alike. But there’s a new twist on the concept of using eminent domain that could have far wider implications, not only for the foreclosure crisis, but also for the power of big banks. In this post we explore that twist—referred to here as “clouded chain of title”—and its potential implications.
By this point, many of us have at least heard of mortgage-backed securities and other financial products that gambled on future mortgage payments and lost, precipitating the 2008 financial crisis and throwing hundreds of thousands, if not millions, of people out of their homes via foreclosure. Most of the gamblers (big banks, other financial institutions) have yet to pay for their bad bets, while homeowners and former homeowners—perhaps better understood as “debt-owners”—continue to struggle in the wake of Wall Street’s failures. A situation known as “broken” or “clouded” chain of title—a lesser-known aspect of the mortgage-backed securities story—may hold the potential to turn this around.
Put simply, in order for mortgages to become part of a financial instrument—to become “securitized”—they need to be pooled with other mortgages and then transferred from the originator (Bank of America, Countrywide, or whoever issued the original mortgage), to an aggregator, eventually ending up in a securitized trust for investors. For our purposes, the finer details are unimportant. What is important is that each of these steps requires a true and legal sale from one entity to the next.
The last step in this sequence—when the mortgage joins a securitized trust—is documented by a Pooling and Servicing Agreement (PSA). Each PSA has a cutoff date, and if the mortgages are not transferred into the PSA by the cutoff date, then that sale is not true and legal. (According to one of the lawyers we consulted for this article, the more accurate language is “a post-cutoff-date transfer is a void assignment,” taken from the court case Glaski v. Bank of America.) Missing the cutoff date for transfer into the PSA clouds the chain of title on the mortgage, meaning that the official record of ownership of a given mortgage is now muddled, throwing into question who owns that mortgage. The bank that receives your monthly payments doesn’t own the mortgage, since the bank is merely a “servicer” for the investors. The aggregator may or may not still own it, given that the aggregator received money from the trust it was ultimately placed in, and from that point on assumed that the mortgage was legally no longer in its possession. But the investors don’t really own it either, because it wasn’t transferred into the PSA before the cutoff date.
While this clouded chain of title situation may seem obscure and technical, it turns out that when the mortgage-backed securities market started heating up around 2005, and even before, an unknown but very high percentage of mortgages that were turned into mortgage-backed securities were transferred into their PSAs after the cutoff date. One industry insider told us that all non-Fannie Mae or Freddie Mac mortgages were transferred improperly. In other words, the ownership of potentially millions of mortgages is in question.
The closing date of the trust in the top image is February 25, 2005. The date of assignment in the bottom image is July 26, 2011. This mortgage was transferred into the trust more than six years after the closing date. Note that the two named entities are virtually identical, with just the component identifiers ordered differently: CWALT-INC, Series 2005-7CB, Mortgage Pass Through Certificates.
What does this have to do with systemic solutions to the ongoing foreclosure crisis and eminent domain? Put simply, if we can combine the eminent domain strategy that Richmond is currently contemplating with legal proceedings that force banks/trusts to prove that they own mortgages in their portfolios (which they can’t, because they don’t, as described above), we have the potential to wrest untold thousands of mortgages out of the hands of Wall Street. What we then do with them (and who might own them if not the banks or the trust) is another question. But first things first: what does this plan look like?
Here is the idea laid out in five steps, using Richmond as a hypothetical example:
Step 1: Find a willing Richmond citizen whose mortgage is in dispute. This will be easy given that, by insider estimations, after 2005 all non-Fannie Mae or Freddie Mac mortgages were transferred improperly.
Step 2: The city of Richmond steps in on behalf of this citizen, in an attempt to force banks (acting on behalf of the trust) to prove ownership of the mortgage. The city has at least two choices here: One, as a preliminary step before going ahead with the eminent domain seizure of this citizen’s mortgage, Richmond can ask a judge to determine ownership of the mortgage using something called “declaratory judgment law” (for legal folks out there, this is Cal. Civ. Proc. Section 1060). Put simply, declaratory judgment law asks the court to resolve a legal uncertainty. In this case, the uncertainty is, who owns this mortgage? In the declaratory judgment suit, the city would note that it is planning to condemn the loan via eminent domain, but due to an apparently invalid assignment process, the “owner” of the mortgage is unclear. Thus the lawsuit would determine ownership of the mortgage. A second approach might be for the city to condemn the loan as abandoned property.
Now, pay close attention because this is the important part: In either strategy, the bank will come forward to challenge the city, declaring itself (acting on behalf of the trust) to be the owner. This means that in clouded title processes—unlike the current Richmond plan or extant court cases like Glaski v. Bank of America—the burden of proof should rest with the trusts, and with the banks working as their trustees, to show that they are actually the party with rights to the loan. In other words, this kind of eminent domain approach could force trusts and the banks through which they work to acknowledge that, in fact, they do not own hundreds of thousands of mortgages they claim to own.
Legally speaking, Step 2 is complicated. But let’s say for the sake of argument that the judge indeed decides that the clouded chain of title or “void assignment” means that the trust does not actually own the mortgage, which is the legal precedent we are trying to create. This leads us to…
Step 3: If the trust doesn’t own the mortgage, the next legal question is, well who does? The city is making a claim on the mortgage via eminent domain, but it still has to offer the owner, whoever that may be, fair market value (FMV) in order to take possession.1 Most lawyers we’ve spoken with say that once it has been established that the trust does not own the loan, ownership would revert back one step in the chain, to the aggregator or maybe the loan originator.2 Seems straightforward enough, except that in California and across the country, many of those companies went out of business entirely (see a list of 388 such companies here) and left no successors.3
If it turns out that there is an owner, whether the aggregator or the mortgage originator, we’re back to using eminent domain, as Richmond originally envisioned (i.e., the CARES program, albeit for a single mortgage). It seems predictable enough that whoever has been declared the owner (some sort of entity tied to Wall Street) will push the same kind of court case that has already been filed in Richmond,4 even if said entity is already bankrupt. It also seems safe to assume that every bank in America will be falling over themselves to pay all associated court costs and we’ll be potentially looking at years of litigation. But even anticipating this response, we will have already dealt Wall Street a nasty blow—legal proof that the tens of thousands of trusts that were set up to hold securitized mortgages don’t really own them!
And if no one owns the loan, we move on to Step 4, where things start to get very exciting and very speculative.
Step 4: With no owner, it seems there is a chance that the city would not have to offer FMV to anyone. In terms of legal procedure, the city could then hold the proceeds of the loan in escrow, and pursue a quiet title action: after five years, if ownership on the loan proceeds is still unknown, quiet title could proceed via an “unclaimed funds” argument, and those funds could then legally belong to the city.
Step 5: Once the precedent is established that the city can take possession of mortgages via clouded title/eminent domain, there are many possible routes that Richmond could take. Among them, the city could threaten to initiate the same procedure against a whole set of houses within Richmond, unless the servicers/banks/trusts negotiate satisfactory principal reductions. Another option would be to forego the threat and instead simply take those mortgages and place them in another entity altogether. For instance, (and to end with a provocation) this would be an ideal situation to leverage in order to argue for a public bank. Rather than give those mortgages over to another private company to securitize and gamble with all over again, the city could set up a public bank to service those mortgages, collect payments, etc. Leveraging clouded title to set up public banks has the potential not only to eliminate the blight caused by the foreclosure crisis, but also to use the funds collected to invest in public infrastructure—schools, roads, parks—instead of providing profits to Wall Street and shareholders, as is the mandate of private banks.5
As this brief mention of a public bank suggests, this new twist on the eminent domain tactic has exciting implications. Not least among these is the prospect of finally transferring some of those ill-gotten gains away from the gamblers, who have yet to be punished in any meaningful way for their recklessness with other people’s money, and toward today’s debt-owners, who once imagined themselves to be homeowners. Even if the plan fails, it still has the potential to cause serious tax problems for these trusts. Proof that mortgages were entered into PSAs past the closing date would theoretically eliminate the tax-exempt status (as pass-through entities) that trusts currently enjoy.6 To date, the IRS doesn’t seem to care, and no one seems to have pushed the issue, but suppose some “outraged taxpayers” reported a set of trusts as tax cheats and demanded that the IRS pursue them and give the group the 30% of the taxes and penalties recovered that would be their due!
While the clouded title approach has many legal complexities, and while it is very difficult to tell what might happen once a brave municipality decides to test the waters, we feel confident asserting two things: First, simply the prospect of turning the tables on the banks by forcing them to prove ownership (which they most likely cannot) is itself a significant step in the right direction. Second, as one lawyer we consulted for this article put it:
These are issues of power. Create enough political leverage, and these nebulous and complex issues get resolved in favor of the people. Judges and policymakers have to understand that correct decisions are the only thing standing between them and 40,000 people marching in the street.
And for that reason, we introduce these issues to you, so that you can introduce them to your friends, and if they hit the courts, we can all be ready. See you in the streets.
1 The Eminent Domain Clause of the Fifth Amendment permits the government to appropriate private property, including real estate, personal belongings, and intangible assets, for a public purpose so long as the owner receives just compensation, which is normally equated with the fair market value of the property. This prescription attempts to strike a balance between the needs of the public and the property rights of the owner.
2 Because the “previous owner” has already been paid for the mortgage, one thing that the (current) claimed owner—the trust—can say is that it has what is called an “equitable” right to the loan, since it paid money to the originator to get it.
3 Some of the loan originators may have gone out of business but be in bankruptcy proceedings. If that’s the case, the loan would be an asset in the bankruptcy, hence, the bankruptcy trustee would get control of it and make the decision about whether to sell it, foreclose, etc.
4 Wells Fargo Bank, National Association, as Trustee, et. al. v. City of Richmond, California and Mortgage Resolution Partners Llc, Case No. CV-13-3663.
5 The Bank of North Dakota is a public bank that has existed for over one hundred years and is so successful that even North Dakota’s Republican-dominated government has no intention of purging such a “socialist blight” from its prominent place in the economy of the state.
6 A securitized trust is what’s known as a Real Estate Mortgage Investment Trust, or REMIC, for legal and tax purposes.


{{user.username}}
{{user.email}}
Add A New BeneficiaryBeneficiaries
| First Name | Last Name | Email Address | ID Number | Relation | Date Created | ||
|---|---|---|---|---|---|---|---|
{{beneficiary.first_name}} |
{{beneficiary.last_name}} |
{{ beneficiary.email}} |
{{ beneficiary.id_number}} |
{{ beneficiary.relation}} |
{{ beneficiary.date_created}} |
Update | Delete |


|
JavaTM 2 Platform Standard Ed. 5.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.sound.sampled.AudioFormat
public class AudioFormat
AudioFormat
is the class that specifies a particular arrangement of data in a sound stream.
By examing the information stored in the audio format, you can discover how to interpret the bits in the
binary sound data.
Every data line has an audio format associated with its data stream. The audio format of a source (playback) data line indicates
what kind of data the data line expects to receive for output. For a target (capture) data line, the audio format specifies the kind
of the data that can be read from the line.
Sound files also have audio formats, of course. The
class encapsulates an AudioFileFormat
AudioFormat
in addition to other,
file-specific information. Similarly, an
has an
AudioInputStream
AudioFormat
.
The AudioFormat
class accommodates a number of common sound-file encoding techniques, including
pulse-code modulation (PCM), mu-law encoding, and a-law encoding. These encoding techniques are predefined,
but service providers can create new encoding types.
The encoding that a specific format uses is named by its encoding
field.
In addition to the encoding, the audio format includes other properties that further specify the exact arrangement of the data. These include the number of channels, sample rate, sample size, byte order, frame rate, and frame size. Sounds may have different numbers of audio channels: one for mono, two for stereo. The sample rate measures how many "snapshots" (samples) of the sound pressure are taken per second, per channel. (If the sound is stereo rather than mono, two samples are actually measured at each instant of time: one for the left channel, and another for the right channel; however, the sample rate still measures the number per channel, so the rate is the same regardless of the number of channels. This is the standard use of the term.) The sample size indicates how many bits are used to store each snapshot; 8 and 16 are typical values. For 16-bit samples (or any other sample size larger than a byte), byte order is important; the bytes in each sample are arranged in either the "little-endian" or "big-endian" style. For encodings like PCM, a frame consists of the set of samples for all channels at a given point in time, and so the size of a frame (in bytes) is always equal to the size of a sample (in bytes) times the number of channels. However, with some other sorts of encodings a frame can contain a bundle of compressed data for a whole series of samples, as well as additional, non-sample data. For such encodings, the sample rate and sample size refer to the data after it is decoded into PCM, and so they are completely different from the frame rate and frame size.
An AudioFormat
object can include a set of
properties. A property is a pair of key and value: the key
is of type String
, the associated property
value is an arbitrary object. Properties specify
additional format specifications, like the bit rate for
compressed formats. Properties are mainly used as a means
to transport additional information of the audio format
to and from the service providers. Therefore, properties
are ignored in the matches(AudioFormat)
method.
However, methods which rely on the installed service
providers, like (AudioFormat, AudioFormat) isConversionSupported
may consider
properties, depending on the respective service provider
implementation.
The following table lists some common properties which service providers should use, if applicable:
| Property key | Value type | Description |
|---|---|---|
| "bitrate" | Integer |
average bit rate in bits per second |
| "vbr" | Boolean |
true , if the file is encoded in variable bit
rate (VBR) |
| "quality" | Integer |
encoding/conversion quality, 1..100 |
Vendors of service providers (plugins) are encouraged to seek information about other already established properties in third party plugins, and follow the same conventions.
DataLine.getFormat()
,
AudioInputStream.getFormat()
,
AudioFileFormat
,
FormatConversionProvider
| Nested Class Summary | |
|---|---|
static class |
AudioFormat.Encoding
The Encoding class names the specific type of data representation
used for an audio stream. |
| Field Summary | |
|---|---|
protected boolean |
bigEndian
Indicates whether the audio data is stored in big-endian or little-endian order. |
protected int |
channels
The number of audio channels in this format (1 for mono, 2 for stereo). |
protected AudioFormat.Encoding |
encoding
The audio encoding technique used by this format. |
protected float |
frameRate
The number of frames played or recorded per second, for sounds that have this format. |
protected int |
frameSize
The number of bytes in each frame of a sound that has this format. |
protected float |
sampleRate
The number of samples played or recorded per second, for sounds that have this format. |
protected int |
sampleSizeInBits
The number of bits in each sample of a sound that has this format. |
| Constructor Summary | |
|---|---|
AudioFormat(AudioFormat.Encoding encoding,
float sampleRate,
int sampleSizeInBits,
int channels,
int frameSize,
float frameRate,
boolean bigEndian)
Constructs an AudioFormat with the given parameters. |
|
AudioFormat(AudioFormat.Encoding encoding,
float sampleRate,
int sampleSizeInBits,
int channels,
int frameSize,
float frameRate,
boolean bigEndian,
Map<String,Object> properties)
Constructs an AudioFormat with the given parameters. |
|
AudioFormat(float sampleRate,
int sampleSizeInBits,
int channels,
boolean signed,
boolean bigEndian)
Constructs an AudioFormat with a linear PCM encoding and
the given parameters. |
| Method Summary | |
|---|---|
int |
getChannels()
Obtains the number of channels. |
AudioFormat.Encoding |
getEncoding()
Obtains the type of encoding for sounds in this format. |
float |
getFrameRate()
Obtains the frame rate in frames per second. |
int |
getFrameSize()
Obtains the frame size in bytes. |
Object |
getProperty(String key)
Obtain the property value specified by the key. |
float |
getSampleRate()
Obtains the sample rate. |
int |
getSampleSizeInBits()
Obtains the size of a sample. |
boolean |
isBigEndian()
Indicates whether the audio data is stored in big-endian or little-endian byte order. |
boolean |
matches(AudioFormat format)
Indicates whether this format matches the one specified. |
Map<String,Object> |
properties()
Obtain an unmodifiable map of properties. |
String |
toString()
Returns a string that describes the format, such as: "PCM SIGNED 22050 Hz 16 bit mono big-endian". |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected AudioFormat.Encoding encoding
protected float sampleRate
protected int sampleSizeInBits
protected int channels
protected int frameSize
protected float frameRate
protected boolean bigEndian
| Constructor Detail |
|---|
public AudioFormat(AudioFormat.Encoding encoding, float sampleRate, int sampleSizeInBits, int channels, int frameSize, float frameRate, boolean bigEndian)
AudioFormat
with the given parameters.
The encoding specifies the convention used to represent the data.
The other parameters are further explained in the class description
.
encoding
- the audio encoding techniquesampleRate
- the number of samples per secondsampleSizeInBits
- the number of bits in each samplechannels
- the number of channels (1 for mono, 2 for stereo, and so on)frameSize
- the number of bytes in each frameframeRate
- the number of frames per secondbigEndian
- indicates whether the data for a single sample
is stored in big-endian byte order (false
means little-endian)public AudioFormat(AudioFormat.Encoding encoding, float sampleRate, int sampleSizeInBits, int channels, int frameSize, float frameRate, boolean bigEndian, Map<String,Object> properties)
AudioFormat
with the given parameters.
The encoding specifies the convention used to represent the data.
The other parameters are further explained in the class description
.
encoding
- the audio encoding techniquesampleRate
- the number of samples per secondsampleSizeInBits
- the number of bits in each samplechannels
- the number of channels (1 for mono, 2 for
stereo, and so on)frameSize
- the number of bytes in each frameframeRate
- the number of frames per secondbigEndian
- indicates whether the data for a single sample
is stored in big-endian byte order
(false
means little-endian)properties
- a Map<String,Object>
object
containing format propertiespublic AudioFormat(float sampleRate, int sampleSizeInBits, int channels, boolean signed, boolean bigEndian)
AudioFormat
with a linear PCM encoding and
the given parameters. The frame size is set to the number of bytes
required to contain one sample from each channel, and the frame rate
is set to the sample rate.
sampleRate
- the number of samples per secondsampleSizeInBits
- the number of bits in each samplechannels
- the number of channels (1 for mono, 2 for stereo, and so on)signed
- indicates whether the data is signed or unsignedbigEndian
- indicates whether the data for a single sample
is stored in big-endian byte order (false
means little-endian)| Method Detail |
|---|
public AudioFormat.Encoding getEncoding()
AudioFormat.Encoding.PCM_SIGNED
,
AudioFormat.Encoding.PCM_UNSIGNED
,
AudioFormat.Encoding.ULAW
,
AudioFormat.Encoding.ALAW
public float getSampleRate()
AudioSystem.isConversionSupported
) or capabilities (e.g. DataLine.Info.getFormats
), a sample rate of
AudioSystem.NOT_SPECIFIED
means that any sample rate is
acceptable. AudioSystem.NOT_SPECIFIED
is also returned when
the sample rate is not defined for this audio format.
AudioSystem.NOT_SPECIFIED
getFrameRate()
,
AudioSystem.NOT_SPECIFIED
public int getSampleSizeInBits()
AudioSystem.isConversionSupported
) or capabilities (e.g. DataLine.Info.getFormats
), a sample size of
AudioSystem.NOT_SPECIFIED
means that any sample size is
acceptable. AudioSystem.NOT_SPECIFIED
is also returned when
the sample size is not defined for this audio format.
AudioSystem.NOT_SPECIFIED
getFrameSize()
,
AudioSystem.NOT_SPECIFIED
public int getChannels()
AudioSystem.isConversionSupported
) or capabilities (e.g. DataLine.Info.getFormats
), a return value of
AudioSystem.NOT_SPECIFIED
means that any (positive) number of channels is
acceptable.
AudioSystem.NOT_SPECIFIED
AudioSystem.NOT_SPECIFIED
public int getFrameSize()
AudioSystem.isConversionSupported
) or capabilities (e.g. DataLine.Info.getFormats
), a frame size of
AudioSystem.NOT_SPECIFIED
means that any frame size is
acceptable. AudioSystem.NOT_SPECIFIED
is also returned when
the frame size is not defined for this audio format.
AudioSystem.NOT_SPECIFIED
getSampleSizeInBits()
,
AudioSystem.NOT_SPECIFIED
public float getFrameRate()
AudioSystem.isConversionSupported
) or capabilities (e.g. DataLine.Info.getFormats
), a frame rate of
AudioSystem.NOT_SPECIFIED
means that any frame rate is
acceptable. AudioSystem.NOT_SPECIFIED
is also returned when
the frame rate is not defined for this audio format.
AudioSystem.NOT_SPECIFIED
getSampleRate()
,
AudioSystem.NOT_SPECIFIED
public boolean isBigEndian()
true
if the data is stored in big-endian byte order,
false
if little-endianpublic Map<String,Object> properties()
class description
.
Map<String,Object>
object containing
all properties. If no properties are recognized, an empty map is
returned.getProperty(String)
public Object getProperty(String key)
class description
.
If the specified property is not defined for a
particular file format, this method returns
null
.
key
- the key of the desired property
null
if the property does not exist.properties
public boolean matches(AudioFormat format)
AudioSystem.NOT_SPECIFIED
,
which any sample rate will match. The frame rates must
similarly be equal, unless the specified format has the frame rate
value AudioSystem.NOT_SPECIFIED
. The byte order (big-endian or little-endian)
must match if the sample size is greater than one byte.
format
- format to test for match
true
if this format matches the one specified,
false
otherwise.public String toString()
toString
in class Object
|
JavaTM 2 Platform Standard Ed. 5.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 2004, 2010 Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.


Preparation time
1-2 hours
Cooking time
10 to 30 mins
Serves
Makes 6 tartlets
Dietary
Sweet apple slices layered over spiced fruit, all on homemade pastry, served with a creamy caramel sauce.
For the rough puff pastry, put the flour in a mound on the work surface and make a well in the centre. Place the butter and salt in the well and work them together with the fingertips of one hand, gradually drawing the flour into the centre with the other hand.
When the cubes of butter have become small pieces and the dough is grainy, gradually add the iced water and mix until it is all incorporated, but don’t overwork the dough.
Roll it into a ball, wrap in cling film and refrigerate for 20 minutes.
Flour the work surface and roll out the pastry into a 40x20cm/16x8in rectangle.
Fold it into three, by folding the outside third on each side over onto the middle section, then give it a quarter-turn.
Roll the block of pastry into a 40 x 20cm rectangle as before, and fold it into three again.
These are the first two turns. Wrap the block in cling film and refrigerate it for 30 minutes.
Give the chilled pastry another two turns, rolling and folding as before. This makes a total of four turns, and the pastry is now ready.
Wrap it in cling film and refrigerate for at least 30 minutes before using.
For the tartlets, preheat the oven to 200C/400F/Gas 6.
On a light floured surface, roll out the pastry to a 3mm/1/8in thickness.
Using a 10cm/4in pastry cutter, cut out six discs and six small leaf shapes.
Brush a baking sheet with a little cold water and lift the pastry onto it with a palette knife. Refrigerate for 20 minutes.
Prick the pastry discs with a fork, and mark the leaves with a knife to form veins.
Brush the halved apples with butter then sprinkle with some of the caster sugar and set aside.
Mix the sultanas with the soft dark brown sugar, spices and remaining butter in a bowl, then spoon the sultana mix onto the centre of the pastry.
Finely slice the apples, keeping them in their original shape, then place over the top of the sultana mix on the pastry and press gently to one side so the slices just separate, but the filling is enclosed.
Place the leaf shapes onto the edge of the pastry and brush with butter and sugar. (Place into the freezer at this stage if you want to and freeze until needed.)
Bake for 15 minutes, then sprinkle generously with the caster sugar and cook for another five minutes.

For the caramel sauce, heat the sugar and butter in a small saucepan until melted and well combined.
Pour in the double cream and simmer gently for 3-5 minutes, or until the mixture thickens slightly.
To serve, slide the tart onto a plate and serve with a spoonful of caramel sauce.