If you’ve played more than a few hours of Skyrim, this is for you…
Completely unrealistic example - A Backbone Blog
Last week, while I was playing and coding on my Backbone blog project (backbone-rails-blog), I started wondering if it was something I could use to replace this blog, since I put so much time on it lately. But at the same time I kept telling myself, is Google going to index the content? The short answer is: NO, not now anyway.
The long answer goes like this: Facebook comments are indexed. So there should be a way to provide this content to GoogleBot. I have done my homework and this document, Making Ajax Applications Crawlable) provides some answers. Basically, we need the hashbang) url format. This is achieved with Backbone when we are not using pushstate.
Hashbang url:
http://sebastienlachance.com#!blog-post
My urls:
http://sebastienlachacne.com/blog-post
And frankly, I will not pursue this path. In my case anyway, it provides no real advantages to have an Ajax-powered blog.
In fact, I could have left Backbone and only use it on the admin backend, but as a learning tool, I didn’t want to revert back (and there is so much great blogging platform now anyway).
Do you have any other web apps ideas (other than a todo list or blog)? In my next iteration (that is, the next app), I will be using Backbone with NodeJs and MongoDB. Sounds fun.
Available
I am now available to do freelance web development. Contract or on site.
I have experience in ASP.NET (MVC or WebForms) and Ruby On Rails. HTML, Javascript and CSS, no problem.
You can see my CV here (CV).
I can be on site if you are in the area or work remotely (I also have experience in that).
I am looking forward to accept new challenges and deliver WORKING solutions!
You can contact me here (Twitter), (LinkedIn) or here (at sebastien.lachance creatiom.com).
Disponible pour mandat de développement
Je suis maintenant disponible pour des mandats de développement Web à la pige. Contrat ou sur place.
J’ai de l’expérience en ASP.NET (MVC ou WebForms) et Ruby On Rails. HTML, Javascript et CSS, aucun problème.
Vous pouvez consultez mon CV ici (CV).
Je peux me déplacer si vous êtes dans la région ou travailler à distance (j’ai aussi de l’expérience dans ça).
J’ai très hâte de relever de nouveaux défis et de livrer des solutions qui FONCTIONNENT.
Vous pouvez me contactez ici (Twitter), ici (LinkedIn) ou ici (sebastien.lachance at creatiom.com).
Rerun all Guards
I have been searching this feature for a while and never realized it was built-in into Guard. Whenever I tried to rerun all with pressing enter, nothing happened. I didn’t realized I was because of an old gem version.
Ctrl-r if you are on Guard version < 7
and
enter if you are on a more recent version
Help needed, A Backbone blog
I’m currently doing my best to learn Backbone and his best practices. I have set up a demo blog application on GitHub (Backbone-rails-blog).
So, if you are interested to give me some feedback, tips or check out the development progress, just watch the project to see where things are going and I’ll blog the important parts as I move forward.
Filling a select from an array on javascript object
As a reminder for my future self, here is how I fill a select from an array of javascript object.
Converting a BlogEngine.Net blog to Octopress
Some months ago, I moved my BlogEngine.net blog (hosted on GoDaddy) to Octopress hosted on Heroku. I needed a tool to migrate all my posts and found nothing that could apply to my case (I’m pretty sure there is something out there, but I didn’t look very far and wanted to code the tool myself anyway).
Octopress blog post format look like this:
---
layout: post
title: "Setting ComVisible"
date: 2005-01-19 14:46:00
comments: true
categories:
---
** This is my post using Markdown **
My BlogEngine.Net was configured to use xml files to store posts. Which look like this:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<post>
<author>SebastienLachance</author>
<title>Building a new app - Introduction</title>
<description>The introduction</description>
<content>This is ...
At first, I wanted to move each post individually whenever I could. After a week and pretty much nothing converted, I created a little .Net tool to make the conversion/migration much easier.
It’s a pretty basic windows form application that takes a path and output a bundle of simili-markdown (because the original posts are html, but, since markdown accept html, it’s fine) files that are compatible with the Octopress format.
It’s also generating a redirection.rb file that contains necessary code to be used by rack-rewrite to make necessary 301 redirection. It can be useful if you don’t want to write it all manually.
use Rack::Rewrite do
r301 %r{^/post/The-surprising-science-of-motivation-by-Dan-Pink.aspx?$}, '/blog/the-surprising-science-of-motivation-by-dan-pink'
r301 %r{^/post/Building-a-new-application-Introduction.aspx?$}, '/blog/building-a-new-application-introduction'
r301 %r{^/post/tight-deadlines.aspx?$}, '/blog/tight-deadlines'
r301 %r{^/post/no-such-file-to-load-cucumberrailsactive_record-(LoadError).aspx?$}, '/blog/no-such-file-to-load-cucumberrailsactive_record-(loaderror)'
r301 %r{^/post/Buying-games-on-Steam.aspx?$}, '/blog/buying-games-on-steam'
r301 %r{^/post/AlternativeToNet-review.aspx?$}, '/blog/alternativetonet-review'
r301 %r{^/post/Excellent-post-by-Uncle-Bob.aspx?$}, '/blog/excellent-post-by-uncle-bob'
You can grab the source here : BlogEngineToOctopres
My starting Gemfile
This is how my Gemfile looks like at the moment. Continuous feedback with Guard and metrics to keep track on defects and best practices not used.
Startup Camp Quebec
Jeudi dernier, avait lieu l’événement Startup Camp Québec.
Je ne suis pas un habitué de ces événements même si j’ai ma propre compagnie et ait participé à quelques coktails et diners aux homards (j’aime pas le homard). C’était quand un monde nouveau avec de nouvelles personnes.
Il y avait 8 startups qui présentaient leur produits. J’ai bien aimé les présentations, et j’ai beaucoup accroché sur quelques projets. Particulièrement le projet Trapèze École de MX4. Ils ont créer une manière de gérer les horaires dans les écoles, et ca, c’est ce que j’appelle trouver des solutions à un problème.
Mais le grand gagnant de cette édition est FateCraft, qui développe des jeux sociaux.
Je n’ai malheureusement pu rester jusqu’à la fin et voir la remise des prix. Mais je souhaite quand même bonne chance à toutes ces jeunes entreprises et puissent-elles continuer malgré toutes les embuches qui peuvent se présenter devant elles.


Wayne is professional footballer who plays for and captains both Manchester United and the England national team. He has played much of his career as a forward, but he has also been used in various midfield roles.


There are a lot of stories showing that the right measurement is important, that market valuation is not a simple calculation of tangible assets, or that showing new measurements are used to give further insight in the organization. All this is related to the term intellectual capital, which has been defined in many ways. It is about those intangible assets that do not show up on financial statements but can be codified, valued and managed by the company. It might be knowledge of people that is important to a company. Or it can be said to be the combination of patents, processes, skills, about stakeholders of a company. Economists define it simply as Tobin’s-q.
<!– more –>
The principles of intellectual capital

The concern with intellectual capital comes from different sources: - a more accurate valuation of intangible inputs increase market efficiency through more appropriate flows of capital - new measurements provide managers with a clearer picture - to guide future strategy like accounting systems do

Accuracy in valuations

Brand valuation, goodwill, human assets accounting are all subjects brought forward in the discussion about truly valueing a company. Still there is a difference between book and market value of companies.

Goodwill on the books is also only what was paid for another company above book value, calculated via "fair" value of the underlying assets. Intangible assets can be valued by accountants by finding out their market value. The difference between what the accountant then says the company is worth and what you pay is goodwill.

The difference between accounting data and share prices has increased over the last 30 years as more value is attached to intangible assets that cannot be monetized. Data from 1992 suggests that 40% of the value of a company is missing from the books, something that is subscribed to intellectual capital assets by some.

Tobin’s q is a measurement of that really in that it calculates the ratio between market and book value. But the market value is more about investor attitude towards the value of the firm than an objectifiable value. Bubbles on the stock market are still happening even though we know they exist and the collapse of confidence brought forward by investors. Once some speculators cash in, it might create a panic and the bubble bursts. This then turns out to be a self-reinforcing process. Can we remove that bubble with good intellectual capital accounting?

Internal efficiencies are another thing driving intellectual capital measurement. Companies want to be worth more or know what they are worth at least. Some studies seem to show that an increase in published R&D expenditure increases market value. Another link seems to be between expenditure on advertising and market value. These costs seem to lead to a reaction that would suggest and increase in assets instead of costs.

In that, companies need to manage all their assets including knowledge. The better you measure all your assets, the more easily you detect opportunities and all allocate resources better. This I actually buy into. You can also measure to read a goal, meaning that you look at where you stand and if your base is capable of supporting you in reaching your goal.

So what drives intellectual capital measurement: - Market inefficiencies - Internal inefficiencies - Measurement to reach goals

We can then group intellectual capital into some categories: - knowledge - information - communication - human resources - brands - copyright - patents - systems

Roos and Roos identify a three-stop process: - nurturing an intellectual capital language - identifying intellectual capital indicators - developing an intellectual capital report

