In addition to the ANSI storage classes SDCC allows the following 8051 specific storage classes.
Variables declared with this storage class will be placed in the extern RAM. This is the default storage class for Large Memory model .
eg. xdata unsigned char xduc;
This is the default storage class for Small Memory model. Variables declared with this storage class will be allocated in the internal RAM.
eg. data int iramdata;
Variables declared with this storage class will be allocated into the indirectly addressable portion of the internal ram of a 8051 .
eg.idata int idi;
This is a data-type and a storage class specifier. When a variable is declared as a bit , it is allocated into the bit addressable memory of 8051.
eg.bit iFlag;
Like the bit keyword, sfr / sbit signifies both a data-type and storage class, they are used to describe the special function registers and special bit variables of a 8051.
eg.
sfr at 0x80 P0; /* special function register P0 at location 0x80 */
sbit at 0xd7 CY; /* CY (Carry Flag) */


Home
Login
Sign Up
Sign Up
Firstname
*
Lastname
*
Othername
Email
*
Phonenumber
Password
*
SignUp
Already have an account?
login


General
About
Getting Started
Building REGoth
Building the documentation
Running REGoth
Tutorials
Setting up a test application
World
Waynet
Characters
Creating a new component
Case Studies
Kinds of objects in Gothic
Scene structure
Character state machine
Daedalus VM
Code Reference
Core
Executables
REGoth
Docs
»
Index
Index
E
|
R
E
EmptyGame::config (C++ function)
EmptyGame::EmptyGame (C++ function)
Engine::findEngineContent (C++ function)
Engine::hasFoundGameFiles (C++ function)
Engine::initializeBsf (C++ function)
Engine::loadCachedResourceManifests (C++ function)
Engine::loadGamePackages (C++ function)
Engine::loadModPackages (C++ function)
Engine::run (C++ function)
Engine::saveCachedResourceManifests (C++ function)
Engine::setShaders (C++ function)
Engine::setupInput (C++ function)
Engine::setupMainCamera (C++ function)
Engine::shutdown (C++ function)
EngineConfig::registerCLIEngineOptions (C++ function)
EngineConfig::registerCLIOptions (C++ function)
EngineConfig::verifyCLIEngineOptions (C++ function)
EngineConfig::verifyCLIOptions (C++ function)
EngineConfig::~EngineConfig (C++ function)
R
REGoth::EmptyGame (C++ class)
REGoth::EmptyGame::mConfig (C++ member)
REGoth::Engine (C++ class)
REGoth::Engine::config (C++ function)
REGoth::Engine::mEngineContent (C++ member)
REGoth::Engine::mMainCamera (C++ member)
REGoth::Engine::setupScene (C++ function)
REGoth::EngineConfig (C++ class)
REGoth::EngineConfig::engineExecutablePath (C++ member)
REGoth::EngineConfig::isFullscreen (C++ member)
REGoth::EngineConfig::originalAssetsPath (C++ member)
REGoth::EngineConfig::resolutionX (C++ member)
REGoth::EngineConfig::resolutionY (C++ member)
REGoth::EngineConfig::verbosity (C++ member)
REGoth::parseArguments (C++ function)
REGoth::runEngine (C++ function)


