Extended Object Tracking
Joint shape and state estimation
Abstract
I built a multithreaded C++ application using the JUCE API to model and track extended objects. In this page, I will discuss the mathematical details, along with how I approached the implementation.
Introduction
Late last year, while I was working on a professional problem tracking extended objects, I came across this paper and some Matlab code by the authors. I ended up pursuing a different approach than the one outlined in the paper, mostly due to differences between the problem the authors had considered and my problem, but I told myself that when I had time, I would dig deep into the paper and understand how the authors’ Matlab implementation worked. In addition to understanding the algorithm, I wanted to use what I had been learning about multithreaded embedded system applications using JUCE.
In this project post, I will discuss how I worked through the problem of building a multithreaded application that implemented the extended object tracking algorithm discussed in the previously referenced sources. I will begin with the final output of the algorithm:
The setup for the above GIF is:
- A ground-truth elliptical object, in white, moves at near constant velocity except when undergoing turns
- Returns off the surface of the object, shown as white squares, are processed by a modified Kalman filter to generate the state and shape/orientation estimate shown in green.
In the remainder of this post, I will go through the relevant details of the implementation, starting with the mathematics.
Mathematical Details
For the complete discussion, see the paper. I will discuss only the major points of the paper in the subequent sections.
Generating Ground Truth
The ground truth object is an ellipse that travels at constant speed. The object undergoes 4 counterclockwise turns during the simulation. The object state and orientation are modeled as explicitly time-dependent:
\[\dot x = v \cos \theta \\ \dot y = v \sin \theta \\ \theta = \begin{cases} -\frac{\pi}{4} & 0 \leq t \leq t_1 \\ -\frac{\pi}{4} + \frac{\pi}{4(t_2-t_1)} (t-t_1) & t_1 < t \leq t_2 \\ 0 & t_2 < t \leq t_3 \\ \frac{\pi}{2(t_4-t_3)} (t-t_3) & t_3 < t \leq t_4 \\ \frac{\pi}{2} & t_4 < t \leq t_5 \\ \frac{\pi}{2} + \frac{\pi}{2(t_6-t_5)} (t-t_5) & t_5 < t \leq t_6 \\ \pi & t > t_6 \end{cases} \\ \dot v = 0\]The object moves with it’s velocity along it’s major axis.
Modeling Sensor Measurements
Measurements are modeled as point returns. At each timestep, $k$, the set of all measurements has the form:
\[Y_k = \{ \mathbf{y}_{k,i} \}_{i=1}^{n_k},\]where the term $n_k$ is the number of measurements at time $k$, which follows a Poisson distribution. Each measurement $y_{k,i}$ is written as:
\[\mathbf{y}_{k,i} = \mathbf{m}_k + h_{k,i}^1 l_1 \begin{pmatrix} \cos \theta_k \\ \sin \theta_k \end{pmatrix} + h_{k,i}^2 l_2 \begin{pmatrix} -\sin \theta_k \\ \cos \theta_k \end{pmatrix} + \mathbf{v}_{k,i}\]The noise vectors \(\mathbf{h}_{k,i}\) and \(\mathbf{v}_{k,i}\) are clearly seen as multiplicative and additive, respectively. For the specific noise levels used, check the paper and the subsequent implementation.
In laymen’s terms: the values used for measurements are drawn from a multivariate normal distribution about the object’s center.
Tracking an Extended Object
Prediction Step
The kinematic state, $\mathbf{r}$, and covariance, $C^r$, are assumed to propagate according to a nearly-constant velocity model:
\[\mathbf{r}_{k|k-1} = A_r \mathbf{r}_{k-1|k-1} \\ A_r = \begin{pmatrix} 1 \ 0 \ \Delta t \ 0 \\ 0 \ 1 \ 0 \ \Delta t \\ 0 \ 0 \ 1 \ 0 \\ 0 \ 0 \ 0 \ 1 \end{pmatrix} \\ C^r_{k|k-1} = A_r C^r_{k-1|k-1} A_r^T + C^r_w,\]where $C^r_w$ is the state process covariance matrix.
For the shape and orientation process updates
\[\mathbf{p}_{k|k-1} = A_p \mathbf{p}_{k-1|k-1} \\ A_r = \begin{pmatrix} 1 \ 0 \ 0 \\ 0 \ 1 \ 0 \\ 0 \ 0 \ 1 \end{pmatrix} \\ C^p_{k|k-1} = A_p C^p_{k-1|k-1} A_p^T + C^p_w,\]where $C^p_w$ is the shape/orientation process covariance matrix.
Update Step
The update step revolves around first- and second-order moment estimation using a quadratic measurement, a 2-fold Kronecker product, to augment the existing linear measurement. The choice of this measurement model is due to the fact that there are not enough correlations between the state vector and the measurements, as the paper authors state. The total measurement vector combining the linear and quadratic measurements will be denoted as $\mathbf{z}_{k,i}$. Using this measurement model, the resulting update equations are:
\[\mathbf{r}_{k|k} = \mathbf{r}_{k|k-1} + M^r_k (S^r_k)^{-1} (\mathbf{z}_{k,i} - H \mathbf{r}_{k|k-1}) \\ C^r_{k|k} = C^r_{k|k-1} - M^r_k (S^r_k)^{-1} (M^r_k)^T\]where the matrix $H$ is the measurement Jacobian,
\[H = \begin{pmatrix} 1 \ 0 \ 0 \ 0 \\ 0 \ 1 \ 0 \ 0 \end{pmatrix}\]and the covariance matrices $M^r_k$ and $S^r_k$ are the measurement-to-state and measurement-to-measurement covariance matrices.
The update equations for the shape/orientation parameters have the same form, but have different covariance matrices.
Implementation
The implementation uses two third-party software packages: JUCE and Eigen.
JUCE
JUCE is a GUI-builder that is usually used for audio applications but it happens to be useful for other embedded system applications as well. In many ways, JUCE is similar to QT: it has a publish/subscribe messaging protocol for passing data across multiple threads, as well as a graphical front-end that can be used to plot output in real-time. Both of the aforementioned features were used in completing this project.
JUCE exports a project file that can be used to build an executable. For this project, I chose Xcode as the export target. Xcode’s built-in debugger was very useful throughout the whole project, though it was a bit difficult at times because the program is multithreaded.
Eigen
Eigen is an API for building and operating on matrix and vector data types. Operator-overloading makes matrix operations a breeze. There is also built-in support for computationally-intensive operations like matrix decompositions, eigenvector computation, and matrix inversion. Eigen outperforms similar linear algebra packages; check the website for benchmarks.
Building the Application
Modeling measurements
I created a timer thread that executes at a fixed rate. Once a full cycle of the timer thread executes, a new measurement comprised of a set of $n$ points, where $n$ is drawn from a Poisson distribution. Each of the $n$ points are drawn from a multivariate Gaussian distribution. For all random number calls, the C++ standard library was used. After a new measurement set is generated, the sensor thread sends a change message to notify the main process to execute it’s run
method.
Kalman filter
The use of the Eigen API made the Kalman filter estimation straight-forward and relatively simple. Due to the overloading of operators, such as *
and +
, matrix multiplication and addition resembles very closely the corresponding operations in Matlab, which the paper authors used for their original implementation.
Only limited a priori knowledge regarding shape of the object is assumed; I initially assume that the object is circular with radius equal to the larger of the two axes of the true extended object. This makes sense from an operational standpoint; in the absence of more information, filters are initialized using heuristic assumptions about the objects-to-track, e.g. cars in this case. The position of the object’s center is set to the mean of the first set of measurements and the velocity is set to 0, since we cannot observe velocity, directly or indirectly. After the filter has been initialized, the processing cycle follows the normal schema for Kalman filters: predict to current time, and then correct the predicted estimate with the latest measurement.
Putting it all together
I was able to use a pre-existing GUI application: plot window + background + run button. The plot window uses draw utilities from the JUCE API to plot the measurements, ground truth, and the estimated extended object. The run button creates pointers to new sensor and Kalman filter objects, which are then executed to update the plot window.
The main loop executes at 1Hz because of the sleep thread that signals when to generate new sensor data. Consequently, new data is plotted at roughly 1Hz, as well.
Challenges
The biggest challenge of this project, as in so many estimation tasks, was selecting proper noise terms. The algorithm is sensitive to the choice of noise terms. However, when I reviewed a different reference, I was able to find a suitable noise model using a single parameter for the acceleration noise.
With regards to the measurement modeling: C++ does not have built-in support for generating multivariate Gaussian random numbers, so I had to write my own utility to do it. With Eigen, this was no big deal; literally, this was a one-liner.
One final note regarding what I found mildly frustrating: different compilers initialize allocated memory differently! This has caused me heartburn from time-to-time, but I have become spoiled because my compiler of choice, g++, zeros out the memory when it allocates. JUCE + Xcode does not! Thankfully, the results I was observing were not repeatable and were consistent with improper initialization. From now on, I will explicitly zero out memory at initialization to avoid problems in the future.


Readings of all orientation data are given in azimuth of dip and angle of dip. These are the readings of the two-circle Clar-compass (according to E. CLAR). the azimuth of dip is the clockwise angle between north and the direction of dip of a plane or a lineation. The dip direction is normal to the strike line.


--- # Feel free to add content and custom Front Matter to this file. # To modify the layout, see https://jekyllrb.com/docs/themes/#overriding-theme-defaults layout: home ---
Robert Martin (2012)
Andrew Hunt, David Thomas (1999)
Kent Beck (2010)
Michael C. Feathers (2013)
Erich Gamma (2000)


We’ll be back soon!
Sorry for the inconvenience but we’re making updates to the site. If you need to you can always contact us!
— Mekeni!
6339 Mission Street, Daly City, 91404
650.992.6020
Sorry for the inconvenience but we’re making updates to the site. If you need to you can always contact us!
— Mekeni!
6339 Mission Street, Daly City, 91404
650.992.6020


Silver Star Mall Al-Ghada-Mohamed Naguib Axis-Rehab Road-New Cairo
0122589554
19025
Register now
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s