You might not agree to all of this but one thing that is sire is that current performance measurement is sub-optimal to predict future financial performance. Strategic decisions need full information, which is not anything new really. The link of IC to market value should now be clear though.

The language of intellectual capital

The vocabulary is important to make the areas of focus and concern clear. The process to build the vocabulary should be continuous, being fitted and refitted to your necessary focus and concern. There are some intellectual capital methods that can be noted: - Kaplan and Norton’s Balanced Scorecard - Skandia’s Navigator - Karl Sveiby’s Intangible Asset Monitor - The IC Index

They often are similar in their categories of concern: - human capital - infrastructure - intellectual property - franchise value / customer capital - renewal and development - process - …

In the end the areas of concern need to be indicators of future performance. Financial measurement as sales show past performance. Customer loyalty or satisfaction might show future performance. An intellectual capital language is looking at future performance. There are several areas of concern that might be a good starting point: - Information sharing because good capacity means good ability to re-use - Networks, communication & and innovation (e.g. 3M) - Intellectual property - Brands - Talent/Human resources

These are again just examples though.

In summary, you need three steps.

Broadly define intellectual capital.

Identify subgrouped areas of concern.

Identify elements that contribute to future success.

It must be pointed out that even though you find a potential element it might not contribute to the company intellectual capital. In a sense you might have to move back from 3 to 2 for further discussion and re-evaluation. The process should never end.

Measureing Intellectual Capital

From the root up: Find your concerns and then ask those at the core how they should be measured.

Recap: a) Nurture IC language. b) Identify IC indicators. c) Develop IC Report

Intro to measures: Many measures will not be monetary but they might be.

Discounted Cash Flow: Patents and Copyrights are often valued like that, via future cash flows discounted by a discount factors, which can still be wrong though.

Monetary Measures: e.g. amount spent on training, R&D expenditure

Ratio Measures: This gives a relative performance indicator.

Absolute Numbers: Number of scientists for example. But there needs to be a sound justification for exactly that number.

Subjective: More used to augment a measure. Do you find working here a pleasant experience rated between 1 and 5 can best be used to support another measure but not as the only one.

As a new method: In the financial market you always compare, yet here you are only looking inside which might mean that it is respected too much outside the organization as a measure.

Examples of measurement methods

Skyrme argued that these systems are currently in a stage of evolution, being refined over time.

The balanced scorecard It was introduced 1992 in an HBR article by Kaplan and Norton based on a year-long study at 12 companies. There are four perspectives: financial, customer, internal business, innovation and learning. They are often interlinked, influencing each other and need to be based on areas of focus and concern. The main idea is that you put control of vision and strategy while implementation is done by others. It focusses on the drivers or lead indicators of future performance. Some examples are on page 40 of the book or likely to be found all over the net.

The Skandia Navigator Skandia, the swedish financial services company, is one of the leaders in IC measurement. If I remember correctly they are also on the forefront of a move to remove budgets totally. Anyway, they look at: financial, customer, human, process, and ‘renewal and development’. the human focus is at the center with the systems there to help managers figure out their appropriate measurements.

There are only very few measures in their system but they have been refined over a long period. Skandia believes the measurement system shows how Skandia can create financial capital from intellectual capital.

The intangible assets monitor Karl Eric Sveiby developed it, designating four categories of concern:

Internal structure: patents, concepts, models, systems, …

External structure: relationships, brands, trademarks, reputation, …

"Individual" competence: employee ability to act, skills, education, experience, eq, …

Competence belongs to be individual he believes but the company cannot be conceived without people. Each of these categories is then measured to see whether it aids stability, efficiency, or growth and renewal.

The IC Index GÃ¶ran and Roos combine some larger focus areas into an "efficiency" index. Different areas of focus are combined to form an index. Some examples are on page 44.

Additional points

The report needs to include the following: - How did IC become important to use - How does it fit our objectives - Explanation of areas of concern - Measures in tables and charts

The reader of a company report needs to be introduced to the specific measures as they are very specific to the company. The idea is that if the measures are accurate (financial reporting is a science too), the market will reward it and become more efficient.

Then you also need to assess the need. It is certain that regulatory bodies like the SEC will require more IC accounting as standard account is only showing the past. Several studies show that the benefits outweigh the costs.

Steward actually believes that utilizing your intellectual capital means exploiting the "free-floating brainpower" of individuals.

Critique of ICM Programs

it is merely repackaging of managing people (Boudreau)

we already have benchmarking, competence models, business worth, … all the other reports that are similar.

can the data really correspond to the question? Sample bias, missing data, the difference between correlation and causation, playing the numbers, … all play a role.

Power (1994) raised the question whether any audit system is not flawed and only uses up valuable resources. This is because the data can easily be misinterpreted, because of the increase of likelihood of group think, becoming entrenched in the numbers and whether that what is audited is really important of whether something else is not simply missed.

Context of the auditor matters and might be unfit. What, how and if something is audited is influence by the receivers of the audit. There is likely one way. And who audits the auditors?

Potential for fraudulent behavior is big (playing the numbers).


Module: ReneeCore::ClassMethods
- Includes:
- URLGeneration
- Included in:
- ReneeCore
- Defined in:
- lib/renee_core.rb
Instance Attribute Summary (collapse)
-
- (Object) application_block
readonly
Returns the value of attribute application_block.
Instance Method Summary (collapse)
-
- (Object) app(&app)
-
- (Object) call(env)
-
- (ReneeCore::Matcher) register_variable_type(name, matcher)
Registers a new variable type for use within Routing#variable and others.
-
- (Object) setup(&blk)
-
- (Object) variable_types
Methods included from URLGeneration
#path, #prefix, #register, #url
Instance Attribute Details
- (Object) application_block (readonly)
Returns the value of attribute application_block
26 27 28 |
# File 'lib/renee_core.rb', line 26 def application_block @application_block end |
Instance Method Details
- (Object) app(&app)
33 34 35 36 37 38 39 40 |
# File 'lib/renee_core.rb', line 33 def app(&app) @application_block = app setup do register_variable_type :integer, IntegerMatcher register_variable_type :int, :integer end self end |
- (Object) call(env)
29 30 31 |
# File 'lib/renee_core.rb', line 29 def call(env) new.call(env) end |
- (ReneeCore::Matcher) register_variable_type(name, matcher)
Registers a new variable type for use within Routing#variable and others.
55 56 57 58 59 60 61 62 63 64 |
# File 'lib/renee_core.rb', line 55 def register_variable_type(name, matcher) matcher = case matcher when Matcher then matcher when Array then Matcher.new(matcher.map{|m| variable_types[m]}) when Symbol then variable_types[matcher] else Matcher.new(matcher) end matcher.name = name variable_types[name] = matcher end |
- (Object) setup(&blk)
42 43 44 45 |
# File 'lib/renee_core.rb', line 42 def setup(&blk) instance_eval(&blk) self end |
- (Object) variable_types
47 48 49 |
# File 'lib/renee_core.rb', line 47 def variable_types @variable_types ||= {} end |


By Chen Hui Jing / @hj_chen
“a slowdown of 3 seconds on page load time caused a mean percentage drop of 7.9% in article views over a period of 28 days”
—Financial Times Technology Department
“53% of mobile site visits are abandoned if pages take longer than 3 seconds to load”
—DoubleClick by Google
“...led to a 40% decrease in Pinner wait time, a 15% increase in SEO traffic and a 15% increase increase in conversion rate to signup.”
—Pinterest Engineering
“...for every additional second a page takes to load, 10 per cent of users leave. ”
—BBC
Images and explanations by Lin Clark
Images and explanations by Lin Clark
Images and explanations by Lin Clark
Images and explanations by Lin Clark
Images and explanations by Lin Clark
Images and explanations by Lin Clark
Font used is Edmond Sans, by James T. Edmondson


