Joshua de la Bruere
{scryAnotherDay} is an R package that wraps the scryfall API. Scryfall is the leading 3rd party database for finding Magic the Gathering card data, such as printings, prices, previews, and rulings.
{scryfalleR} is currently in development and is very experimental. You can install this alpha version using devtools or remotes from this repository.
devtools::install_github("delabj/scryAnotherDay")
remotes::install_github("delabj/scryAnotherDay")
This package is very much in the alpha stages, the API may change and breaking changes will be introduced. Use at your own risk while this is still experimental. The name is likely to change to be in accordance with the Scryfall Agreement. This package is not maintained nor endorsed this R package. If you have a suggestion for a name for the package, please open an issue, or contact me directly.
In general Scryfall asks that you make no more than 10 requests per second, in addition they reccomend that you chache the data from scryfall once every 25 hours, in general though small updates are made per day, prices are only updated every 24 hours, and gameplay information like card names, Oracle text, and mana costs, are made on a significantly less frequent basis. If only looking at elements that are unlikely to update, it is encouraged that you process the data locally in your own database, and update far less frequently.
Taken from the Scryfall docs:
As part of the Wizards of the Coast Fan Content Policy, Scryfall provides our card data and image database free of charge for the primary purpose of creating additional Magic software, performing research, or creating community content (such as videos, set reviews, etc) about Magic and related products.
When using Scryfall data, you must adhere to the following guidelines:
- You may not use Scryfall logos or use the Scryfall name in a way that implies Scryfall has endorsed you, your work, or your product.
- You may not require anyone to make payments, take surveys, agree to subscriptions, rate your content, or create accounts in exchange for access to Scryfall data.
- You may not use Scryfall data to create new games, or to imply the information and images are from any other game besides Magic: The Gathering.
- If you wish to use card images, please also review our image guidelines.


Week 8 Cultural Blog - Dealing with Conflict
Dealing with conflict can be a very difficult thing and something that can leave us broken, diminished, unhappy, or disengaged from our work. But if handled well, can also help us better understand ourselves, help us grow, bring us closer together as a team, and to help us see other's view points more rapidly.
Today's blog is all about dealing with conflict and how I myself have dealt with it in the past.
The Story
I remember when I was first starting out as an IT guy and I was paired to work with a more experienced employee. We'll name this employee "Jack" for the purposes of our story.
Jack was what I like to call a "Know it all". He had an answer for everything and as the new guy I had to do it his way unless I wanted to be berated and made to do everything over again.
Jack constantly reminded me that I had no idea what I was doing and that I was a worthless employee. To make things worse he would always question why he had to tell me how to do things just because I wouldn't always do them the way he wanted them done.
Jack wasn't all bad, he got his work done and he did teach me a few things a long the way but oh how I wanted to punch him in the face most days for the way he treated me.
Over time, I disengaged from my work and found myself avoiding anything that would involve me with Jack. To make things worse, I was not the only person in the company with a problem with Jack and I was often made fun of for having to work with him.
I have to admit that I did not treat Jack very kindly in return for his behavior towards me. I was often short with him and on a few occasions I even left the room when he was talking at me in his normal "you're and idiot" tone of voice.
I even remember having to talk with our supervisor at one point when Jack made it a point to tell our supervisor that I was worthless and that he was having to do all my work. That was a fun conversation and only served to increase the conflict between the two of us.
The source of the conflict
The source of the conflict had everything to do with two things. The first was Jack's need to over state his qualifications and knowledge in a play to cover his perceived shortcomings. We all knew Jack was not the best tech and we all knew that he knew that too. His need to put me down and show off his knowledge was his way of fitting in.
The second part of the conflict was my feeling of being neglected and having a poor learning experience as the new guy. I felt cut off from the rest of the IT department due to everyone hating to work with Jack. In short, I felt like Jack was holding me back from learning and growing.
How I handled it
I will be the first to admit that I didn't handle the situation as best I could. I disengaged from my work and found excuses to avoid the conflict. I would let Jack handle the major stuff and I would tackle the small stuff that didn't require his help. I rationalized that the lack of learning from avoiding Jack was worth not having to deal with him.
I also became short with Jack. Being kind to him or getting to know him was not high on my lists of priorities and I made that well known to him.
How my actions made things worse
Most people would have said that my actions were justified. In fact several co-workers said just that. Even our supervisor said something to that effect after I had my long talk with him after Jack made it clear that I was worthless.
But my actions only served to make things worse. In avoiding the conflict I removed myself from any opportunity to resolve it. I continued to hate my job. I continued to feel the same feelings day in and day out.
Even worse, I prevented myself from helping Jack. Jack's behavior only got worse the more I avoided him. I can see now how Jack needed a friend and some validation more than he needed my avoidance and attitude.
If I could go back
Now that I'm older and I can see the situation better, I wish I could go back and be a better friend to Jack. I think Jack was the out-sider of the IT department and having a friend would have gone a long way to ground Jack and provide the validation and acceptance that he needed and wanted.
My take away
We're all human and we're all seeking validation and acceptance. Jack just didn't know the best way to go about it and I didn't know how to deal with it. Knowing yourself can go a long way to helping you understand others. To some degree I to wanted the same things Jack did. I just employed different tactics to try and achieve it. Finding that commonality can be the thing that really brings people together and strengthens us as individuals as well as teams.


|
|
Overview
Projects Using CsGL
Downloads
Screenshots
FAQ
Sourceforge Page
Forum
Mailing List
Authors
License
Links
History
|
|
- What are these DLLS?
- How do I install / deploy CsGL?
- Where did the SDL wrapper go?
- What are the differences between the original API's and the CsGL ones?
- Why does CsGL wrap
#define 's using class variables instead of enums?
- How are the various
float*, void* translated into CsGL?
-
How do I create a customized pixelformat?
How do I share display list between context?
How do I create a customized OpenGLContext?
- How to build it?
- How to use with Visual Studio .NET?
- How do I use OpenGL extensions?
- How can I manage the keyboard efficiently?
- How can I get a nice cursor for my control?
- How can I manage the mouse efficiently?
- How can I use fonts?
- What about multithreading, multiple views?
- Where did the NeHe lessons go?
- I have an uncatched exception coming from nowhere, what could I do?
- What are these DLLS?
There is 2 DLL for CsGL: csgl.dll & csgl.native.dll.
csgl.dll
is a .NET assembly providing some OpenGL class and utility. It should either
be installed with install.bat in libinstall directory or in the same
directory as your app.
csgl.native.dll is not an assembly, it's an ordinary DLL performing
some native and private work for CsGL to work. it should be in your path or in
the same directory as csgl.dll
- How do I install / deploy CsGL?
There are two flavors of the precompiled library, one in the lib
directory and another in the libinstall directory.
In libinstall the DLL is strongly named and compiled as optimized. This DLL could be installed
into the global assembly cache or distributed with your program. This DLL is recommended for the end-user.
It also come with a install.bat files. clic on it to install it.
In lib the DLL is not strongly named and is compiled with debug information. This DLL should be
in your development directory, as it is recommended for the CsGL hacker.
- Where did the SDL wrapper go?
Well, I gave it away, it was too time consuming. It can now be found at http://cs-sdl.sourceforge.net.
However, there seems to be little activity with it.
- What are the differences between the original API's and the CsGL ones?
We try to imitate the original API's as closely as possible. There are very few differences in usage.
Since C# is a modern, object-oriented language, we have also added some classes that wrap
the "loose" functions, hide pointer arithmetic, and eliminate some of the procedural aspects that
come from plain C.
- Why does CsGL wrap
#define 's using class variables instead of enums?
Simply because we found class variables to be the best imitation for
#define 's. But we additionally put them into enums for the use in the improved object-oriented classes.
- How are the various float*, void* translated into CsGL?
OpenGL, a C API often takes pointers as parameters. In order to have "safe" (without pointers) managed code
the following translation rule applies:
type* -> type[]
Two problems remain though.
- The void* cannot be translated like this.
- Sometimes OpenGL retains the pointer address.
(glColorPointer(..), glSelectBuffer(..), etc.) and a managed array could move..
To address these problems, these functions take a pointer argument (System.IntPtr) and second there is a class
CsGL.Pointers.PVoid which could allocate and return an unmoving pointer.
Though you generally use one of its child's CsGL.Pointers.PType, such as PFloat, PUInt32, etc... like this:
PUInt32 p = new PUInt32(N);
for(i=0; p.Length; i++)
p[i] = whatever();
glSelectBuffer(p.Length /*N*/, p);
-
How do I create a customized pixelformat?
How do I share display list between context?
How do I create a customized OpenGLContext?
You could choose the pixelformat when creating the OpenGLContext.
The OpenGLControl create its context in CreateContext(), override this method to return a
customized context.
When creating a context you could choose its pixel format and whith which other
context it will eventually share it's data. it's a simple 2 step creation process show
below:
protected override OpenGLContext CreateContext()
{
// choose your pixel format here
DisplayType mydisplay = new DisplayType(8, 8);
mydisplay.Flags = ...
// init your display
ControlGLContext ctxt = new ControlGLContext(this);
// here eventually display the list of available format
for(int i=0,n=ctxt.NumPixelFormat; i<n; i++)
Console.WriteLine(ctxt.GetPixelFormatAt(i));
// if one please you create with it with => ctxt.Create(mydisplay, null);
// toShare is an OpenGLContext with which ctxt share its display list, or null
ctxt.Create(mydisplay, toShare);
return ctxt;
}
- How to build it?
Well you could use the GNUmakefile provided ? If you don't have it
there is a <csgl>/src/buildcs.bat file which build
csgl.dll (double clic on it). You could
even build the instalable version with "buildcs install".
For csgl.native.dll you will at last need gcc
(http://www.mingw.org)
and you could either make it or tape:
gcc -I ../include -shared -o csgl.dll *.c -lOPENGL32 -lgdi32
strip csgl.native.dll
- How to use with Visual Studio .NET?
Well if you install it (in <csgl>/libinstall there is an instalable
version with an install.bat) you could add it in your toolbox in VS.NET and it work
just fine !...
- How do I use OpenGL extensions?
Just use them! It just works. GL.myExtensionFunction()...
You should check first if it is supported by the driver, with call like
Info.IsPresent("MyWonderfullExtension") or parse glGetString(GL_EXTENSION)
yourself, or simply check if the function is present with GL.GetProc("funcName").
It could also happen that the extension is not already implemented in CsGL, so.. generate it
with glgenerator.exe in <CsGL>extras\generator directory.
One last recommandation, remember that extensions are OpenGLContext dependant
- How can I manage the keyboard efficiently?
Well, if you too encounter some arrow key problems and other problems using the Key Events from .Net...
There is a solution! CsGL.Util.Keyboard class manages any key.
Just write a subclass or use the GetKeyState and Hook methods...
- How can I get a nice cursor for my control?
You have a nice bitmap, which could be a good mouse cursor? (like the hand in
<csgl>\examples\CS\drawimage example ?), well, just create a
Sustem.Drawing.Cursor from it with the CreateCursor(..) method in
CsGL.Util.Mouse class. Don't forget to destroy it when it's no longer
needed with the DestroyCursor(..) method. Sorry about this fussy obligation
but the Cursor class being sealed, I can't help ...
- How can I manage the mouse efficiently?
There is a CsGL.Util.Mouse class which permits you to do
anything with the mouse :-)
- How can I use fonts?
Well, I didn't manage to have wglFont/glxFont working but, using
some tricks, I created CsGL.OpenGL.GDITextureFont which do a decent job.
Take a look at <csgl>/examples/CS/gdifont.cs
- What about multithreading, multiple views?
An OpenGLContext can be current to only one thread at a time. (OpenGLContext
ensures your OpenGL calls got somewhere). So if you have a thread trying to Draw
on a view which is also drawn in the main event loop you will end up with an
"OpenGLException(..) resource already in use". There are four solutions. Use this
view only in this thread or customize the OpenGLControl code to suit your needs
or write your own using you own ControlGLContext or tag your Main() method
with [STAThread].
BTW, with multiple views/threads you would probably have multiple calls to
ctxt.Grab() (this function makes the context current), however,
this call has some perfomance cost...
- Where did the NeHe lessons go?
The examples are released as a separate package, containing the examples, their data,
and a small basecode layer, allowing you to quickly write examples/demos using CsGL.
- I have an uncatched exception coming from nowhere, what could I do?
At the end of OpenGLControl.OnPaint() there is a call to OpenGLException.Assert() which ensure all OpenGL call went
without error. This method being at the top of the hierarchy you probably can't catch it in a standart event driven
application. maybe it's a design error.
I have to think about it.
In the mean time you have 2 solution:
- override OnPaint() and put a try/catch around base.OnPaint()
- call glGetError() yourself to test & clear eventual GL error
|
|


