A B C D E F G H I K L M N O P Q R S T U V W X Y
All Classes All Packages
All Classes All Packages
All Classes All Packages
A
- addArgs(String, int) - Method in class controller.ArgumentType
-
adds new arguments to the argument map based on user defined commands
- addLine(double, double) - Method in class view.turtlearena.BasicTurtle
-
Moves turtle to new location and draws line from old to new location
- addLine(int, double, double) - Method in class view.turtlearena.BasicTurtleArena
- addLine(int, double, double) - Method in interface view.turtlearena.TurtleArena
-
Moves turtle of specified index and draws line from old position to new position
- addLine(int, Coordinate, Coordinate) - Method in interface view.MovementView
-
Tells the view to add al line for the turtle with the given index starting and ending at the given coordinates
- addLine(int, Coordinate, Coordinate) - Method in class view.View
-
This is called to to tell the view to add a line to the turtle arena starting at start coordinate and ending at end coordinate.
- AddLineCommand - Class in utilities.Commands
-
Tells the BasicView object to add a line for the specific turtle index with given starting and ending coordinates.
- AddLineCommand(int, double, double, double, double) - Constructor for class utilities.Commands.AddLineCommand
-
Constructor for AddLineCommand
- addNewColorIndex(int, int, int, int) - Method in class view.selector.features.ColorPicker
-
Adds a new color with the given index to the palette.
- addPane(String) - Method in class view.selectorpane.BasicSelectorPane
-
Initialises an element in the selection pane representing a new pane that can be shown or hidden.
- addPane(String) - Method in interface view.selectorpane.SelectorPane
-
Add a pane that can be selected from the selector pane, only the name of the pane is required.
- addPane(Node, String) - Method in interface view.mainpane.MainPane
-
Add an additional view pane into the possible panes that could be displayed.
- addPane(Node, String) - Method in class view.mainpane.MainVisualiser
-
Method from the MainPane interface.
- addPatterns(String) - Method in class controller.ProgramParser
-
Adds the given resource file to this language's recognized types
- addToCommandList(Command) - Method in interface model.ListModel
- addToCommandList(Command) - Method in class model.Model
- addTurtle(int) - Method in class view.statepane.BasicStatePane
-
Allows an additional turtle to be added, with initial state values determined using the default value stored in this object, Creates a new BasicSingleTurtleState object.
- addTurtle(int) - Method in interface view.statepane.StatePane
-
Add a turtle with a given index to the state pane for visualisation of properties
- addTurtle(int) - Method in interface view.StaticView
-
Method to add a turtle with specified index to the front-end view
- addTurtle(int) - Method in class view.turtlearena.BasicTurtleArena
- addTurtle(int) - Method in interface view.turtlearena.TurtleArena
-
Adds a new turtle of specified index to the arena
- addTurtle(int) - Method in class view.View
-
Method to add a turtle with specified index to the front-end view
- AddTurtleCommand - Class in utilities.Commands
-
This command object tells the basic view to add a new turtle with the given index.
- AddTurtleCommand(int) - Constructor for class utilities.Commands.AddTurtleCommand
-
Constructor for the AddTurtleCommand.
- addVar(String, String) - Method in class controller.ArgumentType
-
adds variables to the dictionary, given the var name and value
- addWorkspace(View, String) - Method in interface workspaces.WorkspaceList
- addWorkspace(View, String) - Method in class workspaces.Workspaces
- And - Class in controller.operations
-
takes in two params and returns true if both are 1
- And(Model) - Constructor for class controller.operations.And
- ArcTangent - Class in controller.operations
-
returns the arc tan of a given value
- ArcTangent(Model) - Constructor for class controller.operations.ArcTangent
- ARENA_CSS_FILE - Static variable in class view.turtlearena.ArenaConstants
- ArenaConstants - Class in view.turtlearena
-
Holds all constants for classes in the turtlearena package.
- ArgumentType - Class in controller
- ArgumentType(String) - Constructor for class controller.ArgumentType
-
is a class which extends standard program parser but also has some additional features useful for obtaining arguments this includes finding the number of arguments for a given set of operations, as well as storing all of the different variables.
- Ask - Class in controller.specialOperations
- Ask(Model, ControlParser, ParamOperator) - Constructor for class controller.specialOperations.Ask
- AskWith - Class in controller.specialOperations
- AskWith(Model, ControlParser, ParamOperator) - Constructor for class controller.specialOperations.AskWith
All Classes All Packages


|
ActiveTcl User Guide
|
||
Tk_CreateGenericHandler, Tk_DeleteGenericHandler - associate procedure callback with all X events
#include <tk.h>
Tk_CreateGenericHandler(proc, clientData)
Tk_DeleteGenericHandler(proc, clientData)
Tk_CreateGenericHandler arranges for proc to be invoked in the future whenever any X event occurs. This mechanism is not intended for dispatching X events on windows managed by Tk (you should use Tk_CreateEventHandler for this purpose). Tk_CreateGenericHandler is intended for other purposes, such as tracing X events, monitoring events on windows not owned by Tk, accessing X-related libraries that were not originally designed for use with Tk, and so on.
The callback to proc will be made by Tk_HandleEvent; this mechanism only works in programs that dispatch events through Tk_HandleEvent (or through other Tk procedures that call Tk_HandleEvent, such as Tk_DoOneEvent or Tk_MainLoop).
Proc should have arguments and result that match the type Tk_GenericProc:
typedef int Tk_GenericProc( ClientData clientData, XEvent *eventPtr);
The clientData parameter to proc is a copy of the clientData argument given to Tk_CreateGenericHandler when the callback was created. Typically, clientData points to a data structure containing application-specific information about how to handle events. EventPtr is a pointer to the X event.
Whenever an X event is processed by Tk_HandleEvent, proc is called. The return value from proc is normally 0. A non-zero return value indicates that the event is not to be handled further; that is, proc has done all processing that is to be allowed for the event.
If there are multiple generic event handlers, each one is called for each event, in the order in which they were established.
Tk_DeleteGenericHandler may be called to delete a previously-created generic event handler: it deletes each handler it finds that matches the proc and clientData arguments. If no such handler exists, then Tk_DeleteGenericHandler returns without doing anything. Although Tk supports it, it's probably a bad idea to have more than one callback with the same proc and clientData arguments.
Establishing a generic event handler does nothing to ensure that the process will actually receive the X events that the handler wants to process. For example, it is the caller's responsibility to invoke XSelectInput to select the desired events, if that is necessary.
bind, callback, event, handler
Copyright © 1992-1994 The Regents of the University of California. Copyright © 1994-1996 Sun Microsystems, Inc. Copyright © 1995-1997 Roger E. Critchlow Jr.


The dextop package provides a minimal window manager in your browser.
A DextopWindow can contain any DOM element, and it is wrapped in a window that can be moved and resized.
The window is visible on mouse over. Drag the toolbar on top to move the window.
Drag bottom right circle to resize the window.


Don’t stereotype well-mannered boys as gay, Jamaican Minister pleads
by Jamaica Gleaner(JAMAICA GLEANER) — Jamaican males have been urged to reject subcultural norms that define manhood by promiscuity, mass paternity, and crudeness.
State minister in the Ministry of Culture, Gender, Entertainment and Sport, Alando Terrelonge, says locals should condemn notions that men must be victims of societal pressures such as beliefs that “you must deh pon di corner a burn your weed and drink your rum and Boom because a suh di thing set, dawg”.
Terrelonge was one of three presenters at a public forum on Tuesday at The University of the West Indies, Mona, organised by the Institute of Gender and Development Studies Guild Committee and the Commuting Students Guild Committee. The forum’s theme was ‘Men Leading by Example: Making a Difference for Men and Boys’.
Tuesday was International Men’s Day.
“What it takes to be a man is to empower yourself with an education firstly. You can relate to a time in your childhood when to speak English properly, they called you names. To be seated at the front of the class, to be respectful to your teachers and to female colleagues, you are going to be called names”
“(Although people) a go tell you seh you a fish (homosexual) and you are not man enough,” Terrelonge encouraged young men to respect their parents and take an interest in personal hygiene and deportment.
“No boy should be teased by how he speaks and because he displays or evidences good manners at school. We start by bullying our boys, and some parents are also guilty,” he added.
More Jamaica News Stories
-
Jamaica: American Airlines begins daily non-stop flights bewteen Mobay and JFK November 22, 2019
-
Jamaican-born Dale Holness elected mayor of Florida county November 22, 2019
-
‘I feel like a bride’ – Jamaican Rose Hudson-Wilkin gets rock-star welcome as first black woman Bishop Of Dover November 22, 2019
-
Jamaica: 16 businesses charged for breaching plastic ban – NEPA November 22, 2019
-
Jamaican man lands on US most wanted list for girlfriend’s murder November 22, 2019
-
Senior UK police officer of Jamaican ancestry in hot water over indecent Whatsapp video November 22, 2019
-
Jamaican JP tries to beat traffic with illegal police siren and flashing lights on his bmw November 22, 2019
-
Jamaica: Flow warns of online fraud targeting customers November 21, 2019
-
Jamaica: Woman raped five times November 20, 2019


An unhandled exception was caught during the processing of this request. Please review the information below to determine the source of the problem.
{request} {exceptions}The exception reporter middleware in the Owin Framework supports the following configuration options:
| Property | Default | Current | Description |
|---|---|---|---|
| Message | {message.default} | {message} |
Optional additional HTML to insert into the body of the page when viewed by a public visitor to your site. If you configured a custom template you can insert this message into your content by adding a {message} placeholder in your template. |
| Template | {template.default} | {template} |
The relative file path of a static html file containing the page to send back to public site visitors. If this property is blank (the default) then a default template will be used. In the default template you can insert some custom HTML by configuring the Message property. |
| RequiredPermission | {requiredPermission.default} | {requiredPermission} |
If the logged on user has the RequiredPermission assigned to them then they will see a detailed description of th exception instead of the public message. If you leave this blank then permissions will not be used to determine if the user sees a public message or detailed tecnical information. For this to work you must have some Authorization middleware configured in your Owin pipeline, and you must configure the Authorization middleware to run before the exception reporter. If you do this then the exception reporter will not report on unhandled exceptions in the Authorization middleware. The name of the permission that you specify here is any permission recognized by the Authorization middleware that you configured. |
| Localhost | {localhost.default} | {localhost} |
When this is True requests that originate from the machine hosting the web site will see detaild technical information insread of the generic public message. |
This middleware is configured the same way as all other middleware in the Owin Framework; you need to construct a class that implements IConfiguration then add a fluid .ConfigureWith() when you register this middleware with the Owin Framework builder. Please read Owin Framework documentation on configuration for full details and examples.


