Class: Rails::DBConsole
| Relationships & Source Files | |
| Inherits: | Object |
| Defined in: | railties/lib/rails/commands/dbconsole/dbconsole_command.rb |
Class Method Summary
- .new(options = {}) ⇒ DBConsole constructor
- .start(*args)
Instance Method Summary
- #database
- #db_config
- #environment
- #start
- #adapter_class private
- #configurations private
- #find_cmd_and_exec(commands, *args) private
Constructor Details
.new(options = {}) ⇒ DBConsole
# File 'railties/lib/rails/commands/dbconsole/dbconsole_command.rb', line 12
def initialize( = {}) @options = @options[:environment] ||= Rails::Command.environment end
Class Method Details
.start(*args)
[ GitHub ]# File 'railties/lib/rails/commands/dbconsole/dbconsole_command.rb', line 8
def self.start(*args) new(*args).start end
Instance Method Details
#adapter_class (private)
[ GitHub ]# File 'railties/lib/rails/commands/dbconsole/dbconsole_command.rb', line 52
def adapter_class if ActiveRecord::Base.respond_to?(db_config.adapter_class_method) ActiveRecord::Base.public_send(db_config.adapter_class_method) else ActiveRecord::ConnectionAdapters::AbstractAdapter end end
#configurations (private)
[ GitHub ]# File 'railties/lib/rails/commands/dbconsole/dbconsole_command.rb', line 60
def configurations # :doc: require APP_PATH ActiveRecord::Base.configurations = Rails.application.config.database_configuration ActiveRecord::Base.configurations end
#database
[ GitHub ]# File 'railties/lib/rails/commands/dbconsole/dbconsole_command.rb', line 43
def database @options[:database] end
#db_config
[ GitHub ]# File 'railties/lib/rails/commands/dbconsole/dbconsole_command.rb', line 23
def db_config return @db_config if defined?(@db_config) # If the user provided a database, use that. Otherwise find # the first config in the database.yml if database @db_config = configurations.configs_for(env_name: environment, name: database, include_hidden: true) else @db_config = configurations.find_db_config(environment) end unless @db_config missing_db = database ? "'#{database}' database is not" : "No databases are" raise ActiveRecord::AdapterNotSpecified, "#{missing_db} configured for '#{environment}'. Available configuration: #{configurations.inspect}" end @db_config end
#environment
[ GitHub ]# File 'railties/lib/rails/commands/dbconsole/dbconsole_command.rb', line 47
def environment @options[:environment] end
#find_cmd_and_exec(commands, *args) (private)
[ GitHub ]# File 'railties/lib/rails/commands/dbconsole/dbconsole_command.rb', line 66
def find_cmd_and_exec(commands, *args) # :doc: Rails.deprecator.warn(<<~MSG.squish) Rails::DBConsole#find_cmd_and_exec is deprecated and will be removed in Rails 7.2. Please use find_cmd_and_exec on the connection adapter class instead. MSG ActiveRecord::Base.connection.find_cmd_and_exec(commands, *args) end
#start
[ GitHub ]# File 'railties/lib/rails/commands/dbconsole/dbconsole_command.rb', line 17
def start adapter_class.dbconsole(db_config, @options) rescue NotImplementedError abort "Unknown command-line client for #{db_config.database}." end


In the case that you have multiple source files and multiple mzTab files as part of a single conversion, this form will enable you to map the correct mzTab file to the appropriate source file. If you have used the PRIDE mzTab generator to generate your mzTab files, it will have used the default file naming convention of [SOURCE_FILE]-mztab.txt. PRIDE Converter will try and automatically pair up source files and mzTab files based on the default file naming convention.
If the mzTab files do not follow the default file naming convention, you will need to choose from the pull-down menu and assign the proper file manually.


Ephesians 3:19
And to know the love of Christ, which passeth knowledge, that ye might be filled with all the fulness of God.


Best Exercises for beginners
So you walk into a gym and there are these buff dudes lifting heavy weights and screaming, pretty intimidating right. So you go into a corner, the most secluded place in the gym and start lifting those 5-10 pounders and all of a sudden a gym whack comes up and starts giving you advice about what exercises you must be doing to achieve that godly physique.
Every gym beginner goes through stuff like this or it's just pretty relatable to me.
So here's a guide for what all exercises you need to be doing if you are just starting out your fitness journey.
Let's take it step by step, so it's your first day or week in the gym and assumed that you have not lifted any weights before or haven't done any bodyweight exercises in the past, your body is not accustomed to such exercises so first you need to give it some time to adapt to what you are starting out with.
The human body is one wonderful machine it will adapt to anything you throw at it, just give it some time and see what wonders it will do for you.
Start out with some stretching and bodyweight exercises like pushups, situps, and pullups and if you are not able to even do the ups there are some alternatives that you can practice to reach there.
Compound or Isolation exercises, which is better??
Compound exercises are those that hit more than one muscle group in one full range of motion( contraction and relaxation).
Isolation exercises are those that hit only one muscle during one full range of motion.
When starting out you should always opt for compound exercises as they are the best to boost testosterone levels in your body and kickstart muscle growth. So let's list some of the best compound exercises for beginners.
Lat Pulldowns and Pullups
Barbell BenchPress and Pushups
Plank and Leg raises
Squats and Lunges
The Deadlift
Clean and Jerk(Snatch)
Upper Body Movements
The Latissimus dorsi or the 'lats' or 'wings' are one of the biggest muscle in your back. Lat pulldowns is the best exercise to hit those muscles as it not only works the lats but also the biceps and forearms.Once large enough the lats are responsible for the body's V-taper, which most of the men dream for.
The Pectoralis Major or the 'pecs' are the major muscles that make up the chest.Barbell benchpress is an upper body pressing drill that builds up strength specifically in the chest,triceps and the shoulders.
Abdominal or Mid-body movements
The mid-section of the body which comprises of the abs,obliques and the lower back also called as the core of the body is the major muscle group that works as the stabilizers for the whole body. With a strong core you can lift heavyass weights and do whichever workout you want. Its the muscle group that provides superhuman strength to your entire body. So how do you build a strong core, focus on exercises that target the whole body and work those abs.
The plank is a isometric bodyweight exercise that requires you to hold a position similar to a pushup for a maximum amount of time.
Lower Body Movements
Squat known as the king of all exercises is versalite exercise for developing strength in your legs.Squat targets multiple muscles in your legs such as the quadriceps, glutes and the core.Squat is known as a highly functional exercise providing overall strength and agility to the body.
Full Body Movements
And here comes my favourite exercise, the Deadlift.The dealift is the singlemost exercise that works most of the muscles in the body ranging from hamstrings, glutes, lower back, forearms, traps... .When it comes to deadlift, the thing that matters the most is the form and correct body posture. Start out slowly with light weights and soon you will be smashing heavy weights to your gym floor.
If you are familiar with olympic weightlifting, you might know this awesome exercise. Mostly targeted by intermediate and advanced athletes the snatch is the singlemost exercise with the longest range of motion starting from a dealift position to an overhead squat.


Question: I tried locating a beer and I got nothing! What gives?
Answer: We are a start-up company and we rely on people to enter locations for us.
If nobody checked in a beer at your location, you would get "No beers at this location" warning.
Question: Brew Search crashes! Uninstall! 0 stars!
Answer: We are at the early stage of our software development and bugs
do happen. Help us fix this by going to the
"contact us"
page and tell us what happened and what mobile device so we can get this issue resolved.
Question: Do I need GPS turned on to check-in places?
Answer: No. However, GPS will give you a more pinpoint location.
All you need is internet data.
Question: What version of Android or IOS do you support?
Answer: We support Android KitKat and above. For Apple, iPhone 5 and above.
Question: Beer and brewery data isn't up to date
Answer: Click the 3 dots icon on the beer and brewery detail page to update.
It takes 24 hours for the update to change upon approval.
Question: Will you offer a Windows Phone version?
Answer: No. Technology we use doesn't support Windows phone.
Question: Do you sell my personal data to solicitors?
Answer: No.
Question: Where do you get your beer and location information?
Answer: We use 3rd party websites. We use BreweryDB.com for beer / brewery information.
For other locations, maps, and location reviews, we use Google.
Question: I'm traveling overseas. Will Brew Search work in other countries?
Answer: Yes it will. As long as you have data connection, our App will work.
Question: How come I see Nail Bars when I search for bars?
Answer: We know this problem exists. The 3rd party compnay we use to pull data from
searches for where the business type is a bar or where the business name has the word "bar".
We are currently looking for a solution to fix this.
Question: Your App said this brewery is open. In fact, it's been closed for awhile!
Answer: A lot of new breweries open and sadly, a lot of them go out of business.
Flag the brewery as closed on the brewery detail page by clicking on icon.
Review process takes 24 hours and the brewery will be flagged as permanently closed.
Question: There's a beer/brewery that's not on your app. How do I add it?
Answer: You can either contact us and provide us with the name of the beer or brewery if possible
and we'll take care of the rest. Or, you can click the "Post" button in the app menu tab to submit a new beer/brewery.
Question: How close do I have to be to check-in at a location?
Answer: 1000 yards.
Question: Someone is giving false info on new check-ins. How can I notify you?
Answer: Click on the user's check-in detail, hit the red flag button, and tell us the reason why.
We take users that abuse the system seriously and will have them removed.


Welcome to the world of programming!!
How many times were you frustrated while looking out for a good collection of programming/algorithm/interview questions? What did you expect and what did you get? This portal has been created to provide well written, well thought and well explained solutions for selected questions.
1.This website contain all the necessary things about the c,c++,java,python,php programming languages.
2.Here programming start from low level to high level even if someone doesn't have programming background he/she can also learn programming.
Belive us anyone can learn programming


Hawaii boat ramp could restore ocean access in volcano area
HILO, Hawaii (AP) - The Hawaii Department of Land and Natural Resources is expected to seek funding from the state Legislature to establish ocean access at a boat ramp cut off by the Kilauea eruption, officials said.
The Pohoiki boat ramp facility on the Big Island closed shortly after Kilauea began erupting in May 2018, The Hawaii Tribune-Herald reported .
The only ramp between Hilo and Milolii became landlocked by a black sand and cobblestone beach and affected the ability of fishermen to access the ocean, officials said.
A short-term proposal involves driving sheet-pile walls into the ground on either side of the ramp entrance and dredging the channel to provide temporary ocean access, said Dan Dennison, a Department of Land and Natural Resources spokesman.
The department has requested the release of $500,000 from the state’s fiscal year 2020-21 budget, Dennison said.
The state likely would have to prepare an environmental assessment and obtain the necessary permits for the work, according to the Division of Boating and Ocean Recreation.
The department estimated a cost of $8 million to $9 million.
A long-term solution under consideration involves a new boat ramp on the north side of Pohoiki Bay. The Federal Emergency Management Agency is reviewing that proposal, which is estimated to cost $28 million, Dennison said.
“Implementation of either the short-term or long-term projects will of course depend on whether funding becomes available,” Dennison said.
Information from: Hawaii Tribune-Herald, http://www.hawaiitribune-herald.com/
Sign up for Daily Newsletters
Copyright © 2019 The Washington Times, LLC.
Please read our comment policy before commenting.


[1]
i must say it was really a surprise despite i had read before very good comments .
[2]
my wife enjoyed it very much swimming or having breakfast in the tables that sorrounded .