"BOLSTER" The Hebrew word kebir, rendered “pillow” in 1 Samuel 19:13, 16, but in Revised Version marg. “quilt” or “network,” probably means some counterpane or veil intended to protect the head of the sleeper. A different Hebrew word (meraashoth’) is used for “bolster” (1 Samuel 26:7, 11, 16). It is rightly rendered in Revised Version “at his head.” In Genesis 28:11, 18 the Authorized Version renders it “for his pillows,” and the Revised Version “under his head.” In Ezekiel 13:18, 20 another Hebrew word (kesathoth) is used, properly denoting “cushions” or “pillows,” as so rendered both in the Authorized and the Revised Version.
"BOLSTER" The Hebrew word kebir, rendered “pillow” in 1 Samuel 19:13, 16, but in Revised Version marg. “quilt” or “network,” probably means some counterpane or veil intended to protect the head of the sleeper. A different Hebrew word (meraashoth’) is used for “bolster” (1 Samuel 26:7, 11, 16). It is rightly rendered in Revised Version “at his head.” In Genesis 28:11, 18 the Authorized Version renders it “for his pillows,” and the Revised Version “under his head.” In Ezekiel 13:18, 20 another Hebrew word (kesathoth) is used, properly denoting “cushions” or “pillows,” as so rendered both in the Authorized and the Revised Version.


|
Trex Run
1.12
Arcade Classic Game from Chrome Browser Exported to Minix Environment.
|
Go to the source code of this file.
Macros | |
| #define | RTC_IRQ 8 |
| #define | RTC_ADDR_REG 0x70 |
| #define | RTC_DATA_REG 0x71 |
| #define | SEC 0x00 |
| #define | MINT 0x02 |
| #define | HOUR 0x04 |
| #define | DAY 0x07 |
| #define | MONTH 0x08 |
| #define | YEAR 0x09 |
| #define | REG_A 10 |
| #define | REG_B 11 |
| #define | REG_C 12 |
| #define | REG_D 13 |
| #define | REGAP BIT(7) |
| #define | REGBM BIT(2) |
Functions | |
| int | rtc_subscribe_int (uint8_t *bit_no) |
| Subscribes and enables RTC interrupts. More... | |
| int | rtc_unsubscribe_int () |
| Unsubscribes RTC interrupts. More... | |
| uint32_t | rtc_data (uint8_t port) |
| Reads the content in the specified port. More... | |
| bool | check_bcd () |
| Checks if data is in bcd. More... | |
| void | bcd_to_bin (uint32_t *num) |
| Converts num to binary if it's in bcd. More... | |
| int | isUpdating () |
| Checks if RTC is updating. More... | |
| void | get_time (uint32_t *sec, uint32_t *min, uint32_t *hour) |
| Reads time from the RTC if it's not updating. More... | |
| void | get_date (uint32_t *day, uint32_t *month, uint32_t *year) |
| Reads date from the RTC if it's not updating. More... | |


"""
The middleware module contains functionality that is common to most (if not all) requests.
This module contains functions that performs
* authentication and
* publishing of errors to Sentry.
Performing Authentication:
Authentication is implemented using JSON Web Tokens (JWT). These tokens form part
of the OpenID Connect specification. We validation of these tokens is performed using
the PyJWT library. Care should be taken when interpreting JWTs as most of the information
is in clear-text and can easily be faked.
1. It is important to check that the token signature is legitimate. Only then can the rest of
the information in the token be trusted.
2. Even when the rest of the information can be trusted, we still need to check that the token
was issues for the correct audience (this application) and by the current issuer (the
Authentication Service).
In OIDC there are trusted and untrusted clients:
* Trusted clients are able to store a secret where it will not be exposed. An example would be
our Wagtail demo application.
* Untrusted clients are not able to store a secret. Javascript applications would be an
example of these.
Because trusted clients can share a secret with the Authentication Service, the Authentication
Service can use an HMAC-based algorithm (HS256) to sign the token. For untrusted clients, the
Authentication Service uses a public/private key pair (RS256). The token is signed using the
private key and can then be verified by another party using the public key, which is exposed
by the Authentication Service at a well-known URL for obtaining a JSON Web Token Keyset
(JWKS)::
http://core-authentication-service:8000/openid/jwks
{
keys: [
{
kty: "RSA",
alg: "RS256",
use: "sig",
kid: "1cc97496f77201c711529bd6d0159cd3",
n: "tQ02VatIRGX2ZC0bu31lxNldo57E3bW8sh...",
e: "AQAB"
}
]
}
The Management Layer is slightly different from other applications which typically only
supports a single type of token. The Management Layer needs to support both trusted and
untrusted clients. When a token is received, we can look at the headers to determine the
algorithm used to sign the token::
Unverified headers included in the token for an untrusted client.
{
'alg': 'RS256',
'kid': '1cc97496f77201c711529bd6d0159cd3'
}
Unverified headers included in the token for a trusted client.
{
'alg': 'HS256'
}
When the algorithm is "RS256" there will be a corresponding key id (kid) field, which can
be used to look up the related key parameters (see JWKS above). The public key can be
constructed from these parameters.
"""
import time
import jwt
import logging
from aiohttp.web import middleware
from aiohttp.web_response import json_response
from prometheus_client import Histogram
from management_layer import settings
from management_layer.mappings import Mappings
from management_layer.sentry import sentry
LOGGER = logging.getLogger(__name__)
INVALID_TOKEN_STATUS = 401
MISSING_TOKEN_STATUS = 400
TOKEN_PREFIX = "bearer "
TOKEN_PREFIX_LENGTH = len(TOKEN_PREFIX)
# URLs that do not require authorisation.
WHITELIST_URLS = ["/healthcheck", "/metrics"]
H = Histogram("management_layer_http_duration_seconds", "API duration",
["path_prefix", "method", "status"])
[docs]@middleware
async def metrics_middleware(request, handler):
start_time = time.time()
response = await handler(request)
H.labels(path_prefix=request.path.split("/")[1],
method=request.method,
status=response.status).observe(time.time()-start_time)
return response
[docs]@middleware
async def auth_middleware(request, handler):
authorization_header = request.headers.get("authorization", None)
if request.method == "OPTIONS":
# HTTP OPTION requests do not need a token
pass
elif request.path in WHITELIST_URLS:
# URLs that do not require authorisation
pass
elif authorization_header:
if not authorization_header.lower().startswith(TOKEN_PREFIX):
return json_response({"message": "Malformed authorization header"},
status=INVALID_TOKEN_STATUS)
jwt_token = authorization_header[TOKEN_PREFIX_LENGTH:]
try:
LOGGER.debug("JWT Token: {}".format(jwt_token.encode("utf-8")))
unverified_headers = jwt.get_unverified_header(jwt_token)
algorithm = unverified_headers["alg"]
if algorithm == "HS256":
payload = jwt.decode(
jwt_token,
key=settings.JWT_SECRET,
algorithms=[settings.JWT_ALGORITHM],
audience=settings.JWT_AUDIENCE,
options={
"verify_aud": True
}
)
elif algorithm == "RS256":
key_id = unverified_headers["kid"]
key = Mappings.public_key_for(key_id)
payload = jwt.decode(
jwt_token,
key=key,
algorithms=[algorithm],
audience=settings.JWT_AUDIENCE,
options={
"verify_aud": True
}
)
else:
return json_response({"message": "Unsupported token algorithm: {}".format(algorithm)},
status=INVALID_TOKEN_STATUS)
LOGGER.debug("Token payload: {}".format(payload))
except jwt.DecodeError as e:
return json_response({"message": "Token is invalid: {}".format(e)},
status=INVALID_TOKEN_STATUS)
except jwt.ExpiredSignatureError:
return json_response({"message": "Token expired"},
status=INVALID_TOKEN_STATUS)
except jwt.InvalidAudienceError:
return json_response({"message": "Token audience is invalid"},
status=INVALID_TOKEN_STATUS)
except jwt.InvalidIssuerError:
return json_response({"message": "Token issuer is invalid"},
status=INVALID_TOKEN_STATUS)
except Exception as e:
return json_response({"message": "Exception: {} {}".format(type(e), str(e))},
status=INVALID_TOKEN_STATUS)
LOGGER.debug("Token payload: {}".format(payload))
request["token"] = payload
else:
return json_response({"message": "An authentication token is required"},
status=MISSING_TOKEN_STATUS)
return await handler(request)
# Based on https://github.com/underyx/aiohttp-sentry/blob/master/aiohttp_sentry
[docs]@middleware
async def sentry_middleware(request, handler):
try:
return await handler(request)
except Exception:
sentry.captureException(data={
"request": {
"query_string": request.query_string,
"cookies": request.headers.get("Cookie", ""),
"headers": dict(request.headers),
"url": request.path,
"method": request.method,
"env": {
"REMOTE_ADDR": request.transport.get_extra_info("peername")[0],
}
}
})
raise