Businessmodel of Twitter
Customer Segments
Twitter has a segmented market business model, with customer segments that have slightly different needs. The company targets its offering at individuals who want to communicate with each other/the public and businesses that want to promote their brands.
Value Proposition
Twitter offers six primary value propositions: customization, convenience, pricing, performance, risk reduction, and brand/status.
The company enables customization by allowing users to personalize their profile pages. It also enables businesses to tailor their marketing efforts by identifying and targeting individuals based on age, gender, geography, interests, devices used, and keywords in their tweets.
The company offers convenience by providing users with a source of real-time information. It is often used by news organizations to give breaking news and updates. The platform also makes operations simpler for businesses by enabling them to easily monitor the progress of their marketing campaigns. It gives them access to the Tweet Activity Dashboard, Campaign Dashboard, and Account Analytics, all of which provide data such as most popular tweets, providing a useful gauge of performance.
The company offers a pricing value proposition. Usage of the platform is free. Also, businesses that use its advertising services only have to pay when individuals follow their accounts or retweet, reply, like, or click on the firms’ Promoted Tweets. There is no minimum spending amount for the services.
The company has demonstrated strong performance through tangible results. One study claims that the interactivity it offers drives an emotional response that is 75% higher than that experienced on most websites. Also, the company itself indicates that ads on its platform generate 2 to 2.4x the average sales and penetration lifts of those on comparable social sites. High-profile examples of positive outcomes for specific advertisers on the site include the following:
- Software firm MuleSoft used Twitter’s ad solutions to make it stand out at an industry conference, resulting in a 5.18% average tweet engagement rate and over 4,000 leads
- Toho-Towa, a movie distributor, used Twitter’s Promoted Video option to build buzz for a film sequel, resulting in 54,000 retweets and a 70% increase in box office over the previous film
- Huawei Mobile used Twitter’s Promoted Tweet option to generate chatter over an announcement for its new phone, resulting in an engagement rate 193% higher than expected
- Coca-Cola Mexico used Twitter’s ad solutions to increase brand recognition and promote a sponsorship, resulting in over 10,000 new followers and 4,818 mentions
-
Jaguar USA used Twitter’s First View option to drive awareness of its new model, resulting in 4.5 million views in one day and a 12% increase in brand favorability The company reduces risk by maintaining high safety and security standards. It allows users to do the following:
- Receive warnings in advance of tweets that may contain media with sensitive content
- Flag one’s own tweets if they contain sensitive content so others will be warned
- Identify undesirable tweets from brands so Twitter can limit tweets of that nature in the future
- Protect one’s tweets (limit which followers can see them on one’s profile)
- Mute received tweets considered undesirable (prevent them from appearing on one’s profile without blocking/unfollowing the tweeter; tweeters are not aware they have been muted)
- Block undesirable followers (prevent followers from being able to interact with one’s account; they will not be able to tweet on the account or see the account’s tweets)
- Unfollow undesirable followers so that one does not see their tweets in one’s profile
- Report followers that are believed to be in violation of Twitter’s rules/Terms of Service The company has established a powerful brand due to its success. It has 35 offices around the world, is available in over 40 languages, and has over 313 million monthly active users. It is used by most *Fortune *500 companies and several prominent individuals, ranging from entertainers to politicians.
Channels
Twitter’s main channel for individuals is its website. It maintains a direct sales team for reaching out to potential advertisers. The company promotes its offering through its social media pages, online marketing, and participation in conferences.
Customer Relationships
Twitter’s customer relationship is primarily of a self-service, automated nature.
Customers utilize the service through the main platform while having limited interaction with employees. The company’s website features an “Insights” section that includes articles and research reports, and the site provides answers to frequently asked questions.
That said, there is a personal assistance component in the form of e-mail and social media support.
Key Activities
Twitter’s business model entails maintaining a robust platform for its users.
Key Partners
Twitter maintains the Twitter Official Partner Program, whose members include firms that provide high-quality products and services that assist advertisers on its platform.
They demonstrate expertise in one or more of the following areas: Analytics, Engagement & Publishing, Content Curation & Display, Consulting & Agency Services, Ad Technology, Audience Data, Audience Onboarding, and Ad Measurement.
They can help brands do everything from scale customer care to increase campaign return on investment. Specific partners include the following:
· 4C


Highly Video Gallery is the supported services that provides Extreamely supported community
"Conquer with character in Apex Legends, a free-to-play* hero shooter game where legendary challengers fight for glory, fame, and fortune on the fringes of the Frontier.
3 CommentsJoin or battle other players—or attempt to go it alone—starting with primitive tools and weapons and advancing to firearms and massive bases.
3 CommentsThe shooting isn’t the tightest, and there are still plenty of bugs, but the sheer range of creatures to fight, hunt, and befriend in Ark will keep you exploring the game’s many biomes for hundreds of hours.
3 CommentsIn Asphalt 9: Legends, take the wheel of real cars from high-end renowned legendary car manufacturers, such as Ferrari, Porsche, Lamborghini, and W Motors, among many other international brands. Drive, boost and perform stunts across dynamic real-life locations in single or multiplayer play. Racing adrenaline,
3 CommentsClimb into the cockpit of your favorite fighter aircraft, get ready to take-off, and soar into the skies brimming with visceral dogfights!
3 CommentsThe shooting isn’t the tightest, and there are still plenty of bugs, but the sheer range of creatures to fight, hunt, and befriend in Ark will keep you exploring the game’s many biomes for hundreds of hours.
3 CommentsBattlefield V doesn't drastically alter the first-person-shooter field, but what's in this package is quite good. The EA DICE-developed game features a gorgeous World War II scenario and lightning-fast gameplay that'll keep you running and shooting for hours on end.
3 CommentsXbox Game Studios' Gears 5 is the first main game in the beloved third-person shooter series to ditch the "of War" suffix, but don't get it twisted: This is a Gears of War through and through.
3 Comments
James Smith on Lorem consec ipsum dolor sit amet, co
Michael James onCras sit amet sapien aliquam
Justin More on Lorem ipsum dolor consecsit amet, co


{% extends "base.html" %} {% load crispy_forms_tags %} {% load staticfiles %} {% block head_title %}Welcome | {{ block.super }}{% endblock %} {% block jumbotron %}
The “Time 4 Cultural Innovation” is a product of social intervention that aims to help create and accomplish projects (dreams) with the help of a mentor.
{% if not request.user.is_authenticated %} Join Us » {% else %} Go To My Dreams » {% endif %}
Create a Dream
Manage your Dream
Make it a Reality


hp-pkservice(1) User Manuals hp-pkservice(1) NAME hp-pkservice - Policy Kit Service SYNOPSIS hp-pkservice [MODE] [OPTIONS] MODE Run in interactive mode: -i or --interactive OPTIONS Set the logging level: -l<level> or --logging=<level> <level>: none, info*, error, warn, debug (*default) Run in debug mode: -g (same as option: -ldebug) This help information: -h or --help OPTIONS (GENERAL) PolicyKit version: -v<version> or --version=<version> AUTHOR HPLIP (Hewlett-Packard Linux Imaging and Printing) is an HP developed solution for printing, scanning, and faxing with HP inkjet and laser based printers in Linux. REPORTING BUGS The HPLIP Launchpad.net site https://launchpad.net/hplip is available to get help, report bugs, make suggestions, discuss the HPLIP project or otherwise contact the HPLIP Team. COPYRIGHT Copyright (c) 2001-14 Hewlett-Packard Development Company, L.P. This software comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to distribute it under certain conditions. See COPY‐ ING file for more details. Linux 1.0 hp-pkservice(1)


