Definition Validation¶
By default, CRUDlex validates the yml file and throws an exception if anything is wrong.
Turning off Validation¶
This costs a bit of performance, so you might want to turn it off in your production environment as it should be sure at this point that the file is valid:
$app['crud.validateentitydefinition'] = $app['debug'];
Implementing a Custom Validator¶
It is possible to use your own validator by implementing the interface CRUDlexEntityDefinitionValidatorInterface and handing it in before registering the service provider:
$app['crud.entitydefinitionvalidator'] = $myCustomValidator;


{% extends "layout.html" %} {% block content %}
A simple service to allow MIT webapps to authenticate students with MIT certificates.
There are two parts to the authentication flow. One takes place online when creating the webapp, the other happens when a user wants to log in.
Offline Steps
RETURN_URL
APP_NAME
SECRET_KEY
and stores it somewhere private.Online Steps
https://authello.mit.edu/auth/(APP_NAME)
SHA256((user's kerberos) + (current time) + SECRET_KEY)
, also known as the TOKEN
https://RETURN_URL?time=(current time)&user=(user's kerberos)&token=(TOKEN)
There are three major design goals as we build this service (in order of priority):
Developer Easy of Use essentially means that the overhead for integrating this service into a new or existing application should be very low. There should be no need for extra dependencies or any assumptions made about the host application's design. In addition, This design goal is the most important out of the three.
Simple Flow means that a user being authenticated by this service should have no questions as to what they should do while being authenticate. One design decision made from this goal was that users are only asked for their certificates, not for their username and password or for kerberos tickets.
Basic Security means this service should not allow adversaries to forge the identity of someone else when authenticating through this service. This service does not aim to provide bulletproof security from an adversary once a user has been authenticated. It is up to the receiving application to properly handle someone's authentication.
This project does not aim to provide a completely secure way to provide authentication to web applications. Most importantly, use of this service shows implicit trust in the operators of this website. It is possible for the owner of this website to authenticate as any user to the connected web applications, though we pledge not to do so. Furthermore, if this website's internal database were to be hacked, the hackers would be able to authenticate as well.
Since the purpose of this tool is to make it easy for new developers to introduce basic authentication via certificates, these are trust considerations that we are okay with. Once a web application has moved beyond proof-of-concept, the owners of that web application should work to directly accept certificates themselves, for better security.
{% endblock %}


"Playing by Heart" Review by Fontaine Lien http://members.aol.com/saitiau/cinema.html ****** HUGE SPOILERS ******
"Talking about love is like dancing about architecture."
"Playing by Heart" is movie with a very cute and promising premise: four couples, seemingly unrelated, each deal with their relationship problems. In the end, it is discovered that they're all connected in some way. Here's a plot that's refreshing, somewhat original, and has a potential for greatness. For once, a movie has more *dialogue* than it has special effects and gratuitous nudity. But "Playing" is a few olives short of a vodka martini.
The least they could have done was keep us interested in the characters long enough for the big "surprise" at the end, which the preview for the movie all but gave away, so I was probably at a disadvantage. Being mysterious is fine, but you've got to have enough punch to keep the movie running at a fair pace.
Of all the couples, only Angelina Jolie and Ryan Philippe's Joan and Keenan have really grabbed my attention. Even though Philippe was stiff as a stick and Jolie didn't really "grow into" her character until the movie was well underway. And even then it felt like they were reciting their lines. But at any rate, the characters were the most developed: Here's a guy who seems to have a lot of emotional baggage hidden inside, and a girl who's very unabashed about expressing her feelings. I found myself wondering whatever happened to Keenan, and whether this odd couple would ever get together (whether I thought they were right for each other, on the other hand, is an entirely different matter). In contrast, I didn't really care for the other couples. Jon Stewart's Trent was played and written as a slick, unlikable sleazebag, and Gillian Anderson's Meredith was a character who developed solely out of her past (her unhappy marriage with Jay Mohr's Mark, which we will deal with later). Throughout the whole courtship the problem was that Meredith supposedly had too many walls around her; well, those walls came tumbling down a little too soon, too conveniently. Gillian Anderson's mellow, stoic performance as Meredith once again confirmed my suspicion that she's most cut out for the role of Dana Scully. Or was it because Meredith was too similar to Scully? I hope it is the latter. I never really understood Madeline Stowe / Anthony Edwards / Dennis Quaid triangle, partly because the film didn't take enough time to explain their relationship. The same with Sean Connery and Gena Rowlands. I'm not saying that the explanation was incomplete, or the characters any less deserving of sympathy--but that we were given too little to go on. We've just gotten to know these characters at a certain turning point in their lives, and it's just too bad that we aren't given the chance to get more acquainted with them. The whole other sideline with Jay Mohr and Ellen Burstyn seemed unnecessary; sure, it made for a great story, contributed a few good scenes, gave a few surprises at the end, but it had nothing to do with the theme of the movie (dancing about architecture, so to speak). All in all, it was disappointing that only two of the eight main characters succeeded in "being"; the rest in comparison seemed like mere paper dolls cut out to serve the story's purpose. Part of the reason is because they were played with so little conviction: a well- developed character needs good lines, good scenarios, and a good actor; here the dialogue seemed to shoulder too much of the burden. We were constantly being hit over-the-head with monologues about the character's problems, without a lot of acting to back it up. The big obstacle: making the characters three-dimensional before the big revelation deadline. It doesn't matter if a particular stage of the development was too hasty, we have to move on because they all need to be happily together by the end of two hours. It's a shame to see how often an assembly of great actors go to waste.
It might be confusing if I said that what could have made this story more interesting is where the movie failed. The premise was great: brief glimpses into the lives of couples that we run into almost everyday, gradually getting to know these couples, then reaching some sort of a conclusion. However, everything seemed to work against it. The snippets started to become annoying when after each one we felt confused and apathetic rather than interested. There were a few scenes that were noteworthy, but the movie as a whole seemed disjointed. I don't want to discourage the obviously very talented writer of this story by saying (*snort*, like he'll ever read this) this, but I think the movie could have been better with a few fix-ups. As much as I rant about my disappoint, the movie was satisfying in its attempt at deciphering the world of love and make us sigh with contentment with its sappy-sweet ending.

Rating: C+ (First viewing, 1/28/99)
*Highlight: Gillian Anderson giving Sean Connery a kiss. Wasn't that wonderful?

*"My mind has an endless capacity for useless information." -- Dude, sounds like me.
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


Welcome To My Page!
Graphic Artist - Illustrator - Web Designer
Nice to meet you! I’m Trisha, im a graphic artist who specializes in the digita arts like graphic design, vectors, illustrations and web design for more than 3 years and I still continue to improve and grow as a better artist.
I've loved digital media with my entire life and I want to use all of my skills and talent to make a brighter future~!
My hobbies during my freetime are drawing, surfing the net, watch western cartoons + anime, and play video games.
Experties:
Adobe Photoshop
Adobe Dreamweaver
Sony Veags Pro
Clip Studio Paint
HTML5 + CSS3
Photo Manipulation
SketchUp


Firstly started as a funny joke of me and my friends I had finally developed a plugin, that calculates how long it'll take to reach Colonel 100 based on your score per minute.
http://img.pun1a.net/2013-06-10_0123.png
Greetings to Jumpy who gave me the idea with the tooltip
It would be also cool to see how long it takes, based on your total account time (since you have the bf3 account). To see how long it will take for me when i play not 24h per day.
Post edited 2 x times, last by
BrainFooLong
Administrator
BrainFooLong
Administrator
For example what i mean:
I have my account since Oct. 2011 (about 20 months) and i have now rank 75.
I reach lvl. 145 in approx. 20 months (at Feb. 2015)