Gold Coast lock away another key piece of future. And this one could be the most exciting yet
by Staff writersGold Coast has now re-signed all three of its 2018 top 10 Picks, with Jack Lukosius joining Izak Rankine and Ben King pledging their commitment to the club.
Lukosius, who is originally from South Australia, was speculated to return home but has instead recommitted to the Suns until 2022.
The 19-year-old played 21 games in his debut season mostly in defence, but can play in attack.
Stream over 50 sports live & anytime on your TV or favourite device with KAYO SPORTS. The biggest Aussie sports and the best from overseas. Just $25/month. No lock-in contract. Get your 14 day free trial >
He said he was looking forward to his future as a Sun.
“Over the off-season I took the opportunity to reflect on my first year at AFL level and that made making the decision an easy one, I’ve loved my time at the club so far,” Lukosius said.
“We’ve got a great group of players, who are all committing to the future of this football club and I can’t wait to be a part of it.
“The way everyone at the club has made my family and I feel welcome has definitely helped with the transition to becoming a professional footballer in the AFL.
"The challenge now is to put my head down, continue to work hard on developing my game and ensure I’m ready to play my role for the team on field in 2020."
Lukosius’ signature is a major boost for the club, who are also expected to welcome top draft prospects Matt Rowell and Noah Anderson up north in 2020.


Mengxi Food Market of Julu Foods Group / Roarc Renew
- Curated by 韩爽 - HAN Shuang
- about 4 hours
- version="1.0" encoding="UTF-8"? Architects: Roarc Renew
- AreaArea of this architecture projectArea: 1360.0 m2
- version="1.0" encoding="UTF-8"?YearCompletion year of this architecture project Year: 2019
- version="1.0" encoding="UTF-8"?PhotographsPhotographs: Freeman
- version="1.0" encoding="UTF-8"?ManufacturersBrands with products used in this architecture project Manufacturers: 境道原竹, 江苏结庐建材, 泰州澳洋道具
- Architecture and Interior Design Roarc Renew
- Lead Architect Robben BAI
- Project architect Huiqin Lu
- Design Team Leqian Xue, Qian Gu
- Construction consultant Chenghua Zhang, Jielu Decoration Company
- Bamboo material and construction Jingdao Yuanzhu
- Property owner Julu Group of Huaihai Commercial
More Specs Less Specs
Design layout
Food market renovation led by architectural layout thinking mode
What does architectural layout mean for the community?
It is a thinking mode centered on the relationship between the food market and its surrounding neighborhood.
When we were tasked with the renovation project, we were under a “strained and limited” budget, but the target cannot be compromised, which is to significantly improve the block and community environment as a whole by focusing on the renovation of the market. With this big picture in mind, we decided to focus on the renovation of the market façade while respecting the original design of the property.
We should build food markets into public open spaces for citizens rather than supermarkets. This is the belief of Roarc Renew and also a concept we explored after the renovation project of the Yongnian Food Market. As our position is clear, we started to create all the design elements with this principle in mind. Should supermarkets be regarded as public spaces? We don’t believe so. We think supermarkets are more of business premises which pursue turnover per square meter. For this kind of site, all the designs of the architectural flows and layouts are driven by the sought-after “turnover per square meter”. Then how should we define public spaces for citizens? In our view, public spaces are the activity spaces attached to a community and a “grey space” in a city.
The future urban pattern of Shanghai: "people's city people build, people's city for people." In fact, we should reasonably arrange production, life, and ecological space, and strive to expand public space, so that people can have places for fitness and entertainment, and make the city a paradise suitable for people to work and live in. In other words, the design of public spaces for citizens should not be driven by the so-called “turnover per square meter”, but be aiming at building a “comfortable and pleasant place for both working and living” for neighboring residents, which means keeping a good balance between life and business.
Therefore, we can keep the commercial attributes of the food market inside the market. But the façade facing the street is a space actively interacting with the passing citizens, which will act more like a public space. We noticed that the Mengxi Food Market has a façade stretching for almost 50m with an upward staircase leading into the market. Based on these unique physical structures, we transformed the straight-line handrail into regular curving waves.
In this way, the boundary between the market façade and the neighboring street was blurred. It also created many hollow areas functioning as the rest stops. Apart from the efforts to blur the boundary, we also spent a large amount of time observing the habits of its customers. For example, we found that some senior citizens come to play chess almost every day at the pedestrian walkways. The small hollow spaces created by the wild bamboo fences are specially designed for them and the ones who need a rest here. Accordingly, the raised space created by the walkway functions as rest sites for market customers offered by the street-side shops.
II Form of Expression
Shanghai’s food markets should have typical Shanghai elements
Similar to Wukang Road and Yongjia Road, the block on the Mengzi West Road presents a peaceful vibe and a unique styleof Shanghai. Plane trees are intersected with Art Deco villas at the roadsides, forming the characteristic Shanghai lanes and the age-old bamboo fences form the authentic old Shanghai style.
The wild bamboo, a very special material, was selected as the main material for this Mengxi Food Market renovation project. From the point of design intention, the wild bamboo is a reminder of the “rural and wild theme” of the Yongnian project; while from the point of meaning, Mengxi Food Market has made one step further to give full play to the romantic “old Shanghai” style with the use of wild bamboo materials.
At the same time, the texture of wild bamboo possesses visual cues for the “rural and wild theme”. These two elements complement each other perfectly well. In terms of of construction, wild bamboo has taken root in Shanghai for several decades. It has become a symbol of “Shanghai style” and was often used as fences for villas by men of letters. As a durable material, its life in natural environment can last over 5 years after corrosion and fungus-resistant treatment.
Unlike the ordinary wild bamboo weaving pattern, this time we have tried a new pattern. While creating a whole curving surface, the details were also made interwoven in a 60 degree angle to make each bamboo joint enlarged visibly, which produces an exquisite visual delight and construction logic. The indoor shop signs also used bamboo material to inherite the use of light-weight steel wire joints from the Yongnian project, forming a unified visual style between the inside and the outside.
Rural and wild - A market with warmth
After all, we cannot deny that food markets are business premises in nature. But we still endeavored to build the food markets in Shanghai into places of exquisiteness, geniality and full of life. The reason behind is a deep longing for retaining the “humanistic” elements of the city.
We hope the corridor of the Mengxi Food Market carries more “design goodwill” rather than being a pure commercial space. We hope the corridor will see more sidewalk small talk, where nodding greetings become ten minutes’ warm talks. We hope the corridor becomes a place of social gathering for senior citizens to alleviate their loneliness. We even hope the corridors can witness many romantic encounters.
For Roarc Renew, each themed project is seen as a new challenge and an exploration for a new “possibility”. These possibilities may be realized through different materials, construction methods or spiritual quest. This time the small food market on Mengzi West Road is an exploration in “material” and “ connotation”. The reason why we are keen on projects related to people's livelihood is because we hope to impact this lovely city where we grew up through the power of design, and add more humanistic care to its financial identity.


A random number is assigned to each round of play
There are four cards below. Click each card to add a specific amount of points to your total score.
Win the round by matching your total score to the random number without going over.
The value of each card is hidden and is reassigned in each round of play.
Good Luck! and may the odds forever be in your favor!


Why doesn't Hextrapolate let me type the characters I want?
Hextrapolate only allows you to type numbers and letters that are valid for a particular base or text encoding. The allowed characters for some of the common bases and text encodings are shown below:
- Hexadecimal: the digits 0 through 9, as well as the letters a through f
- Decimal: the digits 0 through 9
- Octal: the digits 0 through 7
- Binary: the digits 0 and 1
- ASCII: the 95 printable characters of the ASCII character encoding; these include all the 26 lowercase and uppercase letters of the Roman alphabet, the digits 0 through 9, and a number of punctuation and other characters (see ASCII text encoding for a full listing)
If a character you type is rejected Hextrapolate will show information about it in a tool-tip (see digit error (screenshot) and text encoding error (screenshot)).


It has been about 3 weeks after the midterm evaluations. The dipy website is gradually heading towards completion!
Progress so far
The documentation has been completely integrated with the website and it is synced automatically from the github repository where the docs are hosted.
The honeycomb gallery in the home page is replaced with a carousal of images with content overlays that will allow us to display important announcements at the top.
The news feed now has sharing options for Facebook, Google Plus and Twitter.
Google analytics has been integrated for monitoring traffic.
There are many performance optimizations like introducing a layer of cache and enabling GZipping middleware. Now the google page speed score is even higher than the older website of dipy.
All pages of the website has meta tags for search engine optimizations.
And of course there has been lots of bug fixes and the website scales a lot better in mobile devices.
The documentations are now generated and uploaded to the dipy_web repository using a script. Previously html version of the docs were built, but this script builds the json docs that allows us to integrate them within the django templates vrey easily. Then using github API the list of documentations are synced with the django website models.
Now the admins with proper permissions can select which documentation versions to display in the website. Those selected documentations are displayed in the navbar dropdown menu. This is done by passing the selected docs in the context in a context preprocessor.
Now when a user requests a documentation, the doc in json format is retrieved from github parsed and the urls in the docs are processed so that they work properly within the django site. Then the docs are rendered in a template.
Cache
Processing the json documentations every time a page is requested is an overhead. Also in the home page, every time the social network feeds are fetched which is not required. So a cache is used to reduce the overhead. In django adding a cache is really really simple. All we need to do is setup the cache settings and add some decorators to the views.
For now we are using local memory cache, but in production it will be replaced with memcached.
We are keeping the documentation view and the main page view in cache for 30 minutes.
But this creates a problem. When we change some section or news or publications in the admin panel then the changes are not reflected in the views and we need to wait for 30 minutes to see the changes. In order to solve the issue the cache is cleared whenever some changes are made to the sections, news etc.
Search Engine Optimizations
One of the most important steps for SEO is adding proper meta tags in every page of the webiste. These also include the open graph tags and the twitter card tags so that when a page is shared in a social network, it is properly rendered with the correct title, description, thumbnail etc.
The django-meta app provides vrey useful template that can be included to render the meta tags properly provided a meta object is passed in the context. Ideally all pages should have its unique meta tags, but there must be a fallback so that if no meta attributes are specified then some default values are used.
So in order to generate the meta objects we have this function:
And in settings.py we can specify some default values:
Googe Analytics
Adding google analytics is very simple. All we need to do is put a code snippet in every template or just the base template that is extended by all other templates. But in order to make it more easy to customize, I have kept it as a context preprocessor that will take the Tracking ID from settings.py and generate the code snippet in the templates.
What’s next
We have to add more documentation versions (the older ones) and add a hover button in the documentation pages to hop from one documentation version to another just like the django documentations.
We have to design a gallery page that will contain images, videos and tutorials.
I am currently working on a github data visualization page for visualization of dipy contributors and activity in the dipy repository.


