text:
WebObjects/Web Applications/Development/General Best Practices

Avoid Changing WOComponent Structure Before It Is Used
One of the more pernicious problems that afflict new WebObjects developers results from creating and sending out a WOComponent in appendToResponse, then changing the structure of that component before the subsequent takeValuesFromRequest and invokeAction methods have completed on that page.

Doing so will confuse WO's interpretation of the page when it's referenced either in the takeValuesFromRequest or invokeAction. The results will make you feel like your WOComponent has become schizophrenic. If it gets confused during the takeValuesFromRequest, it will take values from a field or fields on your form and put them in unrelated instance variables in your corresponding class file. If it gets confused during the invokeAction, it will activate an action method unrelated to the one bound to the WOSubmitButton or WOHyperlink on which you clicked.

In short, if your page starts showing signs of schizophrenic behavior, this is the first place I would look. So what, exactly, is the problem?

From the point that you execute the appendToResponse, you must make sure that none of the objects used to create the HTML structure that went out as the response, change in any way that would cause that HTML structure (page template) to change before the ensuing takeValuesFromRequest and invokeAction methods have completed. In particular, if any boolean values change on which WOConditionals depend, if any array sizes used in WORepetitions change, then you will have created a problem whose manifestations can often be difficult to track down.

When you execute the appendToResponse, WO uses your WOComponents, subcomponents and WOElements to create a hierarchy of objects (an object graph) which it then "walks" to generate the HTML. When the takeValuesFromRequest and invokeAction methods execute, WO recreates this template and re-"walks" it to determine which objects receive the returned values and which object was responsible for invoking the action. If any changes to your object graph would cause that template structure to change between the appendToResponse and the corresponding takeValuesFromRequest and invokeAction, then WO will get lost and probably put wrong values in your form objects and determine that the wrong element (say, a WORadioButton) caused the action.

It's both a common and a pernicious error.

If you have WOConditionals, it's safest to bind them to booleans in your class file that you only change in appendToResponse, before it's call to super.appendToResponse. If that is difficult, use whatever logic is natural in your program, but put a boolean (to which you bind your WOConditional) to reflect that logic before the super.appendToResponse, and only change the boolean accordingly at that point in that method.

If you have WORepetitions, confirm that none of your code changes the sizes of those arrays or indexes on which their sizes depend between your activation of super.appendToResponse and the completion of the corresponding invokeAction for that page.

For a deeper explanation of this process and its ramifications, see. In particular, read the last paragraph, and the following page. In this latter page, pay close attention to the second to last paragraph.

Creating WOComponents
Rather than use

MyNewPage nextPage = (MyNewPage)pageWithName("MyNewPage");

Prefer this form:

MyNewPage nextPage = (MyNewPage)pageWithName(MyNewPage.class.getName);

The class.getName allows Eclipse to do proper refactoring and you can right click=>References=>Workspace your class and truly find all the references vs just having a string references. One other advantage that it has is that if you have two pages with the same name but in different packages, this avoids confusion. If you just use pageWithName("MyNewPage";), WO can return the wrong one. Minor change but really nice benefits.

If you use 1.5, you can use the 1.5 variation:

@SuppressWarnings("unchecked") public  T pageWithName(Class componentClass) { return (T) super.pageWithName(componentClass.getName); }

which removes a cast:

MyNewPage nextPage = pageWithName(MyNewPage.class);

Avoid String Literals
KeyValueCoding (aka KVC) tends to encourage the use of constructs like this

website.addObjectToBothSidesOfRelationshipWithKey(newFolder, “folders”);

This litters code with hard coded strings. Changing the property name breaks code with no compilation warnings. If you use EOGenerator to generate constants for the names:

public static final String FOLDERS = “folders”;

You can use them in place of the hard coded strings and get errors when changes affect code:

website.addObjectToBothSidesOfRelationshipWithKey(newFolder, FOLDERS);

An EOGenerator template (fragement) to do this:

public static final String ENTITY_NAME = "<$name$>"; <$foreach propertyName classPropertyNames.@reversedArray do$> public static final String <$propertyName.uppercaseString$> = "<$propertyName$>";<$endforeach do$>

Except

 * This does not address the related issue when property names are used in bindings in a wod file
 * This does not work in the (admittedly rare) case where one class implements multiple entities. EOGenerator assumes one entity == one class. So, MyEO.ENTITY_NAME will return the name of the last entity to get generated.

See the EOGenerator page for more similar tricks.


text:
WebObjects/Web Applications/Development/Authentication and Security

Wikibooks WebObjects pages considered deprecated
See http://wiki.objectstyle.org/confluence/display/WO/Web+Applications-Development-Authentication+and+Security instead.

Encrypted Passwords
Kieran Kelleher has written an excellent article on his blog about performing encryption on an EO attribute via a custom attribute: http://web.archive.org/20071121050703/homepage.mac.com/kelleherk/iblog/C729512539/E2033071041/index.html

Security Considerations
Just some tips and hints originally compiled by Anders Björklund...

Besides the normal drill with "everything over HTTP is unsafe, use HTTPS for sensitive data", there are some WO-specific issues. It can give away a lot of your setup to the visitor...