--- layout: post title: A probabilistic analysis of leaving the toilet seat down permalink: /2013/09/probabilistic-toilet-seat-analysis/ published: false jqui: true latex: true d3: true js: toilet.js ---
I will assign a constant penalty for touching the toilet seat during your bathroom session.
| \( Penalty \) | The penalty for touching the toilet seat. |
| \( P_{Him} \) | The probability that on any random bathroom visit, it is the male in the bathroom. For example, \( P_{Him} = 0.5 \) would be the case in which the man and woman go to the bathroom with equal frequency, and \( P_{Him} = 1.0 \) is the case where the woman never goes to the bathroom. |
| \( P_{Pee} \) | The probability that, when the man goes to the bathroom, he pees. If \( P_{Pee} = 0.75 \), for example, it means the man pees three times for every time he poops. |
That's it. It turns out that the woman's bathroom habits cancel out in the math so these are the only two variables we need.
This case is easy. Both parties can assume the seat will be down when they arrive, so the man only needs be concerned with lifting the seat to pee. He incurs the penalty twice: once for putting the seat up, and once for putting it back down.
| \(Cost_{Her, 1}\) | \(= 0\) |
| \(Cost_{Him, 1}\) | \(= 2 * P_{Pee} * Penalty \) |
You might argue that the man should only incur the penalty once: after all, he is washing his hands afterwar, so what's wrong with a second toilet seat manipulation if you've already done a first. We'll call this special case Policy 1-Prime:
| \(Cost_{Him, 1}' \) | \(= P_{Pee} * Penalty \) |
|
Since the woman always leaves the toilet seat down, she only needs to touch the seat when the man went before her and he peed. |
||||||||||
| \(Cost_{Her, 2} =\) | \( P_{Him} * P_{Pee} * Penalty \) | |||||||||
|
The man's case is more complicated. If he is peeing, he touches the seat if the woman went before him, or if he went last time and pooped. If he is pooping, he touches the seat if he went last time and peed. |
||||||||||
| \(Cost_{Him, 2} =\) |
|
I've left the solution so generalized because I can't presume how much you poop, or how much your SO pees, or how often either of you go to the bathroom. Instead, play around with the simulation below to see what policy you should choose.
| Who goes more? | When the man goes, what does he do? | ||||||
|---|---|---|---|---|---|---|---|
| Her | Him |   | Poop | Pee |
|


norm
index
/home/epete/src/simfMRI/norm.py
Routines to normalize 1d and 2d array-like objects.
Modules
numpy
Functions
percent_change
(arr)
Returns percent change scores for the given 1 or 2d array.
zscore
(arr)
Returns Z scores for the given 1 or 2d array.


Backward Chaining
Backward chaining rules are processed when your program asks Pyke a question (i.e., asks Pyke to prove a specific goal). Pyke will only use activated rule bases to do the proof.
Overview of "Backward-Chaining"
To do backward-chaining, Pyke finds rules whose then part matches the goal (i.e., the question). Once it finds such a rule, it tries to (recursively) prove all of the subgoals in the if part of that rule. Some of these subgoals are matched against facts, and others are subgoals for other backward-chaining rules. If all of the subgoals can be proven, the rule succeeds and the original goal is proven. Otherwise, the rule fails, and Pyke tries to find another rule whose then part matches the goal, and so on.
So Pyke ends up linking (or chaining) the if part of the first rule to the then part of the next rule.
Reviewing:
- Pyke starts by finding a rule whose then part matches the goal.
- Pyke then proceeds to process the if part of that rule.
- Which may link (or chain) to the then part of another rule.
Since Pyke processes these rules from then to if to then to if in the reverse manner that we normally think of using rules, it's called backward chaining.
To make this more clear, Pyke has you write your backward-chaining rules upside down by writing the then part first (since that's how it is processed).
"Use", "When" Rather than "Then", "If"
But then-if rules sound confusing, so Pyke uses the words use and when rather than then and if. You can then read the rule as "use" this statement "when" these other statements can be proven.
Note
Unlike the assert clause in forward-chaining rules, Pyke only allows one statement in the use clause.
Example
Consider this example:
1 direct_father_son 2 use father_son($father, $son, ()) 3 when 4 family2.son_of($son, $father) 5 grand_father_son 6 use father_son($grand_father, $grand_son, (grand)) 7 when 8 father_son($father, $grand_son, ()) 9 father_son($grand_father, $father, ()) 10 great_grand_father_son 11 use father_son($gg_father, $gg_son, (great, $prefix1, *$rest_prefixes)) 12 when 13 father_son($father, $gg_son, ()) 14 father_son($gg_father, $father, ($prefix1, *$rest_prefixes)) 15 brothers 16 use brothers($brother1, $brother2) 17 when 18 father_son($father, $brother1, ()) 19 father_son($father, $brother2, ()) 20 check $brother1 != $brother2 21 uncle_nephew 22 use uncle_nephew($uncle, $nephew, $prefix) 23 when 24 brothers($uncle, $father) 25 father_son($father, $nephew, $prefix1) 26 $prefix = ('great',) * len($prefix1) 27 cousins 28 use cousins($cousin1, $cousin2, $distance, $removed) 29 when 30 uncle_nephew($uncle, $cousin1, $prefix1) 31 father_son($uncle, $cousin2, $prefix2) 32 $distance = min(len($prefixes1), len($prefixes2)) + 1 33 $removed = abs(len($prefixes1) - len($prefixes2))
Note
These rules draw the same conclusions as the forward-chaining example, with the addition of the brothers, uncle_nephew and cousins rules.
We can draw something similar to a function call graph with these rules:
These rules are not used until you ask Pyke to prove a goal.
The easiest way to do this is with some_engine.prove_1_goal or some_engine.prove_goal. Prove_1_goal only returns the first proof found and then stops (or raises pyke.knowledge_engine.CanNotProve). Prove_goal returns a context manager for a generator that generates all possible proofs (which, in some cases, might be infinite).
Both functions return the pattern variable variable bindings, along with the plan.
Backtracking with Backward-Chaining Rules
For this example, these are the starting set of family2 facts:
1 son_of(tim, thomas) 2 son_of(fred, thomas) 3 son_of(bruce, thomas) 4 son_of(david, bruce)
And we want to know who fred's nephews are. So we'd ask uncle_nephew(fred, $nephew, $prefix).
Here are the steps (in parenthesis) in the inferencing up until the first failure is encountered (with the line number from the example preceding each line):
(1) 22 use uncle_nephew(fred, $nephew, $prefix) 24 brothers(fred, $father) (2) 16 use brothers(fred, $brother2) 18 father_son($father, fred, ()) (3) 2 use father_son($father, fred, ()) 4 family2.son_of(fred, $father) matches fact 2: son_of(fred, thomas) 19 father_son(thomas, $brother2, ()) (4) 2 use father_son(thomas, $son, ()) 4 family2.son_of($son, thomas) matches fact 1: son_of(tim, thomas) 20 check fred != tim 25 father_son(tim, $nephew, $prefix1) (5.1) 2 use father_son(tim, $son, ()) 4 family2.son_of($son, tim) => FAILS (5.2) 6 use father_son(tim, $grand_son, (grand)) 8 father_son(tim, $grand_son, ()) 2 use father_son(tim, $son, ()) 4 family2.son_of($son, tim) => FAILS (5.3) 11 use father_son(tim, $gg_son, (great, $prefix1, *$rest_prefixes)) 13 father_son(tim, $gg_son, ()) 2 use father_son(tim, $son, ()) 4 family2.son_of($son, tim) => FAILS
Each rule invocation is numbered (in parenthesis) as a step number. Step 5 has tried 3 different rules and they have all failed (5.1, 5.2 and 5.3).
If you think of the rules as functions, the situation now looks like this (the step numbers that succeeded circled in black, and steps that failed circled in red):
At this point, Pyke has hit a dead end and must backtrack. The way that backtracking proceeds is to go back up the list of steps executed, combining the steps from all rules into one list. Thus, when step 5 fails, Pyke backs up to step 4 and tries to find another solution to that step.
If another solution is found, Pyke proceeds forward again from that point. If no other solutions are found, Pyke backs up another step.
When Pyke goes back to step 4, the next solution binds $son to fred. This fails the subsequent check in the brothers rule:
20 check $brother1 != $brother2
And so Pyke goes back to step 4 once again. The next solution binds $son to bruce. This succeeds for brother and is passed down to father_son which returns david as fred's nephew.
Further backtracking reveals no other solutions.
Backtracking Summary
Thus we see:
- The backtracking algorithm: "fail goes up (or back) while success goes down (or forward)" is not limited to the steps within a single rule's when clause; but includes the entire chain of inferencing from the very start of trying to prove the top level goal.
- This execution model is not available within traditional programming languages like Python.
- The ability to go back to any point in the computation to try an alternate solution is where backward-chaining systems get their power!
Running the Example
>>> from pyke import knowledge_engine >>> engine = knowledge_engine.engine(__file__) >>> engine.activate('bc_related')
Nothing happens this time when we activate the rule base, because there are no forward-chaining rules here.
We want to ask the question: "Who are Fred's nephews?". This translates into the Pyke statement: bc_related.uncle_nephew(fred, $v1, $v2).
Note
Note that we're using the name of the rule base, bc_related rather than the fact base, family2 here; because we expect this answer to come from the bc_related rule base.
This is 'bc_related', 'uncle_nephew', with ('fred',) followed by 2 pattern variables as arguments:
>>> from __future__ import with_statement >>> with engine.prove_goal('bc_related.uncle_nephew(fred, $nephew, $distance)') as gen: ... for vars, no_plan in gen: ... print(vars['nephew'], vars['distance']) david ()


California is experiencing its worst drought in recorded history.
Hit play in the upper right of the screen or scroll at your own pace to view the website
Drought: Tahoe will dip below its natural rim this month
from the Reno Gazette Journal
Parched California expected to miss out on typical fall rains
from the LA Times
California drought continues to take heavy toll on reservoirs
from Stanford Daily
Drilling Through the Drought: A Look At Well Drilling Activity In The Central Valley
from CA Public Radio
Drought has 14 communities on the brink of waterlessness
from the LA Times
California: Paradise Burning
from the New Yorker
Drought reduces snowpack and results in lower reservoir storage capacity.
Over 80% of public drinking water supply comes from rivers, lakes, reservoirs, and other surface waters (1).
Here, the effect of drought on 59 of California's >700 reservoirs are shown through time.
| Reservoir Capacity (%) | |
| California reservoirs sorted by elevation |
Snowpack in California is the primary source of water to reservoirs that serve drinking water, agriculture, and hydroelectric needs.
For any given year, less wintertime snowpack results in lower reservoir levels, and less water for consumptive use.
Agriculture represents the largest fraction of freshwater withdrawals(1).
For the first time in history, some agricultural areas are not receiving any water for irrigation which is resulting in devastation of historically productive areas. The agricultural output for the state could fall by $3.5 billion this year (3).


Image processing
Regression
Classification
Web Scraping
Overview
I was always interested in behavioral psychology. It is curious what makes people make certain decisions,
why they behave one way or another, sometimes against the logic. Of course, it is hard to answer these questions in all situations.
Still, one of them, which seems comparatively simple, is determining why people like what they see. But is it possible to build a model
that could predict if an image will be pleasant for most people?
In a nutshell I tried to build a model capable of prediction relative number of likes based on post image and caption. Or at least rank them.
Relative number of likes is number of likes normalized (divided) by number of the followers. That what the tool on the right does.
It will take about {{given_duration}} seconds. Be patient:)
Results
Here's a table with extracted parameters and scores is rendered
What's under the hood?
Datset description
To predict how "liked" postt would be, firstly I scraped a dataset from Instagram.
The dataset consists of about 4000 scraped Instagram posts (metadata) from 18 accounts.
How were chosen the accounts?
Tried to avoid personal accounts because they contain mainly selfies
Tried to avoid accounts having many posts with textual information
Tried to avoid accounts in which ”likes” could be based on caption text
Problems:
Instagram prevents scraping therefore the process is painful and time-consuming.
Solution:
random time.sleep() during scraping
taking breaks
changing session IDs
Correlation study
As for the first step I wasintersted to see which features are correlated positively and negtively with the target variable.
On the right you can see corresponding bar charts.
Correlation values are pretty low, but it’s interesting that narrower images with animals with no bright colors and people should gain more likes.
Here it’s interesting to compare samples with opposite characteristics to see how significant the difference between mean log-weighted likes values is.
For that purpose, I took 2 samples with 300 records in each. The samples were taken from dataframe sorted by top-10 columns from positive and negative correlations. Their boxplots are provided below.
Initially I wanted to conduct one-way ANOVA but the samples didn’t meet its requirements: they had different variance, not normally distributed residuals and values.
Therefore, I conducted the Kruskal-Wallis H-test which requires only independence of samples (the equality of distribution shapes can be ignored if null hypothesis is rejected
[1]).
The result of Kruskal_Wallis H-test showed that these two groups are stochastically different (H>Hc, p<<0.05): Hence, the elimination of negatively correlated features can lead to increase of number of likes.
Model selection
I tried 2 approaches to solve this task. They are regression and classification.
For regression I tried several models, such as Random forest, XGBoost, K-neighbors, Decision Tree and Voting Regressors with previously mentioned models as voters.
Regarding classification, i binned likes into 5 quantiles and tried to predict quantile using Random forest Classifier, XGBoost Classifier, K-neighbors Classifier and
Voting Classifier which combined forementioned methods with soft voting.
The metrics are provided in tables. Based on them I decided to use XGBoost regression model. is used which was trained on a dataset scraped by me from Instagram.
Regression models
| Model name |
Model selection method |
RMSE |
R2 |
| Random Forest Regressor |
RandomizedSearchCV |
0.699 |
0.253 |
| XGBoost Regressor |
RandomizedSearchCV |
0.696 |
0.261 |
| K-neighbors Regressor |
RandomizedSearchCV |
0.811 |
-0.004 |
| Decision Tree Regressor |
RandomizedSearchCV |
0.769 |
0.097 |
| Voting Regressor |
Deafult settings |
0.769 |
0.247 |
Classification models
| Model name |
Model selection method |
Accuracy |
Weighted avg F1-score |
| Random Forest Classifier |
RandomizedSearchCV |
0.50 |
0.51 |
| XGBoost Classifier |
RandomizedSearchCV |
0.52 |
0.52 |
| K-neighbors Classifier |
GridSearchCV |
0.35 |
0.36 |
| Voting Classifier |
Default settings |
0.49 |
0.49 |
| CNN |
Grid Search |
0.24 |
0.31 |
Selected model
As I mentioned above the best model is XGBoost regressor. Corresponding graphs obtained on a test set are provided to the right.
Its hyperparameters are:
'min_child_weight': 3,
'max_depth': 8,
'learning_rate': 0.1,
'gamma': 0.1,
'colsample_bytree': 0.4
Conclusion
The models created within this project did not show outstanding results. I suppose that number of records should be increased which I will implement later. However, Random Forest regressor can be used for comparative choice of the posts.
Conducted Kruskal-Wallis H-test showed significant differences between Instagram posts with dominating positively and negatively correlating features which allows to determine factors affecting success of a post.
As for the future work, I plan to increase number of records, fine tune neural networks and apply clusterization to generate new features. I would also pay some attention to tuning of models which demonstrate overfitting.


{% include head.html %}
Hello, there. I’m Yew Wee. I'm a big data analyst and web developer from Singapore. I'm currently working in Accenture Analytics , helping clients to build apps / platform to discover more about data.
I enjoy building cool machine learning apps using Python, JavaScript, React & integrating it with APIs.
In my spare time I love to run. I train and travel for marathons.
I'm currently getting my hands dirty in NodeJS and just started on contributing to the open source JS community with Node, writing / refactoring tests for them.


Methods summary
abstract public
|
|
public
|
|
protected
|
|
protected
|
|
protected
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
mixed
|
#
current( )
(PHP 5 >= 5.0.0)
Return the current element
(PHP 5 >= 5.0.0)
Return the current element
Returns
mixed Can return any type.
Link
Implementation of
Iterator::current()
|
public
|
#
next( )
(PHP 5 >= 5.0.0)
Move forward to next element
(PHP 5 >= 5.0.0)
Move forward to next element
Returns
Any returned value is ignored.
Link
Implementation of
Iterator::next()
|
public
mixed
|
#
key( )
(PHP 5 >= 5.0.0)
Return the key of the current element
(PHP 5 >= 5.0.0)
Return the key of the current element
Returns
mixed scalar on success, or null on failure.
Link
Implementation of
Iterator::key()
|
public
boolean
|
#
valid( )
(PHP 5 >= 5.0.0)
Checks if current position is valid
(PHP 5 >= 5.0.0)
Checks if current position is valid
Returns
boolean The return value will be casted to boolean and then evaluated.
Returns true on success or false on failure.
Link
Implementation of
Iterator::valid()
|
public
|
#
rewind( )
(PHP 5 >= 5.0.0)
Rewind the Iterator to the first element
(PHP 5 >= 5.0.0)
Rewind the Iterator to the first element
Returns
Any returned value is ignored.
Link
Implementation of
Iterator::rewind()
|
public
Angelfon\SDK\Version
|
|
public
|
|


In this post I will present solution to the following problem:
We have a non empty singly linked list with a cycle in it.
We must find first element of a cycle in a linear time.
For example, given a singly linked list:
Algorithm should return node N3
as it is the first node counting
from head of a list that is part of cycle.
Boundary conditions
To better understand this problem let’s think about boundary conditions for our algorithm.
One of the boundary conditions is that entire list forms single cycle:
In this case our algorithm should return first element of a list (N1
node for a list
presented on picture above).
Another boundary condition is that only last element
of the list forms a cycle:
In this case algorithm should return last element of the list (N4
node for
a list presented on picture above).
The last boundary condition is a list that consists of only one element: In this case algorithm should return that single element.
For all except last described boundary conditions we should consider lists with odd and even number of elements.
Create test suite
Let’s code these boundary conditions and a few of other generic cases as a set of unit tests. To represent list nodes we will use following Java class:
Our algorithm will be represented by CycleStart.find
method:
To avoid code duplication we will use JUnit 4 parameterized unit tests. AssertJ will be used as an assertion library:
Each of arrays returned by static data()
method contains
CycleStartTest
constructor parameters. For each of these arrays JUnit will create
CycleStartTest
instance with parameters passed to class constructor. Then
JUnit will call all methods annotated with @Test
on that instance.
In our case we have two parameters listSize
and cycleSize
, I think these
are pretty self explanatory.
The last missing piece is ListWithCycle
helper that creates list of given size
with cycle of given size:
Now with unit tests covering all normal and border cases we can start implementing our algorithm.
Create simple implementation
Let’s start with simple implementation that works in O(N)
time but uses O(N)
additional memory.
The idea behind this algorithm is simple. We will be tracking all
already visited nodes, when we visit some node N twice we will know that
node N must be start of a cycle.
This is implemented in Java as:
We use IdentityHashMap<K,V>
to track already visited nodes.
IdentityHashMap<K,V>
is special purpose Map<K,V>
implementation that uses references to objects
as a keys.
Internally it uses ==
instead of Object.equals()
to compare keys for equality, and
System.identityHashCode()
instead of Object.hashCode()
to compute hashes.
This algorithm passes all unit tests but can’t we do any better?
In fact we can, there is a beautiful algorithm that runs in O(N)
time and
uses O(1)
memory.
Create efficient implementation
Let’s create a more efficient implementation. To understand how it works we must first familiarize ourselves with fast and slow pointer method. Main usage of fast and slow pointer method is cycle detection in singly linked lists. The main idea is to have two pointers that traverse the same list. One pointer “slow” moves only one element at time, other pointer “fast” moves two elements at time. Singly linked list contains cycle if both pointers met. This can be implemented in Java as:
In our algorithm we’ll use simple fact from fast/slow pointer method: when fast and slow pointers are inside cycle, fast pointer cannot “jump over” slow pointer. In other words situation like: is not possible.
PROOF: First we assume that slow pointer always moves first and that
we stop algorithm when fast and slow pointer meet. (If entire list is one
cycle we would not count first step - when fast and slow pointers point to the list head).
Let’s assume that fast pointer jumped over slow pointer as depicted on image above.
We know that slow pointer always moves first and it moves only one element at time,
so before slow pointer moved it was at N2
node. But that was the node that
fast pointer was pointing to before it moved. In other words before slow and fast pointers
moved they pointed to the same node so our algorithm should have stopped, but it didn’t.
Here we have contradiction that completes the proof.
Consequence of above proof is simple fact: let’s say slow and fast pointers are pointing at cycle first element and that cycle has C elements in total. After at most C slow pointer moves, pointers must meed again.
Now let’s go back to our cycle start finding algorithm. To help us reason we will introduce some variables:
- N - number of nodes in list before cycle (
N = 3
in our example below) - C - number of nodes in cycle (
C = 4
in our example below) - K - position of slow pointer inside cycle
(first element of cycle has
k: 0
, secondk: 1
etc.)
Let’s consider following situation, we ran fast/slow pointer algorithm on 7 element list
depicted below:
After N iterations of algorithm slow pointer enters
first element of the cycle and has position K = 0
. Meanwhile fast
pointer that moves 2 times faster has position Kfast = N % C
.
From this point every iteration of algorithm moves slow pointer from position K
to K+1
,
and fast pointer from position Kfast
to Kfast+2
. In other words after S
iterations
of algorithm slow pointer has position S % C
and fast pointer has position (N+2*S) % C
.
We know that fast pointer cannot jump over slow pointer, both pointers must met
in some Smet
iteration (where Smet <= C
). When this happens we have:
or in more mathematical notation:
We can transform this equation using modulo arithmetic into:
and finally into:
This last equation is very important, it tells us that after another N
iterations of the
algorithm slow pointer will point at cycle first element:
From this we can get main idea of our new algorithm. First run fast/slow pointer algorithm until pointers met. Then we know that after another N iterations slow pointer will point at cycle first element. But hey if we start moving from list head after N iterations we will point at first cycle element too! We don’t know N but if we start moving slow pointer one element at time and simultaneously we start moving another pointer from list head one element at time they must met at cycle first element:
Above description of algorithm will work only when C > 1
and N > 1
. Case when C = 1
is simple and I leave it as an exercise to reader.
Case when N = 0
: entire list forms a single cycle is easy too, we solve it now.
Slow and fast pointers will met after Smet
iterations, then:
In other words because Smet <= C
and Smet = 0 (mod C)
pointers can met only at the first element of the cycle (at position 0 or C).
First element of the cycle is a list head, so in this case our algorithm will work too!
Now let’s move to implementation:
All tests are green so we are done, yay!


This positions your element relative to the placement of itself which is where it normally would be placed by default. By defining the position property to value relative, it allows us to set top, right, bottom, and left properties which will cause it to be "nudged" away from it's normal position.
Example: here are three div tags, box 2 has the property position set to relative with additional properties defining top and left. This has moved the box-2 element 10px from the left and 10px from the top relative from its original position in the document.
See the Pen LYGOWpx by josiah (@josiahwaikari) on CodePen.
Removes the element from the flow of the document and allows it to be positioned relative to it's nearest defined relatively positioned parent element. When there is no positioned parent element, it will be positioned relative to the document body.
Example: here we have a parent div tag which has the property position set to relative and box-2 div tag which has the property position set to absolute. we give right and bottom properties to the box-2 element to move it in relation to it's parent element. box-3 moves up to occupy the space vacated by box-2
See the Pen BajmWjP by josiah (@josiahwaikari) on CodePen.
An element that has a position of fixed is similar to the absolute positioning, inheriting all of it's rules except that it's positioned relative to the viewport (browser/device). This means that it will always stay in the same place even if the page is scrolled.
Example:
See the Pen Fixed by josiah (@josiahwaikari) on CodePen.


The builtin type pipe.
Pipes are a thread-safe way to send objects from one thread to another
thread. Or from one collection of threads to another collection of
threads.
| bool | $isOpen @file | state of the pipe
|
| int | $bufferSize @file | maximum number of items buffered
|
| |
| NEW() @public |
Create a new pipe with buffer size one.
|
| NEW(bufferSize) @public |
Create a new pipe with buffer size bufferSize.
|
| $setBufferSize(bufferSize) @public |
Change the buffer size to bufferSize.
|
| $close() @public |
Close the pipe.
|
| $wait() @public |
Wait for the pipe to be empty and closed.
|
| $Size() int @public |
Return the number of items currently buffered and ready to be read.
|
| $write(item) status @public |
Write one item into the pipe.
|
| $read(st) Titem @public |
Read one item from the pipe.
|
| $read() Titem @public |
Read one item from the pipe.
|
| |


StartCommand(commandToStart: Command)
A StartCommand will call the Command.start method of another command when it is initialized and will finish immediately.


What do you want to add?
Available free space for Books is {{bookFreeSpace}} Items
Available free space for DVDs is {{dvdFreeSpace}} Items


Video Demos for CLI Projects
Liri Bot Demo
Constructor Word Guess Demo
Bamazon Marketplace Demo
Click on the links above to que up a video.


Report metadata
- Account: {{ t["account_name"] }} ({{ t["account_id"] }})
- Report Generated: {{t.report_generated_time}}
- Cloudsplaining version: {{t.cloudsplaining_version}}
Executive Summary
{% include 'summary/executive-summary.html' %}
IAM Principals
{% include 'summary/iam-principals.html' %}
Findings: Customer-managed and inline Policies
{% include 'summary/customer-managed.html' %}
In-depth analysis: Customer-managed and inline Policies
{% include 'analysis/customer-managed.html' %}
Findings: AWS-managed Policies
{% include 'summary/aws-managed.html' %}
In-depth analysis: AWS-managed Policies
{% include 'analysis/aws-managed.html' %}


--- title: Engineering Progression description: Careers and progression for engineers in the CTO organisation at the FT. permalink: / layout: o-layout-landing ---
Careers and progression for engineers in the CTO organisation at the FT.
This site and the accompanying repository is the single source of truth for the competencies and level definitions for Engineering roles in the CTO organisation at the FT.
You can find more information on the GitHub repository
Engineering competencies are used to inform conversations about career progression between an engineer and their line manager:
Anybody working for the Financial Times is welcome to suggest changes via a GitHub issue or pull request.


stores the multiple paragraph attributes for the text object. This vardata field will store the ChunkHandle to a chunk array of paragraph style runs (each of type
VisTextParaAttr
). See Paragraph Runs
.
ATTR_GEN_TEXT_EXTENDED_FILTER
stores the
VisTextExtendedFilterTypes
to use instead of the default
VisTextFilters
. Extended filters offer more powerful (and complex) filtering mechanisms for accepting and rejecting text into the GenText.
ATTR_GEN_TEXT_TYPE_RUNS specifies the type runs for this text object. You should not need type runs unless you need hyperlink capabilities. ATTR_GEN_TEXT_GRAPHIC_RUNS specifies a graphics run to use within the text object.
ATTR_GEN_TEXT_REGION_ARRAY specifies the array of regions defined for this text object. Text within the GenText will flow from each of the defined regions to the next region. ATTR_GEN_TEXT_STYLE_ARRAY specifies the name array of styles used in the GenText's style sheets.
ATTR_GEN_TEXT_RUNS_ITEM_GROUP
indicates that this text object is linked to an item group (list). When the user hits Return (or the equivalent), the text object sends a message to the item group; similarly, the item group will attempt to update the text object on changes.
ATTR_GEN_TEXT_DO_NOT_INTERACT_WITH_SEARCH_CONTROL
indicates that the text object should not send notification to the search control object.
ATTR_GEN_TEXT_SET_OBJECT_ENABLED_WHEN_TEXT_EXISTS
makes the specified object enabled any time the GenText object has text in it.
ATTR_GEN_TEXT_LEGAL_DOS_PATH
makes sure that only legal DOS paths are used.
ATTR_GEN_TEXT_DATE
and
ATTR_GEN_TEXT_TIME
allows short date and time characters and spaces; the text object will be affected by the localization driver.
ATTR_GEN_TEXT_MAKE_UPPERCASE indicates that in addition to any other filters, any alphabetic characters are forced into uppercase.
ATTR_GEN_TEXT_ALLOW_COLUMN_BREAKS allows all characters including column breaks. Column breaks are normally filtered out in a GenText object. The column breaks usually will appear as new lines (like carriage returns) in the text object.
ATTR_GEN_TEXT_UPPERCASE_ALPHA
allows alphabetic characters and spaces.
ATTR_GEN_TEXT_UPPERCASE_ALPHA_NUMERIC
, an allows only uppercase alphabetic characters and spaces.
ATTR_GEN_TEXT_DASHED_ALPHA_NUMERIC
allows only uppercase alphabetic characters and spaces but also allows dashes.
ATTR_GEN_TEXT_NORMAL_ASCII
allows only normal ASCII characters (no extended ASCII characters).
ATTR_GEN_TEXT_LEGAL_DOS_VOLUME_NAMES
allows only characters that may appear in a legal DOS volume name.
ATTR_GEN_TEXT_DOS_CHARACTER_SET
allows only characters in the legal DOS character set.
ATTR_GEN_TEXT_NO_SPACES
and
ATTR_GEN_TEXT_ALLOW_SPACES
govern whether spaces are allowed in the text object.
ATTR_GEN_TEXT_ALPHA
,
ATTR_GEN_TEXT_NUMERIC
,
ATTR_GEN_TEXT_SIGNED_NUMERIC
,
ATTR_GEN_TEXT_SIGNED_DECIMAL
,
ATTR_GEN_TEXT_FLOAT_DECIMAL
, and
ATTR_GEN_TEXT_ALPHA_NUMERIC
govern the character types allowed.
ATTR_GEN_TEXT_LEGAL_FILENAMES
allows any characters legal to file names.
ATTR_GEN_TEXT_NEVER_MAKE_SCROLLABLE forces the text object to expand larger as the text grows without forcing it into scrollable text.
ATTR_GEN_TEXT_DOES_NOT_ACCEPT_INK indicates that this text object will not accept ink under any circumstances.
ATTR_GEN_TEXT_CURSOR_NO_FOCUS causes the text object to have a cursor whether it has the focus or not.
ATTR_GEN_TEXT_CUSTOM_FILTER
contains the ChunkHandle of an array of
VisTextCustomFilterData
structures. Each of these structures contains a range of character
values
to filter out. These values are determined from the
Chars
enumerated type. The text object figures out the number of filters in place by getting the size of the chunk.
Code Display 10-23 GenText Hints
@vardata ColorQuad HINT_TEXT_WASH_COLOR @vardata void HINT_TEXT_WHITE_WASH_COLOR; @vardata void HINT_TEXT_AUTO_HYPHENATE; @vardata void HINT_TEXT_SELECT_TEXT; @vardata void HINT_TEXT_CURSOR_AT_START; @vardata void HINT_TEXT_CURSOR_AT_END; @vardata void HINT_TEXT_FRAME; @vardata void HINT_TEXT_NO_FRAME; @vardata void HINT_TEXT_ALLOW_UNDO; @vardata void HINT_TEXT_ALLOW_SMART_QUOTES; @vardata void HINT_TEXT_DO_NOT_MAKE_LARGER_ON_PEN_SYSTEMS;
HINT_TEXT_WASH_COLOR indicates the background color for the GenText to exhibit. This hint takes a
ColorQuad
argument.
HINT_TEXT_WHITE_WASH_COLOR indicates the background color of the GenText should be white.
The GenText instance fields can be set to specific values in your Goc files. They may also be modified by your application at run-time. These instance fields may be modified by both
GenTextClass
messages or
VisTextClass
messages.
GenTextClass
always builds out into a completely functioning subclass of
VisTextClass
. With the exception of geometry management behavior, you can assume that they will behave the same. You may send any
VisTextClass
message to a GenText object. Messages are only provided in
GenTextClass
to manipulate and alter behavior solely of
GenTextClass
origins.
The chunk handle stored in GTXI_
text
is copied to the VisText instance field VTI_
text
at run-time. To perform operations on this text, you may use any of the
VisTextClass
messages in The Text
. Similarly, the text object maximum length stored in GTXI_
maxLength
is copied to VTI_
maxLength
at run-time. To perform operations on this data, use an appropriate message under Using VisText
.
GTXI_attrs, MSG_GEN_TEXT_SET_ATTRS, MSG_GEN_TEXT_GET_ATTRS
GTXI_
attrs
stores the
GenTextAttrs
of the GenText object. These attribute flags are listed below.
Tab
key is used for navigation purposes in your application and should be interpreted to move to the next field rather than inserted into the text object.
You may alter the contents of a GenText's GTXI_
attrs
instance field at run-time by sending the object a
MSG_GEN_TEXT_SET_ATTRS
. You may only send this message to a non-usable (~GS_USABLE) text object. To retrieve the current
GenTextAttrs
in use, send the text object
MSG_GEN_TEXT_GET_ATTRS
.
void MSG_GEN_TEXT_SET_ATTRS( byte attrsToSet, byte attrsToClear);
This message sets a GenText object's
GenTextAttrs
(GTXI_
attrs
). The GenText object must not be GS_USABLE when sent this message.
Source: Unrestricted.
Destination: Any non-usable GenText object.
Parameters:
attrsToSet
GenTextAttrs
to add.
GenTextAttrs
to remove. An attribute set in both parameters will be cleared.Return: Nothing.
Interception: Generally not intercepted.
byte MSG_GEN_TEXT_GET_ATTRS();
This message retrieves the GenText object's
GenTextAttrs
(GTXI_
attrs
).
Source: Unrestricted.
Destination: Any GenText object.
Parameters: None.
Return:
GenTextAttrs
in use by the GenText object(
GTXI_attrs
).
Interception: Generally not intercepted.
GTXI_stateFlags, MSG_GEN_TEXT_SET_INDETERMINATE_STATE, MSG_GEN_TEXT_SET_MODIFIED_STATE, MSG_GEN_TEXT_IS_INDETERMINATE, MSG_GEN_TEXT_IS_MODIFIED
GTXI_
stateFlags
stores the current state of the GenText object. There are two
GenTextStateFlags
:
MSG_GEN_APPLY
. The handler for
MSG_GEN_APPLY
checks whether this flag is set before sending out the GenText's GTXI_
applyMsg
.
GenText objects should normally be marked by the application as not modified anytime their state is set with an external message. They will automatically be marked modified whenever the user interacts with them and marked not modified after receiving
MSG_GEN_APPLY
.
You may set a GenText's indeterminate or modified state with
MSG_GEN_TEXT_SET_INDETERMINATE_STATE
or
MSG_GEN_TEXT_SET_MODIFIED_STATE
, respectively. To check whether a GenText is indeterminate or modified, use
MSG_GEN_TEXT_IS_INDETERMINATE
or
MSG_GEN_TEXT_IS_MODIFIED
.
void MSG_GEN_TEXT_SET_INDETERMINATE_STATE( Boolean indeterminateState);
This message sets the GenText object's indeterminate state (the GTSF_INDETERMINATE flag in GTXI_
stateFlags
). This message does not affect the stored text.
Source: Unrestricted.
Destination: Any GenText object.
Parameters:
indeterminateState
True
to set the text object indeterminate (GTSF_INDETERMINATE);
false
otherwise.
Return: Nothing.
Interception: Generally not intercepted.
void MSG_GEN_TEXT_SET_MODIFIED_STATE( Boolean modifiedState);
This message allows you to set the modified state of a GenText object (the GTSF_MODIFIED flag in GTXI_
stateFlags
). This message does not affect the stored text.
Source: Unrestricted.
Destination: Any GenText object.
Parameters:
modifiedState
True
to set the text object modified (GTSF_MODIFIED);
false
otherwise.
Return: Nothing.
Interception: Generally not intercepted.
Boolean MSG_GEN_TEXT_IS_INDETERMINATE();
This message checks whether a GenText object is indeterminate in state.
Source: Unrestricted.
Destination: Any GenText object.
Parameters: None.
Return: The indeterminate state of the GenText object (
true
if the object is indeterminate,
false
otherwise).
Interception: Generally not intercepted.
Boolean MSG_GEN_TEXT_IS_MODIFIED();
This message checks whether a GenText object has been modified.
Source: Unrestricted.
Destination: Any GenText object.
Parameters: None.
Return: The modified state of the GenText object (
true
if the object has been modified,
false
otherwise).
Interception: Generally not intercepted.
GTXI_applyMsg, GTXI_destination, MSG_GEN_TEXT_GET_DESTINATION, MSG_GEN_TEXT_SET_DESTINATION, MSG_GEN_TEXT_GET_APPLY_MSG, MSG_GEN_TEXT_SET_APPLY_MSG
GTXI_
applyMsg
holds the message for the GenText to send out whenever it has been modified and needs to apply its changes. Whenever a GenText receives
MSG_GEN_APPLY
, it checks whether its GTSF_MODIFIED flag has been set; if it has, it will send out its apply message. If a GenText is operating in immediate mode, these actions will happen immediately, resulting in an immediate action.
Use the prototype GEN_TEXT_APPLY_MSG to define your apply message. This ensures that the apply message passes the correct parameters (the current
GenTextStateFlags
). GTXI_
destination
specifies the destination object (or process) to send the GTXI_
applyMsg
to. (This may also be a
TravelOption
such as TO_APP_FOCUS.) Use of these two fields is shown in Sending an Apply Message
.
Code Display 10-24 Sending an Apply Message
/* Define the apply message using the provided prototype. */ @message (GEN_TEXT_APPLY_MSG) MSG_MY_TEXT_STUFF_TEXT_IN_BUFFER;
/* In the object declaration, set the destination and the apply message. */ @object GenTextClass MyText = { GI_visMoniker = "My Text Object"; GTXI_text = "Initial Text Here"; GTXI_maxLength = 99; GTXI_applyMsg = MSG_MY_TEXT_STUFF_TEXT_IN_BUFFER; GTXI_destination = process; }
/* Retrieve the current text and place it in the indicated buffer. */
@method MyTextProcessClass, MSG_MY_TEXT_STUFF_TEXT_IN_BUFFER { char tempBuffer[100];
/* The GET_ALL_PTR retrieves the current text and stuffs at the location it in the * passed pointer. Pass a text length of zero for null-terminated text strings. */ @call MyText::MSG_VIS_TEXT_GET_ALL_PTR(tempBuffer); }
To change a GenText's apply message or destination, send it
MSG_GEN_TEXT_SET_APPLY_MSG
or
MSG_GEN_TEXT_SET_DESTINATION
, respectively. Use
MSG_GEN_TEXT_GET_APPLY_MSG
or
MSG_GEN_TEXT_GET_DESTINATION
to return the current apply message or destination.
void MSG_GEN_TEXT_SET_APPLY_MSG( Message message);
This message sets a new apply message (GTXI_
applyMsg
) for the text object.
Source: Unrestricted.
Destination: Any GenText object.
Parameters: message The new apply message.
Return: Nothing.
Interception: Generally not intercepted.
Message MSG_GEN_TEXT_GET_APPLY_MSG();
This message retrieves the current apply message (GTXI_
applyMsg
) of a GenText object.
Source: Unrestricted.
Destination: Any GenText object.
Parameters: None.
Return: The apply message of the GenText object.
Interception: Generally not intercepted.
void MSG_GEN_TEXT_SET_DESTINATION( optr dest);
This message sets the destination object or process (GTXI_
destination
) of a GenText object.
Source: Unrestricted.
Destination: Any GenText object.
Parameters: dest The optr of the new destination object or process.
Return: Nothing.
Interception: Generally not intercepted.
optr MSG_GEN_TEXT_GET_DESTINATION();
This message returns the current destination object (GTXI_
destination
) of a GenText object.
Source: Unrestricted.
Destination: Any GenText object.
Parameters: None.
Return: The optr of the GenText's destination object (GTXI_
destination
).
Interception: Generally not intercepted.
void GEN_TEXT_APPLY_MSG( word stateFlags);
This prototype should be used to define your GenText's apply message (with GTXI_
applyMsg
).
Parameters:
stateFlags
The text object's GTXI_
stateFlags
status.
ATTR_GEN_TEXT_STATUS_MSG, MSG_GEN_TEXT_SEND_STATUS_MSG
If your GenText is operating in delayed mode, there usually occur times when its current state may not reflect the most recent changes. In most cases, this is fine, but in some cases you may wish to notify other UI objects of a change in your GenText's state without sending out an apply message. This can be done with a status message .
A status message allows your GenText object to send out a message whenever the user interacts with the text object, regardless of whether that change will be immediately applied. This is most useful for cases in which two UI objects depend on each other. The status message allows one UI object to inform its counterpart that its state has changed, and that the counterpart should change its state to reflect the new information.
To give a GenText object a status message, include ATTR_GEN_TEXT_STATUS_MSG in the object's declaration. Use the prototype GEN_TEXT_STATUS_MSG to define your status message. This prototype ensures that the status message passes the correct parameters (the current
GenTextStateFlags
).
Any user changes that do not result in the sending of the object's apply message will result in the sending of the object's status message. For an object in immediate mode, this attribute will have no effect. You may also manually send an object's status message by sending the GenText object
MSG_GEN_TEXT_SEND_STATUS_MSG
.
void MSG_GEN_TEXT_SEND_STATUS_MSG( Boolean modifiedState);
This message causes a GenText object to send out its status message, stored in the text object's ATTR_GEN_TEXT_STATUS_MSG vardata field. This message will still function even if the text object is not enabled (or usable).
Source: Unrestricted.
Destination: Any GenText object.
Parameters: modifiedState Non-zero if GVSF_MODIFIED bit should be passed with the status message.
Return: Nothing.
Interception: Generally not intercepted.
void GEN_TEXT_STATUS_MSG( word stateFlags);
This prototype should be used to define your GenText's status message (with ATTR_GEN_TEXT_STATUS_MSG).
Parameters:
stateFlags
The text object's GTXI_
stateFlags
status.
This section describes the various text controller classes and how best to use them. Controllers create their UI gadgetry wherever in the generic tree they are placed; this section will give some pointers to designing the text controller UI. For full information on
GenControlClass
and how controllers work, see the Controllers chapter.
Character Attribute Controllers
Paragraph Attribute Controllers
Search and Replace and Spell-Checking
The following controllers affect character attributes within a text object. As such, they each affect the contents of a text object's character attributes instance field (usually the
VisTextCharAttr
structure).
This controller works with the style character attributes of the current text selection. The features and tools of this controller are shown in TextStyleControlClass Features .
Code Display 10-25 TextStyleControlClass Features
typedef WordFlags TSCFeatures; #define TSCF_PLAIN 0x0800 #define TSCF_BOLD 0x0400 #define TSCF_ITALIC 0x0200 #define TSCF_UNDERLINE 0x0100 #define TSCF_STRIKE_THRU 0x0080 #define TSCF_SUBSCRIPT 0x0040 #define TSCF_SUPERSCRIPT 0x0020 #define TSCF_BOXED 0x0010 #define TSCF_BUTTON 0x0008 #define TSCF_INDEX 0x0004 #define TSCF_ALL_CAP 0x0002 #define TSCF_SMALL_CAP 0x0001
typedef WordFlags TSCToolboxFeatures; #define TSCTF_PLAIN 0x0800 #define TSCTF_BOLD 0x0400 #define TSCTF_ITALIC 0x0200 #define TSCTF_UNDERLINE 0x0100 #define TSCTF_STRIKE_THRU 0x0080 #define TSCTF_SUBSCRIPT 0x0040 #define TSCTF_SUPERSCRIPT 0x0020 #define TSCTF_BOXED 0x0010 #define TSCTF_BUTTON 0x0008 #define TSCTF_INDEX 0x0004 #define TSCTF_ALL_CAP 0x0002 #define TSCTF_SMALL_CAP 0x0001
#define TSC_DEFAULT_FEATURES (TSCF_PLAIN | TSCF_BOLD | TSCF_ITALIC | TSCF_UNDERLINE | TSCF_SUBSCRIPT | TSCF_SUPERSCRIPT | TSCF_STRIKE_THRU | TSCF_BOXED | TSCF_BUTTON | TSCF_INDEX | TSCF_ALL_CAP | TSCF_SMALL_CAP) #define TSC_DEFAULT_TOOLBOX_FEATURES (TSCTF_PLAIN | TSCTF_BOLD | TSCTF_ITALIC | TSCTF_UNDERLINE)
This controller allows the user to change font types of the current text selection. Its features and tools are shown in FontControlClass Features .
Code Display 10-26 FontControlClass Features
typedef WordFlags FCFeatures; #define FCF_SHORT_LIST 0x0002 #define FCF_LONG_LIST 0x0001
typedef WordFlags FCToolboxFeatures; #define FCTF_ROMAN 0x0004 #define FCTF_SANS 0x0002 #define FCTF_MONO 0x0001
#define FC_DEFAULT_FEATURES (FCF_SHORT_LIST | FCF_LONG_LIST) #define FC_DEFAULT_TOOLBOX_FEATURES (FCTF_ROMAN | FCTF_SANS | FCTF_MONO)
This controller controls the point size of the current text selection. Its features and tools are shown in PointSizeControlClass Features .
Code Display 10-27 PointSizeControlClass Features
typedef WordFlags PSCFeatures; #define PSCF_9 0x0800 #define PSCF_10 0x0400 #define PSCF_12 0x0200 #define PSCF_14 0x0100 #define PSCF_18 0x0080 #define PSCF_24 0x0040 #define PSCF_36 0x0020 #define PSCF_54 0x0010 #define PSCF_72 0x0008 #define PSCF_SMALLER 0x0004 #define PSCF_LARGER 0x0002 #define PSCF_CUSTOM_SIZE 0x0001
typedef WordFlags PSCToolboxFeatures; #define PSCTF_9 0x0400 #define PSCTF_10 0x0200 #define PSCTF_12 0x0100 #define PSCTF_14 0x0080 #define PSCTF_18 0x0040 #define PSCTF_24 0x0020 #define PSCTF_36 0x0010 #define PSCTF_54 0x0008 #define PSCTF_72 0x0004 #define PSCTF_SMALLER 0x0002 #define PSCTF_LARGER 0x0001 #define PSC_DEFAULT_FEATURES (PSCF_9 | PSCF_10 | PSCF_12 | PSCF_14 | PSCF_18 | PSCF_24 | PSCF_36 | PSCF_72 | PSCF_CUSTOM_SIZE | PSCF_SMALLER | PSCF_LARGER) #define PSC_DEFAULT_TOOLBOX_FEATURES (PSCTF_9 | PSCTF_10 | PSCTF_12 | PSCTF_14 | PSCTF_18 | PSCTF_24 | PSCTF_36 | PSCTF_72 | PSCTF_SMALLER | PSCTF_LARGER)
These controllers handle changes to the foreground (text) and background colors of the current text selection. They are both subclassed from
ColorSelectorClass
and therefore inherit the feature set of that class. The additional definitions for these classes are given in Character Color Controller Features
.
Code Display 10-28 Character Color Controller Features
/* Both CharFGColorControlClass and CharBGColorControlClass are subclasses of * ColorSelectorClass. For full details, see that class. */
@class CharFGColorControlClass, ColorSelectorClass; #define CFGCC_DEFAULT_FEATURES (CSF_INDEX | CSF_RGB | CSF_DRAW_MASK | CSF_PATTERN) @default GI_states = @default & ~GS_ENABLED; @default GCI_output = (TO_APP_TARGET); @endc
@class CharBGColorControlClass, ColorSelectorClass; #define CBGCC_DEFAULT_FEATURES (CSF_INDEX | CSF_RGB | CSF_DRAW_MASK | CSF_PATTERN) @default GI_states = @default & ~GS_ENABLED; @default GCI_output = (TO_APP_TARGET); @endc
This controller controls the font weight, font width, and track kerning of characters of the current text selection. Its features are shown in FontAttrControlClass Features .
Code Display 10-29 FontAttrControlClass Features
typedef WordFlags FACFeatures; #define FACF_FONT_WEIGHT 0x0004 #define FACF_FONT_WIDTH 0x0002 #define FACF_TRACK_KERNING 0x0001
typedef WordFlags FACToolboxFeatures;
#define FAC_DEFAULT_FEATURES (FACF_FONT_WEIGHT | FACF_FONT_WIDTH | FACF_TRACK_KERNING) #define FAC_DEFAULT_TOOLBOX_FEATURES 0 @default GCI_output = (TO_APP_TARGET);
The following controllers affect paragraph attributes within a text object. As such, they each affect the contents of a text object's paragraph attributes instance field (usually the
VisTextParaAttr
structure).
This controller allows the user to specify paragraph justification of the current text selection (left, right, center, or full). Its features and tools are shown in JustificationControlClass Features .
Code Display 10-30 JustificationControlClass Features
typedef WordFlags JCFeatures; #define JCF_LEFT 0x0008 #define JCF_RIGHT 0x0004 #define JCF_CENTER 0x0002 #define JCF_FULL 0x0001
typedef WordFlags JCToolboxFeatures; #define JCTF_LEFT 0x0008 #define JCTF_RIGHT 0x0004 #define JCTF_CENTER 0x0002 #define JCTF_FULL 0x0001 #define JC_DEFAULT_FEATURES (JCF_LEFT | JCF_RIGHT | JCF_CENTER | JCF_FULL)
#define JC_DEFAULT_TOOLBOX_FEATURES (JCTF_LEFT | JCTF_RIGHT | JCTF_CENTER | JCTF_FULL) @default GCI_output = (TO_APP_TARGET); @default GI_attrs = (@default | GA_KBD_SEARCH_PATH);
This controller controls several paragraph spacing characteristics of the current text selection (such as paragraph spacing on top, spacing on bottom, leading, and line spacing). Its features and tools are shown in ParaSpacingControlClass Features .
Code Display 10-31 ParaSpacingControlClass Features
typedef WordFlags PASCFeatures; #define PASCF_SPACE_ON_TOP_BOTTOM 0x0002 #define PASCF_LEADING 0x0001
typedef WordFlags PASCToolboxFeatures; #define PASCTF_SINGLE 0x8000 #define PASCTF_ONE_AND_A_HALF 0x4000 #define PASCTF_DOUBLE 0x2000 #define PASCTF_TRIPLE 0x1000
#define PASC_DEFAULT_FEATURES (PASCF_SPACE_ON_TOP_BOTTOM | PASCF_LEADING) #define PASC_DEFAULT_TOOLBOX_FEATURES (PASCTF_SINGLE | PASCTF_ONE_AND_A_HALF | PASCTF_DOUBLE | PASCTF_TRIPLE) @default GCI_output = (TO_APP_TARGET);
These controllers set the placement and features of both default and user-defined tabs in the current text selection. The features and tools of both controllers are shown in Tab Controllers .
Code Display 10-32 Tab Controllers
/* DefaultTabsControlClass */
typedef WordFlags DTCFeatures; #define DTCF_LIST 0x0002 #define DTCF_CUSTOM 0x0001
typedef WordFlags DTCToolboxFeatures;
#define DTC_DEFAULT_FEATURES (DTCF_LIST | DTCF_CUSTOM) #define DTC_DEFAULT_TOOLBOX_FEATURES 0 @default GCI_output = (TO_APP_TARGET);
/* TabControlClass */
typedef WordFlags TCFeatures; #define TCF_LIST 0x0080 #define TCF_POSITION 0x0040 #define TCF_GRAY_SCREEN 0x0020 #define TCF_TYPE 0x0010 #define TCF_LEADER 0x0008 #define TCF_LINE 0x0004 #define TCF_CLEAR 0x0002 #define TCF_CLEAR_ALL 0x0001
typedef WordFlags TCToolboxFeatures;
#define TC_DEFAULT_FEATURES (TCF_LIST | TCF_POSITION | TCF_GRAY_SCREEN | TCF_TYPE | TCF_LEADER | TCF_LINE | TCF_CLEAR | TCF_CLEAR_ALL) #define TC_DEFAULT_TOOLBOX_FEATURES 0 @instance word TCI_numberOfTabs; @instance Tab TCI_tabList[VIS_TEXT_MAX_TABS]; @instance word TCI_selectedTab; @default GCI_output = (TO_APP_TARGET);
This controller controls the background color, draw mask, and pattern of the background color of the current paragraph selections. Since
ParaBGColorControlClass
is a subclass of
ColorSelectorClass
, it inherits the functions of that class. Its features and tools are shown in ParaBGColorControlClass Features
.
Code Display 10-33 ParaBGColorControlClass Features
#define PBGCC_DEFAULT_FEATURES (CSF_INDEX | CSF_RGB | CSF_DRAW_MASK | CSF_PATTERN) @default GI_states = @default & ~GS_ENABLED; @default GCI_output = (TO_APP_TARGET);
This controller the user to set the "keep with," hidden, word wrapping, an widow and orphan attributes of the current paragraph selection. Its features and tools are shown in ParaAttrControlClass Features .
Code Display 10-34 ParaAttrControlClass Features
typedef WordFlags PACFeatures; #define PACF_WORD_WRAP 0x0010 #define PACF_HIDDEN_TEXT 0x0008 #define PACF_KEEP_PARA_WITH_NEXT 0x0004 #define PACF_KEEP_PARA_TOGETHER 0x0002 #define PACF_KEEP_LINES 0x0001
typedef WordFlags PACToolboxFeatures;
#define PAC_DEFAULT_FEATURES (PACF_WORD_WRAP | PACF_HIDDEN_TEXT | PACF_KEEP_PARA_WITH_NEXT | PACF_KEEP_PARA_TOGETHER | PACF_KEEP_LINES #define PAC_DEFAULT_TOOLBOX_FEATURES 0 @default GCI_output = (TO_APP_TARGET);
This controllers set border color and placement.
BorderColorControlClass
is a subclass of
ColorSelectorClass
and therefore inherits the features and tools of that class. The tools and features of both controllers are shown in Border Controller Features
.
Code Display 10-35 Border Controller Features
/* BorderControlClass */
typedef WordFlags BCFeatures; #define BCF_LIST 0x0002 #define BCF_CUSTOM 0x0001
typedef WordFlags BCToolboxFeatures;
#define BC_DEFAULT_FEATURES (BCF_LIST | BCF_CUSTOM) #define BC_DEFAULT_TOOLBOX_FEATURES 0 @default GCI_output = (TO_APP_TARGET);
/* BorderColorControlClass */
typedef WordFlags BCCToolboxFeatures; #define BCC_DEFAULT_FEATURES (CSF_INDEX | CSF_RGB | CSF_DRAW_MASK | CSF_PATTERN) #define BCC_DEFAULT_TOOLBOX_FEATURES 0 @default GI_states = @default & ~GS_ENABLED; @default GCI_output = (TO_APP_TARGET);
This controller allows the user to set "drop cap" features of the current paragraph selection. Its features and tools are shown in DropCapControlClass Features .
Code Display 10-36 DropCapControlClass Features
typedef WordFlags DCCFeatures; #define DCCF_DROP_CAP 0x0001
typedef WordFlags DCCToolboxFeatures;
#define DCC_DEFAULT_FEATURES (DCCF_DROP_CAP) #define DCC_DEFAULT_TOOLBOX_FEATURES 0 @default GCI_output = (TO_APP_TARGET);
This controller sets the implementation of automatic word hyphenation of the current paragraph selection. Its features and tools are shown in HyphenationControlClass .
Code Display 10-37 HyphenationControlClass
typedef WordFlags HCFeatures; #define HCF_LIST 0x0001
typedef WordFlags HCToolboxFeatures;
#define HC_DEFAULT_FEATURES (HCF_LIST) #define HC_DEFAULT_TOOLBOX_FEATURES 0 @default GCI_output = (TO_APP_TARGET);
This controller sets the left, paragraph, and right margins of the current paragraph selection. Its tools and features are shown in MarginControlClass .
Code Display 10-38 MarginControlClass
typedef WordFlags MCFeatures; #define MCF_LEFT_MARGIN 0x0004 #define MCF_PARA_MARGIN 0x0002 #define MCF_RIGHT_MARGIN 0x0001
typedef WordFlags MCToolboxFeatures;
#define MC_DEFAULT_FEATURES (MCF_LEFT_MARGIN | MCF_PARA_MARGIN | MCF_RIGHT_MARGIN) #define MC_DEFAULT_TOOLBOX_FEATURES 0 @default GCI_output = (TO_APP_TARGET);
This controller manages how the
TextRulerClass
ruler operates, if any text ruler is used. The TextRuler provides a complete ruler for the text object. The features and tools of the TextRulerControl are shown in TextRulerControlClass
.
Code Display 10-39 TextRulerControlClass
typedef WordFlags TRCCFeatures; #define TRCCF_ROUND 0x0002 #define TRCCF_IGNORE_ORIGIN 0x0001
typedef WordFlags TRCCToolboxFeatures;
#define TRCC_DEFAULT_FEATURES (TRCCF_ROUND | TRCCF_IGNORE_ORIGIN) #define TRCC_DEFAULT_TOOLBOX_FEATURES 0
typedef WordFlags TextRulerControlAttributes; #define TRCA_ROUND 0x8000 #define TRCA_IGNORE_ORIGIN 0x4000 @instance TextRulerControlAttributes TRCI_attrs = TRCA_ROUND;
This controller allows the user to set up and use style sheets with the target text object. It is subclassed off
StyleSheetControlClass
and inherits all the features and tools of that class. It has no additional tools or features of its own.
TextSearchInString(), TextSearchInHugeArray(), SearchOptions, WildCard
Text searches are not specifically part of
VisTextClass
, but are commonly used on text objects, and they are discussed here for that reason.
TextSearchInString()
searches in a single text chunk for a passed text string. If a match is found, a pointer to that match (and the length of the match) are returned in buffers.
TextSearchInHugeArray()
performs the same searching operations, but can return the segment and offset of a found match within a huge array.
The following
SearchOptions
may affect the search procedure:
WildCard
values and treats them as the control character values (CTRL_P, CTRL_Q and CTRL_R) which they overlap.
Both routines may take wild cards (type
WildCard
) in the place of any character. These wildcards tell the search mechanism to accept any character in the allotted space. Passing WC_MATCH_MULTIPLE_CHAR instructs the search mechanism to accept any number of random characters in that place in the search string. The values of
WildCard
are:
You can set higher-level features of your text objects with the
SearchReplaceControlClass
and
SpellControlClass
controllers. These controllers allow spell-checking and search and replace. These two controllers are designed to interact with each other and use common messages.
This controller allows the use of the text object's built-in search and replace features. The controller must be placed on the GAGCNLT_SELF_LOAD_OPTIONS Application GCN list. This controller sends out the following messages to its GCI_
output
, which may be intercepted to provide custom behavior:
Because many of these messages are shared by the SpellControlClass, they are described in Shared Functionality .
The Search & Replace messages make use of a
SearchReplaceStruct
. This structure is followed by text string(s) that represent the strings to search (and replace if that is the case). These strings may contain
WildCard
values (unless SO_NO_WILDCARDS is set in
params
).The
SearchReplaceStruct
is shown below:
typedef struct { word searchSize; word replaceSize; byte params; optr replyObject; Message replyMsg; } SearchReplaceStruct;
searchSize stores the number of characters in the search string, including the null terminator.
replaceSize stores the number of characters in the replace string (if present), including the null terminator.
params
stores the
SearchOptions
in use for this operation.
replyObject stores the optr of the object to send the replyMsg to if the string is not found.
replyMsg stores the message sent to the replyObject above.
The block containing this
SearchReplaceStruct
will contain either one null-terminated string (if the operation is just a simple search operation) or a null-terminated search string followed by a null-terminated replace string (if the operation is a search & replace).
@importMessage MetaSearchSpellMessages, void MSG_SEARCH( MemHandle searchInfo);
This message is sent by the SearchReplace controller when an object is starting a search operation. You may intercept this message to find out the nature and specifics of the search.
Source: Search controller.
Destination: GCI_
output
of the search controller (usually a text object).
Parameters:
searchInfo
Handle of block containing the
SearchReplaceStruct
. The search string immediately follows this structure in the passed block. This block should be freed by the message handler.
Interception: Intercept to find out the nature of the search and replace operation.
The features and tools of this controller are shown in SearchReplaceControlClass Features .
Code Display 10-40 SearchReplaceControlClass Features
typedef WordFlags SRCFeatures; #define SRCF_CLOSE 0x200 #define SRCF_FIND_NEXT 0x100 #define SRCF_FIND_PREV 0x80 #define SRCF_REPLACE_CURRENT 0x40 #define SRCF_REPLACE_ALL_IN_SELECTION 0x20 #define SRCF_REPLACE_ALL 0x10 #define SRCF_PARTIAL_WORDS 0x08 #define SRCF_IGNORE_CASE 0x04 #define SRCF_WILDCARDS 0x02 #define SRCF_SPECIAL_CHARS 0x01
typedef WordFlags SRCToolboxFeatures; #define SRCTF_SEARCH_REPLACE 0x01
#define SRC_DEFAULT_FEATURES (SRCF_FIND_NEXT | SRCF_FIND_PREV | SRCF_REPLACE_CURRENT | SRCF_REPLACE_ALL | SRCF_PARTIAL_WORDS | SRCF_IGNORE_CASE | SRCF_WILDCARDS | SRCF_SPECIAL_CHARS | SRCF_REPLACE_ALL_IN_SELECTION | SRCF_CLOSE) #define SRC_DEFAULT_TOOLBOX_FEATURES (SRCTF_SEARCH_REPLACE)
This controller allows you to include the advanced spelling-checker features of the text object. The controller must be placed on the GAGCNLT_SELF_LOAD_OPTIONS Application GCN list. The
SpellControlClass
controller defaults to a state of not enabled; it should be set GS_ENABLED before use.
If the controller will affect a text object within a document object, the SpellControl should be added to the GenDocumentControlClass object's GDCI_
enableDisableList
. This will ensure that the spell controller is automatically enabled when text appears within the document.
This controller sends out the following messages, which may be intercepted to provide custom behavior:
@importMessage MetaSearchSpellMessages, void MSG_SPELL_CHECK(@stack optr replyObj, dword numCharsToCheck, SpellCheckOptions options, MemHandle ICbuff);
This message is sent by the Spell controller to continue spell checking from the current position in the document.
Source: Spell controller.
Destination: GCI_
output
of the spell controller.
Parameters: replyObj Object to send MSG_SPELL_CHECK_COMPLETED.
SpellCheckOptions
in use for this operation.
IC
buff
Interception: Intercept to find out the nature of the spell checking operation.
@importMessage MetaSearchSpellMessages, void MSG_META_GET_CONTEXT(@stack dword position, ContextLocation location, word numCharsToGet, optr replyObj);
This message is sent by the Spell controller to find out the current context of the text object. Other objects may also send this message to the text object. The text object will return MSG_META_CONTEXT to the requestor.
Source: The Spell controller. (Other objects may want to send this to retrieve the text context displayed in the spell box.)
Destination: GCI_
output
of the Spell controller (usually a text object).
Parameters:
position
Position of the context. The context returned depends on this value and the
ContextLocation
passed in
location
.
ContextLocation
. This may be one of the following values:Interception: You may intercept to alter the nature of the context request.
@importMessage MetaSearchSpellMessages, void MSG_META_CONTEXT( MemHandle data);
This message returns the current context to the SpellControl object.
Source: A text object receiving MSG_META_GET_CONTEXT.
Destination: The object that sent the request.
Parameters:
data
ContextData
structure storing information on the context, and the null-terminated context string.
Structures:
typedef struct { optr CD_object; dword CD_numChars; dword CD_startPos; VisTextRange CD_selection; } ContextData;
CD_
object
stores the optr of the object that the context is coming from.
CD_
numChars
stores the number of characters in the text object.
CD_
range
stores the range of characters that this context represents within the text object.
CD_
selection
stores the range of characters that represent the current text selection.
The null-terminated context data follows this structure.
Interception: Generally not intercepted.
Its feature and tool definitions are shown in SpellControlClass .
Code Display 10-41 SpellControlClass
typedef WordFlags SpellFeatures; #define SF_CLOSE 0x2000 #define SF_CONTEXT 0x1000 #define SF_SIMPLE_MODAL_BOX 0x0800 #define SF_SUGGESTIONS 0x0400 #define SF_CHECK_ALL 0x0200 #define SF_CHECK_TO_END 0x0100 #define SF_CHECK_SELECTION 0x0080 #define SF_SKIP 0x0040 #define SF_SKIP_ALL 0x0020 #define SF_REPLACE_CURRENT 0x0010 #define SF_REPLACE_ALL 0x0008 #define SF_ADD_TO_USER_DICTIONARY 0x0004 #define SF_EDIT_USER_DICTIONARY 0x0002 #define SF_STATUS 0x0001
typedef WordFlags SpellToolboxFeatures; #define STF_SPELL 0x01
#define SC_DEFAULT_FEATURES (SF_STATUS | SF_EDIT_USER_DICTIONARY | SF_ADD_TO_USER_DICTIONARY | SF_REPLACE_ALL | SF_REPLACE_CURRENT | SF_SKIP_ALL | SF_SKIP | SF_CHECK_SELECTION | SF_CHECK_TO_END | SF_SUGGESTIONS | SF_CLOSE | SF_CONTEXT) #define SC_DEFAULT_TOOLBOX_FEATURES STF_SPELL
The SearchReplace and Spell controllers share a common range of messages (
MetaSearchSpellMessages
) imported from
MetaClass
. (The messages MSG_SEARCH and MSG_SPELL_CHECK are specific to their respective controllers and were described earlier.) These messages common to both controllers are listed and described here.
@importMessage MetaSearchSpellMessages, void MSG_REPLACE_CURRENT( MemHandle replaceInfo);
This message is sent by the SearchReplace controller when an object is starting a search operation that should replace the found match with the passed replacement string. This message involves a single replacement operation. To perform a replace-all operation, use MSG_REPLACE_ALL_OCCURENCES.
Source: Search controller.
Destination: GCI_
output
of the search controller (usually a text object).
Parameters:
replaceInfo
Handle of block containing the
SearchReplaceStruct
. The null-terminated search string immediately follows this structure. The null-terminated replace string follows that string. This block should be freed by the message handler.
Interception: Intercept to find out the nature of the replacement operation.
@importMessage MetaSearchSpellMessages, void MSG_REPLACE_ALL_OCCURRENCES( MemHandle replaceInfo, Boolean replaceFromBeginning);
This message is sent by the SearchReplace controller when an object is starting a search operation that should replace all found matches (in the search string) with the passed replacement string.
Source: Search controller.
Destination: GCI_
output
of the search controller (usually a text object).
Parameters:
replaceInfo
Handle of block containing the
SearchReplaceStruct
. The null-terminated search string immediately follows this structure. The null-terminated replace string follows that string. This block should be freed by the message handler.
Interception: Intercept to find out the nature of the replacement operation.
@importMessage MetaSearchSpellMessages, void MSG_REPLACE_ALL_OCCURRENCES_IN_SELECTION( MemHandle replaceInfo, Boolean replaceFromBeginning);
This message is sent by the SearchReplace controller when an object is starting a search operation that should replace all found matches within a selection (in the search string) with the passed replacement string.
Source: Search controller.
Destination: GCI_
output
of the search controller (usually a text object).
Parameters:
replaceInfo
Handle of block containing the
SearchReplaceStruct
. The null-terminated search string immediately follows this structure. The null-terminated replace string follows that string. This block should be freed by the message handler.
Interception: Intercept to find out the nature of the replacement operation.
@importMessage MetaSearchSpellMessages, void MSG_META_GET_OBJECT_FOR_SEARCH_SPELL( GetSearchSpellObjectOption option, optr curObject);
This message is sent by a text object to itself when a search reaches the end of the current object and needs to determine where to continue the search.
Source: Any text object.
Destination: The text object sends this to itself.
Parameters:
option
GetSearchSpellObjectOption
specifying the next object to continue the search at. This value may be GSSOT_FIRST_OBJECT, GSSOT_LAST_OBJECT, GSSOT_NEXT_OBJECT, or GSSOT_PREV_OBJECT.
Interception: May intercept if you want to direct where a search or spell check operation should continue to.
@importMessage MetaSearchSpellMessages, void MSG_META_DISPLAY_OBJECT_FOR_SEARCH_SPELL();
This message is sent by the text object to itself when a matching word (or misspelled word if the controller is a Spell controller) has been found and should be displayed.
Source: The text object.
Destination: The text object sends this to itself.
Interception: You may intercept this message at the text object to receive notification of a match.