|
Drake
|
#include <cmath>
#include <limits>
#include <sstream>
#include <string>
#include <gflags/gflags.h>
#include "drake/automotive/automotive_simulator.h"
#include "drake/automotive/create_trajectory_params.h"
#include "drake/automotive/gen/maliput_railcar_params.h"
#include "drake/automotive/maliput/api/lane_data.h"
#include "drake/automotive/maliput/dragway/road_geometry.h"
#include "drake/automotive/multilane_onramp_merge.h"
#include "drake/common/drake_assert.h"
#include "drake/common/text_logging_gflags.h"
#include "drake/lcm/drake_lcm.h"
Namespaces | |
| drake | |
| drake::automotive | |
Enumerations | |
| enum | RoadNetworkType { flat = 0, dragway = 1, onramp = 2 } |
Functions | |
| DEFINE_int32 (num_simple_car, 0, "Number of SimpleCar vehicles. The cars are " "named \\ \\ \\ etc. If this option is provided, " "simple_car_names must not be provided.") | |
| DEFINE_string (simple_car_names, "", "A comma-separated list that specifies the number of SimpleCar " "models to instantiate, their names, and the names of the LCM " "channels to which they subscribe (e.g., 'Russ,Jeremy,Liang' " "would spawn 3 cars subscribed to DRIVING_COMMAND_Russ, " "DRIVING_COMMAND_Jeremy, and DRIVING_COMMAND_Liang). If this " "option is provided, num_simple_car must not be provided.") | |
| DEFINE_int32 (num_mobil_car, 0, "Number of MOBIL-controlled SimpleCar vehicles. This option is " "currently only applied when the road network is a dragway. " "MOBIL-controlled vehicles are placed behind any idm-controlled " "railcars and any fixed-speed railcars.") | |
| DEFINE_int32 (num_trajectory_car, 0, "Number of TrajectoryCar vehicles. This " "option is currently only applied when the road network is a flat " "plane or a dragway.") | |
| DEFINE_int32 (num_idm_controlled_maliput_railcar, 0, "Number of IDM-controlled " "MaliputRailcar vehicles. This option is currently only applied " "when the road network is a dragway. These cars are added after " "the trajectory cars are added but before the fixed-speed " "railcars are added. They are initialized to be behind the " "fixed-speed railcars, if any.") | |
| DEFINE_int32 (num_maliput_railcar, 0, "Number of fixed-speed MaliputRailcar " "vehicles. This option is currently only applied when the road " "network is a dragway or merge. The speed is derived based on the " "road's base speed and speed delta. The railcars are added after " "the IDM-controlled railcars are added and are positioned in " "front of the IDM-controlled railcars.") | |
| DEFINE_double (target_realtime_rate, 1.0, "Playback speed. See documentation for " "Simulator::set_target_realtime_rate() for details.") | |
| DEFINE_double (simulation_sec, std::numeric_limits< double >::infinity(), "Number of seconds to simulate.") | |
| DEFINE_int32 (num_dragway_lanes, 0, "The number of lanes on the dragway. The number of lanes is by " "default zero to disable the dragway. A dragway road network is " "only enabled when the user specifies a number of lanes greater " "than zero. Only one road network can be enabled. Thus if this " "option is enabled, no other road network can be enabled.") | |
| DEFINE_double (dragway_length, 100, "The length of the dragway.") | |
| DEFINE_double (dragway_lane_width, 3.7, "The dragway lane width.") | |
| DEFINE_double (dragway_shoulder_width, 3.0, "The dragway's shoulder width.") | |
| DEFINE_double (dragway_base_speed, 4.0, "The speed of the vehicles on the right-most lane of the " "dragway.") | |
| DEFINE_double (dragway_lane_speed_delta, 2, "The change in vehicle speed in the left-adjacent lane. For " "example, suppose the dragway has 3 lanes. Vehicles in the " "right-most lane will travel at dragway_base_speed m/s. " "Vehicles in the middle lane will travel at " "dragway_base_speed + dragway_lane_speed_delta m/s. Finally, " "vehicles in the left-most lane will travel at " "dragway_base_speed + 2 * dragway_lane_speed_delta m/s.") | |
| DEFINE_double (dragway_vehicle_spacing, 10, "The initial spacing (in meters) between consecutive vehicles " "traveling on a lane.") | |
| DEFINE_bool (with_stalled_cars, false, "Places a stalled vehicle at the end of " "each lane of a dragway. This option is only enabled when the " "road is a dragway.") | |
| DEFINE_bool (with_onramp, false, "Loads the onramp road network. Only one road network can be " "enabled. Thus, if this option is enabled, no other road network " "can be enabled.") | |
| DEFINE_int32 (onramp_num_lanes, 1, "The number of lanes on the onramp. The number of lanes is by " "default 1 (one). This option is only valid when `with_onramp` " "option is used.") | |
| DEFINE_double (onramp_lane_width, 3.7, "The onramp lane width. This option is only valid when " "`with_onramp` option is used.") | |
| DEFINE_double (onramp_shoulder_width, 3.0, "The onramp's road shoulder width. This option is only valid " "when `with_onramp` option is used.") | |
| DEFINE_double (onramp_base_speed, 25, "The speed of the vehicles " "added to the onramp, i.e. this option is only valid when " "`with_onramp` option is used.") | |
| DEFINE_bool (onramp_swap_start, false, "Whether to swap the starting " "lanes of the vehicles on the onramp scenario, i.e. this " "option is only valid when `with_onramp` option is used.") | |
| int | main (int argc, char *argv[]) |
|
strong |
| DEFINE_bool | ( | with_stalled_cars | , |
| false | , | ||
| "Places a stalled vehicle at the end of " "each lane of a dragway. This option is only enabled when the " "road is a dragway." | |||
| ) |
| DEFINE_bool | ( | with_onramp | , |
| false | , | ||
| "Loads the onramp road network. Only one road network can be " "enabled. | Thus, | ||
| if this option is | enabled, | ||
| no other road network " "can be enabled." | |||
| ) |
| DEFINE_bool | ( | onramp_swap_start | , |
| false | , | ||
| "Whether to swap the starting " "lanes of the vehicles on the onramp | scenario, | ||
| i.e. this " "option is only valid when `with_onramp` option is used." | |||
| ) |
| DEFINE_double | ( | target_realtime_rate | , |
| 1. | 0, | ||
| "Playback speed. See documentation for " "Simulator::set_target_realtime_rate() for details." | |||
| ) |
| DEFINE_double | ( | simulation_sec | , |
| std::numeric_limits< double > | ::infinity(), | ||
| "Number of seconds to simulate." | |||
| ) |
| DEFINE_double | ( | dragway_length | , |
| 100 | , | ||
| "The length of the dragway." | |||
| ) |
| DEFINE_double | ( | dragway_lane_width | , |
| 3. | 7, | ||
| "The dragway lane width." | |||
| ) |
| DEFINE_double | ( | dragway_shoulder_width | , |
| 3. | 0, | ||
| "The dragway's shoulder width." | |||
| ) |
| DEFINE_double | ( | dragway_base_speed | , |
| 4. | 0, | ||
| "The speed of the vehicles on the right-most lane of the " "dragway." | |||
| ) |
| DEFINE_double | ( | dragway_lane_speed_delta | , |
| 2 | , | ||
| "The change in vehicle speed in the left-adjacent lane. For " " | example, | ||
| suppose the dragway has 3 lanes. Vehicles in the " "right-most lane will travel at dragway_base_speed m/s. " "Vehicles in the middle lane will travel at " "dragway_base_speed+dragway_lane_speed_delta m/s. | Finally, | ||
| " "vehicles in the left-most lane will travel at " "dragway_base_speed+2 *dragway_lane_speed_delta m/s." | |||
| ) |
| DEFINE_double | ( | dragway_vehicle_spacing | , |
| 10 | , | ||
| "The initial spacing (in meters) between consecutive vehicles " "traveling on a lane." | |||
| ) |
| DEFINE_double | ( | onramp_lane_width | , |
| 3. | 7, | ||
| "The onramp lane width. This option is only valid when " "`with_onramp` option is used." | |||
| ) |
| DEFINE_double | ( | onramp_shoulder_width | , |
| 3. | 0, | ||
| "The onramp's road shoulder width. This option is only valid " "when `with_onramp` option is used." | |||
| ) |
| DEFINE_double | ( | onramp_base_speed | , |
| 25 | , | ||
| "The speed of the vehicles " "added to the | onramp, | ||
| i.e. this option is only valid when " "`with_onramp` option is used." | |||
| ) |
| DEFINE_int32 | ( | num_simple_car | , |
| 0 | , | ||
| "Number of SimpleCar vehicles. The cars are " "named \\\etc. If this option is | provided, | ||
| " "simple_car_names must not be provided." | |||
| ) |
| DEFINE_int32 | ( | num_mobil_car | , |
| 0 | , | ||
| "Number of MOBIL-controlled SimpleCar vehicles. This option is " "currently only applied when the road network is a dragway. " "MOBIL-controlled vehicles are placed behind any idm-controlled " "railcars and any fixed-speed railcars." | |||
| ) |
| DEFINE_int32 | ( | num_trajectory_car | , |
| 0 | , | ||
| "Number of TrajectoryCar vehicles. This " "option is currently only applied when the road network is a flat " "plane or a dragway." | |||
| ) |
| DEFINE_int32 | ( | num_idm_controlled_maliput_railcar | , |
| 0 | , | ||
| "Number of IDM-controlled " "MaliputRailcar vehicles. This option is currently only applied " "when the road network is a dragway. These cars are added after " "the trajectory cars are added but before the fixed-speed " "railcars are added. They are initialized to be behind the " "fixed-speed | railcars, | ||
| if any." | |||
| ) |
| DEFINE_int32 | ( | num_maliput_railcar | , |
| 0 | , | ||
| "Number of fixed-speed MaliputRailcar " "vehicles. This option is currently only applied when the road " "network is a dragway or merge. The speed is derived based on the " "road's base speed and speed delta. The railcars are added after " "the IDM-controlled railcars are added and are positioned in " "front of the IDM-controlled railcars." | |||
| ) |
| DEFINE_int32 | ( | num_dragway_lanes | , |
| 0 | , | ||
| "The number of lanes on the dragway. The number of lanes is by " "default zero to disable the dragway. A dragway road network is " "only enabled when the user specifies a number of lanes greater " "than zero. Only one road network can be enabled. Thus if this " "option is | enabled, | ||
| no other road network can be enabled." | |||
| ) |
| DEFINE_int32 | ( | onramp_num_lanes | , |
| 1 | , | ||
| "The number of lanes on the onramp. The number of lanes is by " "default 1 (one). This option is only valid when `with_onramp` " "option is used." | |||
| ) |
| DEFINE_string | ( | simple_car_names | , |
| "" | , | ||
| "A comma-separated list that specifies the number of SimpleCar " "models to | instantiate, | ||
| their | names, | ||
| and the names of the LCM " "channels to which they subscribe(e.g., 'Russ, Jeremy, Liang' " "would spawn 3 cars subscribed to DRIVING_COMMAND_Russ, " "DRIVING_COMMAND_Jeremy, and DRIVING_COMMAND_Liang). If this " "option is | provided, | ||
| num_simple_car must not be provided." | |||
| ) |


---
# jekyll header
level: 2
active: profiles
---
{% include header.html %}
{% include container-start.html %}
{% include breadcrumbs.html %}
New Zealand Information source for DOB & DOD
Formats: XML, JSON, Turtle
{% include CodeSystem-nzinfosource-html.xhtml %}
{% include container-end.html %}
{% include footer.html %}