THE THIRTEENTH FLOOR A film review by Mark R. Leeper
Capsule: The third artificial reality film in about a month is the most stylish and best photographed with the most coherent plotline. Had this been the first of the three to be released, it would be recognized as the best. Roland Emmerich finally has produced a quality science fiction film. Rating: 8 (0 to 10), high +2 (-4 to +4)
The year is 1937. As our story opens we follow an elderly man (played by Armin Mueller-Stahl) from his mistress's bedroom to a nightclub. He leaves a letter he has written someone in the care of a bartender (Vincent D'Onofrio) and goes home to his wife. As he lies in bed, suddenly he is propelled into the present. The world of 1937 was a fully functioning world, realistic is every respect but one. It was not actually real but a total computer simulation. And it was a very complete computer simulation. It is not just a virtual reality program creating for one person what could be a three-dimensional world. Each person in the 1937 world has a life and personality of his or her own and continues even when there is nobody to see him. It is an entire virtual world functioning on its own. And our elderly gentleman is Hammond Fuller, "the Einstein of our generation" who created the cyber-world. But tonight Hammond Fuller is going to be murdered and suspicion will fall on his chief programmer Douglas Hall (Craig Bierko). Hall and his friend and coworker Whitney (Vincent D'Onofrio) have worked for Hammond for years and think that they know him fairly well. Now that he is dead, they are not so sure. A daughter (Gretchen Mol) has turned up mysteriously and nobody knew Fuller had a daughter. Discovered also is that Fuller has been repeatedly projecting himself into his created world of 1937. Even Hall had not realized that was possible yet. Now Hall will have to solve a mystery spread across two different worlds.
Part of what makes this film as remarkable as it is is that it comes from Centropolis Film Productions, Roland Emmerich's company. Until now the best thing we have seen coming from Centropolis is their imaginative opening banner. However, the approach for THE THIRTEENTH FLOOR is entirely different from that of STARGATE, INDEPENDENCE DAY, and GODZILLA. Director Josef Rusnak, experienced mostly in European films, has kept the use of special effects modest. Rather than having a visual carnival, this film is instead intelligent and filmed with a great deal of visual style. Cinematographer Wedigo von Schultzendorff's style uses relatively modest special effects. His views of 1937 Los Angeles are lush and gorgeous, generally filmed with a sepia filter to give us a Los Angeles where Philip Marlowe would feel right at home. von Schultzendorff has made his modern-day Los Angeles looks like a giant electric-blue circuit pack. Where the 1937 city has a rich period feel, 1999 feels electronic and electrically charged.
Rather than paying expensive stars, Rusnak has two little known actors, Craig Bierko and Gretchen Mol, in the two top-billed positions. He has saved the familiar faces for supporting roles. His familiar actors are more known for good performances than for powerhouse marquee value. Armin Mueller-Stahl had a long career in Germany and now frequently appears in English-language films including SHINE, THE GAME, and THE X FILES. Vincent D'Onofrio has also been a familiar character actor since his pivotal role as a somewhat retarded Marine recruit in FULL METAL JACKET.
So now we have had released in about a month three films about worlds that seem real but are in reality created in computers. We can see how three different filmmakers have each handled the theme in an action-adventure. This is a rare opportunity. The Wachowskis created in THE MATRIX a future world that was visually imaginative and gave us a plot that to a very great extent was chases, fighting, and martial arts. David Cronenberg's worlds in "eXistenZ" are basically our world, but ones where the line between the totally inanimate and the biological is breaking down. Josef Rusnak has dusted off the 1964 science fiction novel SIMULACRON-3 by Daniel F. Galouye, toned down the Frederik Pohl aspects (in the novel the world are used to predict public opinion) and played up the Philip K. Dick aspects. He has given us a beautiful sepia-toned view of the 1930s to compare with an electrically charged view of the present. Perhaps which you prefer says something about you. THE MATRIX will clearly be the most profitable, but THE THIRTEENTH FLOOR is the one I want in my collection. I rate the latter film 8 on the 0 to 10 scale and a high +2 on the -4 to +4 scale. (Oh, and when we see a newspaper toward the end, June 21 should be a Friday, not a Monday.)
Mark R. Leeper<EMAIL_ADDRESS>Copyright 1999 Mark R. Leeper
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


{% load extra_tags %}
Glad we could help!
Thanks for improving the recognition! If you have more to add, please click the feedback button (app version 2.0).


| 1 | /* | |
| 2 | * Licensed to the Apache Software Foundation (ASF) under one or more | |
| 3 | * contributor license agreements. See the NOTICE file distributed with | |
| 4 | * this work for additional information regarding copyright ownership. | |
| 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 | |
| 6 | * (the "License"); you may not use this file except in compliance with | |
| 7 | * the License. You may obtain a copy of the License at | |
| 8 | * | |
| 9 | * http://www.apache.org/licenses/LICENSE-2.0 | |
| 10 | * | |
| 11 | * Unless required by applicable law or agreed to in writing, software | |
| 12 | * distributed under the License is distributed on an "AS IS" BASIS, | |
| 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| 14 | * See the License for the specific language governing permissions and | |
| 15 | * limitations under the License. | |
| 16 | */ | |
| 17 | package org.apache.commons.math3.linear; | |
| 18 | ||
| 19 | import org.apache.commons.math3.exception.NumberIsTooSmallException; | |
| 20 | import org.apache.commons.math3.exception.util.LocalizedFormats; | |
| 21 | import org.apache.commons.math3.exception.util.ExceptionContext; | |
| 22 | ||
| 23 | /** | |
| 24 | * Exception to be thrown when a positive definite matrix is expected. | |
| 25 | * | |
| 26 | * @since 3.0 | |
| 27 | * @version $Id: NonPositiveDefiniteMatrixException.java 1416643 2012-12-03 19:37:14Z tn $ | |
| 28 | */ | |
| 29 | public class NonPositiveDefiniteMatrixException extends NumberIsTooSmallException { | |
| 30 | /** Serializable version Id. */ | |
| 31 | private static final long serialVersionUID =<PHONE_NUMBER>113738061L; | |
| 32 | /** Index (diagonal element). */ | |
| 33 | private final int index; | |
| 34 | /** Threshold. */ | |
| 35 | private final double threshold; | |
| 36 | ||
| 37 | /** | |
| 38 | * Construct an exception. | |
| 39 | * | |
| 40 | * @param wrong Value that fails the positivity check. | |
| 41 | * @param index Row (and column) index. | |
| 42 | * @param threshold Absolute positivity threshold. | |
| 43 | */ | |
| 44 | public NonPositiveDefiniteMatrixException(double wrong, | |
| 45 | int index, | |
| 46 | double threshold) { | |
| 47 | super(wrong, threshold, false); | |
| 48 | this.index = index; | |
| 49 | this.threshold = threshold; | |
| 50 | ||
| 51 | final ExceptionContext context = getContext(); | |
| 52 | 1 | context.addMessage(LocalizedFormats.NOT_POSITIVE_DEFINITE_MATRIX); |
| 53 | 1 | context.addMessage(LocalizedFormats.ARRAY_ELEMENT, wrong, index); |
| 54 | } | |
| 55 | ||
| 56 | /** | |
| 57 | * @return the row index. | |
| 58 | */ | |
| 59 | public int getRow() { | |
| 60 | 1 | return index; |
| 61 | } | |
| 62 | /** | |
| 63 | * @return the column index. | |
| 64 | */ | |
| 65 | public int getColumn() { | |
| 66 | 1 | return index; |
| 67 | } | |
| 68 | /** | |
| 69 | * @return the absolute positivity threshold. | |
| 70 | */ | |
| 71 | public double getThreshold() { | |
| 72 | 1 | return threshold; |
| 73 | } | |
| 74 | } | |
Mutations | ||
| 52 |
removed call to org/apache/commons/math3/exception/util/ExceptionContext::addMessage : SURVIVED |
|
| 53 |
removed call to org/apache/commons/math3/exception/util/ExceptionContext::addMessage : SURVIVED |
|
| 60 |
replaced return of integer sized value with (x == 0 ? 1 : 0) : NO_COVERAGE |
|
| 66 |
replaced return of integer sized value with (x == 0 ? 1 : 0) : NO_COVERAGE |
|
| 72 |
replaced return of double value with -(x + 1) for org/apache/commons/math3/linear/NonPositiveDefiniteMatrixException::getThreshold : NO_COVERAGE |


|
Class Summary |
| ColumnComparisonFilter |
ColumnComparisonFilter - selects rows from an NST based on a comparison
between two columns of the NST. |
| ColumnDistinctFilter |
Implements a filter that finds distinct values in a column
Corresponds to a DISTINCT in SQL
It only works on one column at a time. |
| ColumnInFilter |
Implements a filter based on a column from another BAT
Corresponds to a WHERE IN in SQL |
| ColumnNotInFilter |
Implements a filter based on a column from another BAT
Corresponds to a WHERE NOT IN in SQL |
| ColumnValueFilter |
Implements a filter based on the value of a column |
| ColumnValueLikeFilter |
Implements a filter based on the value of a column
Corresponds to the SQL 'like' command
Accepts % as wildcard |
| ColumnValueRandomFilter |
Implements a filter based on the value of a column. |
| ColumnValueRangeFilter |
Implements a filter based on the value of a column. |
| ComparisonOperatorEnum |
|
| CompositeFilter |
|
| DataTypeEnum |
|
| FilterFactory |
Given a string description of a filter, a-la SQL, it
returns an actual instance of the Filter* hierarchy that implements it. |
| KeyInFilter |
Implements a filter for the head column of an NST,
based on the column from another BAT
Corresponds to a WHERE keID IN in (SQL) |
| KeyNotInFilter |
Implements a filter for the head column of an NST,
based on the column from another BAT
Corresponds to a WHERE keID NOT IN in (SQL) |
| LogicalConnectorEnum |
|
| NST |
Represents our "Named Synchronized Tables" idea in Monet. |
| NSTColumn |
Represents a column in an NST
Stores the column name, its data type, and the BAT where the data are stored
Normally the batName corresponds to a BAT in Monet. |
| NSTTypeEnum |
|
| NSTUtil |
A series of utilites to make the processing of internal NST structures easier |


--- layout: post status: publish published: true title: More Recent Music author: display_name: Tomas Restrepo login: tomasr email<EMAIL_ADDRESS>url: http://winterdom.com/ author_login: tomasr author_email<EMAIL_ADDRESS>author_url: http://winterdom.com/ wordpress_id: 786 wordpress_url: http://winterdom.com/2004/05/morerecentmusic date: '2004-05-30 20:52:54 +0000' date_gmt: '2004-05-30 20:52:54 +0000' categories: - Personal tags: [] comments: [] ---
Some more new music I've gotten lately:


Don't miss out! Follow us for timely updates.
Copyright (c) 2017 DOUQCHI SOUHAIL. ALL Rights Reserved.


Outside blur pure CSS
- by EsCss blog
- under Beerware licence
- if you can imagine, CSS will make it real
- Image from nonoesp
- other demos css: here, in codepen, and in my blog
- Please, resize the window and
- Scroll down & up
DINAMYC OUTSIDE BLUR
PURE CSS
Outside blur: warning!
- Don´t use in a real work!
- This is only a Css play
- so that you can see the power of
- the Imagination and Css working together
- Now it's your turn, because
- I'm waiting to play with your demos
Link the POST, show the PEN


class File extends File
Entity file.
Methods
|
__construct(string $src = null, string $name = null)
Constructor. |
from File | |
|
setSrc(string $src)
Set the file path. |
from File | |
|
setName(string $name)
Set the file name. |
from File | |
| string |
getName()
Get the name basename. |
from File |
|
setUploaded(boolean $uploaded)
Set uploaded to a given value. |
from File | |
| boolean |
isUploaded()
Check if the file was uploaded. |
from File |
| integer |
size()
Return the file size. |
from File |
| string |
type()
Return the file type. |
from File |
| string |
extension()
Return the file extension. |
from File |
| boolean |
exists()
Check if the file exists. |
from File |
| string |
src()
Return the source path. |
from File |
| string |
relativeTo(string $path)
Get the relative path to a given one. |
from File |
| boolean |
moveToDir(string $dir, integer $mode = null)
Move the file to a directory. |
from File |
| boolean |
isIn(string $dir)
Check if the file is in a given directory. |
from File |
| boolean |
isAt(string $at)
Check if the file is at a given path. |
from File |
| string |
rename(string $dst, integer $mode = null)
Rename the file. |
from File |
| boolean |
delete()
Delete the file. |
from File |
| boolean |
copy(string $dst, integer $mode = null)
Copy the file. |
from File |
|
toDelete(boolean $toDelete = true)
Set toDelete flag. |
||
| boolean |
shouldDelete()
Check if should delete the file. |
|
|
save()
Save the file. |
||
| string |
__toString()
__toString magic method. |
|
| boolean |
isWeb()
Check if file is accessible from web. |
|
|
setWeb(boolean $web)
Set web flag. |
||
|
setUrl(URLInterface $url)
Set URL dependency. |
||
| string |
url(string $default = null)
Return the file url. |
|
|
setWebDir(string $webDir)
Set web directory. |
||
| string |
relativeToWebDir()
Return relative path from web directory. |
|
|
setDir(string $dir)
Set destination directory. |
Details
in File at line 30
public
__construct(string $src = null, string $name = null)
Constructor.
in File at line 39
public
setSrc(string $src)
Set the file path.
in File at line 47
public
setName(string $name)
Set the file name.
in File at line 55
public string
getName()
Get the name basename.
in File at line 66
public
setUploaded(boolean $uploaded)
Set uploaded to a given value.
in File at line 75
public boolean
isUploaded()
Check if the file was uploaded.
in File at line 83
public integer
size()
Return the file size.
in File at line 91
public string
type()
Return the file type.
in File at line 100
public string
extension()
Return the file extension.
in File at line 110
public boolean
exists()
Check if the file exists.
in File at line 118
public string
src()
Return the source path.
in File at line 127
public string
relativeTo(string $path)
Get the relative path to a given one.
in File at line 146
public boolean
moveToDir(string $dir, integer $mode = null)
Move the file to a directory.
in File at line 157
public boolean
isIn(string $dir)
Check if the file is in a given directory.
in File at line 168
public boolean
isAt(string $at)
Check if the file is at a given path.
in File at line 178
public string
rename(string $dst, integer $mode = null)
Rename the file.
in File at line 192
public boolean
delete()
Delete the file.
in File at line 206
public boolean
copy(string $dst, integer $mode = null)
Copy the file.
at line 39
public
toDelete(boolean $toDelete = true)
Set toDelete flag.
at line 47
public boolean
shouldDelete()
Check if should delete the file.
at line 54
public
save()
Save the file.
at line 66
public string
__toString()
__toString magic method.
Print out the url or source.
at line 77
public boolean
isWeb()
Check if file is accessible from web.
at line 85
public
setWeb(boolean $web)
Set web flag.
at line 93
public
setUrl(URLInterface $url)
Set URL dependency.
at line 102
public string
url(string $default = null)
Return the file url.
at line 118
public
setWebDir(string $webDir)
Set web directory.
at line 126
public string
relativeToWebDir()
Return relative path from web directory.
at line 134
public
setDir(string $dir)
Set destination directory.


Canadian women climb one spot to No. 3 in latest World Rugby rankings
TORONTO - Helped by a pair of wins over the U.S., Canada has moved up one spot to No. 3 in World Rugby women's rankings.
The Americans dropped one place to sixth after the 19-0 and 52-7 losses to Canada in California.
New Zealand remains atop the standings, followed by England. Canada, meanwhile, returned to third for the first time since June.
France fell one rung to fourth while Australia moved past the Americans into fifth. The rest of the top 10 was unchanged with Italy seventh followed by Wales, Spain and Ireland.
Japan was a big mover, climbing 15 places to a career-high No. 12 after drawing Italy 17-17 and beating Scotland 24-20.
The Canadian men are ranked 22nd in the world.
This report by The Canadian Press was first published Nov. 25, 2019.


Krossy
Road
Chicken Survival
Score
0
High Score
0
Use arrow keys to move. Collect rare power ups for unique abilities!
Developed by Derek Wan.


Shabana Azmi to sanction film version of ‘Kaifi & I’?
by BizAsia CorrespondentShabana Azmi had previously played lead actress in the play ‘Kaifi & I’, which was based on the accomplished lives of her parents Kaifi and Shaukat Azmi. Now, the actress has agreed to a remake of the play as a film, with four notable Bollywood producers wanting to champion the project.
Azmi has one condition, though, which is that the producer must cast a younger pair that are fresh on the Bollywood scene. In her own words, Azmi was quoted in Deccan Chronicle as saying the following, “Javed and I have played the role on stage over and over again all over the world. We’ve taken the roles as far as we can. Now it’s time for other actors to see what they can do with the characters”.
Sadly, Shabana’s mother Shaukat Kaifi passed away on Friday.
Keep it with BizAsiaLive.com for more updates on this developing story.
By Arjen Gill


Susan Choi, Sarah M. Broom win National Book Awards
by Hillel ItalieNEW YORK - Susan Choi’s novel “Trust Exercise,” in which a high school romance is spun out into a web of memories and perspectives, has won the National Book Award for fiction.
Sarah M. Broom’s family memoir “The Yellow House” won in nonfiction and Martin W. Sandler’s “1919 The Year That Changed America” for young people’s literature. The winner for best translated book was Laszlo Krasznahorkai’s “Baron Wenckheim’s Homecoming,” translated from Hungarian by Ottilie Mulzet. In poetry, the winner was Arthur Sze’s “Sight Lines.”
Choi expressed gratitude not just for the award, but for the writing life, saying that writing and teaching showed her that the word was "its own reward." Her other books include the Pulitzer Prize finalist "American Woman" and the PEN/Faulkner finalist "A Person of Interest."
The 70th annual National Book Awards were presented Wednesday night at a dinner benefit gala in downtown Manhattan. Honorary prizes were given to author Edmund White and to the head of the American Booksellers Association, Oren J. Teicher.


BLACK AND WHITE
EVENT DESCRIPTION:
Follow the path and save the minion.
On one side of the rectangular path shall be stationed a good minion and a BAD one on the other.
Dont forget to pick your, FRIEND!!!
PROBLEM STATEMENT:
The bot should traverse the grid, starting from the specified point, in the least possible time.
The bot should be able to choose the path of the good minion.
In case of generic bots the postioning of the good minion shall be decided by the orgaizers, on the spot.
For non-genric bots the minion shall be positioned as requested by the participant.
Both the parameters time and completion would be considered.
Each bot is given two runs.
The team can have a maximum of three touches, with appropriate penalty.

The path of the bot might contain curves, and turns of any angle, and broken lines.
The width of the line will be 3 cm
The dimensions of the arena are subject to change.
RULES:
1) A maximum of 3 participants per team.
2) The bot has to be developed and designed by the team itself.
3) The bot should be completely autonomous and should not receive any external assistance, wired or wireless during the run.
4) No Lego kits or Vega kits are allowed. If any robot is found sceptical, it will be immediately disqualified.
5) The bot must not damage the arena, else it will be disqualified.
6) Coordinators reserve the right to ask for the explanation of the bot.
7) No power supply will be provided at the sight of play.
8) The bot should fit within a cube of 25 cm at any point and violation of which will lead to the disqualification of the bot
9) Maximum voltage at any two point in the circuit should not exceed 12V.
10) Decision of the event organizers shall be treated as final and binding on all, and no further arguments shall be entertained.
JUDJING
The team to complete in the least possible time WINS!
Going in the path of the good minion will lead to a deduction of 60s .
If the bot is genric 100s shall be deducted from the total time.
Picking the wrong path will be awarded a penalty 30s .
Each touch will be awarded a penalty of 10s .
Incase of a touch, the bot can be placed anywhere in the path, prior to the touch.
Incase of more than three touches, a penalty of 50s shall be awarded and the bot should restart the race.
Malfunctioning of bot, during the run will, be awarded a penalty of 100s and the bot should restart the race, and time will be given for repair.
Decision of the event organizers shall be treated as final and binding on all, and no further arguments shall be entertained.
To test if the bot is generic, the shall be asked to take the race in both possible paths, and the least time would be considered
Main Track
Contact:
Harsha vardhan reddy<PHONE_NUMBER>
Aravinthan<PHONE_NUMBER>