Encapsulates the pattern of wanting to validate the acceptance of a terms of service check box (or similar agreement). Example:
class Person < ActiveRecord::Base validates_acceptance_of :terms_of_service validates_acceptance_of :eula, :message => "must be abided" end
If the database column does not exist, the terms_of_service attribute is entirely virtual. This check is performed only if terms_of_service is not nil and by default on save.
Configuration options:
# File /usr/lib/ruby/gems/1.8/gems/activemodel-3.0.0.beta4/lib/active_model/validations/acceptance.rb, line 48 48: def validates_acceptance_of(*attr_names) 49: validates_with AcceptanceValidator, _merge_attributes(attr_names) 50: end
Encapsulates the pattern of wanting to validate a password or email address field with a confirmation. Example:
Model: class Person < ActiveRecord::Base validates_confirmation_of :user_name, :password validates_confirmation_of :email_address, :message => "should match confirmation" end View: <%= password_field "person", "password" %> <%= password_field "person", "password_confirmation" %>
The added password_confirmation attribute is virtual; it exists only as an in-memory attribute for validating the password. To achieve this, the validation adds accessors to the model for the confirmation attribute. NOTE: This check is performed only if password_confirmation is not nil, and by default only on save. To require confirmation, make sure to add a presence check for the confirmation attribute:
validates_presence_of :password_confirmation, :if => :password_changed?
Configuration options:
# File /usr/lib/ruby/gems/1.8/gems/activemodel-3.0.0.beta4/lib/active_model/validations/confirmation.rb, line 44 44: def validates_confirmation_of(*attr_names) 45: validates_with ConfirmationValidator, _merge_attributes(attr_names) 46: end
Validates that the value of the specified attribute is not in a particular enumerable object.
class Person < ActiveRecord::Base validates_exclusion_of :username, :in => %w( admin superuser ), :message => "You don't belong here" validates_exclusion_of :age, :in => 30..60, :message => "This site is only for under 30 and over 60" validates_exclusion_of :format, :in => %w( mov avi ), :message => "extension %{value} is not allowed" end
Configuration options:
# File /usr/lib/ruby/gems/1.8/gems/activemodel-3.0.0.beta4/lib/active_model/validations/exclusion.rb, line 35 35: def validates_exclusion_of(*attr_names) 36: validates_with ExclusionValidator, _merge_attributes(attr_names) 37: end
Validates whether the value of the specified attribute is of the correct form, going by the regular expression provided. You can require that the attribute matches the regular expression:
class Person < ActiveRecord::Base validates_format_of :email, :with => /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\Z/i, :on => :create end
Alternatively, you can require that the specified attribute does not match the regular expression:
class Person < ActiveRecord::Base validates_format_of :email, :without => /NOSPAM/ end
Note: use \A and \Z to match the start and end of the string, ^ and $ match the start/end of a line.
You must pass either :with or :without as an option. In addition, both must be a regular expression, or else an exception will be raised.
Configuration options:
# File /usr/lib/ruby/gems/1.8/gems/activemodel-3.0.0.beta4/lib/active_model/validations/format.rb, line 59 59: def validates_format_of(*attr_names) 60: validates_with FormatValidator, _merge_attributes(attr_names) 61: end
Validates whether the value of the specified attribute is available in a particular enumerable object.
class Person < ActiveRecord::Base validates_inclusion_of :gender, :in => %w( m f ) validates_inclusion_of :age, :in => 0..99 validates_inclusion_of :format, :in => %w( jpg gif png ), :message => "extension %{value} is not included in the list" end
Configuration options:
# File /usr/lib/ruby/gems/1.8/gems/activemodel-3.0.0.beta4/lib/active_model/validations/inclusion.rb, line 35 35: def validates_inclusion_of(*attr_names) 36: validates_with InclusionValidator, _merge_attributes(attr_names) 37: end
Validates that the specified attribute matches the length restrictions supplied. Only one option can be used at a time:
class Person < ActiveRecord::Base validates_length_of :first_name, :maximum=>30 validates_length_of :last_name, :maximum=>30, :message=>"less than 30 if you don't mind" validates_length_of :fax, :in => 7..32, :allow_nil => true validates_length_of :phone, :in => 7..32, :allow_blank => true validates_length_of :user_name, :within => 6..20, :too_long => "pick a shorter name", :too_short => "pick a longer name" validates_length_of :zip_code, :minimum => 5, :too_short => "please enter at least 5 characters" validates_length_of :smurf_leader, :is => 4, :message => "papa is spelled with 4 characters... don't play me." validates_length_of :essay, :minimum => 100, :too_short => "Your essay must be at least 100 words."), :tokenizer => lambda {|str| str.scan(/\w+/) } end
Configuration options:
# File /usr/lib/ruby/gems/1.8/gems/activemodel-3.0.0.beta4/lib/active_model/validations/length.rb, line 91 91: def validates_length_of(*attr_names) 92: validates_with LengthValidator, _merge_attributes(attr_names) 93: end
Validates whether the value of the specified attribute is numeric by trying to convert it to a float with Kernel.Float (if only_integer is false) or applying it to the regular expression /\A[+\-]?\d+\Z/ (if only_integer is set to true).
class Person < ActiveRecord::Base validates_numericality_of :value, :on => :create end
Configuration options:
The following checks can also be supplied with a proc or a symbol which corresponds to a method:
class Person < ActiveRecord::Base
validates_numericality_of :width, :less_than => Proc.new { |person| person.height } validates_numericality_of :width, :greater_than => :minimum_weight
end
# File /usr/lib/ruby/gems/1.8/gems/activemodel-3.0.0.beta4/lib/active_model/validations/numericality.rb, line 118 118: def validates_numericality_of(*attr_names) 119: validates_with NumericalityValidator, _merge_attributes(attr_names) 120: end
Validates that the specified attributes are not blank (as defined by Object#blank?). Happens by default on save. Example:
class Person < ActiveRecord::Base validates_presence_of :first_name end
The first_name attribute must be in the object and it cannot be blank.
If you want to validate the presence of a boolean field (where the real values are true and false), you will want to use validates_inclusion_of :field_name, :in => [true, false].
This is due to the way Object#blank? handles boolean values: false.blank? # => true.
Configuration options:
# File /usr/lib/ruby/gems/1.8/gems/activemodel-3.0.0.beta4/lib/active_model/validations/presence.rb, line 36 36: def validates_presence_of(*attr_names) 37: validates_with PresenceValidator, _merge_attributes(attr_names) 38: end


Add an Twitter App
To add an app to SocialBot you need to create one via https://apps.twitter.com.
You need a twitter account to do that.
You need to do the following things:
Add an Twitter App
Add a Bot to SocialBot
To create a bot you need to add an user to your app.
To add a user to your twitter app be sure to be logged in as the user you want to add.
By clicking the 'Next' Button you will be taken to twitter to authenticate your user for the app.
You then need to press 'Authorize' and put displayed PIN into the field.
As soon as the process is successfully finished the bot will be added.
Add a User to your Twitter App
To add the user to your app you need to type the pin you got from twitter into the form.
Please also provide a name for your bot.


Non-linear least squares regression with the Levenberg-Marquardt algorithm using multiple starting values for increasing the chance that the minimum found is the global minimum.
| Version: | 1.0.0 |
| Depends: | R (≥ 3.2.1) |
| Imports: | minpack.lm, purrr, dplyr, tidyr, tibble |
| Suggests: | ggplot2, broom, nlstools, testthat |
| Published: | 2018-03-06 |
| Author: | Daniel Padfield [aut, cre], Granville Matheson [aut] |
| Maintainer: | Daniel Padfield <d.padfield at exeter.ac.uk> |
| License: | GPL-3 |
| NeedsCompilation: | no |
| Materials: | README NEWS |
| CRAN checks: | nls.multstart results |
| Reference manual: | nls.multstart.pdf |
| Package source: | nls.multstart_1.0.0.tar.gz |
| Windows binaries: | r-devel: nls.multstart_1.0.0.zip, r-release: nls.multstart_1.0.0.zip, r-oldrel: nls.multstart_1.0.0.zip |
| OS X binaries: | r-release: nls.multstart_1.0.0.tgz, r-oldrel: nls.multstart_1.0.0.tgz |
Please use the canonical form https://CRAN.R-project.org/package=nls.multstart to link to this page.


Joker Sequel In The Works
by Lucy ConnollyWant to hear something that will put a smile on your face? Sources have confirmed a follow-up to Joker is in the works.
Advertisements
According to reports, the film’s director, Todd Phillips, is likely to reunite with Joaquin Phoenix, with the two reportedly in talks about a sequel.
Not only that, but Phillips is expected to write the script alongside Scott Silver, who worked on the first movie’s screenplay.
Advertisements
Warner Bros. is said to already have a sequel option in place for Joaquin Phoenix – who is a strong contender for the ‘Best Actor’ category in next year’s Oscars – and so we can expect him to return as Arthur Fleck.
Sources told The Hollywood Reporter Phillips was initially in discussions with Warner Bros. Pictures Group chairman Toby Emmerich to develop a range of DC characters’ origin stories.
After pitching the idea in a meeting on October 7 – i.e. immediately after the film’s multi million-dollar opening weekend – it got turned down. However, it’s said he emerged from the meeting with the rights to make one other DC story.
For those of you wondering what kind of sequel might be in the works, wonder no longer because Phillips has previously hinted at what he might do.
Advertisements
The director told the Los Angeles Times it couldn’t just be ‘this wild and crazy movie’ about the Joker, adding: ‘It would have to have some thematic resonance in a similar way that this does.’
When you think about the film’s success, it’s really no wonder a follow-up is in the works; Joker was brilliantly received even before its release, receiving an eight-minute standing ovation at the Venice Film Festival.
It soon overtook Deadpool to become the highest-grossing R-rated movie of all time, and just last week the film crossed the $1 billion mark at the worldwide box office, becoming the first R-rated film ever to do so.
Advertisements
In fact, Joker marks only the fourth DC title to cross the $1 billion mark, following in the footsteps of Aquaman ($1.15 billion), The Dark Knight Rises ($1.08 billion) and The Dark Knight ($1 billion).
And with a budget of $62.5 million – far less than the prior-mentioned films – Joker has managed to become the most profitable comicbook movie of all time too.
Making that feat even more impressive is the fact that the film hasn’t even been released in China yet – and doesn’t look set to do so, either – so these statistics are missing from one of the key markets.
If that bit of news hasn’t put a smile on your face, I don’t know what will.
Joker is in cinemas now.
A Broadcast Journalism Masters graduate who went on to achieve an NCTJ level 3 Diploma in Journalism, Lucy has done stints at ITV, BBC Inside Out and Key 103. While working as a journalist for UNILAD, Lucy has reported on breaking news stories while also writing features about mental health, cervical screening awareness, and Little Mix (who she is unapologetically obsessed with).


various utilities not related to optimization
| Class |
|
blanc container class to have a collection of attributes. |
| Class |
|
a dictionary of lists (of data) |
| Class |
|
resembling somewhat types.SimpleNamespace from Python >=3.3 but with instantiation and resembling even more the dataclass decorator from Python >=3.7. |
| Class |
|
for conveniently adding methods/functionality to a dictionary. |
| Class |
|
A class wrapped over dict to use class .-notation. |
| Class |
|
read from a string or file all key-value pairs within all <python>...</python> tags and return a dict . |
| Class |
|
measure elapsed cumulative time while not paused and elapsed time since last tic. |
| Class |
|
For delayed selective mirrored sampling |
| Class |
|
A list of callables that can be called like a single callable . |
| Class |
|
make sure that this list does not grow unbounded |
| Class |
|
callable instance to save and show figures from matplotlib . |
| Class |
|
dictionary with computation of an hash key. |
| Class |
|
wrap a timer around a callable. |
| Function | argsort |
return index list to get a in order, ie a[argsort(a)[i]] == sorted(a)[i], which leads to unexpected results with np.nan entries, because any comparison with np.nan is False . |
| Function | as |
a tool to handle a vector or a list of vectors in the same way, return a list of vectors and a function to revert the "list making". |
| Function | download |
Undocumented |
| Function | extract |
filename must be a valid path in the tar |
| Function | format |
put line breaks and trailing white spaces |
| Function | is_ |
intuitive handling of variable truth value also for numpy arrays. |
| Function | is |
return all(is_(v) for v in var_list) |
| Function | is |
return any(is_(v) for v in var_list) |
| Function | is |
return np.isnan(var) or False if var is not numeric |
| Function | is |
see is_ |
| Function | is |
return True if var == 1 or ones vector |
| Function | is |
bytes (in Python 3) also fit the bill. |
| Function | is |
make an educated guess whether x is a list of vectors. |
| Function | num2str |
returns the shortest string representation. |
| Function | pprint |
nicely formated print |
| Function | print |
Undocumented |
| Function | print |
Poor man's maxwarns: warn only if iteration<=maxwarns |
| Function | ranks |
return ranks of entries starting with zero based on Pythons sorted . |
| Function | recycled |
return vec with the last element recycled to dim if len(vec) doesn't fail, else vec. |
| Function | rglen |
return generator range(len(.)) with shortcut rglen(.) |
| Function | set |
assign, for example, all arguments given to an __init__ method to attributes in self or self.params or self.args. |
| Function | seval |
Undocumented |
| Function | zero |
generate increasing index pairs (i, j) with all(diffs[i:j] == 0) |
| Constant | PY2 |
Undocumented |
| Variable | global |
Undocumented |
return index list to get a
in order, ie
a[argsort(a)[i]] == sorted(a)[i], which leads to unexpected
results with np.nan
entries, because any comparison with np.nan
is False
.
a tool to handle a vector or a list of vectors in the same way, return a list of vectors and a function to revert the "list making".
Useful when we might either have a single solution vector or a set/list/population of vectors to deal with.
Namely, this function allows to replace a slightly more verbose:
was_list = utils.is_vector_list(X) X = X if was_list else [X] # work work work on X, e.g. res = [x[0] + 1 for x in X] res = res if was_list else res[0]
with:
X, revert = utils.as_vector_list(X) # work work work on X, e.g. res = [x[0] + 2 for x in X] res, ... = revert(res, ...) # also allows to revert X, if desired
Testing:
>>> from cma.utilities import utils >>> X = [3] # a single vector >>> X, revert_vlist = utils.as_vector_list(X) # BEGIN >>> assert X == [[3]] # a list with one element >>> # work work work on X as a list of vectors, e.g. >>> res = [x[0] + 1 for x in X] >>> X, res = revert_vlist(X, res) # END >>> assert res == 4 >>> assert X[0] == 3
intuitive handling of variable truth value also for numpy
arrays.
Return True
for any non-empty container, otherwise the truth value of the
scalar var
.
Caveat of the most unintuitive case: [0] evaluates to True, like [0, 0].
>>> import numpy as np >>> from cma.utilities.utils import is_ >>> is_({}) or is_(()) or is_(0) or is_(None) or is_(np.array(0)) False >>> is_({0:0}) and is_((0,)) and is_(np.array([0])) True
bytes
(in Python 3) also fit the bill.
>>> from cma.utilities.utils import is_str >>> assert is_str(b'a') * is_str('a') * is_str(u'a') * is_str(r'b') >>> assert not is_str([1]) and not is_str(1)
make an educated guess whether x is a list of vectors.
>>> from cma.utilities.utils import is_vector_list as ivl >>> assert ivl([[0], [0]]) and not ivl([1,2,3])
returns the shortest string representation.
Generally, display either significant_digits digits or its true value, whichever is shorter.
force_rounding shows no more than the desired number of significant digits, which means, e.g., 12345 becomes 12000.
remove_trailing_zeros removes zeros, if and only if the value is exactly.
desired_length adds digits up to the desired length.
>>> from cma.utilities import utils >>> print([utils.num2str(val) for val in [12345, 1234.5, 123.45, ... 12.345, 1.2345, .12345, .012345, .0012345]]) ['12345', '1234', '123', '12', '1.2', '0.12', '0.012', '1.2e-3']
Poor man's maxwarns: warn only if iteration<=maxwarns
return ranks of entries starting with zero based on Pythons sorted
.
This leads to unreasonable results with np.nan
values.
return vec with the last element recycled to dim if len(vec) doesn't fail, else vec.
If dim is not given, len(as_) is used if available, else a scalar is returned.
assign, for example, all arguments given to an __init__ method to attributes in self or self.params or self.args.
If initial_params_dict_name is given, dict_ is also copied into an attribute of self with name initial_params_dict_name:
setattr(self, initial_params_dict_name, dict_.copy())
and the self key is removed from the copied dict
if present.
>>> from cma.utilities.utils import set_attributes_from_dict >>> class C(object): ... def __init__(self, arg1, arg2, arg3=None): ... assert len(locals()) == 4 # arguments are locally visible ... set_attributes_from_dict(self, locals()) >>> c = C(1, 22) >>> assert c.arg1 == 1 and c.arg2 == 22 and c.arg3 is None >>> assert len(c.__dict__) == 3 and not hasattr(c, 'self')
Details:
The entry dict_['self'] is always ignored.
Alternatively:
self.args = locals().copy() self.args.pop('self', None) # not strictly necessary
puts all arguments into self.args: dict.
generate increasing index pairs (i, j) with all(diffs[i:j] == 0)
and diffs[j] != 0 or j == len(diffs), thereby identifying "flat
spots/areas" in diffs
.
Returns the respective generator type.
Not anymore used to smoothen ECDFs.
Example:
>>> from cma.utilities.utils import zero_values_indices >>> for i, j in zero_values_indices([0, 0.1, 0, 0, 3.2, 0, 2.1]): ... print((i, j)) (0, 1) (2, 4) (5, 6)


http://ethicalhackingblog.com/hacking-powershell-empire-2-0/
http://www.harmj0y.net/blog/empire/expanding-your-empire/
https://enigma0x3.net/2016/01/28/an-empire-case-study/
https://enigma0x3.net/2015/08/26/empire-tips-and-tricks/
See Privilege Escalation > Windows > Everything To Enumerate > Gathering AD Data
and
See Privilege Escalation > Windows > Everything To Enumerate > Empire Modules


This morning, at nine o' clock, I celebrated Adam's birthday, for as we know
In the seventeenth century, in his great work, Dr. John Lightfoot, Vice-Chancellor of the University of Cambridge, and one of the most eminent Hebrew scholars of his time, declared, as the result of his most profound and exhaustive study of the Scriptures, that “heaven and earth, centre and circumference, were created all together, in the same instant, and clouds full of water,” and that “this work took place and man was created by the Trinity on October 23, 4004 B.C., at nine of the clock in the morning
or so said Andrew Dickson White in A History of the Warfare of Science with Theology in Christendom (1896). It has been suggested that White was rather selectively quoting Lightfoot, and there are arguments to be had. But let us not get into a kerfuffle about it. Clearly the important thing is that God knew what time it was, on what day, in what month, of what year. Being majestic and subtle and ineffable, He did not proclaim the beginning of all things as “Year Zero”, as the tiresomely literal-minded Pol Pot did, in spite of a French university education. I think we can all be grateful that the universe, with all its kinks and crooked timbers, was created by a mischievous beardy rascal and not by that Cambodian psychopath.


Selects
Home
Native & Custom select
Native select:
Standard: 7 day
Rush: 3 days
Express: next day
Overnight
Custom select:
Standard: 7 day
Rush: 3 days
Express: next day
Overnight
Custom select, 1 selected:
Standard: 7 day
Rush: 3 days
Express: next day
Overnight
Custom select, 1 disabled:
Standard: 7 day
Rush: 3 days
Express: next day
Overnight
Custom select, long:
Alabama
Alaska
Arizona
Arkansas
California
Colorado
Connecticut
Delaware
Florida
Georgia
Hawaii
Idaho
Illinois
Indiana
Iowa
Kansas
Kentucky
Louisiana
Maine
Maryland
Massachusetts
Michigan
Minnesota
Mississippi
Missouri
Montana
Nebraska
Nevada
New Hampshire
New Jersey
New Mexico
New York
North Carolina
North Dakota
Ohio
Oklahoma
Oregon
Pennsylvania
Rhode Island
South Carolina
South Dakota
Tennessee
Texas
Utah
Vermont
Virginia
Washington
West Virginia
Wisconsin
Wyoming
Custom select, data-placeholder:
Choose one...
Standard: 7 day
Rush: 3 days
Express: next day
Overnight
Custom select, option w/o value:
Choose one...
Standard: 7 day
Rush: 3 days
Express: next day
Overnight
Custom select, option w/o value/content:
Standard: 7 day
Rush: 3 days
Express: next day
Overnight
Custom multiple select:
Choose options
Standard: 7 day
Rush: 3 days
Express: next day
Overnight
Custom multiple select, long:
Choose options
Alabama
Alaska
Arizona
Arkansas
California
Colorado
Connecticut
Delaware
Florida
Georgia
Hawaii
Idaho
Illinois
Indiana
Iowa
Kansas
Kentucky
Louisiana
Maine
Maryland
Massachusetts
Michigan
Minnesota
Mississippi
Missouri
Montana
Nebraska
Nevada
New Hampshire
New Jersey
New Mexico
New York
North Carolina
North Dakota
Ohio
Oklahoma
Oregon
Pennsylvania
Rhode Island
South Carolina
South Dakota
Tennessee
Texas
Utah
Vermont
Virginia
Washington
West Virginia
Wisconsin
Wyoming
Native select, optgroup:
Choose shipping method
Standard: 7 day
Rush: 3 days
Express: next day
Overnight
First Overnight
Express Saver
Ground
Custom select, optgroup:
Choose shipping method
Standard: 7 day
Rush: 3 days
Express: next day
Overnight
First Overnight
Express Saver
Ground


Part of Macker's power is its ability to apply rules to a whole categories of classes which have certain roles or characteristics. Macker relies on you to use naming and packaging conventions to make these roles and layers well-defined -- the programmer still has to think a bit about what they're doing! (Macker will is also able to look at some attributes other than name; see filters. Strong AI which intuits the role of a particular class, however, is not currently in scope.)
At the heart of class categorization is a simple regular expression syntax, governed by just a few rules:
java.lang.String
").
java
", "lang
", "String
"). The wildcard *
matches zero or more characters within a part, while **
matches across part boundaries.
**
prefix and suffix.)
Here are a few examples to give you the idea:
| This regex... | ...will match these classes... | ...but not these. |
|---|---|---|
| java.lang.* | java.lang.String | java.lang.reflect.Method
java.language.MadeUpClass |
| java.lang.** | java.lang.String
java.lang.reflect.Method |
java.language.MadeUpClass |
| java.lang** | java.lang.String
java.lang.reflect.Method java.language.MadeUpClass |
|
| String | String (a hypothetical class named "String" not in a package) |
java.lang.String (the actual Java language String class) |
| java.lang.String | java.lang.String | String |
| *String* | String | java.lang.String
java.lang.StringBuffer java.text.AttributedString |
| **String* | String
java.lang.String java.lang.StringBuffer java.text.AttributedString |
|
| **String | String
java.lang.String java.text.AttributedString |
java.lang.StringBuffer |
| **.String* | String
java.lang.String java.lang.StringBuffer |
java.text.AttributedString |
Note that the Macker regex syntax currently does not support any sort of "OR" construct. This is because one can accomplish the same thing using composite patterns (explained in the next section). I might consider adding this functionality to the actual regex syntax if there is demand for it.
Macker does not currently support any alternate regex syntaxes. In the future, it will include support for Java regex and/or Apache regexp. (Although Macker currently uses Apache regexp internally, I'm holding off on exposing its syntax as part of Macker's published API.)