First, if using the Apache web server before WO 4.5.1, set the WebObjectsConnectionPool to zero to avoid the Session Mixing bug (users get each other's sessions)

You might want to check your system (preferrably from the outside of your server's firewall) for the following things:

 * $HOSTNAME = host.domain.tld (your web server)
 * $APPNAME = WOApplication name (your application)

The CGI adaptor application listing
http://$HOSTNAME/cgi-bin/WebObjects/

Set username and password for the application listing.

The web server resources listing
http://$HOSTNAME/WebObjects/

Don't allow directory browsing on your web server, otherwise users will be able to see all of your web server resources, and learn the names of all of your applications and frameworks that contain web server resources.

The wotaskd config page (WO >= 4.5)
http://$HOSTNAME:1085/cgi-bin/WebObjects/wotaskd.woa/wa/woconfig

The port 1085 should not be allowed through the firewall.

The Monitor
http://$HOSTNAME/cgi-bin/WebObjects/Monitor

Monitor should be unavailable, or at least password protected.

The xyzzy default page
http://$HOSTNAME/cgi-bin/WebObjects/xyzzy

The name/password for the xyzzy page should be changed.

The WOStatisticsStore default page
http://$HOSTNAME/cgi-bin/WebObjects/$APPNAME.woa/wa/WOStats

The statistics page should be protected by a password (or off).

The WOEventDisplay default page (WO >= 4.5)
http://$HOSTNAME/cgi-bin/WebObjects/$APPNAME.woa/wa/WOEventDisplay

The events page should be be protected by a password (or off).

The WOEventSetup default page
http://$HOSTNAME/cgi-bin/WebObjects/$APPNAME.woa/wa/WOEventSetup

See http://developer.apple.com/techpubs/webobjects/EOControlRef/Java/Classes/Concepts/EOEventCenterConcepts.html

You can invoke a WOComponent directly if you know its name
http://$HOSTNAME/cgi-bin/WebObjects/$APPNAME.woa/wo/$COMPONENTNAME.wo

This can be used to navigate a site in ways not otherwise explicitly allowed. In addition, a number of WOComponents with well-known names are included in the WebObjects frameworks, and are thus accessible in any WebObjects application.

This is a very serious security issue. WOComponents that are accessed in this way are basically uninitialized (i.e., no bindings are set). In some cases, accessing an uninitialized WOComponent in this way will bring an app down. Any way in which someone can bring down your application with a simple URL call to it should be blocked.

You can invoke a DirectAction if you know its name
http://$HOSTNAME/cgi-bin/WebObjects/$APPNAME.woa/wa/$DIRECTACTIONNAME http://$HOSTNAME/cgi-bin/WebObjects/$APPNAME.woa/wa/$DIRECTACTIONCLASSNAME/$DIRECTACTIONNAME

If someone has access to your application, then he can call any direct action he wants by using the URL above. If the DirectAction name exists, it will be called. If it does not exist, an error is thrown (which should be caught). A DirectAction that should not be randomly accessed should be secured. If your application displays user-entered text into the HTML stream, it may be possible for them to insert a ; tag to display a component that otherwise wouldn't be displayed.

This is tricky -- the attacker would need to know the name of an existing webobject, and even then they wouldn't be able to override the parameters in the binding (.wod) file.

Andrus Adamchik points out that because of the way WebObjects' HTML templating system works, you'd also need to explicitly call WOComponent.templateWithName with the user-enterer string.

Others
And a few miscellaneous additions contributed by GarrickMcFarlane, a UK-based WebObjects consultant:

Don't forget about the security implications of any direct actions you may have available in your application.
 * If you leave multiple adaptors around (eg, on IIS, the WebObjects.dll and the WebObjects.exe) then you can apply all the security in the world to one of them whilst still leaving the other one pretty much unprotected -- because they each use different names and mechanisms for determining your security settings. So, if you're using the dll, you should consider getting rid of the .exe.
 * xyzzy is called WOAdaptorInfo on 4.5.1 and upwards.
 * If you use the file upload component make sure you have the web server configured to disallow uploads over a certain size, otherwise your web/app server/adaptor/application can easily be denial-of-serviced (verb?) by uploading a large block of data.
 * If you implement user/password security at the application level -- eg, by having a login panel on the Main page -- consider overriding a global part of the request handling (such as session.appendToResponse) to check it's set on every request. Otherwise it's just too easy to sneak into your app via an accidental backdoor.
 * You can use web server authentication and check the headers on every request in somewhere like application.handleRequest -- that way no unauthorised request can ever get processed by your app. If you want to be really careful, you could recompile the Adaptor to check these headers and not even pass the request to the applications.

You probably also want to check that your application server(s) and your database server's service ports are not open to the public internet. Normally, you only need 80 and 443 to the web server as the only communication (there are exceptions: You might want to allow 22 as well, for SSH administration,and perhaps even 21 for FTP access to some of the pages, etc.)

And all other normal server internet connection precautions... http://www.w3.org/Security/Faq/

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
User talk:Nemo The Pyro

Hey, Nemo, I got the question you asked me about the templates. They are called infoboxes and all the Wikiprojects have them. There are more options on Wikipedia and you can find them here. As for the infoboxes for WikiBooks, I believe you can only put up languages and not the more interesting stuff. I hope the above link helps. You can message me anytime if you have any other questions. Boneheadmx 12:10, 16 May 2006 (UTC)

I found the Wikibooks user namespace templates and they can be found here. I hope you find Wikibooks useful. Once again, if you ever need help with anything, don't hesitate to message me. Boneheadmx 12:13, 16 May 2006 (UTC)

Check the list of infoboxes here. Then, you can use the following code, listing the parameters inside: " " where "x" is the number of total infoboxes you want and "parameter" is the code for the specific infobox. For example, if you speak English at a native level and French at an elementary level, you would write " " because you have 2 infoboxes. The "en" and "fr" are the codes to the English and French infoboxes. The list of language codes can be found here and if you want to check the codes for the other infoxes, just go here. If you want to give me list of infoboxes you want to put on your page, you can just message me and I will help you write the code up. Cheers mate. Boneheadmx 08:04, 17 May 2006 (UTC)

title: User talk:Nemo The Pyro


text:
WebObjects/EOF/Using EOF/EOF Performance Tuning

EOF Performance Tuning
EOF does many nice things for you. But many people learn some things the hard way; like that a relational->object mapping library can have some serious overhead. A common experience with large and complex object model, is that people model their objects, then do a large fetch and find out that bringing in a large set of EO's can be really slow (relative to what they were expecting with JDBC or direct SQL). The overhead of bringing something into an EO can vary, but seeing 100 times speed degradation over raw SQL is certainly plausible; and for many problems, that is just too stiff a penalty. So what to do about it?

Here are some of the approaches you can take to improve things;

Lighten your objects
The largest penalty in an R/O system, is comparing new objects (items) against other cached versions (snapshots) and consolidating and resolving any changes. So adding things as objects, means you will incur that penalty. Still, there are some minor benefits to be had if you lighten the objects.

Your EO's do not have to model everything that is in your table. And you can have many EO's that map to the same table. The valuable part of an EO is that you model in the relationships and can have relationship traversal; but those relationships can have costs. If you thin out objects of relationships you don't need, they will load faster; the same for attributes you don't need. You can even take this a step further; and have multiple flavors of an EO, for what you are doing at a given time. So have an EO that has just the attributes and relationships that you need for a particular fetch, and another variant for a different type of fetch; and finally the full blown version that you load only in the cases where you need ALL the information for viewing or editing. So most of the your collections of EO's are lighter weight and more targeted variants than ones you need for large edits.

There are other techniques as well; using the little lock attribute in EOModeler to make many more items opaque (or non mutable) to EOF. EOF compares those attitubutes with locks to figure out if an object in the snapshots is stale or not; so reducing the attributes it needs to compare, can speed up the overhead. Some people take this to the extreme, and set all/most of the attibutes to unlocked, and have one time-stamp that is the only keyed item; then if any attribute changes, that one timestamp will also change, and EOF will still manage the snapshots, but with fewer attributes. But this seems to push more into code, for the sake of saving EOF some runtime maintenance with each objects.

But the point is that the lighter and simpler an EO is, the faster it is. However, the main penalty is on serialization/synchronization at all; so the returns are probably not dramatic enough, in most cases, to justify the measures necessary to create these "optimizations".

Adapt your model
When you are going to be using a relational to object mapping library (like EOF), you should expect that this will change your requirements; enough that you can adapt your model to fit the tool.

If fetching an EO is heavy/slow, then generally the fewer objects you bring in, the faster your system will perform. So if you collapse and denormalize many small tables, into a few bigger ones, you will be doing fewer EO loads, and probably dealing less with all that fault and relationship management of all those little fragments and relationships; which can result in performance savings.

You can do this a little by flattening relationships, or using views in the database to make things appear to be flatter than they are; or you can go right to model and actually flatten. Arguments can be made for each, depending on your requirements.

You can even go further, and start moving complex data structures and relationships into blobs that you manage yourself. This offloads EOF from managing them, and often allows you to speed things up; but the cost is more code maintenance on your part, and of course denormalizing can negatively impact the design so you want to be careful about how zealously you go down this path.

Raw-Rows (late promotion)
One of THE most important techniques for speeding up access, is using Raw-Rows; or doing late promotion. Basically a raw-row fetch is a way for you to do a database fetch that returns a data structure (array of key-value pairs), instead of fetching and promoting that to a full blown object (EO). This lighter fetch takes much less time, and is much better for large collections.

Then on pages that use those collections can use Raw-Rows, and you promote an object out of that collection to a heavy-weight EO, only on those pages that need to work with an entire object (and all the complexities thereof).

Raw-SQL
Fetches generated by EOF or EOModeler or other tools are generally not as tuned as those generated by a human being; if they were, then machines wouldn't need us, and could program themselves. By creating the Raw-SQL yourself, you can generally tune and optimize fetches yourself, to either fetch in just the parts of table (both columns and/or rows) that you have interest in; again improving the performance and tuning the areas that most need it.

Another major boost in performance here, is that you can traverse your relationships if you select the fields you need from your relationships as part of the raw rows. This also reduces your transaction load (some databases only allow 100 TPM with cheaper licenses), and often increases fetch speed as all data is fetched in the one SQL query with a multiple table SELECT statement (a JOIN). You can also command your EOModel as to wether the relationships perform inner or outer joins which can be a major benefit for checking data integrity. (Check out some SQL sites to learn about INNER, LEFT OUTER, OUTER and RIGHT OUTER joins to see some great data collection methods)

Get closer to the Database (Stored Procedures)
While it seems like it is defeating one of the purposes of a database abstraction layer to get down and dirty with a database (using stored procedures, etc.); it may be a necessary or prudent step.

Stored procedures can do things at the database level that are much faster and lighten the app server load immensely. The cost is a lack of database independence; and you must learn intimate details of the database you are using. But a few well placed StoreProcedures can offer orders of magnitude difference.

Caching
One issue that needs to be discussed on its own is caching. While EO's are slow; they do cache -- so subsequent fetches (refetches) are significantly faster than first (primary fetches). This works well on not mutable (static) data. Less well on dynamic data. Still, you can use more than the default cache behaviors. You can fetch raw-rows of non-mutable data into your own arrays and manage your own cache of those. You can also put complex or compound attibutes in a cached attribute and fetch that item, instead of getting that live or constantly recalculating that from all the source parts (prebuild some calculations or collections).

So caching not only means WO+EOF should cache, but you might want to consider what you can cache to lighten various fetch loads as well.

Prefetching / Hinting
Now various prefetches and hints don't really save you time, in that you still have to load all the objects in and pay the same load time for the; but they can move where you pay that time. Sometimes this can dramatically improve the perceived performance, even if it doesn't alter the actual performance. Users might tolerate a 5 or 10 second penalty on one page, if the next 10 things they interact with are all much faster; and vice versa. So it helps to figure out what a user is trying to do, and how they are trying to do it; and tune accordingly.

Reduce your dataset
This may sound obvious, but reduce your dataset whenever possible. For example, no page should really display 5,000 elements -- that takes way too long to load and display. Better to use fetch limits or similar type of behaviors to show a user a smaller set of data whenever possible; and then use various techniques to fetch as little data as possible. The smaller the dataset, generally the faster you can work with it.

Conclusion
These are just some of the techniques you can think of to speed up EO fetches.

Some might say that if you have to do all these things that you're doing all the work for EOF for it; or your spending as much time optimizing code as it saved you in the first place. While in a few extreme cases that might be true; generally what happens is that EOF allows you to create a solution very quickly and easily; then you go back and learn where the bottlenecks are (profile), and tune those areas until they perform reasonably for your requirements. This allows the advantages of a RAD (Rapid Application Development) tool, with later the power and speed of a lower level tool; if you'll commit the time to tuning those areas that need to be tuned. And many classes of Apps may require very little tuning.

Vendor-Specific
For vendor-specific performance tuning, refer to the vendor-specific sections.

Anjo Krank
Take a look at the ERXAdaptorChannelDelegate in Project Wonder.

Chuck Hill
The SQL that EOModeler generates for many to many join tables does not allow full optimization of the join. Many to many join tables are only generated with a single index which is the compound key of both columns.

For example,

CREATE TABLE "GROUP_FILE" (   "FILE_PKEY" NUMERIC NOT NULL,    "GROUP_PKEY" NUMERIC NOT NULL  ); ALTER TABLE "GROUP_FILE" ADD PRIMARY KEY ("GROUP_PKEY","FILE_PKEY") NOT DEFERRABLE INITIALLY IMMEDIATE;

This index can only be used to optimize joins on the first column in the index (which is the second column in the table for some reason). The lack of an index for the other column results in a table scan when joining on the other column. This sort of joins happen when following a to many relationship. For example, group.files will result in SQL similar to this for each element in files:

SELECT f.* FROM FILE f,       GROUP g,       GROUP_FILE gf  WHERE f.PKEY = gf.FILE_PKEY AND g.PKEY = gf.GROUP_PKEY AND g.PKEY = 10;

Only the GROUP_PKEY has an index which is usable for optimizing this query. The join on FILE_PKEY (f.PKEY = gf.FILE_PKEY) is not optimized and results in table scans. You need to manually add an index for this:

CREATE INDEX GROUP_FILE_FILE_PKEY ON GROUP_FILE (FILE_PKEY);

This can make a truly dramatic difference if there are a lot of rows in the join table.


text:
WebObjects/EOF/Using EOF/Context and Database Locking

Overview
Errors in locking your editing context (shared editing contexts or not) will cause your instance to deadlock. This is one of the most vexing problems.

''Do you have to lock & unlock the editing context only when you are using a stateless section (directActions) of your application or do you have to lock & unlock it in state as well? What about the defaultEditingContext, does that need locking & unlocking too?''

If your sessions only use the default editing context, you don't worry about locking.

''Also, manually locking/unlocking objects is error prone. And the resulting errors are the most difficult to fix since they only occur randomly on heavy load. I really feel that WebObjects should use Java synchronization to ensure safe access without requiring manual coding. But this would probably mean a considerable rework of WebObjects''

I used to think along the same lines, but it turns out this would introduce a lot of overhead. You'd have a performance situation not unlike the original Java collections (BAD). If you can acquire one lock and then plow through EC and EO API at will until unlock, you really save some cycles. I'm sure there are others more enlightened here that can elaborate or correct me here; but this is my impression.

BTW: I tend to create extra ECs at the Session level and do the locking and unlocking in the Session awake and sleep. The request handler prevents more than one request from getting access to a Session at a time; and you are guaranteed that Session awake and sleep trigger just once per request cycle. That's not true of component awake and sleep calls. You have a greater potential for a deadlock if you do the lock/unlock at the component level:

Transaction starts on one page (lock), then instead of returning that page after action, you create another page (potential lock again, deadlock).

The only tricky thing I've run into is if your app uses Long Running Request Page. That's a case where you get multiple request/responses as viewed by the session over one logical "request". That is, the status page will be reloading, but your background job is busy doing its thing continuously. If it's busy using a EC that is locking and unlocking at the session awake/sleep you wouldn't get very far without complaints. So in these cases, if a user enters such a page AND is using a EC, I disable the automatic session lock/unlock for that EC until the job is over. Or I create a EC used strictly for the background job.

David LeBer
In general you are better to lock EC's in the session (if you've got one) rather than the component.

As that is the usual approach, there are a couple of solutions to implement that for you:
 * MultiECLockManager
 * Project Wonder's ERXEC

Jonathan Rochkind
Note: One very handy (if I do say so myself) reusable solution for locking ECs you create (not necessary for session default EC) can be found at: http://WOCode.com/cgi-bin/WebObjects/WOCode.woa/wa/ShareCodeItem?itemId=301

Anjo Krank
One thing to watch out for is that EC locking on the page's awake and sleep doesn't really work, because awake may be called more often than sleep. This means that normally you can't use DirectToWeb because it does just that. However, ProjectWonder has an editing context factory, an automatically locking and unlocking EC subclass and a lock manager that will release all locks when the application sleeps.

This works nicely with long response pages, provided that you don't use the session's editing context in the long running task.

Locking in a DirectAction
''If i call session.defaultEditingContext from within a DirectAction, I'm currently defensively locking it. Do I need to, or does it follow the same (automatic) locking rules as in a normal WOComponent?''

Anjo Krank
You don't need to lock it.

But anyway, doing something like:

public WOActionResults someAction { WOActionResults page = pageWithName("Foo"); session.defaultEditingContext.lock; try { ...   } finally { session.defaultEditingContext.unlock; }   return page; }

isn't sufficient, as the appendToResponse phase only occurs *after* the page is returned and faults could still get fired there... so when you create an EC there instead of using the session EC, you still have to lock it in the component.

Chuck Hill
Here is another way to handle this:

public WOActionResults someAction { WOComponent page = pageWithName("Foo"); WOResponse response; session.defaultEditingContext.lock; try { ...       response = page.generateResponse. } finally { session.defaultEditingContext.unlock; }   return response; }

The call to generateResponse before the unlock ensures that appendToResponse is called while the EC is locked and that all the faults are fired in a safe state.

Robert Walker
I generally avoid using the session's default editing context within direct actions. A call to session.defaultEditingContext will create a session, even if you don't actually need one. It can be more efficient to use a new editing context and lock it as necessary, since this will not cause unnecessary sessions to be created.

Tracking EOEditingContext Locks
Project WOnder's ERXEC provides extensive logging facilities for tracking EOEditingContext locks. If you are not interested in using Project WOnder, there are several other ways:

You can display the stack trace of editingcontext locking warnings with the Launch Argument:

-NSDebugLevel 2 -NSDebugGroups 18

This will give you some information but there is a better way. You need to sub-class EOEditingContext like this:

LockErrorScreamerEditingContext
// LockErrorScreamerEditingContext.java // // Copyright (c) 2002-2003 Red Shed Software. All rights reserved. // by Jonathan 'Wolf' Rentzsch (jon at redshed dot net) // enhanced by Anthony Ingraldi (a.m.ingraldi at larc.nasa.gov) // // Thu Mar 28 2002 wolf: Created. // Thu Apr 04 2002 wolf: Made NSRecursiveLock-aware by Anthony. // Thu Jun 22 2003 wolf: Made finalizer-aware. Thanks to Chuck Hill. import com.webobjects.eocontrol.*; import com.webobjects.foundation.*; import java.io.StringWriter; import java.io.PrintWriter; public class LockErrorScreamerEditingContext extends EOEditingContext { private String _nameOfLockingThread = null; private NSMutableArray _stackTraces = new NSMutableArray; public LockErrorScreamerEditingContext { super; }    public LockErrorScreamerEditingContext(EOObjectStore parent) { super(parent); }    public void lock { String nameOfCurrentThread = Thread.currentThread.getName; if (_stackTraces.count == 0) { _stackTraces.addObject(_trace); _nameOfLockingThread = nameOfCurrentThread; //NSLog.err.appendln("+++ Lock number (" + _stackTraces.count + ") in " + nameOfCurrentThread); } else { if (nameOfCurrentThread.equals(_nameOfLockingThread)) { _stackTraces.addObject(_trace); //NSLog.err.appendln("+++ Lock number (" + _stackTraces.count + ") in " + nameOfCurrentThread); } else { NSLog.err.appendln("!!! Attempting to lock editing context from " + nameOfCurrentThread                                   + " that was previously locked in " + _nameOfLockingThread); NSLog.err.appendln("!!! Current stack trace: \n" + _trace); NSLog.err.appendln("!!! Stack trace for most recent lock: \n" + _stackTraces.lastObject); }        }         super.lock; }    public void unlock { super.unlock; if (_stackTraces.count > 0) _stackTraces.removeLastObject; if (_stackTraces.count == 0) _nameOfLockingThread = null; String nameOfCurrentThread = Thread.currentThread.getName; //NSLog.err.appendln("--- Unlocked in " + nameOfCurrentThread + " (" + _stackTraces.count + " remaining)"); }    public void goodbye { if (_stackTraces.count != 0) { NSLog.err.appendln("!!! editing context being disposed with " + _stackTraces.count + " locks."); NSLog.err.appendln("!!! Most recently locked by: \n"                               + _stackTraces.lastObject); }    }     public void dispose { goodbye; super.dispose; }    protected void finalize throws Throwable { try { goodbye; } finally { super.finalize; }    }     private String _trace { StringWriter stringWriter = new StringWriter; PrintWriter printWriter = new PrintWriter(stringWriter); (new Throwable).printStackTrace(printWriter); return stringWriter.toString; } }

Now you'll have to get the subclass substituted whenever an EOEditingContext is created. Too bad there's no generalized EOEditingContext factory method in WOF, but this will cover default editing contexts:

public class Session extends WOSession { public Session { super; setDefaultEditingContext( new LockErrorScreamerEditingContext ); }    public Session( String sessionID ) { super( sessionID ); setDefaultEditingContext( new LockErrorScreamerEditingContext ); } ...  }


text:
User:Bmearns

wikipedia:User:Bmearns

title: User:Bmearns


text:
User talk:Mjkaye

Brazilian Portuguese duplication merge proposal
Hi there. Back in 2006 it looks like you did a bit of work on the Brazilian Portuguese lessons here: Portuguese/Contents/BPL1. Later on somebody created a separate Brazilian Portuguese wikibook, but left your set of lessons in place. I've started a discussion about how we can resolve this duplication: Talk:Portuguese/Contents. If you're still interested in this, let me know your thoughts.

-- Harry Wood (talk) 11:58, 14 January 2011 (UTC)

title: User talk:Mjkaye


text:
User:Wknight8111

I am a bot, operated by Whiteknight, capable of doing rapid page editing. If you would like my help with a large or tedious task, ask Whiteknight.

About Me
Here are a few facts about this user account:
 * I belong to User:Whiteknight as a pseudonym.
 * When I leave a message on somebody's talk page, I will sign that message with User:Whiteknight's name. To reply, talk to Whiteknight.
 * I am not a separate entity, but only a puppet account. Comments that I leave are indistinguishable from comments left by User:Whiteknight. I will probably not leave many comments.
 * This user page will be monitored for vandalism.
 * My user talk page will redirect to User talk:Whiteknight.
 * My operation is always semi-automated, and is directly controlled by User:Whiteknight. I do not operate independently at any time. If I malfunction, or if I appear to be operating in error, contact Whiteknight immediately.

title: User:Wknight8111


text:
User:Whiteknight/Bot

This page is about the various automated and semi-automated tools that I create for use with Wikibooks. This is not to be confused with my Book Creator gadgets, which are semi-automated javascripts. My bot scripts are all written in Perl.

Projects
This is a list of projects that I am working on, will be working on, or have basically already completed. These are all automated or semi-automated tools for creating, editing, or analyzing books and pages on Wikibooks.

 * Book designer gadget
 * Print version gadget
 * Book categorizer gadget
 * Page Transformer
 * User:Whiteknight/WEP

Current Status
Bot is in good working order.

Requesting Help
To request help from my bot, especially if you know perl, use the User:Whiteknight/BotTask template on my user talk page as follows:

{{subst:User:Whiteknight |init= |transform= |basepage= |pagelist= |summary= |getmode= |}

Where:
 * init=:This is code that gets run before any page transformations are performed
 * transform=: This is code that is applied to every page
 * basepage=:This is the "main page" of a book, such as the book's TOC
 * pagelist=:A page or a list of pages, separated by a comma.
 * summary=:The edit summary to use
 * getmode=:The mode to use. Use "NONE" for no special get mode. Use "BOOK" to load the page list from the basepage (such as a book TOC). Other modes will be available eventually.

I double-check all requests before they get performed. Also, if you don't know exactly what to put for init= or transform=, write a plain-english description and I will try to translate it for you.

WBRegex Page Processor
This is the primary tool in my bot arsenal. The page processor is a script that allows the user to apply an arbitrary amount of perl code to the text on a page. It uses the Wikitargets.pm module to specify a list of pages, and the Wikisession module to apply a transformation function to each page in the list. Each transformation has access to the previous and the next page in the list (for navigation templates).

Common tasks can be saved as "filters". Filters are sets of perl code that takes current wikitext in, and output a transformed version of that text for uploading. Filters can be loaded into the page processor, or they can be used as stand-alone programs to modify one page at a time.

Because the page processor can execute an arbitrary amount of code on a per-page basis, various graphical widgets, or user-interfaces can be defined. Also, the code is able to add new pages to the list, or to modify the code to be executed on future pages in the list. Some common tasks for the processor are:

 * 1) Adding or removing templates, categories, or links.
 * 2) performing pattern-matching substitutions
 * 3) Creating new pages from a template or model
 * 4) Examining the text of a page to make decisions based on existing content.