BARCODE(1) GNU barcode BARCODE(1) NAME barcode - a stand alone program to run the barcode library SYNOPSIS barcode [-b - | string] [-e encoding] [-o - | outfile] [ other-flags ] DESCRIPTION The information below is extracted from the texinfo file, which is the preferred source of information. The barcode program is a front-end to access some features of the library from the command line. It is able to read user supplied strings from the command line or a data file (standard input by default) and encode all of them. OPTIONS barcode accepts the following options: --help or -h Print a usage summary and exit. -i filename Identify a file where strings to be encoded are read from. If missing (and if -b is not used) it defaults to standard input. Each data line of the input file will be used to create one bar‐ code output. -o filename Output file. It defaults to standard output. -b string Specify a single ``barcode'' string to be encoded. The option can be used multiple times in order to encode multiple strings (this will result in multi-page postscript output or a table of barcodes if -t is specified). The strings must match the encoding chosen; if it doesn't match the program will print a warning to stderr and generate ``blank'' output (although not zero-length). Please note that a string including spaces or other special characters must be properly quoted. -e encoding encoding is the name of the chosen encoding format being used. It defaults to the value of the environment variable BARCODE_ENCODING or to auto detection if the environment is also unset. -g geometry The geometry argument is of the form ``[<width> x <height>] [+ <xmargin> + <ymargin>]'' (with no intervening spaces). Unspecified margin values will result in no margin; unspecified size results in default size. The specified values represent print points by default, and can be inches, millimeters or other units according to the -u option or the BARCODE_UNIT environment variable. The argument is used to place the printout code on the page. Note that an additional white margin of 10 points is added to the printout. If the option is unspecified, BARCODE_GEOMETRY is looked up in the environment, if missing a default size and no margin (but the default 10 points) are used. -t table-geometry Used to print several barcodes to a single page, this option is meant to be used to print stickers. The argument is of the form ``<columns> x <lines> [+ <leftmargin> + <bottommargin> [- <right‐ margin> [- <topmargin>]]]'' (with no intervening spaces); if miss‐ ing, the top and right margin will default to be the same as the bottom and left margin. The margins are specified in print points or in the chosen unit (see -u below). If the option is not speci‐ fied, BARCODE_TABLE is looked up in the environment, otherwise no table is printed and each barcode will get its own page. The size (but not the position) of a barcode item within a table can also be selected using -g (see "geometry" above), without struggling with external and internal margins. I still think management of geometries in a table is suboptimal, but I can't make it better without introducing incompatibilities. -m margin(s) Specifies an internal margin for each sticker in the table. The argument is of the form ``<xmargin>,<ymargin>'' and the margin is applied symmetrically to the sticker. If unspecified, the environ‐ ment variable BARCODE_MARGIN is used or a default internal margin of 10 points is used. -n ``Numeric'' output: don't print the ASCII form of the code, only the bars. -c No checksum character (for encodings that allow it, like code 39, other codes, like UPC or EAN, ignore this option). -E Encapsulated postscript (default is normal postscript). When the output is generated as EPS only one barcode is encoded. -P PCL output. Please note that the Y direction goes from top to bot‐ tom for PCL, and the origin for an image is the top-left corner instead of the bottom-left -p pagesize Specify a non-default page size. The page size can be specified in millimeters, inches or plain numbers (for example: "210x297mm", "8.5x11in", "595x842"). A page specification as numbers will be interpreted according to the current unit specification (see -u below). If libpaper is available, you can also specify the page size with its name, like "A3" or "letter" (libpaper is a standard component of Debian GNU/Linux, but may be missing elsewhere). The default page size is your system-wide default if libpaper is there, A4 otherwise. -u unit Choose the unit used in size specifications. Accepted values are ``mm'', ``cm'', ``in'' and ``pt''. By default, the program will check BARCODE_UNIT in the environment, and assume points otherwise (this behaviour is compatible with 0.92 and previous versions. If -u appears more than once, each instance will modified the behav‐ iour for the arguments at its right, as the command line is pro‐ cesses left to right. The program internally works with points, and any size is approximated to the nearest multiple of one point. The -u option affect -g (geometry), -t (table) and -p (page size). ENCODING TYPES The program encodes text strings passed either on the command line (with -b) or retrieved from standard input. The text representation is inter‐ preted according to the following rules. When auto-detection of the encoding is enabled (i.e, no explicit encoding type is specified), the encoding types are scanned to find one that can digest the text string. The following list of supported types is sorted in the same order the library uses when auto-detecting a suitable encoding for a string. EAN The EAN frontend is similar to UPC; it accepts strings of digits, 12 or 7 characters long. Strings of 13 or 8 characters are accepted if the provided checksum digit is correct. I expect most users to feed input without a checksum, though. The add-2 and add-5 extension are accepted for both the EAN-13 and the EAN-8 encodings. The following are example of valid input strings: ``123456789012'' (EAN-13), ``1234567890128'' (EAN-13 wih check‐ sum), ``1234567'' (EAN-8), ``12345670 12345'' (EAN-8 with check‐ sum and add-5), ``123456789012 12'' (EAN-13 with add-2), ``123456789012 12345'' (EAN-13 with add-5). UPC The UPC frontend accepts only strings made up of digits (and, if a supplemental encoding is used, a blank to separate it). It accepts strings of 11 or 12 digits (UPC-A) and 6 or 7 or 8 digits (UPC-E). The 12th digit of UPC-A is the checksum and is added by the library if not specified in the input; if it is specified, it must be the right checksum or the code is rejected as invalid. For UPC-E, 6 digit are con‐ sidered to be the middle part of the code, a leading 0 is assumed and the checksum is added; 7 digits are either considered the initial part (lead‐ ing digit 0 or 1, checksum missing) or the final part (checksum speci‐ fied, leading 0 assumed); 8 digits are considered to be the complete code, with leading 0 or 1 and checksum. For both UPC-A and UPC-E, a trailing string of 2 digits or 5 digits is accepted as well. Therefore, the following are examples of valid strings that can be encoded as UPC: ``01234567890'' (UPC-A) ``012345678905'' (UPC-A with checksum), ``012345'' (UPC-E), ``01234567890 12'' (UPC-A, add-2) and ``01234567890 12345'' (UPC-A, add-5), ``0123456 12'' (UPC-E, add-2). Please note that when setting BARCODE_ANY to auto-detect the encoding to be used, 12-digit strings and 7-digit strings will always be identified as EAN. This because I expect most user to provide input without a checksum. If you need to specify UPC-with-checksum as input you must explicitly set BAR‐ CODE_UPC as a flag or use -e upc on the command line. ISBN ISBN numbers are encoded as EAN-13 symbols, with an optional add-5 trailer. The ISBN frontend of the library accepts real ISBN num‐ bers and deals with any hyphen and, if present, the ISBN checksum character before encoding data. Valid representations for ISBN strings are for example: ``1-56592-292-1'', ``3-89721-122-X'' and ``3-89721-122-X 06900}''. code 128-B This encoding can represent all of the printing ASCII characters, from the space (32) to DEL (127). The checksum digit is mandatory in this encoding. code 128-C The ``C'' variation of Code-128 uses Code-128 symbols to represent two digits at a time (Code-128 is made up of 104 symbols whose interpretation is controlled by the start symbol being used). Code 128-C is thus the most compact way to represent any even number of digits. The encoder refuses to deal with an odd number of digits because the caller is expected to provide proper padding to an even number of digits. (Since Code-128 includes control symbols to switch charset, it is theoretically possible to represent the odd digit as a Code 128-A or 128-B symbol, but this tool doesn't cur‐ rently implement this option). code 128 raw Code-128 output represented symbol-by-symbol in the input string. To override part of the problems outlined below in specifying code128 symbols, this pseudo-encoding allows the used to specify a list of code128 symbols separated by spaces. Each symbol is repre‐ sented by a number in the range 0-105. The list should include the leading character.The checksum and the stop character are automatically added by the library. Most likely this pseudo-encod‐ ing will be used with BARCODE_NO_ASCII and some external program to supply the printed text. code 39 The code-39 standard can encode uppercase letters, digits, the blank space, plus, minus, dot, star, dollar, slash, percent. Any string that is only composed of such characters is accepted by the code-39 encoder. To avoid loosing information, the encoder refuses to encode mixed-case strings (a lowercase string is nonetheless accepted as a shortcut, but is encoded as uppercase). interleaved 2 of 5 This encoding can only represent an even number of digits (odd digits are represented by bars, and even digits by the interleav‐ ing spaces). The name stresses the fact that two of the five items (bars or spaces) allocated to each symbol are wide, while the rest are narrow. The checksum digit is optional (can be disabled via BARCODE_NO_CHECKSUM). Since the number of digits, including the checksum, must be even, a leading zero is inserted in the string being encoded if needed (this is specifically stated in the specs I have access to). code 128 Automatic selection between alphabet A, B and C of the Code-128 standard. This encoding can represent all ASCII symbols, from 0 (NUL) to 127 (DEL), as well as four special symbols, named F1, F2, F3, F4. The set of symbols available in this encoding is not eas‐ ily represented as input to the barcode library, so the following convention is used. In the input string, which is a C-language null-terminated string, the NUL char is represented by the value 128 (0x80, 0200) and the F1-F4 characters are represented by the values 193-196 (0xc1-0xc4, 0301-0304). The values have been cho‐ sen to ease their representation as escape sequences. Since the shell doesn't seem to interpret escape sequences on the command line, the "-b" option cannot be easily used to designate the strings to be encoded. As a workaround you can resort to the command echo, either within back-ticks or used separately to create a file that is then fed to the standard-input of barcode -- assuming your echo command processes escape sequences. The newline character is especially though to encode (but not impossible unless you use a csh variant. These problems only apply to the command-line tool; the use of library functions doesn't give any problem. In needed, you can use the ``code 128 raw'' pseudo-encoding to represent code128 symbols by their numerical value. This encoding is used late in the auto-selection mechanism because (almost) any input string can be represented using code128. Codabar Codabar can encode the ten digits and a few special symbols (minus, plus, dollar, colon, bar, dot). The characters ``A'', ``B'', ``C'' and ``D'' are used to represent four different start/stop characters. The input string to the barcode library can include the start and stop characters or not include them (in which case ``A'' is used as start and ``B'' as stop). Start and stop characters in the input string can be either all lowercase or all uppercase and are always printed as uppercase. Plessey Plessey barcodes can encode all the hexadecimal digits. Alphabetic digits in the input string must either be all lowercase or all uppercase. The output text is always uppercase. MSI MSI can only encode the decimal digits. While the standard speci‐ fies either one or two check digits, the current implementation in this library only generates one check digit. code 93 The code-93 standard can natively encode 48 different characters, including uppercase letters, digits, the blank space, plus, minus, dot, star, dollar, slash, percent, as well as five special charac‐ ters: a start/stop delimiter and four "shift characters" used for extended encoding. Using this "extended encoding" method, any standard 7-bit ASCII character can be encoded, but it takes up two symbol lengths in barcode if the character is not natively sup‐ ported (one of the 48). The encoder here fully implements the code 93 encoding standard. Any characters natively supported (A- Z, 0-9, ".+-/$ encoded as such - for any other characters (such as lower case letters, brackets, parentheses, etc.), the encoder will revert to extended encoding. As a note, the option to exclude the checksum will eliminate the two modulo-47 checksums (called C and K) from the barcode, but this probably will make it unreadable by 9 These checksums are specified to be used at the firmware level, and their absence will be interpreted as an invalid barcode. PCL OUTPUT While the default output is Postscript (possibly EPS), and Postscript can be post-processed to almost anything, it is sometimes desirable to create output directly usable by the specific printer at hand. PCL is currently supported as an output format for this reason. Please note that the Y coordinate for PCL goes from top to bottom, while for Postscript it goes from bottom to top. Consistently, while in Postscript you specify the bottom-left corner as origin, for PCL you specify the top-left corner. Barcode output for PCL Printers (HP LaserJet and compatibles), was devel‐ oped using PCL5 Reference manuals from HP. that really refers to these printers: LaserJet III, III P, III D, III Si, LaserJet 4 family LaserJet 5 family LaserJet 6 family Color LaserJet DeskJet 1200 and 1600. However, barcode printing uses a very small subset of PCL, probably also LaserJet II should print it without problem, but the resulting text may be horrible. The only real difference from one printer to another really depends on which font are available in the printer, used in printing the label asso‐ ciated to the bars (if requested). Earlier LaserJet supports only bitmaps fonts, so these are not "scal‐ able". (Ljet II ?), Also these fonts, when available, have a specified direction, and not all of them are available in both Portrait and Land‐ scape mode. From LaserJet 4 series, (except 4L/5L that are entry-level printers), Arial scalable font should be available, so it's the "default font" used by this program. LaserJet III series printers (and 4L, 5L), don't feature "Arial" as a resident font, so you should use BARCODE_OUT_PCL_III instead of BAR‐ CODE_OUT_PCL., and font the font used will be "Univers" instead of "Arial". Results on compatible printers, may depend on consistency of PCL5 compat‐ ibility, in doubt, try BARCODE_OUT_PCL_III PJL commands are not used here, as it's not very compatible. Tested Printers: Hp LaserJet 4050 Hp LaserJet 2100 Epson N-1200 emul PCL Toshiba DP2570 (copier) + PCL option Epson EPL-7100 emul. HP LaserJet II: bars print fine but text is bad. BUGS The current management of borders/margins is far from optimal. The ``default'' margin applied by the library interferes with the external representation, but I feel it is mandatory to avoid creating barcode out‐ put with no surrounding white space (the problem is especially relevant for EPS output). EAN-128 is not (yet) supported. I plan to implement it pretty soon and then bless the package as version 1.0. SEE ALSO barcode(3) AUTHORS Alessandro Rubini<EMAIL_ADDRESS>(maintainer) Leonid A. Broukhis<EMAIL_ADDRESS>(several encodings) Andrea Scopece<EMAIL_ADDRESS>(PCL output) 4th Berkeley Distribution October 2001 BARCODE(1)


Django-Newsletter
links:
documentation: https://django-newsletter.readthedocs.io/en/latest/
github: https://github.com/dokterbob/django-newsletter
Features:
Users can be added and removed from a subscription.
Html code can be set as the template for a message to be sent. If html code is not used as a template. A premailer is used by this app which allows embedded CSS to be translated into inline CSS. HTML code can be uploaded so an email can be made.
Attachments and add ons can be managed with this app. Allows widget integration and attachments.
Capable of sending emails to the recipients listed within the system.
It has a smart queueing system.
Pros:
Code is written in Django python. This is beneficial for the team working on it familiar with django.
It has been tested in sending a newsletter to large groups of recipients, with an estimate of at least 15,000 recipients.
It has worked in multiple working environments.
Tests are run to this day and a team is active in working on the product.
Cons:
It doesn't appear to contain any statistic analytical tool to analyze emails sent. This may make it difficult to not know if it was successful or not.
It is confirmed to send to a large pool of recipients and the app may not be suitable for larger amounts of emails being sent. However, the app is in development and it is possible that this will improve. The problem is that it may take time for a larger pool to be possible. However it depends on how many the department of records wants to send emails to. It may be an option.
It is still in development and certain features are missing from it. Templates may not be as update with the competition.
It doesn't appear to possess any statistical tools to keep track of whether emails were read or not. It maybe harder for the NYC department of records to rely on for certain events.


All Classes
actor
Boom
Boss
Boss_bullet
GameBackend
GameDiver
GameFrame
GameLeader
GamePanel
GameParser
LittleMonster
LittleMonster_bullet
MiddleMonster
MiddleMonster_bullet
protagonist
protagonist_bullet


Font icons using ligatures are the default option and simple to use:
which renders
SVG icons can be used either by directly specifying the icon's URL, or by associating an icon name with a URL and then referring to the name. To use a URL directly, set the svgSrc input:


About Us
Home
ROOMS&SUITES
Restaurants
Things to do
Gallery
Tariff
Contact Us
Home
Rooms & Suites
Restaurants
Things To Do
Gallery
Tariff
Contact Us


Oftentimes you need to make a custom validator function and share it across you project.
validators
service available through injection allow you to do that.
Actual extension of the service is demonstrated in the next example and this one concentrates
on its built-in functions and different ways you can pass parameters to them.
Built-in validator functions are required
, minLength
, maxLength
and pattern
.
They pretty much resemble their counterparts available with vanilla Angular, and will stop $veiwValue propagation towards model
if it is invalid, returning undefined.
All of them accept a parameter and return the actual validator function tied to that parameter. It can be:
minLength(3)
- inline valueminLength(value)
- inline value from $scope $scope.value = 3;
Do note, chainging $scope.value afterwards does
not affect the already passed function in this case.minLength(valueObj)
- an object on the $scope, whose .value
property will
be eveluated every time that this validation function fires. $scope.valueObj = { value: 3 };
minLength(valueProviderFn)
- a value provider function attached to the $scope, that will
be called for actual value during each validation. $scope.valueProviderFn = function () { return $scope.valueObj.value;};


Pseudocodes
A little of a theory.
There are definitions of used data structures
(Binary Tree, Binary Heap,
Priority Queue, Binary Search Tree)
and simplified actually used codes of algorithms.
Binary Tree Visualiser is written in JavaScript, so these codes are also written in JavaScript syntax.
Codes are simplified to show the main functionality. Extreme cases (given empty tree, null node, etc.) are usually not solved.
Make sure you know the basics about JavaScript.
It is a scripting language. It is object oriented, dynamic typed, prototype based and has first-class functions.
In JavaScript object are passed by references, but primitive types by values.
There are no classes. Functions are used as objects constructors, and prototyping is used for inheritance.developer.mozilla.org
Binary Tree
A binary tree is an data structure with one root node (the ancestor of all nodes).
Each node has a value and at most two child nodes, usually called left child and right child.
Each node (except for root) has one parent. Root node has no parent.
Node with no children is called leaf.
The formal recursive definition is: a binary tree is either empty (represented by a null),
or is made of a single node, where the left and right references (recursive definition ahead)
each point to a binary tree.Nick Parlante
Binary Tree
/** * @class * @param {BinaryTreeNode} root */ function BinaryTree(root) { /** * @private * @type {BinaryTreeNode} */ this.root = root; } /** * @returns {BinaryTreeNode} */ BinaryTree.prototype.getRoot = function() {...} /** * @param {BinaryTreeNode} root */ BinaryTree.prototype.setRoot = function(root) {...} /** * Return number of nodes in tree. * @returns {Number} */ BinaryTree.prototype.getCount = function() {...} /** * Build a tree from given array. * @param {Number[]} array */ BinaryTree.prototype.build = function(array) {...} /** * Swap nodes and change all needed references. * @param {BinaryTreeNode} node1 * @param {BinaryTreeNode} node2 */ BinaryTree.prototype.swapNodes = function(node1, node2) {...} /** * Simulate an array implementation. * @param {Number} index * @returns {BinaryTreeNode} */ BinaryTree.prototype.getNode = function(index) {...} /** * Simulate an array implementation. * @param {BinaryTreeNode} node * @returns {Number} Index of given node. */ BinaryTree.prototype.getIndex = function(node) {...}
Binary Tree Node
/** * @class * @param {Number|String} value The value of the node. */ BinaryTreeNode = function(value) { /** * @private * @type {Number|String} */ this.value = value; /** * @private * @type {BinaryTreeNode} */ this.parent = null; /** * @private * @type {BinaryTreeNode} */ this.left = null; /** * @private * @type {BinaryTreeNode} */ this.right = null; } /** * @returns {Number} */ BinaryTreeNode.prototype.getValue = function() {...} /** * @returns {Boolean} */ BinaryTreeNode.prototype.isRoot = function() {...} /** * @returns {Boolean} */ BinaryTreeNode.prototype.isLeaf = function() {...} /** * @returns {BinaryTreeNode} */ BinaryTreeNode.prototype.getParent = function() {...} /** * Set left child and changes all needed references. * @param {BinaryTreeNode} left */ BinaryTreeNode.prototype.setLeft = function(left) {...} /** * @returns {BinaryTreeNode} */ BinaryTreeNode.prototype.getLeft = function() {...} /** * Set right child and changes all needed references. * @param {BinaryTreeNode} right */ BinaryTreeNode.prototype.setRight = function(right) {...} /** * @returns {BinaryTreeNode} */ BinaryTreeNode.prototype.getRight = function() {...}
Binary Heap + Priority Queue
A binary heap is a binary tree. In addition it meets these two condition:
- The tree is a complete binary tree: a binary tree in which every level, except possibly the deepest, is completely filled, and all nodes must be as far left as possible.
- The heap property: each node is lower than or equal to its parent.Chris L. Kuszmaul
A priority queue is an abstract data type to efficiently support finding the item with the highest priority (highest value) across a series of operations (nodes). The basic operations are: insert, get maximum and extract maximum.Paul E. Black In Binary Tree Visualiser there is priority queue implemented as binary heap with these functions.
Heapify-down
Rearrange a heap to maintain the heap property downwards. If the node is not greater than or equal to its children, swap it with the greater child, then recursively heapify-down that child's subtree. Michael L. Littman
/** * @param {BinaryTree} tree * @param {BinaryTreeNode} node */ function heapifyDown(tree, node) { var left = node.getLeft(); var right = node.getRight(); var greaterChild; if(node.isLeaf()) { // no child, end return; } // get greater child if(left != null && right != null) { // both child, compare child if(left.getValue() >= right.getValue()) { greaterChild = left; } else { greaterChild = right; } } else { // just left child greaterChild = left; } // swap and continue if(greaterChild.getValue() > node.getValue()) { tree.swapNodes(node, greater); heapifyDown(tree, node); } }
Heapify-up
Rearrange a heap to maintain the heap property upwards. If the node is greater than its parent, swap these nodes, then recursively heapify-up the parent that changed (originally the given node). Michael L. Littman
/** * @param {BinaryTree} tree * @param {BinaryTreeNode} node */ function heapifyUp(tree, node) { var parent = node.getParent(); if(parent == null) { return; } // swap and continue if(parent.getValue() < node.getValue()) { tree.swapNodes(this.node, parent); heapifyUp(node); } }
Random Binary Heap
Generate a new random binary heap. This is my own algorithm written for this application. This is not a general generator of random binary heaps.
/** * @param {BinaryTree} tree * @param {Number} min * @param {Number} max */ function randomHeap(tree, min, max) { var count = randomInt(1, Math.min(max - min + 1, 31)); var numbers = new Array(max - min + 1); var array = new Array(); // generate array of random non identic numbers of scale for(var i = 0; i < count; i++) { do{ array[i] = randomInt(Math.ceil(min), Math.floor(max)); } while (numbers[array[i] - min] == true); numbers[array[i] - min] = true; } buildHeap(tree, array); }
Build Heap
Convert an array into a heap by executing heapify-down progressively closer to the root.Paul E. Black
/** * @param {BinaryTree} tree * @param {Number[]} array */ function buildHeap(tree, array) { tree.build(array); // use heapify-down from half of the tree to root for(var i = Math.floor(array.length/2) - 1; i >= 0; i--) { heapifyDown(tree, tree.getNode(i)); } }
Insert
The new node is initially appended to the end of the heap. The heap property is repaired by comparing the added node with its parent and swapping them if added node is grater than its parent. The comparison is repeated until the parent is larger than or equal to the percolating element.Victor Adamchik
/** * @param {BinaryTree} tree * @param {Number} value */ function insert(tree, value) { node = new BinaryTreeNode(value); if(tree.getRoot() == null) { // empty tree tree.setRoot(node); return; } var index = tree.getCount(); var parentIndex = Math.floor((index-1)/2); var parent = tree.getNode(parentIndex); if(index % 2 == 1) { // left parent.setLeft(node); } else { // right parent.setRight(node); } // maintain the heap property heapifyUp(node); }
Delete
Remove the node and replace it with the last element of the heap and then restore the heap property. It is necessary to check for both up- and downshifts. For example when the "last" node takes up the vacant spot, it can be over- or underevaluated. It can't be both, for obvious reasons. Victor S.Adamchik Gaminic
/** * @param {BinaryTree} tree * @param {BinaryTreeNode} node */ function delete(tree, node) { if(tree.getRoot == node) { tree.setRoot(null); return; } // swap selected and last var last = tree.getNode(tree.getCount() - 1); if(node != last) { tree.swapNodes(node, last); } if(node.getParent().getLeft() == node) { // left node.getParent().setLeft(null); } else { // right node.getParent().setRight(null); } // heapify last, it is necessary to check for both ways, // but only one heapify is done, the other end at the first comparison heapifyUp(tree, last); heapifyDown(tree, last); }
Get Max
The heap property ensures the root is always maximum node.
/** * @param {BinaryTree} tree */ function getMax(tree) { return tree.getRoot(); }
Extract Max
Same as delete the root node. Root is always maximum node (the heap property).
/** * @param {BinaryTree} tree */ function extractMax(tree) { var max = tree.getRoot(); if(max != null) { delete(tree, max); } return max; }
Heap Sort
A sort algorithm that repeatedly extracts the maximum from heap.Paul E. Black This implementation delete the whole tree and nodes are sorted in an array.
/* * @param {BinaryTree} tree */ function heapSort(tree) { var array = new Array(); while(tree.getRoot() != null) { array.push(extractMax(tree)); } array.reverse(); return array; }
Binary Search Tree
A binary search tree is a type of binary tree where the nodes are arranged in order: for each node, all nodes in its left subtree are less than the node, and all the nodes in its right subtree are greater than or equal to the node. Recursively, each of the subtrees must also obey the binary search tree constraint.Nick Parlante
Random Binary Search Tree
Generate a new random binary search tree. This is my own algorithm written for this application. This is not a general generator of random binary trees.
/** * @param {BinaryTree} tree * @param {Number} min * @param {Number} max */ function randomBSTree(tree, min, max) { var epsilon = (max - min)/4; tree.setRoot(new BinaryTreeNode(randomInt(Math.floor(min+epsilon), Math.ceil(max-epsilon)))); randomBSTreeRec(tree.getRoot(), 1, min, max); } } /** * @param {BinaryTreeNode} node * @param {Number} level * @param {Number} min * @param {Number} max */ function randomBSTreeRec(node, level, min, max) { if(min >= node.getValue() - 1 || node.getValue() + 1 >= max) { // safety return; } var chance; if(level <= 3 && Math.random() < 0.33) { // make both child - generated tree is fuller chance = 1.0; } else { switch(level) { case 1: chance = 0.95; break; case 2: chance = 0.5; break; case 3: chance = 0.3; break; case 4: chance = 0.1; break; default: chance = 0.0; break; // no node at higher levels } } var epsilon = (max - min)/4; // left child if(chance > Math.random()) { node.setLeft(new BinaryTreeNode(randomInt(Math.floor(min + epsilon), Math.ceil(node.getValue() - epsilon)))); if(node.getLeft().getValue() == min) { min += 1; } randomBSTreeRec(node.getLeft(), level + 1, min, node.getValue() - 1); } // right child if(chance > Math.random()) { node.setRight(new BinaryTreeNode(randomInt(Math.floor(node.getValue() + epsilon), Math.ceil(max - epsilon)))); if(node.getRight().getValue() == max) { max -= 1; } randomBSTreeRec(node.getRight(), level + 1, node.getValue() + 1, max); } }
Insert
Insert algorithm traverses the tree, choosing appropriate way to go by comparing value of each visited node with the new value, following the binary search tree property. Following this simple rule, the algorithm reaches a node, which has not a subtree to go. Appended new node here.algolist.net
/** * @param {BinaryTree} tree * @param {Number} value */ function insert(tree, value) { var newNode = new BinaryTreeNode(value); if(tree.getRoot() == null) { // empty tree tree.setRoot(node); return; } var node = tree.getRoot(); while(true) { if(newNode.getValue() >= node.getValue()) { // right subtree node = node.getRight(); if(node == null) { node.setRight(newNode); // insert break; // end } } else { // left subtree node = node.getLeft(); if(node == null) { node.setLeft(newNode); // insert break; end } } } }
Find
Search algorithm traverses the tree, choosing appropriate way to go by comparing value of each visited node with the searched value, following the binary search tree property. Algorithm stops if a node with necessary value is found or the algorithm has no way to go.algolist.net
/** * @param {BinaryTree} tree * @param {Number} value * @return {BinaryTreeNode} */ function find(tree, value) { var node = tree.getRoot(); while(true) { if(node.getValue() == node.getValue()) { // found return node; } if(node.getValue() > node.getValue()) { // right if(node.getRight() == null) { // not found break; } else { // next comparison node = node.getRight(); } } else { // left if(node.getLeft() == null) { // not found break; } else { // next comparison node = node.getLeft(); } } } return null; // not found }
Delete
There are three cases:
- Node to be removed has no children: Algorithm sets corresponding link of the parent to NULL.
- Node to be removed has one child: In this case, node is cut from the tree and algorithm links single child (with it's subtree) directly to the parent of the removed node.
- Node to be removed has two children: In this case node to be removed is swapped with its successor (in that case it is minimum from right subtree). Then it is deleted as node with no or one child because minimum of subtree cannot have tho children.algolist.net
/** * @param {BinaryTree} tree * @param {BinaryTreeNode} node */ function delete(tree, node) { if(node.getLeft() != null && node.getRight() != null) { // both children var successor = getSuccessor(node); tree.swapNodes(node, successor); } // continue normally - delete node // now just one or no child if(node.getLeft() != null) { // just left child var leftSubtreeRoot = node.getLeft(); if(node.isRoot()) { // is root, no parent, set tree root node.setLeft(null); tree.setRoot(leftSubtreeRoot); } else { if(node.getParent().getLeft() == node) { // left child node.getParent().setLeft(leftSubtreeRoot); } else { // right child node.getParent().setRight(leftSubtreeRoot); } } } else if(node.getRight() != null) { // just right child var rightSubtreeRoot = node.getRight(); if(node.isRoot()) { // is root, no parent, set tree root node.setRight(null); tree.setRoot(rightSubtreeRoot); } else { if(node.getParent().getLeft() == node) { // left child node.getParent().setLeft(rightSubtreeRoot); } else { // right child node.getParent().setRight(rightSubtreeRoot); } } } else { // no child if(node.isRoot()) { // is root, no parent, set tree root tree.setRoot(null); } else { if(node.getParent().getLeft() === node) { // left child node.getParent().setLeft(null); } else { // right child node.getParent().setRight(null); } } } }
Get Max
The binary search tree property ensures the maximum node is always the most right one.
/** * @param {BinaryTreeNode} root Root of (sub)tree. */ function getMax(root) { var max = root; while(max.getRight() != null) { max = max.getRight(); } return max; }
Get Min
The binary search tree property ensures the minimum node is always the most left one.
/** * @param {BinaryTreeNode} root Root of (sub)tree. */ function getMin(root) { var min = root; while(min.getLeft() != null) { min = min.getLeft(); } return min; }
Get Predecessor
See get successor algorithm. Get predecessor is similar, but look for maximum of left subtree or ancestor from right.
/** * @param {BinaryTreeNode} node */ function getPredecessorAlg(node) { if(node.getLeft() != null) { // has left subtree return getMax(node.getLeft()); // return max of left subtree of given node } else { // no left subtree, try find predecessor in ancestors var child = node; var parent = node.getParent(); while(true) { if(parent == null) { // no parent, no predecessor return null; // no predecessor found } if(parent.getRight() == child) { // arrived from right return parent; // predecessor found } // next loop child = parent; parent = parent.getParent(); } } }
Get Successor
There are two options:-
1. The node has a right subtree.
The next larger node must be in the right subtree. Since all nodes in a right subtree are larger than or equal to the given node, the successor must be the smallest of all those nodes (minimum of right subtree). -
2. The node does not have a right subtree.
In this case we will have to look up the tree since that's the only place we might find the next larger node. There is no point looking at the left subtree as all nodes in the left subtree are guaranteed to be smaller than the given node.
When we look up from the given node, there can be two cases. First, the current node is the left child of its parent. In this case the parent is the successor node. This is because the parent always comes next in in-order traversal if you are done with left subtree (rooted at the current node). Second, the current node is the right child of the parent. This is an interesting case. In this case, as you keep going up the ancestor chain you encounter smaller values if you are going up but larger values if you are going right. The successor node will be the first node up the ancestor chain that you encounter on the right chain.Golam Kawsar
/** * @param {BinaryTreeNode} node */ function getSuccessorAlg(node) { if(node.getRight() != null) { // has left subtree return getMin(node.getRight()); // return min of right subtree of given node } else { // no right subtree, try find successor in ancestors var child = node; var parent = node.getParent(); while(true) { if(parent == null) { // no parent, no successor return null; // no successor found } if(parent.getLeft() == child) { // arrived from left return parent; // successor found } // next loop child = parent; parent = parent.getParent(); } } }
To Pre-order Array
To traverse a tree data structure is to process every node exactly once. However you may "pass through" a node many times. For pre-order walk process node itself, recursively traverse its left subtree, recursively traverse its right subtree.Robert Holte
/** * @param {BinaryTree} tree */ function toPreorderArray(tree) { var array = new Array(); var node = tree.getRoot(); if(node == null) { return array; // empty tree } array.push(node); toPreorderArrayRec(node.getLeft(), array); toPreorderArrayRec(node.getRight(), array); return array; } /** * @param {BinaryTreeNode} node * @param {BinaryTreeNode[]} array */ function toPreorderArrayRec(node, array) { if(node == null) { return; } array.push(node); toPreorderArrayRec(node.getLeft(), array); toPreorderArrayRec(node.getRight(), array); }
To In-order (Sorted) Array
To traverse a tree data structure is to process every node exactly once. However you may "pass through" a node many times. For in-order walk recursively traverse node's left subtree, process node itself, recursively traverse node's right subtree.Robert Holte
/** * @param {BinaryTree} tree */ function toInorderArray(tree) { var array = new Array(); var node = tree.getRoot(); if(node == null) { return array; // empty tree } toInorderArrayRec(node.getLeft(), array); array.push(node); toInorderArrayRec(node.getRight(), array); return array; } /** * @param {BinaryTreeNode} node * @param {BinaryTreeNode[]} array */ function toInorderArrayRec(node, array) { if(node == null) { return; } toInorderArrayRec(node.getLeft(), array); array.push(node); toInorderArrayRec(node.getRight(), array); }
To Post-order Array
To traverse a tree data structure is to process every node exactly once. However you may "pass through" a node many times. For post-order walk recursively traverse node's left subtree, traverse node's right subtree, process node itself.Robert Holte
/** * @param {BinaryTree} tree */ function toPostorderArray(tree) { var array = new Array(); var node = tree.getRoot(); if(node == null) { return array; // empty tree } toPostorderArrayRec(node.getLeft(), array); toPostorderArrayRec(node.getRight(), array); array.push(node); return array; } /** * @param {BinaryTreeNode} node * @param {BinaryTreeNode[]} array */ function toPostorderArrayRec(node, array) { if(node == null) { return; } toPostorderArrayRec(node.getLeft(), array); toPostorderArrayRec(node.getRight(), array); array.push(node); }


| Path: | README.rdoc |
| Last Update: | Tue Oct 18 17:44:21 -0400 2011 |
Rack::Test is a small, simple testing API for Rack apps. It can be used on its own or as a reusable starting point for Web frameworks and testing libraries to build on. Most of its initial functionality is an extraction of Merb 1.0‘s request helpers feature.
require "rack/test" class HomepageTest < Test::Unit::TestCase include Rack::Test::Methods def app MyApp.new end def test_redirect_logged_in_users_to_dashboard authorize "bryan", "secret" get "/" follow_redirect! assert_equal "http://example.org/redirected", last_request.url assert last_response.ok? end end
To install the latest release as a gem:
sudo gem install rack-test
Copyright (c) 2008-2009 Bryan Helmkamp, Engine Yard Inc. See MIT-LICENSE.txt in this directory.


AMERICAN YAKUZA A Film Review Copyright Dragan Antulov 1999
The author of this review, while being introduced to the phenomenon called "straight-to-video" in the early 1990, made an interesting observation. It dealt with the trailers of the "straight-to-video" movies. The good trailers usually meant bad or unwatchable movies. The trailer for AMERICAN YAKUZA, 1993 action film by Nick A. Capello, was one of the better ones. But the movie itself was one of the rare exceptions to the rule above; it was surprisingly good and it delivered the goods promised in the trailer.
The plot of this movie, based on the screenplay by John Allen Nelson and Max Strom, uses the very same American phobias as much more spectacular (and less successful) RISING SUN - phobias based on the great success of Japanese economy in 1980s and the infiltration of Japanese capital into American mainland. But in order for this film to have attractive "straight-to-video" potential, the Japanese invasion of USA happens in the form of yakuzas - Japanese crime organisations that are taking over lucrative crime businesses from the locals like Mafia. Of course, that leads to the series of bloody conflicts and one of the people caught in the crossfire is Nick Davis (played by Viggo Mortensen), convict recently released from prison. He happens to be in the right place and the right time and saves the life of an important yakuza. Yakuza reward him by employing his services and he gradually begins to get their trust and friendship. Of course, they don't know that Davis is undercover FBI agent, now torn between his official duty and the loyalty he feels towards his new friends.
Although the screenplay seems rather weak excuse for the series of standard action scenes, the writers should be commended because very few of them would use the form of an action movie to preach multiculturalism, like Nelson and Strom do. Of course, the plot is full of simplifications and sometimes not very plausible events, like in many straight-to-video films. But AMERICAN YAKUZA still has a very good impact, because the direction by Nick A. Capello, very MTV-like style (few years before that style became fashionable), reminds the viewers of John Woo's Hong Kong films. The music by David C. Williams is also very good. But the most impressive element of the film is Viggo Mortensen, one of the most capable American character actors, here in a very unusual role of an action lead - tough, but sensitive man with a hidden agenda. AMERICAN YAKUZA is still a low-budget action film in its essence, but the talent of its makers managed to cross the barriers of such genre designation.
RATING: 6/10 (++)
Review written on September 11th 1999
Dragan Antulov a.k.a. Drax Fido: 2:381/100 E-mail<EMAIL_ADDRESS>E-mail<EMAIL_ADDRESS>E-mail<EMAIL_ADDRESS>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


Class: Thread::Delay
- Inherits:
-
Object
- Object
- Thread::Delay
- Defined in:
- thread-0.2.2/lib/thread/delay.rb
Overview
A delay is an object that incapsulates a block which is called upon value retrieval, and its result cached.
Instance Method Summary collapse
-
#delivered? ⇒ Boolean
(also: #realized?)
Check if the delay has been called.
-
#exception ⇒ Object
Return the raised exception.
-
#exception? ⇒ Boolean
Check if an exception has been raised.
-
#initialize(&block) ⇒ Delay
constructor
Create a delay with the passed block.
-
#value ⇒ Object
(also: #~)
Get the value of the delay, if it's already been executed, return the cached result, otherwise execute the block and return the value.
-
#value! ⇒ Object
(also: #!)
Do the same as #value, but return nil in case of exception.
Constructor Details
#initialize(&block) ⇒ Delay
Create a delay with the passed block.
17 18 19 20 21 22 |
# File 'thread-0.2.2/lib/thread/delay.rb', line 17 def initialize (&block) raise ArgumentError, 'no block given' unless block @mutex = Mutex.new @block = block end |
Instance Method Details
#delivered? ⇒ Boolean Also known as: realized?
Check if the delay has been called.
39 40 41 42 43 |
# File 'thread-0.2.2/lib/thread/delay.rb', line 39 def delivered? @mutex.synchronize { instance_variable_defined? :@value } end |
#exception ⇒ Object
Return the raised exception.
32 33 34 35 36 |
# File 'thread-0.2.2/lib/thread/delay.rb', line 32 def exception @mutex.synchronize { @exception } end |
#exception? ⇒ Boolean
Check if an exception has been raised.
25 26 27 28 29 |
# File 'thread-0.2.2/lib/thread/delay.rb', line 25 def exception? @mutex.synchronize { instance_variable_defined? :@exception } end |
#value ⇒ Object Also known as: ~
Get the value of the delay, if it's already been executed, return the cached result, otherwise execute the block and return the value.
In case the block raises an exception, it will be raised, the exception is cached and will be raised every time you access the value.
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'thread-0.2.2/lib/thread/delay.rb', line 52 def value @mutex.synchronize { raise @exception if instance_variable_defined? :@exception return @value if instance_variable_defined? :@value begin @value = @block.call rescue Exception => e @exception = e raise end } end |
#value! ⇒ Object Also known as: !
Do the same as #value, but return nil in case of exception.
71 72 73 74 75 76 77 |
# File 'thread-0.2.2/lib/thread/delay.rb', line 71 def value! begin value rescue Exception nil end end |


West Coast VPN 2016
Information
Agreement Name
Account Name
Primary Contact
--Select--
Diego Francis
Binding Period Start End
Record Type
--None--
MSA
Reference #
Is Perpetual?
Track Version?
Key Terms
Region
North America
Payment Terms
Net 30
Special Terms
Support Exhibits
--None--
Annual Uplift
--None--
Auto Renew?
SLA
Custom Fields


Class: LinkageCacheStore
- Inherits:
-
CacheStore
- Object
- CacheStore
- LinkageCacheStore
- Defined in:
- linkage_cache_store.rb
Overview
LinkageCacheStore provides methods to fetch and mutate linkage-specific data used
by the brew linkage
command.
Instance Method Summary collapse
-
#delete! ⇒ nil
Delete the keg from the LinkageCacheStore.
-
#fetch(type) ⇒ Hash
-
#initialize(keg_path, database) ⇒ nil
constructor
-
#keg_exists? ⇒ Boolean
Returns
true
if the database has any value for the currentkeg_path
. -
#update!(hash_values) ⇒ nil
Inserts dylib-related information into the cache if it does not exist or updates data into the linkage cache if it does exist.
Constructor Details
#initialize(keg_path, database) ⇒ nil
15 16 17 18 |
# File 'linkage_cache_store.rb', line 15 def initialize(keg_path, database) @keg_path = keg_path super(database) end |
Instance Method Details
#delete! ⇒ nil
Delete the keg from the LinkageCacheStore
62 63 64 |
# File 'linkage_cache_store.rb', line 62 def delete! database.delete(@keg_path) end |
#fetch(type) ⇒ Hash
47 48 49 50 51 52 53 54 55 56 57 |
# File 'linkage_cache_store.rb', line 47 def fetch(type) unless HASH_LINKAGE_TYPES.include?(type) raise TypeError, <<~EOS Can't fetch types that are not defined for the linkage store EOS end return {} unless keg_exists? fetch_hash_values(type) end |
#keg_exists? ⇒ Boolean
Returns true
if the database has any value for the current keg_path
.
23 24 25 |
# File 'linkage_cache_store.rb', line 23 def keg_exists? !database.get(@keg_path).nil? end |
#update!(hash_values) ⇒ nil
Inserts dylib-related information into the cache if it does not exist or updates data into the linkage cache if it does exist.
32 33 34 35 36 37 38 39 40 41 42 |
# File 'linkage_cache_store.rb', line 32 def update!(hash_values) hash_values.each_key do |type| next if HASH_LINKAGE_TYPES.include?(type) raise TypeError, <<~EOS Can't update types that are not defined for the linkage store EOS end database.set @keg_path, hash_values end |