VisContentClass
provides objects that can be used to head visible trees and interact with the GenView. The VisContent is a necessary class for any application that plans on displaying visible objects in a view.
You should be familiar with visible objects, visible object trees, and the GenView class. These topics can be found in the VisClass chapter and the GenView chapter.
Because
VisContentClass
is a subclass of
VisCompClass
, it inherits all the instance data fields and messages of both that class as well as
VisClass
. You will likely want to read about both of those classes before reading this chapter. You can just read Basic VisContent Usage
if you need a basic VisContent object--that section describes the most basic ways to use the VisContent without understanding its inner workings.
1 VisContent Instance Data
1.1 The VCNI_attrs Field
1.2 Fields That Affect the View
1.3 Fields That Affect the Document
1.4 Fields That Affect Input Events
2 Basic VisContent Usage
2.1 Setting Up Sizing Behavior
2.2 Messages Received from the View
The VisContent has many instance data fields above and beyond those defined in
VisClass
and
VisCompClass
. These new instance fields deal with such topics as content attributes, the way the content interacts with the view, the document described by the content, and how the content handles input.
All the instance fields defined by
VisContentClass
and their definitions are shown in VisContent Instance Data Fields
. Each field is described later in this section.
Code Display 17-1 VisContent Instance Data Fields
/* All the instance fields defined in VisContentClass are described below. You * will likely use very few of them, if any; see the later sections of this * chapter for specific information about each field. */
/* The following fields deal with the GenView and the view window. */ @instance optr VCNI_view = 0; @instance WindowHandle VCNI_window = 0; @instance word VCNI_viewHeight = 0; @instance word VCNI_viewWidth = 0;
/* VCNI_attrs determines the content's attributes. */ @instance VisContentAttrs VCNI_attrs = 0;
/* The possible flags for VCNI_attrs are * VCNA_SAME_WIDTH_AS_VIEW 0x80 * VCNA_SAME_HEIGHT_AS_VIEW 0x40 * VCNA_LARGE_DOCUMENT_MODEL 0x20 * VCNA_WINDOW_COORDINATE_MOUSE_EVENTS 0x10 * VCNA_ACTIVE_MOUSE_GRAB_REQUIRES_LARGE_EVENTS 0x08 * VCNA_VIEW_DOC_BOUNDS_SET_MANUALLY 0x04 */
/* The following fields determine features of the content's document. */ @instance PointDWord VCNI_docOrigin = {0, 0}; @instance PointWWFixed VCNI_scaleFactor = {{0, 1}, {0, 1}};
/* The following fields deal with how the content handles input. */ @instance ChunkHandle VCNI_prePassiveMouseGrabList = 0; @instance VisMouseGrab VCNI_impliedMouseGrab = {0, 0, {0, 0}, (VIFGF_MOUSE | VIFGF_PTR), 0}; @instance VisMouseGrab VCNI_activeMouseGrab = {0, 0, {0, 0}, 0, 0}; @instance ChunkHandle VCNI_postPassiveMouseGrabList = 0; @instance KbdGrab VCNI_kbdGrab = {0, 0}; @instance FTVMCGrab VCNI_focusExcl = {0, MAEF_FOCUS}; @instance FTVMCGrab VCNI_targetExcl = {0, MAEF_TARGET}; @instance Handle VCNI_holdUpInputQueue = 0; @instance word VCNI_holdUpInputCount = 0; @instance byte VCNI_holdUpInputFlags = 0;
/* The type flags of the content are special and should not be altered. */ @default VI_typeFlags = VTF_IS_COMPOSITE | VTF_IS_WINDOW | VTF_IS_CONTENT | VTF_IS_WIN_GROUP | VTF_IS_INPUT_NODE;
Fields That Affect the Document
Fields That Affect Input Events
VCNI_attrs, MSG_VIS_CONTENT_SET_ATTRS, MSG_VIS_CONTENT_GET_ATTRS
The
VCNI_attrs
field is a record of
VisContentAttrs
that contains several attributes which affect how the content object interacts with the view and with the visible object tree. You can set these attributes with
MSG_VIS_CONTENT_SET_ATTRS
dynamically, and you can retrieve them with
MSG_VIS_CONTENT_GET_ATTRS
.
The flags in this field are shown below. None of them is set by default.
VCNA_WINDOW_COORDINATE_MOUSE_EVENTS
This flag must be set if VCNA_LARGE_DOCUMENT_MODEL is set. It indicates that the associated GenView will pass input events with window coordinates rather than document coordinates. The default handlers in the content object will then automatically translate the events into document coordinates.
MSG_VIS_VUP_ALTER_INPUT_FLOW
. Large content objects should not set this flag in their Goc declarations.
MSG_GEN_VIEW_SET_DOC_BOUNDS
.
MSG_META_CONTENT_VIEW_ORIGIN_CHANGED
to the content when the user interacts with the scroller. The UI will use this flag to invalidate the correct region of the content. This should be set when
ATTR_GEN_VIEW_DO_NOT_WIN_SCROLL
is set in the GenView. See the GenView chapter for full information on view scrolling.
void MSG_VIS_CONTENT_SET_ATTRS( VisContentAttrs attrsToSet, VisContentAttrs attrsToClear);
This message sets the
VCNI_attrs
field of the content object according to the passed values.
Source: Unrestricted.
Destination: Any VisContent object.
Parameters:
attrsToSet
This is a record of
VisContentAttrs
to set. A flag set in this field will be set in the object's
VCNI_attrs
field.
attrsToClear
This is a record of
VisContentAttrs
to clear. A flag set in this field will be cleared in the object's
VCNI_attrs
field. This parameter takes precedence over
attrsToSet
; that is, if a flag is set in both parameters, it will end up cleared.
Return: Nothing.
Interception: Unlikely.
VisContentAttrs MSG_VIS_CONTENT_GET_ATTRS();
This message returns the current contents of the object's
VCNI_attrs
field, a record of
VisContentAttrs
.
Source: Unrestricted.
Destination: Any VisContent object.
Parameters: None.
Return: A record of
VisContentAttrs
reflecting the flags currently set in the object's
VCNI_attrs
field.
Interception: Unlikely.
VCNI_view, VCNI_viewHeight, VCNI_viewWidth, VCNI_window, MSG_VIS_CONTENT_GET_WIN_SIZE
Because the content must interact directly with the view, it must maintain some information about both the GenView object and its associated window.
VisContentClass
defines four fields that deal exclusively with view-related information. Each of these fields is described below.
VCNI_view
MSG_VIS_VUP_SEND_TO_OBJECT_OF_CLASS
and
MSG_VIS_VUP_CALL_OBJECT_OF_CLASS
. The field will be set automatically by the GenView when the view is opened; the view will send a
MSG_META_CONTENT_VIEW_OPENING
.
VCNI_viewHeight
MSG_VIS_CONTENT_GET_WIN_SIZE
(below). The view automatically notifies the content each time the window size changes with
MSG_META_CONTENT_VIEW_SIZE_CHANGED
.
VCNI_viewWidth
MSG_VIS_CONTENT_GET_WIN_SIZE
(below). The view automatically notifies the content on each window resize with
MSG_META_CONTENT_VIEW_SIZE_CHANGED
.
VCNI_window
MSG_VIS_QUERY_WINDOW
. This field will be set automatically by the GenView when the view's window is first opened. The view will send the messages
MSG_META_CONTENT_VIEW_WIN_OPENED
and
MSG_META_CONTENT_VIEW_OPENING
to set the window handle. When the view window closes, the view will send
MSG_META_CONTENT_VIEW_CLOSING
and
MSG_META_CONTENT_VIEW_WIN_CLOSED
.The messages shown above that are sent by the view to the content are detailed in Messages Received from the View .
SizeAsDWord MSG_VIS_CONTENT_GET_WIN_SIZE();
This message returns the size of the content object's associated window in terms of width and height.
Source: Unrestricted.
Destination: Any VisContent object.
Parameters: None.
Return: A
SizeAsDWord
value with the window's width in the high word and the window's height in the low word. Use the DWORD_HEIGHT and DWORD_WIDTH macros to extract the proper values.
Interception: Unlikely.
VCNI_docOrigin, VCNI_scaleFactor, MSG_VIS_CONTENT_SET_DOC_BOUNDS, MSG_VIS_CONTENT_RECALC_SIZE_BASED_ON_VIEW
The GenView object maintains quite a bit of information about the document as managed by the content object. The content must also keep information about the document and how the view is displaying it. This information is stored in two fields,
VCNI_docOrigin
and
VCNI_scaleFactor
, both detailed below.
The document bounds of the content are typically equal to the bounds of the VisContent itself. The content's bounds are stored in the
VI_bounds
field inherited from
VisClass
. When a content is managing layers or large documents, however, its bounds are set to zero. It then manages its document bounds within the layer objects and the GenView. When the document bounds change, a
MSG_VIS_CONTENT_SET_DOC_BOUNDS
should be sent to the content to get it to notify all its layer children and the GenView of the new bounds. This message is shown at the end of this section.
If the content is not a large document and is set up to follow the GenView's geometry (it has either or both of VCNA_SAME_WIDTH_AS_VIEW or VCNA_SAME_HEIGHT_AS_VIEW set), it will be affected by changes in the view's geometry. During geometry updates, the view will send it a
MSG_VIS_CONTENT_RECALC_SIZE_BASED_ON_VIEW
. This message sets the content's width and/or height and therefore affects its
VI_bounds
field. This message is also shown at the end of this section.
VCNI_docOrigin
PointDWord
, which has the following structure:typedef struct { sdword PD_x; /* x coordinate of origin */ sdword PD_y; /* y coordinate of origin */ } PointDWord;
MSG_META_CONTENT_VIEW_ORIGIN_CHANGED
to indicate the origin is different from its current setting.
VCNI_scaleFactor
PointWWFixed
structure, as follows:typedef struct { WWFixed PF_x; /* horizontal scale factor */ WWFixed PF_y; /* vertical scale factor */ } PointWWFixed;
WWFixed
structures that determine the scale factor in each dimension consist of two elements. This structure is shown below:typedef struct { word WWF_frac; /* fractional portion */ word WWF_int; /* integral portion */ } WWFixed;
VCNI_scaleFactor
field in the content is never set directly by the application; instead, it is set with
MSG_META_CONTENT_VIEW_SCALE_FACTOR_CHANGED
whenever the view's scale factor changes.Messages that set these fields are discussed in Messages Received from the View .
void MSG_VIS_CONTENT_SET_DOC_BOUNDS(@stack sdword bottom, sdword right, sdword top, sdword left);
This message is used to set the document bounds of a content's large document. The content will send
MSG_GEN_VIEW_SET_DOC_BOUNDS
to its view and
MSG_VIS_LAYER_SET_DOC_BOUNDS
to each of its children with the new bounds. The recipient content
must
have the flag
VCNA_LARGE_DOCUMENT_MODEL
set in
VCNI_attrs
.
Source: Unrestricted.
Destination: Any large VisContent object--if the content is not using the large document model, an error will result.
Parameters:
bottom, right, top, left
The new document bounds in 32-bit document coordinates.
Return: Nothing.
Interception: Unlikely.
Warnings: You may only send this message to a content that is using the large document model. All other contents will not handle this message but will result in a fatal error.
SizeAsDWord MSG_VIS_CONTENT_RECALC_SIZE_BASED_ON_VIEW();
This message causes the content to recalculate its size based on the view's geometry. It will try to set its width if it has VCNA_SAME_WIDTH_AS_VIEW set, and it will try to set its height if it has VCNA_SAME_HEIGHT_AS_VIEW set.
Source: Unrestricted--typically sent by the view or by the content to itself during geometry updates.
Destination: Any VisContent object.
Parameters: None.
Return: A
SizeAsDWord
value indicating the new size of the content. Use the macros DWORD_HEIGHT and DWORD_WIDTH to extract the appropriate values.
One of the main features of
VisContentClass
is its ability to handle, manage, and pass on input events sent through the GenView. The content has a large amount of functionality built into it to provide these features.
VCNI_prePassiveMouseGrabList, VCNI_impliedMouseGrab, VCNI_activeMouseGrab, VCNI_postPassiveMouseGrabList, VCNI_kbdGrab, MSG_VIS_CONTENT_UNWANTED_MOUSE_EVENT, MSG_VIS_CONTENT_UNWANTED_KBD_EVENT, MSG_VIS_CONTENT_TEST_IF_ACTIVE_OR_IMPLIED_WIN
VisContentClass
, as the head of the visible tree displayed in the view, keeps track of which object in its tree has each different type of input grab. With this information, the content can simply pass the input event directly to the object that has the grab. It can also easily send the event to both the prepassive and postpassive grab objects, if any.
VCNI_prePassiveMouseGrabList
VCNI_impliedMouseGrab
VisMouseGrab
(described below) structure that contains details about the object which has the implied mouse grab.
VCNI_activeMouseGrab
VisMouseGrab
(described below) structure that contains details about the object which has the active mouse grab.
VCNI_postPassiveMouseGrabList
VCNI_kbdGrab
KbdGrab
structure that contains details about the object which currently has the keyboard grab.
You will probably not ever have to know the structure of these fields, how to set them, or the information they contain. However the two structures
VisMouseGrab
and
KbdGrab
are shown in Grab Data Structures
for your information.
Code Display 17-2 Grab Data Structures
/* These structures are obscure, and you will likely never have to use them. */
/* The VisMouseGrab structure contains information about the object that * currently has the mouse grab. */
typedef struct { optr VMG_object; /* The optr of the object that has the grab. * If no object has the grab, this is zero. */ WindowHandle VMG_gWin; /* The window handle of the window with the object * having the grab, if it's different from * the content's window. If it's in the content's * window, this field contains zero. */ PointDWord VMG_translation; /* The 32-bit translation applied to mouse events * if the large document model is in use. This is * set with a previous message call. */ VisInputFlowGrabFlags VMG_flags; /* A record of VisInputFlowGrabFlags, * described below. */ byte VMG_unused; /* Reserved byte. */ } VisMouseGrab;
/* The VisInputFlowGrabFlags determine the type and context of the grab. These * flags are not listed here for simplicity. You do not have to know these flags; * they are set with MSG_VIS_VUP_ALTER_INPUT_FLOW. */
/* The KbdGrab structure contains information about the object that currently * has the keyboard grab. */
typedef struct { optr KG_OD; /* The optr of the object that has the * keyboard grab. */ word KG_unused; /* Reserved word. */ } KbdGrab;
In addition, the VisContent has the following messages that are affected by the input grab fields:
MSG_VIS_CONTENT_TEST_IF_ACTIVE_OR_IMPLIED_WIN
true
if the passed window handle is the same as the active or implied window currently translating mouse events. It returns
false
otherwise. This is used by specific UI objects.
MSG_VIS_CONTENT_UNWANTED_MOUSE_EVENT
MSG_VIS_CONTENT_UNWANTED_KBD_EVENT
Boolean MSG_VIS_CONTENT_TEST_IF_ACTIVE_OR_IMPLIED_WIN( WindowHandle window);
This message checks to see if the passed window handle is the same as the window of the object having either the implied or active mouse grab. This is typically used by objects in a Specific UI library to determine if the mouse event was actually within the window or directly on the window's border.
Source: Unrestricted.
Destination: Any VisContent object.
Parameters:
window
The window handle to be checked.
Return:
True
if the window handle is the same as either the active or the implied window,
false
otherwise.
Interception: Unlikely.
void MSG_VIS_CONTENT_UNWANTED_MOUSE_EVENT( VisMouseGrab *mouseGrab, word inputState);
This message is received by the content if a mouse event was received and there was no active or implied grab. This is most frequently encountered when the user presses a mouse button outside a modal dialog box. The default action of this handler is to beep (on presses only, not releases) and get rid of the event as if it had been handled.
Source: Input flow mechanism.
Destination: The affected VisContent object.
Parameters:
mouseGrab
A pointer to the appropriate
VisMouseGrab
structure.
inputState
Return: Nothing.
Interception: Unlikely.
void MSG_VIS_CONTENT_NOTIFY_ACTIVE_MOUSE_GRAB_WIN_CHANGED();
A message we send ourselves from within our
MSG_VIS_VUP_ALTER_INPUT_FLOW
handler in the case that
VCNI_activeMouseGrab
.
VMG_gWin
changes. Used by the specific UI's implementation of
GenApplicationClass
to keep track of the currently active window within the application.
Source: See above.
Destination: Self.
Parameters: None
Return: Nothing.
Interception: Intercepted by specific UI's implementation of GenApplication for the purpose of finding out a change in the active window within the application has occurred. It will in turn update the window system so that mouse grabs and pointer image changes work properly.
void MSG_VIS_CONTENT_UNWANTED_KBD_EVENT( word character, word flags, word state);
This message will be received by the content if a keyboard event was sent and there was no keyboard grab set up. The default action of the content is to beep (on presses only, not releases) and return as if the event had been processed.
Source: Input flow mechanism.
Destination: The affected VisContent object.
Parameters:
character
The keyboard character pressed.
flags
CharFlags
record, and the high byte is a
ShiftState
record. Both are the same as passed with the original
MSG_META_KBD_CHAR
.
state
ToggleState
, and the high byte is the scan code. Both are the same as passed with the original
MSG_META_KBD_CHAR
.Return: Nothing.
Interception: Unlikely.
VCNI_focusExcl, VCNI_targetExcl, MSG_META_CONTENT_APPLY_DEFAULT_FOCUS
In addition to keeping track of which of its children have the mouse and keyboard grabs, the content also keeps track of which objects have the focus and target input exclusives. Both
VCNI_focusExcl
and
VCNI_targetExcl
contain a structure of type
FTVMCGrab
that describes the object that has the subject exclusive. The messages sent by the GenView that set these fields are described in Messages Received from the View
.
VCNI_holdUpInputQueue, VCNI_holdUpInputCount, VCNI_holdUpInputFlags, MSG_VIS_CONTENT_HOLD_UP_INPUT_FLOW, MSG_VIS_CONTENT_RESUME_INPUT_FLOW, MSG_VIS_CONTENT_DISABLE_HOLD_UP, MSG_VIS_CONTENT_ENABLE_HOLD_UP
GEOS allows a visible tree to hold up input--that is, input will be stored elsewhere while the visible tree is doing something else. This can be useful if complex tree operations are going on and you don't want input to go to the wrong object.
VisContentClass
provides three instance fields that define the input holdup mechanism. These three fields are
VCNI_holdUpInputQueue
VCNI_holdUpInputCount
VCNI_holdUpInputFlags
VisContentClass
has four messages that it sends to itself to set the state of information hold-up. These messages are detailed below.
void MSG_VIS_CONTENT_HOLD_UP_INPUT_FLOW();
This message increments the count in
VCNI_holdUpInputCount
. If this count is nonzero and HUIF_HOLD_UP_MODE_DISABLED is clear, subsequent input events will be sent into the hold-up queue until either the flag is set or the count once more drops to zero.
Source: Unrestricted.
Destination: Any VisContent object.
Interception: Unlikely.
Warnings: Do not forget to resume input with a later use of the message
MSG_VIS_CONTENT_RESUME_INPUT_FLOW
.
void MSG_VIS_CONTENT_RESUME_INPUT_FLOW();
This message decrements the count in
VCNI_holdUpInputCount
. If the count becomes zero with this call, the hold-up event queue is flushed and all the events in it are "played back." If the count goes below zero, GEOS will give an error. Therefore, do not use this message unless it is preceded with a
MSG_VIS_CONTENT_HOLD_UP_INPUT_FLOW
.
Source: Unrestricted.
Destination: Any VisContent object.
Interception: Unlikely.
Warnings: If this message is used without first holding up input with
MSG_VIS_CONTENT_HOLD_UP_INPUT_FLOW
, an error will be the likely result. The error condition is the
VCNI_holdUpInputCount
field going below zero.
void MSG_VIS_CONTENT_DISABLE_HOLD_UP();
This message sets the HUIF_HOLD_UP_MODE_DISABLED flag, forcing all input events to flow normally until the flag is cleared.
Source: Unrestricted.
Destination: Any VisContent object.
Interception: Unlikely.
void MSG_VIS_CONTENT_ENABLE_HOLD_UP();
This message clears the HUIF_HOLD_UP_MODE_DISABLED flag, allowing input events to be held up in the hold-up event queue.
Source: Unrestricted.
Destination: Any VisContent object.
Interception: Unlikely.
You will probably not have to subclass
VisContentClass
unless you are using a large document or you want the content to draw something in response to a
MSG_VIS_DRAW
. In most other cases, you can declare your content object directly on
VisContentClass
.
Most VisContent behavior is inherited directly from
VisCompClass
. Some additional behavior is detailed in the following sections.
If you are planning on using the document control objects with GenViews, you will not need VisContent objects. The GenDocument resolves at run-time into a subclass of VisContent and therefore replaces the need for an explicitly-defined VisContent object. See the Documents chapter for full information on GenDocuments.
Messages Received from the View
Most geometry behavior revolves around whether the GenView is scrollable or not. You can set up several different sizing behaviors depending on the attributes you set in the GenView. Some are listed below with the attributes you should set in both the GenView and the VisContent.
Typically, setting the view's attributes will involve either setting or not setting the GVDA_SCROLLABLE flag in the appropriate GenView dimension; also, you will want to be aware of the GVDA_NO_LARGER_THAN_CONTENT and GVDA_NO_SMALLER_THAN_CONTENT flags.
Typically, if the content object is a fixed size, the view will either conform to the content's size or scroll in one or both dimensions. This behavior is determined entirely within the GenView's instance data. Three types of this behavior are shown in Sizing the View with a Fixed Content .
Code Display 17-3 Sizing the View with a Fixed Content
/* This code display shows three different types of sizing behavior of the GenView * if its VisContent object is of a fixed size. Note that if the content is * managing its geometry, its bounds (and therefore the view's) will be determined * by the content's children. */
/* The view window is scrollable in both dimensions. This will result in the view * being sizable and scrollable in both dimensions. */
@object GenViewClass MyView = { GVI_content = @MyVisContent; GVI_horizAttrs = @default | GVDA_SCROLLABLE; GVI_vertAttrs = @default | GVDA_SCROLLABLE; };
/* The view window is scrollable in only the vertical dimension. It follows the * width of the VisContent object and therefore does not scroll vertically. The * VisContent's VI_bounds field should be set by the content. */
@object GenViewClass MyView = { GVI_content = @MyVisContent; GVDI_horizAttrs = @default | GVDA_NO_LARGER_THAN_CONTENT | GVDA_NO_SMALLER_THAN_CONTENT; GVDI_vertAttrs = @default | GVDA_SCROLLABLE; };
/* The view window sizes itself exactly to the size of the VisContent's bounds. * The VisContent's VI_bounds field should be set appropriately by the content. * Note that this is not a valid combination for VisContents that display large * documents or layer objects. */
@object GenViewClass MyView = { GVI_content = @MyVisContent; GVDI_horizAttrs = @default | GVDA_NO_LARGER_THAN_CONTENT | GVDA_NO_SMALLER_THAN_CONTENT; GVDI_vertAttrs = @default | GVDA_NO_LARGER_THAN_CONTENT | GVDA_NO_SMALLER_THAN_CONTENT; }
Another type of behavior with fixed-size contents is called "keeping the aspect ratio." The view and content can work together to allow the user to resize the view while automatically setting the view's scale factor to keep the entire content in the window. This might be used, for example, for a game board; the game could be resized, and the entire game board would stay in the view.
In this situation, the content calculates its new size based on one of the view's dimensions. For example, when the user resizes the view, the content may keep the width but calculate the height based on the width. The proper scale factor is then set, and the content does not have to do anything special beyond that. To gain this behavior, set up your view and content as shown in Keeping the View Aspect Ratio .
Code Display 17-4 Keeping the View Aspect Ratio
/* This example shows a view and its content. The content object is of a fixed * size, and the view is resizable. The content/view pair will keep the aspect * ratio to automatically figure the view's height based on its width and then * scale the image to keep the entire bounds of the content within the view * window. */
@object GenViewClass MyView = { GVI_content = @MyVisContent; GVDI_horizAttrs = @default | GVDA_NO_LARGER_THAN_CONTENT | GVDA_NO_SMALLER_THAN_CONTENT; GVDI_vertAttrs = @default | GVDA_KEEP_ASPECT_RATIO; };
@object VisContentClass MyVisContent = { VI_bounds = {0, /* left bound */ 0, /* top bound */ 250, /* right bound */ 250}; /* bottom bound */ VCI_comp = /* put any children here */; VCI_geoAttrs = VCGA_CUSTOM_MANAGE_CHILDREN; /* This is set because typically a content's bounds are determined * by its children. If we want to set our own bounds, we should * custom manage our geometry. This is true of contents used with * the views in the previous example. */ };
Many visible trees will have contents that are of variable size. How the content determines its size differs from use to use; some contents will adjust their geometries to those of their view objects, and some will resize themselves based on the geometry of their children.
Typically, if the content resizes itself based on its children's geometry, the view either will be scrollable or will adjust its size to that of its content.
If the content rearranges its children to meet the size of the view, the view will not be scrollable and will not adjust its size to the content at all. Instead, the content will have the VCNA_SAME_WIDTH_AS_VIEW and VCNA_SAME_HEIGHT_AS_VIEW flags set in its
VCNI_attrs
field
.
MSG_META_CONTENT_SET_VIEW, MSG_META_CONTENT_VIEW_ORIGIN_CHANGED, MSG_META_CONTENT_VIEW_SCALE_FACTOR_CHANGED, MSG_META_CONTENT_VIEW_OPENING, MSG_META_CONTENT_VIEW_WIN_OPENED, MSG_META_CONTENT_VIEW_SIZE_CHANGED, MSG_META_CONTENT_VIEW_CLOSING, MSG_META_CONTENT_VIEW_WIN_CLOSED
A
s detailed in the discussions on GenView, the view sends a sequence of messages to its content when the view is first opening and when it is closing. These messages set up the content's visible instance data and prime the visible tree to be drawn on the screen. The messages are handled by the default handlers in
VisContentClass
, and you do not need to add anything to them to make them work.
The messages sent to the content when the view is first created are
MSG_META_CONTENT_SET_VIEW
This message passes the view's optr to the content, setting the
VCNI_view
field properly.
MSG_META_CONTENT_VIEW_ORIGIN_CHANGED
This message passes the view's initial origin (which may be set other than the default) to the content.
MSG_META_CONTENT_VIEW_SCALE_FACTOR_CHANGED
This message passes the view's initial scale factor (which may be set other than the default) to the content.
MSG_META_CONTENT_VIEW_OPENING
This message is sent to the content when the view receives a
MSG_VIS_OPEN
. This notifies the content that the view is about to be put on the screen and that it should prepare itself to be drawn.
MSG_META_CONTENT_VIEW_WIN_OPENED
This message passes the window handle of the newly created view window so the content can record it in
VCNI_window
.
MSG_META_CONTENT_VIEW_SIZE_CHANGED
This message passes the view window's size (height and width) to the content so the content can determine its proper size and geometry.
MSG_META_EXPOSED
This message is sent when the view's window is finally on the screen. It signifies that the content should draw itself and then send
MSG_VIS_DRAW
s to all its children.The view will also send certain messages to the content when different things happen to change the content's instance data:
MSG_META_CONTENT_VIEW_SIZE_CHANGED
This message is passed whenever the view window's size changes for any reason.
MSG_META_CONTENT_VIEW_SCALE_FACTOR_CHANGED
This message is passed whenever the view's scale factor is changed, usually due to the user setting it from a menu.
MSG_META_CONTENT_VIEW_ORIGIN_CHANGED
This message is passed whenever the view's origin is changed, usually when the view is scrolled.
MSG_META_EXPOSED
This message is passed to the content whenever a portion of the view window becomes exposed and must be drawn. The content automatically translates this into a
MSG_VIS_DRAW
.When the view is shutting down, it will send the following three messages to the content to set the proper data:
MSG_META_CONTENT_VIEW_CLOSING
This message is sent to the content when the view receives a
MSG_VIS_CLOSE
. It indicates that the view is being taken off the screen and that all the visible objects in the content's tree should remove themselves from the screen.
MSG_META_CONTENT_VIEW_WIN_CLOSED
This message is sent when the view's window is finally destroyed. The copy of the window handle in
VCNI_window
will be thrown out now so no drawing to the stale window handle will be done.
MSG_META_CONTENT_SET_VIEW
This message is sent to set the content's
VCNI_view
field to a null handle. When the view is finally taken off the screen, it no longer should have a content associated with it since it is meaningless to work with a visible tree that is not on the screen. If the view is opened again later, the content will receive another
MSG_META_CONTENT_VIEW_OPENING
and will once again be passed the view's optr.void MSG_META_CONTENT_SET_VIEW( optr view);
This message passes the optr of the GenView object that will display this content object. The default handler will set the content's
VCNI_view
field to the passed optr. This message is also used when the view has been shut down; the passed optr will be null.
Source: Unrestricted--typically sent by a GenView to its content object.
Destination: Any VisContent or Process object acting as the content of a GenView.
Parameters:
view
The optr of the GenView using this object as its content.
Return: Nothing.
Interception: Unlikely.
void MSG_META_CONTENT_VIEW_ORIGIN_CHANGED(@stack WindowHandle viewWindow, sdword xOrigin, sdword yOrigin);
This message notifies the content that the view's origin has changed. The content will set its
VCNI_docOrigin
field to the passed values.
Source: Unrestricted--typically sent by a GenView to its content object.
Destination: Any VisContent or Process object acting as the content of a GenView.
Parameters:
viewWindow
The window handle of the GenView's window.
xOrigin
yOrigin
Return: Nothing.
Interception: Any content that is managing large documents will probably need to subclass this message and apply the proper translations for the 32-bit coordinates.
void MSG_META_CONTENT_VIEW_SCALE_FACTOR_CHANGED(@stack WindowHandle viewWindow, WWFixedAsDWord yScaleFactor, WWFixedAsDWord xScaleFactor);
This message notifies the content that the view window's scale factor has changed. The content will set its
VCNI_scaleFactor
field to the passed values.
Source: Unrestricted--typically sent by a GenView to its content object.
Destination: Any VisContent or Process object acting as the content of a GenView.
Parameters:
viewWindow
The window handle of the GenView's window.
yScaleFactor
xScaleFactor
Return: Nothing.
Interception: Any content that is managing large documents will probably need to subclass this message and apply the proper translations for the 32-bit coordinates.
void MSG_META_CONTENT_VIEW_WIN_OPENED( word viewWidth, word viewHeight, WindowHandle viewWindow);
This message notifies the content that the view's window has been created and is being put on the screen. This message will be followed by
MSG_META_EXPOSED
, so the content should not draw anything here.
Source: Unrestricted--typically sent by a GenView to its content object.
Destination: Any VisContent or Process object acting as the content of a GenView.
Parameters:
viewWidth
The new window's initial width.
viewHeight
viewWindow
Return: Nothing.
Interception: A content may wish to subclass this message if it needs to initialize data before the view's window is actually on the screen.
void MSG_META_CONTENT_VIEW_OPENING( optr view);
This message notifies the content that the view window is being put on the screen. Although the window will usually be fully realized by the time the content handles this message, the content should not draw anything in this handler. Because the view and content are often in different threads, a context switch could have occurred and the window might not be fully realized. This message will be followed by a
MSG_META_EXPOSED
indicating that the visible tree can be drawn and that the window is fully opened.
Source: Unrestricted--typically sent by a GenView to its content object.
Destination: Any VisContent or Process object acting as the content of a GenView.
Parameters:
view
The optr of the GenView.
Return: Nothing.
Interception: A content may wish to subclass this message to initialize data before the view window is fully opened.
void MSG_META_CONTENT_VIEW_SIZE_CHANGED( word viewWidth, word viewHeight, WindowHandle viewWindow);
This message is sent to the content whenever the view's size changes for any reason. The passed height and width will be stored in the content's
VCNI_viewHeight
and
VCNI_viewWidth
fields.
Source: Unrestricted--typically sent by a GenView to its content object.
Destination: Any VisContent or Process object acting as the content of a GenView.
Parameters:
viewWidth
The new width of the view window.
viewHeight
viewWindow
Return: Nothing.
Interception: Any content that is managing large documents may need to subclass this message to apply translations for 32-bit coordinates.
void MSG_META_CONTENT_VIEW_CLOSING();
This message indicates to the content that the view window is being shut down. The content should remove the visible tree from the screen and should prepare itself for the window to be closed.
Source: Unrestricted--typically sent by a GenView to its content object.
Destination: Any VisContent or Process object acting as the content of a GenView.
Interception: A content may subclass this message if it wants to do additional things when the view is taken off the screen.
void MSG_META_CONTENT_VIEW_WIN_CLOSED( WindowHandle viewWindow);
This message indicates that the view's window has been shut down, taken off the screen, and destroyed. The content responds to this message by discarding the window handle stored in its
VCNI_window
field. The content should already have removed itself from the screen when it received an earlier
MSG_VIS_CLOSE
.
Source: Unrestricted--typically sent by a GenView to its content object.
Destination: Any VisContent or Process object acting as the content of a GenView.
Parameters:
viewWindow
The window handle of the GenView's window.
Return: Nothing.
Interception: A content may subclass this message to clean up after the view window is closed (e.g. if the content cached the view's window handle to a global variable, it will need to zero that handle now).


To start the data generating
process,
specify the amount that you want to generate. You can only generate data for
specific attributes, yet. Enter a integer value in the textbox and press Return
to accept the value that you have entered. If you don't press Return, you won't
get valid output.
Finally, click the generate button in the icon bar or go to
Run - Generate Data in the menu bar.
You will be asked where you want to store the generated
files and the data generation process will start.
|


Boil the onions in quarter cup of water. Drain and allow to cool. Grind to a fine paste. Heat the oil in a kadai, add the cloves, peppercorns, cinnamon and bay leaf and saute till fragrant. Add the green chillies and boiled onion paste and saute for three to four minutes on low heat so it does not get coloured. Add the ginger paste and garlic paste and continue to saute for half a minute. Add the cashewnut paste and saute for another two minutes. Add the yogurt and saute till the water from the yogurt gets absorbed. Stir in the cream, saffron and garam masala powder and salt to taste. Add the paneer and stir gently to mix. Sprinkle green cardamom powder and serve hot.


Saviors of Middle Earth
Account
Your account has been deactivated by this website's administrators. Please
Logout
.


| choose.k {mgcv} | R Documentation |
Choosing the basis dimension, and checking the choice, when using penalized regression smoothers.
Penalized regression smoothers gain computational efficiency by virtue of
being defined using a basis of relatively modest size, k
. When setting
up models in the mgcv
package, using s
or te
terms in a model formula, k
must be chosen: the defaults are essentially arbitrary.
In practice k-1
(or k
) sets the upper limit on the degrees of freedom
associated with an s
smooth (1 degree of freedom is usually lost to the identifiability
constraint on the smooth). For te
smooths the upper limit of the
degrees of freedom is given by the product of the k
values provided for
each marginal smooth less one, for the constraint. However the actual
effective degrees of freedom are controlled by the degree of penalization
selected during fitting, by GCV, AIC, REML or whatever is specified. The exception
to this is if a smooth is specified using the fx=TRUE
option, in which
case it is unpenalized.
So, exact choice of k
is not generally critical: it should be chosen to
be large enough that you are reasonably sure of having enough degrees of
freedom to represent the underlying ‘truth’ reasonably well, but small enough
to maintain reasonable computational efficiency. Clearly ‘large’ and ‘small’
are dependent on the particular problem being addressed.
As with all model assumptions, it is useful to be able to check the choice of
k
informally. If the effective degrees of freedom for a model term are
estimated to be much less than k-1
then this is unlikely to be very
worthwhile, but as the EDF approach k-1
, checking can be important. A
useful general purpose approach goes as follows: (i) fit your model and
extract the deviance residuals; (ii) for each smooth term in your model, fit
an equivalent, single, smooth to the residuals, using a substantially
increased k
to see if there is pattern in the residuals that could
potentially be explained by increasing k
. Examples are provided below.
The obvious, but more costly, alternative is simply to increase the suspect k
and refit the original model. If there are no statistically important changes as a result of
doing this, then k
was large enough. (Change in the smoothness selection criterion,
and/or the effective degrees of freedom, when k
is increased, provide the obvious
numerical measures for whether the fit has changed substantially.)
gam.check
runs a simple simulation based check on the basis dimensions, which can
help to flag up terms for which k
is too low. Grossly too small k
will also be visible from partial residuals available with plot.gam
.
One scenario that can cause confusion is this: a model is fitted with
k=10
for a smooth term, and the EDF for the term is estimated as 7.6,
some way below the maximum of 9. The model is then refitted with k=20
and the EDF increases to 8.7 - what is happening - how come the EDF was not
8.7 the first time around? The explanation is that the function space with
k=20
contains a larger subspace of functions with EDF 8.7 than did the
function space with k=10
: one of the functions in this larger subspace
fits the data a little better than did any function in the smaller
subspace. These subtleties seldom have much impact on the statistical
conclusions to be drawn from a model fit, however.
Simon N. Wood<EMAIL_ADDRESS>Wood, S.N. (2017) Generalized Additive Models: An Introduction with R (2nd edition). CRC/Taylor & Francis.
http://www.maths.bris.ac.uk/~sw15190/
## Simulate some data .... library(mgcv) set.seed(1) dat <- gamSim(1,n=400,scale=2) ## fit a GAM with quite low `k' b<-gam(y~s(x0,k=6)+s(x1,k=6)+s(x2,k=6)+s(x3,k=6),data=dat) plot(b,pages=1,residuals=TRUE) ## hint of a problem in s(x2) ## the following suggests a problem with s(x2) gam.check(b) ## Another approach (see below for more obvious method).... ## check for residual pattern, removeable by increasing `k' ## typically `k', below, chould be substantially larger than ## the original, `k' but certainly less than n/2. ## Note use of cheap "cs" shrinkage smoothers, and gamma=1.4 ## to reduce chance of overfitting... rsd <- residuals(b) gam(rsd~s(x0,k=40,bs="cs"),gamma=1.4,data=dat) ## fine gam(rsd~s(x1,k=40,bs="cs"),gamma=1.4,data=dat) ## fine gam(rsd~s(x2,k=40,bs="cs"),gamma=1.4,data=dat) ## `k' too low gam(rsd~s(x3,k=40,bs="cs"),gamma=1.4,data=dat) ## fine ## refit... b <- gam(y~s(x0,k=6)+s(x1,k=6)+s(x2,k=20)+s(x3,k=6),data=dat) gam.check(b) ## better ## similar example with multi-dimensional smooth b1 <- gam(y~s(x0)+s(x1,x2,k=15)+s(x3),data=dat) rsd <- residuals(b1) gam(rsd~s(x0,k=40,bs="cs"),gamma=1.4,data=dat) ## fine gam(rsd~s(x1,x2,k=100,bs="ts"),gamma=1.4,data=dat) ## `k' too low gam(rsd~s(x3,k=40,bs="cs"),gamma=1.4,data=dat) ## fine gam.check(b1) ## shows same problem ## and a `te' example b2 <- gam(y~s(x0)+te(x1,x2,k=4)+s(x3),data=dat) rsd <- residuals(b2) gam(rsd~s(x0,k=40,bs="cs"),gamma=1.4,data=dat) ## fine gam(rsd~te(x1,x2,k=10,bs="cs"),gamma=1.4,data=dat) ## `k' too low gam(rsd~s(x3,k=40,bs="cs"),gamma=1.4,data=dat) ## fine gam.check(b2) ## shows same problem ## same approach works with other families in the original model dat <- gamSim(1,n=400,scale=.25,dist="poisson") bp<-gam(y~s(x0,k=5)+s(x1,k=5)+s(x2,k=5)+s(x3,k=5), family=poisson,data=dat,method="ML") gam.check(bp) rsd <- residuals(bp) gam(rsd~s(x0,k=40,bs="cs"),gamma=1.4,data=dat) ## fine gam(rsd~s(x1,k=40,bs="cs"),gamma=1.4,data=dat) ## fine gam(rsd~s(x2,k=40,bs="cs"),gamma=1.4,data=dat) ## `k' too low gam(rsd~s(x3,k=40,bs="cs"),gamma=1.4,data=dat) ## fine rm(dat) ## More obvious, but more expensive tactic...


Preparation time
overnight
Cooking time
30 mins to 1 hour
Serves
Serves 6
Lightly spiced, crisp chicken pieces baked in the oven, rather than fried, to reduce those pesky calories.
For the marinade, combine all the marinade ingredients in a pestle and mortar and mix well to make a paste. Add the chicken and coat each piece well in the paste. Cover with cling film and leave for a couple of hours or overnight in the fridge. Bring back to room temperature before continuing.
Preheat the oven to 225C/435F/Gas 7.
Pour the oil into a roasting pan large enough to hold all the chicken pieces in one layer. Place the pan on a high shelf in the oven for 15 minutes to heat up.
Mix the salt, black pepper and cumin into the breadcrumbs. Take the chicken out of the marinade, letting the excess drip off and roll each piece in the crumbs ensuring an even coating on all sides.
Dip the chicken pieces into the beaten egg and add a second coating of crumbs. Place them on the baking sheet and cook for 20 minutes. Then lower the oven to 200C/400F/Gas 6, turn the chicken and cook for another 15-25 minutes (depending on the size of the chicken pieces), or until cooked through.
Place on a serving dish, cut the lemon into wedges and serve.


CHAPTER 439
BEAUTY CULTURE
Section
439-1 Definitions
439-2 License; required
439-3 to 10 Repealed
439-11 Application for examination
439-12 Requisites for admission to examination
439-12.5 Medical clearance
439-13 Admission to examination
439-14 Examination
439-15 License, fees
439-16 Temporary permits
439-17 Beauty shops
439-18 Schools
439-19 Refusal to grant and revocation and suspension of
licenses
439-20 Hearing
439-21 Board to aid prosecution
439-22 Penalty
439-22.5 Citation for licensee or permittee violations; fines
439-23 Right of injunction
439-24 Cumulative remedies
Note
Source notes for certain sections of this chapter start with L 1949, c 397, which completely amended this chapter.
Cross References
Sunset evaluations modified, see §§26H-4 and 26H-5.


What is Artificial Intelligence?
Intelligent behaviour is what humans do
Skype Translator
This feature of Skype can recognize and translate natural human language in real time
Learn moreVideo Games for AI
Minecraft for AI Experimentation
- Large amounts of data
- Wide variety of tasks
- Speed
- Repeatability
import MalmoAgent
import time
agent_host = MalmoPython.AgentHost()
my_mission = MalmoPython.MissionSpec("my_mission.xml")
my_mission_record = MalmoPython.MissionSpec("save.tgz")
agent_host.startMission( my_mission, my_mission_record )
world_state = agent_host.peekWorldState()
while world_state.is_mission_running:
// interpret world state
world_state = agent_host.getWorldState()
for reward in world_state.rewards:
print "Summed reward:",reward.value
for observation in world_state.observations:
print "Observation:",observation.text
// act
agent_host.sendCommand( "move 1" )
agent_host.sendCommand( "turn 0.5" )
agent_host.sendCommand( "jump 1" )
time.sleep(0.1)
[...]
<ServerHandlers>
<FlatWorldGenerator>
generatorString="3;7,220*1,5*3,2;3;,biome_1"/>
<DrawingDecorator>
<!-- limits of our arena -->
<DrawCuboid x1="-2" y1="46" z1="-2" x2="7" y2="50“
z2="18" type="air" />
<!-- lava floor -->
<DrawCuboid x1="-2" y1="45" z1="-2" x2="7" y2="45“
z2="18" type="lava" />
<!-- floor of the arena -->
<DrawCuboid x1="1" y1="45" z1="1" x2="3" y2="45“
z2="12" type="sandstone" />
<!-- the starting marker -->
<DrawBlock x="4" y="45" z="1" type="cobblestone" />
<!-- the destination marker -->
<DrawBlock x="4" y="45" z="12" type="lapis_block" />
<!-- another destination marker -->
<DrawItem x="4" y="46" z="12" type="diamond" />
</DrawingDecorator>
<ServerQuitFromTimeUp timeLimitMs="10000"/>
<ServerQuitWhenAnyAgentFinishes/>
</ServerHandlers>
[...]
Interactive Learning
Project Malmo
A platform for AI experimentation, built on Minecraft
Learn more


A simple reactive data type designed to make state management in React as intuitive, ergonomic, and performant as possible.
The following operations are available for working with Atoms:
When an Atom's value is updated, all function components that called useAtom on that Atom will be notified to re-render and read the next state
import React from 'react'; import ReactDOM from 'react-dom'; import { Atom, useAtom, swap } from '@dbeining/react-atom'; const stateAtom = Atom.of({ count: 0 }); const increment = () => swap(stateAtom, (state) => ({...state, count: state.count + 1})); const decrement = () => swap(stateAtom, (state) => ({...state, count: state.count - 1})); export const App = () => { const { count } = useAtom(stateAtom); return (

Count: {count}
 <button onClick={increment}>Moar</button> <button onClick={decrement}>Less</button>
 ); }; ReactDOM.render(<App />, document.getElementById('root'));
the type of the value being set as an Atom's internal state
Constructs a new instance of Atom with its internal state set to state.
state
import { Atom } from '@dbeining/react-atom' const a1 = Atom.of(0) const a2 = Atom.of("zero") const a3 = Atom.of({ count: 0 })
A simple reactive data type designed to make state management in React as intuitive, ergonomic, and performant as possible.
The following operations are available for working with Atoms:
When an Atom's value is updated, all function components that called useAtom on that Atom will be notified to re-render and read the next state
import React from 'react'; import ReactDOM from 'react-dom'; import { Atom, useAtom, swap } from '@dbeining/react-atom'; const stateAtom = Atom.of({ count: 0 }); const increment = () => swap(stateAtom, (state) => ({...state, count: state.count + 1})); const decrement = () => swap(stateAtom, (state) => ({...state, count: state.count - 1})); export const App = () => { const { count } = useAtom(stateAtom); return (

Count: {count}
 <button onClick={increment}>Moar</button> <button onClick={decrement}>Less</button>
 ); }; ReactDOM.render(<App />, document.getElementById('root'));


Our customers rely on us for accurate and fast turnaround of their broadcast fax orders. Our Customer Service team members are trained to assist with database work, Custom Fax Merge applications, area code updates, processing removals, assisting with reports or any unique situation that may require special attention.
Fully staffed from 8 AM to 8 PM ET, our Customer Service team is the perfect fit for clients in need of a more consultative approach.
Call a representative toll-free today at<PHONE_NUMBER> or send email to info@westfax.com.


Example of CenteredCluster strategy for OpenLayers that allows add and remove individual features.
View the strategy-centered-cluster-add-remove.js source to see how this is done.


public abstract class ServerRequest extends Object
Request
object in the DII.
The ORB is responsible for creating this embodiment of a request,
and delivering it to a Dynamic Implementation Routine (DIR).
A dynamic servant (a DIR) is created by implementing the
DynamicImplementation
class,
which has a single invoke
method. This method accepts a
ServerRequest
object.
The abstract class ServerRequest
defines
methods for accessing the
method name, the arguments and the context of the request, as
well as methods for setting the result of the request either as a
return value or an exception.
A subtlety with accessing the arguments of the request is that the
DIR needs to provide type information about the
expected arguments, since there is no compiled information about
these. This information is provided through an NVList
,
which is a list of NamedValue
objects.
Each NamedValue
object
contains an Any
object, which in turn
has a TypeCode
object representing the type
of the argument.
Similarly, type information needs to be provided for the response,
for either the expected result or for an exception, so the methods
result
and except
take an Any
object as a parameter.
DynamicImplementation
,
NVList
,
NamedValue
| Constructor and Description |
|---|
ServerRequest() |
| Modifier and Type | Method and Description |
|---|---|
void |
arguments(NVList args)
Specifies method parameter types and retrieves "in" and "inout"
argument values.
|
abstract Context |
ctx()
Returns the context information specified in IDL for the operation
when the operation is not an attribute access and the operation's IDL
definition contains a context expression; otherwise it returns
a nil
Context reference. |
void |
except(Any any)
Deprecated.
use set_exception()
|
String |
op_name()
Deprecated.
use operation()
|
String |
operation()
Throws an
org.omg.CORBA.NO_IMPLEMENT exception. |
void |
params(NVList params)
Deprecated.
use the method
arguments |
void |
result(Any any)
Deprecated.
use the method
set_result |
void |
set_exception(Any any)
Throws an
org.omg.CORBA.NO_IMPLEMENT exception. |
void |
set_result(Any any)
Throws an
org.omg.CORBA.NO_IMPLEMENT exception. |
@Deprecated public String op_name()
_get_<attribute_name>
and _set_<attribute_name>
,
respectively.public String operation()
org.omg.CORBA.NO_IMPLEMENT
exception.
Retrieves the name of the operation being
invoked. According to OMG IDL's rules, these names must be unique
among all operations supported by this object's "most-derived"
interface. Note that the operation names for getting and setting
attributes are _get_<attribute_name>
and _set_<attribute_name>
,
respectively.
CORBA
package comments for unimplemented features@Deprecated public void params(NVList params)
arguments
Note that this method is deprecated; use the method
arguments
in its place.
Unless it calls the method set_exception
,
the DIR must call this method exactly once, even if the
method signature contains no parameters. Once the method
arguments
or set_exception
has been called, calling arguments
on the same
ServerRequest
object
will result in a BAD_INV_ORDER
system exception.
The DIR must pass in to the method arguments
an NVList initialized with TypeCodes and Flags
describing the parameter types for the operation, in the order in which
they appear in the IDL specification (left to right). A
potentially-different NVList will be returned from
arguments
, with the
"in" and "inout" argument values supplied. If it does not call
the method set_exception
,
the DIR must supply the returned NVList with return
values for any "out" arguments before returning, and may also change
the return values for any "inout" arguments.
params
- the arguments of the method, in the
form of an NVList
objectpublic void arguments(NVList args)
set_exception
,
the DIR must call this method exactly once, even if the
method signature contains no parameters. Once the method
arguments
or set_exception
has been called, calling arguments
on the same
ServerRequest
object
will result in a BAD_INV_ORDER
system exception.
The DIR must pass in to the method arguments
an NVList initialized with TypeCodes and Flags
describing the parameter types for the operation, in the order in which
they appear in the IDL specification (left to right). A
potentially-different NVList will be returned from
arguments
, with the
"in" and "inout" argument values supplied. If it does not call
the method set_exception
,
the DIR must supply the returned NVList with return
values for any "out" arguments before returning, and it may also change
the return values for any "inout" arguments.args
- the arguments of the method, in the
form of an NVListCORBA
package comments for unimplemented features@Deprecated public void result(Any any)
set_result
Note that this method is deprecated; use the method
set_result
in its place.
Unless the method
set_exception
is called, if the invoked method
has a non-void result type, the method set_result
must be called exactly once before the DIR returns.
If the operation has a void result type, the method
set_result
may optionally be
called once with an Any
object whose type is
tk_void
. Calling the method set_result
before
the method arguments
has been called or after
the method set_result
or set_exception
has been
called will result in a BAD_INV_ORDER exception. Calling the method
set_result
without having previously called
the method ctx
when the IDL operation contains a
context expression, or when the NVList passed to arguments did not
describe all parameters passed by the client, may result in a MARSHAL
system exception.
any
- an Any
object containing the return value to be setpublic void set_result(Any any)
org.omg.CORBA.NO_IMPLEMENT
exception.
Specifies any return value for the call. Unless the method
set_exception
is called, if the invoked method
has a non-void result type, the method set_result
must be called exactly once before the DIR returns.
If the operation has a void result type, the method
set_result
may optionally be
called once with an Any
object whose type is
tk_void
. Calling the method set_result
before
the method arguments
has been called or after
the method set_result
or set_exception
has been
called will result in a BAD_INV_ORDER exception. Calling the method
set_result
without having previously called
the method ctx
when the IDL operation contains a
context expression, or when the NVList passed to arguments did not
describe all parameters passed by the client, may result in a MARSHAL
system exception.
any
- an Any
object containing the return value to be setCORBA
package comments for unimplemented features@Deprecated public void except(Any any)
any
- the Any
object containing the exceptionpublic void set_exception(Any any)
org.omg.CORBA.NO_IMPLEMENT
exception.
Returns the given exception to the client. This method
is invoked by the DIR, which may call it at any time.
The Any
object passed to this method must
contain either a system
exception or one of the user exceptions specified in the
invoked operation's IDL definition. Passing in an
Any
object that does not contain an exception
will cause a BAD_PARAM system exception to be thrown. Passing
in an unlisted user exception will result in either the DIR receiving a
BAD_PARAM system exception or in the client receiving an
UNKNOWN_EXCEPTION system exception.
any
- the Any
object containing the exceptionBAD_PARAM
- if the given Any
object does not
contain an exception or the exception is an
unlisted user exceptionUNKNOWN_EXCEPTION
- if the given exception is an unlisted
user exception and the DIR did not
receive a BAD_PARAM exceptionCORBA
package comments for unimplemented featurespublic abstract Context ctx()
Context
reference. Calling the method
ctx
before the method arguments
has
been called or after the method ctx
,
set_result
, or set_exception
has been called will result in a
BAD_INV_ORDER system exception.BAD_INV_ORDER
- if (1) the method ctx
is called
before the method arguments
or
(2) the method ctx
is called
after calling set_result
or
set_exception
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2015, Oracle and/or its affiliates. All rights reserved.


Patient enrolled in
{{ toTitleCase(currentEnrollment?.openmrsModel?.display) }}
{{ ' at ' + currentEnrollment.openmrsModel.location.display }}
{{ ' since ' + currentEnrollment?.dateEnrolled }}.
Patient not enrolled in a Community Group.
{{ communityEnrollmentSuccessMessage }}
Please associate this program with a clinic.
Patient not enrolled in the program you loaded please check the
patient