This program cannot move pages, delete pages, protect pages, or various other tasks. It operates solely on the text of the page.

Note: Availability
The code of my libraries and my WBRegex page processor are not currently freely available.

Framework Reference
This is going to serve as a reference to my framework, that will show some of the things that it can do currently, and give some kind of idea what will be done in the future.

Wikisession.pm
This is the "core" module of my framework, and is the central point which all other modules rely on. Wikisession.pm exports a class (Wikisession) that is an extension of the LWP::UserAgent class. This module maintains session data so that the user can login to the wikimedia server with a supplied username and password. All edits made by the library instance will then be attributed to that username.

This module exports a number of methods, of which the most important are:

 * new:This function takes a hash of values, such as "Username", "Password", "Server", etc, and returns a reference to a session object.
 * Login, Logout: These functions log in to wikibooks, and log out of it, using the supplied HTML::Cookiejar object for storing the session information. If no cookiejar is stored, the login information will be stored in a temporary location.
 * GetPageText, GetSectionText: These functions return the wikitext of a page or a particular section on a page.
 * PostPageText, PostSectionText, PostNewSection:These functions post text to the page. The first function deletes all previous text on the page, and replaces it with the supplied text. The second function does the same thing, but only in a specific section. The third function posts a new section to the page, with supplied header and text.
 * ProcessPageText, ProcessSectionText:These are the heart and soul of the module. Both of these functions take, as one of the parameters, a function reference. The passed function reference is called on the current text of the page, and the new text is posted to the page. In essence, if we have our processing function "my_function", the two following peices of code are nearly identical:

$session->ProcessWikiPageText("User:Whiteknight/bottest", "my summary", \&my_function);

and

my $text = $session->GetWikiText("User:Whiteknight/bottest"); my $newtext = my_function($text); $session->PostPageText("User:Whiteknight/bottest", $newtext, "my summary");

They are identical in function except that the second piece of code makes an extra HTTP request to the server, and creates a lot more overhead. Any additional parameters that are passed to ProcessPageText are passed directly to the subroutine. The "complete" C-style function prototype of the function is:

ProcessWikiPageText($page, $summary, \&func, @args);

and if "$text" is the complete text from "$page", then \&func is called internally as follows:

$func->($text, @args);

So the processing functions can have any number of additional arguments, in any format, so long as the first argument is a peice of text (which can easily be disregarded, for instance).

None of the editing functions in this module explicitly account for edit conflicts. Instead, they fail silently. I may add functionality to change this in the future.

Wikihandle.pm
The Wikihandle perl module creates a tied filehandle class that can be used for regular file-style I/O with the server. For instance:

use Wikisession.pm; use Wikihandle.pm; tie(*WIKI, "Wikihandle", $session); open WIKI, "User:Whiteknight/bottest"; @text = ; print @text; print WIKI "This is going to be the new page text!!!\n"; close WIKI;

This module is nearly at a good place, but there are a few issues that are worth considering: Only a few of the functions are implemented: READLINE, PRINT, PRINTF, OPEN, and CLOSE. The other functions either havne't been implemented, or make no sense in this context. This module does allow for ">", "<", or ">>" modifiers, to make the page readable, writable, or appendable. No other modes are allowed.

Wikitarget.pm
This module is used to generate a list of various pages on wiki. The pages can be added manually, or they can be uploaded from a TOC page. They cannot currently be loaded from an automatically-generated page list such as Special:Prefixindex, DPL, Whatlinkshere, or categories.

title: User:Whiteknight/Bot


text:
Web Programming in Visual Basic .NET

Web Browsing functionality is available in the .Net Framework Class Library. In this article we will look at techniques for loading and manipulating web pages using Visual Basic .Net. You will need Microsoft Visual Basic .Net 2005 to use the example code.

The Web Browser Object
Let's look at the Web Browser Object. This object is present in the .NET Framework Class Library. It is new to the framework in version 2.0. If you distribute a program that uses the object, the target system must have version 2.0 (or greater) installed.

The WebBrowser object does not require a form. You can use it to load web pages programmatically without displaying them. However, your program is subject to the configuration settings that you have set for your traditional browser. For example, if you are allowing popups, then any web page that you load into the wbInCode object will have permission to launch popups. The popups will launch in browser windows that are external to your program, even if your WebBrowser object is not displaying in a window.

If a JavaScript method crashes on a loaded page and your are configured to halt on such errors, the web browser control will also halt. Your program will hang. In short, if you plan to use the control in an automated environment you will need to take a close look at your default browser settings. Otherwise you will find that your application has been held up by defective web pages and your display has been inundated with popups.

Load a WebPage into the Browser Object
Use the Navigate method of the WebBrowser object to load a web page:

Wait until the load operation is finished:

You can also have the object tell you when it's finished. The DocumentCompleted event fires after a page has loaded. This example adds an event handler method that will be called when the page has finished loading.

Print a Web Page from the Browser Object
We’re not done yet. Here is the ReadyToPrint method that we referred to in the previous code. The name of the method is arbitrary but the argument list is necessary. Note that you don't have to explicitly call this method. It will be called for you by the WebBrowser object after the web page has loaded.

Access the HTML Stored in the Browser Object
After you have loaded your web site you have access to the underlying HTML. The document object is a property of the web browser object.

title: Web Programming in Visual Basic .NET


text:
Reverse Engineering/Terminology

"Hackers"
Hacking is a term used in popular culture to describe malicious activities of computer users. The movie Hackers was a large influence on bringing the term into common use by romanticising the Hacker as an idealistic youth seeking freedom from tyranny.

There are some fantastic books that help to explain what a real hacker is like:

 * Hackers, by Steven Levy
 * The Devouring Fungus, by Karla Jennings
 * Free as in Freedom, by Sam Williams
 * Just for Fun, by Linus Torvalds
 * The Cathedral and the Bazaar, by Eric Raymond
 * Code Book, by Simon Singh
 * In The Beginning... Was The Command Line, by Neal Stephenson
 * the cluetrain manifesto, by Rick Levine, Christopher Locke, Doc Searls, David Weinberger

This wikibook hopes to shed some light on what hackers really do, and who they actually are.

Hackers are people who enjoy playing around with computers to make things happen. This often involves circumventing some security aspects of operating systems or applications in order to gain privileged access.

The first chapter is one of the most important chapters to read. Here the term Hacking is defined, revealing some insight into what hacking really is.

The second covers the history of computing and hackers. This might help correct the false impressions propagated by news media.

The 'hacking-culture' follows up next and 'finally' the real thing is assessed. (Note: These methods are illegal if used wrongly, yet the method to prevent or 'cure' this 'attack' is given as well to remain as objective as possible).

I would appreciate it if anyone posts stuff which will help the world to deal with security issues and how to 'deal' with hackers (mostly crackers and scriptkiddies).

The Jargon File or New Hackers dictionary defines the term hacker quite nicely. It also does an exceptional job of pointing out that one does not need to be affiliated with computers at all to be considered a hacker.

The excerpt from The Jargon File: hacker: n. [originally, someone who makes furniture with an axe] 1. A person who enjoys exploring the details of programmable systems and how to stretch their capabilities, as opposed to most users, who prefer to learn only the minimum necessary. RFC1392, the Internet Users' Glossary, usefully amplifies this as: A person who delights in  having an intimate understanding of the internal workings of a system, computers and computer networks in particular. 2. One who programs enthusiastically (even obsessively) or who enjoys programming rather than just theorizing about programming. 3. A person capable of appreciating hack value. 4. A person who is good at programming quickly. 5. An expert at a particular program, or one who frequently does work using it or on it; as in ?a Unix hacker?. (Definitions 1 through 5 are  correlated, and people who fit them congregate.) 6. An expert or enthusiast of any kind. One might be an astronomy hacker, for example. 7. One who enjoys the intellectual challenge of creatively overcoming or  circumventing limitations. 8. [deprecated] A malicious meddler who tries to discover sensitive information by poking around. Hence password hacker, network hacker. The correct term for this sense is cracker.

Maybe it is helpful to note that the people that program the Linux kernel are called "Linux hackers".

A brief History of Hackers
As long as there have been computers, people were there to 'hack' them. But this activity really hit the headlines when the Internet arrived. Yet history teaches us that this event wasn't an evil thing at all, hackers actually 'maintain' the Internet as it should be. It is unimaginable for the computer/Internet society to grow so large without people who were at the cutting edge of technology (hacking internet it's way up). Just imagine how it would be if there weren't any hackers... Most technology you use today would not exist. Ask yourself: Would your computer be this powerful if it wasn't put to the edge? Would software be as reliable as it looks? Would there be a spiral of cutting-edge innovations?

You can answer all these questions with no. It might seem strange to think positively of hackers, but know that much is done on the edge of society (mostly not in the middle).

The Hacker-Culture
Advanced computer users describe themselves as hackers; those who use their skills for malevolent purposes are termed "crackers". The term crackersimplies breaking things, in the sense of cracking the integrity of a computer system; and they work through cracks in security, like climbing through a crack in a wall; but their main act is breaking into computers for example by figuring out the root password, which is like cracking a safe at a bank. This means that crackers break the law, yet this isn't enough to get indepth information about the hacker-culture.

In this chapter the main hacker-personalities will be described. In a rather unusual way: the media is used to get to know the real group. This means that you'll be able to understand that some of the people certainly not worth the name hacker.

Terminology
Hack is an onomatopoeic verb describing the noise and actions of chopping at something with a blade (i.e.: He hacked away at the underbrush with a machete), or a particularly nasty cough (i.e.: The chainsmoker hacked up some brown phlegm), but which also came to describe the act of typing on a typewriter, for the same reason (the annoying, incessant HACK HACK HACK, Ding! CRASH! HACK HACK HACK, &c).

From there it became associated not only with the action itself, but also those doing the typing. For example, a "hack"--a bad writer/journalist--would "hack out" a poorly researched or unoriginal story on his typewriter. While the less noisy tapping of computer keyboards began to replace the harsh noise of the typewriter, the old terminology was carried over to the new technology. Thus, the original "hackers," (long before the PC or word processors) were merely called that because they would spend their days "hacking away" at their console keyboards, writing code.

Note: It's worth noting that, when computing was in its infancy and console time at the giant mainframes was scarce, programmers would often hand-write code or type it out on typewriters before they manually plugged it into the machine. Also, the earliest consoles were basically automated typewriters.)

Nowadays, a hacker is, within the software development community, any skilled programmer, especially among open-source developers. A hack in turn, is a quick-and-dirty patch, fix, or utility which may not be well documented or necessarily reliable, but which gets the job done, whatever that job may be.

Crackers are skilled programmers who exploit the limitations of computer networks, and write up cracks--malicious hacks--to automate the dirty work. These hacks/cracks may attempt to break into remote machines e.g. He hacked into the school's server to increase his phys-ed grade., crack passwords (the most useful utility for this is simply called Crack), decrypt data, or simply modify proprietary software so the cracker doesn't have to pay for it e.g. He downloaded a cracked version of Dreamweaver, because he couldn't afford to buy it..

Viruses, trojans, and worms are also hacks/cracks of a sort. Crackers are especially fond of worms, which spread without user interaction and can be used to create giant, distributed supercomputers that can then be used to attack other computers (the Code Red worm used the combined power of infected computers to flood the White House web server, making it inaccessible to regular users for a time).

When a hacker finds a security hole in the software they're using, they hack out some code to patch it. When a cracker finds a hole, they hack out code to exploit it, ideally bringing remote computers under their control.

Script-kiddies use hacks and cracks created by real programmers, but they use their software without really understanding the code that's doing the work. They are generally trying to just impress their friends.

As indicated above, not all hacks are "malware" (malicious code). User-created shell scripts and batch files that automate tasks (like workstation startup, permission settings, data backup, &c.) are hacks too. Hacks are tools. They are hacked out to make someone's life easier, but not necessarily yours.

TV news and, of course, the movie "Hackers" brought the label hacker to the attention of the wider public, but failed to acknowledge its broader meaning, instead using it as a buzzword, so as not to confuse the less informed members of their audience ("Computer programs are written by people? Like books? I thought other computers made them!").

Others have latched on to the grit, glamour, and rebellion the buzzword hacker invokes; thus, they think of hacking as something of a religion. But, in short, it's nothing more than playing around with computer code. You don't even need to be connected to the internet to do some hacking, just learn a programming language.

title: Reverse Engineering/Terminology


text:
User:Msikma~enwikibooks

This is the Wikibooks account of Msikma. See also: en:User:Msikma, nl:Gebruiker:Michiel Sikma, fr:Utilisateur:Michiel Sikma.

title: User:Msikma~enwikibooks


text:
User talk:Bakery2k

Hello, and welcome to wikibooks. I see the work that you are doing at X86 Assembly, and I wanted to personally thank you. I've been trying to fix that book up in my spare time, but I can always use more help. Thanks again, and if you need anything, let me know. --Whiteknight (talk) (projects) 16:01, 16 May 2006 (UTC)

title: User talk:Bakery2k


text:
Wikijunior talk:South America/Glossary

h

title: Wikijunior talk:South America/Glossary


text:
User:Jacnoc/Desk

Any projects that I have previously worked on (and/or finished) and works that I am currently working on, are listed on this page.

--Jacnoc 16:48, 16 May 2006 (UTC)

Jacnoc (Desk)

title: User:Jacnoc/Desk


text:
BLL German/A1

Overview
This level is intended for the absolute beginner and it will lead you up to a basic command of the language, such as defined as level A1 in the Common European Framework of Reference for Languages. This will allow you to succeed in the following standard language tests:
 * Europäisches Sprachenzertifikat: Deutsch A1
 * Fit in Deutsch 1
 * Start 1

Table of contents

 * /Pronunciation/
 * Lesson 1: Introducing yourself
 * Lesson 2: Asking about others
 * Lesson 3: Asking for the way
 * Lesson 4: Voicing your opinion
 * Lesson 5: Talking about the weather
 * Lesson 6: Meeting new people
 * More lessons to follow...

title: BLL German/A1


text:
File talk:RevEngMSArch.JPG

This diagram is incorrect. NTDLL is a user-mode DLL, not a kernel-mode module.

title: File talk:RevEngMSArch.JPG


text:
User talk:Sspoede

Hi sven,

jgerhard hat doch n bissel was gemacht. Ich weigere mich aber noch aus eigenem Antrieb die 100% einzuschalten.

HF, --Aschoeke 02:20, 20 August 2006 (UTC)

I would encourage you, that if you write on another user page, to do that at least in english ;p

--Aschoeke ( talk ) 09:41, 29 August 2006 (UTC)

Actually, I had to show the same to Hibar and Anna... Humans... wäääh ;)

--Aschoeke ( talk ) 10:02, 29 August 2006 (UTC)