DARPA Spectrum Challenge - Final Tournament
Last updated:
please wait...
Competitive
Tweets by @volgy
Cooperative


This process will accept a tar archive file that has been gzip-compressed. The typical
file-extension for this archive format is ".tgz
", but a file-extension of
".tar.gz
" is also sometimes used. The files in the archive should have the
following nomenclature; "hscr/beshare/1.png
". In this example, a PNG
bitmap image is being supplied as a screenshot for the "beshare" package. Any number of
such screenshots can be supplied.
The process can operate in one of two strategies. In "Replace existing screenshots" mode, all existing screenshots are lost and the new screenshots are imported. In "Add to existing screenshots" mode, existing screenshots are retained and new screenshots are imported in addition to those existing ones.


|| Om || D.A.V. PUBLIC SCHOOL (10+2 Affiliated with C.B.S.E. New Delhi) Sec-II, T.H.A. Rajinder Nagar, Sahibabad, Ghaziabad (U.P.)
A school certified with ISO 9001 : 2000 for Quality Worldclass Education


@title
Stories
| Username | Date | Activity ID | Hours Spent on Activity | % of Time Spent Trying to Understand Code |
|---|---|---|---|---|
| @story.username | @story.showDate | @story.showActivityID | @story.showTimeForStoryOrBug | @story.showPercentage |
| Averages | @statistics.getAverageTotalTime(stories) hours | @statistics.getAverageTimeUnderstandingCode(stories)% |
Bugs
| Username | Date | Activity ID | Hours Spent on Activity | % of Time Spent Trying to Understand Code |
|---|---|---|---|---|
| @bug.username | @bug.showDate | @bug.showActivityID | @bug.showTimeForStoryOrBug | @bug.showPercentage |
| Averages | @statistics.getAverageTotalTime(bugs) hours | @statistics.getAverageTimeUnderstandingCode(bugs)% |
Meetings
| Username | Date | Hours Spent on Activity |
|---|---|---|
| @meeting.username | @meeting.showDate | @meeting.showTimeForMeeting |
| Averages | @statistics.getAverageTotalTime(meetings) hours |
Breakdown by Activity Type
| Total # of Hours | % of Total Hours | |
|---|---|---|
| Story | @statistics.getTotalTime(stories) | @statistics.showPercentage(stories) |
| Bug | @statistics.getTotalTime(bugs) | @statistics.showPercentage(bugs) |
| Meeting | @statistics.getTotalTime(meetings) | @statistics.showPercentage(meetings) |
| Total | @statistics.getTotalTime() | @statistics.getTotalPercentage% |


