Below here is a partial copy of the documentation found at http://expressjs.com/guide.html; functionality that makes sense on the client but isn't implemented yet will clearly be marked.
To create an instance of the Client Express Server, simply invoke the createServer() method. With our instance server we can then define routes based on the HTTP verbs, in this example server.get().
var server = require('express').createServer(); server.get('/', function(request, response){ response.send('hello world'); }); server.listen();
Express supports arbitrary environments, such as production and development. Developers can use the configure() method to setup needs required by the current environment. When configure() is called without an environment name it will be run in every environment. The configure functions are being called in the order they where defined.
In the example below we only use the logger in development mode, however for both environments we assign a content_target_area.
server.configure(function(){ server.use(express.content_target_area("content")); }); server.configure('development', function(){ server.use(express.logger()); }); server.configure('production', function(){ });
For internal and arbitrary settings Client Express provides the set(key[, val]), enable(key) and disable(key) methods:
server.configure(function(){ server.set('views', '/views'); server.set('views'); // => "/absolute/path/to/views" server.enable('some feature'); // same as server.set('some feature', true); server.disable('some feature'); // same as server.set('some feature', false); server.enabled('some feature') // => false });
To alter the environment we can use the enable() function, for example:
server.enable('production');
Express supports the following settings out of the box:
Express utilizes the HTTP verbs to provide a meaningful, expressive routing API. For example we may want to render a user’s account for the path /user/12, this can be done by defining the route below. The values associated to the named placeholders are available as request.params.
server.get('/user/:id', function(request, response){ response.send('user ' + request.params.id); });
A route is simple a string which is compiled to a RegExp internally. For example when /user/:id is compiled, a simplified version of the regexp may look similar to:
\/user\/([^\/]+)\/?
Regular expression literals may also be passed for complex uses. Since capture groups with literal RegExp’s are anonymous we can access them directly request.params. So our first capture group would be request.params[0] and the second would follow as request.params[1].
server.get(/^\/users?(?:\/(\d+)(?:\.\.(\d+))?)?/, function(request, response){ response.send(request.params); });
Below are some route examples, and the associated paths that they may consume:
"/user/:id" /user/12 "/users/:id?" /users/5 /users "/files/*" /files/jquery.js /files/javascripts/jquery.js "/file/*.*" /file/jquery.js /file/javascripts/jquery.js "/user/:id/:operation?" /user/1 /user/1/edit "/products.:format" /products.json /products.xml "/products.:format?" /products.json /products.xml /products "/user/:id.:format?" /user/12 /user/12.json
For example we can POST some json, and echo the json back using the bodyParser middleware which will parse json request bodies (as well as others), and place the result in request.body:
var server = require('express').createServer(); server.use(express.bodyParser()); server.post('/', function(request, response){ response.send(request.body); }); server.listen();
Typically we may use a “dumb” placeholder such as “/user/:id” which has no restrictions, however say for example we are limiting a user id to digits, we may use ‘/user/:id([0-9]+)’ which will not match unless the placeholder value contains only digits.
We may pass control to the next matching route, by calling the third argument, the next() function. When a match cannot be made, control is passed back to Connect, and middleware continue to be invoked in the order that they are added via use(). The same is true for several routes which have the same path defined, they will simply be executed in order until one does not call next() and decides to respond.
server.get('/users/:id?', function(request, response, next){ var id = request.params.id; if (id) { // do something } else { next(); } }); server.get('/users', function(request, response){ // do something else });
The server.all() method is useful for serverlying the same logic for all HTTP verbs in a single call. Below we use this to load a user from our fake database, and assign it to request.user.
var express = require('express') , server = express.createServer(); var users = [{ name: 'tj' }]; server.all('/user/:id/:op?', function(request, response, next){ request.user = users[request.params.id]; if (request.user) { next(); } else { next(new Error('cannot find user ' + request.params.id)); } }); server.get('/user/:id', function(request, response){ response.send('viewing ' + request.user.name); }); server.get('/user/:id/edit', function(request, response){ response.send('editing ' + request.user.name); }); server.put('/user/:id', function(request, response){ response.send('updating ' + request.user.name); }); server.get('*', function(request, response){ response.send('what???', 404); }); server.listen();
Routes may utilize route-specific middleware by passing one or more additional callbacks (or arrays) to the method. This feature is extremely useful for restricting access, loading data used by the route etc.
Typically async data retrieval might look similar to below, where we take the :id parameter, and attempt loading a user.
server.get('/user/:id', function(request, response, next){ loadUser(request.params.id, function(err, user){ if (err) return next(err); response.send('Viewing user ' + user.name); }); });
To keep things DRY and to increase readability we can serverly this logic within a middleware. As you can see below, abstracting this logic into middleware allows us to reuse it, and clean up our route at the same time.
function loadUser(request, response, next) { // You would fetch your user from the db var user = users[request.params.id]; if (user) { request.user = user; next(); } else { next(new Error('Failed to load user ' + request.params.id)); } } server.get('/user/:id', loadUser, function(request, response){ response.send('Viewing user ' + request.user.name); });
Multiple route middleware can be serverlied, and will be executed sequentially to serverly further logic such as restricting access to a user account. In the example below only the authenticated user may edit his/her account.
function andRestrictToSelf(request, response, next) { request.authenticatedUser.id == request.user.id ? next() : next(new Error('Unauthorized')); } server.get('/user/:id/edit', loadUser, andRestrictToSelf, function(request, response){ response.send('Editing user ' + request.user.name); });
Keeping in mind that middleware are simply functions, we can define function that returns the middleware in order to create a more expressive and flexible solution as shown below.
function andRestrictTo(role) { return function(request, response, next) { request.authenticatedUser.role == role ? next() : next(new Error('Unauthorized')); } } server.del('/user/:id', loadUser, andRestrictTo('admin'), function(request, response){ response.send('Deleted user ' + request.user.name); });
Commonly used “stacks” of middleware can be passed as an array (serverlied recursively), which can be mixed and matched to any degree.
var a = [middleware1, middleware2] , b = [middleware3, middleware4] , all = [a, b]; server.get('/foo', a, function(){}); server.get('/bar', a, function(){}); server.get('/', a, middleware3, middleware4, function(){}); server.get('/', a, b, function(){}); server.get('/', all, function(){});
For this example in full, view the route middleware example in the repository.
There are times when we may want to “skip” passed remaining route middleware, but continue matching subsequent routes. To do this we invoke next() with the string “route” next('route'). If no remaining routes match the request url then Express will respond with 404 Not Found.
We have seen server.get() a few times, however Express also exposes other familiar HTTP verbs in the same manor, such as server.post(), server.del(), etc.
A common example for POST usage, is when “submitting” a form. Below we simply set our form method to “post” in our html, and control will be given to the route we have defined below it.
<form method="post" action="/"> <input type="text" name="user[name]" /> <input type="text" name="user[email]" /> <input type="submit" value="Submit" /> </form>
Our route below will now have access to the request.body.user object which will contain the name and email properties when defined.
server.post('/', function(request, response){ console.log(request.body.user); response.redirect('back'); });
When using methods such as PUT with a form, we can utilize a hidden input named _method, which can be used to alter the HTTP method. This provides a great solution for forms. Below shows what the usage of PUT might look like:
<form method="post" action="/"> <input type="hidden" name="_method" value="put" /> <input type="text" name="user[name]" /> <input type="text" name="user[email]" /> <input type="submit" value="Submit" /> </form> server.put('/', function(){ console.log(request.body.user); response.redirect('back'); });
Express provides the server.error() method which receives exceptions thrown within a route, or passed to next(err). Below is an example which serves different pages based on our ad-hoc NotFound exception:
function NotFound(msg){ this.name = 'NotFound'; Error.call(this, msg); Error.captureStackTrace(this, arguments.callee); } NotFound.prototype.__proto__ = Error.prototype; server.get('/404', function(request, response){ throw new NotFound; }); server.get('/500', function(request, response){ throw new Error('keyboard cat!'); });
We can call server.error() several times as shown below. Here we check for an instanceof NotFound and show the 404 page, or we pass on to the next error handler.
Note that these handlers can be defined anywhere, as they will be placed below the route handlers on listen(). This allows for definition within configure() blocks so we can handle exceptions in different ways based on the environment.
server.error(function(err, req, res, next){ if (err instanceof NotFound) { response.render('404.jade'); } else { next(err); } });
Here we assume all errors as 500 for the simplicity of this demo, however you can choose whatever you like. For example when node performs filesystem syscalls, you may receive an error object with the error.code of ENOENT, meaning “no such file or directory”, we can utilize this in our error handling and display a page specific to this if desired.
server.error(function(err, req, res){ response.render('500.jade', { error: err }); });
Our servers could also utilize the Connect errorHandler middleware to report on exceptions. For example if we wish to output exceptions in “development” mode to stderr we can use:
server.use(express.errorHandler({ dumpExceptions: true }));
Also during development we may want fancy html pages to show exceptions that are passed or thrown, so we can set showStack to true:
server.use(express.errorHandler({ showStack: true, dumpExceptions: true }));
The errorHandler middleware also responds with json if Accept: serverlication/json is present, which is useful for developing servers that rely heavily on client-side JavaScript.
Route param pre-conditions can drastically improve the readability of your serverlication, through implicit loading of data, and validation of request urls. For example if you are constantly fetching common data for several routes, such as loading a user for /user/:id, we might typically do something like below:
server.get('/user/:userId', function(request, response, next){ User.get(request.params.userId, function(err, user){ if (err) return next(err); response.send('user ' + user.name); }); });
With preconditions our params can be mservered to callbacks which may perform validation, coercion, or even loading data from a database. Below we invoke server.param() with the parameter name we wish to map to some middleware, as you can see we receive the id argument which contains the placeholder value. Using this we load the user and perform error handling as usual, and simple call next() to pass control to the next precondition or route handler.
server.param('userId', function(request, response, next, id){ User.get(id, function(err, user){ if (err) return next(err); if (!user) return next(new Error('failed to find user')); request.user = user; next(); }); });
Doing so, as mentioned drastically improves our route readability, and allows us to easily share this logic throughout our serverlication:
server.get('/user/:userId', function(request, response){ response.send('user ' + request.user.name); });
View filenames take the form “<name>.<engine>”, where <engine> is the name of the module that will be required. For example the view layout.ejs will tell the view system to require(‘ejs’), the module being loaded must export the method exports.compile(str, options), and return a Function to comply with Express. To alter this behaviour server.register() can be used to map engines to file extensions, so that for example “foo.html” can be rendered by ejs.
Below is an example using Jade to render index.html, and since we do not use layout: false the rendered contents of index.jade will be passed as the body local variable in layout.jade.
server.get('/', function(request, response){ response.render('index.jade', { title: 'My Site' }); });
The new view engine setting allows us to specify our default template engine, so for example when using jade we could set:
server.set('view engine', 'jade');
Allowing us to render with:
response.render('index');
vs:
response.render('index.jade');
When view engine is set, extensions are entirely optional, however we can still mix and match template engines:
response.render('another-page.ejs');
The Express view system has built-in support for partials and collections, which are “mini” views representing a document fragment. For example rather than iterating in a view to display comments, we could use partial collection:
partial('comment', { collection: comments });
If no other options or local variables are desired, we can omit the object and simply pass our array, which is equivalent to above:
partial('comment', comments);
When using the partial collection support a few “magic” locals are provided for free:
Local variables passed (or generated) take precedence, however locals passed to the parent view are available in the child view as well. So for example if we were to render a blog post with partial(‘blog/post’, post) it would generate the post local, but the view calling this function had the local user, it would be available to the blog/post view as well.
For documentation on altering the object name view response.partial().
NOTE: be careful about when you use partial collections, as rendering an array with a length of 100 means we have to render 100 views. For simple collections you may inline the iteration instead of using partial collection support to decrease overhead.
View lookup is performed relative to the parent view, for example if we had a page view named views/user/list.jade, and within that view we did partial(‘edit’) it would attempt to load views/user/edit.jade, whereas partial(‘../messages’) would load views/messages.jade.
The view system also allows for index templates, allowing you to have a directory of the same name. For example within a route we may have response.render(‘users’) either views/users.jade, or views/users/index.jade.
When utilizing index views as shown above, we may reference views/users/index.jade from a view in the same directory by partial(‘users’), and the view system will try ../users/index, preventing us from needing to call partial(‘index’).
Below are a few template engines commonly used with Express:
Session support is nothing more then a global variable that stays a life as long as the server is a life. So once a user has refreshed a page manually the session is gone.
The request.session property will be accessible to all routes and subsequent middleware. Properties on request.session are automatically saved on a response, so for example if we wish to shopping cart data:
server.post('/add-to-cart', function(request, response){ // Perhaps we posted several items with a form var items = request.body.items; request.session.items = items; response.redirect('back'); }); server.get('/add-to-cart', function(request, response){ // When redirected back to GET /add-to-cart // we could check request.session.items && request.session.items.length // to print out a message if (request.session.items && request.session.items.length) { request.flash('info', 'You have %s items in your cart', request.session.items.length); } response.render('shopping-cart'); });
Get the case-insensitive request header key, with optional defaultValue:
request.header('Host'); request.header('host'); request.header('Accept', '*/*');
The Referrer and Referer header fields are special-cased, either will work:
// sent Referrer: http://google.com request.header('Referer'); // => "http://google.com" request.header('Referrer'); // => "http://google.com"
Check if the Accept header is present, and includes the given type.
When the Accept header is not present true is returned. Otherwise the given type is matched by an exact match, and then subtypes. You may pass the subtype such as “html” which is then converted internally to “text/html” using the mime lookup table.
// Accept: text/html request.accepts('html'); // => true // Accept: text/*; serverlication/json request.accepts('html'); request.accepts('text/html'); request.accepts('text/plain'); request.accepts('serverlication/json'); // => true request.accepts('image/png'); request.accepts('png'); // => false
Check if the incoming request contains the Content-Type header field, and it contains the give mime type.
// With Content-Type: text/html; charset=utf-8 request.is('html'); request.is('text/html'); // => true // When Content-Type is serverlication/json request.is('json'); request.is('serverlication/json'); // => true request.is('html'); // => false
Ad-hoc callbacks can also be registered with Express, to perform assertions again the request, for example if we need an expressive way to check if our incoming request is an image, we can register “an image” callback:
server.is('an image', function(req){ return 0 == request.headers['content-type'].indexOf('image'); });
Now within our route callbacks, we can use to to assert content types such as “image/jpeg”, “image/png”, etc.
server.post('/image/upload', function(request, response, next){ if (request.is('an image')) { // do something } else { next(); } });
Keep in mind this method is not limited to checking Content-Type, you can perform any request assertion you wish.
Wildcard matches can also be made, simplifying our example above for “an image”, by asserting the subtype only:
request.is('image/*');
We may also assert the type as shown below, which would return true for “serverlication/json”, and “text/json”.
request.is('*/json');
Return the value of param name when present or default.
To utilize urlencoded request bodies, request.body should be an object. This can be done by using the _express.bodyParser middleware.
Get field’s param value, defaulting to ‘’ when the param or field is not present.
request.get('content-disposition', 'filename'); // => "something.png" request.get('Content-Type', 'boundary'); // => "--foo-bar-baz"
Queue flash msg of the given type.
request.flash('info', 'email sent'); request.flash('error', 'email delivery failed'); request.flash('info', 'email re-sent'); // => 2 request.flash('info'); // => ['email sent', 'email re-sent'] request.flash('info'); // => [] request.flash(); // => { error: ['email delivery failed'], info: [] }
Flash notification message may also utilize formatters, by default only the %s string formatter is available:
request.flash('info', 'email delivery to _%s_ from _%s_ failed.', toUser, fromUser);
Also aliased as request.xhr, this getter checks the X-Requested-With header to see if it was issued by an XMLHttpRequest:
request.xhr request.isXMLHttpRequest
Get or set the response header key.
response.header('Content-Length'); // => undefined response.header('Content-Length', 123); // => 123 response.header('Content-Length'); // => 123
Sets the charset for subsequent Content-Type header fields. For example response.send() and response.render() default to “utf8”, so we may explicitly set the charset before rendering a template:
response.charset = 'ISO-8859-1'; response.render('users');
or before responding with response.send():
response.charset = 'ISO-8859-1'; response.send(str);
or with node’s response.end():
response.charset = 'ISO-8859-1'; response.header('Content-Type', 'text/plain'); response.end(str);
Sets the Content-Type response header to the given type.
var filename = 'path/to/image.png'; response.contentType(filename); // Content-Type is now "image/png"
A literal Content-Type works as well:
response.contentType('serverlication/json');
Or simply the extension without leading .:
response.contentType('json');
Sets the Content-Disposition response header to “attachment”, with optional filename.
response.attachment('path/to/my/image.png');
Used by response.download() to transfer an arbitrary file.
response.sendfile('path/to/my.file');
This method accepts an optional callback which is called when an error occurs, or when the transfer is complete. By default failures call next(err), however when a callback is supplied you must do this explicitly, or act on the error.
response.sendfile(path, function(err){ if (err) { next(err); } else { console.log('transferred %s', path); } });
Options may also be passed to the internal fs.createReadStream() call, for example altering the bufferSize:
response.sendfile(path, { bufferSize: 1024 }, function(err){ // handle });
Transfer the given file as an attachment with optional alternative filename.
response.download('path/to/image.png'); response.download('path/to/image.png', 'foo.png');
This is equivalent to:
response.attachment(file); response.sendfile(file);
An optional callback may be supplied as either the second or third argument, which is passed to response.sendfile(). Within this callback you may still respond, as the header has not been sent.
response.download(path, 'expenses.doc', function(err){ // handle });
An optional second callback, callback2 may be given to allow you to act on connection related errors, however you should not attempt to respond.
response.download(path, function(err){ // error or finished }, function(err){ // connection related error });
The response.send() method is a high level response utility allowing you to pass objects to respond with json, strings for html, Buffer instances, or numbers representing the status code. The following are all valid uses:
response.send(); // 204 response.send(new Buffer('wahoo')); response.send({ some: 'json' }); response.send('<p>some html</p>'); response.send('Sorry, cant find that', 404); response.send('text', { 'Content-Type': 'text/plain' }, 201); response.send(404);
By default the Content-Type response header is set, however if explicitly assigned through response.send() or previously with response.header() or response.contentType() it will not be set again.
Note that this method end()s the response, so you will want to use node’s response.write() for multiple writes or streaming.
Redirect to the given url with a default response status of 302.
response.redirect('/', 301); response.redirect('/account'); response.redirect('http://google.com'); response.redirect('home'); response.redirect('back');
Express supports “redirect mservering”, which by default provides home, and back. The back map checks the Referrer and Referer headers, while home utilizes the “home” setting and defaults to “/”.
Sets the given cookie name to val, with options httpOnly, secure, expires etc.
// "Remember me" for 15 minutes response.cookie('rememberme', 'yes', { expires: new Date(Date.now() + 900000), httpOnly: true });
The maxAge property may be used to set expires relative to Date.now() in milliseconds, so our example above can now become:
response.cookie('rememberme', 'yes', { maxAge: 900000 });
To parse incoming Cookie headers, use the cookieParser middleware, which provides the request.cookies object:
server.use(express.cookieParser()); server.get('/', function(request, response){ // use request.cookies.rememberme });
Clear cookie name by setting “expires” far in the past.
response.clearCookie('rememberme');
Render view with the given options and optional callback fn. When a callback function is given a response will not be made automatically, however otherwise a response of 200 and text/html is given.
The options passed are the local variables as well, for example if we want to expose “user” to the view, and prevent a local we do so within the same object:
var user = { name: 'tj' }; response.render('index', { layout: false, user: user });
Render view partial with the given options. This method is always available to the view as a local variable.
as Variable name for each collection or object value, defaults to the view name.
collection Array of objects, the name is derived from the view name itself. For example video.html will have a object video available to it.
The following are equivalent, and the name of collection value when passed to the partial will be movie as derived from the name.
partial('theatre/movie.jade', { collection: movies }); partial('theatre/movie.jade', movies); partial('movie.jade', { collection: movies }); partial('movie.jade', movies); partial('movie', movies); // In view: movie.director
To change the local from movie to video we can use the “as” option:
partial('movie', { collection: movies, as: 'video' }); // In view: video.director
Also we can make our movie the value of this within our view so that instead of movie.director we could use this.director.
partial('movie', { collection: movies, as: this }); // In view: this.director
Another alternative is to “expand” the properties of the collection item into pseudo globals (local variables) by using as: global, which again is syntactic sugar:
partial('movie', { collection: movies, as: global }); // In view: director
This same logic serverlies to a single partial object usage:
partial('movie', { object: movie, as: this }); // In view: this.director partial('movie', { object: movie, as: global }); // In view: director partial('movie', { object: movie, as: 'video' }); // In view: video.director partial('movie', { object: movie }); // In view: movie.director
When a non-collection (does not have .length) is passed as the second argument, it is assumed to be the object, after which the object’s local variable name is derived from the view name:
var movie = new Movie('Nightmare Before Christmas', 'Tim Burton') partial('movie', movie) // => In view: movie.director
The exception of this, is when a “plain” object, aka “{}” or “new Object” is passed, which is considered an object with local variable. For example some may expect a “movie” local with the following, however since it is a plain object “director” and “title” are simply locals:
var movie = { title: 'Nightmare Before Christmas', director: 'Tim Burton' }; partial('movie', movie)
For cases like this where passing a plain object is desired, simply assign it to a key, or use the object key which will use the filename-derived variable name. The examples below are equivalent:
partial('movie', { locals: { movie: movie }}) partial('movie', { movie: movie }) partial('movie', { object: movie })
This exact API can be utilized from within a route, to respond with a fragment via Ajax or WebSockets, for example we can render a collection of users directly from a route:
server.get('/users', function(request, response){ if (request.xhr) { // respond with the each user in the collection // passed to the "user" view response.partial('user', users); } else { // respond with layout, and users page // which internally does partial('user', users) // along with other UI response.render('users', { users: users }); } });
Get or set the given local variable name. The locals built up for a response are serverlied to those given to the view rendering methods such as response.render().
server.all('/movie/:id', function(request, response, next){ Movie.get(request.params.id, function(err, movie){ // Assigns response.locals.movie = movie response.local('movie', movie); }); }); server.get('/movie/:id', function(request, response){ // movie is already a local, however we // can pass more if we wish response.render('movie', { displayReviews: true }); });
Assign several locals with the given obj. The following are equivalent:
response.local('foo', bar); response.local('bar', baz); response.locals({ foo: bar, bar, baz });
serverly an serverlication level setting name to val, or get the value of name when val is not present:
server.set('views', '/views'); server.set('views'); // => ...path...
Alternatively you may simply access the settings via server.settings:
server.settings.views // => ...path...
Enable the given setting name:
server.enable('some arbitrary setting'); server.set('some arbitrary setting'); // => true server.enabled('some arbitrary setting'); // => true
Check if setting name is enabled:
server.enabled('view cache'); // => false server.enable('view cache'); server.enabled('view cache'); // => true
Disable the given setting name:
server.disable('some setting'); server.set('some setting'); // => false server.disabled('some setting'); // => false
Check if setting name is disabled:
server.enable('view cache'); server.disabled('view cache'); // => false server.disable('view cache'); server.disabled('view cache'); // => true
Define a callback function for the given env (or all environments) with callback function:
server.configure(function(){ // executed for each env }); server.configure('development', function(){ // executed for 'development' only });
For use with response.redirect() we can map redirects at the serverlication level as shown below:
server.redirect('google', 'http://google.com');
Now in a route we may call:
response.redirect(‘google’);
We may also map dynamic redirects:
server.redirect('comments', function(request, response){ return '/post/' + request.params.id + '/comments'; });
So now we may do the following, and the redirect will dynamically adjust to the context of the request. If we called this route with GET /post/12 our redirect Location would be /post/12/comments.
server.get('/post/:id', function(request, response){ response.redirect('comments'); });
When mounted, response.redirect() will respect the mount-point. For example if a blog server is mounted at /blog, the following will redirect to /blog/posts:
response.redirect('/posts');
Adds an error handler function which will receive the exception as the first parameter as shown below. Note that we may set several error handlers by making several calls to this method, however the handler should call next(err) if it does not wish to deal with the exception:
server.error(function(err, req, res, next){ response.send(err.message, 500); });
Registers static view helpers.
server.helpers({ name: function(first, last){ return first + ', ' + last } , firstName: 'tj' , lastName: 'holowaychuk' });
Our view could now utilize the firstName and lastName variables, as well as the name() function exposed.
<%= name(firstName, lastName) %>
Express also provides a few locals by default:
- `settings` the server's settings object - `filename` the view's filename - `layout(path)` specify the layout from within a view
This method is aliased as server.locals().
Registers dynamic view helpers. Dynamic view helpers are simply functions which accept req, res, and are evaluated against the Server instance before a view is rendered. The return value of this function becomes the local variable it is associated with.
server.dynamicHelpers({ session: function(request, response){ return request.session; } });
All views would now have session available so that session data can be accessed via session.name etc:
<%= session.name %>
The server.lookup http methods returns an array of callback functions associated with the given path.
Suppose we define the following routes:
server.get('/user/:id', function(){}); server.put('/user/:id', function(){}); server.get('/user/:id/:op?', function(){});
We can utilize this lookup functionality to check which routes have been defined, which can be extremely useful for higher level frameworks built on Express.
server.lookup.get('/user/:id'); // => [Function] server.lookup.get('/user/:id/:op?'); // => [Function] server.lookup.put('/user/:id'); // => [Function] server.lookup.all('/user/:id'); // => [Function, Function] server.lookup.all('/hey'); // => []
To alias server.lookup.VERB(), we can simply invoke server.VERB() without a callback, as a shortcut, for example the following are equivalent:
server.lookup.get('/user'); server.get('/user');
Each function returned has the following properties:
var fn = server.get('/user/:id/:op?')[0]; fn.regexp // => /^\/user\/(?:([^\/]+?))(?:\/([^\/]+?))?\/?$/i fn.keys // => ['id', 'op'] fn.path // => '/user/:id/:op?' fn.method // => 'GET'
The server.match http methods return an array of callback functions which match the given url, which may include a query string etc. This is useful when you want reflect on which routes have the opportunity to respond.
Suppose we define the following routes:
server.get('/user/:id', function(){}); server.put('/user/:id', function(){}); server.get('/user/:id/:op?', function(){});
Our match against GET will return two functions, since the :op in our second route is optional.
server.match.get('/user/1'); // => [Function, Function]
This second call returns only the callback for /user/:id/:op?.
server.match.get('/user/23/edit'); // => [Function]
We can also use all() to disregard the http method:
server.match.all('/user/20'); // => [Function, Function, Function]
Each function matched has the following properties:
var fn = server.match.get('/user/23/edit')[0]; fn.keys // => ['id', 'op'] fn.params // => { id: '23', op: 'edit' } fn.method // => 'GET'
Assign a callback fn which is called when this Server is passed to Server#use().
var server = express.createServer(), blog = express.createServer(); blog.mounted(function(parent){ // parent is server // "this" is blog }); server.use(blog);
Register the given template engine exports as ext. For example we may wish to map “.html” files to jade:
server.register('.html', require('jade'));
This is also useful for libraries that may not match extensions correctly. For example my haml.js library is installed from npm as “hamljs” so instead of layout.hamljs, we can register the engine as “.haml”:
server.register('.haml', require('haml-js'));
For engines that do not comply with the Express specification, we can also wrap their api this way. Below we map .md to render markdown files, rendering the html once since it will not change on subsequent calls, and support local substitution in the form of “{name}”.
server.register('.md', { compile: function(str, options){ var html = md.toHTML(str); return function(locals){ return html.replace(/\{([^}]+)\}/g, function(_, name){ return locals[name]; }); }; } });
Bind the server to the following events: onClick, onSubmit and onPopState which means that it will intercept clicking of links and submitting of forms and also the back and forward actions. server.listen() also triggers the loading of the configuration functions after the DOM is loaded.
server.listen();


Shadan College Of Engineering & Technology
Permitted by Govt.of TS, Approved by AICTE, and affiliated to JNTU Hyderabad.)
Peerancheru, HimayathSagar Road, Hyderabad, TS, India.
Home
Admin Login
Department Login
Student Login
Campus Life
About Us
Contact Us
Contact Us
Name
Contact
Email
Message/Compliant/Feedback


| Path: | README |
| Last Update: | Wed Jul 30 21:54:07 -0700 2008 |
merb-action-args
A plugin for the Merb framework that provides support for arguments to actions that come in from the query.
{{[ class Foo < Merb::Controller
def bar(baz) bar end
end ]}}
Hitting "/foo/bar?baz=bat" will call foo("bat").
Hitting "/foo/bar" will raise a BadRequest (Status 400) error.
{{[ class Foo < Merb::Controller
def bar(baz, bat = "hola") "#{baz} #{bat}" end
end ]}}
Hitting "/foo/bar?baz=bat" will call foo("bat", "hola")
Hitting "/foo/bar?baz=bat&bat=whaa" will call foo("bat", "whaa")
Hitting "/foo/bar" will still raise a BadRequest.
{{[ class Foo < Merb::Controller
def bar(one, two = "dos", three = "tres") "#{one} #{two} #{three}" end
end ]}}
The interesting thing here is that hitting "/foo/bar?one=uno&three=three" will call foo("uno", "dos", "three"). In other words, the defaults can be in any order, and merb-action-args will figure out where to fill in the holes.


Speed Limit Alertness App - Test data Control
Set car speed
0
Set road speed limit
0
0
200
National Highway
Service Road
City Limits
State Highway


Home
About
Dates
Succes stories
Register
username
E-mail
Password
Age
Gender
Male
Female
Secret
Already have an account?
login


Current Projects
Project Name
Project Stage
Project Description
Current employees
First Name
Last Name
Email


| Interface | Description |
|---|---|
| FiniteFieldInteger<E> |
| Class | Description |
|---|---|
| Array | |
| ByteClassLoader | |
| ClassUtils | |
| ClassUtils.RefCounter | |
| Distribution<T> |
Distribution represents a probability-weighted collection of
objects.
|
| Exceptions | |
| Files | |
| FiniteFieldInteger32 | |
| FJ |
FunctionalJava utility methods
|
| Functional | |
| Functional.DeferredF<S,T> |
Defer the execution of f(s) until call() is called
|
| FunctionalReflection | |
| ImmutableIterator<T> |
Iterator interface for iterators that do not support the remove
operation
This exists only for convenience --- one less stub to throw
UnsupportedOperationException when you're writing an iterator class that
can't remove.
|
| KryoUtil | |
| Launcher |
The Launcher class starts a single instance of a MiCA protocol on the
local
machine.
|
| Logging |
Contains subclasses for custom log events
Note: The "current" preferences for logging are stored in
LogFlag.currentLogMask
|
| Logging.SelectEvent | |
| Logging.StateEvent | |
| MarkingObjectInputStream | |
| Randomness | |
| Serialization | |
| SinglyLinkedRingGraph | |
| SinglyLinkedRingGraph.StaticSinglyLinkedRingOverlay | |
| StreamUtil | |
| WeakHashSet<T> |
| Exception | Description |
|---|---|
| IteratorSpentException | |
| NotFoundException | |
| NotImplementedException | |
| Randomness.EmptyCollection | |
| TooManyException |


{% extends "base.html" %} {% block app_content %}
"The Magical Number Seven, Plus or Minus Two: Some Limits on Our Capacity for Processing Information"[1] is one of the most highly cited papers in psychology.[2][3][4] It was published in 1956 in Psychological Review by the cognitive psychologist George A. Miller of Princeton University's Department of Psychology. It is often interpreted to argue that the number of objects an average human can hold in working memory is 7 ± 2. This is frequently referred to as Miller's law.
Paper {% endblock %}


Complete redesign for SoHo eyewear boutique Surreal built in WordPress. Primarily responsible for the Front-End asset presentation, worked with a designer and a back-end developer in an agile work environment to produce this sharp, distinct presentation.
Built site in conjunction with consulting on the overall rebranding initiative including production of new logo, copy, and brand colors. All work was completed within the framework of strict fiduciary responsibilities associated with the industry—requiring nuance and expert communication with the client.
Joined when project was 70% completed as a ringer to finish what other developers started, requiring a keen ability to learn others' code quickly and build off it with efficiency and rigor. Created a late game style guide to ensure consistent polish across the site and implemented various UX changes to grab new users for this promising start-up.


| name | Mark Petruska |
| phone | +36 20 312 8347 |
| petruska[dot]mark[at]gmail[dot]com | |
| github | mpetruska |
| gitlab | mpetruska |
| bitbucket | proxy |
Functional programming and crypto enthusiast, on the assignment of building a better and more honest world.
Formal methods, type theory, dependent types, theorem proving. (Proving program correctness always produces better results than testing it.)
Functional programming, functional programming and fp. :) (Yes, I'm very enthusiastic about it.)
Very strong analytic thinking. I always try to find multiple paths to solve a problem to be able to choose the best.
Dedicated teacher: teaching is part of everybody's learning process. ("If you can’t explain something in simple terms, you don’t understand it.")
Programming languages: Coq, Haskell, PureScript, Scala, F#, Ocaml, Elixir, Erlang (and anything functional really) ...
other programming languages: C#, Java, Python, R, T/SQL, C++, JavaScript
Technologies: Docker, Vagrant, Linux, Nix/NixOS, Mac, Windows, Cassandra, various sql servers (MS SQL, postgres, MySql), Edeliver, Erlang OTP, .Net framework, JVM
2022
Technologies used: Haskell, Plutus, Coq
Lead a team as we developed version 2 contracts of an already published protocol on Cardano.
2018 - 2022
Technologies used: scala, Coq, akka, mssql, kafka, docker, vagrant
Mainly worked on a finance project as a developer and mentor. Trained co-workers in basic and advanced Scala, and advanced functional programming techniques.
Introduced mathematically proven algorithms to a key area based on Calculus of Inductive Constructions.
Unshackled.com Ltd.
2016 - 2018
Technologies used: scala, akka cluster, protocol buffers, amazon web services, docker, cassandra, postgresql
As a founding member of the team, introduced akka clustering, protocol buffers, scalaz and Amazon Sqs to the project.
Also worked heavily to establish good functional programming techniques with the team, through experimenting and training/mentoring colleagues.
Cake Solutions
2015 - 2016
Technologies used: scala, akka, docker, vagrant, ocaml, java, cassandra, mongodb
Got my first functional programming position at an outsourcing company. Met some truly brilliant developers/engineers/professors and learned a lot. Quickly caught up the pace and soon I became a reliable team member.
EPAM Systems
2013 - 2015
Technologies used: C#, C++, WPF, F# (training colleagues)
While working at Epam, I truly became a master of object-oriented programming and design; although working with object-oriented code, libraries and tools always felt a little "strange" to me.
After doing a thorough research on programming paradigms and methodologies, I fell in love with functional programming. While deepening my understanding I started to also teach colleagues F# and Scala.
While I loved working at Epam, it was time for me to move on, to find positions with strong emphasis on functional programming.


Dear Customer,
Thank you for your interest in our Custom Acrylic Awards. Since each custom award is unique and handmade, we require a minimum order value of $600.00(G). If your project is less than $600.00(G), please review our online Award Catalog at this link: http://www.innovation-line.com/2-acrylic-award-line and choose from any of our stock Award shapes.
If your custom project meets the $600.00(G) minimum order requirement, please take a moment to complete the "Custom Acrylic Awards Specification Form " below. We require the Spec Sheet be completed so we can provide an accurate quote. After completing the Spec Sheet, click on the SUBMIT button below and it will automatically email to us and we'll provide a quote within 24 hours. If you want to fill out the Spec Sheet by hand, please print, scan and email it to<EMAIL_ADDRESS>Thank you again for your interest in Innovation Line's custom award division, we look forward to working with you.


(Horton)
I've been guarding this clover for over a week
Getting laughed at for thinking a dust speck can speak
Well, let them all laugh
I'll try not to mind
For I have found something that they'll never find
There are secrets on a leaf, in the water, in the air
Hidden planets, tiny worlds, all invisible
Not a person seems to know, not a person seems to care
There is no one who believes a thing I say
Well, I'm fairly certain that at one time or other
Great thinkers all feel this way
I'm alone in the universe
So alone in the universe
I found magic, but they don't see it
They all call me a lunatic, okay, call me a lunatic
If I stand on my own, so be it
Because I have wings, yes I can fly
Around the moon and far beyond the sky
And one day soon I know there will be
One small voice in the universe
One true friend in the universe
Who believes in me
(JoJo)
I'm alone in the universe
So alone in the universe
My own planets and stars are glowing
(Horton)
Alone in the universe
(JoJo)
No one notices anything
Not one person is listening
They don't have any way of knowing
(Horton)
Nobody knows THAT I have wings
(JoJo)
I have wings
(Horton)
And I can fly
(JoJo)
I can fly
(Horton)
Around the moon
(Both)
And far beyond the sky
Well someday soon
You will hear my PLEA
(Horton)
One small voice in the universe
(JoJo)
One true friend in the universe
(Both)
Please believe in me
spoken
(Horton)
Hello? Hello?
(JoJo)
Hello? (GASP)
(Horton)
Who's there?
(JoJo)
It's me, JoJo, the mayor's son!
(Horton)
Oh, I'm Horton, the elephant.
(JoJo)
Are you real, or are you a very large think?
(Horton)
Oh I'm real all right, I would state that in ink.
(JoJo)
In my thinks, I imagine a lot of strange things,
And I go to strange places
As if I had wings!
I love a good think!
(Horton)
Well for me that goes double.
(JoJo)
Sometimes my thinks are what get me in trouble.
(Horton)
When you think, do you dream?
(JoJo)
In bright colors!
(Horton)
Oh, me too!
And I go to strange places like Solla Sollew!
(JoJo)
When you think, do you think you can fly with the stars?
(Horton)
Oh little friend, no one else can have thinks such as ours!
sung
Yes I have wings
(JoJo)
I have wings
(Horton)
And I can fly
(JoJo)
I can fly
(Horton)
Around the moon
(Both)
And far beyond the sky
(Horton)
You called my name and you set me free
One small voice in the universe
(JoJo)
One true friend in the universe
(Both)
Who believes in me
spoken
(Horton)
Good night, JoJo.
(JoJo)
Good night Horton, see you in Solla Sollew...


|
JNIPort for Dolphin Smalltalk |
|
|
Back to Goodies |
JNIPort and JVMsThis section is about which JVMs JNIPort has been tested against. I have tried no other JVMs at all. Each JVM implementation comes with its own way of locating the runtime (since Sun didn't even bother to set up a decent convention, let alone a proper specification, for how to do this). The corresponding subclasses of JNILibrary differ only in that they understand the different vendors' conventions. If you explicitly specify the location of the JVM DLL in the configuration, then the conventions are ignored and there is no effective difference between the versions of JNILibrary. If you try another JVM implementation then please do let me know how you get on. Note that JNIPort requires an implementation of JNI that is compatible with (at least) the 1.2.x release from Sun. Sun JVMsI've used the Sun JVMs almost exclusively as I've been writing JNIPort. It really requires a 1.4.x version of the JVM to work fully. The 1.3.x series also worked when I last used them, but there were a few bugs. I can't remember exactly what; I think there were some problems with accessing static fields inherited from interfaces. Also the -verbose:jni option caused the JVM to issue thousands of warnings about exceeding the capacity of the local pool (the warnings were wrong, but irritating nonetheless). A very early version of JNIPort was based on 1.2.x, but there were endless problems and instabilities — the problems were mostly with Sun's code (their floating-point handling), but it might be that current JNIPort, and a recent Dolphin VM, could be made to work with it. The Sun JVM's have always had a problem with floating point exceptions. The picture has improved over time, partly because Sun have worked on the problems, but also because, since version 5, Dolphin now suppresses floating point underflow errors by default (it was always intended to, but the default was set wrongly). The Sun JVM seems to require that both underflow and overflow exceptions are turned off or else it fails intermittently on floating point operations that generate the error. To turn off overflow trapping, execute this Dolphin code:
The constant, IBM JVMsI've tested briefly against the IBM JVM for Windows. It seems to work OK. There are a couple of bugs in the JVM that show up in the regression tests, but these are because of a really obscure part of the JVM semantics that IBM have got wrong. It shouldn't affect anything in practice. The most recent IBM version that I've tried is 1.3.x, so there may be a later version with the bug fixed. Since the IBM implementation for Windows seems to be based on Sun's code, it shares the same irritating tendency to witter on about the local pool. I haven't tested extensively, but it appears that the IBM JVM does not share Sun's problems with floating point exceptions. BEA JVMs (JRockit)
I've tested briefly against version 7 of the JRockit JVM from BEA Weblogic. It almost
works, but there is a nasty bug in their implementation of
With the patch, the picture is very much the same as with IBM. There are a couple of obscure bugs and incompatibilities with Sun's JVM, but nothing very major. The BEA JVM appears to suffer from the same floating point failures as Sun's. Only worse — the failure crashes Dolphin rather than simply aborting the Java runtime. |
Copyright © Chris Uppal, 2003-2005
Java, JNI (probably), JVM (possibly), and God knows what else, are trademarks of Sun Microsystems, Inc.


| Class and Description |
|---|
| com.github.xemiru.sponge.boxboy.button.ToggleButton
This version of a ToggleButton was designed in a very confusing way when put to use -- the confusion
being caused by the decision to let the underlying action buttons have their action activated when
becoming the new state instead of when being changed from. As a result, this button is considered to have
"inverted" behavior. Though this button implementation remains completely functional as intended, it is
recommended to use
SwitchButton instead. |
| Method and Description |
|---|
| com.github.xemiru.sponge.boxboy.util.MenuPattern.apply(Menu, boolean)
Underscores can now be used to represent slots that should forcibly be emptied.
MenuPattern.apply(Menu)
can be used after giving the pattern underscores instead. |
| com.github.xemiru.sponge.boxboy.button.Button.isAnimated()
While still usable for special implementations of non-static representatives through the use of
Button.getRepresentative() , it is recommended to implement Button.getAnimatedRepresentative()
instead. |
| com.github.xemiru.sponge.boxboy.button.ToggleButton.of(ActionButton, ActionButton)
see
ToggleButton |
| com.github.xemiru.sponge.boxboy.button.ToggleButton.of(ActionButton, ActionButton, boolean)
see
ToggleButton |


Tag handlers should contain logic, performing whatever processing and calculation needed. On the other hand, templates should contain static string for generated HTML and JavaScript. The templates should not contain complicated logic. Configurable values should not be specified in the template, they should go to the properties file.
An object may be used as a tag handler's instance variable for holding
states (set via the setter methods) only if its state never changes once
the setters have all been invoked. Otherwise, temporary instance variables
should be used in its place. Inside doStartTag()
(or
doEndTag()
, etc), information is transferred from the
temporary variables to initialize the original object's states. This
avoids bugs due to reuse of tag handlers.


Your application will be processed within 10 working days.
If we need any further information or additional evidence we will contact you by email.
Your actual payment won't be made until your University confirms you have a capped place.


From our meetups
Sorry, there was a problem loading data from Imgur. Please try again later.
View more photos on Imgur.


@JvmField protected val commandUniques: CommandMap
The mutable map which maps unique name identifier strings to the respective command, for all commands.


Message
element
should not contain HTML
Explanation
This value appears to contain HTML markup. Be advised that clients will behave unpredictably in the presence of such markup: some will interpret it as HTML, others will strip it, and still others will display the markup itself.
Solution
Consider removing the markup.
If the purpose of the markup is to escape the use of an HTML entity, use this table to find the Entity Number to replace the escaped version of the Entity Name. For example:
©
becomes:
©
Encoding of the characters "&"
and "<"
are especially problematic in places like RSS 2.0 titles. For the widest
interop, the
RSS Profile
recommends the use of the hexadecimal character reference
"&
" to represent "&
" and
"<
" to represent "<
".
Not clear? Disagree?
You might be able to find help in one of these fine resources.


This code is hereby placed in the public domain.
Please send comments, suggestions, and bug reports to<EMAIL_ADDRESS>This is a simple Lua library for packing and unpacking binary data.
The library adds two functions to the string
library: pack
and unpack
.
Prototype:
ret = pack( F, x1, x2, ... )
Description:
Packs binary data into a string.
Parameters:
F
A string describing how the values
x1, x2, ...
are to be interpreted and formatted. Each letter in the format stringF
consumes one of the given values. The letter codes understood by pack are listed below (they are inspired by Perl's codes but are not the same). Numbers following letter codes inF
indicate repetitions.
x1, x2, ...
Values to pack into binary. Only values of type number or string are accepted.
Returns:
ret
A (binary) string containing the values packed as described in
F
.
Prototype:
val, next = unpack( s, F [,init] )
Description:
Packs binary data into a string.
Parameters:
s
A (binary) string containing data packed as if by pack.
F
A format string describing what is to be read from
s
init
An optional init marks where in
s
to begin reading the values.
Returns:
next
The first value returned by unpack is the next unread position in
s
, which can be used as the init position in a subsequent call tounpack
. This allows you tounpack
values in a loop or in several steps. If the position returned byunpack
is beyond the end ofs
, thens
has been exhausted; any calls tounpack
starting beyond the end ofs
will always returnnil
values.
val
One value per letter in
F
untilF
ors
is exhausted (the letters codes are the same as for pack, except that numbers followingA
are interpreted as the number of characters to read into the string, not as repetitions).
z
: zero-terminated string
p
: string preceded by length byte
P
: string preceded by length word
a
: string preceded by length size_t
A
: string
f
: float
d
: double
n
: Lua number
c
: char
b
: byte (unsigned char)
h
: short
H
: unsigned short
i
: int
I
: unsigned int
l
: long
L
: unsigned long
<
: little endian
>
: big endian
=
: native endian


{% extends "frame.html" %} {% load sleep_tags %} {% block content %}
Join groups to see them here!
Create a group here.


Next: 5 Variables
Up: 1 Language definition
Previous: 3 Literals
Contents
A constant declaration introduces a name which
has a constant value throughout its scope. When the type is omitted
the constant has a SDWORD type. A single constant declaration
can introduce a number of constants of the same type.
CONST [type[*cexpr]] identifier [ '[' cexpr ']' ]
{ '=' cexpr | = '{' cexpr1[, cexpr2,...]'}' | = '"' cexpr '"'}
[ , identifier2...]
- CONST
- denotes the beginning of a constant definition clause.
- type[*cexpr]
- Defines the type of the constant. If none is
given, the constant becomes universal type which is 32 bit signed
(SDWORD).
- '[' cexpr ']'
- Defines a constant table .
A constant table will not take any space unless it is indexed at least
once with a non-constant subscript. On the PIC, constant tables consume
code space, not data space, and are limited to 255 elements.
- '=' cexpr
- For non-table constants this assigns the value to the
constant.
- '=' '{' cexpr1[, cexpr2 ...] '}'
- For tables of constants
this assigns the value to each element. There must be the same number
of cexprs as there are elements defined.
-
-
- '''' cexpr ''''
- A string constant can be assigned to
a constant table:
const byte x[] = "hello"
.
Example:
const byte cr = 0x0D, lf = 10 -- byte constants
const word cr = 1492 -- word constant
-- Literal (SDWORD) constant
const seconds_per_day = 60 * 60 * 24
-- constant table
const byte mytable[5] = {"M","2",24,1,43}
-- String constant table
const byte zz[] = "Hello"
-- Extended type constant
const byte*3 my_pointer = 0xFFCC00
Footnotes
- ...
- See section 1.6.1 sub:Constant-tables
Next: 5 Variables
Up: 1 Language definition
Previous: 3 Literals
Contents
pJAL Manual.
(c) 2006 Javier Martinez, Vasile Surducan and Dave Lagzdin.


This is in reponse to the ask Erowid question:
I've read that anti-depressants influence your trip on shrooms, however I haven't heard anything about Prozac in particular. Does anyone know how it would affect a mushroom experience?
I was taking these three antidepressants, in that order, over a period of two years. About 6 months for Effexor, 6 months for Prozac, and a year for Zoloft. With each I raised my dosage along with my doctors help until I reached the so-called 'high dose'. I reached the conclusion that with each antidepressant the results from mixing other chemicals stayed the same. I also must add I reached a euphoria with Effexor unlike the kind I felt when I was taking Prozac/Zoloft, which I quickly seemed to build tolerance to, then quit.
MDMA / Methamphetamines / Cocaine: I found that when taking these uppers, the experience seemed to take on new extremities. First, the Euphoria was much more intense, much stronger than when not mixed with SSRIs [Erowid Note: this is the opposite of what is generally reported]. Then, when the come-down hit, it would make me feel like I was going insane. Not like when I came down normally, this was a feeling of much greater helplessness and deprivation of ego.  For example, when I was on Prozac, and would do Crystal Meth, maybe for 1-2 days straight, during my come down I couldn't keep quiet, period. Not that I was just tweaking and couldn't keep my mouth shut, but I wasn't even realizing what I was saying, I was just blabbering on and on (with my friends there or alone), I was delirious.
I am sure that these effects were because I was on high doses of SSRIs. I do not recommend mixing these compounds only because they both effect your neurotransmitters tremendously and I cannot think of a beneficial result from it.
LSD: As always, LSD was a puzzling, mind-blowing experience. I was dropping a lot while on each kind of SSRI, maybe go through a vial in a week every 3 weeks. But it seemed much different...
At low - moderate dosage: With SSRIs the trip's intensity seemed to decrease, the visual patterns that you get seemed to lose their edges.  The visuals seemed to subside into much more handalable patterns, ones that would not petrify or 'trip' me out. These trips were very enjoyable and could be taken anywhere and experienced in any way. What I mean is that normally when I took LSD I would be scared/very nervous to go to a place with a lot of people, with SSRIs the thought of it didn't bother me nearly as much. Unfortunately, not the same can be said about high-extremely high dosage.
High-Extremely high dosage: This is where things got quite a bit crazy. This is a close description of the plateus when going from high to extremely high doses.
1) Memory SHOT. None whatsoever... .5 - 1 second recollection of time. Picture frames is all that ones concousness experiences at this point. To say the least, it drove me crazy.
2) Not in any control of my actions, I seemed to take on another dimension of concousness where whatever comes into your mind you not only know to be true but are absorbed in its reality. The mind races from subject to subject but can't make sense of any of it, the best you can do is try not to hurt yourself or anyone else.
3) Complete possesion by the acid, no memory of who you are, or who you were. Whatever you see or hear is all you will ever know... not a good state to be in. Not even your friends can talk you out of this state.
Once when I took about 8 paper tabs, and I was taking about four pills of Zoloft daily. Me and a friend were in my car, smoked a few bowls, then thats pretty much all I can remember thinking. I flipped out in my car. The acid was real good, because my friend who was with me (who takes no SSRIs) just looked up at the sky, mumbled something, then spun around a few times just before collapsing and rolling a few feet, blacking out. I was so out of it I didn't even notice. I was busy thinking about whatever the hell it was that I was thinking about (people that take LSD know exactly how hard it is to put trips into words).  It wasn't a very pleasant trip...
Mushrooms: Although I had not mixed this with SSRIs as many times as I may have wished, I do recall a few experiences. From what I remember, it did not seem to have a strong effect on my trip, maybe a little, but not enough to notice or mind. If anything, like in when mixing LSD, the effect can give you a happier, more peaceful trip versus a sad / scary trip.
PCP: Unfortunately I have no control to basis this one because I only smoked PCP while on SSRIs, but I must say I noticed I was having a much better time than all of my friends. The trip was pleasant and had EXTREME-numbing and euphoria. It stayed with me 3-4 days after smoking, and I have to say the period in which I smoked PCP (about a month) was one of the most enjoyable and intresting times of my life. It was non-stop fun...
I no longer take antidepressants, probably because of the side effects and the way they make me feel. All of this mixing made the feeling of just being on SSRIs very crazy and intolerable. I do not recommend taking SSRIs with anything, or at least not taking the medication the day of the trip, but that's just my 2 cents. I hope this information was helpful, have a good trip!
Experience Reports are the writings and opinions of the individual authors who submit them.
Some of the activities described are dangerous and/or illegal and none are recommended by Erowid.


I'm programming on this platform for almost 4 years. In love with google technologies and material design. I can also build iOS app when using Flutter framework.
When I have to, I will also create my restful web service, in PHP using Silex, or in Java using Jax-RS. I'm also familiar with some Javascript web frameworks, such as Koa.
I like creating and prototyping the design of my own apps, and Sketch is the tool to go for me.
I can also create cross platform 2D mobile games, using libGDX or Unity.
Android developer


FIRST AID RESEARCH ZINC OXYDE PLUS - menthol and zinc oxide ointment
TAI GUK PHARM. CO., LTD.
Disclaimer: Most OTC drugs are not reviewed and approved by FDA, however they may be marketed if they comply with applicable regulations and policies. FDA has not evaluated whether this product complies.
Active ingredients Purpose
Menthol 0.44% .......................................................................External analgesic, first aid antiseptic
Zinc Oxide 20% .....................................................................Skin protectant/moisture barrier
Uses
Keep out of reach of children.
In case of accidental ingestion contact a physician or Poison Control Center immediately.
Directions
Other information
|
FIRST AID RESEARCH ZINC OXYDE PLUS
menthol and zinc oxide ointment | ||||||||||||||||||||
| ||||||||||||||||||||
| ||||||||||||||||||||
| ||||||||||||||||||||
| ||||||||||||||||||||
|
| Labeler - TAI GUK PHARM. CO., LTD. (631101656) |
| Registrant - UNITED EXCHANGE CORP. (840130579) |
| Establishment | |||
| Name | Address | ID/FEI | Business Operations |
|---|---|---|---|
| TAI GUK PHARM. CO., LTD. | 631101656 | manufacture |


DORSCON
Orange
Confirmed
{{current.confirmed}}
Recovered
{{current.recovered}}
Deaths
{{current.deaths}}
No news yet
{{news.title}} - {{news.source.name}}


this collaborative project was designed using html and Bootstrap. It was Charlie's first project with css; His Objectives were to familiarize himself with Botstrap as well as experiment with how his own Stylesheets interacted with Bootstraps CSS.Lorem ipsum dolor, sit amet consectetur adipisicing elit. Tenetur ipsam delectus, sunt molestias ipsum, expedita quaerat, dicta architecto cupiditate nulla numquam quidem earum deleniti voluptate aliquam ab nobis commodi cum.
This Was charlie's first attempt at an HTML website. The objectives were to utilize various different tags as well as link HTML pages together. Lorem ipsum dolor, sit amet consectetur adipisicing elit. Tenetur ipsam delectus, sunt molestias ipsum, expedita quaerat, dicta architecto cupiditate nulla numquam quidem earum deleniti voluptate aliquam ab nobis commodi cum.
This project was one of the first forays in HTMl for Charlie. The content reflects his love for his puppy but more importantly provided Charlie with a chance to practice his basic HTML skills. Lorem, ipsum dolor sit amet consectetur adipisicing elit. Possimus at sed odit, tenetur magnam sequi unde qui et provident facere recusandae magni a temporibus tempora quo incidunt autem, non id?


The Lost Gods of Easter Island
The Lost Gods of Easter Island is a TV movie starring David Attenborough. A simple, carved figure bought at an auction in New York leads David Attenborough on a global journey from Russia to Australia, from England back to the...


IRIS is an inter-college cultural festival. It is held annually in the month of February/March. A galaxy of events is held ranging from cultural to literary, gaming, management and marketing.
SFIT ensures all-round development of the students of the college through the various inter-college and intra-college events the best of which is the cultural festival IRIS.
IRIS is the annual college cultural festival normally held in the even semesters. It is organized by the student body of the college with enormous zeal and enthusiasm. It is a channel through which students inculcate and sharpen their hidden skills like organization, management, administration and so on. It is a platform on which students bloom into entrepreneurs.
IRIS was first organized in 2002 and it has been a college trend since then on a grand scale. The main events being
Performing arts
• Literary events
• Fine arts
• Gaming
• Glow-Night
• Rock Show
• DJ Night


These instructions are for *nix platforms. We also have Windows instructions
You can run the tests by calling the path_to_enlightenment.rb file.
In your terminal, while in the ruby_koans directory, type:
[ ruby_koans ] $ ruby path_to_enlightenment.rb
In test-driven development (TDD) the mantra has always been red: write a failing test and run it, green: make the test pass, and refactor: look at the code and see if you can make it any better.


You can find us at two different locations in Wellington.
Wellington Railway Station, Bunny Street, Pipitea, Wellington, 6011
<EMAIL_ADDRESS>+64 4 472 8430
4 Majoribanks Street, Mount Victoria, Wellington, 6011
<EMAIL_ADDRESS>+64 4 384 2630
We offer FREE consultation on all shoe alterations. We resole, re-heel or repair zips on all types of shoes and boots for men and women! We also offer specialist jobs on boot and shoe repairs including shortening or widening of your boots!
We stock a wide range of shoe accessories including brushes, polishes and creams! We also have a wide selection of soles, heels and leather swatches to suit any repair job for both men and women! In addition we stock a wide range of shoe care products.
We repair wheels, handles, side catches, towing handles, zip locks, combination locks, snaps and hinges on all makes and models. We can also repair cracks in plastic cases and stitch nylon plastic bags! We have a range of suitcases, cabin bags, laptop bags, sling bags, purses, luggage bags and padlocks to purchase in store!
We specialise in alterations of all types of clothes including shirts, trousers, dresses and blouses. We also specialise in indian clothing tailoring from blouses, Gaghras, Cholis, Salwar Kameez, Kurtas and Sherwanis to dresses for boys and girls!
We sell a wide range of key rings, tags, remotes and have a large selection of keys to suit all needs and uses.
We are capable of handlng all your key duplication needs, both private and corporate. We also cut car keys and programme them at our site.
We are collection agents for Dry Cleaners. Clothes returned the same day if dropped before 9 am.
We sell and replace your watch battery.
We also sell electrical power adapters, wallets and belts.
We repair leather goods, jacket lining and zip replacements.
Send us and email by filling out the form below and we will get in touch with you.


| Module | AesShared |
| In: |
lib/ruby-aes/aes_shared.rb
|
# File lib/ruby-aes/aes_shared.rb, line 23 23: def decrypt_blocks(buffer) 24: raise "Bad block length" unless (buffer.length % 16).zero? 25: pt = "" 26: block = "" 27: buffer.each_byte do |char| 28: block << char 29: if block.length == 16 30: pt << decrypt_block(block) 31: block = "" 32: end 33: end 34: pt 35: end
# File lib/ruby-aes/aes_shared.rb, line 55 55: def decrypt_buffer(buffer) 56: pt = "" 57: block = "" 58: buffer.each_byte do |char| 59: block << char 60: if block.length == 16 61: pt << decrypt_block(block) 62: block = "" 63: end 64: end 65: if block.length != 1 66: raise 'Bad Block Padding' 67: elsif (c = block[-1]).zero? 68: pt 69: else 70: if block * c == pt[-c..-1] 71: pt[0..-c-1] 72: else 73: raise "Bad Block Padding" 74: end 75: end 76: end
# File lib/ruby-aes/aes_shared.rb, line 9 9: def encrypt_blocks(buffer) 10: raise "Bad block length" unless (buffer.length % 16).zero? 11: ct = "" 12: block = "" 13: buffer.each_byte do |char| 14: block << char 15: if block.length == 16 16: ct << encrypt_block(block) 17: block = "" 18: end 19: end 20: ct 21: end
# File lib/ruby-aes/aes_shared.rb, line 37 37: def encrypt_buffer(buffer) 38: ct = "" 39: block = "" 40: buffer.each_byte do |char| 41: block << char 42: if block.length == 16 43: ct << encrypt_block(block) 44: block = "" 45: end 46: end 47: c = "\000" 48: if (m = 16 - block.length % 16) != 16 49: c = m.chr 50: ct << encrypt_block(block << c * m) 51: end 52: ct << c 53: end


Nurse Betty (2000) 4 stars out of 4. Starring Renee Zellweger, Morgan Freeman, Greg Kinnear and Chris Rock. Screenplay by John C. Richards & James Flamberg. Story by Richards. Directed by Neil LaBute. Rated R.
Sometimes a movie comes along that is so special, so out of the ordinary that you want to embrace it as tightly as a long-lost relative.
Such a film is "Nurse Betty," a whimsical fairy tale as fragile and spunky as its heroine. It is a movie with Oscar contender stamped all over it.
Betty Sizemore (Renee Zellweger) is a sweet, young woman, a waitress in the Tip Top, a small restaurant in Fair Oaks, Kan. She is married to Del, a used car dealer with all the stereotypical vices associated with those in that maligned profession.
Betty's one vice is her addiction to the soap opera "A Reason to Love," and her devotion to its hero, Dr. David Ravell.
One night, while in another part of the house watching a tape of her soap, Del is in the living room negotiating a shady business deal with two men, Charlie (Morgan Freeman) and Wesley (Chris Rock). The pair turn out to be hitmen who dispatch Del because he stole a package belonging to their employer.
The brutality of the situations sends Betty into a fantasy world in which she believes she is the long-lost fiancÚ of famous heart surgeon Dr. David Ravell, and she decides to drive to Los Angeles to find him and rekindle their relationship.
So, Betty packs her bags and hops into a Buick LeSabre taken from her late husband's car lot and drives off. Coincidentally, and unknown by Betty, the item Charlie and Wesley seek is secreted in the car.
Thus, while Betty begins her odyssey to L.A., Charlie and Wesley set forth on one of their own seeking clues to the whereabouts of the elusive woman.
Once in the land of dreams, Betty transforms herself into Nurse Betty, gets a job at a hospital, makes a friend and acquires a roommate at the same time, and begins her quest to find her Dr. David.
Fate is kind, and Betty comes face to face with her dream lover. In a scene reminiscent of Peter Sellers' "Being There," Betty begins quoting dialogue from old episodes of "A Reason to Love" to Dr. David, actually actor George McCord (Greg Kinnear), who believing she is a determined actress seeking a role on the soap, plays along as Dr. David.
That is about as much of the plot as I care to reveal without spoiling the rest of this Capraesque story. Let us just say that Betty fulfills her dreams.
One of the ironies of "Nurse Betty" is that it is directed by Neil LaBute, who helmed such cynical offerings as "In the Company of Men" and "Your Friends & Neighbors." "Nurse Betty" does not quite seem the material for a director who has such a bleak outlook on the human condition.
But LaBute pulls it off. He treats Betty with love and respect, neither mocking nor criticizing her mental state.
This is not to say the movie is light fare. It has an edge and LaBute stages some harrowing scenes of violence.
As Betty, Zellweger gives an outstanding performance. Within the parameters of her manufactured world she acts rationally, sanely and with utter conviction. She tightropes that thin line between sanity and psychosis with the aplomb of a veteran acrobat. I rooted for her, wanting to see her achieve happiness.
Zellweger's performance is charming. It is a turn that could - and should - bring her an Academy Award nomination if not the statue itself.
Freeman's performance is wonderfully smart and controlled. As a veteran hit man who takes pride in his work, he gradually falls in love with Betty as he tracks her across the country.
Freeman is one of those actors who elevates weak material merely by his presence. Presented with well-written material as in "Nurse Betty," his work is stellar, whether it be lecturing his partner, Wesley, about the lack of work ethic in the country, or musing about Betty and wondering what kind of woman she really is. This is another possible Oscar contender.
Kinnear also does sterling work as the soap opera star caught up in Betty's fantasy. Kinnear has the difficult task of playing an actor acting on a soap opera. And, when with Betty, he must, as George, act in character as David. He captures the self-centeredness of the actor perfectly.
Rock is all hair-trigger impatience and attitude as Wesley.
"Nurse Betty's" script, with a screenplay by John C. Richards and James Flamberg, based on a story by Richards, is delicious with its double meanings and cultural insights.
"Nurse Betty" is like an oasis in a cinematic desert. Finally, finally, a movie that I can recommend without hesitation has reached the theaters. "Nurse Betty" is a must-see experience, a winning trifecta of acting, writing and directing.
Bob Bloom is the film critic at the Journal and Courier in Lafayette, IN. He can be reached by e-mail at<EMAIL_ADDRESS>or at<EMAIL_ADDRESS>Reviews by Bloom can be found posted on the Internet Movie Database at: http://www.imdb.com/M/reviews_by?Bob+Bloom
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


| Number of Classes | Line Coverage | Mutation Coverage |
|---|---|---|
| 15 | 62% | 49% |
| Name | Line Coverage | Mutation Coverage |
|---|---|---|
| AbstractBagDecorator.java | 64% |
70% |
| AbstractMapBag.java | 72% |
56% |
| AbstractSortedBagDecorator.java | 38% |
25% |
| CollectionBag.java | 95% |
79% |
| CollectionSortedBag.java | 95% |
75% |
| HashBag.java | 100% |
50% |
| PredicatedBag.java | 36% |
17% |
| PredicatedSortedBag.java | 43% |
20% |
| SynchronizedBag.java | 14% |
10% |
| SynchronizedSortedBag.java | 25% |
20% |
| TransformedBag.java | 17% |
6% |
| TransformedSortedBag.java | 21% |
8% |
| TreeBag.java | 48% |
38% |
| UnmodifiableBag.java | 26% |
33% |
| UnmodifiableSortedBag.java | 23% |
33% |


Biography
Work Experience
|
Associate Professor May 2020 ~ Present College of Computer Science and Electronic Engineering Hunan University, China |
|
|
Visiting Researcher April 2020 ~ Present Department of Computer Science and Intelligent Systems Osaka Prefecture University, Japan |
|
|
Research Assistant Professor Jan 2018 ~ March 2020 Department of Computer Science and Intelligent Systems Osaka Prefecture University, Japan |
|
|
Visiting Scholar Host: Dr. Hisao Ishibuchi Oct 2017 ~ Nov 2017 Department of Computer Science and Engineering Southern University of Science and Technology, China |
|
|
Visiting Scholar (Joint Ph.D.) Host: Dr. Gary G. Yen Aug 2016 ~ Sep 2017 School of Electrical and Computer Engineering Oklahoma State University, USA |
Education
|
Dr. Eng. Dec 2017 Control Theory and Control Engineering China University of Mining and Technology, China |
|
|
B. Eng. Jun 2012 Electrical Engineering and Automation China University of Mining and Technology, China |
Awards
- 2016, Scholarship of Chinese Government Graduate Student Overseas Study Program
- 2018, Excellent Doctoral Thesis of China University of Mining and Technology
- 2018, Best Paper Award from the Conference on Genetic and Evolutionary Computation
- 2019, Excellent Doctoral Thesis of Jiangsu Province


DelayButtonStyle QML Type
Provides custom styling for DelayButton. More...
| Import Statement: | import QtQuick.Controls.Styles 1.4 |
| Since: | Qt 5.5 |
Properties
- control : DelayButton
- foreground : Component
- progressBarDropShadowColor : color
- progressBarGradient : Gradient
Detailed Description
You can create a custom DelayButton by replacing the following delegates:
Property Documentation
[read-only] control : DelayButton |
The DelayButton that this style is attached to.
foreground : Component |
The foreground of the button.
The progress bar is drawn here.
progressBarGradient : Gradient |
The gradient of the progress bar around the button.


The following are the notes taken when I learn Angular from this Udemy course.
You are recommended to go through the Udemy Course as it covers the fundamental of Angular with great examples.
The notes for recording what kinds of things can be done instead of teaching how to use them.
These are the temporary notes before I spend time making code snippets for each of them, like what I did for routing part.
Please refer to this.


If a primitive is a field in a class, each primitive field of a class is guaranteed to get an initial value. Here's a program that verifies this, and shows the values:
public class HelloWorld { boolean t; char c; byte b; short s; int i; long l; float f; double d; HelloWorld reference; void printInitialValues() { System.out.println("Data type Initial value"); System.out.println("boolean " + t); System.out.println("char [" + c + "]"); System.out.println("byte " + b); System.out.println("short " + s); System.out.println("int " + i); System.out.println("long " + l); System.out.println("float " + f); System.out.println("double " + d); System.out.println("reference " + reference); } public static void main(String[] args) { HelloWorld instance = new HelloWorld(); instance.printInitialValues(); } }
Data type Initial value boolean false char [ ] byte 0 short 0 int 0 long 0 float 0.0 double 0.0 reference null
You can see that even though the values are not specified, they automatically get initialized (the char
value is a zero, which prints as a space). So at least there's no threat of working with uninitialized variables.
When you define an object reference inside a class without initializing it to a new object, that reference is given a special value of null
.
constant_pool_count='007F' (127) constant_pool |001| CONSTANT_Methodref {Value='java/lang/Object.<init>:()V', HexCode='0A00260048'} ... ... === === === === === === === === === max_stack = 1 max_locals = 1 code_length = 5 code = 2AB70001B1 === === === === === === === === === 0000: aload_0 // 2A 0001: invokespecial #1 // B70001 || java/lang/Object.<init>:()V 0004: return // B1 LocalVariableTable: index start_pc length name_and_type 0 0 5 this:Lsample/HelloWorld;
Create a class containing an uninitialized String
reference. Demonstrate that this reference is initialized by Java to null
.
public class HelloWorld { // 注意，我们并没有在Constructor中对value进行赋值，它默认成为null值。 private String value; public String getValue() { return value; } public static void main(String[] args) { HelloWorld instance = new HelloWorld(); System.out.println(instance.getValue()); } }
Create a class with a String
field that is initialized at the point of definition, and another one that is initialized by the constructor.  One direct way to do this is simply to assign the value at the point you define the variable in the class. Here the field definitions in class HelloWorld are changed to provide initial values:
public class HelloWorld { boolean t = true; char c = 'x'; byte b = 47; short s = 0xff; int i = 999; long l = 1; float f = 3.14f; double d = 3.14159; Object reference = new Object(); void printInitialValues() { System.out.println("Data type Initial value"); System.out.println("boolean " + t); System.out.println("char [" + c + "]"); System.out.println("byte " + b); System.out.println("short " + s); System.out.println("int " + i); System.out.println("long " + l); System.out.println("float " + f); System.out.println("double " + d); System.out.println("reference " + reference); } public static void main(String[] args) { HelloWorld instance = new HelloWorld(); instance.printInitialValues(); } }
Data type Initial value boolean true char [x] byte 47 short 255 int 999 long 1 float 3.14 double 3.14159 reference java.lang.Object@4554617c
constant_pool_count='0083' (131) constant_pool |001| CONSTANT_Methodref {Value='java/lang/Object.<init>:()V', HexCode='0A000D004C'} |002| CONSTANT_Fieldref {Value='sample/HelloWorld.t:Z', HexCode='090027004D'} |003| CONSTANT_Fieldref {Value='sample/HelloWorld.c:C', HexCode='090027004E'} |004| CONSTANT_Fieldref {Value='sample/HelloWorld.b:B', HexCode='090027004F'} |005| CONSTANT_Fieldref {Value='sample/HelloWorld.s:S', HexCode='0900270050'} |006| CONSTANT_Fieldref {Value='sample/HelloWorld.i:I', HexCode='0900270051'} |007| CONSTANT_Fieldref {Value='sample/HelloWorld.l:J', HexCode='0900270052'} |008| CONSTANT_Float {Value='3.14', HexCode='044048F5C3'} |009| CONSTANT_Fieldref {Value='sample/HelloWorld.f:F', HexCode='0900270053'} |010| CONSTANT_Double {Value='3.14159', HexCode='06400921F9F01B866E'} |012| CONSTANT_Fieldref {Value='sample/HelloWorld.d:D', HexCode='0900270054'} |013| CONSTANT_Class {Value='java/lang/Object', HexCode='070055'} |014| CONSTANT_Fieldref {Value='sample/HelloWorld.reference:Ljava/lang/Object;', HexCode='0900270056'} ... ... === === === === === === === === === max_stack = 3 max_locals = 1 code_length = 65 code = 2AB700012A04B500022A1078B500032A102FB500042A1100FFB500052A1103E7B500062A0AB500072A1208B500092A14000AB5000C2ABB000D59B70001B5000EB1 === === === === === === === === === 0000: aload_0 // 2A 0001: invokespecial #1 // B70001 || java/lang/Object.<init>:()V 0004: aload_0 // 2A 0005: iconst_1 // 04 0006: putfield #2 // B50002 || sample/HelloWorld.t:Z 0009: aload_0 // 2A 0010: bipush 120 // 1078 0012: putfield #3 // B50003 || sample/HelloWorld.c:C 0015: aload_0 // 2A 0016: bipush 47 // 102F 0018: putfield #4 // B50004 || sample/HelloWorld.b:B 0021: aload_0 // 2A 0022: sipush 255 // 1100FF 0025: putfield #5 // B50005 || sample/HelloWorld.s:S 0028: aload_0 // 2A 0029: sipush 999 // 1103E7 0032: putfield #6 // B50006 || sample/HelloWorld.i:I 0035: aload_0 // 2A 0036: lconst_1 // 0A 0037: putfield #7 // B50007 || sample/HelloWorld.l:J 0040: aload_0 // 2A 0041: ldc #8 // 1208 || 3.14 0043: putfield #9 // B50009 || sample/HelloWorld.f:F 0046: aload_0 // 2A 0047: ldc2_w #10 // 14000A || 3.14159 0050: putfield #12 // B5000C || sample/HelloWorld.d:D 0053: aload_0 // 2A 0054: new #13 // BB000D || java/lang/Object 0057: dup // 59 0058: invokespecial #1 // B70001 || java/lang/Object.<init>:()V 0061: putfield #14 // B5000E || sample/HelloWorld.reference:Ljava/lang/Object; 0064: return // B1 LocalVariableTable: index start_pc length name_and_type 0 0 65 this:Lsample/HelloWorld;
This approach to initialization is simple and straightforward. It has the limitation that every object of type HelloWorld
will get these same initialization values. Sometimes this is exactly what you need, but at other times you need more flexibility.
The constructor can be used to perform initialization, and this gives you greater flexibility in your programming because you can call methods and perform actions at run time to determine the initial values. There's one thing to keep in mind, however: You aren't precluding the automatic initialization, which happens before the constructor is entered. So, for example, if you say:
public class HelloWorld { int i; HelloWorld() { i = 7; } }
then i
will first be initialized to 0
, then to 7
. This is true with all the primitive types and with object references, including those that are given explicit initialization at the point of definition. For this reason, the compiler doesn't try to force you to initialize elements in the constructor at any particular place, or before they are used — initialization is already guaranteed.
constant_pool_count='0014' (20) constant_pool |001| CONSTANT_Methodref {Value='java/lang/Object.<init>:()V', HexCode='0A00040010'} |002| CONSTANT_Fieldref {Value='sample/HelloWorld.i:I', HexCode='0900030011'} ... ... === === === === === === === === === max_stack = 2 max_locals = 1 code_length = 11 code = 2AB700012A1007B50002B1 === === === === === === === === === 0000: aload_0 // 2A 0001: invokespecial #1 // B70001 || java/lang/Object.<init>:()V 0004: aload_0 // 2A 0005: bipush 7 // 1007 0007: putfield #2 // B50002 || sample/HelloWorld.i:I 0010: return // B1 LocalVariableTable: index start_pc length name_and_type 0 0 11 this:Lsample/HelloWorld;
public class HelloWorld { public static int staticValue; public static void main(String[] args) { System.out.println("HelloWorld.staticValue = " + HelloWorld.staticValue); } }
HelloWorld.staticValue = 0
constant_pool_count='0035' (53) constant_pool |001| CONSTANT_Methodref {Value='java/lang/Object.<init>:()V', HexCode='0A000C001D'} ... ... === === === === === === === === === max_stack = 1 max_locals = 1 code_length = 5 code = 2AB70001B1 === === === === === === === === === 0000: aload_0 // 2A 0001: invokespecial #1 // B70001 || java/lang/Object.<init>:()V 0004: return // B1 LocalVariableTable: index start_pc length name_and_type 0 0 5 this:Lsample/HelloWorld;
public class HelloWorld { public static int staticValue = 1; }
constant_pool_count='0015' (21) constant_pool ... ... |002| CONSTANT_Fieldref {Value='sample/HelloWorld.staticValue:I', HexCode='0900030012'} ... ... === === === === === === === === === max_stack = 1 max_locals = 0 code_length = 5 code = 04B30002B1 === === === === === === === === === 0000: iconst_1 // 04 0001: putstatic #2 // B30002 || sample/HelloWorld.staticValue:I 0004: return // B1
Java allows you to group other static initializations inside a special “static clause” (sometimes called a static block) in a class. It looks like this:
public class HelloWorld { public static int staticValue; static { staticValue = 1; } }
constant_pool_count='0015' (21) constant_pool ... ... |002| CONSTANT_Fieldref {Value='sample/HelloWorld.staticValue:I', HexCode='0900030012'} ... ... === === === === === === === === === max_stack = 1 max_locals = 0 code_length = 5 code = 04B30002B1 === === === === === === === === === 0000: iconst_1 // 04 0001: putstatic #2 // B30002 || sample/HelloWorld.staticValue:I 0004: return // B1
It appears to be a method, but it's just the static
keyword followed by a block of code. This code, like other static initializations, is executed only once: the first time you make an object of that class or the first time you access a static member of that class (even if you never make an object of that class).
public class HelloWorld { static String strA = "Hello"; static String strB; static { strB = "World"; } }
constant_pool_count='001C' (28) constant_pool ... ... |002| CONSTANT_String {Value='Hello', HexCode='080016'} |003| CONSTANT_Fieldref {Value='sample/HelloWorld.strA:Ljava/lang/String;', HexCode='0900060017'} |004| CONSTANT_String {Value='World', HexCode='080018'} |005| CONSTANT_Fieldref {Value='sample/HelloWorld.strB:Ljava/lang/String;', HexCode='0900060019'} ... ... === === === === === === === === === max_stack = 1 max_locals = 0 code_length = 11 code = 1202B300031204B30005B1 === === === === === === === === === 0000: ldc #2 // 1202 || Hello 0002: putstatic #3 // B30003 || sample/HelloWorld.strA:Ljava/lang/String; 0005: ldc #4 // 1204 || World 0007: putstatic #5 // B30005 || sample/HelloWorld.strB:Ljava/lang/String; 0010: return // B1
public class HelloWorld { //区别：这是用final修饰 public static final int staticValue = 1; }
constant_pool_count='0014' (20) constant_pool ... ... |006| CONSTANT_Utf8 {Value='ConstantValue', HexCode='01000D436F6E7374616E7456616C7565'} |007| CONSTANT_Integer {Value='1', HexCode='0300000001'} ... ... attributes_count='0001' (1) attributes --->|001| ConstantValue: HexCode:<PHONE_NUMBER>020007 attribute_name_index='0006' (#6) attribute_length='00000002' (2) constantvalue_index='0007' (#7)
public class HelloWorld { public static final int staticValue; static { staticValue = 1; } }
constant_pool_count='0015' (21) constant_pool ... ... |002| CONSTANT_Fieldref {Value='sample/HelloWorld.staticValue:I', HexCode='0900030012'} ... ... === === === === === === === === === max_stack = 1 max_locals = 0 code_length = 5 code = 04B30002B1 === === === === === === === === === 0000: iconst_1 // 04 0001: putstatic #2 // B30002 || sample/HelloWorld.staticValue:I 0004: return // B1
public class HelloWorld { public static final Object obj = new Object(); }
constant_pool_count='0015' (21) constant_pool |001| CONSTANT_Methodref {Value='java/lang/Object.<init>:()V', HexCode='0A00020011'} |002| CONSTANT_Class {Value='java/lang/Object', HexCode='070012'} |003| CONSTANT_Fieldref {Value='sample/HelloWorld.obj:Ljava/lang/Object;', HexCode='0900040013'} ... ... === === === === === === === === === max_stack = 2 max_locals = 0 code_length = 11 code = BB000259B70001B30003B1 === === === === === === === === === 0000: new #2 // BB0002 || java/lang/Object 0003: dup // 59 0004: invokespecial #1 // B70001 || java/lang/Object.<init>:()V 0007: putstatic #3 // B30003 || sample/HelloWorld.obj:Ljava/lang/Object; 0010: return // B1
To summarize the process of creating an object, consider a class called Dog
:
static
keyword, the constructor is actually a static method. So the first time an object of type Dog
is created, or the first time a static method or static field of class Dog
is accessed, the Java interpreter must locate Dog.class
, which it does by searching through the classpath.
笔记：先要找到ClassFile
Dog.class
is loaded (creating a Class
object), all of its static initializers are run.
Thus, static initialization
takes place only once, as the Class
object is loaded for the first time.
笔记：加载ClassFile之后，执行static initializer。
new Dog()
, the construction process for a Dog
object first allocates enough storage for a Dog
object on the heap.
笔记：创建对象时，先在heap上分配空间
Dog
object to their default values (zero for numbers and the equivalent for boolean
and char
) and the references to null
.
笔记：先将heap上分配的空间进行归零。
Within a class, the order of initialization is determined by the order that the variables are defined within the class. The variable definitions may be scattered throughout and in between method definitions, but the variables are initialized before any methods can be called — even the constructor.


REMAP_FILE_PAGES
Section: Linux Programmer's Manual (2)
Updated: 2014-05-28
Index
Return to Main Contents
NAME
remap_file_pages - create a nonlinear file mapping
SYNOPSIS
#define _GNU_SOURCE /* See feature_test_macros(7) */
#include <sys/mman.h>
int remap_file_pages(void *addr, size_t size, int prot,
size_t pgoff, int flags);
DESCRIPTION
Note:
this system call is (since Linux 3.16) deprecated and will
eventually be replaced by a slower in-kernel emulation.
Those few applications that use this system call should
consider migrating to alternatives.
The
remap_file_pages()
system call is used to create a nonlinear mapping, that is, a mapping
in which the pages of the file are mapped into a nonsequential order
in memory.
The advantage of using
remap_file_pages()
over using repeated calls to
mmap(2)
is that the former approach does not require the kernel to create
additional VMA (Virtual Memory Area) data structures.
To create a nonlinear mapping we perform the following steps:
- 1.
-
Use
mmap(2)
to create a mapping (which is initially linear).
This mapping must be created with the
MAP_SHARED
flag.
- 2.
-
Use one or more calls to
remap_file_pages()
to rearrange the correspondence between the pages of the mapping
and the pages of the file.
It is possible to map the same page of a file
into multiple locations within the mapped region.
The
pgoff
and
size
arguments specify the region of the file that is to be relocated
within the mapping:
pgoff
is a file offset in units of the system page size;
size
is the length of the region in bytes.
The
addr
argument serves two purposes.
First, it identifies the mapping whose pages we want to rearrange.
Thus,
addr
must be an address that falls within
a region previously mapped by a call to
mmap(2).
Second,
addr
specifies the address at which the file pages
identified by
pgoff
and
size
will be placed.
The values specified in
addr
and
size
should be multiples of the system page size.
If they are not, then the kernel rounds
both
values
down
to the nearest multiple of the page size.
The
prot
argument must be specified as 0.
The
flags
argument has the same meaning as for
mmap(2),
but all flags other than
MAP_NONBLOCK
are ignored.
RETURN VALUE
On success,
remap_file_pages()
returns 0.
On error, -1 is returned, and
errno
is set appropriately.
ERRORS
- EINVAL
-
addr
does not refer to a valid mapping
created with the
MAP_SHARED
flag.
- EINVAL
-
addr,
size,
prot,
or
pgoff
is invalid.
VERSIONS
The
remap_file_pages()
system call appeared in Linux 2.5.46;
glibc support was added in version 2.3.3.
CONFORMING TO
The
remap_file_pages()
system call is Linux-specific.
NOTES
Since Linux 2.6.23,
remap_file_pages()
creates non-linear mappings only
on in-memory file systems such as tmpfs, hugetlbfs or ramfs.
On filesystems with a backing store,
remap_file_pages()
is not much more efficient than using
mmap(2)
to adjust which parts of the file are mapped to which addresses.
SEE ALSO
getpagesize(2),
mmap(2),
mmap2(2),
mprotect(2),
mremap(2),
msync(2)
Index
- NAME
-
- SYNOPSIS
-
- DESCRIPTION
-
- RETURN VALUE
-
- ERRORS
-
- VERSIONS
-
- CONFORMING TO
-
- NOTES
-
- SEE ALSO
-
This document was created by
man2html,
using the manual pages.
Time: 02:54:47 GMT, September 18, 2014


Errors
Property update has failed! Check log for details.
Update property of null
Name
confirmProperty
Description
confirmProperty
Type
confirmProperty
Value


Toggle navigation
Lee Warrick
About
Portfolio
Contact
Portfolio
Dice
Hangman
Rock Paper Scissors
Clicker Game
Trivia
Connect with me


Confusion Matrix from the Original AML Training Experiment (this is a static image for reference)
In an unsupervised method such as k-eans clustering the outcome (Category) variable is not used in the training process, but rather simply to illustrate which Category most closely associates with a cluster assignment as can seen below. The numbers are the counts of companies falling into that cluster by Category name. Assignments are the cluster assignments in integer form starting at 0. We have 10 cluster assignments because we specified 10 as the number of centroids in the training process using our k-means algorithm.


Welcome to the website of the Paradixm project. This site aims to provide a no-holds-barred catalog of user interface elements, designs, and behaviors across platforms and across time.
The long-term goal of the Paradixm project is to serve as the basis for a broad-based, best-of-breed user interface vision that can accommodate users of all levels of proficiency as well as devices with varying display and interaction technologies. The very feasibility of this goal remains to be seen, but we have to start somewhere, right?
Catalog of Component Articles
The project is in a very early stage, so some articles might not yet be available.
{% for group in site.data.catalog %}
{% endfor %}