Capacity Grids Prototypes
Information:
If you wish to see a true reflection of how the prototype appears on Tablet/Mobile, access the prototype link on the portable device of your preference
{#
Prototypes
In this section you will find direct access to various flows and design variants of the Prototype.
End To End Prototype
Single Views - Capacity Status Versions
Prototypes
| Variant # | Description | Last Updated | Desktop | Tablet | Mobile |
|---|---|---|---|---|---|
| Variant # 1 | Description Grid View design | Last Updated 19/4/2021 | Desktop View | Tablet {# View #} | Mobile {# View #} |
| Variant # | Description | Last Updated | Desktop | Tablet | Mobile |
|---|---|---|---|---|---|
| Variant # 1 | Description First design put forward to users, | Last Updated 19/3/2021 | Desktop View | Tablet View | Mobile View |
| Variant # 2 | Description Based on the first variant but has stacked label on input fields (in all viewport widths) | Last Updated 08/4/2021 | Desktop View | Tablet View | Mobile View |
| Variant # | Description | Last Updated | Desktop | Tablet | Mobile |
|---|---|---|---|---|---|
| Variant # 3 |
Description A design concept with Tabs
used from GDS. |
Last Updated 19/3/2021 | Desktop View | Tablet View | Mobile View |
| Variant # 4 | Description Based on variant 3 design, but has stacked labels and inputs | Last Updated 19/3/2021 | Desktop View | Tablet View | Mobile View |
Change Log (Deployments)
- 19/4/21
-
Grid View design updates including:
- Counter added to Restore Column
- Pink background removed from some examples
- View
- 16/4/21
- Grid View design developed as per recent sessions
- 13/4/21
- Grid View initial idea(s) added
- 07/4/21
-
Various updates including:
- Refresh/Add buttons added to bottom of Capacity Grids
- Remove Grid icon added to Capacity Grids
- Edit grid icon added to Capacity Grids
- View
- 29/3/21
- Updated Prototype with enriched changes to Variant 2, including adding notification messages
- 17/3/21
-
Added a design concept that:
- Uses GDS Tabs instead of the default DoS tabs
- Has an additional Capcity Grids tab idea (DEVELOP MORE)
- Has a left fly in menu, with icon in top left
- View


You have successfully recovered your Health Gateway account. You may continue to use the service as you did before.
Thanks,
Health Gateway Team


class: center, middle # Java Collections --- # Main interfaces
.center[![](images/colls-coreInterfaces.png)] --- class: center, middle # java.util.Collection --- # Collection * A collection is an object that represents a group of objects; * The Collections Framework is a unified architecture for representing and manipulating collections; * Enables collections to be manipulated independently of implementation details; * The primary advantages of a collections framework are that it: * Reduces programming effort by providing data structures and algorithms so you don't have to write them yourself; * Provides high-performance implementations of data structures and algorithms; ??? * Because the various implementations of each interface are interchangeable, programs can be tuned by switching implementations; --- # Collection * The primary advantages of a collections framework are that it: * Provides interoperability between unrelated APIs; * Reduces the effort required to learn or to design and implement ad hoc APIs; * Fosters software reuse by providing a standard interface for collections and algorithms with which to manipulate them; ??? * Provides interoperability: by establishing a common language to pass collections back and forth; * Reduces the effort: by not requiring you to learn and produce your own ad hoc collections APIs; --- # Collection * Many modification methods in the interfaces are labeled optional; * The documentation for each implementation must specify which optional operations are supported; * Several terms are introduced to aid in this specification: * Collections that do not support modification operations are referred to as "unmodifiable", the counterpart being "modifiable"; * Collections that guarantee that no change in the collection object will be visible are referred to as "immutable", the counterpart being "mutable"; ??? * Optional: implementations are permitted to not perform one or more of these operations, throwing a runtime exception (UnsupportedOperationException) if they are attempted; * Modification operations such as add, remove and clear; --- # Collection * Several terms are introduced to aid in this specification: * Lists that guarantee that their size remains constant even though the elements can change are referred to as "fixed-size", the counterpart being "variable-size"; * Lists that support fast (generally constant time) indexed element access are known as "random access lists", the counterpart being "sequential access lists"; * The RandomAccess marker interface is used by lists to advertise the fact that they support random access; ??? * This enables generic algorithms to change their behavior to provide good performance when applied to either random or sequential access lists; --- class: center, middle # Set --- # Set * A collection that contains no duplicate elements and at most one null element; * All constructors must create a set that contains no duplicate elements; * Some set implementations have restrictions on the elements that they may contain: * Some implementations prohibit null elements; * Some have restrictions on the types of their elements; * Common implementations: * HashSet * TreeSet * LinkedHashSet --- # TreeSet * Based on a TreeMap; * Not synchronized; * Elements are ordered using their natural ordering, or by a Comparator provided at set creation time; * Provides guaranteed log(n) time cost for the basic operations (add, remove and contains); --- # HashSet * Backed by a HashMap instance; * Permits the null element; * Not synchronized; * Makes no guarantees as to the iteration order of the set; * In particular, it does not guarantee that the order will remain constant over time; * Offers constant time performance for the basic operations: add, remove, contains and size; --- # LinkedHashSet * Hash table and linked list implementation of the Set interface, with predictable iteration order; * Permits the null element; * Not synchronized; * Differs from HashSet because it maintains a doubly-linked list running through all of its entries, so it maintains insertion-order; * Provides constant-time performance for the basic operations: add, contains and remove; --- class: center, middle # List --- # List * An ordered collection (a sequence); * User has precise control over where each element is inserted, and can access elements by their index; * Unlike sets, lists typically allow duplicate elements, including multiple null elements; * Some list implementations have restrictions on the elements that they may contain: * Some implementations prohibit null elements; * Some have restrictions on the types of their elements; * Common implementations: * Vector * ArrayList * LinkedList --- # Vector * This class was retrofitted to implement the List interface, making it a member of the Java Collections Framework; * Is roughly equivalent to ArrayList, except that it is synchronized; * If a thread-safe implementation is not needed, it is recommended to use ArrayList; --- # ArrayList * Implements a growable array of objects; * The size can grow as needed to accommodate adding items after the ArrayList has been created; * Operations size, isEmpty, get, set, iterator, and listIterator run in constant time; * All of the other operations run in linear time (roughly); * Each ArrayList instance has a capacity and, as elements are added, its capacity grows automatically; ??? * The add operation runs in amortized constant time; * The capacity is always at least as large as the list size; --- # LinkedList * [Doubly-linked list](https://en.wikipedia.org/wiki/Doubly_linked_list) implementation of the List and Deque interfaces; * A set of sequentially linked nodes; * Each node contains two fields that are references to the previous and to the next node in the sequence; * The beginning and ending nodes point to null; * Not synchronized; * Implements all optional list operations, and permits all elements (including null);
.center[![](images/doubly-linked-list.png)] --- class: center, middle # Queue --- # Queue * A collection designed for holding elements prior to processing; * Provide additional insertion, extraction, and inspection operations; * Every Queue implementation must specify its ordering properties; * Queues typically, but do not necessarily, order elements in a FIFO manner; * Priority queues order elements according to a supplied comparator, or the elements' natural ordering; * Stacks are queues ordering the elements in a LIFO manner; * The head of the queue is always that element which would be removed by a call to remove() or poll(); ??? * Each these additional operations exists in two forms: * One throws an exception if the operation fails, designed specifically for use with capacity-restricted Queue implementations; * The other returns a special value (null or false), for most implementations, where insert operations cannot fail; --- # PriorityQueue * Does not permit null elements; * Not synchronized; * The elements of the priority queue are ordered according to their natural ordering, or by a provided Comparator; * The head is the least element with respect to the specified ordering; ??? * Head: if multiple elements are tied for least value, the head is one of those elements -- ties are broken arbitrarily; --- # PriorityQueue * Is unbounded, but has an internal capacity; * Capacity is always at least as large as the queue size; * As elements are added, its capacity grows automatically; * Provides: * O(log(n)) time for offer, poll, remove and add methods; * Linear time for the remove(Object) and contains(Object) methods; * Constant time for the retrieval methods (peek, element, and size) --- class: center, middle # Deque --- # Deque * Linear collection that supports insertion and removal at both ends; * Name is short for "double ended queue", usually pronounced "deck"; * Extends the Queue interface; * When a deque is used as a queue, FIFO behavior results; * Deques can also be used as LIFO stacks; * Should be used in preference to the legacy Stack class; * Provides two methods to remove interior elements, removeFirstOccurrence and removeLastOccurrence; * Does not provide support for indexed access to elements; * LinkedList is the most popular implementation; --- class: center, middle # Comparisons ## ArrayList vs LinkedList --- # ArrayList vs LinkedList * LinkedList implements List with a doubly-linked list: * Allows for constant-time insertions or removals using iterators; * You can walk the list forwards or backwards, but finding an element in the list takes time proportional to its size; * ArrayList implements List with a dynamically re-sizing array: * Allows constant time random read access; * Adding/removing from anywhere but the end requires shifting all the latter elements over; * When the capacity of the underlying array is exceeded, a bigger array is allocated; ??? * ArrayList resizing makes add operations O(n) at worst case, but constant on average; --- # LinkedList Complexities * get(int index) is O(n) average; * .green[add(E element) is O(1);] * add(int index, E element) is O(n) average; * remove(int index) is O(n) average; * .green[Iterator.remove() is O(1);] * .green[ListIterator.add(E element) is O(1);] --- # ArrayList Complexities * .green[get(int index) is O(1);] * .green[add(E element) is O(1) amortized]; * O(n) worst-case, while resizing array; * add(int index, E element) is O(n) average; * remove(int index) is O(n) average; * Iterator.remove() is O(n) average; * ListIterator.add(E element) is O(n) average; --- # ArrayList vs LinkedList Complexities
.center[![](images/complexity-arraylist-vs-linkedlist.png)] --- class: center, middle # Comparisons ## HashSet vs TreeSet --- # HashSet vs TreeSet * Both implementations are not synchronized; * Both garantee duplicate-free collections of elements; * HashSet is faster than TreeSet on basic operations; * O(1) for operations like add, remove and contains; * TreeSet guarantees that elements will be sorted; * Ascending natural order, or using a comparator specified via constructor; * The cost is O(log n) complexity for basic operations; --- # HashSet vs TreeSet Complexities
.center[![](images/complexity-hashset-vs-treeset.png)] --- class: center, middle # Map --- # Map * A map is an object that maps keys to values; * It cannot contain duplicate keys, each key can map to at most one value; * Not true collections: implementations based on java.util.Map do not implement the Collection interface; * However, they contain collection-view operations, which enables them to be manipulated as collections; * Provides three collection views, which allow a map's contents to be viewed as: * A set of keys; * A collection of values; * A set of key-value mappings; * Common implementations: * HashMap * TreeMap ??? * Some implementations make specific guarantees as to their order, like the TreeMap, and others do not, like the HashMap; * keySet(), values(), entrySet(); --- # HashMap * Implementation of the Map interface based on a hash table; * Is roughly equivalent to Hashtable, except that it is not synchronized and permits null values and the null key; * Provides all of the optional map operations; * Makes no guarantees as to the order of the map and does not guarantee that it will remain constant over time either; * Provides constant-time performance for basic operations (get and put); * Assuming the hash function disperses the elements properly among the buckets; --- #HashMap
.center[![](images/hashtable.png)] --- # HashMap * A HashMap has two parameters that affect its performance: initial capacity and load factor: * The capacity is the number of buckets in the hash table; * The load factor is a measure of how full the hash table is allowed to get before its capacity is automatically increased; * When the number of entries in the hash table exceeds the limit, it is rehashed (internal data structures are rebuilt) so that the number of buckets grows; * Creating it with a sufficiently large capacity will allow the mappings to be stored more efficiently than letting it perform automatic rehashing; ??? * Limit of hash table: product of the load factor and the current capacity; --- # TreeMap * A [Red-Black tree](https://en.wikipedia.org/wiki/Red-black_tree) based NavigableMap/SortedMap implementation; * Sorted according to the natural ordering of its keys, or by a provided Comparator; * This order is reflected when iterating over the map's collection views; * Provides guaranteed O(log(n)) time cost for the containsKey, get, put and remove operations; * Not synchronized; * All keys inserted into a sorted map must implement the Comparable interface (or be accepted by the specified comparator); * All such keys must be mutually comparable: k1.compareTo(k2) or comparator.compare(k1, k2) must not throw a ClassCastException; ??? * Map collection views: entrySet(), keySet() and values() methods; * It is the map analogue of SortedSet; --- class: center, middle # Comparisons ## HashMap vs TreeMap --- # HashMap vs TreeMap * HashMap: * Makes no guarantees about the iteration order; * The order might even change when new elements are added; * Is faster in general, providing O(1) complexity for basic operations; * Only works with objects having a suitable hashCode() operation; * Iteration performance depends on capacity and load factor; * TreeMap: * Guarantees ordering at the cost of being slower: O(log(n)) for basic operations; * Only works with Comparable objects; * Additionally, it implements the SortedMap interface, which contains methods that depend on this sort order; * Does not provide tuning parameters; --- # Credits * [Oracle - Collections Framework Overview](https://docs.oracle.com/javase/8/docs/technotes/guides/collections/index.html) * [StackOverflow](https://stackoverflow.com) * [When to use LinkedList over ArrayList?](https://stackoverflow.com/a/322742/7976727) * [What are the time complexities of various data structures?](https://stackoverflow.com/a/7294635/7976727) * [Hashset vs Treeset](https://stackoverflow.com/a/4464394/7976727) * [What are hashtables and hashmaps and their typical use cases?](https://stackoverflow.com/a/138285/7976727) * [Big-O Cheat Sheet](http://bigocheatsheet.com/) * [Wikipedia](https://en.wikipedia.org/) * [Doubly Linked List](https://en.wikipedia.org/wiki/Doubly_linked_list) * [Hash table](https://en.wikipedia.org/wiki/Hash_table)


[gecode-users] Scheduling
Guido Tack
tack at gecode.org
Mon May 30 12:50:13 CEST 2011
Did you use the version of unary with optional tasks? Otherwise, the same start time ends up in different unary constraints, which is quite likely to be unsatisfiable.
Guido
On 30 May 2011, at 12:07, Alin wrote:
> Christian Schulte <cschulte at ...> writes:
>
>>
>> Please use unary, that's what it is meant for.
>>
>> Christian
>>
>
> I have used unary, but I still have some problems
>
> since I have more than one resource the
> starting time must depend on the resource.
>
> so I set the starting time to depend
> on the resource asigned for the task
> using the reified version of dom
> like this:
>
> for tasks and for resources that can do the task:
> BoolVar condition=expr(resource[i] == possible_resource_for_task_i);
> dom(home, start_time[i], set_possible_values, condition);
>
> where i is the task.
>
> The problem is that this always fails...
> it tries to assign each resource possible
> to the first task
> and sets the starting times for that tasks
>
> but considers that this has failed without tring any
> values for the next resources.
>
> Any idea why this happens ?
> is there a better way to restrict the starting times
> to depend on the resources or this is the correct
> way to do it and I probably have a bug ?
>
> thanks!
>
>
> _______________________________________________
> Gecode users mailing list
> users at gecode.org
> https://www.gecode.org/mailman/listinfo/gecode-users
--
Guido Tack, http://people.cs.kuleuven.be/~guido.tack/
More information about the users
mailing list


REALPATH(1) Debian REALPATH(1) NAME realpath - return the canonicalised absolute pathname SYNOPSIS realpath [-s|--strip] [-z|--zero] filename ... realpath --h|--help realpath --v|--version DESCRIPTION realpath converts each filename argument to an absolute pathname, which has no components that are symbolic links or the special . or .. direc‐ tory entries. (See realpath(3) for more information.) Each path component in the filename must exist, otherwise realpath will fail and non-zero exit status will be returned. Please note that mostly the same functionality is provided by the `-e' option of the readlink(1) command. When the -s option is used realpath only removes the . and .. directo‐ ries, but not symbolic links from filename. If the given filename argu‐ ment is relative (i.e. does not start with `/'), realpath -s prepends to it the current directory name as obtained from the getcwd(2) system call before further processing. Each converted pathname is output to the standard output, on its own line. OPTIONS -s, --strip Only strip . and .., components, but do not resolve symbolic links. -z, --zero Separate output filenames with the null character instead of new‐ line, so it can be used with the `-0' option of xargs(1). -h, --help Print short usage information. -v, --version Show realpath's version number. EXAMPLES For the examples below let's suppose that /usr/bin/X11 is a symbolic link, pointing to directory /usr/bin. Example 1 Regardless of what the current directory is realpath /../usr/bin/X11/./xterm prints /usr/bin/xterm but realpath -s /../usr/bin/X11/./xterm outputs /usr/bin/X11/xterm Example 2 When the current directory is /usr/bin/X11 (which is still a symbolic link to /usr/bin), the output of both realpath ./xterm and realpath -s ./xterm will be /usr/bin/xterm Example 3 Providing that the current directory is /home/user (and the directory exists before and during the realpath run), the command realpath ../path/to/some/./non-existent/./directory/../or/../file will fail with the following error ../path/to/some/./non-existent/./directory/../or/../file: No such file or directory but realpath -s ../path/to/some/./non-existent/./directory/../or/../file will return /home/path/to/some/non-existent/file EXIT STATUS realpath returns a zero exit code when all pathnames were successfully converted. In case of any errors (e.g. missing or unavailable directories in the path), realpath prints error message to stderr and returns a non-zero exit code. SEE ALSO basename(1), dirname(1), readlink(1), chase(1), realpath(3) BUGS Hopefully none :) If you find some, please report them via the normal Debian bug reporting system, see the file /usr/share/doc/debian/bug-reporting.txt in the pack‐ age doc-debian or the reportbug(1) man page. AUTHOR Originally written by Lars Wirzenius<EMAIL_ADDRESS>as a part of the dwww package. Robert Luberda<EMAIL_ADDRESS>currently maintains and extends it. realpath is licensed via the GNU General Public License. While it has been written for Debian, porting it to other systems is strongly encour‐ aged. Debian October 16th, 2011 REALPATH(1)