?Paspalum
alterniflorum
A.
Rich,
in
Sagra
Luis
Catass
Guerra
2006
X
Mus.
Botan.
Stockholm.
Plant¾
Indi¾
Occidentals
N:o..>
Ne,'ëLY.¡ë..?0,anÔcal
Garden
lbOS82£
Yo^
OTANICAL
SN^
R
D
E't
Cuba:
provJ
T.^yH.AQ^^.r.
e^^.-ct
eg.
E.
L.
Ekman.
e
1605222
Legend -
Level of confidence that token is an accurately-transcribed word
extremely low
very low
low
undetermined
medium
high
very high


SwiftValidator
Swift Validator is a rule-based validation library for Swift.
Core Concepts
UITextField
+[Rule]
+ (and optional errorUILabel
) go intoValidator
UITextField
+ValidationError
come out ofValidator
Validator
evaluates[Rule]
sequentially and stops evaluating when aRule
fails.
Installation
# Podfile
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, "8.1"
use_frameworks!
pod 'SwiftValidator', '3.0.3'
Install into your project:
$ pod install
Open your project in Xcode from the .xcworkspace file (not the usual project file):
$ open MyProject.xcworkspace
If you are using Carthage you will need to add this to your Cartfile
github "jpotts18/SwiftValidator"
Usage
You can now import SwiftValidator framework into your files.
Initialize the Validator
by setting a delegate to a View Controller or other object.
// ViewController.swift
let validator = Validator()
Register the fields that you want to validate
override func viewDidLoad() {
super.viewDidLoad()
// Validation Rules are evaluated from left to right.
validator.registerField(fullNameTextField, rules: [RequiredRule(), FullNameRule()])
// You can pass in error labels with your rules
// You can pass in custom error messages to regex rules (such as ZipCodeRule and EmailRule)
validator.registerField(emailTextField, errorLabel: emailErrorLabel, rules: [RequiredRule(), EmailRule(message: "Invalid email")])
// You can validate against other fields using ConfirmRule
validator.registerField(emailConfirmTextField, errorLabel: emailConfirmErrorLabel, rules: [ConfirmationRule(confirmField: emailTextField)])
// You can now pass in regex and length parameters through overloaded contructors
validator.registerField(phoneNumberTextField, errorLabel: phoneNumberErrorLabel, rules: [RequiredRule(), MinLengthRule(length: 9)])
validator.registerField(zipcodeTextField, errorLabel: zipcodeErrorLabel, rules: [RequiredRule(), ZipCodeRule(regex = "\\d{5}")])
// You can unregister a text field if you no longer want to validate it
validator.unregisterField(fullNameTextField)
}
Validate Fields on button tap or however you would like to trigger it.
@IBAction func signupTapped(sender: AnyObject) {
validator.validate(delegate:self)
}
Implement the Validation Delegate in your View controller
// ValidationDelegate methods
func validationSuccessful() {
// submit the form
}
func validationFailed(errors:[UITextField:ValidationError]) {
// turn the fields to red
for (field, error) in validator.errors {
field.layer.borderColor = UIColor.redColor().CGColor
field.layer.borderWidth = 1.0
error.errorLabel?.text = error.errorMessage // works if you added labels
error.errorLabel?.hidden = false
}
}
Single Field Validation
You may use single field validation in some cases. This could be useful in situations such as controlling responders:
// Don't forget to use UITextFieldDelegate
// and delegate yourTextField to self in viewDidLoad()
func textFieldShouldReturn(textField: UITextField) -> Bool {
validator.validateField(textField){ error in
if error == nil {
// Field validation was successful
} else {
// Validation error occurred
}
}
return true
}
Custom Validation
We will create a SSNRule
class to show how to create your own Validation. A United States Social Security Number (or SSN) is a field that consists of XXX-XX-XXXX.
Create a class that inherits from RegexRule
class SSNVRule: RegexRule {
static let regex = "^\\d{3}-\\d{2}-\\d{4}$"
convenience init(message : String = "Not a valid SSN"){
self.init(regex: SSNVRule.regex, message : message)
}
}
Documentation
Checkout the docs here via @jazzydocs.
Credits
Swift Validator is written and maintained by Jeff Potter @jpotts18.
Contributing
- Fork it
- Create your feature branch
git checkout -b my-new-feature
- Commit your changes
git commit -am 'Add some feature'
- Push to the branch
git push origin my-new-feature
- Create a new Pull Request