Class juce.Component
JUCE Component.
Is a pointer to a JUCE Component
As of now, components can't be created by protoplug scripts. This is mainly for accessing the custom GUI component using gui.getComponent.
Methods
| juce.Component:repaint () | Request total repaint. |
| juce.Component:repaint (area) | Request partial repaint. |
| juce.Component:repaint (x, y, width, height) | Request partial repaint. |
| juce.Component:createComponentSnapshot (areaToGrab[, clipImageToComponentBounds=true[, scaleFactor=1]]) |
Create component snapshot. |
Methods
- juce.Component:repaint ()
- Request total repaint. Tell the operating system that the component is "dirty" and needs to be redrawn. The component's paint method will be called asynchronously (gui.paint)
- juce.Component:repaint (area)
-
Request partial repaint.
Tell the operating system that a portion of the component is "dirty" and needs to be redrawn.
The component's paint method will be called asynchronously (gui.paint). The dirty region will be accessible
with Graphics.getClipBounds().
Parameters:
- area juce.Rectangle_int the region needing the be redrawn
- juce.Component:repaint (x, y, width, height)
-
Request partial repaint.
Tell the operating system that a portion of the component is "dirty" and needs to be redrawn.
The component's paint method will be called asynchronously (gui.paint). The dirty region will be accessible
with Graphics.getClipBounds().
Parameters:
- x the region needing the be redrawn
- y the region needing the be redrawn
- width the region needing the be redrawn
- height the region needing the be redrawn
-
juce.Component:createComponentSnapshot
(areaToGrab[, clipImageToComponentBounds=true[, scaleFactor=1]]) -
Create component snapshot.
Paint the component into a virtual buffer and return it as an image.
Parameters:
- areaToGrab juce.Rectangle_int the region to the be drawn
- clipImageToComponentBounds (default true)
- scaleFactor (default 1)
Returns:


Bio
Florida native, Washington raised since 2000. I have been married to my wife for 9 years. We have a 19 month old son named Sebastian and will have our daughter Athena in December. I am big into football and basketball. I also enjoy comics, video games, and I am a pretty dope bowler. I have played the drums since age 6 or 7 and I played the trombone from middle school into high school. My wife and I are archery hunters, just deer for now, but we do want to expand our horizons. Golf is the next thing I look to add to my skillset because it is chill, relaxing, and would totally make me feel like more of an adult.


Humdinger
Bell ringer
Got a nasty stinger
To slow you down
Mud slinger
Gold digger
Who point the finger
And do you down
Kickin’ and a fightin’ on a TV show
Lightin’ blindin’ in the middle of the road
Are you comin’ in
Are you comin’ in
I said come into the house of
Come into the house of
Come into the house of jazz
Come into the house of
Come into the house of
Come into the house of jazz
Ball stripper
Big tipper
Got a slap ‘n’ tickler
To make you growl
Spitin’ and bitin’ on a TV show
Tightenin’ frightenin’ givin’ out a load
Are you comin’ in
Are you comin’ in
I said come into the house of
Come into the house of
Come into the house of jazz
Come into the house of
Come into the house of
Come into the house of jazz


As compared with earlier times where a reservation personnel has to update its inventory every time.
Travel has helped us to understand the meaning of life and it has helped us become better people. Each time we travel, we see the world with new eyes.
A wonderful little cottage right on the seashore - perfect for exploring.
A wonderful little cottage right on the seashore - perfect for exploring.
A wonderful little cottage right on the seashore - perfect for exploring.
A wonderful little cottage right on the seashore - perfect for exploring.
A wonderful little cottage right on the seashore - perfect for exploring.
A wonderful little cottage right on the seashore - perfect for exploring.
Travel has helped us to understand the meaning of life and it has helped us become better people. Each time we travel, we see the world with new eyes.Travel has helped us to understand the meaning of life and it has helped us become better people. Each time we travel, we see the world with new eyes.Travel has helped us to understand the meaning of life and it has helped us.
Travel has helped us to understand the meaning of life and it has helped us become better people. Each time we travel, we see the world with new eyes.
Travel has helped us to understand the meaning of life and it has helped us become better people. Each time we travel, we see the world with new eyes.
Travel has helped us to understand the meaning of life and it has helped us become better people. Each time we travel, we see the world with new eyes.
A wonderful little cottage right on the seashore - perfect for exploring with the little boat which is included in the price. Located opposite Nidri sleeping.
Travel has helped us to understand the meaning of life and it has helped us become better people. Each time we travel, we see the world with new eyes.
I have personally participated in many of the programs mentioned on this site. One of the programs is Save Our I have personally in many of the programs mentioned on this site.