To install bike navigate for Android:
Install the dropbox app on your phone
Copy the files in here into your dropbox account
Open the files using the dropbox app on your phone, this will install the apps
If you haven't already you'll need to allow unsigned applications, and you shouldn't do this unless you trust that I'm not putting a virus on your phone. To do this go to Settings->Applications->Unknown Sources
The second app will allow you to send me some log files which will help me to diagnose any problems you have. If you have a problem using the app, load the LogCollector app and email it to me<EMAIL_ADDRESS>When using the app you should use headphones if you can, and put the phone somewhere you can feel it vibrating. Before using it for the first time you can feel what the different vibrations are, in summary:
One long vibration for turn left or first exit
Two long vibrations for 2nd exit. You WILL NOT get a vibration for "Continue straight", assume that you are going straight unless told otherwise
Three long vibrations for 3rd exit or turn right
Four long vibrations for 4th exit...
A short vibration at the end of one/three vibrations means slight/keep left or right
Continuous short vibrations mean that you are close (50m away from) the next turn
You can press the volume button (either up or down) twice in quick succession to have the journey information read out to you.
Sometimes the app will not close cleanly, and it will leave the GPS running on your phone. To stop it:
Settings->Applications->Manage applications->BikeDirect->Force stop
video


16-inch MacBook Pro maxes out at over $6000 with 8TB SSD, 64GB RAM, more
by Chance MillerApple’s new 16-inch MacBook Pro is available to order now. It starts at $2,399, which is much lower than some supply chain rumors had suggested. At the high-end, the 16-inch MacBook Pro maxes out at $6,099 and gets you quite a bit of power.
For $6,099 you get 64GB of 2666MHz DDR4 memory, an AMD Radeon Pro 5500M with 8GB of GDDR6 memory graphics card, and an 8TB SSD, which Apple says is a first for a laptop.
Here are the SSD upgrade options from the base 512GB configuration:
- 1TB SSD +$200
- 2TB SSD +$600
- 4TB SSD +$1,200
- 8TB SSD +$2,400
What’s interesting to note is the price delta between the entry-level Mac Pro. While Apple has yet to publish the online configurator for the Mac Pro, we do know that it will start at $5,999 with 256GB of SSD storage. While the Mac Pro has other benefits, such as expandability, the SSD pricing on the 16-inch MacBook Pro and the 512GB base option is particularly notable.
Apple did announce today that the Max Pro and the Pro Display XDR will start shipping in December. We should learn build-to-order configuration options soon.
The 16-inch MacBook Pro also features a new Magic Keyboard, which should greatly improve the reliability compared to the butterfly keyboard. Read all of the details on the new 16-inch MacBook Pro in our full coverage here.
Read more:
- Apple discontinues 15-inch MacBook Pro as 16-inch now available
- Phil Schiller talks 16-inch MacBook Pro Magic Keyboard, Touch Bar, and more in new interview
- Apple announces Mac Pro and Pro Display XDR available starting in December
- Apple announces new 16-inch MacBook Pro: scissor switch ‘Magic Keyboard’, louder speakers, $2399
FTC: We use income earning auto affiliate links. More.


Simply powerful Todos - Personal and Team Task Management
More…
FAST. SIMPLE.
Unbeatable design. Everything you need is one click away.

Dead simple that you'll want to use it for everything (shopping list, movie list ...)
CONQUER LONG TODO LISTS
Stay Motivated. Break down your long never-ending todo lists into flexible milestones (e.g. weekly, daily)
TASK AUTO-MANAGEMENT
Didn't complete a task on time? No problem, Sandglaz will move it to today's time block
Let Sandglaz auto-archive your tasks and more
YOUR LIFE COMPANION
Connect with your Mobile
Receive email reminders
COLLABORATE WORRY-FREE
Multiple
projects & multiple collaborators; easily share each project with
its own collaborators, and customize their permissions.
Real-time
awesomeness: Your grids are kept up-to-date without refreshing your
page. Share your grids with others and Sandglaz will show you the edits
as they happen.
TESTIMONIALS:
★ "Loving Sandglaz! Very simple and easy to use! Kudos!" -- Mark Dino
★
"I don't know what planet you guys beamed in from, but this radical,
intuitive approach to to-do lists and project management may just save
the human race from imminent self-destruction. All hail Sandglaz!" --
Erik Risinger, Professional Organizer, Northampton, MA
★
"I am thoroughly impressed. This answers all of my task list needs, and
I'm so glad I stumbled upon it. I wish I'd found it sooner!" -- Rachel
Hollister, Education Coordinator, EVFAC
★ “Over the years, I personally strived for an effective ToDo software and now Sandglaz solved my problem” -- Startuptunes
★ “@Sandglaz Nothing creepy, but I think I love you.” -- @leafophoto
★
"Amazing software! Thank you very much indeed. I really feel I should
be paying for this" -- Michael Griffiths, Consultant Ophthalmic Surgeon,
UK
★ "(I) had never been enlightened to the
possibilities of intuitiveness and simplicity that an app could offer.”
-- ADDitude Magazine
★ “I've been looking for a tool like this for ages - thanks a lot guys!!” -- @AndrewStkhlm


|
SphinxBase
5prealpha
|
file IO related operations. More...
#include <stdio.h>
#include <sys/stat.h>
#include <sphinxbase/sphinxbase_export.h>
#include <sphinxbase/prim_type.h>
Go to the source code of this file.
Data Structures | |
| struct | lineiter_t |
| Line iterator for files. More... | |
Macros | |
| #define | myfopen(file, mode) _myfopen((file),(mode),__FILE__,__LINE__) |
Typedefs | |
| typedef struct lineiter_t | lineiter_t |
| Line iterator for files. | |
| typedef struct bit_encode_s | bit_encode_t |
| Bitstream encoder - for writing compressed files. | |
Functions | |
| SPHINXBASE_EXPORT FILE * | fopen_comp (const char *file, const char *mode, int32 *ispipe) |
| Like fopen, but use popen and zcat if it is determined that "file" is compressed (i.e., has a .z, .Z, .gz, or .GZ extension). More... | |
| SPHINXBASE_EXPORT void | fclose_comp (FILE *fp, int32 ispipe) |
| Close a file opened using fopen_comp. More... | |
| SPHINXBASE_EXPORT FILE * | fopen_compchk (const char *file, int32 *ispipe) |
| Open a file for reading, but if file not present try to open compressed version (if file is uncompressed, and vice versa). More... | |
| SPHINXBASE_EXPORT FILE * | _myfopen (const char *file, const char *mode, const char *pgm, int32 line) |
| Wrapper around fopen to check for failure and E_FATAL if failed. | |
| SPHINXBASE_EXPORT int32 | fread_retry (void *pointer, int32 size, int32 num_items, FILE *stream) |
| NFS file reads seem to fail now and then. More... | |
| SPHINXBASE_EXPORT char * | fread_line (FILE *stream, size_t *out_len) |
| Read a line of arbitrary length from a file and return it as a newly allocated string. More... | |
| SPHINXBASE_EXPORT lineiter_t * | lineiter_start (FILE *fh) |
| Start reading lines from a file. | |
| SPHINXBASE_EXPORT lineiter_t * | lineiter_start_clean (FILE *fh) |
| Start reading lines from a file, skip comments and trim lines. | |
| SPHINXBASE_EXPORT lineiter_t * | lineiter_next (lineiter_t *li) |
| Move to the next line in the file. | |
| SPHINXBASE_EXPORT void | lineiter_free (lineiter_t *li) |
| Stop reading lines from a file. | |
| SPHINXBASE_EXPORT int | lineiter_lineno (lineiter_t *li) |
| Returns current line number. | |
| bit_encode_t * | bit_encode_attach (FILE *outfh) |
| Attach bitstream encoder to a file. | |
| bit_encode_t * | bit_encode_retain (bit_encode_t *be) |
| Retain pointer to a bit encoder. | |
| int | bit_encode_free (bit_encode_t *be) |
| Release pointer to a bit encoder. More... | |
| int | bit_encode_write (bit_encode_t *be, unsigned char const *bits, int nbits) |
| Write bits to encoder. | |
| int | bit_encode_write_cw (bit_encode_t *be, uint32 codeword, int nbits) |
| Write lowest-order bits of codeword to encoder. | |
| int | bit_encode_flush (bit_encode_t *be) |
| Flush any unwritten bits, zero-padding if necessary. | |
| SPHINXBASE_EXPORT int32 | stat_retry (const char *file, struct stat *statbuf) |
| There is no bitstream decoder, because a stream abstraction is too slow. More... | |
| SPHINXBASE_EXPORT int32 | stat_mtime (const char *file) |
| Return time of last modification for the given file, or -1 if stat fails. | |
| SPHINXBASE_EXPORT int | build_directory (const char *path) |
| Create a directory and all of its parent directories, as needed. More... | |
file IO related operations.
Custom fopen with error checking is implemented. fopen_comp can open a file with .z, .Z, .gz or .GZ extension
WARNING: Usage of stat_retry will results in 100s of waiting time if the file doesn't exist.
Definition in file pio.h.
| int bit_encode_free | ( | bit_encode_t * | be | ) |
| SPHINXBASE_EXPORT int build_directory | ( | const char * | path | ) |
Create a directory and all of its parent directories, as needed.
Definition at line 621 of file pio.c.
References ckd_free(), ckd_salloc, E_ERROR_SYSTEM, and path2dirname().
| SPHINXBASE_EXPORT void fclose_comp | ( | FILE * | fp, |
| int32 | ispipe | ||
| ) |
Close a file opened using fopen_comp.
| fp | In: File pointer to be closed |
| ispipe | In: ispipe argument that was returned by the corresponding fopen_comp() call |
| SPHINXBASE_EXPORT FILE* fopen_comp | ( | const char * | file, |
| const char * | mode, | ||
| int32 * | ispipe | ||
| ) |
Like fopen, but use popen and zcat if it is determined that "file" is compressed (i.e., has a .z, .Z, .gz, or .GZ extension).
| file | In: File to be opened |
| mode | In: "r" or "w", as with normal fopen |
| ispipe | Out: On return *ispipe is TRUE iff file was opened via a pipe |
Definition at line 107 of file pio.c.
References E_FATAL, and string_join().
Referenced by fopen_compchk().
| SPHINXBASE_EXPORT FILE* fopen_compchk | ( | const char * | file, |
| int32 * | ispipe | ||
| ) |
Open a file for reading, but if file not present try to open compressed version (if file is uncompressed, and vice versa).
| file | In: File to be opened |
| ispipe | Out: On return *ispipe is TRUE iff file was opened via a pipe |
Definition at line 201 of file pio.c.
References fopen_comp().
| SPHINXBASE_EXPORT char* fread_line | ( | FILE * | stream, |
| size_t * | out_len | ||
| ) |
Read a line of arbitrary length from a file and return it as a newly allocated string.
| stream | The file handle to read from. |
| out_len | Output: if not NULL, length of the string read. |
| SPHINXBASE_EXPORT int32 fread_retry | ( | void * | pointer, |
| int32 | size, | ||
| int32 | num_items, | ||
| FILE * | stream | ||
| ) |
NFS file reads seem to fail now and then.
Use the following functions in place of the regular fread. It retries failed freads several times and quits only if all of them fail. Be aware, however, that even normal failures such as attempting to read beyond EOF will trigger such retries, wasting about a minute in retries. Arguments identical to regular fread.
Definition at line 408 of file pio.c.
References E_ERROR_SYSTEM, and stat_retry().
| SPHINXBASE_EXPORT int32 stat_retry | ( | const char * | file, |
| struct stat * | statbuf | ||
| ) |
There is no bitstream decoder, because a stream abstraction is too slow.
Instead we read blocks of bits and treat them as bitvectors. Like fread_retry, but for stat. Arguments identical to regular stat. Return value: 0 if successful, -1 if stat failed several attempts.
Definition at line 489 of file pio.c.
References E_ERROR_SYSTEM.
Referenced by fread_retry(), and stat_mtime().