Image copyright problem with Image:ImmersedExp.jpg
Thanks for uploading Image:ImmersedExp.jpg. However, the image may soon be deleted unless we can determine the copyright holder and copyright status. The Wikimedia Foundation is very careful about the images included in Wikibooks because of copyright law (see Wikibooks' Copyright policy).

The copyright holder is usually the creator, the creator's employer, or the last person who was transferred ownership rights. Copyright information on images is signified using copyright templates. The three basic license types on Wikibooks are open content, public domain, and fair use. Find the appropriate template in Image copyright tags and place it on the image page like this:.

Please signify the copyright information on any other images you have uploaded or will upload. Remember that images without this important information or giving false information can be deleted by an administrator. If you have any questions, feel free to contact me, or ask them at the Study help desk. Thank you. Derbeth talk 17:31, 30 August 2006 (UTC)

title: User talk:Sspoede


text:
Suomen kieli käyttöön/kihlaus

Kihlaus
Tarinassa esiintyy neljä ihmistä. Aapeli on kraatari eli räätäli. Hän on naimaton eikä enää nuori. Aapeli asuu omassa mökissään ja tekee vaatteita ihmisille.

Eenokki on toinen kraatari, Aapelin ystävä ja myöskin vanhapoika.

Jooseppi on nuori mies, Aapelin oppipoika. Aapeli opettaa hänelle räätälin ammattia. Oppipojan täytyy totella ja kunnioittaa mestariaan ja myös Aapelia.

Eeva on tarinan nainen. Hän on kotoisin samasta kylästä, mutta lähtenyt sieltä Helsinkiin töihin. Eeva oli palvelijana hienossa perheessä. Nyt hän asuu lähitienoilla kahden naimattoman herran luona. Se ei ole kaikkien mielestä sopivaa, ja kylällä juorutaan kaikenlaista. Eeva hoitaa herrojen taloutta. Häntä sanotaan herrojen Eevaksi.

Tapahtumapaikka on Aapelin tupa. Henkilöt puhuvat myös asioista, jotka ovat sattuneet muualla. Aapeli ja Eeva tulevat sisään. Molemmat kantavat kädessään nyyttiä. Jooseppi jatkaa padan hämmentämistä, mutta kumartaa syvään.

Eenokki: Tervetuloa, morsiuskunta!

Aapeli: Me kiitämme sinua, Eenokki. Sinä olet tässä juuri tarpeellinen. Onko Jooseppi kertonut sinulle jotakin?

Eenokki: Lyhyesti.

Aapeli: Onhan minulla nyt edes se, joka paitani pesee. - Istu, istu, Eeva.

'''Eeva (miettii itsekseen): Tämmöinen tupa! Huuhkaimen pesä.'''

Aapeli ottaa nyytistä sokeriastian ja asettaa sen pöydälle. Aapeli: Sokeriastia on kuitenkin ehjä. Tiedä, Eenokki, että olemme pyörineet kamalassa leikissä, minä ja Eeva. Oi niitä jumalattomia herroja!

Eenokki: He kai kohtelivat sinua kopeasti?

Aapeli: Kiitän, etten saanut heiltä selkääni.

Eenokki: Kateus, kateus!

Aapeli: Sula kateus. En päässyt edes sisään. Seisoin pihalla ja otin vastaan Eevan tavaroita. Mutta kun olimme valmiit lähtemään ja istuimme rattaille, niin arvaas, mitä tekivät?

Eenokki: Häijyn koiranjuonen, arvaan sen.

Aapeli: Tuli pieni poika, herrojen käskystä, ja sanoi että korjaa hevosen häntävyötä. Mutta se peijakas pisti palavan taulankappaleen Ruskon hännän alle. Samalla yksi herroista ampui meille jäähyväislaukauksen pilkallaan. Rakas virkaveljeni, ajattelepas, millä hirmuisella vauhdilla me lähdimme. Rusko juoksi kuin vimmattu, potki ja juoksi. Oliko ihme, että Eeva ja minä huusimme täyttä kurkkua hädissämme?

Eenokki: Ei mikään ihme. Mutta se on ihme, että seisot vielä tässä ja kertoilet retkestäsi. Kiitä, ettet makaa ojassa tallukat taivasta päin.

Aapeli: Onni suojeli minua. Taulanpala irtosi viimein, ja vähitellen Rusko hiljensi juoksuansa. Istuimme yhä rattailla luut ehjinä, vaikka sydän pamppaili.

Eenokki: Voi julmia herroja, voi julmettuneita!

Aapeli: Sanos muuta. Ihmettelenpä, että Eeva on näin kauan sietänyt heitä. Ettet jo ennen ole tehnyt tätä temppua, Eeva? Eeva kääntyy poispäin ja puhuu itsekseen.

Eeva: Jaa, sinä västäräkki! Suokoon jumala, etten koskaan olisi tätä tehnyt. Mikä hulluus minulta jättää herrat ja tulla tänne turvekaton alle!

Aapeli: Mutta miksi morsian on niin äänetön?

Eenokki: Tavallinen morsiamen alakuloisuus, kun hän muuttaa miehelään.

title: Suomen kieli käyttöön/kihlaus


text:
Suomen kieli käyttöön/Suot

Original Finnish text
Suot

Suomen pinta-alasta peräti kolmasosa on alun perin suota. Suo onkin hyvin tyypillinen ja ominainen asia Suomen luonnossa. Monille ulkomaalaisille suoperäinen maasto saattaa olla ainutlaatuinen kokemus. Suon synty on myös ainutlaatuista. Suot eivät kasva samalla lailla kuin metsät. Suo kerrostuu pikkuhiljaa eli muodostaa itse oman kasvualustansa.

Suot kuuluvat omalta osaltaan suomalaisen luonnon monimuotoisuuteen. Suolla elää monia eläinlajeja ja kasvaa monia kasvilajeja, jotka eivät viihdy muualla. Suon suojelu on tärkeää pelkästään näiden lajien säilymisen kannalta.

Marjoja ja turvetta

Vaikka suot ovat usein aika karuja paikkoja, niillä kasvaa monia erityisiä kasvilajeja. Suolla käydään poimimassa hilloja eli suomuuraimia ja karpaloita. Soilla kasvaa myös rahkasammalta. Linnuista soilla viihtyvät erityisesti kurjet, suokukot ja muuttohaukat. Soista saadaan myös turvetta. Turvetta käytetään maataloudessa ja teollisuudessa.

Translation
Suot
 * Swamps (Literal word-by-word translation in italics)
 * Swamplands

'''Suomen pinta-alasta peräti kolmasosa on alun perin suota. '''
 * As much as one third of the surface area of Finland was originally swamp land.
 * Suomen pinta-alasta of the Finnish surface area
 * Pinta-ala Surface area (the hyphen separates the word pinta surface and ala area in order to prevent a long aa in the new word)
 * Pinta-alasta of the surface area (elative)
 * peräti even, as much as (adverb)
 * kolmasosa  one third part (nom)
 * kolmas third osa part
 * alun perin (adverb) (or alunperin) from the very beginning
 * on is (verb) -note that this is an existential statement and verb is in the present tense
 * suota (part.) suo swamp

'''Suo onkin hyvin tyypillinen ja ominainen asia Suomen luonnossa. '''
 * Swampland is-indeed very typical and characteristic thing in Finnish nature
 * Swamplands are very characteristic of Finnish nature.

'''Monille ulkomaalaisille suoperäinen maasto saattaa olla ainutlaatuinen kokemus. '''
 * To many foreigners swamp-based terrain can be a unique experience.

'''Suon synty on myös ainutlaatuista. Suot eivät kasva samalla lailla kuin metsät. '''
 * Swamp's formation is also unique. Swamps don't grow same way as forests.
 * The formation of swampland is also unique. Swamp doesn't grow like forest.

'''Suo kerrostuu pikkuhiljaa eli muodostaa itse oman kasvualustansa. '''
 * Swamp layers slowly, in other words, generates itself its own growth base.
 * Swamplands are formed over very long periods of time, layer by layer. That way swamp slowly re-generates the base the plants grow on.

'''Suot kuuluvat omalta osaltaan suomalaisen luonnon monimuotoisuuteen. '''
 * Swamps belong in their own part to Finnish nature's multiplicity.

'''Suolla elää monia eläinlajeja ja kasvaa monia kasvilajeja, jotka eivät viihdy muualla. '''
 * On swamp live many animal species and grow many plant varieties, that will not thrive anywhere else.
 * Many swampland plants and animals can't live anywhere else.

'''Suon suojelu on tärkeää pelkästään näiden lajien säilymisen kannalta. '''
 * Swamp's protection is important just (from) these species' preservation's standpoint.
 * Protecting swamplands is already important just for preserving these species.

Marjoja ja turvetta
 * Berries and peat

Vaikka suot ovat usein aika karuja paikkoja, niillä kasvaa monia erityisiä kasvilajeja.
 * Though swamps are often pretty barren places, they grow many special plant-species.

Suolla käydään poimimassa hilloja eli suomuuraimia ja karpaloita.
 * On swamp (people) visit to gather cloudberries a.k.a. cloudberries and cranberries.
 * People go to swamplands to gather cloudberries and cranberries
 * Cloudberry (Rubus chamaemorus) has (at least) three equally official names in Finnish: lakka, hilla and suomuurain, originally used in different dialects. See Finnish Wikipedia article for more information.

Soilla kasvaa myös rahkasammalta.
 * Swamps grow also sphagnum (moss).

Linnuista soilla viihtyvät erityisesti kurjet, suokukot ja muuttohaukat.
 * Of birds, on swamps thrive especially cranes, ruffs, and hawks.
 * Cranes, ruffs, and hawks are bird species particular to swamplands.

Soista saadaan myös turvetta.
 * From-within swamps (people) gather also peat.
 * Swamps are additionally a source of peat.

Turvetta käytetään maataloudessa ja teollisuudessa.
 * Peat is used in agriculture and in industry.

title: Suomen kieli käyttöön/Suot


text:
Suomen kieli käyttöön/Rajalla

Finnish Text
Suomen ja Venäjän rajalla on paljon jonoja. Jonojen syy on uusi autositoumusmaksu. Venäjän tulli alkoi torstaina ottaa Kaakkois-Suomen rajanylityspaikoilla 100 ruplaa eli noin kolme euroa autositoumusmaksua. Tulli sanoo, että venäjän verohallinto haluaa maksun. Maksu koskee kaikkia, jotka eivät ole Venäjän kansalaisia. Venäjän rajanylityspaikoilla on jonoja, koska ajoneuvomaksun maksaminen kestää jokaisen auton kohdalla 15 - 30 minuuttia. Jonoja on syntynyt molemmilla puolilla rajaa. Suomen puolella jono on pitkä Imatralla. Vaalimaan raja-asemalla Venäjän puolella autot jonottavat Suomeen pääsyä 6 - 8 tuntia. Autositoumusmaksu täytyy maksaa henkilö- ja linja-autoista. Yhdellä autositoumusmaksulla saa ajaa auton Venäjälle ja takaisin Suomeen yhden kerran. Autositoumusmaksun tarkoitus on, että auto tulee Venäjältä takaisin Suomeen.

title: Suomen kieli käyttöön/Rajalla


text:
Io Programming/Binding Io to C++

The following code example shows a simple class bound to Io. The binding was tested to work, but it may not be fully correct.

The IoBindingTest class only stores a number, with the usual setter and getter accessors. Also, two instances of the class can be compared to each other. The class has the regular constructor, as well as a copy constructor, and a constructor that takes a number. The copy constructor is used in the binding when creating a clone.

// begin test class

class IoBindingTest;

class IoBindingTest { public: IoBindingTest : num(0) {}; IoBindingTest(int n) : num(n) {}; IoBindingTest(IoBindingTest* ptr) : num(ptr->num) {}; ~IoBindingTest {}; int GetNum(void) { return num; }; void SetNum(int n) { num = n; }; bool CompareWith(IoBindingTest* obj) { return num == obj->num; };

private: int num; };

// end test class

The binding class creates a bunch of static class functions, which can be accessed from C code, such as Io's VM, for using the test class' similarly named instance methods. Also, the binding class has methods specific to the Io VM (proto, tag, rawClone, mark, free), and a final function to add the binding to the VM at runtime.

 * 1) include "IoVM.h"

class IoBindingTest_io { public: static IoObject* GetNum(IoObject *self, IoObject *locals, IoMessage *m); static IoObject* SetNum(IoObject *self, IoObject *locals, IoMessage *m);

static IoObject* CompareWith(IoObject *self, IoObject *locals, IoMessage *m);

static IoObject* proto(IoState* state); static IoTag* tag(IoState* state, const char* name);

static IoObject* rawClone(IoObject* self); static IoObject* mark(IoObject* self); static IoObject* free(IoObject* self); static void addBinding(IoState* state);

};

IoTag *IoBindingTest_io::tag(IoState* state, const char* name) { IoTag* tag = IoTag_newWithName_(name); tag->state = state; tag->cloneFunc = (TagCloneFunc*) rawClone; tag->markFunc = (TagMarkFunc*) mark; tag->freeFunc = (TagFreeFunc*) free;

return tag; }

The  function is used for creating the initial prototype in the Io VM.

IoObject *IoBindingTest_io::proto(IoState* state) { IoMethodTable methods[] = { {"GetNum", GetNum}, {"SetNum", SetNum}, {"CompareWith", CompareWith}, {NULL, NULL} }; IoObject* self = IoObject_new(state); self->tag = tag(state, "IoBindingTest"); self->data = 0; IoObject_addMethodTable_(self, methods); return self; }