--- title: "Making A Custom Dockerfile To Host A Shiny App" author: Timothy Deitz, Clinical Psychologist & Data Science Consultant date: '2019-12-14' categories: - Docker tags: - Docker output: blogdown::html_page: toc: no ---
In this post, I demonstrate how to copy files required for my Shiny app into a custom Docker image.
I start by examining which images I have stored on my machine:
docker image ls
REPOSITORY TAG IMAGE ID CREATED SIZE
rocker/shiny-verse latest 94490fbd4d3b 9 days ago 1.86GB
mysql latest d435eee2caa5 3 weeks ago 456MB
nginx latest 231d40e811cd 3 weeks ago 126MB
bretfisher/jekyll-serve latest 144799b59c39 5 months ago 269MB
openanalytics/shinyproxy-demo latest 9a83d7d80ebf 10 months ago 925MB
postgres 9.6.2 b3b8a2229953 2 years ago 267MB
postgres 9.6.1 4023a747a01a 2 years ago 265MB
As you can see, the rocker/shiny-verse
image is available from when I last pulled it from Dockerhub.
Now I’m going to make a new Dockerfile that hardcodes the styling of my Shiny app. Normally the css stylesheet for a Shiny app is stored in a www
folder, which is situated in the same directory as your app files.
Below, I navigate to the root of the folder in which my Shiny app is contained and create the Dockerfile.
cd rocker_proj
touch Dockerfile
The Dockerfile is blank when I open it. I add the following content, which is explained below:
cat Dockerfile
## FROM rocker/shiny-verse
##
## WORKDIR /srv/shiny-server/
##
## COPY /srv/shinyapps/example_app/www/ example_app/www/
All dockerfiles need to begin with the FROM
instruction. This instruction indicates the parent image from which you are building. The WORKDIR
command sets the working directory for any RUN
, CMD
, ENTRYPOINT
, COPY
and ADD
instructions that come after it in the dockerfile.
The COPY
instruction copies new files or directories from the source (i.e. the host) and adds them to the filesystem of the container. You can specify the path of the source but otherwise, this path will be taken from the build context (i.e. the folder you are in when you build the container). In this example, I am in the rocker_proj
folder. From within this folder, the path to the www
folder containing my stylesheet will be /srv/shinyapps/example_app/www/
. We already know that within the container, the working directory is /srv/shiny-server/
. When I add example_app/www/
as the destination, these directories will be created with in the container as subdirectories of the working directory. Note that there is no /
before the destination path — this ensures that Docker will treat it as a relative path (relative to WORKDIR
) and not an absolute path.
According to Docker documentation, “You are strongly encouraged to use VOLUME for any mutable and/or user-serviceable parts of your image”. Thus, I wouldn’t ordinarily hardcode css styling into the image layers — because the styling is likely to need alteration over time. Rather, I should use the COPY
instruction only for files that really aren’t likely to change.
To build the image and store it locally, I run:
docker image build -t custom_rocker .
The -t
flag stands for the name of the “tag” I am giving the image: in this case, “custom_rocker”. The dot .
at the end means that the image should be built using the Dockerfile in the current folder. Also, if I wanted to push the new image to my Dockerhub repo, I would need to prefix tag with my username. So it would be `timothydeitz/custom_rocker".
Finally, I build the new container, as follows:
docker container run --rm -p 3838:3838 -v /Users/timothyjamesdeitz/rocker_proj/srv/shinyapps/:/srv/shiny-server/ -v /Users/timothyjamesdeitz/rocker_proj/srv/shinylog/:/var/log/shiny-server/ custom_rocker
Which gives me the following output:
[2019-12-11T11:32:16.945] [INFO] shiny-server - Shiny Server v<IP_ADDRESS>3 (Node.js v10.15.3)
[2019-12-11T11:32:16.961] [INFO] shiny-server - Using config file "/etc/shiny-server/shiny-server.conf"
[2019-12-11T11:32:17.058] [WARN] shiny-server - Running as root unnecessarily is a security risk! You could be running more securely as non-root.
[2019-12-11T11:32:17.069] [INFO] shiny-server - Starting listener on http://[::]:3838
[2019-12-11T11:32:58.564] [INFO] shiny-server - Created bookmark state directory: /var/lib/shiny-server/bookmarks
[2019-12-11T11:32:58.566] [INFO] shiny-server - Created user bookmark state directory: /var/lib/shiny-server/bookmarks/shiny
*** '/var/log/shiny-server//example_app-shiny-20191211-113258-36645.log' has been created ***
*** /var/log/shiny-server//example_app-shiny-20191211-113258-36645.log ***
Listening on http://<IP_ADDRESS>:36645
To check that the css styling has been encoded into the image itself, I remove the www
folder from my local shiny app directory. Then I head to the browser at http://localhost:3838/example_app/
to check it out:
Success! I now have a custom border around the side panel.


This is an example of interactive zoom and pan.
In this example, the zoom can be changed via the mouse wheel or the buttons on the screen.
Panning is done via left mouse click dragging. Note that the core cornerstone library does
not specify any interaction paradigm and allows any interaction paradigm to be implemented
by the developer


This structure contains the parameters to setup a event. More...
#include <csl_clec.h>
Data Fields | |
| uint32_t | secureClaimEnable |
| uint32_t | evtSendEnable |
| uint32_t | rtMap |
| uint32_t | extEvtNum |
| uint32_t | c7xEvtNum |
This structure contains the parameters to setup a event.
| uint32_t CSL_ClecEventConfig::c7xEvtNum |
[IN] C7x event number to send when this event is triggered. Range 0 to (CSL_CLEC_MAX_C7X_EVT_OUT - 1).
| uint32_t CSL_ClecEventConfig::evtSendEnable |
[IN] TRUE/FALSE. Controls whether ESR sends this event when written. When set to TRUE, write to ESR triggers the event.
| uint32_t CSL_ClecEventConfig::extEvtNum |
[IN] Encoded external event number to send when this event is triggered. Range 0 to (CSL_CLEC_MAX_EXT_EVT_OUT - 1).
| uint32_t CSL_ClecEventConfig::rtMap |
[IN] Route map bit field. Refer CSL_ClecRouteMap.
| uint32_t CSL_ClecEventConfig::secureClaimEnable |
[IN] TRUE/FALSE. When set to TRUE, a non-secure read/write to MRR will generate a privilege error.


Little known fact: If you analyze many thousands of ECG waveforms, you can occasionaly detect a pattern!
With no javascript or JQuery, and nothing other than a single CSS file and a single web font, pages load in a flash.
*89 score was without the web font :(
Like what you see? Download it from GitHub!


The Rails Internationalization (I18n) API
The Ruby I18n (shorthand for internationalization) gem which is shipped with Ruby on Rails (starting from Rails 2.2) provides an easy-to-use and extensible framework for translating your application to a single custom language other than English or providing multi-language support in your application.
| The Ruby I18n framework provides you with all neccessary means for internationalization/localization of your Rails application. You may, however, use any of various plugins and extensions available. See Rails I18n Wiki for more information. |
1. How I18n in Ruby on Rails works
Internationalization is a complex problem. Natural languages differ in so many ways (eg. in pluralization rules) that it is hard to provide tools for solving all problems at once. For that reason the Rails I18n API focuses on:
-
providing support for English and similar languages out of the box
-
making it easy to customize and extend everything for other languages
As part of this solution, every static string in the Rails framework — eg. ActiveRecord validation messages, time and date formats — has been internationalized, so localization of a Rails application means "over-riding" these defaults.
1.1. The overall architecture of the library
Thus, the Ruby I18n gem is split into two parts:
-
The public API of the i18n framework — a Ruby module with public methods and definitions how the library works
-
A default backend (which is intentionally named Simple backend) that implements these methods
As a user you should always only access the public methods on the I18n module, but it is useful to know about the capabilities of the backend.
| It is possible (or even desirable) to swap the shipped Simple backend with a more powerful one, which would store translation data in a relational database, GetText dictionary, or similar. See section Using different backends below. |
1.2. The public I18n API
The most important methods of the I18n API are:
translate # Lookup text translations localize # Localize Date and Time objects to local formats
These have the aliases #t and #l so you can use them like this:
I18n.t 'store.title' I18n.l Time.now
There are also attribute readers and writers for the following attributes:
load_path # Announce your custom translation files locale # Get and set the current locale default_locale # Get and set the default locale exception_handler # Use a different exception_handler backend # Use a different backend
So, let’s internationalize a simple Rails application from the ground up in the next chapters!
2. Setup the Rails application for internationalization
There are just a few, simple steps to get up and running with I18n support for your application.
2.1. Configure the I18n module
Following the convention over configuration philosophy, Rails will set-up your application with reasonable defaults. If you need different settings, you can overwrite them easily.
Rails adds all .rb and .yml files from config/locales directory to your translations load path, automatically.
See the default en.yml locale in this directory, containing a sample pair of translation strings:
en: hello: "Hello world"
This means, that in the :en locale, the key hello will map to Hello world string. Every string inside Rails is internationalized in this way, see for instance ActiveRecord validation messages in the activerecord/lib/active_record/locale/en.yml file or time and date formats in the activesupport/lib/active_support/locale/en.yml file. You can use YAML or standard Ruby Hashes to store translations in the default (Simple) backend.
The I18n library will use English as a default locale, ie. if you don’t set a different locale, :en will be used for looking up translations.
The translations load path (I18n.load_path) is just a Ruby Array of paths to your translation files that will be loaded automatically and available in your application. You can pick whatever directory and translation file naming scheme makes sense for you.
| The backend will lazy-load these translations when a translation is looked up for the first time. This makes it possible to just swap the backend with something else even after translations have already been announced. |
The default environment.rb files has instruction how to add locales from another directory and how to set different default locale. Just uncomment and edit the specific lines.
# The internationalization framework can be changed # to have another default locale (standard is :en) or more load paths. # All files from config/locales/*.rb,yml are added automatically. # config.i18n.load_path << Dir[File.join(RAILS_ROOT, 'my', 'locales', '*.{rb,yml}')] # config.i18n.default_locale = :de
2.2. Optional: custom I18n configuration setup
For the sake of completeness, let’s mention that if you do not want to use the environment.rb file for some reason, you can always wire up things manually, too.
To tell the I18n library where it can find your custom translation files you can specify the load path anywhere in your application - just make sure it gets run before any translations are actually looked up. You might also want to change the default locale. The simplest thing possible is to put the following into an initializer:
# in config/initializer/locale.rb # tell the I18n library where to find your translations I18n.load_path << Dir[ File.join(RAILS_ROOT, 'lib', 'locale', '*.{rb,yml}') ] # set default locale to something else then :en I18n.default_locale = :pt
2.3. Setting and passing the locale
By default the I18n library will use :en (English) as a I18n.default_locale for looking up translations (if you do not specify a locale for a lookup).
If you want to translate your Rails application to a single language other than English you can set I18n.default_locale to your locale. If you want to change the locale on a per-request basis though you can set it in a before_filter on the ApplicationController like this:
before_filter :set_locale def set_locale # if this is nil then I18n.default_locale will be used I18n.locale = params[:locale] end
This will already work for URLs where you pass the locale as a query parameter as in example.com?locale=pt (which is what Google also does).
| For other URL designs, see How to encode the current locale in the URL. |
Now you’ve initialized I18n support for your application and told it which locale should be used. With that in place you’re now ready for the really interesting stuff.
3. Internationalize your application
The process of "internationalization" usually means to abstract all strings and other locale specific bits out of your application. The process of "localization" means to then provide translations and localized formats for these bits. [1]
So, let’s internationalize something. You most probably have something like this in one of your applications:
# config/routes.rb ActionController::Routing::Routes.draw do |map| map.root :controller => 'home', :action => 'index' end # app/controllers/home_controller.rb class HomeController < ApplicationController def index flash[:notice] = "Hello flash!" end end # app/views/home/index.html.erb
Hello world!

<%= flash[:notice] %>

3.1. Adding Translations
Obviously there are two strings that are localized to English. In order to internationalize this code replace these strings with calls to Rails' #t helper with a key that makes sense for the translation:
# app/controllers/home_controller.rb class HomeController < ApplicationController def index flash[:notice] = t(:hello_flash) end end # app/views/home/index.html.erb
<%=t :hello_world %>

<%= flash[:notice] %>

When you now render this view it will show an error message that tells you that the translations for the keys :hello_world and :hello_flash are missing.
| Rails adds a t (translate) helper method to your views so that you do not need to spell out I18n.t all the time. Additionally this helper will catch missing translations and wrap the resulting error message into a . |
So let’s add the missing translations (i.e. do the "localization" part):
# config/locale/en.yml en: hello_world: Hello World hello_flash: Hello Flash # config/locale/pirate.yml pirate: hello_world: Ahoy World hello_flash: Ahoy Flash
There you go. Because you haven’t changed the default_locale I18n will use English. Your application now shows:
And when you change the URL to pass the pirate locale you get:
NOTE You need to restart the server when you add new locale files.
3.2. Adding Date/Time formats
Ok, let’s add a timestamp to the view so we can demo the date/time localization feature as well. To localize the time format you pass the Time object to I18n.l or (preferably) use Rails' #l helper. You can pick a format by passing the :format option, by default the :default format is used.
# app/views/home/index.html.erb
<%=t :hello_world %>

<%= flash[:notice] %></p
<%= l Time.now, :format => :short %>

And in our pirate translations file let’s add a time format (it’s already there in Rails' defaults for English):
# config/locale/pirate.yml pirate: time: formats: short: "arrrround %H'ish"
So that would give you:
NOTE Right now you might need to add some more date/time formats in order to make the I18n backend work as expected. See the rails-i18n repository for starting points.
4. Overview of the I18n API features
The following purposes are covered:
-
lookup translations
-
interpolate data into translations
-
pluralize translations
-
localize dates, numbers, currency etc.
4.1. Looking up translations
4.1.1. Basic lookup, scopes and nested keys
Translations are looked up by keys which can be both Symbols or Strings, so these calls are equivalent:
I18n.t :message I18n.t 'message'
translate also takes a :scope option which can contain one or many additional keys that will be used to specify a “namespace” or scope for a translation key:
I18n.t :invalid, :scope => [:active_record, :error_messages]
This looks up the :invalid message in the ActiveRecord error messages.
Additionally, both the key and scopes can be specified as dot separated keys as in:
I18n.translate :"active_record.error_messages.invalid"
Thus the following calls are equivalent:
I18n.t 'active_record.error_messages.invalid' I18n.t 'error_messages.invalid', :scope => :active_record I18n.t :invalid, :scope => 'active_record.error_messages' I18n.t :invalid, :scope => [:active_record, :error_messages]
4.1.2. Defaults
When a default option is given its value will be returned if the translation is missing:
I18n.t :missing, :default => 'Not here' # => 'Not here'
If the default value is a Symbol it will be used as a key and translated. One can provide multiple values as default. The first one that results in a value will be returned.
E.g. the following first tries to translate the key :missing and then the key :also_missing. As both do not yield a result the string "Not here" will be returned:
I18n.t :missing, :default => [:also_missing, 'Not here'] # => 'Not here'
4.1.3. Bulk and namespace lookup
To lookup multiple translations at once an array of keys can be passed:
I18n.t [:odd, :even], :scope => 'active_record.error_messages' # => ["must be odd", "must be even"]
Also, a key can translate to a (potentially nested) hash as grouped translations. E.g. one can receive all ActiveRecord error messages as a Hash with:
I18n.t 'active_record.error_messages' # => { :inclusion => "is not included in the list", :exclusion => ... }
4.2. Interpolation
In many cases you want to abstract your translations so that variables can be interpolated into the translation. For this reason the I18n API provides an interpolation feature.
All options besides :default and :scope that are passed to #translate will be interpolated to the translation:
I18n.backend.store_translations :en, :thanks => 'Thanks {{name}}!' I18n.translate :thanks, :name => 'Jeremy' # => 'Thanks Jeremy!'
If a translation uses :default or :scope as a interpolation variable an I18n::ReservedInterpolationKey exception is raised. If a translation expects an interpolation variable but it has not been passed to #translate an I18n::MissingInterpolationArgument exception is raised.
4.3. Pluralization
In English there’s only a singular and a plural form for a given string, e.g. "1 message" and "2 messages". Other languages (Arabic, Japanese, Russian and many more) have different grammars that have additional or less plural forms. Thus, the I18n API provides a flexible pluralization feature.
The :count interpolation variable has a special role in that it both is interpolated to the translation and used to pick a pluralization from the translations according to the pluralization rules defined by CLDR:
I18n.backend.store_translations :en, :inbox => { :one => '1 message', :other => '{{count}} messages' } I18n.translate :inbox, :count => 2 # => '2 messages'
The algorithm for pluralizations in :en is as simple as:
entry[count == 1 ? 0 : 1]
I.e. the translation denoted as :one is regarded as singular, the other is used as plural (including the count being zero).
If the lookup for the key does not return an Hash suitable for pluralization an I18n::InvalidPluralizationData exception is raised.
4.4. Setting and passing a locale
The locale can be either set pseudo-globally to I18n.locale (which uses Thread.current like, e.g., Time.zone) or can be passed as an option to #translate and #localize.
If no locale is passed I18n.locale is used:
I18n.locale = :de I18n.t :foo I18n.l Time.now
Explicitely passing a locale:
I18n.t :foo, :locale => :de I18n.l Time.now, :locale => :de
I18n.locale defaults to I18n.default_locale which defaults to :en. The default locale can be set like this:
I18n.default_locale = :de
5. How to store your custom translations
The shipped Simple backend allows you to store translations in both plain Ruby and YAML format. [2]
For example a Ruby Hash providing translations can look like this:
{ :pt => { :foo => { :bar => "baz" } } }
The equivalent YAML file would look like this:
pt: foo: bar: baz
As you see in both cases the toplevel key is the locale. :foo is a namespace key and :bar is the key for the translation "baz".
Here is a "real" example from the ActiveSupport en.yml translations YAML file:
en: date: formats: default: "%Y-%m-%d" short: "%b %d" long: "%B %d, %Y"
So, all of the following equivalent lookups will return the :short date format "%B %d":
I18n.t 'date.formats.short' I18n.t 'formats.short', :scope => :date I18n.t :short, :scope => 'date.formats' I18n.t :short, :scope => [:date, :formats]
Generally we recommend using YAML as a format for storing translations. There are cases though where you want to store Ruby lambdas as part of your locale data, e.g. for special date
5.1. Translations for ActiveRecord models
You can use the methods Model.human_name and Model.human_attribute_name(attribute) to transparently lookup translations for your model and attribute names.
For example when you add the following translations:
en: activerecord: models: user: Dude attributes: user: login: "Handle" # will translate User attribute "login" as "Handle"
Then User.human_name will return "Dude" and User.human_attribute_name(:login) will return "Handle".
5.1.1. Error message scopes
ActiveRecord validation error messages can also be translated easily. ActiveRecord gives you a couple of namespaces where you can place your message translations in order to provide different messages and translation for certain models, attributes and/or validations. It also transparently takes single table inheritance into account.

Consider a User model with a validates_presence_of validation for the name attribute like this:
class User < ActiveRecord::Base validates_presence_of :name end
The key for the error message in this case is :blank. ActiveRecord will lookup this key in the namespaces:
activerecord.errors.messages.models.[model_name].attributes.[attribute_name] activerecord.errors.messages.models.[model_name] activerecord.errors.messages
Thus, in our example it will try the following keys in this order and return the first result:
activerecord.errors.messages.models.user.attributes.name.blank activerecord.errors.messages.models.user.blank activerecord.errors.messages.blank
When your models are additionally using inheritance then the messages are looked up for the inherited model class names are looked up.
For example, you might have an Admin model inheriting from User:
class Admin < User validates_presence_of :name end
Then ActiveRecord will look for messages in this order:
activerecord.errors.models.admin.attributes.title.blank activerecord.errors.models.admin.blank activerecord.errors.models.user.attributes.title.blank activerecord.errors.models.user.blank activerecord.errors.messages.blank
This way you can provide special translations for various error messages at different points in your models inheritance chain and in the attributes, models or default scopes.
5.1.2. Error message interpolation
The translated model name and translated attribute name are always available for interpolation.
count and/or value are available where applicable. Count can be used for pluralization if present:
validation |
with option |
message |
interpolation |
validates_confirmation_of |
- |
:confirmation |
- |
validates_acceptance_of |
- |
:accepted |
- |
validates_presence_of |
- |
:blank |
- |
validates_length_of |
:within, :in |
:too_short |
count |
validates_length_of |
:within, :in |
:too_long |
count |
validates_length_of |
:is |
:wrong_length |
count |
validates_length_of |
:minimum |
:too_short |
count |
validates_length_of |
:maximum |
:too_long |
count |
validates_uniqueness_of |
- |
:taken |
value |
validates_format_of |
- |
:invalid |
value |
validates_inclusion_of |
- |
:inclusion |
value |
validates_exclusion_of |
- |
:exclusion |
value |
validates_associated |
- |
:invalid |
value |
validates_numericality_of |
- |
:not_a_number |
value |
validates_numericality_of |
:odd |
:odd |
value |
validates_numericality_of |
:even |
:even |
value |
5.1.3. Translations for the ActiveRecord error_messages_for helper
If you are using the ActiveRecord error_messages_for helper you will want to add translations for it.
Rails ships with the following translations:
en: activerecord: errors: template: header: one: "1 error prohibited this {{model}} from being saved" other: "{{count}} errors prohibited this {{model}} from being saved" body: "There were problems with the following fields:"
5.2. Other translations and localizations
Rails uses fixed strings and other localizations, such as format strings and other format information in a couple of helpers.
TODO list helpers and available keys
6. Customize your I18n setup
6.1. Using different backends
For several reasons the shipped Simple backend only does the "simplest thing that ever could work" for Ruby on Rails [3] ... which means that it is only guaranteed to work for English and, as a side effect, languages that are very similar to English. Also, the simple backend is only capable of reading translations but can not dynamically store them to any format.
That does not mean you’re stuck with these limitations though. The Ruby I18n gem makes it very easy to exchange the Simple backend implementation with something else that fits better for your needs. E.g. you could exchange it with Globalize’s Static backend:
I18n.backend = Globalize::Backend::Static.new
6.2. Using different exception handlers
The I18n API defines the following exceptions that will be raised by backends when the corresponding unexpected conditions occur:
MissingTranslationData # no translation was found for the requested key InvalidLocale # the locale set to I18n.locale is invalid (e.g. nil) InvalidPluralizationData # a count option was passed but the translation data is not suitable for pluralization MissingInterpolationArgument # the translation expects an interpolation argument that has not been passed ReservedInterpolationKey # the translation contains a reserved interpolation variable name (i.e. one of: scope, default) UnknownFileType # the backend does not know how to handle a file type that was added to I18n.load_path
The I18n API will catch all of these exceptions when they were thrown in the backend and pass them to the default_exception_handler method. This method will re-raise all exceptions except for MissingTranslationData exceptions. When a MissingTranslationData exception has been caught it will return the exception’s error message string containing the missing key/scope.
The reason for this is that during development you’d usually want your views to still render even though a translation is missing.
In other contexts you might want to change this behaviour though. E.g. the default exception handling does not allow to catch missing translations during automated tests easily. For this purpose a different exception handler can be specified. The specified exception handler must be a method on the I18n module:
module I18n def just_raise_that_exception(*args) raise args.first end end I18n.exception_handler = :just_raise_that_exception
This would re-raise all caught exceptions including MissingTranslationData.
Another example where the default behaviour is less desirable is the Rails TranslationHelper which provides the method #t (as well as #translate). When a MissingTranslationData exception occurs in this context the helper wraps the message into a span with the css class translation_missing.
To do so the helper forces I18n#translate to raise exceptions no matter what exception handler is defined by setting the :raise option:
I18n.t :foo, :raise => true # always re-raises exceptions from the backend
7. Resources
8. Footnotes
[1] Or, to quote Wikipedia: "Internationalization is the process of designing a software application so that it can be adapted to various languages and regions without engineering changes. Localization is the process of adapting software for a specific region or language by adding locale-specific components and translating text."
[2] Other backends might allow or require to use other formats, e.g. a GetText backend might allow to read GetText files.
[3] One of these reasons is that we don’t want to any unnecessary load for applications that do not need any I18n capabilities, so we need to keep the I18n library as simple as possible for English. Another reason is that it is virtually impossible to implement a one-fits-all solution for all problems related to I18n for all existing languages.  This also makes it much easier to experiment with custom features and extensions.


---
layout: post
title: reassembled
date: '2007-07-23T13:47:00.000+02:00'
author: Steven Van Acker
tags:
modified_time: '2008-01-19T21:37:37.037+01:00'
blogger_id: tag:blogger.com,1999:blog-5513234137363262204.post-4046677497839302255
blogger_orig_url: http://www.singularity.be/2007/07/reassembled.html
---
I reassembled my frame last saturday, but couldn't upload the pictures untill now because the webserver was down :(
[G2:11554]
Notice how the frame is bent a little on the left side. I have no idea why that is, but I hope it won't cause any trouble.
[Update 20070727]
crashmann on the TK560 forums recognizes this as "barrel distortion". It means my frame is not bent after all :)


A commercial port off the usual route north/south but with all tide access and useful facilities. It is the most important port in Patagonia and is located in the San Jorge Gulf inlet.
Position 45º 51’S, 67º 27’W.
Report to the Prefectura, which is close to the yacht club.
The commercial docks are not suitable for yachts. The best anchorage is near the yacht club but it is open to the NE.
It is possible to land on the beach nearby.
The town has all the usual services.
Last updated October 2011.
The yacht club here may be able to help with facilities and information on repairs.


Web Designer
Am a 21 year old so self motivated in person.I love exploring and innovating more on the current world. Am passionate in learning programming because i want to be more literate in software development.
cooking
reading novels
travelling
commumication
dependability
compassionate
HTML5
CSS3
HTML5
CSS3


Home
About Han Wang
Research
Publications
Interest
1. Embeded hardware
2. fishing
3. hiking
4. machine learning
5. coding


Curtains class
Basic usage
You will have to create a Curtains object first that will handle the scene containing all your planes. It will also create the WebGL context, append the canvas and handle the requestAnimationFrame loop. You just have to pass the HTML element (or its ID) that will wrap the canvas :
There are other options that you can pass as parameters. For example, you can specify whether you want to use the library in production mode:
Parameters
Here is a complete list of all the parameters:
- container HTML Element or string, optionnal the HTML Element or ID of the HTML Element that will wrap the canvas. If not specified, the WebGL context will not be set until you call setContainer() with a valid HTML element or ID.
- alpha bool, optionnal Whether the WebGL context should handle transparency. Default to true.
- antialias bool, optionnal Whether the WebGL context should use the default antialiasing. When using render targets, WebGL disables antialiasing, so you can safely set this to false to improve the performance. Default to true.
- premultipliedAlpha bool, optionnal Whether the WebGL context should handle premultiplied alpha. Default to false.
- production bool, optionnal Whether the library should throw useful console warnings or not. Default to false.
- pixelRatio float, optionnal Defines the pixel ratio value. Use it to limit it on init to increase performance. Default to window.devicePixelRatio.
- renderingScale float, optionnal (minimum: 0.25, maximum: 1) Use it to downscale your rendering canvas. May improve performance but will decrease quality. Default to 1.
- autoRender bool, optionnal Whether the library should create a request animation frame loop to render the scene. Set it to false if you want to handle this by yourself using the render() method. Default to true.
- autoResize bool, optionnal Whether the library should listen to the window resize event and actually resize the scene. Set it to false if you want to handle this by yourself using the resize() method. Default to true.
- watchScroll bool, optionnal Whether the library should listen to the window scroll event. Set it to false if you want to handle this by yourself. Default to true.
Properties
-
alpha (bool) v5.0read only
Whether the WebGL context handles transparency or not.
-
antialias (bool) v6.1read only
Whether the WebGL context should use antialiasing.
-
container (HTML element) v1.0
The container that will hold our WebGL canvas. The canvas will be sized according to this container. For performance reason, the smaller your container the better. Most of the time you'll set it to cover the window.
-
glCanvas (HTML canvas element) v1.0
The WebGL canvas being created and that contains our scene.
-
gl (WebGL context) v5.0
Our WebGL context.
-
pixelRatio (float) v1.0 read only
The current device pixel ratio.
Use the setPixelRatio() method to change this value at runtime. -
planes (array) v1.0
An array containing all your current Plane elements.
-
premultipliedAlpha (bool) v5.0 read only
Whether the WebGL context handles premultiplied alpha or not.
-
productionMode (bool) v1.6
If set to true, will remove all helpful warnings displayed by the library.
-
renderTargets (array) v5.0
An array containing all your current RenderTarget elements (including the one used by your shader passes).
-
shaderPasses (array) v3.0
An array containing all your current ShaderPass elements.
Methods
-
addPlane(planeElement, params): v1.0
This function will create a new Plane and add it to our Curtains wrapper.
The newly created plane will be returned.planeElement (HTML element): a HTML element
params (object, optionnal): an object containing the plane parameters:- planeElement HTML element a HTML element.
-
params
object, optionnal
an object containing the plane parameters:
- vertexShader string, optionnal your vertex shader as a string. Be careful with the line-breaks as it may throw javascript errors. Will look for vertexShaderID param if not specified.
- vertexShaderID string, optionnal the vertex shader ID. If ommited, will look for a data attribute data-vs-id on the plane HTML element. Will use a default vertex shader and throw a warning if nothing specified.
- fragmentShader string, optionnal your fragment shader as a string. Be careful with the line-breaks as it may throw javascript errors. Will look for fragmentShaderID param if not specified.
- fragmentShaderID string, optionnal the fragment shader ID. If ommited, will look for a data attribute data-fs-id on the plane HTML element. Will use a default fragment shader that draws only black pixels and throw a warning if nothing specified.
- widthSegments integer, optionnal the plane's definition along the X axis (1 by default).
- heightSegments integer, optionnal the plane's definition along the Y axis (1 by default).
- depthTest bool, optionnal if your plane should enable or disable the depth test. Default to true.
- transparent bool, optionnal if your plane should handle transparency and therefore be drawn after the planes that do not use transparency (false by default).
- cullFace string, optionnal which face of the plane should be culled. Could either be "back", "front" or "none". Default to "back".
- alwaysDraw bool, optionnal Whether to use frustum culling: defines if the plane should always be drawn or if it should not be drawn if it lies completely outside of the scene (false by default).
- shareProgram bool, optionnal Whether this plane should share its WebGL program with other planes that share the same shaders in order to optimize its creation. Use with caution and see the Plane's shareProgram property to know more. Default to false.
- visible bool, optionnal Whether to draw your plane (default to true).
-
drawCheckMargins
object, optionnal
Additional margins to add in the draw check calculations, in pixels.
Positive value means the plane will be drawn even if outside the canvas by less than the value, negative value means the plane will be hidden if inside the canvas by more than the value.
Useful if you're messing with the vertices positions in your vertex shader.- top float margin to apply when comparing the top side of the plane and the bottom side of the canvas (0 by default).
- right float margin to apply when comparing the right side of the plane and the left side of the canvas (0 by default).
- bottom float margin to apply when comparing the bottom side of the plane and the top side of the canvas (0 by default).
- left float margin to apply when comparing the left side of the plane and the right side of the canvas (0 by default).
- watchScroll bool, optionnal Whether the plane should auto update its position when the user scrolls (false by default).
- autoloadSources bool, optionnal defines if the sources should be load on init automatically (true by default).
- crossOrigin string, optionnal defines the crossOrigin process to load images if any (default to "anonymous").
- fov integer, optionnal defines the perspective field of view (default to 50).
-
uniforms
object, optionnal
the uniforms that will be passed to the shaders (if no uniforms specified there won't be any interaction with the plane).
- name string The name of the uniform to use in your shaders
- type string The type of your uniform (see here).
- value float, integer or array of floats or integers depending on your uniform type The value of the uniform.
returns: the newly created Plane if successful, false othterwise.
Parameters basic example
var params = {vertexShaderID: "plane-vs", // our vertex shader IDfragmentShaderID: "plane-fs", // our fragment shader IDuniforms: {time: {name: "uTime", // uniform name that will be passed to our shaderstype: "1f", // this means our uniform is a floatvalue: 0, // initial value of the uniform},},};Examples: used in all examples.
-
addRenderTarget(params): v5.0
This function will create a new RenderTarget and add it to our Curtains wrapper.
The newly created render target will be returned.params (object, optionnal): an object containing the render target parameters:
-
params
object, optionnal
an object containing the render target parameters:
- clear bool, optionnal Whether the content of your render target should be cleared before being drawn. Should be set to false to handle ping-pong shading. Default to true.
- depth bool, optionnal Whether to create a depth buffer (handle depth inside your render target). Default to false.
returns: the newly created RenderTarget if successful, false othterwise.
Examples: used in Ping pong shading flowmap example and Selective shader passes using render targets examples.
-
params
object, optionnal
an object containing the render target parameters:
-
addShaderPass(params): v3.0
This function will create a new ShaderPass and add it to our Curtains wrapper.
The newly created shader pass will be returned.params (object, optionnal): an object containing the plane parameters:
-
params
object, optionnal
an object containing the shader pass parameters:
- vertexShader string, optionnal your vertex shader as a string. Be careful with the line-breaks as it may throw javascript errors. Will look for vertexShaderID param if not specified.
- vertexShaderID string, optionnal the vertex shader ID. If ommited, will look for a data attribute data-vs-id on the plane HTML element. Will use a default vertex shader and throw a warning if nothing specified.
- fragmentShader string, optionnal your fragment shader as a string. Be careful with the line-breaks as it may throw javascript errors. Will look for fragmentShaderID param if not specified.
- fragmentShaderID string, optionnal the fragment shader ID. If ommited, will look for a data attribute data-fs-id on the plane HTML element. Will use a default fragment shader that draws the scene without modifications if nothing specified.
- renderTarget RenderTarget object, optionnal If specified, will apply the ShaderPass only to the plane that are attached to that RenderTarget. Else the whole scene will be post-processed. Default to null.
- clear bool, optionnal Whether the shader pass render target content should be cleared before being drawn (see addRenderTarget parameters). Default to true.
- depth bool, optionnal Whether the shader pass render target should use a depth buffer (see addRenderTarget parameters). Default to false.
- depthTest bool, optionnal if your shader pass should enable or disable the depth test. Default to true.
- crossOrigin string, optionnal defines the crossOrigin process to load images if any (default to "anonymous").
-
uniforms
object, optionnal
the uniforms that will be passed to the shaders (if no uniforms specified there won't be any interaction with the plane).
- name string The name of the uniform to use in your shaders
- type string The type of your uniform (see here).
- value float, integer or array of floats or integers depending on your uniform type The value of the uniform.
returns: the newly created ShaderPass if successful, false othterwise.
Parameters basic example
See addPlane basic parameters example.
Examples: used in Post processing displacement effect, Post processing multiple passes, Post processing scrolling wheel with custom transform origin and Selective shader passes using render targets examples.
-
params
object, optionnal
an object containing the shader pass parameters:
-
disableDrawing(): v1.8
This function will prevent the scene from being drawn again (putting it in a paused state). You won't be able to update uniforms while the drawing is disabled. Useful to improve performance if you got a static scene.
Examples: used in Slideshow with a displacement shader and Asynchronous textures loading examples.
-
dispose(): v1.0
This function will cancel the requestAnimationFrame loop, remove all planes and delete the WebGL context.
-
enableDrawing(): v1.8
This function will reenable the scene drawing in case you paused it via disableDrawing(). Could be useful if you want to start drawing the scene again when a user gesture happens for example.
Examples: used in Slideshow with a displacement shader and Asynchronous textures loading examples.
-
getBoundingRect(): v3.0
Useful to get our container HTML element bounding rectangle without causing a reflow/layout repaint. Be careful as the values are relative to your pixelRatio value.
returns: an object containing the container HTML element width, height, top and left positions.
Examples: used in Multiple planes scroll effect and Post processing multiple passes examples.
-
getScrollDeltas(): v4.0
Get the last scroll delta values along X and Y axis. Call it after having called updateScrollValues() or inside the onScroll() event if scroll watching is active.
returns: an object containing the last scroll delta values along X and Y axis.
Examples: used in Multiple planes, Multiple planes scroll effect : rotation, scale and parallax, Post processing displacement effect and Post processing multiple passes examples.
-
getScrollValues(): v4.0
Get the current scroll values along X and Y axis. Call it after having called updateScrollValues() or inside the onScroll() event if scroll watching is active.
returns: an object containing the current scroll values along X and Y axis.
Examples: used in Multiple planes, Multiple planes scroll effect : rotation, scale and parallax, Post processing displacement effect and Post processing multiple passes examples.
-
needRender(): v1.8
This function will reenable the scene drawing for just one frame. Useful if you want to update uniforms if the drawing is disabled.
Examples: used in Slideshow with a displacement shader and Asynchronous textures loading examples.
-
removePlane(plane): v1.5
This function will remove a plane from our Curtains object and delete all of its textures. It will also update all other planes indexes.
- plane Plane object the plane to remove.
Examples: used in AJAX navigation with plane removal example.
-
removeRenderTarget(renderTarget): v5.0
This function will remove a render target from our Curtains object and delete its texture. It will also update all other render targets indexes.
- renderTarget RenderTarget object the render target to remove.
-
removeShaderPass(shaderPass): v3.0
This function will remove a shader pass from our Curtains object and delete all of its textures.
- shaderPass ShaderPass object the shader pass to remove.
-
render(): v4.0
This function renders your scene if drawing is enabled. Useful if you're using your own request animation frame loop.
-
resize(): v2.0 triggers reflow
This function will resize your scene and all your planes. Called internally at each window resize event. You should call it if you're changing your container size dynamically without changing the window size.
-
restoreContext(): v2.0
This function will try to restore the WebGL context. Use it after having previously lost the context.
Examples: used in all examples.
-
setContainer(container): v6.2
Set the Curtains container to which we will append the canvas and then start instancing the Curtains class and the WebGL context.
Called internally if a container is specified in the initial parameters object but could be called later on if no container is provided in the initial parameters.- container HTML Element or string HTML element or ID to which append the canvas
-
setPixelRatio(pixelRatio, triggerCallback): v2.0 triggers reflow
This function will set a new pixel ratio and resize everything accordingly.
The default pixel ratio value being initialized is the actual device pixel ratio. Use this method if you want to limit the pixel ratio to improve performance.- pixelRatio float new pixel ratio to set.
- triggerCallback bool, optionnal whether onAfterResize callback should be triggered, false by default.
-
updateScrollValues(xOffset, yOffset): v4.0
Updates the scroll values. Use it before updating your planes positions with updateScrollPosition() while scrolling.
Called internally if scroll watching is active.- xOffset float scroll value along X axis.
- yOffset float scroll value along Y axis.
Examples: used in Multiple planes scroll effect with Locomotive scroll example.
Events
-
onAfterResize(): v3.0
This function will be called each time the window has been resized, after everything has been updated.
returns: your Curtains object, allowing it to be chainable.
-
onContextLost(): v2.0
This function will be called each time the WebGL context has been lost.
returns: your Curtains object, allowing it to be chainable.
Examples: used in all examples.
-
onContextRestored(): v2.0
This function will be called each time the WebGL context has been successfully restored.
returns: your Curtains object, allowing it to be chainable.
-
onError(): v1.7
This function will be called if there's an error during the initialisation, or if the WebGL context could not be created.
returns: your Curtains object, allowing it to be chainable.
Examples: used in all examples.
-
onRender(): v2.0
This function is called once at each request animation frame call. Useful if you need to update stats or tweening engine.
returns: your Curtains object, allowing it to be chainable.
Examples: used in Multiple planes, Multiple planes scroll effect : rotation, scale and parallax examples.
-
onScroll(): v4.0
This function is called each time a window scroll event is fired and scroll watching is active.
returns: your Curtains object, allowing it to be chainable.
Examples: used in Multiple planes, Multiple planes scroll effect : rotation, scale and parallax, Post processing displacement effect and Post processing multiple passes examples.


{% include 'header.html' %} {% load staticfiles %}
AMAZ is an Asian American multiplatform network & studio that is focused on curating and creating content that is actually reflective of Asian Americans. Think early MTV meets BET but for Asian Americans. By focusing on what we know best, we provide interesting content for non-Asian Americans as well. We are in the process of developing relationships with content creators (writers, producers, directors, talent, etc) in order to create a list of content that we will produce. In order to support the creative community that work with us, we are working on putting together a studio - which will serve as a resource hub for our talent. Would love to further discuss with anyone who is interested!
web developer and designer
CEO of AMAZTV


@*
* Copyright 2019 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*@
@(form: Form[_], userProfileBaseUrl: String)(implicit messages: Messages, request: Request[_])
@standard_layout("Deployments", "deployments") {
Deployments


Enumeration members
CloudyWeather
CloudyWeather: = <any>"CloudyWeather"
CoolWhiteFluorescent
CoolWhiteFluorescent: = <any>"CoolWhiteFluorescent"
D50Illuminant
D50Illuminant: = <any>"D50Illuminant"
D55Illuminant
D55Illuminant: = <any>"D55Illuminant"
D65Illuminant
D65Illuminant: = <any>"D65Illuminant"
D75Illuminant
D75Illuminant: = <any>"D75Illuminant"
DayWhiteFluorescent
DayWhiteFluorescent: = <any>"DayWhiteFluorescent"
Daylight
Daylight: = <any>"Daylight"
DaylightFluorescent
DaylightFluorescent: = <any>"DaylightFluorescent"
FineWeather
FineWeather: = <any>"FineWeather"
Flash
Flash: = <any>"Flash"
Fluorescent
Fluorescent: = <any>"Fluorescent"
ISOStudioTungsten
ISOStudioTungsten: = <any>"ISOStudioTungsten"
Other
Other: = <any>"Other"
Shade
Shade: = <any>"Shade"
StandardIlluminantA
StandardIlluminantA: = <any>"StandardIlluminantA"
StandardIlluminantB
StandardIlluminantB: = <any>"StandardIlluminantB"
StandardIlluminantC
StandardIlluminantC: = <any>"StandardIlluminantC"
Tungsten
Tungsten: = <any>"Tungsten"
Unidentified
Unidentified: = <any>"Unidentified"
WhiteFluorescent
WhiteFluorescent: = <any>"WhiteFluorescent"
Corresponds to exif.LightSourceChoice


Detailed Fuel Type information can be found here. The TCO2e field is used in Project Requests to calculate projected cost and savings.


Next: floating-point-inexact, Previous: division-by-zero, Up: Numbers Dictionary
floating-point-invalid-operation, arithmetic-error, error, serious-condition, condition, t
The type floating-point-invalid-operation consists of error conditions that occur because of certain floating point traps.
It is implementation-dependent whether floating point traps occur, and whether or how they may be enabled or disabled. Therefore, conforming code may establish handlers for this condition, but must not depend on its being signaled.


This demos two components that help users select colors: a com.pump.swing.JPalette
and a com.pump.swing.JColorWell
.
The simplest usage resembles:
JColorWell colorWell = new JColorWell();
The JColorWell
will present a JPalette
in a floating popup window when it is clicked.
If you want to use a JPalette
by itself (with no color well), it's similarly easy to instantiate:
JPalette palette = new JPalette();
Both internally keep track of their currently selected Color
using a javax.swing.colorchooser.ColorSelectionModel
. They can also share the same ColorSelectionModel
if you want two components to stay in sync.
The JPalette
is a grid of color swatches. Each cell is a separate JToggleButton
, so the palette should be fully accessible/navigable.
The demo offers a slider to control the swatch cell size. As a rule of thumb: I'd recommend not using a cell size below 40-50 pixels. From an accessibility standpoint: some users may have difficulty targeting an area smaller than 40x40. (To my knowledge this isn't a codified standard, though.)
The default color palette is currently the Flat UI Palette v1, but I tossed in the Fluent and Metro sets as well. Additionally there are two custom palettes we used (simply named "small" and "large") that offer basic primary colors, grayscales and flesh tones.
The JColorWell
is a single color swatch. This compactness makes it great for inspectors that need to list several consecutive controls.
You can define two different behaviors: one for a single click (or down arrow key), and another for a double-click (or enter key). The default single-click behavior is to show a JPalette
in a popup. The default double-click behavior is to show a JColorPicker
.
Well over a decade ago our original implementation of a color palette didn't feature cells. Every pixel was a unique color, so it was a spectrum with thousands of choices. We figured more is better, right? But that's a common rookie mistake. As The Power of Persuasion points out:
The greater the number of choices, the happier the consumer - so it's assumed.In a recent series of experiments ... a group of Columbia University chocolate lovers were given a choice between six different flavors of Godiva chocolates. A second group was asked to select between thirty different flavors.  The thirty-flavor subjects expressed more regrets about their selection and were less likely to choose chocolate as payment for participating in the experiment.
Sure enough: it didn't take long for our users to specifically request a grid-like model. In hindsight providing a fixed set of options offers two advantages:


{% extends "index.html" %} {% import "post_macros.html" as post_macros %} {% block title %}{{ config.title }}{% endblock title %} {% block style %} {% endblock style %} {% block content %} 404 - Not Found You're seeing this page because we couldn't find any content to display. Go back to home {% endblock content %}
You're seeing this page because we couldn't find any content to display.


{%extends '/layouts/modal.html' %} {%block title%}The field has been deleted{%endblock%} {%block content%}
The field has been deleted.
{%endblock%} {%block body_onload %}onload="var data=JSON.stringify({'type' :'delete_field',field_type : '{{field_type}}',field_id:'{{field_id}}'});parent.window.postMessage(data,'*');"{%endblock%}


YOUR INFORMATION WILL REMAIN SAFE AND SECURE.
ACCESS FROM ANYWHERE.

PASSIONATE FOR CODING
INTERESTED IN FRONT END DEVELOPMENT
INTERERSTED IN PROGRAMMING.
INTERESTED IN COMPUTER SCIENCE.
INTERESTED IN COMPUTER ARCHITECTURE.


FROM Edwina Rogers<EMAIL_ADDRESS>Abidjan, IvoryCoast. Please write and reply me through my yahoo<EMAIL_ADDRESS>Dear Respectful, Warm greetings to you and your family in the name of our lord Jesus Christ. I am Edwina Rogers the only daughter of late Mr and Mrs Rogers. My father was a very wealthy Rubber plantation merchant and the managing director of Agro Rogers rubber plantation farm in Abidjan; the economic capital of Ivory Coast, my father was poisoned to death by his business associates on one of their outings on a business trip. My mother died when I was a baby and since then my father took me and my only kid brother (David) so special. Before the death of my father on November 2005 in a private hospital here in Abidjan he secretly called me on his bed side and told me that he has the sum of Ten million, five hundred thousand United State Dollars.USD($10.500,000) left in fixed / suspense account in one of the prime bank here in Abidjan ,that he used my name as his first child for the next of Kin in depositing of the fund. He also explained to me that it was because of this wealth that he was poisoned by his business associates. That I should seek for a foreign partner in a country of my choice where I will transfer this money and use it for investment purpose such as real estate management or hotel management. Now, I am honourably seeking your assistance in the following ways: (1) To serve as a guardian and foreign co-beneficiary of this fund. (2) To make arrangement for me and my brother to come over to your country to further our education and to secure resident permit in your country. I am willing to offer you 15% of the total sum as compensation for your effort/input after the transfer of this fund into your account overseas. Thank you for your signify interest to assist me and my younger brother. Hoping to hear from you soon. May God bless you and preserve our friendship in good faith. Best regards Edwina Rogers and brother, (David) Please write and reply me through my yahoo box(edwina_rogers01@yahoo.fr)


"; if(isset($_REQUEST['submit'])){ if(($_REQUEST['name'] == "") || ($_REQUEST['roll'] == "") || ($_REQUEST['address'] == "")){ echo "Fill All Fields..
| Name Of The Student | |
|---|---|
| Leave Type | |
| Leaving Date | |
| Period Of Leave | |
| Return Date | |
| Total Number Of Leave | |
| Reason | |
| Permission From | |
| Address Of Corresspondence |


Released July 16, 2011
Additions
Grid
Improved PDF export
- Now the grid header text does not shrink the font so that the text fit the width. If there is no room for the text a new line is created
- added new option in PDF options - "shrink_cell" (default is true) if set to false the Font does not increase so that to fit the text in width, but a new line is added if needed.
- added new option in PDF options - "reprint_grid_header" (default is false). If set to true the grid header row is reprinted on every new page
Note : This option currently work only if the pdf option "shrink_cell" is set to false
Fixes
Fix searching with SQL LIKE operator in array driver
Now when debug is set to true the export command is recorded in jqGrid.log file
Fix mtype in add/edit/dell form options
Fix insert and update data when a non UTF-8 chartset is used
Fix database search when non UTF-8 charset is used
Fix Autocomplete to work properly when a non UTF-8 charset is used
Fix jqScheduler to work correct when a non UTF-8 charset is used
Fix client side searching on complex queries
Fix client side sorting when index property is missed.


{{techniqueDesc}}
Would you like to use a planning technique?
Freestyle FreyTag Snowflake Synopsis Three Act Structure Traditional


Sqlite Page Explorer
Page outline
Page contents
Hex view
Decimal view
Text view
DB:
Not opened yet
Open page:
<Ref>
|
© Siara Logics (cc) 2015-19
|
GitHub
|
License
|
Privacy