Notify When Price will Be:
Type
Greather than or equals
Less than or equals
rate
Add
List of notifications
Type
Rate
Actions


The text of the zero-th item is updated and the highlighted item changes. A small wrapper, using native webcomponents, is used to create a React-like lifecycle is used to only diff an item that might have changes.


Scott Chamberlain
@recology_
knitr
and Markdown/LaTeX
- make an open science workflow
R
, including knitr
and Markdown/LaTeX
- make an open science workflow
| Data |
Literature
|
Hybrid
|
| rCharts |
GitHub |
|||||||
| CartoDB |
Shiny |
Xie Y (2012). knitr: A general-purpose package for dynamic report generation in R.
knitr
and Markdown/LaTeX
- make an open science workflow


<EMAIL_ADDRESS>Web Designing
subscribe Easy BenKaka@ Youtube channel to watch more videos on Web Designing, Digital Marketing and Graphics Designing.Digital Marketing
subscribe Easy BenKaka@ Youtube channel to watch more videos on Web Designing, Digital Marketing and Graphics Designing.Graphics Designing
subscribe Easy BenKaka@ Youtube channel to watch more videos on Web Designing, Digital Marketing and Graphics Designing.


With urgent attention !!!!!! >From the Desk of the Chairman of the Board Directors of Finance Bank of scotland Dear Friend, My name is Mr Dennis Stevenson, an executive staff and The Chairman of the Board Directors of Finance here in our bank. I have only written to seek your indulgence and assistance. I know this is coming as a suprise but it is the truth. Keep this confidential. (Fifteen-million pounds sterlings) (£15,000,000)pounds sterlings is what we are talking about. All i need from you is your utmost trust and honesty. I am proposing to make the transfer of the above mentioned money to a designated bank account of your choice. Thus, i need your indulgence and support.I will be furnishing you with the details of the transaction as soon as i get a positive response from you. This email is an awareness . It is of great importance to let you know that this business is strictly CONFIDENTIAL. Kindly reply me stating your interest, and I shall furnish you with the details and necessary procedures with which to make the transfer. I anxiously await your response. Send your replies to<EMAIL_ADDRESS>can also call me on my mobile +447040124814 Thanks and Godbless you. Sincerely Yours, Mr Dennis Stevenson.


Our objective has always been to formulate skin, hair and body care products of the finest quality; we investigate widely to source plant-based and laboratory-made ingredients, and use only those with a proven record of safety and efficacy. In each of our unique stores, informed consultants are pleased to introduce the Aesop range and to guide your selections.