2/7/2016
Today Team Vertigo is proud to announce the formation of Vertigo Studios, a formal team of content creators striving to improve the already rich assortment of media put out each week by Team Vertigo. We are striving to ensure that Vainglory and its community have excellent content to enjoy outside of the game and we are working tirelessly to raise the bar on the expectations that you have for vainglory created media. We would like to take the time to answer questions about the plans of this team and what the future has in store.
Q. What type of content will Vertigo Studios create?
A. Vertigo is already creating amazing content for your viewing pleasure, from our twitch channel twitch.tv/TeamVertigoTV to our multiple streams created each day by our Steam Team (StormGaurdSoilder, SushiKid, ChiefMatt, and ChalupaBatman, to name a few). With the formation of this new division, Vertigo hopes to bring others from the community into the team to help improve our current content while also working to create exciting and new content that the community can be proud of.
Q. How Can I be a part of Vertigo Studios?
A. Just go to our website and apply. We are taking applications for our Stream Team, video producers, Esports Announcers and graphic designers. Just simply select the “Content contributor” option and tell us what you do.
Q. Do I need to have achieved a certain skill tier in the game?
A. Absolutely not, members of Vertigo Studios will be evaluated on their quality of work and there passion for Vainglory. All artist are Vainglorious in our eyes.


By means of this spell, you use an animal to deliver a message. Choose a Tiny beast you can see within range, such as a squirrel, a blue jay, or a bat. You specify a location, which you must have visited, and a recipient who matches a general description, such as “a man or woman dressed in the uniform of the town guard” or “a red-haired dwarf wearing a pointed hat.” You also speak a message of up to twenty-five words. The target beast travels for the duration of the spell toward the specified location, covering about 50 miles per 24 hours for a flying messenger, or 25 miles for other animals.
When the messenger arrives, it delivers your m essage to the creature that you described, replicating the sound of your voice. The messenger speaks only to a creature matching the description you gave. If the messenger doesn't reach its destination before the spell ends, the message is lost, and the beast makes its way back to where you cast this spell.
At Higher Levels. If you cast this spell using a spell slot of 3nd level or higher, the duration of the spell increases by 48 hours for each slot level above 2nd.