redirect_from: "/szn1/"
soul
Products
$35 CAD
White Long Sleeve Tee w/ Cherry Blossom design on arms
$35 CAD
Black Long Sleeve Tee w/ Cherry Blossom design on arms
- Unisex Sizing from S-XL
- 6.0 oz., 100% Cotton
- Set-in rib collar with shoulder-to shoulder taping
- Rib sleeve cuffs
- Preshrunk to minimize shrinkage
- Double-needle bottom hem;
- Unisex Sizing from S-XL
- 6.0 oz., 100% Cotton
- Set-in rib collar with shoulder-to shoulder taping
- Rib sleeve cuffs
- Preshrunk to minimize shrinkage
- Double-needle bottom hem;


|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Endpoint
An Endpoint represents an endpoint of a Pipe
. An Endpoint can be
created, and listened to, and connected to.
An Endpoint represents an end of a byte stream. Depending on how a Endpoint
gets created, it can be listened to or connected to. In both cases, the
endpoint returns a Pipe
. Hence, a Endpoint acts in fact as a
Pipe
factory: multiple Pipe
s can be created from it by
repeatedly listening for incoming connections. The behaviour is similar to
listening on a BSD socket.
Endpoints obtained from the AdvertService
cannot be listened to.
Pipe
s created from endpoints continue to live after the
Endpoint
instance is destroyed.
| Method Summary | |
|---|---|
Pipe |
connect()
Connect to the Endpoint . |
Pipe |
listen()
Listen for a new connection to the Endpoint . |
Pipe |
listen(int timeout)
Listen for a new connection to the Endpoint . |
void |
listen(PipeListener pipeListener)
Listen for a new connection to the Endpoint . |
void |
listen(PipeListener pipeListener,
int timeout)
Listen for a new connection to the Endpoint . |
| Methods inherited from interface org.gridlab.gat.monitoring.Monitorable |
|---|
addMetricListener, getMeasurement, getMetricDefinitionByName, getMetricDefinitions, removeMetricListener |
| Methods inherited from interface org.gridlab.gat.advert.Advertisable |
|---|
marshal |
| Method Detail |
|---|
Pipe connect() throws GATInvocationException
Endpoint
.
When a Endpoint
is obtained from an AdvertService
, it
can be used to create a Pipe
connected to the advertising
application, by calling connect on the Endpoint
instance.
Pipe
connected to the Endpoint
.
GATInvocationException
- if no connection could be made.Pipe listen() throws GATInvocationException
Endpoint
.
The creator of an Endpoint
can use the Endpoint
to create
Pipe
s, which represent incoming connections. This is done by
calling listen on the Endpoint
instance. This call is
synchronous, and blocks until a connection has been made.
Pipe
connected to the Endpoint
.
GATInvocationException
- if no connection could be made.Pipe listen(int timeout) throws GATInvocationException
Endpoint
.
The creator of an Endpoint
can use the Endpoint
to create
Pipe
s, which represent incoming connections. This is done by
calling listen on the Endpoint
instance. This call is
synchronous, and blocks until a connection has been made or until the
specified timeout expires.
timeout
- the specified timeout in milliseconds
Pipe
connected to the Endpoint
.
GATInvocationException
- if no connection could be made.void listen(PipeListener pipeListener) throws GATInvocationException
Endpoint
.
The creator of an Endpoint
can use the Endpoint
to create
Pipe
s, which represent incoming connections. This is done by
calling listen on the Endpoint
instance. This call is
asynchronous, and returns immediately. When a new connection has been
made, the pipeListener will be informed.
pipeListener
- the listener that will be informed
GATInvocationException
- if no connection could be made.void listen(PipeListener pipeListener, int timeout) throws GATInvocationException
Endpoint
.
The creator of an Endpoint
can use the Endpoint
to create
Pipe
s, which represent incoming connections. This is done by
calling listen on the Endpoint
instance. This call is
asynchronous, and returns immediately. When a new connection has been
made, the PipeListener
will be informed.
pipeListener
- the PipeListener
that will be informedtimeout
- the specified timeout in milliseconds
GATInvocationException
- if no connection could be made.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |


|
An Early Report on "Minority
Report"
by Paul Bergman
Minority Report is a Steven Spielberg film based on
a story by Phillip K. Dick. It is scheduled for release about
10 days after I write this brief analysis. I attended a studio
screening to which a number of law professors were invited.
The
story is a futuristic thriller set in Washington, D.C. in the
mid-21st century. The basic concept is that three people called
"Pre-Cogs" have the ability to predict murder. Based
on the Pre-Cogs' unerring accuracy, D.C. has enacted preventive
detention laws that allow officials to arrest people before they
can commit crimes and hold them indefinitely in a kind of animated
suspension. Tom Cruise portrays the official who interprets the
Pre-Cogs' visual images and tries to locate and arrest the murderers
before crimes can take place. The program has been extremely
successful -- D.C. has gone years without a murder. In fact,
the country is soon to vote on an initiative that would extend
the program nationwide.
Without giving away too much
of the story, I can say that even those who are vaguely familiar
with the films of Alfred Hitchcock will recognize that Minority
Report pays homage to one of his most familiar themes, the
"innocent man on the run." (Fans of Hitchcock's Spellbound
will especially appreciate Minority Report's conclusion.)
Like a Hitchcock film, Minority Report has nice touches
of humor, especially when the action moves to a shopping center
in which all the stores know customers' purchase history. Many
sequences are visually compelling, particularly the sequences
in which Cruise orchestrates the Pre-Cogs' images in an effort
to understand their message. The music, by John Williams, is
often soaring. The ultra-squeamish should be advised, however,
that the film does contain a short bit of gore.
Minority Report raises interesting questions about
some fundamental criminal law issues. United States criminal
law policy has always been to punish people who do (or attempt
to do) evil deeds, not people who think evil thoughts or even
plan evil deeds, so long as those deeds stay strictly in the
planning realm. In part, this policy is based on a sense that
all of us think evil thoughts at one time or another, and we
have no way of predicting whose thoughts will become concrete
deeds. But what if we could know ahead of time, with certainty,
the identities of those who will shortly kill? Isn't it preferable
to prevent harm than to punish after harm has taken place? Why
would we have to be 100% certain of accuracy before permitting
preventive detention, when we permit executions based on "beyond
a reasonable doubt"? On the other hand, once a killing is
prevented, is it necessary to lock a person away forever? Studies
suggest that many killings are done in the heat of a moment;
once that moment passes, couldn't many people be trusted not
to kill?
Questions such as these are
not merely academic. Following the killing spree by two teenagers
at Columbine High School in Colorado, other children were arrested
based on plans to commit violence that they had revealed to others
or written about in private diaries. In California and other
states, sex offenders can be kept in prison indefinitely, even
after their sentences expire, based on expert opinions that the
offenders remain a threat to repeat their acts. In the months
following the Sept. 11, 2001 tragedy at the World Trade Center,
a number of Muslims have been detained based on evidence that
they planned to do evil. And in garden-variety personal conflicts,
judges often issue "restraining orders" to try to prevent
one person from harming another.
In none of these situations,
admittedly, has the information leading to detention or other
restrictions on freedom been provided by fortune-tellers. However,
popular confidence in the conclusions of "hard scientists"
is probably lower, and popular confidence in psychic predictions
is probably higher, than many of us would like to believe. By
mid-century, who is to say that scientists won't be able to provide
predictions that are solid enough for us as a society to accept
preventive detention?
Posted: July 5, 2002
|


{% extends "dashboard_base.html" %} {% block main %}
Show more
You need to upload some files to analyze.


--- layout: default title: "404: Page not found" permalink: 404.html ---
Whoops! Either my site's broken or you typed something incorrectly . . . Check your destination and please let me know if it's the former. Head back home to try finding it again.


The toast widget listens for any notification service messages
size: large, anchor: left
size: small, anchor: right


Mission
The mission of Stanford Open Credit Project (SOCP) is to accelerate the dissemination of open credit data and technologies in order to understand and prevent credit crises.
Members
Kay Giesecke, Stanford University<EMAIL_ADDRESS>(co-Chair)
Kapil Jain, Stanford University<EMAIL_ADDRESS>(co-Chair) Krishna Kumar, Omega Advisors<EMAIL_ADDRESS>Source Technology
http://github.com/stanford-ocp
Contributors
Please email us to inquire about membership or contributing to SOCP.
Sponsors
We appreciate the generous support of: the Stanford Center for Financial and Risk Analytics, the Stanford Institute for Computational and Mathematical Engineering


Plugins
There are other plugins for octopress, but here’s an overview of the ones you’ll be likely to use while blogging. This is mainly a description and demo, so be sure to follow the links beneath each section for examples and documentation.
Excerpts
When writing a post, you can add an HTML comment <!--more-->
to split the post for an excerpt. Only the first section of the post, before the comment,
will show up on the blog index.
HTML5 Video Tag
This plugin makes it easy to insert mp4 encoded HTML5 videos in a post. Octopress ships with javascripts which detect mp4 video support (using Modernizr) and automatically offer a flash player fallback.
Image Tag
This plugin makes it easy to insert images in a post, with optional class names, alt and title attributes.
Block quote
Give a man a fish, he’ll have food for a day. Teach a man to fish, and he’ll always come to you with his fishing problems.
Pull quote
Octopress offers a CSS only technique for pull quotes, based on the technique by Maykel Loomans.
When writing longform posts, I find it helpful to include pull quotes to help readers easily identify the topics covered in each section. Some prefer to break things up with lots of headings, and while this seems to be a trend it doesn’t work so well for long form prose. It is important to note that pull quotes are merely visual in presentation and should not appear twice in the text. That is why it a CSS only technique for styling pull quotes is preferable. Octopress includes a handy pull quote plugin to make this easy for you.
Code Blocks
Write blocks of code directly in your posts and optionally add titles and links.
1 2 |
|
Gist Tag
Easily embed gists in your posts or pages.
{% gist 996818 %}
Include Code
Import files on your filesystem into any blog post as embedded code snippets with syntax highlighting and a download link.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
|
Render Partial
Import files on your file system into any blog post or page. For example, to embed this page in another post I’d use the following code.
{% render_partial docs/blogging/plugins/index.markdown %}
Also see the Octopress Plugin index for the full list of Octopress plugins.


Conditions
Trails
Contact
Bacon ipsum dolor amet cillum quis turducken tri-tip chuck leberkas lorem excepteur officia ad et capicola short loin in. Velit occaecat andouille
Check out our variety of Seasonal and Day passes to find what works best for you
For up to 5 people
For up to 5 people
For up to 5 people
For up to 5 people
For up to 5 people
Fo
Check out our variety of Seasonal and Day passes to find what works best for you
If you’re feeling sick, please refrain from visiting our resort.
You must wear a mask at all times while visiting.
Our staff is taking every precaution and constantly cleaning.
Please wash your hands frequently while visiting us.
For the time being, dine in services are on hold. Takeout only.
Please keep 2 meters apart at all times. That’s one ski apart!
Stay up to date on promos, announcements, and weather information.


About Us
Contact Us
Stay Current. Stay Informed.
Click here for current COVID-19 articles, news and statistics
Click on a province to view their most recent COVID-19 statistics.
Ontario
Alberta
British Columbia
Manitoba
New Brunswick
Newfoundland & Labrador
Nova Scotia
Nunavut
Northwest Territories
P.E.I
Quebec
Saskatchewan
Yukon
SpringerLink Publication
Canadian News Publication
Canadian Statistics
Provincial Statistics
Contact Us
Email<EMAIL_ADDRESS>Office: 1.866.COV-ID19
Newsletter Registration
Submit


{% include head.html %}
{% include header.html %} {% include about.html %} {% include classes.html %} {% include scholarships.html %} {% include teams.html %} {% include shows.html %} {% include calendar.html %} {% include contact.html %} {% include footer.html %} {% include js.html %}