Cl-Postgres Reference Manual
The CL-postgres module implements a rather low-level interface for communicating with a PostgreSQL database server. It is part of the Postmodern library, but can be used separately.
Connecting
class database-connection
Representation of a database connection. Contains login information in order to be able to automatically re-establish a connection when it is somehow closed.
(defclass database-connection () ((host :initarg :host :reader connection-host) (port :initarg :port :reader connection-port) (database :initarg :db :reader connection-db) (user :initarg :user :reader connection-user) (password :initarg :password :reader connection-password) (use-ssl :initarg :ssl :reader connection-use-ssl) (use-binary :initarg :binary :accessor connection-use-binary :initform nil) (service :initarg :service :accessor connection-service) (application-name :initarg :application-name :accessor connection-application-name) (socket :initarg :socket :accessor connection-socket) (meta :initform nil) (available :initform t :accessor connection-available) (parameters :accessor connection-parameters) (timestamp-format :accessor connection-timestamp-format)))
function open-database (database user password host &optional (port 5432) (use-ssl :no) (service "postgres")(application-name "") use-binary)
→ database-connection
Create and open a connection for the specified server, database, and user. use-ssl may be :no, :try, :require, :yes, or :full
- :try means if the server supports it
- :require means use provided ssl certificate with no verification
- :yes means verify that the server cert is issued by a trusted CA, but does not verify the server hostname
- :full means expect a CA-signed cert for the supplied hostname and verify the server hostname
If you set it to anything other than :no be sure to also load the CL+SSL library. When it is anything but :no, you must have the CL+SSL package loaded to initiate the connection.
When using ssl, you can set the exported variables *ssl-certificate-file*
, *ssl-key-file*
and *ssl-root-ca-file*
to provide client key, certificate files
and root ca files. They can be either NIL, for no file, or a pathname.
On SBCL and Clozure CL, the value :unix may be passed for host, in order to connect using a Unix domain socket instead of a TCP socket.
Service defaults to "postgres".
Application-name defaults to a blank string. If provided, Postgresl can use it to track applications with multiple connections.
Use-binary defaults to nil. This relates to how Postmodern passes the parameters to Postgresql prepared queries. If you want to have cl-postgres pass integer, float or boolean parameters to Postgresql in binary format, then set this optional parameter to t.
If a query to Postgresql does not have a table column which would allow Postgresql to determine the correct datatype and you do not specify differently, Postgresql will treat the parameters passed with a prepared query as text. The default cl-postgres connection will have results like the following examples:
(defparameter *connect-spec* '("database_name" "user_name" "user_password" "localhost" 5432 :no "postgres" "some_app_name" nil)) (defmacro connect-now (&body body) `(let ((connection (apply 'open-database *connect-spec*))) (unwind-protect (progn ,@body) (close-database connection)))) (connect-now (prepare-query connection "test4" "select $1") (exec-prepared connection "test4" '(42) 'list-row-reader)) (("42")) (connect-now (prepare-query connection "test4" "select $1") (exec-prepared connection "test4" '(T) 'list-row-reader)) (("true")) (connect-now (prepare-query connection "test4" "select $1") (exec-prepared connection "test4" '(nil) 'list-row-reader)) (("false"))
Still in the default setting, you can specify parameter type as so:
(connect-now (prepare-query connection "test1" "select $1::integer") (exec-prepared connection "test1" '(42) 'list-row-reader)) ((42)) (connect-now (prepare-query connection "test1" "select $1::float") (exec-prepared connection "test1" '(42.53) 'list-row-reader)) ((42.53d0)) (connect-now (prepare-query connection "test1" "select $1::boolean") (exec-prepared connection "test1" '(T) 'list-row-reader)) ((T)) (connect-now (prepare-query connection "test1" "select $1::boolean") (exec-prepared connection "test1" '(nil) 'list-row-reader)) ((NIL))
Setting the use-binary slot in the database connection object to t (the last optional parameter) will allow you to pass parameters as binary BUT Postgresql insists on knowing the type of parameters you will be passing in a prepared query. If you do not pass a list of sample parameters, Postgresql will treat all parameters passed in the exec-prepared function required to be text and will throw an error, typically insufficient data left in message. Unlike Postmodern, cl-postgres does not keep a copy of prepared statements in the database connection object. Thus any error checking would require making a second call to Postgresql to find out what it has in the way of prepared statement parameters will lose any efficiency which would otherwise be gained by passing parameters in binary form.
(setf *connect-spec* '("database_name" "user-name" "user-password" "localhost" 5432 :no "postgres" "some-app-name" t)) (connect-now (prepare-query connection "test6" "select $1, $2, $3" '(1 nil 1.0)) (exec-prepared connection "test6" '(42 T 127.89) 'list-row-reader)) ((42 T 127.89))
The default for cl-postgres/Postmodern is to continue to pass parameters to Postgresql as text (not in binary format) in order to avoid breaking existing user code. If you want to pass parameters to Postgresql in binary format and want to set that up when you are making the database connection, the following examples may help. We continue the difference in the signatures (cl-postgres using optional parameters and postmodern using keyword parameters) because of the expected downstream breakage if we shifted cl-postgres:open-database to using keyword parameters.
function close-database (database-connection)
Close a database connection. It is advisable to call this on connections when you are done with them. Otherwise the open socket will stick around until it is garbage collected, and no one will tell the database server that we are done with it.
function reopen-database (database-connection)
Re-establish a database connection for a previously closed connection object. (Calling this on a connection that is still open is harmless.)
function database-open-p (database-connection)
→ boolean
Returns a boolean indicating whether the given connection is currently connected.
method connection-meta (database-connection)
→ hash-table
This method provides access to a hash table that is associated with the current database connection, and is used to store information about the prepared statements that have been parsed for this connection.
method connection-parameters (database-connection)
→ hash-table
This method returns a mapping (string to string) containing all the configuration parameters for the connection.
variable *unix-socket-dir*
Directory where the Unix domain socket for PostgreSQL be found.
On SBCL, when using the :unix keyword as host argument when creating a connection, this variable determines the directory in which CL-Postgres will look for the socket file.
variable *ssl-certificate-file*
variable *ssl-key-file*
variable *ssl-root-ca-file*
When using SSL (see open-database), these can be used to provide client key, certificate files and root ca files. They can be either NIL, for no file, or a pathname.
variable *on-evidence-of-man-in-the-middle-attack*
When establishing an SSL connection, Postmodern will check to see if unexpected extra data was received prior to the connection being encrypted. Unexpected extra data may indicate an attempted man-in-the-middle attack. By default, this variable is set to :error. You can set the response to be a simple warning (by setting this to :warn) or you can set this to :ignore.
variable *retry-connect-times*
(5)
How many times do we try to connect again. Borrowed from pgloader
variable *retry-connect-delay*
(0.5)
How many seconds to wait before trying to connect again. Borrowed from pgloader
function wait-for-notification (database-connection)
This function blocks until asynchronous notification is received on the connection. Retrun the channel string, the payload and notifying pid as multiple values. The PostgreSQL LISTEN command must be used to enable listening for notifications.
function get-postgresql-version (database-connection)
This function returns the version of the connected postgresql instance as a string.
function postgresql-version-at-least (desired-version connection)
Takes a postgresql version number which should be a string with the major and minor versions separated by a period e.g. '12.2' or '9.6.17'. Checks against the connection understanding of the running postgresql version and returns t if the running version is the requested version or newer.
Querying
function exec-query (database-connection query &optional (row-reader 'ignore-row-reader))
→ result
Sends the given query to the given connection, and interprets the results (if there are any) with the given row-reader. If the database returns information about the amount of rows affected, this is returned as a second value.
Example:
(exec-query connection "select 1" 'list-row-reader) '((1)) (exec-query connection "select name from employees where id=3" 'list-row-reader)
function prepare-query (database-connection name query)
Parse and plan the given query, and store it under the given name. Note that prepared statements are per-connection, so they can only be executed through the same connection that prepared them. Also note that while the Postmodern package will also stored the prepared query in the connection-meta slot of the connection, but cl-postgres prepare-query does not. If the name is an empty string, Postgresql will not store it as a reusable query.
If parameters are not passed, Postgresql will assume the parameters will be text. In order to pass integer, float or boolean parameters as binary even when the database-connection is set to use binary parameters, you need to pass a list of parameters with the same type as you will be using when you call (exec-prepared).
The following example shows preparing and executing a query that will accept a boolean parameter:
(prepare-query connection "test-bool" "select $1" '(t)) (exec-prepared connection "test-bool" '(nil) 'list-row-reader) '((nil))
See also the discussion under open database with respect to the use-binary parameter.
function exec-prepared (database-connection name parameters &optional (row-reader 'ignore-row-reader))
→ result
Execute the prepared statement by the given name. Parameters should be given as a list. Each value in this list should be of a type that to-sql-string has been specialised on. (Byte arrays will be passed in their binary form, without being put through to-sql-string.) The result of the executing the statement, if any, is interpreted by the given row reader, and returned. Again, the number or affected rows is optionally returned as a second value.
The following example shows preparing and executing a query that will accept an integer and a float in that order:
(prepare-query connection "test-prepl" "select $1" '(10 7.4)) (exec-prepared connection "test-prep1" '(12 4.2) 'list-row-reader) '((nil))
function unprepare-query (database-connection name)
Close the prepared query given by name by closing the session connection. Note: This is not the same as keeping the connection open and sending Postgresql query to deallocate the named prepared query. That can be done with the postmodern package's function:
(drop-prepared-statement (name &key (location :both) (database *database*) (remove-function t))
method to-sql-string (value)
→ (values string needs-escaping)
Convert a Lisp value to its textual unescaped SQL representation. Returns a second value indicating whether this value should be escaped if it is to be put directly into a query. Generally any string is going to be designated to be escaped.
As of cl-postgres version 1.33.7 the lisp values handled are:
- string
- vector
- cons (must be a proper list and cannot be an empty list) (added in v. 1.33.7)
- array
- integer
- float (single or double except for clisp which does not have a double float)
- ratio
- t
- nil
- :null
Anything else will throw an error that this value cannot be converted to a sql literal.
You can define to-sql-string methods for your own datatypes if you want to be able to pass them to exec-prepared. When a non-NIL second value is returned, this may be T to indicate that the first value should simply be escaped as a string, or a second string providing a type prefix for the value. (This is used by S-SQL.)
variable *silently-truncate-ratios*
Given a ratio, a stream and a digital-length-limit, if *silently-truncate-ratios*
is true,
will return a potentially truncated ratio. If false and the digital-length-limit is reached,
it will throw an error noting the loss of precision and offering to continue or reset
*silently-truncate-ratios*
to true. Code contributed by Attila Lendvai.
variable *query-log*
When debugging, it can be helpful to inspect the queries that are being sent
to the database. Set this variable to an output stream value (*standard-output*
,
for example) to have CL-postgres log every query it makes.
variable *query-callback*
When profiling or debugging, the *query-log*
may not give enough information,
or reparsing its output may not be feasible. This variable may be set to a
designator of function taking two arguments. This function will be then called
after every query, and receive query string and internal time units (as in
(CL:GET-INTERNAL-REAL-TIME)) spent in query as its arguments.
Default value of this variable is 'LOG-QUERY, which takes care of *QUERY-LOG*
processing. If you provide custom query callback and wish to keep *QUERY-LOG*
functionality, you will have to call LOG-QUERY from your callback function
function log-query (query internal-time)
This function is default value of *QUERY-CALLBACK*
and logs queries
to *QUERY-LOG*
if it is not NIL.
Reading values
CL-postgres knows how to convert commonly used PostgreSQL data types to Lisp values. This table shows the mapping:
| PostgreSQL | Lisp |
| smallint | integer |
| integer | integer |
| bigint | integer |
| numeric | ratio |
| real | float |
| double precision | double-float |
| boolean | boolean |
| varchar | string |
| text | string |
| bytea | (vector (unsigned-byte 8)) |
| array | array |
The mapping from PostgreSQL types (identified by OID numbers) to the functions that interpret them is kept in so-called SQL readtables. All types for which no reader is defined will be returned as string values containing their PostgreSQL representation.
variable *sql-readtable*
The exported special var holding the current read table, a hash mapping OIDs to instances of the type-interpreter class that contain functions for retreiving values from the database in text, and possible binary, form.
For simple use, you will not have to touch this, but it is possible that code within a Lisp image requires different readers in different situations, in which case you can create separate read tables.
function copy-sql-readtable (table)
→ readtable
Copies a given readtable.
function default-sql-readtable ()
→ readtable
Returns the default readtable, containing only the readers defined by CL-postgres itself.
function set-sql-reader (oid function &key table binary-p)
Define a new reader for a given type. table defaults to *sql-readtable*
.
The reader function should take a single argument, a string, and transform
that into some kind of equivalent Lisp value. When binary-p is true, the reader
function is supposed to directly read the binary representation of the value.
In most cases this is not recommended, but if you want to use it: provide a
function that takes a binary input stream and an integer (the size of the
value, in bytes), and reads the value from that stream. Note that reading
less or more bytes than the given size will horribly break your connection.
function set-sql-datetime-readers (&key date timestamp timestamp-with-timezone time interval table)
Since there is no widely recognised standard way of representing dates and times in Common Lisp, and reading these from string representation is clunky and slow, this function provides a way to easily plug in binary readers for the date, time, timestamp, and interval types. It should be given functions with the following signatures:
- :date (days)
Where days is the amount of days since January 1st, 2000.
- :timestamp (useconds)
Timestamps have a microsecond resolution. Again, the zero point is the start of the year 2000, UTC.
- :timestamp-with-timezone
Like :timestamp, but for values of the 'timestamp with time zone' type (which PostgreSQL internally stores exactly the same as regular timestamps).
- :time (useconds)
Refers to a time of day, counting from midnight.
- :interval (months days useconds)
An interval is represented as several separate components. The reason that days and microseconds are separated is that you might want to take leap seconds into account.
Row readers
Row readers are a way to read and group the results of queries. Roughly, they are functions that perform the iteration over the rows and cells in the result, and do something with the returned values.
macro row-reader ((fields) &body body)
→ function
Creates a row-reader, using the given name for the variable. Inside the body this variable refers to a vector of field descriptions. On top of that, two local functions are bound, next-row and next-field. The first will start reading the next row in the result, and returns a boolean indicating whether there is another row. The second will read and return one field, and should be passed the corresponding field description from the fields argument as a parameter.
A row reader should take care to iterate over all the rows in a result, and within each row iterate over all the fields. This means it should contain an outer loop that calls next-row, and every time next-row returns T it should iterate over the fields vector and call next-field for every field.
The definition of list-row-reader should give you an idea what a row reader looks like:
(row-reader (fields) (loop :while (next-row) :collect (loop :for field :across fields :collect (next-field field))))
Obviously, row readers should not do things with the database connection like, say, close it or start a new query, since it still reading out the results from the current query.
macro def-row-reader (name (fields) &body body)
The defun-like variant of row-reader: creates a row reader and gives it a top-level function name.
method field-name (field)
→ string
This can be used to get information about the fields read by a row reader. Given a field description, it returns the name the database associated with this column.
method field-type (field)
→ oid
This extracts the PostgreSQL OID associated with this column. You can, if you really want to, query the pg_types table to find out more about the types denoted by OIDs.
function list-row-reader (socket fields)
→ list
A row reader that builds a list of lists from the query results.
function alist-row-reader (socket fields)
→ alist
A row reader that returns a list of alists, which associate column names with values.
function ignore-row-reader (socket fields)
A row reader that completely ignores the result of a query.
Bulk Copying
When loading large amounts of data into PostgreSQL, it can be done significantly faster using the bulk copying feature. The drawback to this approach is that you don't find out about data integrity errors until the entire batch is completed but sometimes the speed is worth it
function open-db-writer (db table &optional columns)
Opens a table stream into which rows can be written one at a time using db-write-row. db is either a connection object or a list of arguments that could be passed to open-database. table is the name of an existing table into which this writer will write rows. If you don't have data for all columns, use columns to indicate those that you do.
function close-db-writer (writer &key abort)
Closes a bulk writer opened by open-db-writer. Will close the associated database connection when it was created for this copier, or abort is true.
function db-write-row (writer row-data)
Writes row-data into the table and columns referenced by the writer. row-data is a list of Lisp objects, one for each column included when opening the writer. Arrays (the elements of which must all be the same type) will be serialized into their PostgreSQL representation before being written into the DB.
Normalization
function saslprep-normalize (str &optional form)
→ string
Scans string. If any character should be mapped to nothing, it eliminates that character. If any character is not printable ascii, it returns nil. If every character remaining after eliminations is printable ascii, it returns the printable-ascii string. It then calls (uax-15:normalize str form) to normalize the string based on the provided unicode form, defaulting to :nfkc.
function string-mapped-to-nothing (str)
→ string
Reads a string and removes any character that should be mapped to nothing per RFC 3454 and RFC 4013.
function string-mapped-to-space (str)
→ string
Reads a string and converts any character which should be mapped to a space per RFC 3454 and RFC 4013 to a space.
function string-printable-ascii-p (str)
→ boolean
Returns t if every character in the string is printable ascii.
Conditions
Opening or querying a database may raise errors. CL-postgres will wrap the errors that the server returns in a lisp condition, and raise conditions of the same type when it detects some problem itself. Socket errors are let through as they are.
condition database-error
This is the condition type that will be used to signal virtually all database-related errors \(though in some cases socket errors may be raised when a connection fails on the IP level). For errors that you may want to catch by type, the cl-postgres-error package defines a bucket of subtypes used for specific errors. See the cl-postgres/package.lisp file for a list.
method database-error-message (database-error)
→ string
The primary human-readable error message. This should be accurate but terse (typically one line). Always present.
method database-error-detail (database-error)
→ string
Detail: an optional secondary error message carrying more detail about the problem. Might run to multiple lines or NIL if none is available.
method database-error-code (database-error)
→ string
Code: the Postgresql SQLSTATE code for the error (see the Postgresql Manual Appendix A for their meaning). Not localizable. Always present.
method database-error-query (database-error)
→ string
The query that led to this error, or NIL if no query was involved.
method database-error-cause (database-error)
→ condition
The condition that caused this error, or NIL when it was not caused by another condition.
function database-error-constraint-name (database-error)
→ string
For integrity-violation error, given a database-error for an integrity violation, will attempt to extract and return the constraint name (or nil if no constraint was found).
function database-error-extract-name (database-error)
→ string
For various errors, returns the name provided by the error message (or nil if no such name was found.)
condition database-connection-error
Subtype of database-error. An error of this type (or one of its subclasses) is signaled when a query is attempted with a connection object that is no longer connected, or a database connection becomes invalid during a query. Always provides a :reconnect restart, which will cause the library to make an attempt to restore the connection and re-try the query.
The following shows an example use of this feature, a way to ensure that the first connection error causes a reconnect attempt, while others pass through as normal. A variation on this theme could continue trying to reconnect, with successively longer pauses.
(defun call-with-single-reconnect (fun) (let ((reconnected nil)) (handler-bind ((database-connection-error (lambda (err) (when (not reconnected) (setf reconnected t) (invoke-restart :reconnect))))) (funcall fun))))
condition postgresql-notification
The condition that is signalled when a notification message is received from the PostgreSQL server. This is a WARNING condition which is caught by the WAIT-FOR-NOTIFICATION function that implements synchronous waiting for notifications.
method postgresql-notification-channel (postgresql-notification)
→ string
The channel string of this notification.
method postgresql-notification-payload (postgresql-notification)
→ string
The payload of this notification.
method postgresql-notification-pid (postgresql-notification)
→ integer
The process ID of the process that sent the notification.


THE FIFTH ELEMENT A film review by Cameron Shelley Copyright 1997 Cameron Shelley
(Columbia)
Review by: Cameron Shelley -- May 21, 1997. Review URL: http://watarts.uwaterloo.ca/~cpshelle/Reviews/tfe.html Cast: Bruce Willis (Korben Dallas), Gary Oldman (Zorg), Milla Jovovich (Leeloo), Ian Holm (Victor Cornelius), Chris Tucker (DJ Ruby Rhod) Screenplay: Luc Besson and Robert Mark Kamen Director: Luc Besson Producer: John Alan Amicarella, Patrice Ledoux, and Iain Smith
The Fifth Element is a hard movie to pin down. Perhaps the best way to describe it is as a collage of sights and events organized (if that is the word) around the mission of an unlikely hero to save the world. For me, at least, watching TFE had the quality of a daydream, or the fantasies sparked in adolescent years when reading a comic book. Like a daydream, the sequence of events makes little sense upon later reflection, and like an adolescent fantasy, the characters are drawn from a small stock of simple and familiar types.
But it is the "sparky" aspect of TFE that is most obvious. Scenes, jokes, and plot devices fly off energetically and disappear in almost all directions. This is probably what has prompted so many reviewers to compare TFE to nearly every other science-fiction movie they've seen. Certainly, TFE does have a kind of borrowed look. The hovering cars are reminiscent of Blade Runner, the glowing ball of evil and the cabbie hero of Heavy Metal, the Egyptian aliens of Stargate, the farcical police of Brazil, and on and on. Plenty of action-adventure cliches get screen time as well - although I think the 3-D car chase scene was pretty good and deserves credit for originality. But Besson seems neither to parody nor plagiarize these earlier films. TFE is simply a pastiche of their more obvious attributes. If you consider collage to be good art, then TFE could be appealing; otherwise it will probably seem to be just pointlessly contrived. My own view is somewhat in between: I don't get the impression that Besson is just rehashing used material from the genre, but neither does his profligate use of such material seem coherently ironic or tongue-in-cheek. To a large extent, it is all just there.
In any case, Besson does his borrowing pretty well. The scenery, gizmos, and aliens are generally lively and eye-catching. The costumes too are interesting and appropriate. The inscrutable and somewhat maladroit aliens, the Mondoshawan, have big, clunky environment suits to stomp around in. The belligerent (and stupid) Mangalores dress and act like rhinos, at least when not in disguise. And the bizarre talk-show host, Ruby Rhod, looks and talks like a sped-up version of Prince with his hair on amphetamines. And, of course, there are many gorgeous women in various states of dress and undress. These characters, and the special effects associated with them, succeed in holding the viewer's attention and interest while on screen.
Generally, the acting is also good in the sense that it is energetic and appropriate to the task. Jovovich, in fact, puts on a good performance as Leeloo, the genetically perfect human sent to Earth by the Mondoshawan to save it from the big evil ball from another dimension. Her role is one of the naive innocent thrust into a fallen world she naturally doesn't understand, which she delivers with a sort of girlish enthusiasm. Gary Oldman also deserves credit for a deftly greasy turn as the evil industrialist Zorg, who is in cahoots with the evil ball itself (we know this because the ball gives Zorg a phone call, calling itself "Mr. Shadow"), while Chris Tucker goes "over-the-top" portraying the shrill and mincing Ruby Rhod. At the center of all this is the character of Korbin Dallas, as mailed in by Bruce Willis. Willis's performance is often flat (as opposed, say, to understated), a problem which may be caused by the similarity of Korbin to most other characters Willis has played since Moonlighting. Whereas TFE's other borrowings are generally superficial and lightly handled, Willis's self-plagiarism comes off as plodding, at least when there are no babes or firefights to distract attention from him.
The roughest point of the movie, though, concerns the plot. Certainly, action-adventures aren't supposed to be intellectually challenging, but the plot of TFE is inexplicably arbitrary even for its genre.  Every 5000 years, the Earth is saved from the evil ball by the benevolent Mondoshawan, using the four elements of earth, air, water, and fire, and a mysterious Fifth Element (Leeloo). But the Mondoshawan change the plan, with the result that in 2300 they fail and humanity must be bailed out by genetic engineering and a heroic cabbie. No motivation for these intricacies is offered, nor do they make much sense in retrospect. Well, the Mondoshawan do actually offer their motivational motto, "Time is nothing, life is most important," (here they sound like ad men for Pepsi) upon arriving three hundred years early, killing an Egyptologist for knowing too much, and then taking off with Earth's only means of defense. Yeah, thanks. Attempts to moralize intrude awkwardly from time to time, as when Zorg nearly chokes to death on a cherry, or when Leeloo learns about "war" and suddenly wonders if humanity is worth saving. Fortunately, Korbin saves the day by declaring his love for Leeloo. Oddly, Besson seems to really want to make a meal of this last-minute complication, but only gets well-deserved snickering from the audience. TFE does alright in the use of the future to parody the present, but it can hardly claim to be an exploration of serious issues such as war, love, or the rather suspect notion of "perfection" in genetic engineering either.
TFE is carried by its energy and surface appeal, but it is a precariously thin surface. Having borrowed so heavily from other works, Besson risks having his film already eclipsed by its predecessors as well as its successors. The next big effects-driven, science-fiction picture may indeed finish the job. As Bruce Willis said, in reacting to some negative reviews of TFE, "The written word is going the way of the dinosaur." Presumably, then, the next picture with an even larger ratio of effects budget to writing budget will be even better!
<EMAIL_ADDRESS>- Phone:<PHONE_NUMBER> x2555
Me:
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


How this works...
programmer 1: Hey, it turns out you don't need semicolons in JavaScript, and my previous reasons for putting them there are not actually true. Neat.
programmer 2: Yeah, but it'll break.
p1: But... that's just it, it *doesn't* break. It's actually ok for me to do this.
p2: No it isn't.
p1: Why not?
p2: Browser bugs.
p1: Which browsers?
p2: All of them.
p1: Well, it works fine on all the engines I've tested---
p2: IE.
p1: Works fine there, too. Even in IE 5.
p2: Compression. Compressors can't handle it. Need the semicolons. All of them.
p1: All the compressors in use today handle it fine. In fact, the code compresses a little *better* in most of them.
p2: Well, whatever, that's not how it's done.
p1: Ok, well, there are other reasons to do things besides a convention. I mean, you're wearing an unconventional hat, and that's cool.
p2: So, now you have a problem with my coding style AND my hat??  Seriously. You crossed a line, dude. Too far.
p1: [puzzled] I don't get why this an issue, I mean, if you see the spec, it says---
p2: You just can't let this go, can you? Why don't you lighten up?
p1: Let what go, exactly? And I don't really think that I'm the one who needs to lighten anything.
p2: Oh, so now you come in with the personal attacks. I get it.  HAVE YOU NO DECENCY, SIR? AT LONG LAST, HAVE YOU NO DECENCY?
p1: I think maybe hacker news isn't for me...


Hang your shirt in a Spfy when you get home and start every day with all of your shirts available.
Dry cleaning chemicals put unneeded wear and tear on your expensive garments. Spfy will keep your shirts looking professional without the wear and tear of dry cleaning.
Spfy will save you thousands over the lifetime of the product compared to dry cleaning costs, which add up quick.
1200mm x 900mm x 150mm
Designed to fit easily into standard household closets
Connects to 120V Power with a 3m cable
15 minute cleaning time
Refillable water tank included
Uses standard laundry detergent
Mechatronics Engineering
Manufacturing and Prototyping at Tesla
Commerce
Entrepreneurship and Marketing
Mechanical Engineering
SMART Technologies
Computer Engineering
IBM, UBC Launch Pad
Business and Computer Science
Yahoo! Inc.


Ant Script Library: asl-java-report.xml
Overview
asl-java-report.xml
contains properties and targets for various
generated reports about Java code. Available reports are:
report-all . report-checkstyle . report-cobertura . report-cpd . report-findbugs . report-javadoc . report-jdepend . report-pmd . report-tests
Properties
All properties defined with this module are prefixed with
"java-report.
".
The following property affects the default location of all reports in this module. Other report specific properties are documented with the report target below.
| Name | Default Value | Description |
|---|---|---|
java-report.report-dir |
${common.dist-dir}/reports |
The top level directory under which all generated reports will be placed. |
Targets
report-all
Generates all available reports.
report-checkstyle
Generates a Checkstyle report. The follow properties control the behaviour of this report:
| Name | Default Value | Description |
|---|---|---|
java-report.checkstyle-dir |
${java-report.report-dir}/checkstyle |
The directory where the Checkstyle report will be generated. |
java-report.checkstyle-libdir |
${java-report.basedir}/lib/checkstyle |
There directory containing the Checkstyle jar file. |
java-report.checkstyle-config-file |
${java-report.checkstyle-libdir}/config/sun_checks.xml |
The configuration file for Checkstyle, which can be used to control what checks are performed. |
java-report.checkstyle-data-dir |
${common.target-dir}/checkstyle-data |
The directory where the Checkstyle data will be stored. |
java-report.checkstyle-data-file |
${java-report.checkstyle-data-dir}/checkstyle-data.xml |
The file where the Checkstyle data will be stored. |
java-report.checkstyle-stylesheet |
${java-report.checkstyle-libdir}/xsl/checkstyle-noframes.xsl |
The XSLT stylesheet used to generate the HTML report |
report-cobertura
Generates a Cobertura test coverage report.
The location of this report is controlled by the property
java-report.coverage-dir
:
| Name | Default Value | Description |
|---|---|---|
java-report.coverage-dir |
${java-report.report-dir}/coverage |
The directory where the test coverage report will be generated. |
report-cpd
Generates a Copy-Paste Detection report. The follow properties control the behaviour of this report:
| Name | Default Value | Description |
|---|---|---|
java-report.cpd-dir |
${java-report.report-dir}/cpd |
The directory where the copy-paste detection report will be generated. |
java-report.cpd-data-dir |
${common.target-dir}/cpd-data |
The directory where the CPD data will be stored. |
java-report.cpd-data-file |
${java-report.cpd-data-dir}/cpd-data.xml |
The file where the CPD data will be stored |
java-report.cpd-minimum-token-count |
75 |
The minimum number duplicated tokens that will trigger a warning. |
java-report.cpd-stylesheet |
${java-report.pmd-libdir}/etc/xslt/cpdhtml.xslt |
The XSLT stylesheet used to generate the HTML report |
report-findbugs
Generates a FindBugs report. The follow properties control the behaviour of this report:
| Name | Default Value | Description |
|---|---|---|
java-report.findbugs-failbuild |
(unset) |
If this property is set, any FindBugs warnings will cause the build to fail. |
java-report.findbugs-home |
${java-report.basedir}/lib/findbugs |
The directory containing the FindBugs installation. |
java-report.findbugs-dir |
${java-report.report-dir}/findbugs |
The directory where the FindBugs report will be generated. |
java-report.findbugs-libdir |
${java-report.findbugs-home}/lib |
The directory containing the FindBugs jar files. |
java-report.findbugs-data-dir |
${common.target-dir}/findbugs-data |
The directory where the FindBugs data will be stored. |
java-report.findbugs-data-file |
${java-report.findbugs-data-dir}/findbugs.xml |
The file where the FindBugs data will be stored. |
java-report.findbugs-stylesheet |
${java-report.findbugs-home}/src/xsl/default.xsl |
The XSLT stylesheet used to generate the HTML report |
java-report.findbugs-report-file |
${java-report.findbugs-dir}/index.html |
The name of the HTML report file. |
java-report.findbugs-jvmargs |
-Xmx512m |
Extra arguments that will be passed to the JVM running FindBugs. |
report-javadoc
Generates JavaDoc
for all the source code underneath the directory specified by the property
java-build.src-dir
.
| Name | Default Value | Description |
|---|---|---|
java-report.javadoc-dir |
${java-report.report-dir}/javadoc |
The directory where the JavaDoc documentation will be generated. |
java-report.javadoc-window-title |
${ant.project.name} |
The title that will appear on the JavaDoc. |
java-report.javadoc-doc-title |
${java-report.javadoc-window-title} - ${common.timestamp-long} |
The title that will appear at the top of the JavaDoc pages. |
report-jdepend
Generates a JDepend report. The follow properties control the behaviour of this report:
| Name | Default Value | Description |
|---|---|---|
java-report.jdepend-dir |
${java-report.report-dir}/jdepend |
The directory where the JDepend report will be generated. |
java-report.jdepend-data-dir |
${common.target-dir}/jdepend-data |
The directory where the JDepend data will be stored. |
report-pmd
Generates a PMD code quality report. The follow properties control the behaviour of this report:
| Name | Default Value | Description |
|---|---|---|
java-report.pmd-dir |
${java-report.report-dir}/pmd |
The directory where the PMD report will be generated. |
java-report.pmd-libdir |
${java-report.basedir}/lib/pmd |
The directory containing the PMD jar files. |
report-tests
Generates a test report from the set of JUnit
xml reports found in the directory ${java-test.test-data-dir}
.
Note that both the test-unit
target and the test-integration
target will place their data files in that directory.
| Name | Default Value | Description |
|---|---|---|
java-report.test-dir |
${java-report.report-dir}/test |
The directory where the test report will be generated. |
java-test.test-data-dir |
${common.target-dir}/test-data |
The directory containing all the generated test result data. |
Is there a problem or mistake on this page? Do you want to contribute some changes? Send me an email at joe@exubero.com.


NTL Application Type
Specify the application type and platform support for your NTL project.
Overview
Application Type
Application Settings
Application type:
C
oncole (exe)
W
in32 program (exe)
Dynamic
L
ink Library (dll)
N
ative (exe)
System
d
river (sys)
Platform support:
x
8
6 code
x
6
4 code
Unicode support:
U
nicode Character Set
Finish
Cancel
Help


Class ControllerPoseSynchronizer
Waits for a controller to be initialized, then synchronizes its transform position to a specified handedness.
Inheritance
ControllerPoseSynchronizer
Implements
UnityEngine.EventSystems.IEventSystemHandler
Assembly: XRTK.SDK.dll
public class ControllerPoseSynchronizer : InputSystemGlobalListener, IMixedRealityControllerPoseSynchronizer, IMixedRealitySourcePoseHandler, IMixedRealitySourceStateHandler, IMixedRealityInputHandler, IMixedRealityInputHandler<float>, IMixedRealityInputHandler<Vector2>, IMixedRealityInputHandler<Vector3>, IMixedRealityInputHandler<Quaternion>, IMixedRealityInputHandler<MixedRealityPose>, IEventSystemHandler
Fields
|
Improve this Doc
View Source
Declaration
protected TrackingState TrackingState
Field Value
Properties
|
Improve this Doc
View Source
The current controller reference.
Declaration
public virtual IMixedRealityController Controller { get; set; }
Property Value
|
Improve this Doc
View Source
Should this GameObject clean itself up when it's controller is lost?
Declaration
public bool DestroyOnSourceLost { get; set; }
Property Value
|
Improve this Doc
View Source
The controller handedness to synchronize with.
Declaration
public Handedness Handedness { get; protected set; }
Property Value
|
Improve this Doc
View Source
Is the controller this Synchronizer is registered to currently tracked?
Declaration
public bool IsTracked { get; protected set; }
Property Value
|
Improve this Doc
View Source
The input action that will drive the Transform's pose, position, or rotation.
Declaration
public MixedRealityInputAction PoseAction { get; set; }
Property Value
|
Improve this Doc
View Source
The Transform that will be synchronized with the controller data.
Declaration
public Transform PoseDriver { get; set; }
Property Value
|
Improve this Doc
View Source
Should the Transform's position be driven from the source pose or from input handler?
Declaration
public bool UseSourcePoseData { get; set; }
Property Value
Methods
|
Improve this Doc
View Source
Declaration
public virtual void OnInputChanged(InputEventData<float> eventData)
Parameters
|
Improve this Doc
View Source
Declaration
public virtual void OnInputChanged(InputEventData<Quaternion> eventData)
Parameters
|
Improve this Doc
View Source
Declaration
public virtual void OnInputChanged(InputEventData<Vector2> eventData)
Parameters
|
Improve this Doc
View Source
Declaration
public virtual void OnInputChanged(InputEventData<Vector3> eventData)
Parameters
|
Improve this Doc
View Source
Declaration
public virtual void OnInputChanged(InputEventData<MixedRealityPose> eventData)
Parameters
|
Improve this Doc
View Source
Input Down updates from Interactions, Keys, or any other simple input.
Declaration
public virtual void OnInputDown(InputEventData eventData)
Parameters
|
Improve this Doc
View Source
Input Up updates from Interactions, Keys, or any other simple input.
Declaration
public virtual void OnInputUp(InputEventData eventData)
Parameters
|
Improve this Doc
View Source
Raised when a source is detected.
Declaration
public virtual void OnSourceDetected(SourceStateEventData eventData)
Parameters
|
Improve this Doc
View Source
Raised when a source is lost.
Declaration
public virtual void OnSourceLost(SourceStateEventData eventData)
Parameters
|
Improve this Doc
View Source
Raised when the source rotation is changed.
Declaration
public virtual void OnSourcePoseChanged(SourcePoseEventData<Quaternion> eventData)
Parameters
|
Improve this Doc
View Source
Raised when the source position is changed.
Declaration
public virtual void OnSourcePoseChanged(SourcePoseEventData<Vector2> eventData)
Parameters
|
Improve this Doc
View Source
Raised when the source position is changed.
Declaration
public virtual void OnSourcePoseChanged(SourcePoseEventData<Vector3> eventData)
Parameters
|
Improve this Doc
View Source
Raised when the source pose tracking state is changed.
Declaration
public virtual void OnSourcePoseChanged(SourcePoseEventData<TrackingState> eventData)
Parameters
|
Improve this Doc
View Source
Raised when the source pose is changed.
Declaration
public virtual void OnSourcePoseChanged(SourcePoseEventData<MixedRealityPose> eventData)
Parameters
Implements
UnityEngine.EventSystems.IEventSystemHandler
Extension Methods


Lying and deceiving is dated as early as the beginning of human communication itself. Our society recognizes and even embraces (Santa, White lies, Secret Agents) some parts of this ability to hide or manipulate the truth. In general, whether a person is bluntly lying or simply leaving out facts in order to deceive us - we want to know the whole picture. Knowing the truth gives us better understanding of the situation and the ability to make intelligent choices.
Throughout the years numerous research works were conducted in order to better understand the human deception mechanism and find giveaways. Some of the recent computer vision based works introduce eye-blinks and pupil dilation patterns, eulerian video magnification techniques and micro-expressions analysis. Continuing recent ground-breaking works with depth cameras, our project approaches the lie detection challenge from the side of facial motion analysis using modern computer vision and machine learning techniques.
In essence, our project is a computer system that is able to decide if a person is concealing information, by analyzing a video stream of the subject passing CIT-like questionnaire acquired from depth camera. We introduce a novel technique for learning subject-tailored classifier. By this we eliminate human bias and the need in physical contact with subject at time of the test, which raises extra consciousness in the subject. We developed a simple, portable and quickly deployed solution.


{% extends "base.html" %} {% block title %} Wellbeing | Calorie Calculator {% endblock title %} {% block content %}
Give any common food (i.e Apple, Soup, Burger, Pizza, Ice Cream, Vegies, Fruits ),gives the calories on that disease, if multiple edibles gives the sum of the calories in the edibles and substracts them from your daily calorie required and gives whether do you need more calories or its enough for today!


Benefits of joining
The Online Academy offers easy-to-digest, digital courses that are expertly designed to improve multiple aspects of young people’s lives. Topics range from How to Start Your Own Business, Writing a Killer CV and Successful Habits to Public Speaking, Employment Opportunities and Money Making Ideas, plus many more essential life skills.
The course content, presentation style and accessibility is based on international best practice combined with feedback received from thousands of young people who have attended Pride Factor events and completed online surveys, and is constantly being updated and improved.
Each course is hosted by aspirational role models and presented in a concise and conversational style via a series of episodes that can be accessed at any time and on any form of digital platform. Links to related content, interactive instructions and digital workbooks, as well as motivation and advice, are included throughout.
A Certificate of Achievement is issued on completion of each course and students are motivated via prizes and rewards, along with Pride Factor’s unique ‘Earn Whle You Learn’ offering.
“It’s like a new-age digital finishing school that teaches the life-lessons needed for the transition between schooler / student and adulthood. It’s absolutely brilliant!”
– Vuyo Joboda – (Pride Factor student)


Before Change
return self._transitive_deps_by_target
// Sort from least to most dependent.
sorted_targets = reversed(InternalTarget.sort_targets(self._context.targets()))
transitive_deps_by_target = defaultdict(set)
// Iterate in dep order, to accumulate the transitive deps for each target.
for target in sorted_targets:
After Change
and injected deps are taken into account.
if self._transitive_deps_by_target is None:
return self._compute_transitive_deps_by_target()
else:
return self._transitive_deps_by_target
def _compute_transitive_deps_by_target(self):


×
x4 = bid x2
x4 = bid x3
x4 = bid x5
x4 = bid x7
x4 = bid x10
do not lose bid
4 different cards
bid x 1.5
Gambling machine
Draw
Show legend
10$
30$
50$
Your money:
Won draws:


123
Picture information 1
Picture information 2
Picture information 3
Picture information 4
Picture information 5


HOME
ABOUT US
SERVICES
CREATIVE BLOG
CURRENT AFFAIRS
POLITICS
SPORTS
SENSEX
ETC..
MONETIZATION
PORTFOLIO
CONTACT US
INNOVATIVE BLOG'S
GET STARTED
GET BLOGIFIED!!


| Components | Average Price (NTD) |
|---|---|
| Chip | 100 |
| Resistor | 1 |
| Capacitor | 100 |
| milestone | work | memo |
|---|---|---|
| M1 | Basic UI Design | |
| M2 | Implement Google OAuth Service | |
| v0.1.1 | User able to Submit Orders | |
| v0.1.2 | Provide a Administration Console | |
| v0.1.3 | Implement a user’s order history and paying platform | Alpha Release |
| v0.2 | Implement a area let user writes reviews | |
| v0.3 | Create function for user to submit item for Exchange | |
| v1.4 | Enter beta stage |
- CHIPHUB


{%- extends 'base.html' -%} {%- block content -%}
Our life experiences and this new model led us to realize that many humans have questions about sexuality and in particular their own genitals.
Sadly, there are few places where you can find answers to these questions. Unfortunately many people get sexual knowledge from consuming pornography, which promotes a lot of concepts and ideas that simply do not apply to real life. We hope to make models available so that anyone can view, study, download or even print these models without time pressure, in privacy. Printing our models for your purposes should also be inexpends and reasonably fast.
With this project we aim educate the world about human sexuality by making 3D models of genitals of human genitalia from all over the world. We aim to show females, males and many in between; all major ethnicities, body shapes and ages. We aim to show common shapes and uncommon shapes alike -- both are beautiful.
All of our human models will be anonymous and must provide written consent. We will destroy all source images and personally identifying information as soon as the 3D model is created from the source photos. The human models may revoke their consent to have their 3D models on this site. However, it is impossible to remove all the copies that people have downloaded.
Our goal is to be educational; not creepy.
We are not peddling pornography.
We aim to disspel myths about the human body.
Find out more about our team.
We Are Beautiful is a company headquartered in Tallin, Estonia. Our models are created near Zürich, Switzerland and the company web site and business is created and maintained from Barcelona, Spain.


Just wanted to update
everyone regarding the status of the new Montana Bicycle
Racing Association.
At this point, here are the
particulars:
MBRA
Executive:
President -- John Weyhrich
Vice-President -- Jeff
Crouch
Treasurer -- Steve Dolberg
Secretary -- Tim Bechtold
Development -- Geoff Proctor
Licensing/Officials -- Rob
Whitacre
Board of Directors:
Scott Herzig (Montana Velo)
Shelly Harris (Yellowstone
Valley Cycling Club)
Jason Mohr (Northern Rockies
Cycling Club)
Rich West (Echelon Cycling
Club)
John Coulthard (Highlands
Cycling Club)
Byron DeFord (Great Divide
Cycling Team)
Fred Michini (5 Valley Velo)
Steve W (Flathead Velo)
John Behrens (Gallatin
Valley Bicycle Club)
As of April 12, Rob Whitacre
will be handling licensing and officiating issues.
Please direct all requests
for upgrades, officials' tests, officials' assignments for
races, etc. to Rob (617 S.
9th Street, #3; Bozeman 59715; 586-4315; or
<EMAIL_ADDRESS>).
Additionally, Tim Bechtold
will review race permits prior to their submission to
USCF (note that this a
requirement, per our agreement with USA Cycling). Tim can
be contacted at<EMAIL_ADDRESS>Please be sure to thank
these individuals for volunteering for these important roles.
Their efforts should allow
both the racing and the race permitting processes to flow
more smoothly in the
future. Be on the lookout, also, for
further details regarding
our developmental and other
programs.
Feel free to contact me, any
of the executive members, or your team representative
if you have any questions or
concerns.
Best regards,
John


Everybody loves David Puddy's Magic 8 Ball jacket! Now YOU get the chance to ask it a question! Type your answer in the box below, and hit Enter or click the 'Ask Puddy!' button to ask your question. Make sure you have your sound turned up when you ask your question!


HAYDEN SHOES
Welcome,
Mirela Hayden
Home
Profile
Sales
Boutiques
Employees
Executive
Manager
Employee


Product Details
-
EMV Compliant – Accept chip cards and avoid liability for counterfeit credit card fraud
-
NFC Capable – Accept Apple Pay and other contactless payments from smartphones and wearable devices
-
Compact design uses minimal countertop space, ideal for small businesses
-
Accept Visa, MasterCard, Discover and American Express
-
If you already have a payment processor, we will meet or beat your current rates
-
Live 24/7 customer support
-
Requires connection to landline telephone line or direct Internet connection
-
Low rates for American Express – Pay as low as 2.3% and $.15 for retail transactions


| AVR Libc Home Page | AVR Libc Development Pages | ||||
| Main Page | User Manual | Library Reference | FAQ | Alphabetical Index | Example Projects |
Makefile
can be configured.PWM
) to ramp an LED on and off every two seconds. An AT90S2313 processor will be used as the controller. The circuit for this demonstration is shown in the schematic diagram. If you have a development kit, you should be able to use it, rather than build the circuit, for this project.
Schematic of circuit for demo project
The source code is given in demo.c. For the sake of this example, create a file called demo.c
containing this source code. Some of the more important parts of the code are:
iocompat.h
tries to abstract between all this differences using some preprocessor #ifdef
statements, so the actual program itself can operate on a common set of symbolic names. The macros defined by that file are:OCR
the name of the OCR register used to control the PWM (usually either OCR1 or OCR1A)DDROC
the name of the DDR (data direction register) for the OC outputOC1
the pin number of the OC1[A] output within its portTIMER1_TOP
the TOP value of the timer used for the PWM (1023 for 10-bit PWMs, 255 for devices that can only handle an 8-bit PWM)TIMER1_PWM_INIT
the initialization bits to be set into control register 1A in order to setup 10-bit (or 8-bit) phase and frequency correct PWM modeTIMER1_CLOCKSOURCE
the clock bits to set in the respective control register to start the PWM timer; usually the timer runs at full CPU clock for 10-bit PWMs, while it runs on a prescaled clock for 8-bit PWMs
PWM
is being used in 10-bit mode, so we need a 16-bit variable to remember the current value.PWM
.PWM
register. Since we are in an interrupt routine, it is safe to use a 16-bit assignment to the register. Outside of an interrupt, the assignment should only be performed with interrupts disabled if there's a chance that an interrupt routine could also access this register (or another register that uses TEMP
), see the appropriate FAQ entry.PWM
and enables interrupts.sleep_mode()
puts the processor on sleep until the next interrupt, to conserve power. Of course, that probably won't be noticable as we are still driving a LED, it is merely mentioned here to demonstrate the basic principle./* * ---------------------------------------------------------------------------- * "THE BEER-WARE LICENSE" (Revision 42): *<EMAIL_ADDRESS>wrote this file. As long as you retain this notice you * can do whatever you want with this stuff. If we meet some day, and you think * this stuff is worth it, you can buy me a beer in return. Joerg Wunsch * ---------------------------------------------------------------------------- * * Simple AVR demonstration. Controls a LED that can be directly * connected from OC1/OC1A to GND. The brightness of the LED is * controlled with the PWM. After each period of the PWM, the PWM * value is either incremented or decremented, that's all. * * $Id: demo.c,v 1.9 2006/01/05 21:30:10 joerg_wunsch Exp $ */ #include <inttypes.h> #include <avr/io.h> #include <avr/interrupt.h> #include <avr/sleep.h> #include "iocompat.h" /* Note [1] */ enum { UP, DOWN }; ISR (TIMER1_OVF_vect) /* Note [2] */ { static uint16_t pwm; /* Note [3] */ static uint8_t direction; switch (direction) /* Note [4] */ { case UP: if (++pwm == TIMER1_TOP) direction = DOWN; break; case DOWN: if (--pwm == 0) direction = UP; break; } OCR = pwm; /* Note [5] */ } void ioinit (void) /* Note [6] */ { /* Timer 1 is 10-bit PWM (8-bit PWM on some ATtinys). */ TCCR1A = TIMER1_PWM_INIT; /* * Start timer 1. * * NB: TCCR1A and TCCR1B could actually be the same register, so * take care to not clobber it. */ TCCR1B |= TIMER1_CLOCKSOURCE; /* * Run any device-dependent timer 1 setup hook if present. */ #if defined(TIMER1_SETUP_HOOK) TIMER1_SETUP_HOOK(); #endif /* Set PWM value to 0. */ OCR = 0; /* Enable OC1 as output. */ DDROC = _BV (OC1); /* Enable timer 1 overflow interrupt. */ TIMSK = _BV (TOIE1); sei (); } int main (void) { ioinit (); /* loop forever, the interrupts are doing the rest */ for (;;) /* Note [7] */ sleep_mode(); return (0); }
-mmcu
option is specified. The -Os
option will tell the compiler to optimize the code for efficient space usage (at the possible expense of code execution speed). The -g
is used to embed debug info. The debug info is useful for disassemblies and doesn't end up in the
.hex files, so I usually specify it. Finally, the -c
tells the compiler to compile and stop -- don't link. This demo is small enough that we could compile and link in one step. However, real-world projects will have several modules and will typically need to break up the building of the project into several compiles and one link.
$ avr-gcc -g -Os -mmcu=atmega8 -c demo.c
The compilation will create a demo.o
file. Next we link it into a binary called demo.elf
.
$ avr-gcc -g -mmcu=atmega8 -o demo.elf demo.o
It is important to specify the MCU type when linking. The compiler uses the -mmcu
option to choose start-up files and run-time libraries that get linked together. If this option isn't specified, the compiler defaults to the 8515 processor environment, which is most certainly what you didn't want.
Now we have a binary file. Can we do anything useful with it (besides put it into the processor?)  One tool is avr-objdump
, which takes information from the object file and displays it in many useful ways. Typing the command by itself will cause it to list out its options.
For instance, to get a feel of the application's size, the -h
option can be used. The output of this option shows how much space is used in each of the sections (the .stab and
.stabstr sections hold the debugging information and won't make it into the ROM file).
An even more useful option is -S
. This option disassembles the binary file and intersperses the source code in the output! This method is much better, in my opinion, than using the -S
with the compiler because this listing includes routines from the libraries and the vector table contents. Also, all the "fix-ups" have been satisfied. In other words, the listing generated by this option reflects the actual code that the processor will run.
$ avr-objdump -h -S demo.elf > demo.lst
Here's the output as saved in the demo.lst
file:
demo.elf: file format elf32-avr Sections: Idx Name Size VMA LMA File off Algn 0 .text 00000126 00000000 00000000 00000074 2**1 CONTENTS, ALLOC, LOAD, READONLY, CODE 1 .bss 00000003 00800060 00800060 0000019a 2**0 ALLOC 2 .debug_aranges 00000020 00000000 00000000 0000019a 2**0 CONTENTS, READONLY, DEBUGGING 3 .debug_pubnames 00000035 00000000 00000000 000001ba 2**0 CONTENTS, READONLY, DEBUGGING 4 .debug_info 00000105 00000000 00000000 000001ef 2**0 CONTENTS, READONLY, DEBUGGING 5 .debug_abbrev 000000cf 00000000 00000000 000002f4 2**0 CONTENTS, READONLY, DEBUGGING 6 .debug_line 0000014d 00000000 00000000 000003c3 2**0 CONTENTS, READONLY, DEBUGGING 7 .debug_frame 00000040 00000000 00000000 00000510 2**2 CONTENTS, READONLY, DEBUGGING 8 .debug_str 000000b1 00000000 00000000 00000550 2**0 CONTENTS, READONLY, DEBUGGING Disassembly of section .text: 00000000 <__vectors>: 0: 12 c0 rjmp .+36 ; 0x26 <__ctors_end> 2: 8c c0 rjmp .+280 ; 0x11c <__bad_interrupt> 4: 8b c0 rjmp .+278 ; 0x11c <__bad_interrupt> 6: 8a c0 rjmp .+276 ; 0x11c <__bad_interrupt> 8: 89 c0 rjmp .+274 ; 0x11c <__bad_interrupt> a: 88 c0 rjmp .+272 ; 0x11c <__bad_interrupt> c: 87 c0 rjmp .+270 ; 0x11c <__bad_interrupt> e: 86 c0 rjmp .+268 ; 0x11c <__bad_interrupt> 10: 25 c0 rjmp .+74 ; 0x5c <__vector_8> 12: 84 c0 rjmp .+264 ; 0x11c <__bad_interrupt> 14: 83 c0 rjmp .+262 ; 0x11c <__bad_interrupt> 16: 82 c0 rjmp .+260 ; 0x11c <__bad_interrupt> 18: 81 c0 rjmp .+258 ; 0x11c <__bad_interrupt> 1a: 80 c0 rjmp .+256 ; 0x11c <__bad_interrupt> 1c: 7f c0 rjmp .+254 ; 0x11c <__bad_interrupt> 1e: 7e c0 rjmp .+252 ; 0x11c <__bad_interrupt> 20: 7d c0 rjmp .+250 ; 0x11c <__bad_interrupt> 22: 7c c0 rjmp .+248 ; 0x11c <__bad_interrupt> 24: 7b c0 rjmp .+246 ; 0x11c <__bad_interrupt> 00000026 <__ctors_end>: 26: 11 24 eor r1, r1 28: 1f be out 0x3f, r1 ; 63 2a: cf e5 ldi r28, 0x5F ; 95 2c: d4 e0 ldi r29, 0x04 ; 4 2e: de bf out 0x3e, r29 ; 62 30: cd bf out 0x3d, r28 ; 61 00000032 <__do_copy_data>: 32: 10 e0 ldi r17, 0x00 ; 0 34: a0 e6 ldi r26, 0x60 ; 96 36: b0 e0 ldi r27, 0x00 ; 0 38: e6 e2 ldi r30, 0x26 ; 38 3a: f1 e0 ldi r31, 0x01 ; 1 3c: 02 c0 rjmp .+4 ; 0x42 <.do_copy_data_start> 0000003e <.do_copy_data_loop>: 3e: 05 90 lpm r0, Z+ 40: 0d 92 st X+, r0 00000042 <.do_copy_data_start>: 42: a0 36 cpi r26, 0x60 ; 96 44: b1 07 cpc r27, r17 46: d9 f7 brne .-10 ; 0x3e <.do_copy_data_loop> 00000048 <__do_clear_bss>: 48: 10 e0 ldi r17, 0x00 ; 0 4a: a0 e6 ldi r26, 0x60 ; 96 4c: b0 e0 ldi r27, 0x00 ; 0 4e: 01 c0 rjmp .+2 ; 0x52 <.do_clear_bss_start> 00000050 <.do_clear_bss_loop>: 50: 1d 92 st X+, r1 00000052 <.do_clear_bss_start>: 52: a3 36 cpi r26, 0x63 ; 99 54: b1 07 cpc r27, r17 56: e1 f7 brne .-8 ; 0x50 <.do_clear_bss_loop> 58: 4d d0 rcall .+154 ; 0xf4 <main> 5a: 61 c0 rjmp .+194 ; 0x11e <exit> 0000005c <__vector_8>: #include "iocompat.h" /* Note [1] */ enum { UP, DOWN }; ISR (TIMER1_OVF_vect) /* Note [2] */ { 5c: 1f 92 push r1 5e: 0f 92 push r0 60: 0f b6 in r0, 0x3f ; 63 62: 0f 92 push r0 64: 11 24 eor r1, r1 66: 2f 93 push r18 68: 3f 93 push r19 6a: 8f 93 push r24 static uint16_t pwm; /* Note [3] */ static uint8_t direction; switch (direction) /* Note [4] */ 6c: 80 91 60 00 lds r24, 0x0060 70: 88 23 and r24, r24 72: c1 f4 brne .+48 ; 0xa4 <__vector_8+0x48> { case UP: if (++pwm == TIMER1_TOP) 74: 20 91 61 00 lds r18, 0x0061 78: 30 91 62 00 lds r19, 0x0062 7c: 2f 5f subi r18, 0xFF ; 255 7e: 3f 4f sbci r19, 0xFF ; 255 80: 30 93 62 00 sts 0x0062, r19 84: 20 93 61 00 sts 0x0061, r18 88: 83 e0 ldi r24, 0x03 ; 3 8a: 2f 3f cpi r18, 0xFF ; 255 8c: 38 07 cpc r19, r24 8e: 09 f1 breq .+66 ; 0xd2 <__vector_8+0x76> if (--pwm == 0) direction = UP; break; } OCR = pwm; /* Note [5] */ 90: 3b bd out 0x2b, r19 ; 43 92: 2a bd out 0x2a, r18 ; 42 } 94: 8f 91 pop r24 96: 3f 91 pop r19 98: 2f 91 pop r18 9a: 0f 90 pop r0 9c: 0f be out 0x3f, r0 ; 63 9e: 0f 90 pop r0 a0: 1f 90 pop r1 a2: 18 95 reti ISR (TIMER1_OVF_vect) /* Note [2] */ { static uint16_t pwm; /* Note [3] */ static uint8_t direction; switch (direction) /* Note [4] */ a4: 81 30 cpi r24, 0x01 ; 1 a6: 29 f0 breq .+10 ; 0xb2 <__vector_8+0x56> a8: 20 91 61 00 lds r18, 0x0061 ac: 30 91 62 00 lds r19, 0x0062 b0: ef cf rjmp .-34 ; 0x90 <__vector_8+0x34> if (++pwm == TIMER1_TOP) direction = DOWN; break; case DOWN: if (--pwm == 0) b2: 20 91 61 00 lds r18, 0x0061 b6: 30 91 62 00 lds r19, 0x0062 ba: 21 50 subi r18, 0x01 ; 1 bc: 30 40 sbci r19, 0x00 ; 0 be: 30 93 62 00 sts 0x0062, r19 c2: 20 93 61 00 sts 0x0061, r18 c6: 21 15 cp r18, r1 c8: 31 05 cpc r19, r1 ca: 11 f7 brne .-60 ; 0x90 <__vector_8+0x34> direction = UP; cc: 10 92 60 00 sts 0x0060, r1 d0: df cf rjmp .-66 ; 0x90 <__vector_8+0x34> switch (direction) /* Note [4] */ { case UP: if (++pwm == TIMER1_TOP) direction = DOWN; d2: 81 e0 ldi r24, 0x01 ; 1 d4: 80 93 60 00 sts 0x0060, r24 d8: db cf rjmp .-74 ; 0x90 <__vector_8+0x34> 000000da <ioinit>: void ioinit (void) /* Note [6] */ { /* Timer 1 is 10-bit PWM (8-bit PWM on some ATtinys). */ TCCR1A = TIMER1_PWM_INIT; da: 83 e8 ldi r24, 0x83 ; 131 dc: 8f bd out 0x2f, r24 ; 47 * Start timer 1. * * NB: TCCR1A and TCCR1B could actually be the same register, so * take care to not clobber it. */ TCCR1B |= TIMER1_CLOCKSOURCE; de: 8e b5 in r24, 0x2e ; 46 e0: 81 60 ori r24, 0x01 ; 1 e2: 8e bd out 0x2e, r24 ; 46 #if defined(TIMER1_SETUP_HOOK) TIMER1_SETUP_HOOK(); #endif /* Set PWM value to 0. */ OCR = 0; e4: 1b bc out 0x2b, r1 ; 43 e6: 1a bc out 0x2a, r1 ; 42 /* Enable OC1 as output. */ DDROC = _BV (OC1); e8: 82 e0 ldi r24, 0x02 ; 2 ea: 87 bb out 0x17, r24 ; 23 /* Enable timer 1 overflow interrupt. */ TIMSK = _BV (TOIE1); ec: 84 e0 ldi r24, 0x04 ; 4 ee: 89 bf out 0x39, r24 ; 57 sei (); f0: 78 94 sei } f2: 08 95 ret 000000f4 <main>: void ioinit (void) /* Note [6] */ { /* Timer 1 is 10-bit PWM (8-bit PWM on some ATtinys). */ TCCR1A = TIMER1_PWM_INIT; f4: 83 e8 ldi r24, 0x83 ; 131 f6: 8f bd out 0x2f, r24 ; 47 * Start timer 1. * * NB: TCCR1A and TCCR1B could actually be the same register, so * take care to not clobber it. */ TCCR1B |= TIMER1_CLOCKSOURCE; f8: 8e b5 in r24, 0x2e ; 46 fa: 81 60 ori r24, 0x01 ; 1 fc: 8e bd out 0x2e, r24 ; 46 #if defined(TIMER1_SETUP_HOOK) TIMER1_SETUP_HOOK(); #endif /* Set PWM value to 0. */ OCR = 0; fe: 1b bc out 0x2b, r1 ; 43 100: 1a bc out 0x2a, r1 ; 42 /* Enable OC1 as output. */ DDROC = _BV (OC1); 102: 82 e0 ldi r24, 0x02 ; 2 104: 87 bb out 0x17, r24 ; 23 /* Enable timer 1 overflow interrupt. */ TIMSK = _BV (TOIE1); 106: 84 e0 ldi r24, 0x04 ; 4 108: 89 bf out 0x39, r24 ; 57 sei (); 10a: 78 94 sei ioinit (); /* loop forever, the interrupts are doing the rest */ for (;;) /* Note [7] */ sleep_mode(); 10c: 85 b7 in r24, 0x35 ; 53 10e: 80 68 ori r24, 0x80 ; 128 110: 85 bf out 0x35, r24 ; 53 112: 88 95 sleep 114: 85 b7 in r24, 0x35 ; 53 116: 8f 77 andi r24, 0x7F ; 127 118: 85 bf out 0x35, r24 ; 53 11a: f8 cf rjmp .-16 ; 0x10c <main+0x18> 0000011c <__bad_interrupt>: 11c: 71 cf rjmp .-286 ; 0x0 <__vectors> 0000011e <exit>: 11e: f8 94 cli 120: 00 c0 rjmp .+0 ; 0x122 <_exit> 00000122 <_exit>: 122: f8 94 cli 00000124 <__stop_program>: 124: ff cf rjmp .-2 ; 0x124 <__stop_program>
avr-objdump
is very useful, but sometimes it's necessary to see information about the link that can only be generated by the linker. A map file contains this information. A map file is useful for monitoring the sizes of your code and data. It also shows where modules are loaded and which modules were loaded from libraries. It is yet another view of your application. To get a map file, I usually add -Wl,-Map,demo.map
to my link command. Relink the application using the following command to generate demo.map
(a portion of which is shown below).
$ avr-gcc -g -mmcu=atmega8 -Wl,-Map,demo.map -o demo.elf demo.o
Some points of interest in the demo.map
file are:
.rela.plt *(.rela.plt) .text 0x00000000 0x126 *(.vectors) .vectors 0x00000000 0x26 c:/avrdev/avr-libc/avr-libc-1.6.4/avr/lib/avr4/atmega8/crtm8.o 0x00000000 __vectors 0x00000000 __vector_default *(.vectors) *(.progmem.gcc*) *(.progmem*) 0x00000026 . = ALIGN (0x2) 0x00000026 __trampolines_start = . *(.trampolines) .trampolines 0x00000026 0x0 linker stubs *(.trampolines*) 0x00000026 __trampolines_end = . *(.jumptables) *(.jumptables*) *(.lowtext) *(.lowtext*) 0x00000026 __ctors_start = .
The .text segment (where program instructions are stored) starts at location 0x0.
*(.fini2) *(.fini2) *(.fini1) *(.fini1) *(.fini0) .fini0 0x00000122 0x4 c:/winavr/bin/../lib/gcc/avr/4.3.2/avr4\libgcc.a(_exit.o) *(.fini0) 0x00000126 _etext = . .data 0x00800060 0x0 load address 0x00000126 0x00800060 PROVIDE (__data_start, .) *(.data) .data 0x00800060 0x0 demo.o .data 0x00800060 0x0 c:/avrdev/avr-libc/avr-libc-1.6.4/avr/lib/avr4/atmega8/crtm8.o .data 0x00800060 0x0 c:/avrdev/avr-libc/avr-libc-1.6.4/avr/lib/avr4/exit.o .data 0x00800060 0x0 c:/winavr/bin/../lib/gcc/avr/4.3.2/avr4\libgcc.a(_exit.o) .data 0x00800060 0x0 c:/winavr/bin/../lib/gcc/avr/4.3.2/avr4\libgcc.a(_copy_data.o) .data 0x00800060 0x0 c:/winavr/bin/../lib/gcc/avr/4.3.2/avr4\libgcc.a(_clear_bss.o) *(.data*) *(.rodata) *(.rodata*) *(.gnu.linkonce.d*) 0x00800060 . = ALIGN (0x2) 0x00800060 _edata = . 0x00800060 PROVIDE (__data_end, .) .bss 0x00800060 0x3 0x00800060 PROVIDE (__bss_start, .) *(.bss) .bss 0x00800060 0x3 demo.o .bss 0x00800063 0x0 c:/avrdev/avr-libc/avr-libc-1.6.4/avr/lib/avr4/atmega8/crtm8.o .bss 0x00800063 0x0 c:/avrdev/avr-libc/avr-libc-1.6.4/avr/lib/avr4/exit.o .bss 0x00800063 0x0 c:/winavr/bin/../lib/gcc/avr/4.3.2/avr4\libgcc.a(_exit.o) .bss 0x00800063 0x0 c:/winavr/bin/../lib/gcc/avr/4.3.2/avr4\libgcc.a(_copy_data.o) .bss 0x00800063 0x0 c:/winavr/bin/../lib/gcc/avr/4.3.2/avr4\libgcc.a(_clear_bss.o) *(.bss*) *(COMMON) 0x00800063 PROVIDE (__bss_end, .) 0x00000126 __data_load_start = LOADADDR (.data) 0x00000126 __data_load_end = (__data_load_start + SIZEOF (.data)) .noinit 0x00800063 0x0 0x00800063 PROVIDE (__noinit_start, .) *(.noinit*) 0x00800063 PROVIDE (__noinit_end, .) 0x00800063 _end = . 0x00800063 PROVIDE (__heap_start, .) .eeprom 0x00810000 0x0 *(.eeprom*) 0x00810000 __eeprom_end = .
The last address in the .text segment is location
0x114
( denoted by _etext
), so the instructions use up 276 bytes of FLASH.
The .data segment (where initialized static variables are stored) starts at location
0x60
, which is the first address after the register bank on an ATmega8 processor.
The next available address in the .data segment is also location
0x60
, so the application has no initialized data.
The .bss segment (where uninitialized data is stored) starts at location
0x60
.
The next available address in the .bss segment is location 0x63, so the application uses 3 bytes of uninitialized data.
The .eeprom segment (where EEPROM variables are stored) starts at location 0x0.
The next available address in the .eeprom segment is also location 0x0, so there aren't any EEPROM variables.
.hex files. The GNU utility that does this is called avr-objcopy
.The ROM contents can be pulled from our project's binary and put into the file demo.hex using the following command:
$ avr-objcopy -j .text -j .data -O ihex demo.elf demo.hex
The resulting demo.hex
file contains:
:1000000012C08CC08BC08AC089C088C087C086C01F :1000100025C084C083C082C081C080C07FC07EC034 :100020007DC07CC07BC011241FBECFE5D4E0DEBF05 :10003000CDBF10E0A0E6B0E0E6E2F1E002C005903E :100040000D92A036B107D9F710E0A0E6B0E001C0EC :100050001D92A336B107E1F74DD061C01F920F92F8 :100060000FB60F9211242F933F938F9380916000CE :100070008823C1F420916100309162002F5F3F4FCF :10008000309362002093610083E02F3F380709F12D :100090003BBD2ABD8F913F912F910F900FBE0F90C6 :1000A0001F901895813029F02091610030916200F5 :1000B000EFCF2091610030916200215030403093A9 :1000C0006200209361002115310511F71092600044 :1000D000DFCF81E080936000DBCF83E88FBD8EB5FA :1000E00081608EBD1BBC1ABC82E087BB84E089BFE7 :1000F0007894089583E88FBD8EB581608EBD1BBC5A :100100001ABC82E087BB84E089BF789485B7806899 :1001100085BF889585B78F7785BFF8CF71CFF89465 :0601200000C0F894FFCFBF :00000001FF
The -j
option indicates that we want the information from the .text and
.data segment extracted. If we specify the EEPROM segment, we can generate a
.hex file that can be used to program the EEPROM:
$ avr-objcopy -j .eeprom --change-section-lma .eeprom=0 -O ihex demo.elf demo_eeprom.hex
There is no demo_eeprom.hex
file written, as that file would be empty.
Starting with version 2.17 of the GNU binutils, the avr-objcopy
command that used to generate the empty EEPROM files now aborts because of the empty input section .eeprom, so these empty files are not generated. It also signals an error to the Makefile which will be caught there, and makes it print a message about the empty file not being generated.
make
, save the following in a file called Makefile
.
Makefile
can only be used as input for the GNU version of make
.PRG = demo OBJ = demo.o #MCU_TARGET = at90s2313 #MCU_TARGET = at90s2333 #MCU_TARGET = at90s4414 #MCU_TARGET = at90s4433 #MCU_TARGET = at90s4434 #MCU_TARGET = at90s8515 #MCU_TARGET = at90s8535 #MCU_TARGET = atmega128 #MCU_TARGET = atmega1280 #MCU_TARGET = atmega1281 #MCU_TARGET = atmega1284p #MCU_TARGET = atmega16 #MCU_TARGET = atmega163 #MCU_TARGET = atmega164p #MCU_TARGET = atmega165 #MCU_TARGET = atmega165p #MCU_TARGET = atmega168 #MCU_TARGET = atmega169 #MCU_TARGET = atmega169p #MCU_TARGET = atmega2560 #MCU_TARGET = atmega2561 #MCU_TARGET = atmega32 #MCU_TARGET = atmega324p #MCU_TARGET = atmega325 #MCU_TARGET = atmega3250 #MCU_TARGET = atmega329 #MCU_TARGET = atmega3290 #MCU_TARGET = atmega48 #MCU_TARGET = atmega64 #MCU_TARGET = atmega640 #MCU_TARGET = atmega644 #MCU_TARGET = atmega644p #MCU_TARGET = atmega645 #MCU_TARGET = atmega6450 #MCU_TARGET = atmega649 #MCU_TARGET = atmega6490 MCU_TARGET = atmega8 #MCU_TARGET = atmega8515 #MCU_TARGET = atmega8535 #MCU_TARGET = atmega88 #MCU_TARGET = attiny2313 #MCU_TARGET = attiny24 #MCU_TARGET = attiny25 #MCU_TARGET = attiny26 #MCU_TARGET = attiny261 #MCU_TARGET = attiny44 #MCU_TARGET = attiny45 #MCU_TARGET = attiny461 #MCU_TARGET = attiny84 #MCU_TARGET = attiny85 #MCU_TARGET = attiny861 OPTIMIZE = -O2 DEFS = LIBS = # You should not have to change anything below here. CC = avr-gcc # Override is only needed by avr-lib build system. override CFLAGS = -g -Wall $(OPTIMIZE) -mmcu=$(MCU_TARGET) $(DEFS) override LDFLAGS = -Wl,-Map,$(PRG).map OBJCOPY = avr-objcopy OBJDUMP = avr-objdump all: $(PRG).elf lst text eeprom $(PRG).elf: $(OBJ) $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS) # dependency: demo.o: demo.c iocompat.h clean: rm -rf *.o $(PRG).elf *.eps *.png *.pdf *.bak rm -rf *.lst *.map $(EXTRA_CLEAN_FILES) lst: $(PRG).lst %.lst: %.elf $(OBJDUMP) -h -S $< > $@ # Rules for building the .text rom images text: hex bin srec hex: $(PRG).hex bin: $(PRG).bin srec: $(PRG).srec %.hex: %.elf $(OBJCOPY) -j .text -j .data -O ihex $< $@ %.srec: %.elf $(OBJCOPY) -j .text -j .data -O srec $< $@ %.bin: %.elf $(OBJCOPY) -j .text -j .data -O binary $< $@ # Rules for building the .eeprom rom images eeprom: ehex ebin esrec ehex: $(PRG)_eeprom.hex ebin: $(PRG)_eeprom.bin esrec: $(PRG)_eeprom.srec %_eeprom.hex: %.elf $(OBJCOPY) -j .eeprom --change-section-lma .eeprom=0 -O ihex $< $@ \ || { echo empty $@ not generated; exit 0; } %_eeprom.srec: %.elf $(OBJCOPY) -j .eeprom --change-section-lma .eeprom=0 -O srec $< $@ \ || { echo empty $@ not generated; exit 0; } %_eeprom.bin: %.elf $(OBJCOPY) -j .eeprom --change-section-lma .eeprom=0 -O binary $< $@ \ || { echo empty $@ not generated; exit 0; } # Every thing below here is used by avr-libc's build system and can be ignored # by the casual user. FIG2DEV = fig2dev EXTRA_CLEAN_FILES = *.hex *.bin *.srec dox: eps png pdf eps: $(PRG).eps png: $(PRG).png pdf: $(PRG).pdf %.eps: %.fig $(FIG2DEV) -L eps $< $@ %.pdf: %.fig $(FIG2DEV) -L pdf $< $@ %.png: %.fig $(FIG2DEV) -L png $< $@


Prepare the dataset for training
Annotation file format
- Dataset format
relative/path/to/image1.jpg xmin1 ymin1 xmax1 ymax1 label1 xmin2 ymin2 xmax2 ymax2 label2 ...
relative/path/to/image2.jpg xmin2 ymin2 xmax2 ymax2 label2 xmin2 ymin2 xmax2 ymax2 label2 ...
.
.
.
- The relative path to the image here is the path from the
data_root
to the image. For examples,
data_root
|____train_datasets
| |____train_image1.jpg
| |____train_image2.jpg
| |____train_image3.jpg
| |____train_image4.jpg
| |____train_image5.jpg
|
|____val_datasets
|____val_image1.jpg
|____val_image2.jpg
|____val_image3.jpg
|____val_image4.jpg
|____val_image5.jpg
If we set:
data_root = 'data_root/train_datasets'
Then the annotations file train_annotations.txt
for training dataset should be:
train_images1.jpg xmin1 ymin1 xmax1 ymax1 label1 xmin2 ymin2 xmax2 ymax2 label2 ...
train_images2.jpg xmin1 ymin1 xmax1 ymax1 label1 xmin2 ymin2 xmax2 ymax2 label2 ...
train_images3.jpg xmin1 ymin1 xmax1 ymax1 label1 xmin2 ymin2 xmax2 ymax2 label2 ...
train_images4.jpg xmin1 ymin1 xmax1 ymax1 label1 xmin2 ymin2 xmax2 ymax2 label2 ...
train_images5.jpg xmin1 ymin1 xmax1 ymax1 label1 xmin2 ymin2 xmax2 ymax2 label2 ...
Meanwhile, if we set:
val_data_root = 'data_root/val_datasets'
Then the annotations file val_annotations.txt
for validation dataset should be:
val_images1.jpg xmin1 ymin1 xmax1 ymax1 label1 xmin2 ymin2 xmax2 ymax2 label2 ...
val_images2.jpg xmin1 ymin1 xmax1 ymax1 label1 xmin2 ymin2 xmax2 ymax2 label2 ...
val_images3.jpg xmin1 ymin1 xmax1 ymax1 label1 xmin2 ymin2 xmax2 ymax2 label2 ...
val_images4.jpg xmin1 ymin1 xmax1 ymax1 label1 xmin2 ymin2 xmax2 ymax2 label2 ...
val_images5.jpg xmin1 ymin1 xmax1 ymax1 label1 xmin2 ymin2 xmax2 ymax2 label2 ...
- For each image, after the relative path to image file, we list all the possible bounding boxes
of objects in the image. The a set of values
xmini ymini xmaxi ymaxi labeli
represents for a bounding box i. We denote(xmin, ymin), (xmax, ymax)
are the coordinates of top-left, and bottom-right points of the bounding box while, thelabel
is the class label of the object start from0
. We only need to label the bounding boxes of objects (not the background). If we have only 1 classface
, then the class label forface
is0
. For example, if the image havek
faces then:
relative/path/to/image.jpg xmin1 ymin1 xmax1 ymax1 label1 ... xmink ymink xmaxk ymaxk labelk
Prepare the DataLoader for datasets
In this section, I'm going to explain how to create an ODDataset
(ODDataset
is acutally a wrapped class of torch.utils.data.Dataset
). Then we will create
DataLoader
for training and validation datasets (which is similar to DataGenerator
in Keras):
If we don't want to do validation during training, so we can skip all related below things for validation dataset.
1. Set some configuration parameters
First, we set the values for the following parameters for making the data generator in torch
,
DataGenerator
:
BATCH_SIZE = 16
NUM_CLASSES = 2
WIDTH = 640
HEIGHT = 640
RGB_MEAN = (0.485, 0.456, 0.406)
RGB_STD = (0.229, 0.224, 0.225)
Explain:
BATCH_SIZE
: The size of batch during training and validation.NUM_CLASSES
: Total number of classes in our datasets including the background class. For examples, we setNUM_CLASSES
for face detection because we have two classes:face
andbackground
(non-face).WIDTH
: The width of image that we resize to. We must resize the image of different size into the same size in order to take the advantage ofbatch training
for GPUs.HEIGHT
:The height of image that we resize to.- RGB_MEAN: The mean values in red, green, blue channels. After converting to tensors
using
ToTensor()
, the pixel values of the images will be converted from0-255
to0.0-1.0
. The we subtract these values to RGB_MEAN in each channel of the image. - RGB_STD: The standard deviation values in red, green, blue channels.
Note: Normally, we use any pretrained models, we use the above values of
RGB_MEAN
, andRGB_STD
to normalize the values of inputs imagse. It's the common practice in Pytorch.
Next, we create a box_coder for encoding the ground truth bounding boxes and labels of the datasets into the corresponding formats (anchors) for training and validation.
2. Create the BoxCoder
We need to create for encoding the bounding boxes and labels of objects in images with the following parameters.
box_coder = BoxCoder(img_size=(640, 640),
offset=(0.5, 0.5),
box_sizes=(16, 32, 64, 128, 256, 512),
aspect_ratios=((1,), (1,), (1,), (1,), (1,), (1,)),
fm_sizes=((160, 160), (80, 80), (40, 40), (20, 20), (10, 10), (5, 5)),
)
img_size
. The size of input image. (height, width)offset
. The offset values to normalize the bounding boxes to each cell. It shouldn't be changed.aspect_ratios
. This is a set of aspect ratios in each detection layer. For example, the first valueaspect_ratios[0] = (1,)
is the set of aspect ratios of anchors in a cell for the first detection layer. Here there is 1 aspect ratio value1
which means there is only 1 anchor in a cell and anchor width / anchor height =1
.fm_sizes
. This is a set of feature maps sizes in each detection layer.
3. Create ODDatasets for training and validation datasets
DataLoader
is similar to DataGenerator
in Keras which generates a batch of data in CPU
meanwhile GPUs are doing heavy computations.
3.1. Define transformations
First, we define the transformations applied for our training datasets including:
Color jittering: randomly adjust the brightness
, contrast
, hue
.
Spatial transformations: randomly crop the several square patches from an image and select one
of them (I follow SFD paper), randomly flipping, and
Resize to fixed size (640, 640) for training and validation.
Encoding the ground truth bounding boxes and labels: we need to pass to box_coder
.
We don't need to apply spatial transformations to validation dataset.
# 2.1 Create train_loader
# Initiate some augmentations perform on training data
train_transform = Augmentation(brightnesss=32 / 255.,
contrast=0.5,
saturation=0.5,
hue=0.1,
random_crop=RandomCrop(),
resize=Resize(size=(HEIGHT, WIDTH)),
random_flip=RandomFlip(),
box_coder=box_coder,
rgb_mean=RGB_MEAN,
rgb_std=RGB_STD,
)
val_transform = Augmentation(brightnesss=0,
contrast=0,
saturation=0,
hue=0,
resize=Resize(size=(HEIGHT, WIDTH)),
box_coder=box_coder,
rgb_mean=RGB_MEAN,
rgb_std=RGB_STD,
)
3.2. Create ODDatasets
ODDataset
is actually a class that I wrap up torch.utils.data.Dataset
which is needed for create
the torch.utils.data.DataLoader
.
# 2. Create the training and validation data loaders
# 2.0.1 The dir that contain the images
train_images_dir = '/home/ubuntu/Datasets/WiderFace/WIDER_train/images'
val_images_dir = '/home/ubuntu/Datasets/WiderFace/WIDER_val/images'
# 2.0.2 The dir that contain the annotation files.
train_annotations_file = './examples/annotations/widerface/train_annotations.txt'
val_annotations_file = './examples/annotations/widerface/val_annotations.txt'
train_datasets = ODDataset(images_dir=train_images_dir,
anno_file=train_annotations_file,
transform=train_transform)
4. Create DataLoaders for training and validation datasets
Finally, we need to create DataLoader
for training and validation dataset.
# Get a train data loader (which is similar to DataGenerator in Keras)
train_loader = torch.utils.data.DataLoader(train_datasets,
batch_size=BATCH_SIZE,
shuffle=True,
num_workers=8)
val_datasets = ODDataset(images_dir=val_images_dir,
anno_file=val_annotations_file,
transform=val_transform)
# Get a val data loader
val_loader = torch.utils.data.DataLoader(val_datasets,
batch_size=BATCH_SIZE,
shuffle=False,
num_workers=8)


--- title: find sidebar: function_reference_sidebar permalink: homochoricSO3Grid.find.html folder: function_reference toc: false ---
return indece and distance of all nodes within a eps neighborhood
| SO3G | homochoricSO3Grid |
| ori | orientation |
| radius | double |
| ind | index of the closes grid point |
| cubeInd | Nx8 list of indeces of the cube corners containing ori |
| dist | misorientation angle |


A repository continiously providing updates to Haiku's system files.
A repository continiously providing fresh HaikuPorts packages.
Please contact Haiku's systems administration team if you are interested in mirroring Haiku's package repositories


@(dbs: scrupal.controllers.ConfigWizard.DatabaseForm, step: scrupal.controllers.ConfigWizard.Step.Kind, lastError: Option[Throwable])( implicit context : scrupal.controllers.Context) @import scrupal.views.html @import views.html.helper._ @import scrupal.views.html.helpers._ @import scrupal.controllers.routes.ConfigWizard @implicitField = @{ FieldConstructor(hFormFieldConstructor.f) } @html.configPage("Database Configuration", step, lastError) {
I'm going to help you select and configure your database now. Scrupal stores all its information in a mongoDB database and we need to specify enough information for Scrupal to find or create the database you want to use for Scrupal. If you don't have mongoDB installed, you can download it from this link.. In order to specify the database to use, you will need to provide the hostname the mongoDB server (daemon) is running on, the name of the database you wish to use, and the login credentials (optional). @hForm("Databases", ConfigWizard.configAction) { @inputText(dbs("host"), '_label -> "Host Name", '_placeholder -> "Enter the host name where mongoDB is running.") @inputText(dbs("port"), '_label -> "Port Number", '_placeholder -> "Enter the TCP port number mongoDB is listening on.") @inputText(dbs("name"), '_label -> "Database Name", '_placeholder -> "Enter a name you want to use to refer to this database configuration.") @inputText(dbs("user"), '_label -> "Database User", '_placeholder -> "User name to log into database, or blank for none.") @inputPassword(dbs("pass"), '_label -> "User's Password", '_placeholder -> "Password for DB user, if a user was specified above.") } }


Categories
Statistics
Help
Your carbon footprint has improved by 80% compared to last year.
We know you’re not doing it for the money, but here’s a little sneak-peak on your bonus for completing the form.
TIPS AND TRICKS
INPUT STATS


University of Central Florida, Orlando, Florida, USA
Master of Science in Computer Science • 2017 — present. Graduating on December 2018.
Algorithms and Data Structures, Machine Learning, Natural Language Processing, Data Intensive Computing, Software Engineering, Advanced Computer Architecture.
St. Joseph's College of Engineering, Chennai, Tamil Nadu, India
Bachelor of Science in Computer Science and Engineering • 2011 — 2015
Data Structures, Design and Analysis of Algorithms, Object Oriented Programming, Database Management System, Java, Artificial Intelligence, Data Mining and Warehousing, Operating Systems.
Statusphere - Software Engineering Project - Web Application Development
Front end developer • 2017 Jan — 2017 May
- Web application to facilitate influencers to advertise the products in social media. This application also maintains influencer’s information
- Used HTML, CSS, Bootstrap, Javascript, AngularJS to design web pages for the application
Automated Quality Monitoring System for Metro Water - Final Year Undergrad Project
java programmer • 2013 — 2015
- Developed a prototype to detect the quality of drinking water without manual intervention and to send message to the ward inspector if the quality failed to meet the standards
- Used Java programming to implement the automated quality detection system.
Machine Learning
python programmer • 2017 aug — 2017 dec
Implemented the following algorithms-
- Linear Regression
- Logistic Regression
- Artificial Neural Networks
- Kernelized Ridge Regression
- K means clustering and gaussian mixture model clustering
Natural Language Processing project - Fake news Detection
Performed Random Forest and Xg Boost classification Algorithms using python • 2018 jan — 2018 april
- Implemented Fake News Detection using Random Forest, XGBoost classifier in python and calculated the performance in terms of F1 score.
Hybrid Mobile Application Development
Full stack application developer • 2018 jan — 2018 april
- Developed a Hybrid mobile application for Hindu Society of Minnesota (temple). An application to facilitate the society through online mobile payment for their services, online scheduling of events.
- Using Front end designing in Ionic 3 framework, using Angular 4, javascript, typescript, Sass, CSS and HTML. Planning to launch the application in android, ios and windows. Also performing RESTful API services using express and nodejs, using MongoDB database and mongoose.
Programming Languages / Scripting languages / Technologies
Java, Python, Javascript, Angular JS, Angular 4, React JS, Android, jQuery, Bootstrap, HTML, CSS, C, C++, Ionic 3, RESTful API using Express with nodejs, Git.
Databases and Operating Systems
SQL, MongoDB, Oracle Database, IBM DB2, Windows, Linux
Environments
Microsoft Visual Studio, Visual Studio code, Jupyter Notebook, Spyder, Netbeans, Eclipse, Notepad++
Testing tools/ technologies
HP Quality Center, QTP, Selenium, Junit, TestNG
IBM-CE Fundamentals of DB2
certified by IBM
Software Applications Specialist - Java
certified by HCL technologies
Basic and Intermediate Python for data science
Data Camp online
ReactJS
Code Academy
Android application Development
Udemy


Next-Gen Education
Home
connect
Menu
Class XI
Science
Click Here
Humanities
Click Here
Commerce
Click Here
Science
Mathematics
Sets
Relations & Functions
Trigonometric Functions
Principle of Mathematical Induction
Complex Numbers and Quadratic Equations
Linear Inequalities
Permutations and Combinations
Sequence and Series
Straight Lines
Conic Sections
Introduction to Three-dimensional Geometry
Limits and Derivatives
Statistics
Probability
Physics
Physical World
Units and Measurements
Motion in a Straight Line
Motion in a Plane
Laws of Motion
Work, Energy and Power
System of Particles and Rotational Motion
Gravitation
Mechanical Properties of Solids
Wave Optics
Mechanical Properties of Fluids
Thermal Properties of Matter
Thermodynamics
Kinetic Theory
Oscillations
Waves
Chemistry
Some Basic Concepts of Chemistry
Structure of Atom
Classification of Elements and Periodicity in Properties
Chemical Bonding and Molecular Structure
States of Matter: Gases and Liquids
Chemical Thermodynamics
Equilibrium
Redox Reactions
Hydrogen
s -Block Elements
p -Block Elements
Organic Chemistry: Some Basic Principles and Techniques
Hydrocarbons
Environmental Chemistry
Biology
Unit I: Diversity of Living Organism
The Living World
Biological Classification
Plant Kingdom
Animal Kingdom
Unit II: Structural Organisation in Animals and Plants
Morphology of Flowering Plants
Anatomy of Flowering Plants
Structural Organisation in Animals
Unit III: Cell Structure and Function
Cell-The Unit of Life
Biomolecules
Microbes in Human Welfare
Biomolecules
Cell Cycle and Cell Division
Unit IV: Plant Physiology
Transport in Plants
Mineral Nutrition
Photosynthesis in Higher Plants
Respiration in Plants
Plant - Growth and Development
Unit V: Human Physiology
Digestion and Absorption
Breathing and Exchange of Gases
Body Fluids and Circulation
Excretory Products and Their Elimination
Locomotion and Movement
Neural Control and Coordination
Chemical Coordination and Integration
Humanities
History
From the Beginning of Time
Writing and City Life
An Empire Across Three Continents
The Central Islamic Lands
Nomadic Empires
The Three Orders
Changing Cultural Traditions
Confrontation of Cultures
Kings and Chronicles The Mughal Courts
Colonialism and the Countryside: Exploring Official Archives
Displacing Indigenous Peoples
Paths to Modernization
Geography
Fundamentals of Physical Geography
Geography as a discipline
The Earth
Landforms
Climate
Water (Oceans) - OTBA
Life on the Earth
India - Physical Environment
Introduction
Physiography
Climate, vegetation and soil
Practical Work
Fundamentals of Maps
Topographic and Weather Maps
Political Science
The Cold War Era
The End of Bipolarity
US Hegemony in World Politics
Alternative Centres of Power
Contemporary South Asia
International Organisations
Security in the Contemporary World
Environment and Natural Resources
Globalisation
Challenges of Nation Building
Era of One-Party Dominance
Politics of Planned Development
India’s External Relations
Challenges to And Restoration of The Congress System
The Crisis of Democratic Order
Rise of Popular Movements
Regional Aspirations
Recent Developments in Indian Politics
Sociology
Part A: Introducing Sociology
Society, Sociology and its relationship with other Social Sciences
Basic Concepts and their use in Sociology
Understanding Social Institutions
Culture and Socialization
Doing Sociology: Research Methods
Part B: Understanding Society
Social Structure, Stratification and Social Processes in Society
Social Change and Social order in Rural and Urban Society
Environment and Society/a>
Introducing Western Sociologists
Indian Sociologists
Psychology
What is Psychology?
Methods of Enquiry in Psychology
The Bases of Human Behaviour
Psychological Disorders
Sensory, Attentional and Perceptual Processes
Learning
Human Memory
Thinking
Motivation and Emotion
Economics
Part A: Statistics for Economics
Introduction
Collection, Organisation and Presentation of data
Statistical Tools and Interpretation
Part B: Introductory Microeconomics
Introduction
Consumer’s Equilibrium and Demand
Producer Behaviour and Supply
Forms of Market and Price Determination under Perfect Competition with simple applications.
Commerce
Accountancy
Financial Accounting - I
Theoretical Framework
Accounting Process
Financial Accounting - II
Financial Statements of Sole Proprietorship
Financial Statements of Non-Profits
Computers in Accounting
Business Studies
Part A: Foundations of Business
Nature and Purpose of Business
Forms of Business Organisations
Public, Private and Global Enterprises
Business Services
Emerging Modes of Business
Social Responsibility of Business and Business Ethics
Part B: Finance and Trade
Sources of Business Finance
Small Business
Internal Trade
International Business
Economics
Part A: Statistics for Economics
Introduction
Collection, Organisation and Presentation of data
Statistical Tools and Interpretation
Part B: Introductory Microeconomics
Introduction
Consumer’s Equilibrium and Demand
Producer Behaviour and Supply
Forms of Market and Price Determination under Perfect Competition with simple applications.
Mathematics
Sets
Relations & Functions
Trigonometric Functions
Principle of Mathematical Induction
Complex Numbers and Quadratic Equations
Linear Inequalities
Permutations and Combinations
Sequence and Series
Straight Lines
Conic Sections
Introduction to Three-dimensional Geometry
Limits and Derivatives
Statistics
Probability


geomesa-raster¶
About¶
The Raster support in GeoMesa is currently limited in scope and has a few important caveats that are noted here.
The Raster support was intended to contain image pyramids that are EPSG:4326 with tiles on the order of Kb in size. Any rasters attempted to be ingested will need to be tiled prior to ingest, and the tiles must have disjoint extents. Currently only single band images are supported. Sharding is not currently used to spread the table across the cluster.
Ingest¶
Currently ingest is accomplished by using the ingestraster
command
in the GeoMesa command line tools. See the tools README for usage.
GeoServer¶
The GeoMesa-GeoServer plugin contains the GeoMesaCoverageFormat which is used via the GeoServer UI to create a store for GeoMesa Raster table. Once a layer is published the data can be queried via WMS and WCS 1.0.0. Currently the Plugin is biased to grab tiles at a finer spatial resolution than the wms query window, and will down-sample the mosaic.
Building Instructions¶
If you wish to build this project separately, you can with mvn clean install
geomesa/geomesa-raster> mvn clean install
This will produce a jar in target/


Send mail in future!
Email
Subject
Body
We'll send mail from deLorean mail email on the provided date. so, add your name in subject or body of the mail.
Send Date
Send!


Simple feedback using border colors and icons.
Same as before but added with text feedback.
Swap text feedback with tooltip feedback. Be sure to have a parent with position: relative
on it for tooltip positioning.
Validation styles are available for the following form controls and components.


Andres is no stranger to open source projects. In the last nine years, he has designed and released frameworks for PHP and has been involved in web development - his main passion. A TR35 winner, Andres' main drive is to always choose and implement or use the right tool for the job, mostly focused on performance. Therefore in 2011 a new idea was in the works; to create a new kind of framework for PHP developers, one that focuses on usability, features and mostly performance. Through this new innovative approach Phalcon was born. A PHP framework written in C that can offer a wealth of features to developers while maximizing performance and keeping resource utilization low. Andres is one of the core developers of Phalcon and its inspiration.
Unknown person.
Eduar is a C/PHP developer with several years of experience in application development. He is one of the founders and lead developers of the Phalcon project which began in 2011. He has taken part in all areas, from the framework design to the internal kernel functions, including documentation and developer tools. He is driven by a fascination with frameworks, languages and new technologies. Eduar likes science fiction movies and sometimes plays football.
Nikita is a full stack web developer who loves working with open source technology.
Zephir is and has always been an effort of many volunteers:


Ronaldo's Foul-Mouthed Rant At Juve Coach Revealed?
by David KappelCristiano Ronaldo made headlines in Italy once again after another furious reaction to an early substitution reportedly saw him leaving the stadium early. New reports now suggest that he also hurled some foul language at his coach as he walked off the pitch.
Read: Frustrated CR7 Storms Off Pitch, Leaves Stadium? Sarri Responds
The 34-year-old was substituted after just 55 minutes in Juventus' 1-0 win over AC Milan on Sunday, with his replacement, Paulo Dybala, scoring the eventual winner.
While there have been reports that Ronaldo himself asked for to be substituted, a number of Italian and Portuguese publications have stated that he was left furious with his coach.
According to Il Bianconero, the superstar even swore at manager Maurizio Sarri as he walked off the pitch, calling him a "son of a wh***".
Click through the gallery below to see some images of the incident:
Sky Italia reported that Ronaldo left the stadium three minutes before the final whistle blew, while Gazetta dello Sport believe he will not be fined for his actions, but is expected to apologise to his teammates for not returning to the bench.
Juve sporting director Fabio Paratici reportedly contacted the superstar's agent, Jorge Mendes, to clear up the matter and find out if there were any deeper issues troubling his client.
Ronaldo, meanwhile, has remained silent on the incident, but did take to social media after the match against Milan to write "difficult game, important victory! #finoallafine", accompanied with an image of himself from the game.
Read: Ronaldo Facing Two-Year Ban?
He has since left Turin to link up with his Portugal teammates ahead of his country's upcoming 2020 UEFA European Championship qualifiers against Lithuania and Luxembourg.


To recreate, set computer's timezone to Australia/Sydney, open in Safari, and try to select any time after 3pm.