astropy.io.fits FAQ¶
Contents
- astropy.io.fits FAQ
- General Questions
- Usage Questions
- Something didn’t work as I expected. Did I do something wrong?
- Astropy crashed and output a long string of code. What do I do?
- Why does opening a file work in CFITSIO, ds9, etc. but not in Astropy?
- How do I turn off the warning messages Astropy keeps outputting to my console?
- What convention does Astropy use for indexing, such as of image coordinates?
- How do I open a very large image that won’t fit in memory?
- How can I create a very large FITS file from scratch?
- How do I create a multi-extension FITS file from scratch?
- Why is an image containing integer data being converted unexpectedly to floats?
- Why am I losing precision when I assign floating point values in the header?
- Why is reading rows out of a FITS table so slow?
- Comparison with Other FITS Readers
General Questions¶
What is PyFITS and how does it relate to Astropy?¶
PyFITS is a library written in, and for use with the Python programming language for reading, writing, and manipulating FITS formatted files. It includes a high-level interface to FITS headers with the ability for high and low-level manipulation of headers, and it supports reading image and table data as Numpy arrays. It also supports more obscure and non-standard formats found in some FITS files.
The astropy.io.fits
module is identical to PyFITS but with the names changed.
When development began on Astropy it was clear that one of the core
requirements would be a FITS reader. Rather than starting from scratch,
PyFITS–being the most flexible FITS reader available for Python–was ported
into Astropy. There are plans to gradually phase out PyFITS as a stand-alone
module and deprecate it in favor of astropy.io.fits
. See more about that in
the next question.
Although PyFITS is written mostly in Python, it includes an optional module written in C that’s required to read/write compressed image data. However, the rest of PyFITS functions without this extension module.
What is the development status of PyFITS?¶
PyFITS is written and maintained by the Science Software Branch at the Space Telescope Science Institute, and is licensed by AURA under a 3-clause BSD license (see LICENSE.txt in the PyFITS source code).
It is now primarily developed as primarily as a component of Astropy
(astropy.io.fits
) rather than as a stand-alone module. There are a few
reasons for this: The first is simply to reduce development effort; the
overhead of maintaining both PyFITS and astropy.io.fits
in separate code
bases is non-trivial. The second is that there are many features of Astropy
(units, tables, etc.) from which the astropy.io.fits
module can benefit
greatly. Since PyFITS is already integrated into Astropy, it makes more sense
to continue development there rather than make Astropy a dependency of PyFITS.
PyFITS’ current primary developer and active maintainer is Erik Bray, though patch submissions are welcome from anyone. PyFITS is now primarily developed in a Git repository for ease of merging to and from Astropy. Patches and issue reports can be posted to the GitHub project for PyFITS, or for Astropy. There is also a legacy Trac site with some older issue reports still open, but new issues should be submitted via GitHub if possible. An SVN mirror of the repository is still maintained as well.
The current stable release series is 3.3.x. Each 3.3.x release tries to contain only bug fixes, and to not introduce any significant behavioral or API changes (though this isn’t guaranteed to be perfect). Patch releases for older release series may be released upon request. Older versions of PyFITS (2.4 and earlier) are no longer actively supported.
Usage Questions¶
Something didn’t work as I expected. Did I do something wrong?¶
Possibly. But if you followed the documentation and things still did not work
as expected, it is entirely possible that there is a mistake in the
documentation, a bug in the code, or both. So feel free to report it as a bug.
There are also many, many corner cases in FITS files, with new ones discovered
almost every week. astropy.io.fits
is always improving, but does not support
all cases perfectly. There are some features of the FITS format (scaled data,
for example) that are difficult to support correctly and can sometimes cause
unexpected behavior.
For the most common cases, however, such as reading and updating FITS headers,
images, and tables, astropy.io.fits
. is very stable and well-tested. Before
every Astropy/PyFITS release it is ensured that all its tests pass on a variety
of platforms, and those tests cover the majority of use-cases (until new corner
cases are discovered).
Astropy crashed and output a long string of code. What do I do?¶
This listing of code is what is knows as a stack trace (or in Python parlance a “traceback”). When an unhandled exception occurs in the code, causing the program to end, this is a way of displaying where the exception occurred and the path through the code that led to it.
As Astropy is meant to be used as a piece in other software projects, some
exceptions raised by Astropy are by design. For example, one of the most
common exceptions is a KeyError
when an attempt is made to read
the value of a non-existent keyword in a header:
>>> from astropy.io import fits
>>> h = fits.Header()
>>> h['NAXIS']
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/path/to/astropy/io/fits/header.py", line 125, in __getitem__
return self._cards[self._cardindex(key)].value
File "/path/to/astropy/io/fits/header.py", line 1535, in _cardindex
raise KeyError("Keyword %r not found." % keyword)
KeyError: "Keyword 'NAXIS' not found."
This indicates that something was looking for a keyword called “NAXIS” that does not exist. If an error like this occurs in some other software that uses Astropy, it may indicate a bug in that software, in that it expected to find a keyword that didn’t exist in a file.
Most “expected” exceptions will output a message at the end of the traceback giving some idea of why the exception occurred and what to do about it. The more vague and mysterious the error message in an exception appears, the more likely that it was caused by a bug in Astropy. So if you’re getting an exception and you really don’t know why or what to do about it, feel free to report it as a bug.
Why does opening a file work in CFITSIO, ds9, etc. but not in Astropy?¶
As mentioned elsewhere in this FAQ, there are many unusual corner cases when dealing with FITS files. It’s possible that a file should work, but isn’t support due to a bug. Sometimes it’s even possible for a file to work in an older version of Astropy or PyFITS, but not a newer version due to a regression that isn’t tested for yet.
Another problem with the FITS format is that, as old as it is, there are many conventions that appear in files from certain sources that do not meet the FITS standard. And yet they are so common-place that it is necessary to support them in any FITS readers. CONTINUE cards are one such example. There are non-standard conventions supported by Astropy/PyFITS that are not supported by CFITSIO and possibly vice-versa. You may have hit one of those cases.
If Astropy is having trouble opening a file, a good way to rule out whether not the problem is with Astropy is to run the file through the fitsverify program. For smaller files you can even use the online FITS verifier. These use CFITSIO under the hood, and should give a good indication of whether or not there is something erroneous about the file. If the file is malformatted, fitsverify will output errors and warnings.
If fitsverify confirms no problems with a file, and Astropy is still having trouble opening it (especially if it produces a traceback) then it’s possible there is a bug in Astropy.
How do I turn off the warning messages Astropy keeps outputting to my console?¶
Astropy uses Python’s built-in warnings subsystem for informing about
exceptional conditions in the code that are recoverable, but that the user may
want to be informed of. One of the most common warnings in astropy.io.fits
occurs when updating a header value in such a way that the comment must be
truncated to preserve space:
Card is too long, comment is truncated.
Any console output generated by Astropy can be assumed to be from the warnings subsystem. See Astropy’s documentation on the Python warnings system for more information on how to control and quiet warnings.
What convention does Astropy use for indexing, such as of image coordinates?¶
All arrays and sequences in Astropy use a zero-based indexing scheme. For
example, the first keyword in a header is header[0]
, not header[1]
.
This is in accordance with Python itself, as well as C, on which Python is
based.
This may come as a surprise to veteran FITS users coming from IRAF, where 1-based indexing is typically used, due to its origins in FORTRAN.
Likewise, the top-left pixel in an N x N array is data[0,0]
. The indices
for 2-dimensional arrays are row-major order, in that the first index is the
row number, and the second index is the column number. Or put in terms of
axes, the first axis is the y-axis, and the second axis is the x-axis. This is
the opposite of column-major order, which is used by FORTRAN and hence FITS.
For example, the second index refers to the axis specified by NAXIS1 in the
FITS header.
In general, for N-dimensional arrays, row-major orders means that the right-most axis is the one that varies the fastest while moving over the array data linearly. For example, the 3-dimensional array:
[[[1, 2],
[3, 4]],
[[5, 6],
[7, 8]]]
is represented linearly in row-major order as:
[1, 2, 3, 4, 5, 6, 7, 8]
Since 2 immediately follows 1, you can see that the right-most (or inner-most) axis is the one that varies the fastest.
The discrepancy in axis-ordering may take some getting used to, but it is a necessary evil. Since most other Python and C software assumes row-major ordering, trying to enforce column-major ordering in arrays returned by Astropy is likely to cause more difficulties than it’s worth.
How do I open a very large image that won’t fit in memory?¶
In PyFITS, prior to version 3.1, when the data portion of an HDU is accessed, the data is read into memory in its entirety. For example:
>>> hdul = pyfits.open('myimage.fits')
>>> hdul[0].data
...
reads the entire image array from disk into memory. For very large images or tables this is clearly undesirable, if not impossible given the available resources.
However, astropy.io.fits.open
has an option to access the data portion of an
HDU by memory mapping using mmap. In both Astropy and newer versions of
PyFITS this is used by default.
What this means is that accessing the data as in the example above only reads
portions of the data into memory on demand. For example, if I request just a
slice of the image, such as hdul[0].data[100:200]
, then just rows 100-200
will be read into memory. This happens transparently, as though the entire
image were already in memory. This works the same way for tables. For most
cases this is your best bet for working with large files.
To ensure use of memory mapping, just add the memmap=True
argument to
fits.open
. Likewise, using memmap=False
will
force data to be read entirely into memory.
The default can also be controlled through a configuration option called
USE_MEMMAP
. Setting this to 0
will disable mmap by default.
Unfortunately, memory mapping does not currently work as well with scaled image data, where BSCALE and BZERO factors need to be applied to the data to yield physical values. Currently this requires enough memory to hold the entire array, though this is an area that will see improvement in the future.
An alternative, which currently only works for image data (that is, non-tables) is the sections interface. It is largely replaced by the better support for mmap, but may still be useful on systems with more limited virtual-memory space, such as on 32-bit systems. Support for scaled image data is flakey with sections too, though that will be fixed. See the documentation on image sections for more details on using this interface.
How can I create a very large FITS file from scratch?¶
This is a very common issue, but unfortunately Astropy does not come with any built-in facilities for creating large files (larger than will fit in memory) from scratch (though it may in the future).
Normally to create a single image FITS file one would do something like:
>>> import numpy
>>> from astropy.io import fits
>> data = numpy.zeros((40000, 40000), dtype=numpy.float64)
>> hdu = fits.PrimaryHDU(data=data)
>> hdu.writeto('large.fits')
However, a 40000 x 40000 array of doubles is nearly twelve gigabytes! Most systems won’t be able to create that in memory just to write out to disk. In order to create such a large file efficiently requires a little extra work, and a few assumptions.
First, it is helpful to anticipate about how large (as in, how many keywords) the header will have in it. FITS headers must be written in 2880 byte blocks–large enough for 36 keywords per block (including the END keyword in the final block). Typical headers have somewhere between 1 and 4 blocks, though sometimes more.
Since the first thing we write to a FITS file is the header, we want to write enough header blocks so that there is plenty of padding in which to add new keywords without having to resize the whole file. Say you want the header to use 4 blocks by default. Then, excluding the END card which Astropy will add automatically, create the header and pad it out to 36 * 4 cards like so:
>>> data = numpy.zeros((100, 100), dtype=numpy.float64)
# This is a stub array that we'll be using the initialize the HDU; its
# exact size is irrelevant, as long as it has the desired number of
# dimensions
>>> hdu = fits.PrimaryHDU(data=data)
>>> header = hdu.header
>>> while len(header) < (36 * 4 - 1):
... header.append() # Adds a blank card to the end
Now adjust the NAXISn keywords to the desired size of the array, and write
only the header out to a file. Using the hdu.writeto()
method will
cause Astropy to “helpfully” reset the NAXISn keywords to match the size of the
dummy array. That is because it works hard to ensure that only valid FITS
files are written. Instead, we can write just the header to a file using
the Header.tofile
method:
>>> header['NAXIS1'] = 40000
>>> header['NAXIS2'] = 40000
>>> header.tofile('large.fits')
Finally, we need to grow out the end of the file to match the length of the data (plus the length of the header). This can be done very efficiently on most systems by seeking past the end of the file and writing a single byte, like so:
>>> with open('large.fits', 'rb+') as fobj:
... # Seek past the length of the header, plus the length of the
... # Data we want to write.
... # The -1 is to account for the final byte taht we are about to
... # write:
... fobj.seek(len(header.tostring()) + (40000 * 40000 * 8) - 1)
... fobj.write('\0')
On modern operating systems this will cause the file (past the header) to be filled with zeros out to the ~12GB needed to hold a 40000 x 40000 image. On filesystems that support sparse file creation (most Linux filesystems, but not the HFS+ filesystem used by most Macs) this is a very fast, efficient operation. On other systems your mileage may vary.
This isn’t the only way to build up a large file, but probably one of the safest. This method can also be used to create large multi-extension FITS files, with a little care.
For creating very large tables, this method may also be used. Though it can be
difficult to determine ahead of time how many rows a table will need. In
general, use of the astropy.io.fits
module is currently discouraged for the
creation and manipulation of large tables. The FITS format itself is not
designed for efficient on-disk or in-memory manipulation of table structures.
For large, heavy-duty table data it might be better too look into using HDF5
through the PyTables library. The Astropy Table
interface can provide an abstraction layer between different on-disk table
formats as well (for example for converting a table between FITS and HDF5).
PyTables makes use of Numpy under the hood, and can be used to write binary table data to disk in the same format required by FITS. It is then possible to serialize your table to the FITS format for distribution. At some point this FAQ might provide an example of how to do this.
How do I create a multi-extension FITS file from scratch?¶
When you open a FITS file with astropy.io.fits.open
, an
HDUList
object is returned, which holds all the HDUs in the
file. This HDUList
class is a subclass of Python’s builtin list
, and can
be created from scratch and used as such:
>>> from astropy.io import fits
>>> new_hdul = fits.HDUList()
>>> new_hdul.append(fits.ImageHDU())
>>> new_hdul.append(fits.ImageHDU())
>>> new_hdul.writeto('test.fits')
Or the HDU instances can be created first (or read from an existing FITS file) and the HDUList instantiated like so:
>>> hdu1 = fits.PrimaryHDU()
>>> hdu2 = fits.ImageHDU()
>>> new_hdul = fits.HDUList([hdu1, hdu2])
>>> new_hdul.writeto('test.fits')
That will create a new multi-extension FITS file with two empty IMAGE extensions (a default PRIMARY HDU is prepended automatically if one was not provided manually).
Why is an image containing integer data being converted unexpectedly to floats?¶
If the header for your image contains non-trivial values for the optional BSCALE and/or BZERO keywords (that is, BSCALE != 1 and/or BZERO != 0), then the raw data in the file must be rescaled to its physical values according to the formula:
physical_value = BZERO + BSCALE * array_value
As BZERO and BSCALE are floating point values, the resulting value must be a float as well. If the original values were 16-bit integers, the resulting values are single-precision (32-bit) floats. If the original values were 32-bit integers the resulting values are double-precision (64-bit floats).
This automatic scaling can easily catch you of guard if you’re not expecting it, because it doesn’t happen until the data portion of the HDU is accessed (to allow things like updating the header without rescaling the data). For example:
>>> hdul = fits.open('scaled.fits')
>>> image = hdul['SCI', 1]
>>> image.header['BITPIX']
32
>>> image.header['BSCALE']
2.0
>>> data = image.data # Read the data into memory
>>> data.dtype
dtype('float64') # Got float64 despite BITPIX = 32 (32-bit int)
>>> image.header['BITPIX'] # The BITPIX will automatically update too
-64
>>> 'BSCALE' in image.header # And the BSCALE keyword removed
False
The reason for this is that once a user accesses the data they may also manipulate it and perform calculations on it. If the data were forced to remain as integers, a great deal of precision is lost. So it is best to err on the side of not losing data, at the cost of causing some confusion at first.
If the data must be returned to integers before saving, use the ImageHDU.scale
method:
>>> image.scale('int32')
>>> image.header['BITPIX']
32
Alternatively, if a file is opened with mode='update'
along with the
scale_back=True
argument, the original BSCALE and BZERO scaling will
be automatically re-applied to the data before saving. Usually this is
not desireable, especially when converting from floating point back to
unsigned integer values. But this may be useful in cases where the raw
data needs to be modified corresponding to changes in the physical values.
To prevent rescaling from occurring at all (good for updating headers–even if
you don’t intend for the code to access the data, it’s good to err on the side
of caution here), use the do_not_scale_image_data
argument when opening
the file:
>>> hdul = fits.open('scaled.fits', do_not_scale_image_data=True)
>>> image = hdul['SCI', 1]
>>> image.data.dtype
dtype('int32')
Why am I losing precision when I assign floating point values in the header?¶
The FITS standard allows two formats for storing floating-point numbers in a header value. The “fixed” format requires the ASCII representation of the number to be in bytes 11 through 30 of the header card, and to be right-justified. This leaves a standard number of characters for any comment string.
The fixed format is not wide enough to represent the full range of values that can be stored in a 64-bit float with full precision. So FITS also supports a “free” format in which the ASCII representation can be stored anywhere, using the full 70 bytes of the card (after the keyword).
Currently Astropy/PyFITS only supports writing fixed format (it can read both formats), so all floating point values assigned to a header are stored in the fixed format. There are plans to add support for more flexible formatting.
In the meantime it is possible to add or update cards by manually formatting the card image from a string, as it should appear in the FITS file:
>>> c = fits.Card.fromstring('FOO =<PHONE_NUMBER>.123456789')
>>> h = fits.Header()
>>> h.append(c)
>>> h
FOO =<PHONE_NUMBER>.123456789
As long as you don’t assign new values to ‘FOO’ via h['FOO'] = 123
, will
maintain the header value exactly as you formatted it (as long as it is valid
according to the FITS standard).
Why is reading rows out of a FITS table so slow?¶
Underlying every table data array returned by astropy.io.fits
is a Numpy
recarray
which is a Numpy array type specifically for representing
structured array data (i.e. a table). As with normal image arrays, Astropy
accesses the underlying binary data from the FITS file via mmap (see the
question “What performance differences are there between astropy.io.fits and
fitsio?” for a deeper explanation fo this). The underlying mmap is then
exposed as a recarray
and in general this is a very efficient way to
read the data.
However, for many (if not most) FITS tables it isn’t all that simple. For
many columns there are conversions that have to take place between the actual
data that’s “on disk” (in the FITS file) and the data values that are returned
to the user. For example FITS binary tables represent boolean values
differently from how Numpy expects them to be represented, “Logical” columns
need to be converted on the fly to a format Numpy (and hence the user) can
understand. This issue also applies to data that is linearly scaled via the
TSCALn
and TZEROn
header keywords.
Supporting all of these “FITS-isms” introduces a lot of overhead that might
not be necessary for all tables, but are still common nonetheless. That’s
not to say it can’t be faster even while supporting the peculiarities of
FITS–CFITSIO for example supports all the same features but is orders of
magnitude faster. Astropy could do much better here too, and there are many
known issues causing slowdown. There are plenty of opportunities for speedups,
and patches are welcome. In the meantime for high-performance applications
with FITS tables some users might find the fitsio
library more to their
liking.
Comparison with Other FITS Readers¶
What is the difference between astropy.io.fits and fitsio?¶
The astropy.io.fits
module (originally PyFITS) is a “pure Python” FITS
reader in that all the code for parsing the FITS file format is in Python,
though Numpy is used to provide access to the FITS data via the
ndarray
interface. astropy.io.fits
currently also accesses the
CFITSIO to support the
FITS Tile Compression convention, but this feature is optional. It does not
use CFITSIO outside of reading compressed images.
fitsio, on the other hand, is a Python
wrapper for the CFITSIO library. All the heavy lifting of reading the FITS
format is handled by CFITSIO, while fitsio
provides an easier to use
object-oriented API including providing a Numpy interface to FITS files read
from CFITSIO. Much of it is written in C (to provide the interface between
Python and CFITSIO), and the rest is in Python. The Python end mostly
provides the documentation and user-level API.
Because fitsio
wraps CFITSIO it inherits most of its strengths and
weaknesses, though it has an added strength of providing an easier to use
API than if one were to use CFITSIO directly.
Why did Astropy adopt PyFITS as its FITS reader instead of fitsio?¶
When the Astropy project was first started it was clear from the start that
one of its core components should be a submodule for reading and writing FITS
files, as many other components would be likely to depend on this
functionality. At the time, the fitsio
package was in its infancy (it
goes back to roughly 2011) while PyFITS had already been established going
back to before the year 2000). It was already a mature package with support
for the vast majority of FITS files found in the wild, including outdated
formats such as “Random Groups” FITS files still used extensively in the
radio astronomy community.
Although many aspects of PyFITS’ interface have evolved over the years, much of it has also remained the same, and is already familiar to astronomers working with FITS files in Python. Most of not all existing training materials were also based around PyFITS. PyFITS was developed at STScI, which also put forward significant resources to develop Astropy, with an eye toward integrating Astropy into STScI’s own software stacks. As most of the Python software at STScI uses PyFITS it was the only practical choice for making that transition.
Finally, although CFITSIO (and by extension fitsio
) can read any FITS files
that conform to the FITS standard, it does not support all of the non-standard
conventions that have been added to FITS files in the wild. It does have some
support for some of these conventions (such as CONTINUE cards and, to a limited
extent, HIERARCH cards), it is not easy to add support for other conventions
to a large and complex C codebase.
PyFITS’ object-oriented design makes supporting non-standard conventions somewhat easier in most cases, and as such PyFITS can be more flexible in the types of FITS files it can read and return useful data from. This includes better support for files that fail to meet the FITS standard, but still contain useful data that should still be readable at least well-enough to correct any violations of the FITS standard. For example, a common error in non-English- speaking regions is to insert non-ASCII characters into FITS headers. This is not a valid FITS file, but still should be readable in some sense. Supporting structural errors such as this is more difficult in CFITSIO which assumes a more rigid structure.
What performance differences are there between astropy.io.fits and fitsio?¶
There are two main performance areas to look at: reading/parsing FITS headers and reading FITS data (image-like arrays as well as tables).
In the area of headers fitsio
is significantly faster in most cases. This
is due in large part to the (almost) pure C implementation (due to the use of
CFITSIO), but also due to fact that it is more rigid and does not support as
many local conventions and other special cases as astropy.io.fits
tries to
support in its pure Python implementation.
That said the difference is small, and only likely to be a bottleneck either when opening files containing thousands of HDUs, or reading the headers out of thousands of FITS files in succession (in either case the difference is not even an order of magnitude).
Where data is concerned the situation is a little more complicated, and
requires some understanding of how PyFITS is implemented versus CFITSIO and
fitsio
. First it’s important to understand how they differ in terms of
memory management.
astropy.io.fits
/PyFITS uses mmap, by default, to provide access to the raw
binary data in FITS files. Mmap is a system call (or in most cases these days
a wrapper in your libc for a lower-level system call) which allows user-space
applications to essentially do the same thing your OS is doing when it uses a
pagefile (swap space) for virtual memory: It allows data in a file on disk to
be paged into physical memory one page (or in practice usually several pages)
at a time on an as-needed basis. These cached pages of the file are also
accessible from all processes on the system, so multiple processes can read
from the same file with little additional overhead. In the case of reading
over all the data in the file the performance difference between using mmap
versus reading the entire data into physical memory at once can vary widely
between systems, hardware, and depending on what else is happening on the
system at the moment, but mmap almost always going to be better.
In principle it requires more overhead since accessing each page will result in a page fault, and the system requires more requests to the disk. But in practice the OS will optimize this pretty aggressively, especially for the most common case of sequential access–also in reality reading the entire thing into memory is still going to result in a whole lot of page faults too. For random access having all the data in physical memory is always going to be best, though with mmap it’s usually going to be pretty good too (one doesn’t normally access all the data in a file in totally random order–usually a few sections of it will be accessed most frequently, the OS will keep those pages in physical memory as best it can). So for the most general case of reading FITS files (or most large data on disk) this is the best choice, especially for casual users, and is hence enabled by default.
CFITSIO/fitsio
, on the other hand, doesn’t assume the existence of
technologies like mmap and page caching. Thus it implements its own LRU cache
of I/O buffers that store sections of FITS files read from disk in memory in
FITS’ famous 2880 byte chunk size. The I/O buffers are used heavily in
particular for keeping the headers in memory. Though for large data reads (for
example reading an entire image from a file) it does bypass the cache and
instead does a read directly from disk into a user-provided memory buffer.
However, even when CFITSIO reads direct from the file, this is still largely less efficient than using mmap: Normally when your OS reads a file from disk, it caches as much of that read as it can in physical memory (in its page cache) so that subsequent access to those same pages does not require a subsequent expensive disk read. This happens when using mmap too, since the data has to be copied from disk into RAM at some point. The difference is that when using mmap to access the data, the program is able to read that data directly out of the OS’s page cache (so long as it’s only being read). On the other hand when reading data from a file into a local buffer such as with fread(), the data is first read into the page cache (if not already present) and then copied from the page cache into the local buffer. So every read performs at least one additional memory copy per page read (requiring twice as much physical memory, and possibly lots of paging if the file is large and pages need to dropped from the cache).
The user API for CFITSIO usually works by having the user allocate a memory buffer large enough to hold the image/table they want to read (or at least the section they’re interested in). There are some helper functions for determining the appropriate amount of space to allocate. Then you just pass it a pointer to your buffer and CFITSIO handles all the reading (usually using the process described above), and copies the results into your user buffer. For large reads it reads directly from the file into your buffer. Though if the data needs to be scaled it makes a stop in CFITSIO’s own buffer first, then writes the rescaled values out to the user buffer (if rescaling has been requested). Regardless, this means that if your program wishes to hold an entire image in memory at once it will use as much RAM as the size of the data. For most applications it’s better (and sufficient) to write it work on smaller sections of the data, but this requires extra complexity. Using mmap on the other hand makes managing this complexity simpler and more efficient.
A very simple and informal test demonstrates this difference. This test was
performed on four simple FITS images (one of which is a cube) of dimensions
256x256, 1024x1024, 4096x4096, and 256x1024x1024. Each image was generated
before the test and filled with randomized 64-bit floating point values. A
similar test was performed using both astropy.io.fits
and fitsio
: A
handle to the FITS file is opened using each library’s basic semantics, and
then the entire data array of the files is copied into a temporary array in
memory (for example if we were blitting the image to a video buffer). For
Astropy the test is written:
def read_test_pyfits(filename):
with fits.open(filename, memmap=True) as hdul:
data = hdul[0].data
c = data.copy()
The test was timed in IPython on a Linux system with kernel version 2.6.32, a 6-core Intel Xeon X5650 CPU clocked at 2.67 GHz per core, and 11.6 GB of RAM using:
for filename in filenames:
print(filename)
%timeit read_test_pyfits(filename)
where filenames
is just a list of the aforementioned generated sample
files. The results were:
256x256.fits
1000 loops, best of 3: 1.28 ms per loop
1024x1024.fits
100 loops, best of 3: 4.24 ms per loop
4096x4096.fits
10 loops, best of 3: 60.6 ms per loop
256x1024x1024.fits
1 loops, best of 3: 1.15 s per loop
For fitsio
the test was:
def read_test_fitsio(filename):
with fitsio.FITS(filename) as f:
data = f[0].read()
c = data.copy()
This was also run in a loop over all the sample files, producing the results:
256x256.fits
1000 loops, best of 3: 476 µs per loop
1024x1024.fits
100 loops, best of 3: 12.2 ms per loop
4096x4096.fits
10 loops, best of 3: 136 ms per loop
256x1024x1024.fits
1 loops, best of 3: 3.65 s per loop
It should be made clear that the sample files were rewritten with new random
data between the Astropy test and the fitsio test, so they were not reading
the same data from the OS’s page cache. Fitsio was much faster on the small
(256x256) image because in that case the time is dominated by parsing the
headers. As already explained this is much faster in CFITSIO. However, as
the data size goes up and the header parsing no longer dominates the time,
astropy.io.fits
using mmap is roughly twice as fast. This discrepancy would
be almost entirely due to it requiring roughly half as many in-memory copies
to read the data, as explained earlier. That said, more extensive benchmarking
could be very interesting.
This is also not to say that astropy.io.fits
does better in all cases. There
are some cases where it is currently blown away by fitsio. See the subsequent
question.
Why is fitsio so much faster than Astropy at reading tables?¶
In many cases it isn’t–there is either no difference, or it may be a little
faster in Astropy depending on what you’re trying to do with the table and
what types of columns or how many columns the table has. There are some
cases, however, where fitsio
can be radically faster, mostly for reasons
explained above in “Why is reading rows out of a FITS table so slow?“
In principle a table is no different from, say, an array of pixels. But instead of pixels each element of the array is some kind of record structure (for example two floats, a boolean, and a 20 character string field). Just as a 64-bit float is an 8 byte record in an array, a row in such a table can be thought of as a 37 byte (in the case of the previous example) record in a 1-D array of rows. So in principle everything that was explained in the answer to the question “What performance differences are there between astropy.io.fits and fitsio?” applies just as well to tables as it does to any other array.
However, FITS tables have many additional complexities that sometimes preclude streaming the data directly from disk, and instead require transformation from the on-disk FITS format to a format more immediately useful to the user. A common example is how FITS represents boolean values in binary tables. Another, significantly more complicated example, is variable length arrays.
As explained in “Why is reading rows out of a FITS table so slow?”,
astropy.io.fits
/PyFITS does not currently handle some of these cases as
efficiently as it could, in particular in cases where a user only wishes to
read a few rows out of a table. Fitsio, on the other hand, has a better
interface for copying one row at a time out of a table and performing the
necessary transformations on that row only, rather than on the entire column
or columns that the row is taken from. As such, for many cases fitsio
gets
much better performance and should be preferred for many performance-critical
table operations.
Fitsio also exposes a microlanguage (implemented in CFITSIO) for making efficient SQL-like queries of tables (single tables only though–no joins or anything like that). This format, described in the CFITSIO documentation can in some cases perform more efficient selections of rows than might be possible with Numpy alone, which requires creating an intermediate mask array in order to perform row selection.