The  function is used to put the prototype of our object into the Io VM at runtime.

void IoBindingTest_io::addBinding(IoState* state) { IoObject* self = proto(state); IoState_registerProtoWithFunc_(state, self, (IoStateProtoFunc*)proto); IoObject_setSlot_to_(state->lobby, IOSYMBOL("IoBindingTest"), self); }

IoObject *IoBindingTest_io::rawClone(IoObject *self) { IoObject *clone = IoObject_rawClonePrimitive(self); if (self->data) clone->data = new IoBindingTest(reinterpret_cast(self->data)); else clone->data = new IoBindingTest; return clone; }

The  function is used by the garbage collector. If the C++ object has references to other objects in the Io VM, they must also be marked.

IoObject *IoBindingTest_io::mark(IoObject *self) { return self; }

is pretty self-explanatory, this is where the C++ object should be freed/deleted, if appropriate.

IoObject *IoBindingTest_io::free(IoObject *self) { if (self->data) { IoBindingTest* obj = reinterpret_cast(self->data); delete obj; self->data = NULL; } return self; }

The following three functions are the actual bindings of the instance methods, so that they can be called from a script.

IoObject* IoBindingTest_io::GetNum(IoObject *self, IoObject *locals, IoMessage *m) { IOASSERT(self->data, "No C++ object"); IoBindingTest* obj = reinterpret_cast(self->data);

return IoNumber_newWithDouble_(self->state, obj->GetNum);

};

IoObject* IoBindingTest_io::SetNum(IoObject *self, IoObject *locals, IoMessage *m) { IOASSERT(self->data, "No C++ object"); IoBindingTest* obj = reinterpret_cast(self->data);

IOASSERT(IoMessage_argCount(m) == 1, "Wrong number of arguments"); IoObject *arg1 = IoMessage_locals_numberArgAt_(m, locals, 0);

obj->SetNum(IoNumber_asInt(arg1));

return self;

};

IoObject* IoBindingTest_io::CompareWith(IoObject *self, IoObject *locals, IoMessage *m) { IOASSERT(self->data, "No C++ object"); IoBindingTest* obj = reinterpret_cast(self->data);

IOASSERT(IoMessage_argCount(m) == 1, "Wrong number of arguments"); IoObject *arg1 = IoMessage_locals_valueArgAt_(m, locals, 0);

// make sure the object is tagged IOASSERT(arg1->tag, "No tag in arg");

// check the tag to make sure it is the right object class IOASSERT(strcmp(arg1->tag->name, "IoBindingTest") == 0, "arg not IoBindingTest object");

// check for the actual existence of the C++ object IOASSERT(arg1->data, "No C++ object in arg");

IoBindingTest* arg1obj = reinterpret_cast(arg1->data);

// bool is simulated by returning self or nil if (obj->CompareWith(arg1obj)) return self; else return IONIL(self); };

title: Io Programming/Binding Io to C++


text:
Suomen kieli käyttöön/Koti Suomessa

Koti Suomessa

Oikeus sosiaaliturvaan

Maahanmuuttaja tarkoittaa pakolaista, siirtolaista, paluumuuttajaa ja muita ulkomaalaisia. Maahanmuuttaja saa palveluita ja sosiaalietuuksia, jotka helpottavat elämää uudessa kotimaassa. Tavoite on, että palvelut auttavat maahanmuuttajaa sopeutumaan Suomeen. Maahanmuuttajalla on oikeuksia ja velvollisuuksia, kun hän asuu Suomessa. Ne vaihtelevat sen mukaan, muuttaako hän Suomeen Euroopan Unionin alueelta vai Euroopan talousalueelta vai jostakin muusta maasta.

Maahanmuuttajalla on oikeus sosiaaliturvaan, jos hän aikoo jäädä Suomeen vakinaisesti asumaan ja jos hänellä on lisäksi vähintään yhden vuoden oleskelulupa. Suomeen muuttoa pidetään vakinaisena eli pysyvänä, jos henkilö muuttaa Suomeen, koska hän on:

- paluumuuttaja

- pakolainen

- turvapaikanhakija

ja hänelle on myönnetty oleskelulupa vähintään yhdeksi vuodeksi.

Asuminen on vakinaista myös silloin, kun henkilö muuttaa perhesyistä. Asuminen on vakinaista myös, kun maahanmuuttajalla on vakinainen työpaikka tai vähintään kahden vuoden työsuhde. Maahanmuuttajan pitää myös todella asua Suomessa, jotta hän saisi sosiaalietuudet. Viranomaiset katsovat, että henkilö ei asu maassa vakinaisesti, jos hän tulee Suomeen lyhyeksi ajaksi. Jos henkilö tulee Suomeen pelkästään opiskelemaan, hän ei myöskään ole oikeutettu Kelan hoitamaan sosiaaliturvaan.

Kotoutumissuunnitelma

Kotoutuminen tarkoittaa sitä, että maahanmuuttaja oppii uusia asioita ja taitoja uudessa kotimaassa Suomessa. Hänen täytyy oppia suomen kieltä. Hänen täytyy myös tuntea suomalainen yhteiskunta ja suomalaiset tavat. Kun hän osaa nämä taidot, hän voi olla mukana työelämässä ja yhteiskunnassa niin kuin muutkin suomalaiset.

Suomessa on voimassa kotoutumislaki (laki tuli voimaan 1.5.1999). Kun ihminen muuttaa Suomeen, hän voi tehdä kotoutumissuunnitelman yhdessä oman kotikunnan ja työvoimatoimiston kanssa. Kotoutumissuunnitelmassa sovitaan, miten maahanmuuttaja opiskelee suomea tai ruotsia ja tutustuu Suomen yhteiskuntaan. Kotoutumissuunnitelma tehdään yleensä kolmen vuoden ajaksi. Lisätietoa kotoutumissuunnitelmasta saat Internet-osoitteesta www.mol.fi.

title: Suomen kieli käyttöön/Koti Suomessa


text:
Suomen kieli käyttöön/Terveydenhuolto

Terveydenhuolto

Terveyskeskukset

Jokaisessa kunnassa ja kaupungissa on terveyskeskus. Siellä huolehditaan kunnan asukkaiden terveydestä. Jos sairastut, voit saada terveyskeskuksesta ajan lääkärille. Ota selvää, minkä terveyskeskuksen asiakas sinä olet. Tavallisesti se on kotia lähinnä oleva terveyskeskus.

Lääkärissä käynnistä maksetaan eri kunnissa eri tavalla. Joissakin kunnissa on käytössä vuosimaksu. Silloin terveyskeskusmaksu maksetaan kerran vuodessa. Joissakin kunnissa on käytössä kertamaksu. Silloin asiakas maksaa kertamaksun kolmelta ensimmäiseltä lääkärissä käynniltä vuodessa.

Alle 15-vuotiaille terveyskeskuksen palvelut ovat ilmaisia.

Terveyskeskuksessa voi käydä myös terveydenhoitajan vastaanotolla. Se on ilmaista kaikille. Terveyskeskuslääkärin vastaanotolle täytyy varata etukäteen aika. Vain erittäin kiireellisissä tapauksissa vastaanotolle voi mennä ilman ajanvarausta. Jos hoito tai tutkimukset eivät ole kiireellisiä, niihin pitäisi päästä kolmen päivän kuluessa. Jotkut terveyskeskukset ovat auki myös iltaisin ja viikonloppuisin kiireellisiä tapauksia varten.

Terveyskeskuksesta saa myös hammaslääkärin palvelut. Kaikkien aikuisten hampaita ei kuitenkaan pystytä hoitamaan, ainakaan suurissa kaupungeissa. Kelasta voi hakea korvausta, jos käy yksityisellä hammaslääkärillä.

Äitiysneuvolat

Terveyskeskuksissa on äitiysneuvoloita ja lastenneuvoloita. Äitiysneuvolassa seurataan odottavan äidin ja tulevan vauvan terveydentilaa koko raskauden ajan.

Neuvolaan kannattaa mennä ennen neljännen raskauskuukauden päättymistä, koska se on ehtona äitiysavustuksen saamiselle. Odottava äiti voi myös käydä yksityisen lääkärin vastaanotolla, mutta lähes kaikki odottavat äidit Suomessa käyttävät neuvolan palveluita.

Neuvola järjestää myös synnytysvalmennusta ja perhevalmennusta odottaville isille ja äideille. Suurin osa suomalaisista isistä osallistuu tähän valmennukseen. Suomessa naiset synnyttävät tavallisesti sairaalassa. Yleensä isä on mukana synnytyksessä. Äitiysneuvolat järjestävät usein myös tutustumiskäyntejä synnytyssairaalaan. Äitiysneuvolan palveluista asiakkaan ei tarvitse maksaa.

Lastenneuvolat

Synnyttänyt äiti käy jälkitarkastuksessa vielä äitiysneuvolassa. Sen jälkeen lapsi ja perhe siirtyvät lastenneuvolan asiakkaiksi.

Neuvolassa seurataan lapsen terveyttä ja kehitystä ja autetaan perhettä monin tavoin. Neuvolassa lapsi saa myös ne rokotukset, jotka kuuluvat Suomen rokotusohjelmaan. Äiti tai isä tai molemmat yhdessä voivat viedä lapsen neuvolaan.

Lastenneuvolat järjestävät äideille ja isille ja koko perheille kursseja ja keskustelutilaisuuksia. Niissä perheet voivat tutustua toisiin perheisiin. Kursseilta saa asiantuntijan apua lapsen terveydenhoitoon ja kasvatukseen. Lastenneuvolan palveluista asiakkaan ei tarvitse maksaa.

Kouluterveydenhuolto

Kun lapsi menee kouluun, hän siirtyy lastenneuvolasta kouluterveydenhuollon asiakkaaksi. Kouluterveydenhoitaja on koulussa yleensä kaksi päivää viikossa, jolloin lapset voivat käydä hänen vastaanotollaan. Myös vanhemmat voivat ottaa yhteyttä kouluterveydenhoitajaan. Rokotusohjelma jatkuu koulussa. Kouluterveydenhoitaja tekee lapsille terveystarkastuksia. Koululääkäri tarkastaa lapset joskus. Jos lapsella on ongelmia, niistä voi kertoa kouluterveydenhoitajalla tai koululääkärille. Kouluterveydenhoitaja ja koululääkäri voivat ohjata lapsen esimerkiksi psykologin tai puheterapeutin hoitoon.

Koululaisten hampaat tarkastetaan ja hoidetaan terveyskeskuksessa. Kunnat järjestävät kouluterveydenhuoltoa peruskouluissa, ammatillisissa kouluissa ja lukioissa opiskeleville oppilaille. Korkeakoulujen opiskelijat käyvät Ylioppilaiden terveydenhoitosäätiössä. Kouluterveydenhuolto ja koululaisten hammashuolto ovat asiakkaalle maksuttomia.

Yksityinen terveydenhuolto

Suurilla paikkakunnilla on yksityisiä lääkäreitä ja hammaslääkäreitä. Suomessa on myös joitakin yksityissairaaloita. Yksityinen terveydenhoito on usein paljon kalliimpaa kuin terveyskeskusten tai julkisten sairaaloiden antama terveydenhoito. Kela korvaa osan yksityislääkäreiden ja yksityisten hammaslääkäreiden antaman hoidon hinnasta.

title: Suomen kieli käyttöön/Terveydenhuolto


text:
Suomen kieli käyttöön/rahankäytöopas

Rahankäytönopas

Jos et maksa laskuja tai velkaa

Laskut ja velat on aina maksettava ennemmin tai myöhemmin. Velat eivät noin vain katoa tai vanhene. Mitä myöhemmäksi maksamisen jättää, sitä kalliimmaksi se tulee. Velat vanhenevat kymmenessä vuodessa, jos luotonantaja ei peri velkaa. Mutta yleensä luotonantajat pitävät huolta siitä, että velat eivät vanhene. Se tarkoittaa, että velkaa ei saa anteeksi, vaan se pitää maksaa ja sen korot kasvavat koko ajan.

Maksujärjestelyt

Joskus voit joutua tilanteeseen, jossa et pystykään maksamaan velkaasi. Ota silloin heti yhteys pankkiin tai siihen yritykseen, josta olet lainan saanut. Voit yrittää sopia uuden aikataulun, jossa maksat velan hitaammin. Usein sopiminen onnistuu, jos rahapula on tilapäinen.

Perintä

Jos et maksa laskua eräpäivään mennessä, saat muistutuskirjeitä. Jos et maksa velkaa kahden muistutuskirjeen jälkeen, asia voi siirtyä perintätoimistolle. Sen jälkeen perintätoimisto lähettää muistutuskirjeen. Myös perintätoimiston kanssa voit neuvotella uudesta maksuaikataulusta. Laskun ja viivästyskoron lisäksi joudut maksamaan perintäkulut. Jos olet ostanut osamaksulla tavaran, myyjä saattaa ottaa tavaran takaisin. Viivästyskorko

Jos maksat laskun myöhässä tai et maksa sitä ollenkaan, joudut maksamaan viivästyskorkoa. Korko on nykyisin kymmenen prosenttia. Sadan euron laskusta kertyy siis vuodessa kymmenen euroa viivästyskorkoa.

Ulosotto

Jos et maksa laskua vielä perimistoimistollekaan, asia voidaan viedä käräjäoikeuteen. Jos laskuun ei liity mitään epäselvää, käräjäoikeus antaa tuomion. Sen avulla laskun perijä saa rahat ulosoton kautta.

Ulosoton toteuttaa niin kutsuttu ulosottomies. Hän lähettää ensin perintäkirjeen. Vielä tässäkin vaiheessa voi neuvotella maksuaikataulusta. Jos ei neuvottele eikä maksa velkaa, ulosottomies voi alkaa ulosmitata tuloja tai omaisuutta. Se tarkoittaa, että ulosottomies voi ottaa suoraan työnantajalta kolmasosan nettopalkasta. Nettopalkka on se rahasumma, joka jää palkansaajalle käteen verojen vähentämisen jälkeen. Omaisuuttakin voidaan ulosmitata. Kaikkea ei kuitenkaan voida ulosmitata, vaan palkasta täytyy jäädä sen verran, että tulee jotenkin toimeen.

Velan määrä kasvaa koko ajan, sillä laskuun lisätään viivästyskorko, perintäkulut, oikeudenkäyntikulut ja ulosottomaksu.

Sakot, verot, vakuutusmaksut

Sakkojen, verojen ja vakuutusmaksujen periminen etenee nopeammin kuin muiden maksujen. Niitä voidaan ulosmitata ilman oikeuden päätöstä. Jos ei maksa sakkoa ulosottomiehellekään, tuomioistuin voi muuttaa sakon vankeusrangaistukseksi.

Luottotiedot

Jos ei hoida laskujaan tai velkaansa, voi saada merkinnän maksuhäiriöstä Suomen Asiakastieto Oy:n rekisteriin. Jos saa merkinnän rekisteriin, luottotiedot eivät ole kunnossa. Silloin ei yleensä voi saada uutta pankkilainaa tai luottokorttia eikä voi ostaa tavaroita osamaksulla. Luottotiedot voidaan tarkistaa myös, kun hakee vuokra-asuntoa tai uutta työpaikkaa. Merkintä voi tulla rekisteriin kahdeksi vuodeksi. Joissain tapauksessa merkintä säilyy rekisterissä neljä vuotta.

title: Suomen kieli käyttöön/rahankäytöopas


text:
Suomen kieli käyttöön/Pyöräilijä liikenteessä

Pyöräilijä liikenteessä.

Polkupyöräilijän on ajettava pyörätiellä tai kevyen liikenteen väylällä, jos sellainen on. Kevyen liikenteen väylä on tarkoitettu jalankulkijoille, pyöräilijöille ja joskus myös mopoille. Se on merkitty liikennemerkeillä. Jos pyörätietä tai kevyen liikenteen väylää ei ole, pyöräilijän on ajettava tien oikeanpuoleisella pientareella tai oikeassa reunassa. Piennar on erotettu ajoradasta valkoisella viivalla. Alle 12-vuotias saa ajaa pyörällä jalkakäytävällä. Kevyen liikenteen väyliä on kahdenlaisia.

Pyörätie ja jalkakäytävä ovat rinnakkain.

Pyöräilijöille ja jalankulkijoille on oma puolensa. Ne on erotettu toisistaan valkoisella viivalla. Liikennemerkki osoittaa, kumpi puoli on pyöräilijöille. Pyöräilijä ajaa oman väylänsä oikeassa reunassa.

Pyörätie ja jalkakäytävä on yhdistetty.

Pyöräilijä ajaa väylän oikealla puolella. Hän ohittaa samalla puolella kävelevän jalankulkijan ja muut pyöräilijät vasemmalta puolelta.

Kevyen liikenteen väylillä syntyy joskus vaaratilanteita risteyksissä ja tunneleissa. Ennen niitä on syytä hidastaa nopeutta varsinkin, jos ne ovat mäen alla. Väylien risteyksessä pyöräilijän on väistettävä oikealta tulevia pyöräilijöitä.

Pyöräilijän on tarvittaessa varoitettava muita soittokellolla.

Kypärä

Käytä pyöräilykypärää. Se suojaa päätä vammoilta, jos kaadut.

Kypärän on oltava sopivan kokoinen. Se ei saa kiristää, eikä se saa olla liian löysä. Sopiva kypärä on mukavan tuntuinen päässä. Kokeile kypärää jo kaupassa, ennen kuin ostat sen.

Kypärä on laitettava päähän niin, että se suojaa myös otsaa. Tärkeintä on, että kypärä pysyy päässä kaatuessakin.

Pyöräilykypäriä myydään esimerkiksi polkupyöräliikkeissä, urheiluliikkeissä ja tavarataloissa. Myyjät neuvovat oikean kypärän ostossa.

Tarkista, että kypärässä on merkintä CE. Tällöin kypärän kestävyys on testattu ja hyväksytty.


text:
Suomen kieli käyttöön/Paras Romanttinen komedia

Paras Romanttinen komedia.

- eli siis mikä on paras Romanttinen Komedia?

- eihää se oo

- ... Rakkautta vain! (Love, actually) Ehdottomasti paras rakkauselokuva jonka olen ikinä nähnyt.

Ei saanut Hohdolta turhaan viittä tähteä.

Sekaisin Maristakaan ei ole paha.

- Notting Hill.

- Rushmore on aika hyvä, mutta tiedä nyt sitten onko se virallisesti romanttinen komedia.


text:
Suomen kieli käyttöön/Kylpylä aikuisille

Kylpylä aikuisille.

- Onko etelä-suomessa olemassakaan kylpylään missä olisi lähinnä aikuisia (ei nyt ihan eläkeläisiä)?

- kylpylää suomessa olekkaan mikä on tehty aikuisia varten. Lapset ja sen mukana aikuiset on päivän sana, usko pois ja pelkästään 50-60 eivät kylpylöitä pystyssä pidä, menee muuten heikosti jo muutenkin.

- Naantalin kylpylä voisi olla sellainen, jos se vielä etelä suomeksi kelpaa ;=)) Johtunee tod. näk. heidän epäedullisesta hinnoittelusta lapsiperheille (hinta per nokka eikä huone +lisävuode). Lisäetuna vielä itänaapurin asiakkaiden vähäisyys, mutta länsinaapureita sitten tilalla?