Differences between the L1-norm and the L2-norm (Least Absolute Deviations and Least Squares)
[edit: 12/18/2013 Please check this updated post for the rewritten version on this topic. I’m keeping this only for archival purposes. Thanks. ]
[edit: 12/03/2013 As Miroslaw pointed out, there is some confusion here, which I’ll address later in another post. Thanks.]
While practicing machine learning, you may have come upon a choice of deciding whether to use the L1-norm or the L2-norm for regularization, or as a loss function, etc.
L1-norm is also known as least absolute deviations (LAD), least absolute errors (LAE). It is basically minimizing the sum of the absolute differences (S) between the target value (Yi) and the estimated values (f(xi)):
L2-norm is also known as least squares. It is basically minimizing the sum of the square of the differences (S) between the target value (Yi) and the estimated values (f(xi):
The differences of L1-norm and L2-norm can be promptly summarized as follows:
Robustness, per wikipedia, is explained as:
The method of least absolute deviations finds applications in many areas, due to its robustness compared to the least squares method. Least absolute deviations is robust in that it is resistant to outliers in the data. This may be helpful in studies where outliers may be safely and effectively ignored. If it is important to pay attention to any and all outliers, the method of least squares is a better choice.
Intuitively speaking, since a L2-norm squares the error (increasing by a lot if error > 1), the model will see a much larger error ( e vs e2 ) than the L1-norm, so the model is much more sensitive to this example, and adjusts the model to minimize this error. If this example is an outlier, the model will be adjusted to minimize this single outlier case, at the expense of many other common examples, since the errors of these common examples are small compared to that single outlier case.
Stability, per wikipedia, is explained as:
The instability property of the method of least absolute deviations means that, for a small horizontal adjustment of a datum, the regression line may jump a large amount. The method has continuous solutions for some data configurations; however, by moving a datum a small amount, one could “jump past” a configuration which has multiple solutions that span a region. After passing this region of solutions, the least absolute deviations line has a slope that may differ greatly from that of the previous line. In contrast, the least squares solutions is stable in that, for any small adjustment of a data point, the regression line will always move only slightly; that is, the regression parameters are continuous functions of the data.
This is best explained with a picture below (mspaint made, sorry for the low quality):
The top represents L1-norm and the bottom represents L2-norm. The first column represents how a regression line fits these three points using L1-norm and L2-norm respectively.
Suppose we move the green point horizontally slightly towards the right, the L2-norm still maintains the shape of the original regression line but makes a much steeper parabolic curve. However in the L1-norm case, the slope of the regression line is now much more steeper affecting every other predictions even well-beyond the rightmost point. As such, all future predictions are affected much more seriously than the L2-norm results.
Suppose we move the green point even more horizontally further to the right past the first black point (third column), the L2-norm now also changes a bit but not as much as the L1-norm, which the slope has completed turned in direction. This change of slope will definitely invalidate all previous results.
By just a small perturbation of the data points, the regression line changes by a lot. This is what instability of the L1-norm (versus the stability of the L2-norm) means here.
Solution uniqueness is a simpler case but requires a bit of imagination. First, this picture below:
The green line (L2-norm) is the unique shortest path, while the red, blue, yellow (L1-norm) are all same length (=12) for the same route. Generalizing this to n-dimensions. This is why L2-norm has unique solutions while L1-norm does not.
Built-in feature selection is frequently mentioned as a useful property of the L1-norm, which the L2-norm does not. This is actually a result of the L1-norm, which tends to produces sparse coefficients (explained below). Suppose the model have 100 coefficients but only 10 of them have non-zero coefficients, this is effectively saying that “the other 90 predictors are useless in predicting the target values”. L2-norm produces non-sparse coefficients, so does not have this property.
Sparsity refers to that only very few entries in a matrix (or vector) is non-zero. L1-norm has the property of producing many coefficients with zero values or very small values with few large coefficients.
Computational efficiency. L1-norm does not have an analytical solution, but L2-norm does. This allows the L2-norm solutions to be calculated computationally efficiently. However, L1-norm solutions does have the sparsity properties which allows it to be used along with sparse algorithms, which makes the calculation more computationally efficient.
References:
[[edit: 12/18/2013 Please check this updated post for the rewritten version on this topic. I’m keeping this only for archival purposes. Thanks. ]
[edit: 12/03/2013 As Miroslaw pointed out, there is some confusion here, which I’ll address later in another post. Thanks.]


| xtsInternals {xts} | R Documentation |
This help file is to help in development of xts, as well as provide some clarity and insight into its purpose and implementation.
Last modified: 2008-08-06 by Jeffrey A. Ryan Version: 0.5-0 and above
The xts package xts designed as a drop-in replacement for the very popular zoo package. Most all functionality of zoo has been extended or carries into the xts package.
Notable changes in direction include the use of time-based indexing, at first explicitely, now implicitely.
An xts
object consists of data in the form of a matrix,
an index - ordered and increasing, either numeric or integer, and additional
attributes for use internally, or for end-user purposes.
The current implementation enforces two major rules on
the object. One is that the index must be coercible to numeric, by
way of as.POSIXct
. There are defined types that meet this criteria.
See timeBased
for details.
The second requirement is that the object cannot have rownames.
The motivation from this comes in part from the work
Matthew Doyle has done in his data.table class, in the package of the
same name. Rownames in R must be character vectors, and as such
are inefficient in both storage and conversion. By eliminating
the rownames, and providing a numeric index of R internal type REAL
or INTEGER
, it is possible to maintain a connection
to standard R date and time classes via the POSIXct functions, while at
at the same time maximizing efficiencies in data handling.
User level functions index
, as well as conversion to
other classes proceeds as if there were rownames. The code
for index
automatically converts time to numeric in both extraction
and replacement functionality. This provides a level of
abstraction to facilitate internal, and external package use and inter-operability.
There is also new work on providing a C-level API to some of the xts functionality to facilitate external package developers to utilize the fast utility routines such as subsetting and merges, without having to call only from R. Obviously this places far more burden on the developer to not only understand the internal xts implementation, but also to understand all of what is documented for R-internals (and much that isn't). At present the functions and macros available can be found in the ‘xts.h’ file in the src directory.
There is no current documentation for this API. The adventure starts here. Future documentation is planned, not implemented.
Jeffrey A. Ryan


Home
Canteen
Reg
Offers
Contact
More
Offer single
Product
Book a table
Checkout
Confirmation
Blog
Blog + Sidebar
Blog Post
Documentation
Order
0
ကျပ်
0.00
0
0
WELCOME
Some informations about our restaurant
Member Login
Facebook Login
OR
Email
Password
Forgot Passowrd?
Don't have an account?
Sign up here


Name:
What is taught is connected to student's lives.
Students show their learning in various ways, not just in written form.
High expectations for student performance are communicated.
Instructions and explainations are abbreviated.
Visual images are used to communicate ideas.
Stories are shared that are relevant to students.
Hand-on experiences are used to provide concrete example.
I converse with individual students about the things that interest them.
Students are encouraged as they work towards learning goals.
There are expected routines associated with student teacher behaviour
The tasks carried out in class encourage perserverance.
Students are given time to think things through in their own mind.
Local examples including people are used in teaching
Connections are made between new learning and previous learning
Students are asked to volunteer answers rather than being asked directly.
Students are encouraged to seek assistance from others.
We celebrate our successes as learners.
Students are provided with many opportunities to master skills.
Students are assisted with their work as they request assistance.
Tasks carried out encourage student creativity and independent thinking.
Students are acknowledged by name.
Teacher actively listens to student responses.
Students' strengths and capabilities are used to support the class's learning.
Teacher includes students' opinions in drawing consensus about matters.
Local language and culture connections are made explicit in instruction.
I hold positive views of my students and the community they represent.
Feedback is provided as students work on tasks.
My classroom visually represents and affirms local content.
Members of the community contribute to learning.
Learning focuses on topics specific to events in the community.
I give students lots of examples to help assist students in their learning.
The learning in this classroom is beyond academics.
My teaching focuses on the development of culturally located citizens.
The learning environment has clear expectations for student learning.
Stories about the community and its people are used to promote learning
Lessons are paced to allow students time for task completion.
Print


A Macro is something thats is composed by a Trigger and a list of Action. You can perform a lot of things with macros, an example of macro can be "if i recive a message in my smartphone, show me a notification on my PC". As you can see, in this macro there is a condition ("if i recive") to run the macro, this condition in Sinapsi is called Trigger. The Trigger is a necessary component to run the macro, in the Macro there are also a list of actions ("show me a notification").
The Trigger is the event that cause the execution of the Macro. Triggers are device-dependent. In your smartphone you can have triggers like: "if I recive a sms", "if I recive a phone call" and so on, but this triggers cannot be present in tablet device or pc device, because theren't the physical component to recive sms and phone call.
At this point we have the event that excute the Macro, we only need to define the actions to perfom at Macro execution, and in which device to execute the actions. Actions can be somthing like: "send email to ", "Show a notification", "Tweet on my account" and so on.
We saw the film "her" and we were amazed by the Artificial Intelligence of Samantha and her humanity, and we started dreaming of Being able to create something similar.
On the Occasion of exam of computer networks, we started to simplify our dreams regarding the super human AI for something doable. This was the birth of the Sinapsi project.
After the birthday of Ayoub, we begin to write the initial part of the Sinapsi Engine code and Web Service code
We completed the first pre-alpha 1.0 of Sinapsi Engine and the Sinapsi Android client. The Desktop client is still incomplete, the Sinapsi Android client is still bugged, but we are on track, and we hope that Sinapsi have success.
Client Desktop Developer
Web Service Developer, Web Designer and Security Manager
Sinapsi Engine Developer and Android Client Developer


Big Array sorted using bucket sort:
As you can see, without Web Worker, your browser maybe able to sort the big Array but you can't work with your browser while sorting and also your browser won't render anything until sorting ends, that's why you can't see the animated progress bar in the page.
Your browser sorted big Array without any crash or lagging, because your browser supports Web Worker. When you do a job with Web Worker, it's just like when you run a program in another thread. Also you can see the animated progress bar while sorting.


Who I Am
Background
My Projects
If you want to contact me about an opportunity, you can join me with the informations below:
Sabrina Mianne © 2019


--- layout: default url: anmeldung-erhalten lang: en ---
We will let you know as soon as possible if you are one of the first 200.
If under any circumstance you can’t come, please write us an e-mail because we only have a limited number of spots available.


Curation is vital to how I operate on a daily basis. I learn most of what I know through articles and videos shared via email and Twitter. So, I’ve decided to give back and start my own weekly curated link list. There’s no definite theme yet other than mostly web development; I’ll refine it more each week.
Links
Google Fights Pop-ups
It’s almost worrying how much power Google holds over the internet, but as long as they keep working in our favor, I suppose we’ll just keep ruling over us. Last month, Google made a play for the hearts of UX designers everywhere by telling everyone’s clients to chill out with the pop-ups because, seriously, your users hate them.
Web Developer Checklist
If you regularly make websites from start to finish, you may not need this. Then again, maybe you’ve been missing steps and you don’t know it. Web Developer checklist reminds you of all the steps you probably want to take before sending your project out into the web. I haven’t used it yet, but it seems like a smart bookmark.
The New Rules of Form Design
There are a million ways to design and build a form, but almost all of them are seriously flawed. If you want to design forms that are proven to work from a UX perspective, this article is a great place to start.
Create React App
Starting a new project can be one of the worst parts of web development, especially if you work with a lot of libraries. Automation tools like this one are extremely useful for getting started without the initial speedbump. It’s supported by a lot of great developers, so you can count on it to set you up for success.
Git Extras
I rarely use git to it’s full potential. Even now, I’m working from my main branch and rarely create branches for anything other than major refactors that I’m afraid might screw up everything. Git Extras makes it easy to follow best practices like creating branches for issues. I’m going to start using it as soon as I finish writing this.
React FAQ
Here’s another great resource I have bookmarked to use later. I’m not deep into React right now, but I plan to start diving in very soon. I assume this collections of links will prove very useful.


A training for anyone interested in programming with Java. No experience is required. The course starts from and beginner level and rises to advanced.


{% extends 'base.html' %} {% block content %} {% include 'navbar.html' %}
Please do not mess up my testing server. This ruins it for everybody. Thanks!
You may submit your source code for automated testing through one of two ways:
| Date Submitted | Project | Test Cases Passed |
|---|---|---|
| {{ sub.created_date }} | {{ sub.project_name }} | {{ sub.num_passed }}/{{ sub.num_test_cases }} |


|
Extensible Audio Library
This library provides a unified interface for handling audio.
|
Defines how audio sources should be handled. More...
#include <AudioManager.h>
Public Member Functions | |
| SourceMode (chstr name) | |
| SourceMode (chstr name, unsigned int value) | |
| SourceMode | next () const |
| SourceMode | previous () const |
| bool | operator< (const SourceMode &other) const |
| bool | operator> (const SourceMode &other) const |
| bool | operator<= (const SourceMode &other) const |
| bool | operator>= (const SourceMode &other) const |
| bool | operator== (const SourceMode &other) const |
| bool | operator!= (const SourceMode &other) const |
Static Public Member Functions | |
| static int | getCount () |
| static hltypes::Array< SourceMode > | getValues () |
| static hstr | getEnumName () |
| static hltypes::Map< unsigned int, hstr > | getAsMap () |
| static SourceMode | fromInt (int value) |
| static SourceMode | fromUint (unsigned int value) |
| static SourceMode | fromName (chstr name) |
| static bool | hasValue (chstr name) |
| static bool | hasValueFor (int value) |
| static bool | hasValueFor (unsigned int value) |
Static Public Attributes | |
| static const SourceMode | Disk |
| Leaves data on permanent storage device. | |
| static const SourceMode | Ram |
| Copies data to RAM buffer and accesses it from there. | |
Protected Member Functions | |
| SourceMode (unsigned int value) | |
| hltypes::Map< unsigned int, hstr > & | _getInstances () const |
Defines how audio sources should be handled.


Choose Random
Natural
Party Mode!
Cycle through Colors
Choose a Color
Off
Very Fast (1s)
Fast (5s)
Slow (1 minute)
Slower (2 minute)
Very Slow (6 minutes. Default)
Very Regularly (1 in 2)
Regularly (1 in 4)
Irregularly (1 in 6)
Very Irregularly (1 in 20. Default)
Very Fast
Fast
Slow
Very Slow


Rational choice theories of politics'If Option 1 is ranked higher than Option 2, then removing Option 3 should not alter the relative rankings of Options 1 and 2', this is the definition of which property of fairness?Three sets of voters pick between three candidates:
30% prefer A to B to C
40% prefer B to C to A
30% prefer C to A to B
Suppose only the first choice counts, so B wins the election.
However, if C was removed, A would win the election 60% to 40%.
This is an example of violation of which principle?


Let Xendev streamline your online presence. We can build your business anything from simple static portfolios to large and dynamic E-Commerce platforms.
Need a mobile app for your business? Our engineers have you covered! Xendev can build mobile and tablet applications for your business solutions.
Let us migrate your online presence to Amazon AWS. We'll manage your data and secure your information, allowing you to offer more secure services to your customers.
So you've got data? But what does it mean? Xendev can help you analyze your data so your business can streamline processes for maximum returns.
Have a lot of data? Need to collect more? Or perhaps your business needs help determining how to store your data. Xendev can help handle that data.
Do you need managed Information Technology solutions for your business? Let Xendev's IT technicians free your time to focus on your customers needs.
Xendev started as Cre8, a development and marketing studio serving small businesses and startups.
Cre8 moved to Florida and expanded services to include cloud computing and databasing solutions for SMB's.
Cre8 became Xendev!
With that came new services: Managed IT solutions for small businesses.
Xendev expanded its services to include Mobile App Development and Data Analytics consulting.
Xendev offers many technology solutions for your business. Contact Us to custom tailor the right web app, mobile app, information systems and data analytics solutions for your needs.
Data Scientist / Developer
Software Engineer
Solutions Architect
These are a few of our great team members. There's more where they came from!
We have a whole crew of marketers, engineers and data scientists at your disposal.
Contact Us to find out how our team can serve your business.


Pizza Peddler
We are a customer oriented establishement and your satisfaction is our happiness thus we value a lot our customers feedback. Get in touch with us by filling in the form about the experience you had and rate our services.


Genius Lounge
{{ og_title }}
-
Tile Tracker
$15 - $20
- Reliable device
- One of the largest crowd-sourced "lost & found" networks available
- Battery lasts a long time (a year or more in our experience)
-
Anker 10,000 mAh Battery Pack
$25
- Heavy Duty
- Trusted brand with great reviews
- Holds multiple charges for your phone
-
Roav by Anker - Bluetooth Receiver / FM Transmitter
$25
- Great for vehicles with or without an AUX port
- Great sound quality
- 2 USB charging ports
-
Anker Soundcore 2
$40
- Take your music with you.
- 24 hour battery ensures you're not tethered to a wall
- Excellent sound quality
- Water resistant
-
Echo Dot - 3rd Generation
$50
- Set timers, control lights, or play games with just your voice
- Always getting better - Alexa learns new skills and is updated automatically
- Echo Dot can be connected to your speaker system to give you even better sound quality
-
Instant Pot - IP-DUO60 6 Qt. Electric Pressure Cooker
$90
- Cook a delicious meal in a fraction of the time!
- Built in safety features mean this isn't like Grandma's pressure cooker
- Use it to make Yogurt, Rice, Soup, Roast
- Doubles as an extra slow cooker
-
AmazonBasics 2.1 Channel Soundbar
$99
- 31.5" Soundbar with built-in Subwoofer
- Built-in Bluetooth for a wireless connection to your TV or streaming device
- 3 audio profiles for amazing sound no matter what you're listening to
- Wall mount hardware and remote included
-
Anova - Nano Sous Vide Precision Cooker
$99
- Cooks food to a perfect temperature every time
- Simple to use
- Produces consistent restaurant-quality results
-
Apple AirPods
$159
- Wirelessly connects to your iPhone, iPad, or Mac
- Case also charges AirPods, allowing for multiple charges
- 15 minutes in case gives you 3 hours listening time
-
AppleTV 4K
$179
- Stream all your favorite shows and movies
- 4K video with Dolby 7.1 Surround
- Voice search by asking the Siri Remote
*Genius Lounge may received a commision from items purchased via this page.
**Prices subject to change, and were current at time of publish.


Our product is a our properietary Board Game Guru, a smart and intuitive new engine which takes a few things that you like and provides many new games that match your interests! Just take a quick 2-minute questionnaire and allow it to start finding games for you. Take our Questionnaire below to get started!


STRATEGIC DESIGNER. MAKE IT PRETTY. MAKE IT SMART.
I am a multidisciplinary visual designer with experience in strategic print + digital work. Reach me at<EMAIL_ADDRESS>Hi! I'm Allison, and I love great design and big ideas. With degrees in art and advertising, I know the importance of great design as well as a great strategy behind it.
I currently work full-time as a visual designer at Amazon Video in Seattle, Washington. When I'm not designing, you'll find me hanging out with my husband Paul and my awesome jack russell Stevie.


|
DSL-ABM
|
#include "integration_tests.h"
Functions | |
| bool | balancing_all_tested () |
| bool | balancing_exposed_tested () |
| bool | balancing_symptomatic_tested () |
| bool | balancing_all_false () |
| bool | balancing_all_true () |
| bool | complete_test (std::string, std::string dexp_name="test_data/age_dist_exposed_never_sy.txt") |
| bool | complete_test_false (std::string, std::string dexp_name="test_data/age_dist_exposed_never_sy.txt") |
| bool | complete_test_true (std::string, std::string dexp_name="test_data/age_dist_exposed_never_sy.txt") |
| ABM | setup_simulations (double, std::string, int, std::string dexp_name="test_data/age_dist_exposed_never_sy.txt") |
| bool | check_the_sums (int, std::vector< int >, std::vector< int >, std::vector< int >, std::vector< int >, ABM &, int) |
| int | main () |
| bool balancing_all_false | ( | ) |
| bool balancing_all_tested | ( | ) |
| bool balancing_all_true | ( | ) |
| bool balancing_exposed_tested | ( | ) |
| bool balancing_symptomatic_tested | ( | ) |
| bool check_the_sums | ( | int | tmax, |
| std::vector< int > | tot_tested, | ||
| std::vector< int > | tot_pos, | ||
| std::vector< int > | infected_count, | ||
| std::vector< int > | active_count, | ||
| ABM & | abm, | ||
| int | infected_0 | ||
| ) |
| bool complete_test | ( | std::string | pfname, |
| std::string | dexp_name = "test_data/age_dist_exposed_never_sy.txt" |
||
| ) |
| bool complete_test_false | ( | std::string | pfname, |
| std::string | dexp_name = "test_data/age_dist_exposed_never_sy.txt" |
||
| ) |
| bool complete_test_true | ( | std::string | pfname, |
| std::string | dexp_name = "test_data/age_dist_exposed_never_sy.txt" |
||
| ) |
| int main | ( | ) |
| ABM setup_simulations | ( | double | dt, |
| std::string | pfname, | ||
| int | inf0, | ||
| std::string | dexp_name = "test_data/age_dist_exposed_never_sy.txt" |
||
| ) |


QR StreamPad
Its easy using QR StreamPad
Just point your camera to a QR StreamPad beacon and click:
did you
Populate Database
?


% include("../_includes/meta.html",{"sourceBasePath":sourceBasePath}){} %> <% include("../_includes/css.html",{"sourceBasePath":sourceBasePath}){} %>
<% include("../_includes/header.html",{}){} %> {% include main.html %} {% include js.html %} {% include analytics.html %}


Over 500 kg of banned tobacco products seized in Erode
The products, worth ₹5 lakh, were seized from a provision shop and the shopkeeper’s home
by S. P. SaravananOfficials of the Tamil Nadu Food Safety and Drug Administration Department raided a provision shop and the shopkeeper’s house in Anand Nagar in Perundurai, and seized 534 kg banned tobacco products worth Rs. 5 lakh here on Monday.
Based on a tipoff, district collector C. Kathiravan directed T. Kalaivani, District Designated Officer, to inspect the shop. The team raided the shop on the Perundurai – Chennimalai Road and found banned tobacco products stocked for sale. Inquiries with the shopkeeper revealed that he was in possession of more products at his house in the same area. The team inspected the house and found the products in bags.
Mrs. Kalaivani told The Hindu that the licence of the shop would be cancelled and samples would be lifted and sent for laboratory tests and based on the report, action will be initiated. She said that around 15,000 kg banned tobacco products were seized from shopkeepers and traders in the current year and cases were registered against them.


Features
Pricing
Related Products
Features
This product features:
Decreased activation threshold
Our patented uh-huh feature
A new premium design
Pricing
Product 1
$99
Lorem Itsem
Lorem Itsem
Product 2
$129
Lorem Itsem
Lorem Itsem
Lorem Itsem
Product 3
$169
Lorem Itsem
Lorem Itsem
Lorem Itsem
Lorem Itsem
Related Products


|
App Engine Python SDK
v1.6.9 rev.445
The Python runtime is available as an experimental Preview feature.
|
Public Member Functions | |
| def | __init__ |
Public Attributes | |
| width | |
| on | |
| off | |
| color | |
Static Public Attributes | |
| int | THIN = 1 |
| int | THICK = 2 |
| tuple | SOLID = (1, 0) |
| tuple | DASHED = (8, 4) |
| tuple | DOTTED = (2, 4) |
Represents the style for a line on a line chart. Also provides some convenient presets. Object attributes (Passed directly to the Google Chart API. Check there for details): width: Width of the line on: Length of a line segment (for dashed/dotted lines) off: Length of a break (for dashed/dotted lines) color: Color of the line. A hex string, like 'ff0000' for red. Optional, AutoColor will fill this in for you automatically if empty. Some common styles, such as LineStyle.dashed, are available: solid dashed dotted thick_solid thick_dashed thick_dotted
| def google.appengine._internal.graphy.line_chart.LineStyle.__init__ | ( | self, | |
| width, | |||
| on, | |||
| off, | |||
color = None |
|||
| ) |
Construct a LineStyle. See class docstring for details on args.
|
static |
Represents the style for a line on a line chart. Also provides some convenient presets. Object attributes (Passed directly to the Google Chart API. Check there for details): width: Width of the line on: Length of a line segment (for dashed/dotted lines) off: Length of a break (for dashed/dotted lines) color: Color of the line. A hex string, like 'ff0000' for red. Optional, AutoColor will fill this in for you automatically if empty. Some common styles, such as LineStyle.dashed, are available: solid dashed dotted thick_solid thick_dashed thick_dotted


| Other Stuff (C) |
Table of ContentsOther Stuff (C) Overview Note About HTML Links References Tutorials Required Readings The Permuted Index API Documentation Kernels Used CSPICE Modules Used NAIF Documentation Required Reading and Users Guides HTML format documentation Library Source Code Documentation API Documentation Text kernels Text kernel format Lesson 1: Kernel Management with the Kernel Subsystem Task Statement Learning Goals Code Solution First, create a meta text kernel: Now the solution source code: Run the code example Lesson 2: The Kernel Pool Task Statement Learning Goals Code Solution Run the code example Related Routines Lesson 3: Coordinate Conversions Task Statement Learning Goals Code Solution Run the code example Related Routines Lesson 4: Advanced Time Manipulation Routines Task Statement Learning Goals Code Solution Run the code example Lesson 5: Error Handling Task Statement Learning Goals Code Solution Run the code example Task Statement Learning Goals Code Solution Run the code example Relevant Routines: Lesson 6: Windows, and Cells Programming task Learning Goals Code Solution Run the code example Related Routines Lesson 7: Utility and Constants Routines Task Statement Learning Goals Code Solution Run the code example Task Statement Code Solution Run the code example Related Routines Other Stuff (C)
The extensive scope of the CSPICE system's functionality includes features the average user may not expect or appreciate, features NAIF refers to as "Other Stuff." This workbook includes a set of lessons to introduce the beginning to moderate user to such features. The lessons provide a brief description to several related sets of routines, associated reference documents, a programming task designed to teach the use of the routines, and an example solution to the programming problem. Overview
Note About HTML Links
In order for the links to be resolved, if not done already by installing the lessons package under the Toolkit's ``doc/html'' directory, create a subdirectory called ``lessons'' under the ``doc/html'' directory of the ``cspice/'' tree and copy this document to that subdirectory before loading it into a Web browser. References
Of these documents, the ``Tutorials'' contains the highest level descriptions with the least number of details while the ``Required Reading'' documents contain much more detailed specifications. The most complete specifications are provided in the ``API Documentation''. Tutorials
Name Lesson steps/functions it describes ---------------- ----------------------------------------------- concepts Concepts of space geometry and time intro_to_kernels Using kernels, meta-kernels time Time systems, conversions and formats lsk_and_sclk LSK and SCLK derived_quant "high-level" observation geometry computations other_functions Intro to some SPICE "low level" computations exceptions built-in mechanism for trapping/handling errorsThese tutorials are available from the NAIF ftp server at JPL:
http://naif.jpl.nasa.gov/naif/tutorials.html Required Readings
Name Lesson steps/functions that it describes --------------- ----------------------------------------- cells.req The SPICE cell data type error.req The SPICE error handling system kernel.req Loading SPICE kernels time.req Time conversion windows.req The SPICE window data type The Permuted Index
This text document provides a simple mechanism by which users can discover which CSPICE functions perform functions of interest, as well as the names of the source files that contain these functions. API Documentation
For example the path of the source code of the str2et_c routine is
cspice/src/cspice/str2et_c.c Kernels Used
# FILE NAME TYPE DESCRIPTION -- ------------ ---- ------------------------------------------------ 1 naif0008.tls LSK Generic LSK 2 de405s.bsp SPK Planet Ephemeris SPK 3 pck00008.tpc PCK Generic PCKThese SPICE kernels are included in the lesson package available from the NAIF server at JPL:
ftp://naif.jpl.nasa.gov/pub/naif/toolkit_docs/Lessons/ CSPICE Modules Used
CHAPTER EXERCISE FUNCTIONS NON-VOID KERNELS ------- --------- --------- --------- ---------- 1 kpool furnsh_c 1-3 ktotal_c kdata_c unload_c 2 kervar furnsh_c 1-3 gnpool_c dtpool_c gdpool_c gcpool_c 3 coord furnsh_c dpr_c 1-3 prompt_c str2et_c bodvrd_c spkpos_c recrad_c reclat_c recsph_c recgeo_c 4 xtic furnsh_c jyear_c 1 str2et_c timout_c tpictr_c tsetyr_c 5 errsys chkin_c failed_c erract_c prompt_c chkout_c setmsg_c errdp_c errint_c errch_c sigerr_c aderr erract_c eqstr_c 1-3 furnsh_c failed_c prompt_c spkezr_c reset_c 6 win furnsh_c card_c 1-3 str2et_c size_c wnvald_c wnintd_c wnfetd_c et2utc_c wnsumd_c 7 units prompt_c tkvrsn_c prsdp_c eqstr_c convrt_c xconst spd_c dpr_c rpd_c clight_c j2100_c j2000_c tyear_c halfpi_cRefer to the headers of the various functions listed above, as detailed interface specifications are provided with the source code. NAIF Documentation
The sources for a user needing information concerning the CSPICE System or other NAIF product:
Required Reading and Users Guides
abcorr.req cells.req ck.req cspice.req daf.req das.req dla.req dsk.req ek.req ellipses.req error.req frames.req gf.req kernel.req naif_ids.req pck.req planes.req problems.req rotation.req scanning.req sclk.req sets.req spc.req spk.req symbols.req time.req windows.reqNAIF Users Guides (*.ug) describe the proper use of particular CSPICE tools:
brief.ug chronos.ug ckbrief.ug commnt.ug convert.ug dskbrief.ug dskexp.ug frmdiff.ug inspekt.ug mkdsk.ug mkspk.ug msopck.ug simple.ug spacit.ug spkdiff.ug spkmerge.ug states.ug subpt.ug tictoc.ug tobin.ug toxfr.ug version.ugThese text documents exist in the 'doc' directory of the main Toolkit directory:
../cspice/doc/ HTML format documentation
../cspice/doc/html/index.html Library Source Code Documentation
A header consists of several marked sections:
../cspice/src/Find the CSPICE library source code in:
../cspice/src/cspice/Note: The CSPICE source files have two forms: C files created by the f2c conversion process on a SPICELIB files, indicated with a name of the form "module.c," and wrappers files indicated by names of the form "module_c.c" The f2c converted source code is very difficult to read, refer to the wrapper routines if possible. In some cases, NAIF replaced an f2c converted file with a hand written version. API Documentation
...cspice/doc/html/cspice/index.html Text kernels
The subsystem uses two tags:
\begintextand
\begindatato mark information blocks within the text kernel. The \begintext tag specifies all text following the tag as comment information to be ignored by the subsystem. Things to know:
\begintext ... commentary information on the data assignments ... \begindata ... data assignments ...
Text kernel format
VAR_NAME_DP = 1.234 VAR_NAME_INT = 1234 VAR_NAME_STR = 'FORBIN'Please note the use of a single quote in string assignments. Vector assignments. Vectors must contain the same type data.
VEC_NAME_DP = ( 1.234 , 45.678 , 901234.5 ) VEC_NAME_INT = ( 1234 , 456 , 789 ) VEC_NAME_STR = ( 'FORBIN', 'FALKEN', 'ROBUR' ) also VEC_NAME_DP = ( 1.234, 45.678, 901234.5 ) VEC_NAME_STR = ( 'FORBIN', 'FALKEN', 'ROBUR' )Time assignments.
TIME_VAL = @31-JAN-2003-12:34:56.798 TIME_VEC = ( @01-DEC-2004, @15-MAR-2004 )The at-sign character '@' indicates a time string. The pool subsystem converts the strings to double precision TDB (a numeric value). Please note, the time strings must not contain embedded blanks. WARNING - a TDB string is not the same as a UTC string. The above examples depict direct assignments via the '=' operator. The kernel pool also permits incremental assignments via the '+=' operator. Please refer to the kernels required reading, kernel.req, for additional information. Lesson 1: Kernel Management with the Kernel SubsystemTask Statement
Learning Goals
This lesson requires creation of a SPICE meta kernel. Code SolutionFirst, create a meta text kernel:
KPL/MK \begindata KERNELS_TO_LOAD = ( 'kernels/spk/de405s.bsp', 'kernels/pck/pck00008.tpc', 'kernels/lsk/naif0008.tls' ) \begintext... or a more generic meta kernel using the PATH_VALUES/PATH_SYMBOLS functionality to declare path names as variables:
KPL/MK Define the paths to the kernel directory. Use the PATH_SYMBOLS as aliases to the paths. The names and contents of the kernels referenced by this meta-kernel are as follows: File Name Description --------------- ------------------------------ naif0008.tls Generic LSK. de405s.bsp Planet Ephemeris SPK. pck00008.tpc Generic PCK. \begindata PATH_VALUES = ( 'kernels/lsk', 'kernels/spk', 'kernels/pck' ) PATH_SYMBOLS = ( 'LSK', 'SPK', 'PCK' ) KERNELS_TO_LOAD = ( '$LSK/naif0008.tls', '$SPK/de405s.bsp', '$PCK/pck00008.tpc' ) \begintext Now the solution source code:
#include <stdlib.h> #include <stdio.h> #include <strings.h> #include "SpiceUsr.h" /* Define the maximum length for any string, 80 characters plus one null terminator. */ #define LENOUT 81 int main( int argc, char **argv ) { /* Declare the needed variables: */ SpiceChar file [LENOUT]; SpiceChar type [LENOUT]; SpiceChar source [LENOUT]; SpiceInt i; SpiceInt count; SpiceInt handle; SpiceBoolean found; /* Assign the path name of the meta kernel to META. */ SpiceChar * META = "kpool.tm"; /* Load the meta kernel then use KTOTAL to interrogate the SPICE kernel subsystem for the total number of loaded kernel files. */ furnsh_c ( META ); ktotal_c ("ALL", &count ); printf( "Kernel count after load: %d\n", count ); /* Loop over the number of files; interrogate the SPICE system with kdata_c for the kernel names and the type. 'found' returns a boolean indicating whether any kernel files of the specified type were loaded by the kernel subsystem. This example ignores checking 'found' as kernels are known to be loaded. */ for (i = 0L; i < count; i++ ) { kdata_c( i, "ALL", LENOUT, LENOUT, LENOUT, file, type, source, &handle, &found ); printf ( "File %s\n", file ); printf ( "Type %s\n", type ); printf ( "Source %s\n", source ); printf ( "\n" ); } /* Unload one kernel then check the count. */ unload_c ( "kernels/spk/de405s.bsp" ); ktotal_c ( "ALL", &count ); /* The subsystem should report one less kernel. */ printf ( "Kernel count after one unload: %d\n", count ); /* Now unload the meta kernel. This action unloads all files listed in the meta kernel. */ unload_c ( META ); /* Check the count. SPICE should return a count of zero. */ ktotal_c ( "ALL", &count ); printf ( "Kernel count after meta unload: %d\n", count ); exit(0); } Run the code example
Then the kdata_c loop returns the name of each loaded kernel, the type of kernel (SPK, CK, TEXT, etc.) and the source of the kernel - the mechanism that loaded the kernel. The source either identifies a meta kernel, or contains an empty string. An empty source string indicates a direct load of the kernel with a furnsh_c call.
Kernel count after load: 4 File kpool.tm Type META Source File kernels/lsk/naif0008.tls Type TEXT Source kpool.tm File kernels/spk/de405s.bsp Type SPK Source kpool.tm File kernels/pck/pck00008.tpc Type TEXT Source kpool.tm Kernel count after one unload: 3 Kernel count after meta unload: 0 Lesson 2: The Kernel PoolTask Statement
Learning Goals
For the code examples, use this generic text kernel (kervar.tm) containing PCK-type data, kernels to load, and example time strings:
KPL/MK Name the kernels to load. Use path symbols. The names and contents of the kernels referenced by this meta-kernel are as follows: File Name Description --------------- ------------------------------ naif0008.tls Generic LSK. de405s.bsp Planet Ephemeris SPK. pck00008.tpc Generic PCK. \begindata PATH_VALUES = ('kernels/spk', 'kernels/pck', 'kernels/lsk') PATH_SYMBOLS = ('SPK' , 'PCK' , 'LSK' ) KERNELS_TO_LOAD = ( '$SPK/de405s.bsp', '$PCK/pck00008.tpc', '$LSK/naif0008.tls') \begintext Ring model data. \begindata BODY699_RING1_NAME = 'A Ring' BODY699_RING1 = (122170.0 136780.0 0.1 0.1 0.5) BODY699_RING1_1_NAME = 'Encke Gap' BODY699_RING1_1 = (133405.0 133730.0 0.0 0.0 0.0) BODY699_RING2_NAME = 'Cassini Division' BODY699_RING2 = (117580.0 122170.0 0.0 0.0 0.0) \begintext The kernel pool recognizes values preceded by '@' as time values. When read, the kernel subsystem converts these representations into double precision ephemeris time. Caution: The kernel subsystem interprets the time strings identified by '@' as TDB. The same string passed as input to @STR2ET is processed as UTC. The three expressions stored in the EXAMPLE_TIMES array represent the same epoch. \begindata EXAMPLE_TIMES = ( @APRIL-1-2004-12:34:56.789, @4/1/2004-12:34:56.789, @JD2453097.0242684 ) \begintextThe main references for pool routines are found in the source files or API documentation for the particular routines. Code Solution
#include <stdlib.h> #include <stdio.h> #include <string.h> #include "SpiceUsr.h" /* Define the max number of kernel variables of concern for this examples. */ #define N_ITEMS 20 /* Define the maximum length for any string, 80 characters plus one null terminator. */ #define STRLEN 81 int main( int argc, char **argv ) { /* Note, the pool routines return a boolean to 'found' signaling whether the requested variable name exists in the kernel pool. The code solutions do not check the boolean value since the solutions use variables known to exist. In general, code should always check the boolean value to ensure return of valid data. */ /* As usual, type our variables... */ SpiceInt i; SpiceInt j; SpiceInt dim; SpiceInt n_var; SpiceInt n_val; SpiceInt start; SpiceBoolean found; SpiceDouble dvars [N_ITEMS]; SpiceChar cvals [N_ITEMS][STRLEN]; SpiceChar cvars [N_ITEMS][STRLEN]; SpiceChar type; SpiceChar tmplate[12]; /* Load the example kernel containing the kernel variables. The kernels defined in KERNELS_TO_LOAD load into the kernel pool with this call. */ furnsh_c ( "kervar.tm" ); /* Initialize the start value. This values indicates index of the first element to return if a kernel variable is an array. start = 0 indicates return everything. start = 1 indicates return everything but the first element. */ start = 0; /* Set the template for the variable names to find. Let's look for all variables containing the string RING. Define this with the wildcard template '*RING*'. Note: the template '*RING' would match any variable name ending with the RING string. */ strcpy ( tmplate, "*RING*"); /* We're ready to interrogate the kernel pool for the variables matching the template. gnpool_c tells us: 1. Does the kernel pool contain any variables that match the template (value of found). 2. If so, how many variables? (value of n_val) 3. The variable names. (cvals, an array of strings) */ gnpool_c ( tmplate, start, N_ITEMS, STRLEN, &n_val, cvals, &found ); if ( found ) { printf( "Number variables matching template: %d\n", n_val); } else { puts ( "No kernel variables matched template" ); exit(0); } /* Okay, now we know something about the kernel pool variables of interest to us. Let's find out more... */ for (i=0; i<n_val; ++i ) { /* Use dtpool_c to return the dimension and type, C (character) or N (numeric), of each pool variable name in the cvals array. */ dtpool_c ( cvals[i], &found, &dim, &type ); printf ( "\n%s\n", cvals[i]); printf ( " Number items: %d Of type: %c\n\n", dim, type ); /* Use the EQSTR routine to test character equality, 'N' or 'C'. */ if ( type == 'N' ) { /* If 'type' equals "N", we found a numeric array. In this case any numeric array will be an array of double precision numbers ("doubles"). gdpool_c retrieves doubles from the kernel pool. 'dvars' contains the array of 'n_vars' values. */ gdpool_c ( cvals[i], start, N_ITEMS, &n_var, dvars , &found ); for( j=0; j<n_var; ++j ) { printf( " Numeric value: %20.6f\n", dvars[j] ); } } else if ( type == 'C' ) { /* If 'type' equals "C", we found a string array. gcpool_c retrieves string values from the kernel pool. cvars[i] contains the array of 'n_var' values. */ gcpool_c ( cvals[i], start , N_ITEMS, STRLEN , &n_var, cvars , &found ); for( j=0; j<n_var; ++j ) { printf( " String value: %s\n", cvars[j] ); } } } puts( " " ); /* Now look at the kernel variable EXAMPLE_TIMES. Extract this value as an array of doubles. */ gdpool_c ( "EXAMPLE_TIMES", start, N_ITEMS, &n_var, dvars, &found ); puts( "EXAMPLE_TIMES"); for( j=0; j<n_var; ++j ) { printf( " Time value: %20.6f\n", dvars[j] ); } exit(0); } Run the code example
The program then loops over the dtpool_c 6 times, reporting the name of each pool variable, the number of data items assigned to that variable, and the variable type. Within the dtpool_c loop, a second loop outputs the contents of the data variable using gcpool_c or gdpool_c.
Number variables matching template: 6 BODY699_RING1_1 Number items: 5 Of type: N Numeric value:<PHONE_NUMBER>00 Numeric value:<PHONE_NUMBER>00 Numeric value: 0.000000 Numeric value: 0.000000 Numeric value: 0.000000 BODY699_RING1 Number items: 5 Of type: N Numeric value:<PHONE_NUMBER>00 Numeric value:<PHONE_NUMBER>00 Numeric value: 0.100000 Numeric value: 0.100000 Numeric value: 0.500000 BODY699_RING2 Number items: 5 Of type: N Numeric value:<PHONE_NUMBER>00 Numeric value:<PHONE_NUMBER>00 Numeric value: 0.000000 Numeric value: 0.000000 Numeric value: 0.000000 BODY699_RING1_1_NAME Number items: 1 Of type: C String value: Encke Gap BODY699_RING2_NAME Number items: 1 Of type: C String value: Cassini Division BODY699_RING1_NAME Number items: 1 Of type: C String value: A Ring EXAMPLE_TIMES Time value: 134094896.789000 Time value: 134094896.789000 Time value: 134094896.789753Note the final time value differs from the previous values in the final three decimal places despite the intention that all three strings represent the same time. This results from round-off when converting a decimal Julian day representation to the seconds past J2000 ET representation. Related Routines
Lesson 3: Coordinate ConversionsTask Statement
Learning Goals
This lesson presents these coordinate transform routines for rectangular, cylindrical, and spherical systems. Code Solution
#include <stdlib.h> #include <stdio.h> #include <strings.h> #include "SpiceUsr.h" /* Define the length of the time string, 32 characters plus 1 for the null terminator. */ #define LENOUT 33 int main( int argc, char **argv ) { /* Type the variables. */ SpiceInt dim; /* Define the inertial and non inertial frame names. */ SpiceChar inrfrm [] = "J2000"; SpiceChar nonfrm [] = "IAU_EARTH"; SpiceChar timstr [LENOUT]; SpiceDouble et; SpiceDouble range; SpiceDouble ra; SpiceDouble dec; SpiceDouble lat; SpiceDouble colat; SpiceDouble lon; SpiceDouble ltime; SpiceDouble flat; SpiceDouble rad [3]; SpiceDouble pos [3]; /* Load the needed kernels using a furnsh_c call on the meta kernel. */ furnsh_c ( "coord.tm" ); /* Prompt the user for a time string. Convert the time string to ephemeris time J2000 (ET). */ prompt_c ( "Time of interest: ", LENOUT, timstr ); str2et_c ( timstr, &et ); /* Access the kernel pool data for the triaxial radii of the Earth, 'rad[0]' holds the equatorial radius, 'rad[2]' the polar radius. */ bodvrd_c ( "Earth", "RADII", 3, &dim, rad); /* Calculate the flattening factor for the Earth. equatorial_radius - polar_radius flat = ________________________________ equatorial_radius */ flat = (rad[0] - rad[2])/rad[0]; /* Make the spkpos_c call to determine the apparent position of the Moon w.r.t. to the Earth at 'et' in the inertial frame. */ spkpos_c ( "MOON", et, inrfrm, "LT+S","EARTH", pos, <ime); /* Show the current frame and time. */ printf ( " Time : %s\n" , timstr ); printf ( " Inertial Frame: %s\n", inrfrm ); /* First convert the position vector X = pos[0], Y = pos[1], Z = pos[2], to RA/DEC. */ recrad_c ( pos, &range, &ra, &dec ); printf ( " Range/Ra/Dec\n" ); printf ( " Range: %20.6f\n", range ); printf ( " RA : %20.6f\n", ra * dpr_c() ); printf ( " DEC : %20.6f\n", dec* dpr_c() ); /* ...latitudinal coordinates... */ reclat_c ( pos, &range, &lon, &lat ); printf ( " Latitudinal\n" ); printf ( " Rad : %20.6f\n", range); printf ( " Lon : %20.6f\n", lon * dpr_c() ); printf ( " Lat : %20.6f\n", lat * dpr_c() ); /* ...spherical coordinates use the colatitude, the angle from the Z axis. */ recsph_c ( pos, &range, &colat, &lon ); printf ( " Spherical\n"); printf ( " Rad : %20.6f\n", range ); printf ( " Lon : %20.6f\n", lon * dpr_c() ); printf ( " Colat: %20.6f\n", colat * dpr_c() ); /* Make the spkpos_c call to determine the apparent position of the Moon w.r.t. to the Earth at 'et' in the non-inertial, body fixed, frame. */ spkpos_c ( "MOON", et, nonfrm, "LT+S","EARTH", pos, <ime); puts ( " " ); printf ( " Non-inertial Frame: %s\n", nonfrm ); /* ...latitudinal coordinates... */ reclat_c ( pos, &range, &lon, &lat ); printf ( " Latitudinal\n" ); printf ( " Rad : %20.6f\n", range ); printf ( " Lon : %20.6f\n", lon * dpr_c() ); printf ( " Lat : %20.6f\n", lat * dpr_c() ); /* ...spherical coordinates... */ recsph_c ( pos, &range, &colat, &lon ); printf ( " Spherical\n" ); printf ( " Rad : %20.6f\n", range ); printf ( " Lon : %20.6f\n", lon * dpr_c() ); printf ( " Colat: %20.6f\n", colat * dpr_c() ); /* ...finally, convert the position to geodetic coordinates. */ recgeo_c ( pos, rad[0], flat, &lon, &lat, &range ); printf ( " Geodetic\n" ); printf ( " Rad : %20.6f\n", range ); printf ( " Lon : %20.6f\n", lon * dpr_c() ); printf ( " Lat : %20.6f\n", lat * dpr_c() ); puts ( " " ); exit(0); } Run the code example
Time of interest: Feb 3 2002 TDBExamine the Moon position in the J2000 inertial frame, display the time and frame:
Time : Feb 3 2002 TDB Inertial Frame: J2000Convert the Moon Cartesian coordinates to right ascension declination.
Range/Ra/Dec Range:<PHONE_NUMBER>93 RA : 203.643686 DEC : -4.979010Latitudinal. Note the difference in the expressions for longitude and right ascension though they represent a measure of the same quantity. The RA/DEC system measures RA in the interval [0,2Pi). Latitudinal coordinates measures longitude in the interval (-Pi,Pi].
Latitudinal Rad :<PHONE_NUMBER>93 Lon : -156.356314 Lat : -4.979010Spherical. Note the difference between the expression of latitude in the Latitudinal system and the corresponding Spherical colatitude. The spherical coordinate system uses the colatitude, the angle measure away from the positive Z axis. Latitude is the angle between the position vector and the x-y (equatorial) plane with positive angle defined as toward the positive Z direction
Spherical Rad :<PHONE_NUMBER>93 Lon : -156.356314 Colat: 94.979010The same position look-up in a body fixed (non-inertial) frame, IAU_EARTH.
Non-inertial Frame: IAU_EARTHLatitudinal coordinates return the geocentric latitude.
Latitudinal Rad :<PHONE_NUMBER>93 Lon : 70.986950 Lat : -4.989675Spherical.
Spherical Rad :<PHONE_NUMBER>93 Lon : 70.986950 Colat: 94.989675Geodetic. The cartographic lat/lon.
Geodetic Rad :<PHONE_NUMBER>55 Lon : 70.986950 Lat : -4.990249 Related Routines
Lesson 4: Advanced Time Manipulation RoutinesTask Statement
Learning Goals
Code Solution
#include <stdlib.h> #include <stdio.h> #include <strings.h> #include "SpiceUsr.h" /* Define the maximum length for any string, 80 characters plus one null terminator. */ #define STRLEN 256 int main( int argc, char **argv ) { /* Declare the needed variables: */ SpiceDouble et; SpiceDouble et1; SpiceDouble et2; SpiceBoolean ok; SpiceChar error [STRLEN]; SpiceChar pictr [STRLEN]; SpiceChar timstr[STRLEN]; /* Assign the META variable to the name of the meta-kernel that contains the LSK kernel and create an arbitrary time string. */ SpiceChar * CALSTR = "Mar 15, 2003 12:34:56.789 AM PST"; SpiceChar * META = "xtic.tm"; SpiceChar * AMBIGSTR = "Mar 15, 79 12:34:56"; /* Load the meta-kernel. */ furnsh_c ( META ); printf ( "Original time string : %s\n", CALSTR ); /* Convert the time string to the number of ephemeris seconds past the J2000 epoch. This is the most common internal time representation used by the CSPICE system; CSPICE refers to this as ephemeris time (ET). */ str2et_c ( CALSTR, &et ); printf ( "Corresponding ET : %20.6f\n", et ); /* Make a picture of an output format. Describe a Unix-like time string then send the picture and the 'et' value through timout_c to format and convert the ET representation of the time string into the form described in timout_c. The '::UTC-7' token indicates the time zone for the 'timstr' output - PDT. 'PDT' is part of the output, but not a time system token. */ timout_c ( et, "Wkd Mon DD HR:MN:SC PDT YYYY ::UTC-7", STRLEN, timstr ); printf ( "Time in string format 1 : %s\n", timstr ); /* Create another picture, this time combine a calendar, 2 digit year , with Julian Day format. */ timout_c ( et, "Wkd Mon DD HR:MN ::UTC-7 YR (JULIAND.##### JDUTC)", STRLEN, timstr ); printf ( "Time in string format 2 : %s\n", timstr ); /* Why create a picture by hand when CSPICE can do it for you? Input a string to tpictr_c with the format of interest. 'ok' returns a boolean indicating whether an error occurred while parsing the picture string, if so, an error diagnostic message returns in 'error'. In this example, no need exists to check the error flag since the picture string is known as correct.. */ tpictr_c ( "12:34:56.789 P.M. PDT January 1, 2006", STRLEN, STRLEN, pictr, &ok, error); /* Confirm the tpictr_c call succeeded. Report the error string if not. */ if( !ok ) { printf( "\nError in TPICTR call:\n" ); printf( "%s\n", error ); exit(1); } timout_c ( et, pictr, STRLEN, timstr ); printf ("Time in string format 3 : %s\n", timstr ); /* Two digit year representations often cause problems due to the ambiguity of the century. The routine tsetyr_c gives the user the ability to set a default range for 2 digit year representation. SPICE uses 1969AD as the default start year so the numbers inclusive of 69 to 99 represent years 1969AD to 1999AD, the numbers inclusive of 00 to 68 represent years 2000AD to 2068AD. The defined time string AMBIGSTR contains a two-digit year. Since the SPICE base year is 1969, the time subsystem interprets the string as 1979. */ str2et_c ( AMBIGSTR, &et1 ); /* Set 1980 as the base year causes CSPICE to interpret the time string's "79" as 2079. */ tsetyr_c ( 1980 ); str2et_c ( AMBIGSTR, &et2 ); /* Calculate the number of years between the two ET representations, ~100. */ printf ( "Years between evaluations: %20.6f\n", (et2 - et1)/jyear_c() ); exit(0); } Run the code example
Original time string : Mar 15, 2003 12:34:56.789 AM PST Corresponding ET : 100989360.974561 Time in string format 1 : Sat Mar 15 01:34:56 PDT 2003 Time in string format 2 : Sat Mar 15 01:34 03 (2452713.85760 JDUTC) Time in string format 3 : 01:34:56.789 A.M. PDT March 15, 2003 Years between evaluations: 100.000000 Lesson 5: Error HandlingTask Statement
Learning Goals
Code Solution
#include <stdlib.h> #include <stdio.h> #include <strings.h> #include "SpiceUsr.h" /* Define the maximum length for any string, 80 characters plus one null terminator. */ #define STRLEN 81 void doerr(); int main( int argc, char **argv ) { /* Declare the needed variables: */ SpiceChar errcon[STRLEN]; SpiceBoolean doloop = SPICETRUE; /* Check into the error subsystem to create a traceback showing the call tree. A chkout_c must balance every chkin_c. */ chkin_c ( "ERRSYSC" ); /* Before we start, what's the initial (default) error state? erract_c both sets the state and reports the state. */ erract_c ( "GET", STRLEN, errcon ); printf ( "Default error state: %s\n", errcon ); /* Now start an input loop so we can try different settings for error response. */ do { /* Again use ERRACT to retrieve the current error mode. */ erract_c ( "GET", STRLEN, errcon ); printf ( "Current error state: %s\n", errcon ); /* Okay, input one of the response settings strings then set the error subsystem response to that value. */ prompt_c ( "Set error condition (DEFAULT, REPORT, " "ABORT, RETURN, IGNORE): ", STRLEN, errcon ); erract_c ( "SET", STRLEN, errcon ); /* Cause an error signal. */ doerr(); /* Check for an error signal via a call to FAILED. At this point we see an important difference between the error mode's response to an error signal. */ if ( !failed_c() ) { puts( "No error signal noted." ); } else { puts( "Error signal noted." ); } } while ( doloop ); /* Check out of the error subsystem tho' we'll never hit this call. */ chkout_c ( "ERRSYSC" ); exit(0); } /* This subroutine initiates a SPICE error signal. */ void doerr () { /* Check into the error subsystem as before. */ chkin_c ("DOERR"); /* Let's signal an error. The string passed by setmsg_c is the long error message. You may place markers in the long message string then later substitute other data items for those markers. */ setmsg_c ( "A truly horrendous event occurred " "during execution of this program. " "Data added to long error message string: " "A double #, an int #, and a string #." ); /* Now substitute other data into the long message string. Note the substitutions work on the first found marker. */ errdp_c ( "#", 186282.397 ); errint_c ( "#", 666 ); errch_c ( "#", "A STRING" ); /* SIGERR causes the error signal with the string passed from SETMSG. Set the error flag in the SPICE error subsystem and execute the proper error response. */ sigerr_c ( "OOPS(SOMETHINGBAD)" ); chkout_c ( "DOERR" ); } Run the code example
Default error state: DEFAULT Current error state: DEFAULTThe subsystem is in error state DEFAULT. Let the subsystem run to the error signal in DEFAULT mode:
Set error condition (DEFAULT, REPORT, ABORT, RETURN, IGNORE): DEFAULTWhat subsystem reaction occurs in this state?
===================================================================== =========== Toolkit version: N0066 OOPS(SOMETHINGBAD) -- A truly horrendous event occurred during execution of this program. D ata added to long error message string: A double 1.8628239700000E+05, an int 66 6, and a string A STRING. A traceback follows. The name of the highest level module is first. ERRSYSC --> DOERR Oh, by the way: The SPICELIB error handling actions are USER-TAILORA BLE. You can choose whether the Toolkit aborts or continues when errors occur, which error messages to output, and where to send the output. Please read the ERROR "Required Reading" file, or see the routines ERRACT, ERRDEV, and ERRP RT. ===================================================================== ===========Notice we see no error signal status line. The program quit when it signaled an error. The program output the error messages, an additional information blurb ("Oh by the way"), the Toolkit version, and the traceback list. o- Rerun the program in "REPORT" mode:
Default error state: DEFAULT Current error state: DEFAULT Set error condition (DEFAULT, REPORT, ABORT, RETURN, IGNORE): REPORT ===================================================================== =========== Toolkit version: N0066 OOPS(SOMETHINGBAD) -- A truly horrendous event occurred during execution of this program. D ata added to long error message string: A double 1.8628239700000E+05, an int 66 6, and a string A STRING. A traceback follows. The name of the highest level module is first. ERRSYSC --> DOERR ===================================================================== =========== Error signal noted. Current error state: REPORT Set error condition (DEFAULT, REPORT, ABORT, RETURN, IGNORE):The error output ceases after the traceback then returns into the calling routine. Note the error signal marker indicates detection of the signal. The subsystem in REPORT mode does not print the information blurb. The CSPICE system can continue to run after an error signal with the error state set to REPORT - this mode flags an error then allows the program to continue the run. It may happen that the cause of the error condition causes instability in the CSPICE system. o- Rerun to test "ABORT" mode:
Default error state: DEFAULT Current error state: DEFAULT Set error condition (DEFAULT, REPORT, ABORT, RETURN, IGNORE): ABORTHow does the subsystem respond in ABORT mode?
===================================================================== =========== Toolkit version: N0066 OOPS(SOMETHINGBAD) -- A truly horrendous event occurred during execution of this program. D ata added to long error message string: A double 1.8628239700000E+05, an int 66 6, and a string A STRING. A traceback follows. The name of the highest level module is first. ERRSYSC --> DOERR ===================================================================== ===========ABORT responds quite like DEFAULT except the error output does not include the information blurb shown in the DEFAULT output. All execution stops when the error signals. o- Run the program to demo the "RETURN" mode:
Default error state: DEFAULT Current error state: DEFAULT Set error condition (DEFAULT, REPORT, ABORT, RETURN, IGNORE): RETURNRETURN mode provides the highest measure of flexibility to deal with error signals. On output:
===================================================================== =========== Toolkit version: N0066 OOPS(SOMETHINGBAD) -- A truly horrendous event occurred during execution of this program. D ata added to long error message string: A double 1.8628239700000E+05, an int 66 6, and a string A STRING. A traceback follows. The name of the highest level module is first. ERRSYSC --> DOERR ===================================================================== =========== Error signal noted. Current error state: RETURNThe subroutine signals an error then returns similar to REPORT mode. However, this mode includes another property. If we make another pass through the command loop:
Set error condition (DEFAULT, REPORT, ABORT, RETURN, IGNORE): return Error signal noted. Current error state: returnWe see no error output. The main property of the RETURN mode is to allow program execution to continue but immediately return from all CSPICE routines that check the state of the return_c function. This mode restricts program flow after an error signal. o- And the final mode to test, "IGNORE":
Default error state: DEFAULT Current error state: DEFAULT Set error condition (DEFAULT, REPORT, ABORT, RETURN, IGNORE): IGNORE No error signal noted. Current error state: IGNORE Set error condition (DEFAULT, REPORT, ABORT, RETURN, IGNORE):No error output, no error signal. IGNORE mode prevents expression of all error subsystem functions; the subsystem does not set RETURN or FAILED. While using IGNORE mode the user cannot identify an error signal. Carefully consider program requirements before any use of IGNORE mode. Task Statement
Learning Goals
Code Solution
#include <stdlib.h> #include <stdio.h> #include <strings.h> #include "SpiceUsr.h" /* Define the maximum length for any string, 80 characters plus one null terminator. */ #define STRLEN 81 int main( int argc, char **argv ) { /* Declare the needed variables: */ SpiceChar targ [STRLEN]; /* Set a flag to start/stop and continue the inquiry loop. */ SpiceBoolean doloop = SPICETRUE; SpiceDouble state[6]; SpiceDouble ltime; /* The RETURN mode signals an error then returns to the caller. Just what we need. REPORT mode performs almost the same function as RETURN, however RETURN mode sets the return_c() value to TRUE and so the program does not execute those CSPICE routines that check the return_c() value. Consider REPORT mode useful for debugging. */ erract_c ( "SET", STRLEN, "RETURN" ); /* Load the data we need for state evaluation. */ furnsh_c ( "aderr.tm" ); /* Start our input query loop to the user. */ while ( doloop ) { /* For simplicity, we request only one input. The program calculates the state vector from Earth to the user specified target (TARG) in the J2000 frame, at ephemeris time zero, using aberration correction LT+S (light time plus stellar aberration). */ prompt_c ( "Target: ", STRLEN, targ ); if ( eqstr_c( targ, "NONE" ) ) { /* An exit condition. If the user inputs NONE for a target name, set the loop to stop... */ doloop = SPICEFALSE; } else { /* ...otherwise evaluate the state between the Earth and the target. */ spkezr_c ( targ, 0., "J2000", "LT+S", "EARTH", state, <ime ); /* What if the program can't perform the evaluation? Since we set the error subsystem to REPORT we know a failed spkezr_c call sets the failed_c flag to SPICETRUE then returns control to the calling routine. The CSPICE system also outputs an error message informing the user of the problem's cause. Examine the state of failed_c() to determine if we output a state vector or not. */ if ( ! failed_c() ) { printf ( "R : %20.6f %20.6f %20.6f\n", state[0] , state[1], state[2] ); printf ( "V : %20.6f %20.6f %20.6f\n", state[3] , state[4], state[5] ); printf ( "LT: %20.6f\n", ltime ); } else { /* Problem. Something went wrong. Reset the error subsystem for another pass. */ reset_c(); } } } exit(0); } Run the code example
Target: Moon R : -291584.616595 -266693.402359 -76095.647558 V : 0.643439 -0.666066 -0.301310 LT: 1.342311 Target: Mars R : 234536077.419136 -132584383.595569 -63102685.706191 V : 30.961373 28.932996 13.113031 LT: 923.001080 Target: Pluto barycenter R : -1451304742.838526 -4318174144.406321 -918251433.587357 V : 35.079843 3.053138 -0.036762 LT: 15501.258293 Target: Puck ===================================================================== =========== Toolkit version: N0066 SPICE(SPKINSUFFDATA) -- Insufficient ephemeris data has been loaded to compute the state of 7 15 (PUCK) relative to 0 (SOLAR SYSTEM BARYCENTER) at the ephemeris epoch 2000 J AN 01 12:00:00.000. A traceback follows. The name of the highest level module is first. spkezr_c --> SPKEZR --> SPKEZ --> SPKACS --> SPKAPS --> SPKLTC --> SP KGEO ===================================================================== =========== Target:Perplexing. What happened? The kernel files named in meta.tm did not include ephemeris data for Puck. When the SPK subsystem tried to evaluate Puck's position, the evaluation failed due to lack of data, so an error signaled. The above error signifies an absence of state information at ephemeris time 2000 JAN 01 12:00:00.000 (the requested time, ephemeris time zero). Since the program set the error mode to RETURN, program execution continues. Try another look-up, this time for "Casper"
Target: Casper ===================================================================== =========== Toolkit version: N0066 SPICE(IDCODENOTFOUND) -- The target, 'Casper', is not a recognized name for an ephemeris objec t. The cause of this problem may be that you need an updated version of the SPICE Toolkit. Alternatively you may call SPKEZ directly if you know the SP ICE ID codes for both 'Casper' and 'EARTH' A traceback follows. The name of the highest level module is first. spkezr_c --> SPKEZR ===================================================================== =========== Target:An easy to understand error. The SPICE system does not contain information on a body named 'Casper.' Another look-up, this time, "Venus".
Target: Venus R : -80970027.540532 -139655772.573898 -53860125.958201 V : 31.166910 -27.001056 -12.316514 LT: 567.655074 Target:The look-up succeeded despite two errors in our run. The CSPICE system can respond to error conditions (not system errors) in much the same fashion as languages with catch/throw instructions. Relevant Routines:
Lesson 6: Windows, and CellsProgramming task
Learning Goals
A C SPICE cell consists of a C structure. A user should create cells by use of the appropriate CSPICE calls. NAIF recommends against manual creation of cells. A 'window' is a type of cell containing ordered, double precision values describing a collection of zero or more intervals. We define an interval, 'i', as all double precision values bounded by and including an ordered pair of numbers,
[ a , b ] i iwhere
a < b i - iThe intervals within a window are both ordered and disjoint. That is, the beginning of each interval is greater than the end of the previous interval:
b < a i i+1A common use of the windows facility is to calculate the intersection set of a number of time intervals. Code Solution
#include <stdio.h> #include "SpiceUsr.h" #include <stdlib.h> #include <string.h> #define MAXSIZ 8 /* Define the maximum length for a UTC string, 25 characters plus one null terminator. */ #define UTCLEN 26 int main( int argc, char **argv ) { /* Define our variable types. Define the cells to use as windows. The windows can hold 8 data values i.e. four intervals. */ SPICEDOUBLE_CELL ( loswin, MAXSIZ ); SPICEDOUBLE_CELL ( phswin, MAXSIZ ); SPICEDOUBLE_CELL ( sched , MAXSIZ ); SpiceInt i; SpiceInt small; SpiceInt large; SpiceChar utcstr[2][UTCLEN]; /* Define sets of time intervals. For the purposes of this tutorial program, define time intervals representing an unobscured line of sight between a ground station and some body. */ SpiceChar los [MAXSIZ][UTCLEN] = { "Jan 1, 2003 22:15:02", "Jan 2, 2003 4:43:29", "Jan 4, 2003 9:55:30", "Jan 4, 2003 11:26:52", "Jan 5, 2003 11:09:17", "Jan 5, 2003 13:00:41", "Jan 6, 2003 00:08:13", "Jan 6, 2003 2:18:01" }; /* A second set of intervals representing the times for which an acceptable phase angle exits between the ground station, the body and the Sun. */ SpiceChar phase [MAXSIZ][UTCLEN] = { "Jan 2, 2003 00:03:30", "Jan 2, 2003 19:00:00", "Jan 3, 2003 8:00:00", "Jan 3, 2003 9:50:00", "Jan 5, 2003 12:00:00", "Jan 5, 2003 12:45:00", "Jan 6, 2003 00:30:00", "Jan 6, 2003 23:00:00" }; SpiceDouble left; SpiceDouble right; SpiceDouble meas; SpiceDouble avg; SpiceDouble stddev; SpiceDouble los_et [MAXSIZ]; SpiceDouble phs_et [MAXSIZ]; /* Load our meta kernel for the leapseconds data. */ furnsh_c ( "win.tm" ); /* Windows consist of double precision values, convert the time tags defined in the LOS and PHASE arrays to double precision ET. Store the double values in the loswin and phswin arrays. */ for ( i=0; i < MAXSIZ; ++i ) { str2et_c ( los[i] , &los_et[i] ); str2et_c ( phase[i], &phs_et[i] ); } /* Initialize the cells from the double precision arrays, then validate the cells as windows. Since we use 4 intervals, set the window to accept 8 (MAXSIZ) data values ( 4 * 2 = 8 ). Since we require no more than 8 data values, assign a window size of 8. */ memmove ( (SpiceDouble*)loswin.data, los_et, MAXSIZ * sizeof(SpiceDouble) ); memmove ( (SpiceDouble*)phswin.data, phs_et, MAXSIZ * sizeof(SpiceDouble) ); wnvald_c ( MAXSIZ, MAXSIZ, &loswin ); wnvald_c ( MAXSIZ, MAXSIZ, &phswin ); wnvald_c ( MAXSIZ, MAXSIZ, &sched ); /* The issue for consideration, at what times do line of sight events coincide with acceptable phase angles? Perform the set operation AND on loswin, phswin, place the results in the window 'sched'. */ wnintd_c ( &loswin, &phswin, &sched ); puts ( " " ); printf( "No. data values in sched : %2d\n", (int)card_c(&sched) ); printf( "Space available for values in sched: %2d\n", (int)size_c(&sched) ); /* Output the results. The number of intervals in 'sched' is half the number of data points (the cardinality). Use a call to card_c to retrieve the window's cardinality. */ puts ( " " ); puts ( "Time intervals meeting defined criterion."); for ( i=0; i < card_c(&sched)/2 ; ++i ) { /* Extract from the derived 'sched' the values defining the time intervals, [small, large]. */ wnfetd_c ( &sched, i, &left, &right ); /* Convert the ET values to UTC for human comprehension. */ et2utc_c ( left , "C", 3, UTCLEN, utcstr[0] ); et2utc_c ( right, "C", 3, UTCLEN, utcstr[1] ); /* Output the UTC string and the corresponding index for the interval. */ printf( "%2d %s %s\n", (int)i, utcstr[0], utcstr[1] ); } puts ( " " ); puts ( "Summary of sched window" ); wnsumd_c ( &sched, &meas, &avg, &stddev, &small, &large ); /* Summarize the 'sched' window. */ printf( "o Total measure of sched : %16.6f\n", meas ); printf( "o Average measure of sched : %16.6f\n", avg ); printf( "o Standard deviation of\n " ); printf( " the measures in sched : %16.6f\n", stddev ); /* The values for small and large refer to the indexes of the values in the window ('sched'). The shortest interval is [ SPICE_CELL_ELEM_D( &sched, small), SPICE_CELL_ELEM_D( &sched, small+1) ]; the longest is [ SPICE_CELL_ELEM_D( &sched, large), SPICE_CELL_ELEM_D( &sched, large+1) ]; Output the indexes for the shortest and longest intervals. As C bases an array index on 0, the interval index is half the array index. */ printf( "o Index of shortest interval: %2d\n", (int)small/2 ); printf( "o Index of longest interval : %2d\n", (int)large/2 ); exit (0); } Run the code example
Output the amount of data held in SCHED compared to the maximum possible amount.
No. data values in sched : 6 Space available for values in sched: 8List the time intervals for which a line of sight exists during the time of a proper phase angle.
Time intervals meeting defined criterion. 0 2003 JAN 02 00:03:30.000 2003 JAN 02 04:43:29.000 1 2003 JAN 05 12:00:00.000 2003 JAN 05 12:45:00.000 2 2003 JAN 06 00:30:00.000 2003 JAN 06 02:18:01.000Finally, an analysis of the SCHED data. The measure of an interval [a,b] (a <= b) equals b-a. Real values output in units of seconds.
Summary of sched window o Total measure of sched : 25980.000009 o Average measure of sched : 8660.000003 o Standard deviation of the measures in sched : 5958.550217 o Index of shortest interval: 1 o Index of longest interval : 0 Related Routines
Lesson 7: Utility and Constants RoutinesTask Statement
Learning Goals
Code Solution
#include <stdio.h> #include <stdlib.h> #include <string.h> #include "SpiceUsr.h" #define UTCLEN 32 void tostan ( SpiceChar * alias ); int main( int argc, char **argv ) { /* Define the few variables needed for data input and output. */ SpiceChar funits [UTCLEN]; SpiceChar tunits [UTCLEN]; SpiceChar fromstr[UTCLEN]; SpiceDouble fvalue; SpiceDouble tvalue; /* Define the tkvrsn_c return value. */ ConstSpiceChar * vers; /* Display the Toolkit version string with a tkvrsn_c call. */ vers = tkvrsn_c( "TOOLKIT" ); printf( "\nConvert demo program compiled against " "CSPICE Toolkit %s\n\n", vers ); /* The user first inputs the name of a unit of measure. Send the name through TOSTAN for de-aliasing. */ prompt_c ( "From Units : ", UTCLEN, funits ); tostan ( funits ); /* Input a double precision value to express in a new unit format. */ prompt_c ( "From Value : ", UTCLEN, fromstr ); prsdp_c ( fromstr, &fvalue ); /* Now the user inputs the name of the output units. Again we send the units name through TOSTAN for de-aliasing. */ prompt_c ( "To Units : ", UTCLEN, tunits ); tostan ( tunits ); convrt_c ( fvalue, funits, tunits, &tvalue ); printf ( "%12f.6 %s\n", tvalue, tunits ); exit(0); } void tostan ( SpiceChar * alias ) { /* As a convenience, let's alias a few common terms to their appropriate counterpart. Use eqstr_c to compare strings. The comparison ignores letter case and trailing/leading spaces. */ if ( eqstr_c ( alias, "meter" ) ) { /* First, a 'meter' by any other name is a 'METER' and smells as sweet ... */ strcpy ( alias, "METERS"); } else if ( eqstr_c ( alias, "klicks" ) || eqstr_c ( alias, "kilometers" ) || eqstr_c ( alias, "kilometer" ) ) { /* ... 'klicks' and 'KILOMETERS' and 'KILOMETER' identifies 'KM'.... */ strcpy ( alias, "KM"); } else if ( eqstr_c ( alias, "secs") ) { /* ... 'secs' to 'SECONDS'. */ strcpy ( alias, "SECONDS"); } else if ( eqstr_c ( alias, "miles") ) { /* ... and finally 'miles' to 'STATUTE_MILES'. Normal people think in statute miles. Only sailors think in nautical miles - one minute of arc at the equator. */ strcpy ( alias, "STATUTE_MILES"); } /* Much better. Now return. If the input matched none of the aliases, this routine did nothing. */ } Run the code example
Convert demo program compiled against CSPICE Toolkit CSPICE_N0066 From Units : klicks From Value : 3 To Units : miles 1.864114.6 STATUTE_MILESNow we know. Three kilometers equals 1.864 miles. Legend states Pheidippides ran from the Marathon Plain to Athens. The modern marathon race (inspired by this event) spans 26.2 miles. How far in kilometers?
Convert demo program compiled against CSPICE Toolkit CSPICE_N0066 From Units : miles From Value : 26.2 To Units : km 42.164813.6 km Task Statement
Code Solution
#include <stdlib.h> #include <stdio.h> #include <strings.h> #include "SpiceUsr.h" int main( int argc, char **argv ) { /* All the functions have the same calling sequence: VALUE = function_name(); some_procedure( function_name() ); printf ( "%19.12f\n", function_name() ); First a simple example using the seconds per day constant... */ printf("Number of (S)econds (P)er (D)ay : %19.12f\n", spd_c() ); /* ...then show the value of degrees per radian, 180/Pi... */ printf("Number of (D)egrees (P)er (R)adian : %19.16f\n", dpr_c() ); /* ...and the inverse, radians per degree, Pi/180. It is obvious dpr_c() equals 1.0/rpd_c(), or more simply dpr_c() * rpd_c() equals 1.0. */ printf("Number of (R)adians (P)er (D)egree : %19.16f\n", rpd_c() ); /* What's the value for the astrophysicist's favorite physical constant (in a vacuum)? */ printf("Speed of light in KM per second : %19.12f\n", clight_c() ); /* How long (in Julian days) from the J2000 epoch to the J2100 epoch? */ printf("Number of days between epochs J2000 \n" ); printf(" and J2100 : %19.12f\n", j2100_c() - j2000_c() ); /* Redo the calculation returning seconds... */ printf("Number of seconds between epochs\n" ); printf(" J2000 and J2100 : %19.5f\n", spd_c() * (j2100_c() - j2000_c() ) ); /* ...then tropical years. */ printf("Number of tropical years between\n" ); printf(" epochs J2000 and J2100 : %19.12f\n", ( spd_c() / tyear_c() ) * (j2100_c() - j2000_c() ) ); /* Finally, how can I convert a radian value to degrees. */ printf("Number of degrees in Pi/2 radians of arc: %19.16f\n", halfpi_c() * dpr_c() ); /* and degrees to radians. */ printf("Number of radians in 250 degrees of arc : %19.16f\n", 250. * rpd_c() ); exit(0); } Run the code example
Number of (S)econds (P)er (D)ay : 86400.000000000000 Number of (D)egrees (P)er (R)adian : 57.2957795130823229 Number of (R)adians (P)er (D)egree : 0.0174532925199433 Speed of light in KM per second :<PHONE_NUMBER>99999984 Number of days between epochs J2000 and J2100 : 36525.000000000000 Number of seconds between epochs J2000 and J2100 :<PHONE_NUMBER>.00000 Number of tropical years between epochs J2000 and J2100 :<PHONE_NUMBER>02909 Number of degrees in Pi/2 radians of arc: 90.0000000000000000 Number of radians in 250 degrees of arc : 4.3633231299858242 Related Routines
|


New store openings drive revenue increase at Card Factory
by Jessica ClarkCard Factory has reported a jump in revenue this year driven by sales at new stores and a boost in online trading, as sales at existing stores slumped due to falling high street footfall.
In the nine months to 31 October revenue increased five per cent as Card Factory grew its store portfolio with 38 new branches in the year to date.
Read more: Brexit stockpiling dents Card Factory profits
However like-for-like in-store sales dipped 0.4 per cent in the three months to the end of October due to weaker footfall, as the greetings card retailer gears up for the key Christmas trading period. In the year to date, like-for-like store sales are stable at 0.7 per cent.
In the third quarter, Card Factory increased online sales by 16.2 per cent and sales are up 21.9 per cent in the year to date.
“The tradition of sending Christmas cards by post seems to be in decline so Card Factory will have to push ancillary items more, such as wrapping paper, sticky tape and gift boxes, in order to keep driving up sales,” Russ Mould, investment director at AJ Bell said.
He added: “Fundamentally its prices are low and therefore attractive to a wide market but it has to work even harder each year to encourage people to buy its products, particularly as the market is already highly competitive.
“News that rival Clinton Cards is considering shop closures as part of a survival plan may provide a small benefit to Card Factory yet this is also an indication of how tough life is for many retailers.”
Read more: Clintons signs up advisers as greeting car stalwart eyes potential sale
Card Factory chief executive Karen Hubbard said: “I am pleased with our year-to-date performance. Our ongoing focus on customer experience and the quality and range of our card and complementary non-card products has led to an increased average spend both in stores and online.
“This has helped us to substantially offset the effect of the lower high street footfall experienced in the quarter and the corresponding impact on our like-for-like sales.”
Main image credit: Getty


NilCaream
- Block game - my take on Minecraft 2D in the browser (work in progress)
- Nil Cube Rubik's cube and Square-1 drawing algorithm with some of the algorithms I use
- 2x2 selected algorithms
- 3x3 selected algorithms
- Square-1 selected algorithms
- Set 1 selected algorithms on a single page
- Game V3 single player space shooter with gamepad support (hardcoded bindings)
- Plasma V1 plasma-style animation
- Cars simple 2-players minigame
- Engines combustion engine graphical simulation
- Multiplication table test for kids (in Polish)
- Snake Snake game
- Items simplest possible items board (kanban, eisenhower, todo, etc.)
- Chords for common progressions with Tone.js