Module pl.pretty
Pretty-printing Lua tables
Functions
| read (s) | read a string representation of a Lua table |
| write (tbl, space, not_clever) | Create a string representation of a Lua table |
| dump (t, ...) | Dump a Lua table out to a file or stdout |
Functions
- read (s)
-
read a string representation of a Lua table
Uses loadstring, but tries to be cautious about loading arbitrary code!
It is expecting a string of the form '{...}', with perhaps some whitespace
before or after the curly braces. An empty environment is used, and
any occurance of the keyword 'function' will be considered a problem.
Parameters:
s
: {string} string of the form '{...}', with perhaps some whitespace before or after the curly braces.
- write (tbl, space, not_clever)
-
Create a string representation of a Lua table
Parameters:
tbl
: {table} Table to serialize to a string.space
: {string} (optional) The indent to use. Defaults to two spaces.not_clever
: {bool} (optional) Use for plain output, e.g {['key']=1}. Defaults to false.
- dump (t, ...)
-
Dump a Lua table out to a file or stdout
Parameters:
t
: {table} The table to write to a file or stdout....
: {string} (optional) File name to write too. Defaults to writing to stdout.


Welcome to TheSweatSpace
The Place to Train, Sweat it Out, and Get Ripped
Home
Services
Contact
Opening Hours
Opening Hours
Week Days Opening Hours
Mondays through Fridays 8:00AM to 20:00PM
Saturdays 10:00AM to 18:00PM
Sundays 12:00Midday to 20:00PM