- Tampereen kylpylä, on vaan sieltä kalleimmasta päästä

- on Ruissalonkylpylä, varmasti aikuisille..ehkä välillä vähän vanhemmillekkin aikuisille =)

Ympärillä kauniit kävelymaastot ja rauhaa riittää!

- Haikossa on myös aikuisille suunnattu tuo tarjonta, katsopa esim web sivuja niin lapsista ei edes mainita mitään

- Siellä tulee lasten aika pitkäksi ja ei kaukana ole että aikuistenkin. Ai niin kattoon katsellessa voi samalla yleensä harrastaa itäkielen intensiivikurssia.

- pääsiäiseksi Kasnäsin kylpylään. Oletettavasti rauhallinen paikka..?


text:
Suomen kieli käyttöön/Miten erottuu

Miten erottuu.

- Ennen vanhaan tarvittiin kovasti jotain luistoa, jotta esim. valssin pystyi tanssimaan.

Nykyään tarvitaan teräsharjaa, jotta liian luiston saisi pois!

- Koska kuitenkin vähintän 90% lavoilla ja varsinkin ravintolissa tanssivista on niitä ei niin hyviä, on jouduttu siihen liukasteiden lisäilyyn menemään.

Monessa paikassa niin tehdään, vaikka kuinka pyydetään pois jättämään. Kerran tosin sain tarjoilijan teeskentelemään jauhon varistelua, vaikka purkin kansi oli kiinni. Aina siihen ei ole minkäänlaisia mahdollisuuksia.

- niinjuuri...totta se on...kumipohjaiset kengät eikä korkoakaan niissä ole yhtään päälle viiden millin jos sitäkään tiedä häntä en ole mitannut. Kotimaiset kynppivarpaan kengät. En kerro, minkä väriset.

- Valssissa luisto on ihan jees, mutta tänä päivänä tanssitaan paljon sellaisia uusia lajeja, joissa hyvä pito "startatessa" tuntuu hyvältä. Perinteistenkin lajien tanssityyli on osin muuttunut; niissäkin kaivataan sopivasti pitoa kengän ja lattian välillä. Ennen ehkä "hiihdeltiin" enemmän? Varusteetkin ovat saattaneet muuttua: kumipohjaiset yleiskengät tarvitsevat enemmän luistoa kuin nykyään paljon käytetyt erityisesti tanssia varten suunnitellut kengät.

Mutta sitä en ymmärrä miten naiset ovat pärjänneet muovipohjaisilla juhlakengillään niillä liukkailla lattioilla!!!

- Ei ne naiset ole pärjänneetkään mitenkään likkailla lattioilla. Eikä edenkään niillä muovipohja kengillä. Sillä eihän he ole tanssineet vaan on luultu tanssivan, niinkuin hyvin tiedätkin.

Tuo on tuo lattian luisto kyllä lähes aina joistakin kohden lattiata aivan liian liukas ja kun tullaan "hyvään kohtaan" niin se on nihkeä niinkuin pitääkin. Valssikin sujuu hyvin nihkeämmillä kuin liian likkailla. Nuo mainitsemasi uudet lajit tosinaa tarvitsee sen "startti"pidon ja sitä ei vaan tahdo saada kun "valtatanssijajoukko" on sen liukkauden kannalla ja perustanee sen "taitonsa" sen varaan jolloin daameista tuntuisi että nyt vienti on hyvää kun ei tahdo pystyssä pysyä!!.

Ja vähän on sitä "ilmaista " epävarmuutta" ikään kuin pienessä huppelissa. Voi silloin tällöin tarrautua luvallisesti siihen naapurin mieheen kun on nurin menossa. "hiihtelyä niin".

Kengissä on eroja kyllä ja mainitut tanssikengät nahka pohjilla tai säämiskä pohjilla ovat kyllä lattian suhteen tarkempia mutta hyvällä lattialla niillä on kyllä erittäin hyvä tanssia.

Pito vain tulee olla hyvä.