Class WriteThisAssemblyCodeFile
Generates a temporary code file with the specified generated code fragment. Does not delete the file.
Inheritance
Namespace: Cadru.Build.Tasks
Assembly: Cadru.Build.Tasks.dll
Syntax
public class WriteThisAssemblyCodeFile : Task
Constructors
| Improve this Doc View SourceWriteThisAssemblyCodeFile()
Initializes a new instance of the WriteThisAssemblyCodeFile task.
Declaration
public WriteThisAssemblyCodeFile()
Properties
| Improve this Doc View SourceAssemblyAttributes
Description of attributes to write. Item include is the full type name of the attribute. For example, "System.AssemblyVersionAttribute". Each piece of metadata is the name-value pair of a parameter, which must be of type System.String. Some attributes only allow positional constructor arguments, or the user may just prefer them. To set those, use metadata names like "_Parameter1", "_Parameter2" etc. If a parameter index is skipped, it's an error.
Declaration
public ITaskItem[] AssemblyAttributes { get; set; }
Property Value
| Type | Description |
|---|---|
| ITaskItem[] |
Language
Language of code to generate. Language name can be any language for which a CodeDom provider is available. For example, "C#", "VisualBasic". Emitted file will have the default extension for that language.
Declaration
public string Language { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
OutputDirectory
Destination folder for the generated code. Typically the intermediate folder.
Declaration
public ITaskItem OutputDirectory { get; set; }
Property Value
| Type | Description |
|---|---|
| ITaskItem |
OutputFile
The path to the file that was generated. If this is set, and a file name, the destination folder will be prepended. If this is set, and is rooted, the destination folder will be ignored. If this is not set, the destination folder will be used, an arbitrary file name will be used, and the default extension for the language selected.
Declaration
public ITaskItem OutputFile { get; set; }
Property Value
| Type | Description |
|---|---|
| ITaskItem |
Methods
| Improve this Doc View SourceExecute()
Main entry point.
Declaration
public override bool Execute()
Returns
| Type | Description |
|---|---|
| System.Boolean |


- Third eye: with which he burned Desire to ashes.
- Ashes: Smears his body with ashes; represents the end of all material existence.
- Blue throat (Neelkanth): Drank the poison to eliminate its destructive capacity and save whole life form.
- Sacred Ganga: Represents the nectar of immortality.
- Deer: Holding deer on one hand; indicates he has removed randomness of mind, attained maturity and firmness in thought process.
- Trident: Held in His right hand; represents the three Gunas— Sattva, Rajas and Tamas. That is the emblem of sovereignty.
Destroyer and Benefactor, Ascetic and Householder, God of Ambiguity and Paradox.
"One should know all things of the phenomenal world as of a fivefold character, for the reason that the eternal verity of Śiva is of the character of the fivefold Brahman."


This folder includes third-party libraries that are used by the Zii extension library for Yii. All these libraries are using licenses that are compatible to the BSD license used by Yii. This means you can safely use Zii and Yii for whatever purpose, provided you comply to the BSD license. Please refer to the detailed license information as shown below:
| Library Name | License | Related Yii Component |
|---|---|---|
| jQuery UI 1.8.1 | MIT | JUI widgets (class name started with 'CJui') |


TermiteAlert.org
Most homeowners know very little about whether or not termite treatments have been performed properly. There are basically two choices of treatment - chemical treatment and bait systems. Some homeowners may choose to have both. Below you will find some general information and links to help you make an informed decision regarding chemical treatments vs. bait systems.
To protect your rights, keep all of your termite treatment and inspection records. In addition, if you are a Florida homeowner, your termite company is required to place a treatment sticker on your electrical box or near your attic access. If a sticker has not been posted, call your company and ask to have one posted. If they fail to do so, consider reporting the violation to the Department of Agriculture.
Chemical Treatment
Termiticides, a liquid pesticide, have been used in the past as the standard method of termite control. The purpose of this method is to provide a continuous chemical barrier around the home preventing termites from penetrating the treated soil where the termites are either repelled or killed. Effective treatment usually requires heavy equipment, substantial labor time and a large volume of chemical. A typical barrier treatment may involve hundreds of gallons of chemicals.
The articles below discuss the most effective chemical treatments being used today. Whether you are building a home or having an existing home treated, be sure to request the best chemical at the highest labeled rate.
To Kill or Not To Kill
New Termite treatment effective and less expensive
Terminating Termites
http://www.jacksonville.com/tu-online/stories/060900/bus_3267900.html
Termidor Online – Comparison of Termidor v. Bait
Termite control - Right steps can ensure pests don't feast on your home
http://www.jacksonville.com/tu-online/stories/022000/bus_2164222.html
Bait Systems
Termite food, wood or paper, is put in a tube and inserted below the ground at 10-15 foot intervals around the home. The station is monitored on average once a month. If termites are found, a slow acting poison is placed in the tube and trailed to the colony. The goal of the bait system is to entice termites to feed on the poison, therefore, destroying the colony. The more bait stations installed, the better the chances are of locating termites. Bait systems require patience and persistent monitoring.
The articles below discuss the advantages and disadvantages of chemical treatment versus bait systems.
Termite Baits
http://biocontrol.ifas.ufl.edu/ctgysrch/termite_baits.htm
New Information of Bait Control
http://www.agr.state.ga.us/html/bait_control.html
Common Mistakes
1) Trusting your termite company to use the best chemical. There are many different chemicals that can be used to treat subterranean termites. Some chemicals repel termites while other chemicals kill termites. Be sure to request that your company use the best chemical. A non-repellant that kills termites is best.
2) Assuming your termite company will use the proper volume of chemical. Most termite companies allow their technicians to determine the proper amount of chemical to use on your house. Technicians may use insufficient amounts of chemical and fail to establish a continuous barrier. To insure that your termite company has used the minimum amount of chemical, see the label instructions.
3) Believing that your company will check all of the bait stations consistently. For the bait systems to be effective, all of the bait stations must be monitored periodically. To insure all of the bait stations are monitored, follow the technician as he checks each station and keep a record of all bait station inspections. If a company fails to inspect the stations, call or write your pest control company immediately.


Axis Zoom Control
Try to drag the slider endpoints and the bar to zoom X axis of the chart.
0
10
20
30
40
50
60
70
80
90
100
X Axis Lower Value:
X Axis Upper Value:
That's all Folks!


--- # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. title: "Cayenne Getting Started Guide" description: "Cayenne Getting Started Guide" docsMenuTitle: "Getting Started" cayenneVersion: "3.1" weight: 10 ---
The goal of this chapter of the tutorial is to install (or check that you already have installed) a minimally needed set of software to build a Cayenne application.
Download Eclipse. This tutorial is based on the Galileo package (Eclipse 3.5), JEE edition, still it should work with any recent vanilla Eclipse distribution.
After downloading Eclipse, unpack it somewhere in the filesystem, and start it. The only plugin that you need for the tutorial is m2eclipse. To install it, in Eclipse go to "Help > Install New Software", then click on "Add.." to add a new download site, and enter "Maven" in the "Name" field, and "http://m2eclipse.sonatype.org/sites/m2e" in the "Location" field. You may install any of the optional components that you think you need, but for this tutorial we only select a few basic components as shown on the following screenshot:
From here follow the Eclipse dialog instructions to finish the installation.
The goal of this chapter is to create a new Java project in IntelliJ IDEA containing a basic Cayenne mapping. It presents an introduction to CayenneModeler GUI tool, showing how to create the initial mapping objects: DataDomain
, DataNode
, DataMap
.
In Eclipse select "File > New > Other…" and then "Maven > Maven Project". Click "Next". On the following screen check "Create a simple project" checkbox and click "Next" again. In the dialog shown on the screenshot below, fill the "Group Id" and "Artifact Id" fields and click "Finish".
Now you should have a new empty project in the Eclipse workspace. Check that the project Java compiler settings are correct. Rightclick on the "tutorial" project, select "Properties > Java Compiler" and ensure that "Compiler compliance level" is at least "1.5" (some versions of Maven plugin seem to be setting it to 1.4 by default).
Although later in this tutorial we’ll be using Maven to include Cayenne runtime jars in the project, you’ll still need to download Cayenne to get access to the CayenneModeler tool.
| If you are really into Maven, you can start CayenneModeler from Maven too. We’ll do it in a more traditional way here. |
Download the latest release. Unpack the distribution somewhere in the file system and start CayenneModeler, following platform-specific instructions. On most platforms it is done simply by doubleclicking the Modeler icon. The welcome screen of the Modeler looks like this:
Click on the New Project
button on Welcome screen. A new mapping project will appear that contains a single DataDomain. The meaning of a DataDomain is explained elsewhere in the User Guide. For now it is sufficient to understand that DataDomain is the root of your mapping project.
The next project object you will create is a DataNode. DataNode is a descriptor of a single database your application will connect to. Cayenne mapping project can use more than one database, but for now, we’ll only use one. With "project" selected on the left, click on Create DataNode
button on the toolbar (or select Project > Create DataNode
from the menu).
A new DataNode is displayed. Now you need to specify JDBC connection parameters. For an in-memory Derby database you can enter the following settings:
JDBC Driver: org.apache.derby.jdbc.EmbeddedDriver
DB URL: jdbc:derby:memory:testdb;create=true
| We are creating an in-memory database here. So when you stop your application, all the data will be lost. In most real-life cases you’ll be connecting to a database that actually persists its data on disk, but an in-memory DB will do for the simple tutorial. |
Also you will need to change "Schema Update Strategy". Select org.apache.cayenne.access.dbsync.CreateIfNoSchemaStrategy
from the dropdown, so that Cayenne creates a new schema on Derby based on the ORM mapping when the application starts.
Now you will create a DataMap. DataMap is an object that holds all the mapping information. To create it, click on "Create DataMap" button (or select a corresponding menu item). Note that the newly created DataMap is automatically linked to the DataNode that you created in the previous step. If there is more than one DataNode, you may need to link a DataMap to the correct node manually. In other words a DataMap within DataDomain must point to a database described by the map.
You can leave all the DataMap defaults unchanged except for one - "Java Package". Enter "org.example.cayenne.persistent". This name will later be used for all persistent classes.
Before you proceed with the actual mapping, let’s save the project. Click on "Save" button in the toolbar and navigate to the "tutorial" Eclipse project folder that was created earlier in this section and its "src/main/resources" subfolder and save the project there. Now go back to Eclipse, right click on "tutorial" project and select "Refresh", you will see three Cayenne XML files.
Note that the location of the XML files is not coincidental. Cayenne runtime looks for cayenne-*.xml
file in the application CLASSPATH
and src/main/resources
folder should already be a "class folder" in Eclipse for our project (and is also a standard location that Maven would copy to a jar file, if we were using Maven from command-line).
The goal of this section is to learn how to create a simple Object-Relational model with CayenneModeler. We will create a complete ORM model for the following database schema:
| Very often you’d have an existing database already, and it can be quickly imported in Cayenne via "Tools > Reengineer Database Schema". This will save you lots of time compared to manual mapping. However understanding how to create the mapping by hand is important, so we are showing the "manual" approach below. |
Lets go back to CayenneModeler where we have the newly created project open and start by adding the ARTIST table. Database tables are called DbEntities in Cayenne mapping (those can be actual tables or database views).
Select "datamap" on the left-hand side project tree and click "Create DbEntity" button (or use "Project > Create DbEntity" menu). A new DbEntity is created. In "DbEntity Name" field enter "ARTIST". Then click on "Create Attribute" button on the entity toolbar. This action changes the view to the "Attribute" tab and adds a new attribute (attribute means a "table column" in this case) called "untitledAttr". Let’s rename it to ID, make it an INTEGER
and make it a PK:
Similarly add NAME VARCHAR(200)
and DATE_OF_BIRTH DATE
attributes. After that repeat this procedure for PAINTING and GALLERY entities to match DB schema shown above.
| Don’t forget to save your project periodically to avoid losing your work. You will also have to refresh the project in Eclipse after every CayenneModeler save, as Eclipse is by default unaware of any changes made in the Modeler. |
Now we need to specify relationships between ARTIST, PAINTING and GALLERY tables. Start by creating a one-to-many ARTIST/PAINTING relationship:
Select the ARTIST DbEntity on the left and click on the "Properties" tab.
Click on "Create Relationship" button on the entity toolbar - a relationship called "untitledRel" is created.
Choose the "Target" to be "Painting".
Click on the "Database Mapping" button - relationship configuration dialog is presented. Here you can assign a name to the relationship and also its complimentary reverse relationship. This name can be anything (this is really a symbolic name of the database referential constraint), but it is recommended to use a valid Java identifier, as this will save some typing later. We’ll call the relationship "paintings" and reverse relationship "artist".
Click on "Add" button on the right to add a join
Select "ID" column for the "Source" and "ARTIST_ID" column for the target.
Relationship information should now look like this:
Click "Done" to confirm the changes and close the dialog.
Two complimentary relationships have been created - from ARTIST to PAINTING and back. Still you may have noticed one thing is missing - "paintings" relationship should be to-many, but "To Many" checkbox is not checked. Let’s change that - check the checkbox for "paintings" relationship, and then click on PAINTING DbEntity, and uncheck "artist" relationship "To Many" to make the reverse relationship "to-one" as it should be.
Repeat the steps above to create a many-to-one relationship from PAINTING to GALLERY, calling the relationships pair "gallery" and "paintings".
Now that the database schema mapping is complete, CayenneModeler can create mappings of Java classes (aka "ObjEntities") by deriving everything from DbEntities. At present there is no way to do it for the entire DataMap in one click, so we’ll do it for each table individually.
Select "ARTIST" DbEntity and click on "Create ObjEntity" button either on the entity toolbar or on the main toolbar. An ObjEntity called "Artist" is created with a Java class field set to "org.example.cayenne.persistent.Artist". The modeler transformed the database names to the Java-friendly names (e.g., if you click on the "Attributes" tab, you’ll see that "DATE_OF_BIRTH" column was converted to "dateOfBirth" Java class attribute).
Select "GALLERY" DbEntity and click on "Create ObjEntity" button again - you’ll see a "Gallery" ObjEntity created.
Finally, do the same thing for "PAINTING".
Now you need to synchronize relationships. Artist and Gallery entities were created when there was no related "Painting" entity, so their relationships were not set.
Click on the "Artist" ObjEntity. Now click on "Sync ObjEntity with DbEntity" button on the toolbar - you will see the "paintings" relationship appear.
Do the same for the "Gallery" entity.
Unless you want to customize the Java class and property names (which you can do easily) the mapping is complete.
Here we’ll generate the Java classes from the model that was created in the previous section. CayenneModeler can be used to also generate the database schema, but since we specified “CreateIfNoSchemaStrategy” earlier when we created a DataNode, we’ll skip the database schema step. Still be aware that you can do it if you need to via "Tools > Create Database Schema".
Select "Tools > Generate Classes" menu.
For "Type" select "Standard Persistent Objects", if it is not already selected.
For the "Output Directory" select “src/main/java” folder under your IDEA project folder (this is a "peer" location to the cayenne-*.xml
location we selected before).
Click on "Classes" tab and check the "Check All Classes" checkbox (unless it is already checked and reads "Uncheck all Classes").
Click "Generate"
Now go back to Eclipse, right click on "tutorial" project and select "Refresh" - you should see pairs of classes generated for each mapped entity. You probably also see that there’s a bunch of red squiggles next to the newly generated Java classes in Eclipse. This is because our project does not include Cayenne as a Maven dependency yet. Let’s fix it now by adding "cayenne-server" artifact in the bottom of the pom.xml file. The resulting POM should look like this:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.example.cayenne</groupId>
<artifactId>tutorial</artifactId>
<version>0.0.1-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>org.apache.cayenne</groupId>
<artifactId>cayenne-server</artifactId>
<!-- Here specify the version of Cayenne you are actually using -->
<version>3.1.4-SNAPSHOT</version>
</dependency>
</dependencies>
</project>
Your computer must be connected to the internet. Once you save the pom.xml, Eclipse will download the needed Cayenne jar file and add it to the project build path. As a result, all the errors should disappear.
Now let’s check the entity class pairs. Each one is made of a superclass (e.g. Artist) and a subclass (e.g. Artist). You should not modify the superclasses whose names start with "_" (underscore), as they will be replaced on subsequent generator runs. Instead all custom logic should be placed in the subclasses in "org.example.cayenne.persistent" package - those will never be overwritten by the class generator.
|
Class Generation Hint
Often you’d start by generating classes from the Modeler, but at the later stages of the project the generation is usually automated either via Ant cgen task or Maven cgen mojo. All three methods are interchangeable, however Ant and Maven methods would ensure that you never forget to regenerate classes on mapping changes, as they are integrated into the build cycle. |
In this section we’ll write a simple main class to run our application, and get a brief introduction to Cayenne ObjectContext.
n Eclipse create a new class called "Main" in the "org.example.cayenne" package.
Create a standard "main" method to make it a runnable class:
package org.example.cayenne;
public class Main {
public static void main(String[] args) {
}
}
The first thing you need to be able to access the database is to create a ServerRuntime
object (which is essentially a wrapper around Cayenne stack) and use it to obtain an instance of an ObjectContext
.
package org.example.cayenne;
import org.apache.cayenne.ObjectContext;
import org.apache.cayenne.configuration.server.ServerRuntime;
public class Main {
public static void main(String[] args) {
ServerRuntime cayenneRuntime = new ServerRuntime(
"cayenne-project.xml");
ObjectContext context = cayenneRuntime.getContext();
}
}
ObjectContext
is an isolated "session" in Cayenne that provides all needed API to work with data. ObjectContext has methods to execute queries and manage persistent objects. We’ll discuss them in the following sections. When the first ObjectContext is created in the application, Cayenne loads XML mapping files and creates a shared access stack that is later reused by other ObjectContexts.
Let’s check what happens when you run the application. But before we do that we need to add another dependency to the pom.xml
- Apache Derby, our embedded database engine. The following piece of XML needs to be added to the <dependencies>…</dependencies>
section, where we already have Cayenne jars:
<dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derby</artifactId>
<version><IP_ADDRESS></version>
</dependency>
Now we are ready to run. Right click the "Main" class in Eclipse and select "Run As > Java Application". In the console you’ll see output similar to this, indicating that Cayenne stack has been started: In the console you’ll see output similar to this, indicating that Cayenne stack has been started:
INFO: Loading XML configuration resource from file:cayenne-project.xml INFO: loading user name and password. INFO: Created connection pool: jdbc:derby:memory:testdb;create=true Driver class: org.apache.derby.jdbc.EmbeddedDriver Min. connections in the pool: 1 Max. connections in the pool: 1
In this chapter we’ll learn about persistent objects, how to customize them and how to create and save them in DB.
Persistent classes in Cayenne implement a DataObject interface. If you inspect any of the classes generated earlier in this tutorial (e.g. org.example.cayenne.persistent.Artist
), you’ll see that it extends a class with the name that starts with underscore (org.example.cayenne.persistent.auto._Artist
), which in turn extends from org.apache.cayenne.CayenneDataObject
. Splitting each persistent class into user-customizable subclass (Xyz
) and a generated superclass (_Xyz
) is a useful technique to avoid overwriting the custom code when refreshing classes from the mapping model.
Let’s for instance add a utility method to the Artist class that sets Artist date of birth, taking a string argument for the date. It will be preserved even if the model changes later:
public class Artist extends _Artist {
static final String DEFAULT_DATE_FORMAT = "yyyyMMdd";
/**
* Sets date of birth using a string in format yyyyMMdd.
*/
public void setDateOfBirthString(String yearMonthDay) {
if (yearMonthDay == null) {
setDateOfBirth(null);
} else {
Date date;
try {
date = new SimpleDateFormat(DEFAULT_DATE_FORMAT)
.parse(yearMonthDay);
} catch (ParseException e) {
throw new IllegalArgumentException(
"A date argument must be in format '"
+ DEFAULT_DATE_FORMAT + "': " + yearMonthDay);
}
setDateOfBirth(date);
}
}
}
Now we’ll create a bunch of objects and save them to the database. An object is created and registered with ObjectContext
using “newObject” method. Objects must be registered with DataContext
to be persisted and to allow setting relationships with other objects. Add this code to the "main" method of the Main class:
Artist picasso = context.newObject(Artist.class);
picasso.setName("Pablo Picasso");
picasso.setDateOfBirthString("18811025");
Note that at this point "picasso" object is only stored in memory and is not saved in the database. Let’s continue by adding a Metropolitan Museum “Gallery” object and a few Picasso "Paintings":
Gallery metropolitan = context.newObject(Gallery.class);
metropolitan.setName("Metropolitan Museum of Art");
Painting girl = context.newObject(Painting.class);
girl.setName("Girl Reading at a Table");
Painting stein = context.newObject(Painting.class);
stein.setName("Gertrude Stein");
Now we can link the objects together, establishing relationships. Note that in each case below relationships are automatically established in both directions (e.g. picasso.addToPaintings(girl)
has exactly the same effect as girl.setToArtist(picasso)
).
picasso.addToPaintings(girl);
picasso.addToPaintings(stein);
girl.setGallery(metropolitan);
stein.setGallery(metropolitan);
Now lets save all five new objects, in a single method call:
context.commitChanges();
Now you can run the application again as described in the previous chapter. The new output will show a few actual DB operations:
... org.apache.cayenne.configuration.XMLDataChannelDescriptorLoader load INFO: Loading XML configuration resource from file:cayenne-project.xml ... INFO: Opening connection: jdbc:derby:memory:testdb;create=true Login: null Password: ******* INFO: +++ Connecting: SUCCESS. INFO: Detected and installed adapter: org.apache.cayenne.dba.derby.DerbyAdapter INFO: --- transaction started. INFO: No schema detected, will create mapped tables INFO: CREATE TABLE GALLERY (ID INTEGER NOT NULL, NAME VARCHAR (200), PRIMARY KEY (ID)) INFO: CREATE TABLE ARTIST (DATE_OF_BIRTH DATE, ID INTEGER NOT NULL, NAME VARCHAR (200), PRIMARY KEY (ID)) INFO: CREATE TABLE PAINTING (ARTIST_ID INTEGER, GALLERY_ID INTEGER, ID INTEGER NOT NULL, NAME VARCHAR (200), PRIMARY KEY (ID)) INFO: ALTER TABLE PAINTING ADD FOREIGN KEY (ARTIST_ID) REFERENCES ARTIST (ID) INFO: ALTER TABLE PAINTING ADD FOREIGN KEY (GALLERY_ID) REFERENCES GALLERY (ID) INFO: CREATE TABLE AUTO_PK_SUPPORT ( TABLE_NAME CHAR(100) NOT NULL, NEXT_ID BIGINT NOT NULL, PRIMARY KEY(TABLE_NAME)) INFO: DELETE FROM AUTO_PK_SUPPORT WHERE TABLE_NAME IN ('ARTIST', 'GALLERY', 'PAINTING') INFO: INSERT INTO AUTO_PK_SUPPORT (TABLE_NAME, NEXT_ID) VALUES ('ARTIST', 200) INFO: INSERT INTO AUTO_PK_SUPPORT (TABLE_NAME, NEXT_ID) VALUES ('GALLERY', 200) INFO: INSERT INTO AUTO_PK_SUPPORT (TABLE_NAME, NEXT_ID) VALUES ('PAINTING', 200) INFO: SELECT NEXT_ID FROM AUTO_PK_SUPPORT WHERE TABLE_NAME = ? FOR UPDATE [bind: 1:'ARTIST'] INFO: SELECT NEXT_ID FROM AUTO_PK_SUPPORT WHERE TABLE_NAME = ? FOR UPDATE [bind: 1:'GALLERY'] INFO: SELECT NEXT_ID FROM AUTO_PK_SUPPORT WHERE TABLE_NAME = ? FOR UPDATE [bind: 1:'PAINTING'] INFO: INSERT INTO GALLERY (ID, NAME) VALUES (?, ?) INFO: [batch bind: 1->ID:200, 2->NAME:'Metropolitan Museum of Art'] INFO: === updated 1 row. INFO: INSERT INTO ARTIST (DATE_OF_BIRTH, ID, NAME) VALUES (?, ?, ?) INFO: [batch bind: 1->DATE_OF_BIRTH:'1881-10-25 00:00:00.0', 2->ID:200, 3->NAME:'Pablo Picasso'] INFO: === updated 1 row. INFO: INSERT INTO PAINTING (ARTIST_ID, GALLERY_ID, ID, NAME) VALUES (?, ?, ?, ?) INFO: [batch bind: 1->ARTIST_ID:200, 2->GALLERY_ID:200, 3->ID:200, 4->NAME:'Gertrude Stein'] INFO: [batch bind: 1->ARTIST_ID:200, 2->GALLERY_ID:200, 3->ID:201, 4->NAME:'Girl Reading at a Table'] INFO: === updated 2 rows. INFO: +++ transaction committed.
So first Cayenne creates the needed tables (remember, we used “CreateIfNoSchemaStrategy”). Then it runs a number of inserts, generating primary keys on the fly. Not bad for just a few lines of code.
This chapter shows how to select objects from the database using ObjectSelect
query.
It was shown before how to persist new objects. Cayenne queries are used to access already saved objects. The primary query type used for selecting objects is ObjectSelect
. It can be mapped in CayenneModeler or created via the API. We’ll use the latter approach in this section. We don’t have too much data in the database yet, but we can still demonstrate the main principles below.
Select all paintings (the code, and the log output it generates):
SelectQuery select1 = new SelectQuery(Painting.class);
List paintings1 = context.performQuery(select1);
INFO: SELECT t0.GALLERY_ID, t0.ARTIST_ID, t0.NAME, t0.ID FROM PAINTING t0 INFO: === returned 2 rows. - took 18 ms.
Select paintings that start with “gi”, ignoring case:
Expression qualifier2 = ExpressionFactory.likeIgnoreCaseExp(
Painting.NAME_PROPERTY,
"gi%");
SelectQuery select2 = new SelectQuery(Painting.class, qualifier2);
List paintings2 = context.performQuery(select2);
INFO: SELECT t0.GALLERY_ID, t0.NAME, t0.ARTIST_ID, t0.ID FROM PAINTING t0 WHERE UPPER(t0.NAME) LIKE UPPER(?) [bind: 1->NAME:'gi%'] - prepared in 6 ms. INFO: === returned 1 row. - took 18 ms.
Select all paintings done by artists who were born more than a 100 years ago (demonstrating using Expression.fromString(..) instead of ExpressionFactory):
Calendar c = new GregorianCalendar(); c.set(c.get(Calendar.YEAR) - 100, 0, 1, 0, 0, 0); Expression qualifier3 = Expression.fromString("artist.dateOfBirth < $date"); qualifier3 = qualifier3.expWithParameters(Collections.singletonMap("date", c.getTime())); SelectQuery select3 = new SelectQuery(Painting.class, qualifier3); List paintings3 = context.performQuery(select3);
INFO: SELECT t0.GALLERY_ID, t0.NAME, t0.ARTIST_ID, t0.ID FROM PAINTING t0 JOIN ARTIST t1 ON (t0.ARTIST_ID = t1.ID) WHERE t1.DATE_OF_BIRTH < ? [bind: 1->DATE_OF_BIRTH:'1911-01-01 00:00:00.493'] - prepared in 7 ms. INFO: === returned 2 rows. - took 25 ms.
This chapter explains how to model relationship delete rules and how to delete individual objects as well as sets of objects. Also demonstrated the use of Cayenne class to run a query.
Before we discuss the API for object deletion, lets go back to CayenneModeler and set up some delete rules. Doing this is optional but will simplify correct handling of the objects related to deleted objects.
In the Modeler go to "Artist" ObjEntity, "Relationships" tab and select "Cascade" for the "paintings" relationship delete rule:
Repeat this step for other relationships:
For Gallery set "paintings" relationship to be "Nullify", as a painting can exist without being displayed in a gallery.
For Painting set both relationships rules to "Nullify".
Now save the mapping.
While deleting objects is possible via SQL, qualifying a delete on one or more IDs, a more common way in Cayenne (or ORM in general) is to get a hold of the object first, and then delete it via the context. Let’s use utility class Cayenne to find an artist:
Expression qualifier = ExpressionFactory.matchExp(Artist.NAME_PROPERTY, "Pablo Picasso");
SelectQuery select = new SelectQuery(Artist.class, qualifier);
Artist picasso = (Artist) Cayenne.objectForQuery(context, select);
Now let’s delete the artist:
if (picasso != null) {
context.deleteObject(picasso);
context.commitChanges();
}
}
Since we set up "Cascade" delete rule for the Artist.paintings relationships, Cayenne will automatically delete all paintings of this artist. So when your run the app you’ll see this output:
INFO: SELECT t0.DATE_OF_BIRTH, t0.NAME, t0.ID FROM ARTIST t0 WHERE t0.NAME = ? [bind: 1->NAME:'Pablo Picasso'] - prepared in 6 ms. INFO: === returned 1 row. - took 18 ms. INFO: +++ transaction committed. INFO: --- transaction started. INFO: DELETE FROM PAINTING WHERE ID = ? INFO: [batch bind: 1->ID:200] INFO: [batch bind: 1->ID:201] INFO: === updated 2 rows. INFO: DELETE FROM ARTIST WHERE ID = ? INFO: [batch bind: 1->ID:200] INFO: === updated 1 row. INFO: +++ transaction committed.
This chapter shows how to work with Cayenne in a web application.
The web part of the web application tutorial is done in JSP, which is the least common denominator of the Java web technologies, and is intentionally simplistic from the UI perspective, to concentrate on Cayenne integration aspect, rather than the interface. A typical Cayenne web application works like this:
Cayenne configuration is loaded when an application context is started, using a special servlet filter.
User requests are intercepted by the filter, and the DataContext is bound to the request thread, so the application can access it easily from anywhere.
The same DataContext instance is reused within a single user session; different sessions use different DataContexts (and therefore different sets of objects). The context can be scoped differently depending on the app specifics. For the tutorial we’ll be using a session-scoped context.
So let’s convert the tutorial that we created to a web application:
In Eclipse under "tutorial" project folder create a new folder "src/main/webapp/WEB-INF".
Under WEB-INF
create a new file web.xml
(a standard web app descriptor):
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<display-name>Cayenne Tutorial</display-name>
<!-- This filter bootstraps ServerRuntime and then provides each request thread
with a session-bound DataContext. Note that the name of the filter is important,
as it points it to the right named configuration file.
-->
<filter>
<filter-name>cayenne-project</filter-name>
<filter-class>org.apache.cayenne.configuration.web.CayenneFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>cayenne-project</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
Create the artist browser page src/main/webapp/index.jsp
file with the following contents:
<%@ page language="java" contentType="text/html" %>
<%@ page import="org.example.cayenne.persistent.*" %>
<%@ page import="org.apache.cayenne.*" %>
<%@ page import="org.apache.cayenne.query.*" %>
<%@ page import="org.apache.cayenne.exp.*" %>
<%@ page import="java.util.*" %>
<%
SelectQuery query = new SelectQuery(Artist.class);
query.addOrdering(Artist.NAME_PROPERTY, SortOrder.ASCENDING);
ObjectContext context = BaseContext.getThreadObjectContext();
List<Artist> artists = context.performQuery(query);
%>
<html>
<head>
<title>Main</title>
</head>
<body>
<h2>Artists:</h2>
<% if(artists.isEmpty()) {%>
<p>No artists found</p>
<% } else {
for(Artist a : artists) {
%>
<p><a href="detail.jsp?id=<%=Cayenne.intPKForObject(a)%>"> <%=a.getName()%> </a></p>
<%
}
} %>
<hr>
<p><a href="detail.jsp">Create new artist...</a></p>
</body>
</html>
Create the artist editor page src/main/webapp/detail.jsp
with the following content:
<%@ page language="java" contentType="text/html" %>
<%@ page import="org.example.cayenne.persistent.*" %>
<%@ page import="org.apache.cayenne.*" %>
<%@ page import="java.util.*" %>
<%@ page import="java.text.*" %>
<%
ObjectContext context = BaseContext.getThreadObjectContext();
String id = request.getParameter("id");
// find artist for id
Artist artist = null;
if(id != null && id.trim().length() > 0) {
artist = Cayenne.objectForPK(context, Artist.class, Integer.parseInt(id));
}
if("POST".equals(request.getMethod())) {
// if no id is saved in the hidden field, we are dealing with
// create new artist request
if(artist == null) {
artist = context.newObject(Artist.class);
}
// note that in a real application we would so dome validation ...
// here we just hope the input is correct
artist.setName(request.getParameter("name"));
artist.setDateOfBirthString(request.getParameter("dateOfBirth"));
context.commitChanges();
response.sendRedirect("index.jsp");
}
if(artist == null) {
// create transient artist for the form response rendering
artist = new Artist();
}
String name = artist.getName() == null ? "" : artist.getName();
String dob = artist.getDateOfBirth() == null
? "" : new SimpleDateFormat("yyyyMMdd").format(artist.getDateOfBirth());
%>
<html>
<head>
<title>Artist Details</title>
</head>
<body>
<h2>Artists Details</h2>
<form name="EditArtist" action="detail.jsp" method="POST">
<input type="hidden" name="id" value="<%= id != null ? id : "" %>" />
<table border="0">
<tr>
<td>Name:</td>
<td><input type="text" name="name" value="<%= name %>"/></td>
</tr>
<tr>
<td>Date of Birth (yyyyMMdd):</td>
<td><input type="text" name="dateOfBirth" value="<%= dob %>"/></td>
</tr>
<tr>
<td></td>
<td align="right"><input type="submit" value="Save" /></td>
</tr>
</table>
</form>
</body>
</html>
To run the web application we’ll use "maven-jetty-plugin". To activate it, let’s add the following piece of code to the "pom.xml" file, following the "dependencies" section and save the POM:
<build>
<plugins>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.1.22</version>
</plugin>
</plugins>
</build>
Also to run the web application we’ll use "maven-jetty-plugin". To activate it, let’s add the following piece of code to the pom.xml
file, following the "dependencies" section and save the POM:
<build>
<plugins>
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>9.3.14.v20161028</version>
</plugin>
</plugins>
</build>
Go to "Run > Run Configurations…" menu, select "Maven Build", right click and select "New"
Make sure you fill "Name", "Base directory" and "Goals" fields as shown on the screenshot:
Click "Apply" and "Run". On the first execution it may take a few minutes for Jetty plugin to download all dependencies, but eventually you’ll see the logs like this:
[INFO] Scanning for projects... [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building tutorial 0.0.1-SNAPSHOT [INFO] ------------------------------------------------------------------------ ... [INFO] Configuring Jetty for project: tutorial [INFO] Webapp source directory = /.../tutorial/src/main/webapp [INFO] Reload Mechanic: automatic [INFO] Classes = /.../tutorial/target/classes [INFO] Context path = /tutorial [INFO] Tmp directory = determined at runtime [INFO] Web defaults = org/mortbay/jetty/webapp/webdefault.xml [INFO] Web overrides = none [INFO] web.xml file = /.../tutorial/src/main/webapp/WEB-INF/web.xml [INFO] Webapp directory = /.../tutorial/src/main/webapp [INFO] Starting jetty 6.1.22 ... INFO::jetty-6.1.22 INFO::No Transaction manager found - if your webapp requires one, please configure one. INFO::Started SelectChannelConnector@<IP_ADDRESS>:8080 [INFO] Started Jetty Server
So the Jetty container just started.
Now go to http://localhost:8080/tutorial/ URL. You should see "No artists found message" in the web browser and the following output in the Eclipse console:
INFO: Loading XML configuration resource from file:/.../tutorial/target/classes/cayenne-project.xml INFO: loading user name and password. INFO: Created connection pool: jdbc:derby:memory:testdb;create=true Driver class: org.apache.derby.jdbc.EmbeddedDriver Min. connections in the pool: 1 Max. connections in the pool: 1 INFO: Opening connection: jdbc:derby:memory:testdb;create=true Login: null Password: ******* INFO: +++ Connecting: SUCCESS. INFO: Detected and installed adapter: org.apache.cayenne.dba.derby.DerbyAdapter INFO: --- transaction started. INFO: No schema detected, will create mapped tables INFO: CREATE TABLE GALLERY (ID INTEGER NOT NULL, NAME VARCHAR (200), PRIMARY KEY (ID)) INFO: CREATE TABLE ARTIST (DATE_OF_BIRTH DATE, ID INTEGER NOT NULL, NAME VARCHAR (200), PRIMARY KEY (ID)) INFO: CREATE TABLE PAINTING (ARTIST_ID INTEGER, GALLERY_ID INTEGER, ID INTEGER NOT NULL, NAME VARCHAR (200), PRIMARY KEY (ID)) INFO: ALTER TABLE PAINTING ADD FOREIGN KEY (ARTIST_ID) REFERENCES ARTIST (ID) INFO: ALTER TABLE PAINTING ADD FOREIGN KEY (GALLERY_ID) REFERENCES GALLERY (ID) INFO: CREATE TABLE AUTO_PK_SUPPORT ( TABLE_NAME CHAR(100) NOT NULL, NEXT_ID BIGINT NOT NULL, PRIMARY KEY(TABLE_NAME)) INFO: DELETE FROM AUTO_PK_SUPPORT WHERE TABLE_NAME IN ('ARTIST', 'GALLERY', 'PAINTING') INFO: INSERT INTO AUTO_PK_SUPPORT (TABLE_NAME, NEXT_ID) VALUES ('ARTIST', 200) INFO: INSERT INTO AUTO_PK_SUPPORT (TABLE_NAME, NEXT_ID) VALUES ('GALLERY', 200) INFO: INSERT INTO AUTO_PK_SUPPORT (TABLE_NAME, NEXT_ID) VALUES ('PAINTING', 200) INFO: SELECT t0.DATE_OF_BIRTH, t0.NAME, t0.ID FROM ARTIST t0 ORDER BY t0.NAME - prepared in 43 ms. INFO: === returned 0 rows. - took 56 ms. INFO: +++ transaction committed.
You can click on "Create new artist" link to create artists. Existing artists can be edited by clicking on their name:
You are done with the tutorial!


I had been waiting weeks to go to this show. Then, with the show scheduled for the upcoming weekend, I got a terrible cold on Thursday. It went into Friday and had only gotten worse. Saturday came around and I was coughing seemingly once-a-minute. My nose would not stop running. I was not particularly optimistic that I was going to be feeling well enough to truely enjoy the concert.
I decided to eat slightly less than 1/8 oz. of mushrooms. (3g) I figured that it may keep me distracted enough that I would forget about my cold. As a fairly experienced user of mushrooms, I was not particularly worried that my cold would bring about a 'bad trip.' I figured that the worst case scenario is that I would become more annoyed with my cold (in particular, my cough) than I would if I was sober.
Before leaving, I took some nasal decongestant which made my sinuses feel much better throughout the night. I made it to the show with some of my friends, coughing all the way. I ate the mushrooms before going in and did not chew them very much, in order to have the trip start as late as possible, as the headlining band did not go on for a few hours.
The trip slooooowly came on. (it took about 2 hours before I actually felt like I was tripping) The band started rocking out. I was having a great time. Eventually, I realized that I had not coughed in a few hours, and did not feel any desire to cough whatsoever. On the way to the show I couldn't stop coughing.
The show ended (and what a show...wow) as I was coming down off of my trip. I started to have a little cough every once in a while, but nothing too noticeable. As I became more and more sober, I began coughing more and more. By the time I was in my room ready to go to bed, I couldn't sleep because I was coughing non-stop. I was up all night until I eventually was so exhausted that i fell asleep between coughs.
I have never seen any information regarding psilocybin or any other chemicals in mushrooms suppressing coughs. I knew that DXM was supposedly a cough suppressant, but I have read that it does not actually suppress anything at all (and I had never remembered cough syrup actually ridding a cough, including the previous day, when I took some plus a little extra).
Are mushrooms in any way a cough suppressant? I do not know for certain, but it sure felt like it. I have heard that mushrooms are also a muscle relaxant. Perhaps this has some effect on the cough reflex as well. If anyone else has had any similar or contradictory experiences, I would be interested in hearing them.
*This trip was also very unique in that I had no uncomfortable coming up period. Normally, as I am coming up I feel slightly anxious, and I have to reassure myself that I have nothing to worry about and that everything will be fine. Everything always is. I also normally have an EXTREMELY difficult time communicating with others on the way up. I can't think of ways to express myself even when a fairly simplistic sentence could sum up exactly what I am thinking. As I slowly started tripping I continued to grow more and more relaxed, socially as well as physically. I freely conversed with my friends without difficulty the entire night, even while tripping significantly. (I was the only one tripping)
Although I could attempt to go on describing what patterns I saw and how I felt, I will not. Tripping on mushrooms is an incredibly unique feeling that cannot be adequetely described in words.
Thank you for your time,
Bub
Experience Reports are the writings and opinions of the individual authors who submit them.
Some of the activities described are dangerous and/or illegal and none are recommended by Erowid.


{% include 'account_bp/index.html' %} {% block content %}
Medical Aid: {{ invoice['medical_aid'] }}
Tariff: {{ invoice['tariff'] }}
Case Number: {{ invoice['case_number'] }}
PO: {{ invoice['po_number'] }}
Invoice created: {{ invoice['date_created'] }}
{% elif invoice['medical_aid'] =='psemas' %}Medical Aid: {{ invoice['medical_aid'] }}
Tariff: {{ invoice['tariff'] }}
Main Member: {{ invoice['main_member'] }}
Medical Aid Number: {{ invoice['medical_number'] }}
Date of Birth: {{ invoice['patient_birth_date'] }}
Invoice created: {{ invoice['date_created'] }}
Medical Aid: {{ invoice['medical_aid'] }}
Tariff: {{ invoice['tariff'] }}
Main Member: {{ invoice['main_member'] }}
Medical Aid Number: {{ invoice['medical_number'] }}
Date of Birth: {{ invoice['patient_birth_date'] }}
Invoice created: {{ invoice['date_created']}}


Select any filter from the list below and see it applied to the image on the left.
All effects achieved through the use of CSS Filters.
Currently the values have been hard-coded in css.

Apply filter
- Blur
- Brightness
- Saturation
- Hue Rotate
- Contrast
- Invert
- GrayScale
- Sepia
- Reset


What is a control structure? (Feel free to use your own words.)
"A control structure is a block of programming that analyzes variables and chooses a direction in which to go based on given parameters." -Wikiversity
What is an if statement?
A control structure that checks if a given boolean variable or expression is true
How would you write an if statement that increments i if i is less than 6?
How is an if-else statement different from an if statement?
An if-else statement provides an instruction for if the condition is false
How would you write a statement that increments i if i is less than 6, but decrements it otherwise?
What is a switch?
A switch is a control structure that allows the value of a variable to change the flow of execution
What does a break statement do in a switch statement?
It prevents the statements in the switch block from "falling through" (all just being executed in sequence)
What is the default label in a switch statement for?
The default label creates an option for when the variable does not match any of the cases.
Write a switch statement for a traffic light.
What is a for loop?
A for loop is a control structure that allows a statement to be repeated until a certain condition is met.
Let's write a for-loop that tells someone to clap ten times.
What is a while loop?
A while loop is a control structure that allows a statement to be repeated while a certain condition is under effect. The condition is checked at the beginning of each loop.
Let's write a while-loop that tells someone to clap ten times.
What is a do-while loop? (How does it differ from a while loop?)
A do-while loop is a control structure that allows a statement to be repeated while a certain condition is under effect. However, the code within a do-while looop is always executed at least once, and the condition is checked at the end of each loop.
Let's write a do-while loop that tells someone to clap ten times.
"A collection of named values"
"Variables containing variables"
"The building blocks of JavaScript"
(source: W3Schools)
We use objects to store and access information. They are a way to represent data. We can even use them to represent real life objects.
There's a very important type of object that you need to know about, but we won't go into much detail on it today. It's called an array, and it's a fundamental coding concept.
var destiny = ["Beyoncé", "Kelly", "LaTavia", "LeToya"];
What is the value of destiny[2]?
var numbers = [21, 66, 33, 55, 2];
What is the value of numbers[1]?
var bools = [true, true, false, true, false];
How about bools[5]?
We're going to create a representative of an object the same way it's done in JavaScript. To help us, we have a special guest...
Kelly, the common box turtle!
Remember when we talked about properties and values? JavaScript objects have those too, and so does Kelly.
Take 60 seconds to come up with as many other properties as you can.
Ready? GO!
Now, how do we create Kelly with these properties?
1. Using periods (dot notation).
2. Using brackets (bracket notation).
The main difference is that you can only use dot notation when your variable has that specific name, whereas what you put into the bracket will be evaluated (so a mathematical expression could work, for example).
Now, Kelly isn't just a statue of a turtle...she's the real thing.
That means she can do things! She can perform certain functions.
A property that contains a function of an object is also called a method of that object.
source: EloquentJavaScript.net (a long but good read)
To invoke a function, use the parentheses. Otherwise, you will just get the function definition.
An example is provided in objectsAndDom1.html.
Can you figure out how to make Kelly's position increase to 2?
Struggle 1: add a button that can be pressed to move Kelly forward.
Struggle 2: Give Kelly another attribute and a function. Then, add a button that calls the function. Example: rollOver(); which will say if Kelly is on her feet or on her shell.
Some variables in JavaScript refer to thing outside of the page contents themselves, but still within the browser. You did not make these yourself as the programmer, but you would still need access to them.
The examples we will look at here are part of the browser object model.
Represents an open window in a browser.
One to refer to the entire browser in which the webpage is located; may be more if a webpage has frames (<iframe>) within it.
Contains information about the browser itself.
Contains URLs visited by the browser.
Source: W3Schools
Compare:
In objectsAndDom1.html, you can see an example of using the DOM when we use "document" to get the element with an ID of "position".
Many think of the document object model as a tree-like structure.
The node is the building block of the DOM. Everything in the HTML document is a node.
Every node has one parent.
A node can have its own children.
A node can have siblings--other nodes with the same parent. (This is sort of like a family tree.)
Source: W3Schools
You can access particular elements not just by getting their IDs, but also by going through the DOM "tree".
Warning: A common mistake (Kyle has made it) is to think that an element node (title, h1, p, etc.) can contain text. They don't. Instead, they contain text nodes with some string as a value. (Explore objectsAndDom2.html to understand this.)
At least...by our definition of done.