Github Repo Request by Username
Please enter a GitHub username to view a list of public repositories and descriptions for that user.
Submit
Repository Name
Repository Description


Ruby on Rails
Rails
Ruby and Rails are not the same thing. Ruby is the programming language. Rails is a Rubygem or package library which is installed via terminal or command line. Rails is the web application framework coded using Ruby. Rails makes programming web applications easier and more fun by laying the groundwork that every developer may need to begin coding. As a result, programmers are able to write less code. However because Rails assumes what a developer needs it makes the assumption that there is a best way and discourages all others. Learning the Rails will increase productivity and includes two very important guidelines. One of these guidelines is to keep your code DRY without repeats. The other guideline is to prefer convention over configuration. In other words, code the way Rails wants you to code a web application.
Rails combines Ruby, HTML, CSS, and JS to program web applications on a web server. As a consequence, Rails is considered as a back-end or server-side web application development platform whereas the web browsers Firefox, Chrome, IE, and Safari are examples of front end applications. Web startups usually prefer Rails.
Why Ruby?
So you may have wondered why Ruby is used with rails. Ruby and not Java, PHP, or other programming languages is used in conjunction with Rails because of its "clean" syntax and capabilities of DRY code. Ruby is more streamlined than Java. The greatest advantage of combining Ruby with Rails is the sharing and installation of RubyGems. These gems allow developers to easily obtain the latest version of Rails to aid building complex websites.
Additional Resources on Rails:
Posts
-
The Post DBC Experience
Mixed Emotions
DBC was an awesome, maybe one of a kind experience. I pushed through all 4 phases with the mantids, or the improper plural...
-
How to Ask for Help
How to Ask Good Questions
Experienced Questioning
I don't always ask questions online but when I do I try to be as specific as possible...
-
Ruby on Rails
Rails
Ruby and Rails are not the same thing. Ruby is the programming language. Rails is a Rubygem or package library which is installed via...
-
Resolving Conflicts
A Conflict I Experienced
Honestly, I cannot remember a conflict I've experienced off the top of my head that would be exciting to read or...
-
My Thinking Ways
How do I Think?
I am a concrete sequential thinker which according to cgribben.com mean that I am persistent and product oriented. I am practical...
-
SQL Injection
What is SQL?
SQL is short for Structured Query Language. It is a programming language for querying (fancy word for accessing) and managing databases. SQL...
-
Affirmation and Stereotype Threat
My Values
Accomplishment, accountability, compassion, creativity, efficiency, family, friendships, and integrity area few values which come to mind when I recall the times in my...
-
Blocs, Procs, and Lambdas
Ruby Blocks, Procs, Lambdas
Blocks
A ruby block is the piece of code that is executed. This code can be executed using curly brackets {}...
-
Stereotype Threat
What is Stereotype Threat?
To put it simply, stereotype threat is the experience of not living or carrying out your full potential because of stereotypes....
-
A Pair of Minds
Pairing and Feedback
Pairing
Pairing isn't so bad. The peers are all nice and I haven't met someone who was disrespectful during the sessions. Despite...
-
A Little Ruby
A Snippet into Ruby Classes
When and Why Should I use classes?
One question which kept simmering in my head while working on this week's...
-
Ruby Cycle and Looping
Ruby:Enumberable#Cycle
The #cycle method uses a block for each element of an enumerable object (ranges, hash, or array) repeatedly for n times or endlessly if...
-
Today's Software Apps vs Law
Who Doesn’t Like App Efficiency?
Innovative technologies usually clash with old ways and methods. There are numerous apps out there which are constantly clashing with...
-
What is JS?
What is JavaScript and Why Should You Care?
Javascript(JS) is an object oriented computer programming language often found as a part of web browsers which...
-
CSS Positioning
Positioning in CSS
Elements on a website can be positioned behind, in front of, or next to by using CSS positioning properties: top, left, right,...
-
My Favorite Websites
My 3 Most Visited Websites
Newcelica.org
This is one of my favorite sites because I own a Celica. I do all...
-
Kitchen Vs Table
Kitchen Vs Table
DBC sounds like a buttkicker, a mental, emotional, and physical obstacle course. Honestly, it sounds like it would and should be overwhelming...