- Josta taas tuli mieleen, että jos olisi - näin naisena - pakko valita kahden pahan, tosi liukkaan tai aivan luistamattoman tanssialustan välillä, valitsisin sen tosi liukkaan, koska seuraajana en pääse valitsemaan, mitä kuvioita teen. Olen huomannut, että pitävällä alustalla miehillä ei ole ihmeemmin ongelmia tanssin ja polvilumpioidensa kanssa, koska he voivat sopeuttaa oman tanssinsa alustan mukaan, mutta daamia he vaistomaisesti liikkuttelevat ja pyöräyttelevät ihan samaan tapaan kuin normaali parketillakin (ehkä jopa laajemmin, yrittäessään alitajuisesti kompensoida omia muuttuneita liikeratojaan). Ja daamin polvilumpiot huutaa armoa! Ymmärrän toki, etteivät miehet tätä ilkeyttään tee, vaan vienti tulee selkäytimestä. Ja sama muuten tosi liukkaallakin lattialla: Toivoisin, että miehet huomioisivat vauhdissaan ja liikelaajuuksissaan sen, jos daamilla tuntuu lipsuvan.

title: Suomen kieli käyttöön/Miten erottuu


text:
Suomen kieli käyttöön/Nopeusrajoitukset mitoitettu

Nopeusrajoitukset mitoitettu.

- Naurettavan alhaiset nopeusrajoitukset on mitoitettu keskivertotuulipukukansalaisen ajotaidoille. Eipä siis ole kovin hääviä ajotaidoiltaan tämä rallikansa.

- varten laadittu, ketäs muutakaan?

- Tarvitse mitään noin älytöntä holhousta. Totaaliluuseritkin nauravat rajoituksille. Voin vain kuvitella, minkä luokan vatipäät niitä asettavat! Kummallista hätävarjelun liioittelua?

Ajotaidoista puheenollen, Suomesta löytyy maailman taitavimmat kuskit, kuten minä. Mutta muutama poikkeus vain vahvistaa säännön, suurin osa on onnettomia tunareita!

- Mitäpä jos tänä kesänä lähtisit vaikka autolomalle Saksaan? Ei nuo nopeusrajoitukset niin kauheasti sitten häiritsisi.

- Joka kesä muutenkin. Vaikka ajelisin koko kesän ristiin rastiin Eurooppaa, tullessani takaisin peräpohjolan junttilandiaan alkaa heti ahdistaa. Missään muualla ei nysvätä kuten SUOmessa.

- Lääkäri auttaa, jos ahdistaa. Pyydä samantien tarpeeksi vahvat mömmöt. Toisaalta voisit ihan hyvin muuttaa Saksaan heidän riesakseen. Olisi sitten kaikki vatipäät yhdessä paikassa.

- Täällä näitä superkuskeja riittää :D

- Näinhän se asia valitettavasti on. Tosielämässä joudut ajelemaan tumpeloitten paskahousujen kanssa samaa ajorataa hevoskärryvauhtia. Onneksi saa vielä valita ravintolat ja kaupat, joita nämä tuulipukuhiirulaiset vierastavat.


text:
A-level Geography/AS OCR Geography/Investigation Paper

Spearman's Rank
This is a concept to find the statistical significance of the correlation between the two variables. First, a null hypothesis needs to be made.

Mann-Whitney U Test
Mann-Whitney U test is a test for difference between 2 data sets. Using a critical values table, the level of confidence in the relationship can be established, and the null hypotheses can be accepted or rejected. There are both advantages and disadvantages which accompany this statistical test for analysis of statistical data. One advantage is that it can compare two data sets that are different sizes. This makes the test much more versatile, and can be applied to a range of different data sets. Secondly, the test is not based on observed values. This means that there are no assumptions made about the distribution of the data. This is particularly useful in geography because most of the data we collect will be either positively or negatively skewed. Finally, Mann-Whitney U uses non-parametric (non-grouped) data. This is an advantage because the trends in the data cannot be generalised, and thus producing a more statistically sound result.

It does however carry some disadvantages with it, one being the fact that it cannot be applied to more than 2 data sets at one time. This is because it is non-parametric data. If the test was done using parametric (grouped) data, you would be able to compare multiple data sets at once. An example of this is the student’s “t” test. This is because parametric data provides a result in proportion to the data, and can therefore be contrasted with many data sets. Also, Mann-Whitney becomes increasingly less effective as the data sets get larger. This reduces its effectiveness because the calculation becomes too long-winded, and it takes a very long time to complete. It also reduces the precision of the result, as with a bigger sample size there is more margin for error.

In conclusion, despite the obvious flaws with the test, it is a very effective way of looking at the differences between 2 pairs of data sets.

Five Sections of Investigation
Sampling Techniques:

Pragmatic = essentially safety and accessibility. For example, if a student is carrying out a river investigation they might use pragmatic sampling methods meaning only areas that were easily accessible and did not pose a risk would be studied. It is reliable and practical.

Random = Not as one might assume randomly selecting a site or throwing a quadrat, in order to use random sample methods either a calculator, grid or computer is needed to generate random statistics that have not been influenced by human decision.

Systematic = This type of technique would be used if progressional change over distance or time was being studied. A transect would be measured and data recorded at regular intervals along said transect, so that change over time or distance could be observed. For example, if a student wished to study psammosere succession, a transect might be measured from the sea to the climax environment (woodland) and at every 25m or so measurements would be taken.

Stratified = To be completed by Magneto and River's landmass.

Statistics: Mode
Most=mode

The most frequent Sample number. This is the sample figure which occurs the most times.

e.g: 7, 8, 9, 5, 6, 7, 5, 5, 5, 5, 3, 5, 5=mode

Comes from the french word "la mode" for fashion.

Statistics: Median
This is the middle sample when all the samples are placed in arithmetic Order. e.g. 1,2,3,4,5,6,7,8,9   5=median

Statistic: Range
The area which the samples stretch from.

Statistics: Standard Deviation
To describe the data regarding an infiltration rate statistically I would use the mean and the standard deviation as a measure of central tendency and dispersion. These two are always used together.

The mean is simply the sum of all values of x (infiltration rate) divided by n (total number of samples)

The standard deviation is more complicated and requires the use of the formula;  where x is the individual infiltration rate and X bar is the mean of x’s (as above)

This is simply done by listing the value of x on a table, and subtracting x bar from each. In the next column, square the subsequent result.

Then add up all the values of (x-xbar) ² (Σ (x-xbar) ². Divide this by n (100 IN THIS CASE), and then square root the answer.

These methods are the most powerful and sensitive, because they include all the values of all the data. They do not exclude any data. However, the data must be (nearly) normally distributed to use them.

Mode and range mealy state the most numerous value of x and the difference between the smallest and largest which is not very useful, as it ignores most of the data. Interquartile deviation and medium rely on the rank order of the data row do not engage with the size of the values for x, and ignore the extremes of the data set.


text:
N64 Programming

N64 reference

 * 1) CPU overview
 * 2) Video coprocessor
 * 3) Memory mapping

Tutorials

 * 1) Compiling—Setting up a cross-compiler for the MIPS R4300

title: N64 Programming


text:
N64 Programming/Video coprocessor

The RCP (VDP,PPU,video controller) is mainly interesting for polygon crunching and post-filter effects.

Formed from two components - RSP(Reality Signal Processor) and RDP(Reality Drawing Processor).

Texture cache and framebuffers are shared in RDRAM with the CPU.

Actual texture memory is only 4KB -- only allowed to operate on this amount at a time.

RSP(Reality Signal Processor)
RSP is your transform and lighting unit (TnL). It manipulates world data and textures.

Mathematically, lots of matrices to transform from local data -> world space -> view space (projection w/ z-perspective correction).

Transform means scaling, translating and rotating for polygons, lighting normals, and texture UVs.

Creates primitive lists of triangles and lines for the RDP to render.

RDP(Reality Drawing Processor)
RDP is the display unit.

Rasterizer, fog, environmental, color blending. Anti-aliasing effects.

Lower-level pixel handler.

uCodes
The RCP has its own language, dubbed 'uCodes' (256 microcodes).

Think of modern vertex and fragment shaders from OpenGL or vertex and pixel shaders from Direct3D - both stages combined.

R4000 coprocessor (COP2). Each uCode is a string of ASM instructions run by the RSP. Also sets up the RDP batch renderer.

Display lists are a sequence of uCodes defined by the game. This is fed to the RSP.

Note: Emulator authors choose to translate uCodes into higher-level languages.

The programmers can define their own vertex / texture formats. Lighting methods. Overdraw detection and other flexible wizardry.

The microcodes are uploaded to the RCP at run-time. So each game has its own library of drawing functions (some are like DSP1 -> DSP1A -> DSP1B and others are akin to DSP2,DSP3).

Texture variations
Games use custom formats. Furthermore, linear bitmaps can be any size (320x8, 48x13). 4/8/16/32-bpp is the norm.

The microcode libraries tend to define several 'accepted' formats.

This is a sample list from video plugin authors.

 * 16-bit RGBA = 5551. Red,green,blue,alpha (transparency).
 * 32-bit RGBA = 8888.

 * 4-bit IA = 31. Grayscale intensity (luminosity,brightness) + alpha.
 * 8-bit IA = 44.
 * 16-bit IA = 88.

 * 4-bit I = 40. Grayscale only.
 * 8-bit I = 80. Grayscale.
 * 16-bit I = (16)(0).

 * 4-bit CI = 40. Palette lookup --> 16-bit RGBA or 16-bit IA.
 * 8-bit CI = 80. Palette lookup --> 16-bit RGBA or 16-bit IA.

YUV = some other color format. Output is RGB (888) + Full alpha.

title: N64 Programming/Video coprocessor


text:
N64 Programming/CPU overview

Processor: 93.75 MHz NEC VR4300, based on MIPS R4300i-series 64-bit RISC CPU (info)

Registers
32 general registers, of which Nintendo has given a naming convention.

 * R0 = always zero. Any attempts to modify this register silently fail.
 * T0-T9 = scratch registers. CPU RAM.
 * S0-S7 = registers saved upon function protocol. Trash at will if you know how.
 * A0-A3 = parameter passing to subroutines. Formal but not rigid.
 * RA   = return address from subroutine. Not pulled from 'stack'. Change at convenience.
 * V0-V1 = arithmetic values, function return values.
 * SP   = stack pointer. Informal.
 * AT   = assembler temporary. Free use.

These are formal definitions but not strictly enforced, save for R0 which is hardwired.

Instructions are WORD sized (32-bits).

Coprocessors
In addition to the CPU, there are three other coprocessors.

 * COP0 = memory management unit (MMU). Better known as 'virtual memory'.
 * COP1 = floating-point unit (FPU).
 * COP2 = video coprocessor (RCP).

Branch delays
When performing branches, a 1-cycle delay is incurred. This means a branch instruction such as beq r0,r0,8006D234h would also execute the instruction following it. There is a limit on which opcodes can be placed in the delay slot.

Note that 'beq r0,r0,TARGET' is effectively 'bra TARGET'.

Examples
The following machine code is found in Mario Golf. [1120:0027] 800B0130: BEQ    t1[800FBBD0],r0[00000000],800B01D0h [0000:0000] 800B0134: NOP NOP (no operation) is executed before the next instruction is fetched from memory.

[0c02:c0d7] 800B01B4: JAL    800B035C [0120:2021] 800B01B8: ADDU   a0[00000038],t1[800FBBD0],r0[00000000] An ADDU (add unsigned) is executed as the program counter is set to address 800B035C.

For our hobbyist purposes, it is much safer to always inefficiently waste a NOP (no operation) in the slot, and optimize later if necessary.

Signed Addition
Care is required when using the unsigned family of MIPS instructions as the signedness refers to only whether the instruction will generate a trap on overflow. MIPS will sign-extend an operand regardless of whether ADDI or ADDIU is used: LI $A0, 8013 ;A0 = 0x80130000 ADDIU $A0, $A0, FFFF ;A0 = 0x8012FFFF Essentially when adding a value greater than 0x7FFF, even with the unsigned addition instructions, the effect is as if the value were negative. This also affects relative addressing, e.g.: LI $A0, 8013 ;A0 = 0x80130000 LW $A1, FFFF($A0) ;load word from 0x8012FFFF

title: N64 Programming/CPU overview