filmcritic.com presents a review from staff member Norm Schrager. You can find the review with full credits at http://www.filmcritic.com/misc/emporium.nsf/2a460f93626cd4678625624c007f2b46/358b2d18fee83172882569310002e41d?OpenDocument
SPACE COWBOYS A film review by Norm Schrager Copyright 2000 filmcritic.com
The good news about Space Cowboys is that Clint Eastwood proves to be a skilled comedic director. The bad news is that only the first half of the movie is a comedy - the second half is a sloppy attempt at a heart-pounding, Apollo 13ish, mission-gone-haywire space drama that's vague, oversimplified and unbelievable. There's a gem of an entertaining movie somewhere in there, but it's never fully realized.
The plot is solid high concept. If you did a double-take when you first heard that John Glenn would return to space, you'll love the basic premise of Ken Kaufman's and Howard Klausner's script - four daring, old Air Force codgers weasel their way back into NASA's space shuttle program to attempt an equipment repair mission that only they know how to perform. Our movie visions of strapping, young astronauts (Dennis Quaid, Bill Paxton, Ben Affleck, to name a few) are smashed once we see an aging James Garner pull on an airtight suit.
The man behind the idea is Eastwood's Frank Corvin, a brilliant Top Gun style troublemaker from the 50s who's bitter about his exclusion during NASA's inception. Once he pushes his unlikely proposal through the space program, Corvin travels the South collecting his old flyboy buddies - Tommy Lee Jones as the hard-headed Hawk, a widower who takes unsuspecting thrill seekers on wild flights; Donald Sutherland as smooth ladies' man Jerry, a roller coaster engineer completely unfazed by negative Gs; and Garner as the humble Tank, an old navigator turned pastor. Meeting each of these guys in their natural habitat is a real comedic treat, as Corvin's first mission of convincing them all to join is a fun combination of Armageddon and The Blues Brothers. And these four actors are seasoned to the point of marinade, so they've got no trouble digging in and getting the laughs.
When the movie stays light, dealing broad laughs and poking fun at maturity and ageism, it's easy to suspend disbelief. At times, when the movie jumps ahead without much substance, or the characters seem a bit too cookie-cutter, it's still passable and enjoyable. But when the quartet finally jump on the space shuttle, Space Cowboys dive bombs, becoming just a tepid drama.
>From that point, Eastwood shoots for wide-eyed amazement from the audience (hell, we've seen space walks since Kubrick did it more than 30 years ago), and all the forgivable weaknesses become glaring. The well-timed laughs of the first half become childish, predictable dialogue. William Devane, as a funny, wise-ass, gum-smacking flight director, turns into a cheap imitation of Ed Harris' Apollo 13 character, bellowing lines into space like "Attaboy Frank!" Cut to worried, underdeveloped wife character. Cut back to grimacing, troubled Eastwood. Oh boy.
There's no denying, though, that it is a roar seeing these guys get sent through the ringer at NASA. And it is refreshing to see a movie who's youngest lead actor is 54. But aside from the consistent laughs, there's a lot missing. There's a chance to see these men contemplate the paths of their interesting lives. There's the opportunity to learn more about the families behind them. And there's even more that could've been done about respect of an older generation, and the fact that mistakes and lessons can be learned at any age. Instead, it's all generally ignored as Space Cowboys opts for an easier, less demanding path.
The brutal truth is that this movie was over for me once these guys hit space. The characters lose their energetic charm and begin to pale. The plot becomes wildly unbelievable but asks to be taken seriously. The longer the movie progressed, the lower my admiration. There's a better Space Cowboys than this two-part, 129-minute version - one where an entire 90-minute film is just about four funny, respected men reliving their former glory, blasting off to space in the finale, riding into the sunset and out of sight.
Director: Clint Eastwood Producer: Clint Eastwood, Andrew Lazar Screenwriters: Ken Kaufman, Howard Klausner Stars: Clint Eastwood, Tommy Lee Jones, James Garner, James Cromwell, Donald Sutherland, Loren Dean, Courtney B. Vance, Aleksandr Kuznetsov MPAA Rating: PG-13
Rating: 2 ½ Stars
Official Web Site: www.spacecowboys.net
http://www.amazon.com/exec/obidos/redirect?tag=filmcriticcom&path=subst/video/sellers/amazon-top-100-dvd.html Movie Fiends: Check out Amazon.com's Top 100 Hot DVDs!
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


########### Request Example ################# # URL https://app.divecentrehq.com/api/v1/reports/sales_by_brand # Request Body { user_token: <USER_TOKEN>, store_api_key: <STORE_API_KEY> month: 03 year: 2014 } ########### Response Example ################ { "Mares": "$1140.00", "Scuba Pro": "$0.00", "Cressi": "$0.00", "OCEANIC": "$0.00", "my brand": "$0.00" }
| Param Name | Description |
|---|---|
|
user_token required |
User Token Value: Must be String |
|
store_api_key required |
Store API Key Value: Must be String |
|
month optional |
Number of month for which you want receive reports. By default it's current month Value: Must be Integer |
|
year optional |
Year for which you want receive reports. By default it's current year Value: Must be Integer |
########### Request Example ################# # URL https://app.divecentrehq.com/api/v1/reports/sales_by_category # Request Body { user_token: <USER_TOKEN>, store_api_key: <STORE_API_KEY> month: 03 year: 2014 } ########### Response Example ################ { "Masks": "$1140.00", "BCDs": "$0.00", "Fins": "$0.00" }
| Param Name | Description |
|---|---|
|
user_token required |
User Token Value: Must be String |
|
store_api_key required |
Store API Key Value: Must be String |
|
month optional |
Number of month for which you want receive reports. By default it's current month Value: Must be Integer |
|
year optional |
Year for which you want receive reports. By default it's current year Value: Must be Integer |
########### Request Example ################# # URL https://app.divecentrehq.com/api/v1/reports/sales_by_products # Request Body { user_token: <USER_TOKEN>, store_api_key: <STORE_API_KEY> month: 03 year: 2014 } ########### Response Example ################ { "36\" HP HOSE": "$39.95", "SPRING FIN STRAPS QUICK RELEASE MD": "$34.95", "KIT, SVC, CDX5, YOKE NON DVT": "$30.00", "KIT, SVC, STD 2ND STAGE": "$40.00", "VINYL VALVE PROTECTOR- NITROX": "$1.95" }
| Param Name | Description |
|---|---|
|
user_token required |
User Token Value: Must be String |
|
store_api_key required |
Store API Key Value: Must be String |
|
month optional |
Number of month for which you want receive reports. By default it's current month Value: Must be Integer |
|
year optional |
Year for which you want receive reports. By default it's current year Value: Must be Integer |
########### Request Example ################# # URL https://app.divecentrehq.com/api/v1/reports/sales_by_day # Request Body { user_token: <USER_TOKEN>, store_api_key: <STORE_API_KEY> date: "2014-12-01" } ########### Response Example ################ { "sales_inc_tax": "$0.00", "taxes": "$0.00", "taxable_revenue": "$0.00", "cost_of_goods": "$0.00", "gross_profit": "$0.00" }
| Param Name | Description |
|---|---|
|
user_token required |
User Token Value: Must be String |
|
store_api_key required |
Store API Key Value: Must be String |
|
date optional |
Date of day for report. By default date today Value: Must be Date |
########### Request Example ################# # URL https://app.divecentrehq.com/api/v1/reports/sales_by_staff_member # Request Body { user_token: <USER_TOKEN>, store_api_key: <STORE_API_KEY> date_start: "2014-12-01" date_end: "2014-12-03" } ########### Response Example ################ [ { "John Doe": "$123.44", "Katy Kay": "$1000" } ]
| Param Name | Description |
|---|---|
|
user_token required |
User Token Value: Must be String |
|
store_api_key required |
Store API Key Value: Must be String |
|
date_start optional |
Start date for report. By default - beginning of month Value: Must be Date |
|
date_end optional |
End date for report. By default - date today Value: Must be Date |
########### Request Example ################# # URL https://app.divecentrehq.com/api/v1/reports/financial_reports # Request Body { user_token: <USER_TOKEN>, store_api_key: <STORE_API_KEY> month: 03 year: 2014 } ########### Response Example ################ [ { "id": 782, "name": "Sales Report (Stores::Invoice): 02 Jun, 2014 10:52am", "total_sale": "$207.00" }, { "id": 783, "name": "Sales Report (Stores::Credit): 02 Jun, 2014 10:52am", "total_sale": "$112.00" } ]
| Param Name | Description |
|---|---|
|
user_token required |
User Token Value: Must be String |
|
store_api_key required |
Store API Key Value: Must be String |
|
month optional |
Number of month for which you want receive reports. By default it's current month Value: Must be Integer |
|
year optional |
Year for which you want receive reports. By default it's current year Value: Must be Integer |
########### Request Example ################# # URL https://app.divecentrehq.com/api/v1/reports/financial_reports/1 # Request Body { user_token: <USER_TOKEN>, store_api_key: <STORE_API_KEY> id: 1 } ########### Response Example ################ { financial_report: { id: 890, sent: false, type: "Invoice", completed_sales: "$781.27", tax_total: "$29.26", discounts: "$6.25", total_payments: "$781.27", store: { id: 337, name: "MadisonScuba" }, working_time: { open_at: "2014-07-13T10:22:26-05:00", close_at: "2014-07-13T16:57:42-05:00" }, category_payments: [ { name: "Bags and Boxes", price: "$29.95" }, { name: "Mask Accessories", price: "$7.99" } ], payments_for_complete_sales: [ { payment_type: "Check", amount: "$185.00", id: 1, }, { payment_type: "VISA", amount: "$507.82", id: 2 }, { payment_type: "MasterCard", amount: "$88.45", id: 3 } ], payments_for_layby_sales: [ ], tills: [ { id: 1, created_at: "2014-07-13T10:22:26-05:00", user_name: "Kurt Flitcroft", take_out: true, amount: "$0.00", notes: "" } ] } }
| Param Name | Description |
|---|---|
|
user_token required |
User Token Value: Must be String |
|
store_api_key required |
Store API Key Value: Must be String |
|
year optional |
Year for which you want receive reports. By default it's current year Value: Must be Integer |
|
id required |
Financial Report ID Value: Must be Integer |
########### Request Example ################# # URL https://app.divecentrehq.com/api/v1/reports/financial_reports/1 # Request Body { user_token: <USER_TOKEN>, store_api_key: <STORE_API_KEY>, store: { finance_reports_attributes: { "0": { finance_report_payments_attributes: { "0": { custom_amount: 184.00, id: 1728 }, "1": { custom_amount: 508.82, id: 1729 }, "2": { custom_amount: 88.45, id: 1730 } }, id: 890 } }, tills_attributes: { "0": { take_out: 0, amount: 10.00, notes: "Awesome Note", id: 491 } } } } ########### Response Example ################ # SUCCESS no response #FAILURE { "store": [ "can't be blank" ] }
| Param Name | Description |
|---|---|
|
user_token required |
User Token Value: Must be String |
|
store_api_key required |
Store API Key Value: Must be String |
|
id required |
Financial Report ID Value: Must be Integer |
|
store required |
Value: Must be a Hash |
|
store[finance_reports_attributes] optional , nil allowed |
Value: Must be a Hash |
|
store[finance_reports_attributes][finance_report_payments_attributes] optional , nil allowed |
Value: Must be a Hash |
|
store[finance_reports_attributes][finance_report_payments_attributes][custom_amount] optional |
Changed payment amount Value: Must be Float |
|
store[finance_reports_attributes][finance_report_payments_attributes][id] optional |
Financial report payment id. Should be required if you want update custom_amount value Value: Must be Integer |
|
store[finance_reports_attributes][id] optional |
Finance Report ID Value: Must be Integer |
|
store[tills_attributes] optional , nil allowed |
Value: Must be a Hash |
|
store[tills_attributes][take_out] optional |
Till true - then take out, when false - then put in Value: Must be one of: true, false. |
|
store[tills_attributes][amount] optional |
Amount value Value: Must be Float |
|
store[tills_attributes][notes] optional , nil allowed |
Till note Value: Must be String |
|
store[tills_attributes][id] optional |
Till ID Value: Must be Integer |


contains a textarea whose text is copied to the clipboard. If bordered the textarea is disabled, otherwise the textarea is readonly.
Arguments
container
[value]
initial text
[width]
textarea width, default 200
[height]
textarea height, default 20
[bordered]
boolean to get a bordered textarea
Functions
container
the container (span) which contains the textarea
value()
return the text in the textarea
setValue(value)
to set the text in the textarea
setWidth(width)
to set the textarea width
setHeight(height)
to set the textarea heigth
copyTextToClipBoard(value)
copies the text in the textarea into the clipboard. If value is defined the text in the textarea is set to value, then the textarea text is copied into clipboard


cushion-cli
CouchDB made easy
by
Stefan Judis (@stefanjudis)
ME
- Frontend-Developer
- First Open Source project
- ❤ the web
and I'm absolutely not a ...
But why a CouchDB command line tool?
cushion-cli
- layer on top of cushion
- seen more as a finger excercise
- improve js skills and dive into node.js