The current industry i.e industry 4.0 is completely based on robotics, automation & IoT. Robotics is a filed where developments and inventions cannot be made on paper. You will have to go through a lot of failures, but this course will teach you never to give up on anything untill its done.
The most required skill for this generation to survive in market is the skill of continuous learning. This course will help you kick start to develop this skill of continuous learning.
After the two days workshop a TBT(Task Based Training will be conducted for all the participants.
TBT is a rigorous training program where the participants will be trained on robotics for 1 month, where they will be given task every week to solve.
They will have to solve this task on their own, but, if participants gets stuck anywhere in between ,our team is always their to help them & complete the task.
This approach will help the students to learn new concepts on their own, to solve the task given.
At the end this will help them kick start their continuous learning skill.
All participants will receive the certificate of completion at the end of this program.
You will have an edge over your fellow classmates and friends who did not attend the workshop. You will be knowing how to make you own robot and how the sensor work in real environment, you will know how to calibrate sensors according to your environment. You will learn how to code in arduino IDE ,a software ,that is widely used in the robotics and electronics industries.
The most important skill you are going to learn is how to never give up, and work until the work is done.


Liquidery
III
How many stars it deserves?
5 stars
4 stars
3 stars
2 stars
1 star
And... any comments?
Add your comments here, something that will be useful to know in the future about it
Jump to
The first screen
Step 1, take a picture, add a name
Step 2, tell the kind of liquid it is
Step 3, start as you like and comment it
A 2016 idea!


This test produces four pages of output. The blue numbers must correspond to the page number they appear on.


1 CWP No. 20767 of 2008. HIGH COURT OF PUNJAB AND HARYANA AT CHANDIGARH. ***
M/S Chaudhary Chemical Industries Versus Haryana state Pollution Control Board and ors.
CWP No. 20767 of 2008.
*** CORAM: Hon'ble Mr. Justice T.S.Thakur, CJ and Hon'ble Mr. Justice Jasbir Singh. *** Present: Shri R.B.S.Chahal, Advocate for the petitioner. Shri Arun Walia, Advocate for the respondents. *** T.S.Thakur, Chief Justice (Oral) Issue Rule.
The respondent Board has appeared and filed a counter affidavit through Shri Arun Walia, Standing counsel for the Board. With consent this petition has been heard by us for final disposal.
The petitioner calls in question the correctness of an order dated 20.11.2008/4.12.2008 issued under Section 33-A of the Water (Prevention and Control of Pollution) Act, 1974 and Air (Prevention and Control of Pollution) Act, 1981 directing closure of the unit set up by the petitioner for distillation of acids at Bahalgarh on the Karnal G.T.Road on the outskirts of Delhi in district Sonipat. The challenge arises in the following circumstances.
The petitioner is a registered partnership firm which has set up a small scale unit engaged in the sale of Chemicals since the year 1962 at Village Bahalgarh in Sonipat district of Haryana. The unit in question is according to the petitioner purchasing Hydrochloric Acid, Sulphuric Acid, Nitric Acid and Calcium Nitrate from Gujrat Alkalis and National Fertilizers Limited. The acids so purchased are brought to the unit aforementioned for purification, packaging and for utilizing a part of the same to manufacture Calcium Nitrate. The petitioner's case is that the unit is a small scale unit 2 CWP No. 20767 of 2008. and there are hardly any emissions from the same or any effluent discharge to require any Pollution Control measures or effluent treatment plant. According to the Board the unit in question was inspected by the Field Staff on 29.05.2008 who noticed that the unit was discharging untreated effluent in the open land without any ETP for treatment of the said effluent and that the unit had not provided APCM (Air Pollution Control Measure) for emissions arising from the distillation process or emanating from the coal fired bhatties being used in the unit. In the opinion of the field staff, the unit was violating Sections 25/26 of the Water(Prevention & Control of Pollution) Act, 1974 and 21/22 of the Air (Prevention and Control of Pollution) Act, 1981.
On receipt of the reports aforementioned, the Regional Office, Sonipat Region issued a show cause notice dated 3.6.2008 to the unit for its closure under Section 33-A of the Water (Prevention & Control of Pollution) Act, 1974 and 31-A of the Air (Prevention and Control of Pollution) Act, 1981. In response to the said notice, the unit submitted a written reply in which it was inter alia stated that although the unit was earlier processing some of the products in the premises but due to various economic reasons and cut throat competition in the market most of the goods are now being purchased as finished products only. The unit further stated that the discharge of effluents has considerably gone down on account of the said reasons. It also stated that although the APCM system of an approved type stands already installed in the unit, yet since the manufacturing process was at a very low scale, there was no need to keep the APCM system in operation as there were hardly any fugitive emissions. The effluent discharge, according to the unit, was in its own agricultural land and not in the surrounding area.
Upon consideration of the reply, the Regional Officer recommended to the Chairman of the Pollution Control Board that the reply 3 CWP No. 20767 of 2008. submitted by the petitioner was unsatisfactory and that the unit deserved to be given a personal hearing at the Head Office level. Consequently, a notice was issued to the Unit for a personal hearing scheduled for October 15, 2008. Shri Naresh Lal Chaudhary, partner of the Unit appeared on the said date before the competent authority and made a signed statement promising to undertake the following measures:-
"Shri Naresh Lal Chaudhary Partner on behalf of the said firm appeared before the competent authority today for the personal hearing and informed the following:-
1. That the unit will submit the scheme for modernization/upgradation/improvement of ETP/APCM within 15 days and complete the ETP/APCM within 3 months.
2. That the unit will install the Magnetic Flow Meter at the main source of total water supply and will install the Electronic Flow Meter at the final outlet of the ETP/unit.
3. That the unit will install energy meter for the proof of running of Air Pollution Control Measures and will maintain the log book for the same.
4. That the unit will have at least one day storage capacity of equalization tank.
5. That the unit will provide additional oil and grease trap and automatic chemical dosing system and will also provide one stand by motor in case of any break down within the Effluent Treatment Plant.
6. That the unit will submit the Bank guarantee of Rs. 50,000/- within 15 days for complying the above said conditions, failing which the bank guarantee so provided will be forfeited by the H.S.P.C.B.
7. That the unit will submit the affidavit duly attested by Notary within 15 days for the compliance of above said 4 CWP No. 20767 of 2008. conditions, failing which closure action will be initiated under Section 33-A of the Water Act, 1974 and 31-A of Air Act, 1981.
8. That the unit will maintain the parameters laid down by the Board under Water Act and Air Act.
I accept the above conditions and give assurance to comply the same in the stipulated period.
Signature: Naresh Lal Chaudhary Name and Designation: Partner Dt. 15.10.08."
The Regional Officer then submitted another report dated 6.11.2008, according to which the unit had neither submitted the scheme for upgradation of the APCM nor furnished a bank guarantee of Rs. 50,000/-. The Regional Officer, accordingly recommended the closure action under Section 33-A of the Water Act, 1974. On receipt of the said recommendation, the Board has passed an order and directed closure of the unit under Section 33-A of the Water (Prevention & Control of Pollution) Act, 1974. The present petition assails the validity of the said order, as already noticed above.
On behalf of the petitioner it was strenuously argued by Mr. Chahal that the field staff had at no stage visited the unit nor were any samples taken of the emissions or the treated effluent. It was urged by him that the notice issued by the Regional Office was mala fide and that the unit was being harassed because it had declined to satisfy the demands of the officers in the Regional Office. There is in our opinion no merit in that contention. The reply submitted by the petitioner-unit to the show cause notice issued by the Regional Office does not make any suggestion what so ever that the field staff of the Pollution Control Board had not visited the unit. If the show cause notice had in deed been issued without visit by the field staff that ought to have been the first objection from the petitioner in the reply to the show cause notice. There is no explanation much less a 5 CWP No. 20767 of 2008. cogent one forthcoming from the petitioner for not pointing out this aspect in the reply sent by it to the show cause notice. Not only that in the course of hearing before the Pollution Control Board also the unit at no stage had alleged that the field staff had not visited the unit or that there was no pollution being caused by the working of the unit. On the contrary the managing partner of the unit appeared before the board and specifically undertook to take all such measures as were necessary to prevent pollution. The undertaking inter alia was to the effect that the unit shall furnish a Bank guarantee for Rs. 50,000/- as is evident from a bare reading of the written statement made before the Board and extracted by us in the earlier part of this order. It is, therefore, difficult for us to appreciate the argument that the field staff had not visited the unit nor is it possible for us to accept the submission made before us that there was no necessity for the installation of any anti pollution control measures or the effluent treatment plant. Having appeared before the Board and undertaken to provide both the measures we fail to appreciate how the petitioner can still argue that the unit did not call for either of the two requirements.
Mr. Chahal next contended that the undertaking referred to by the Pollution Control Board and extracted by us in the earlier part, was taken from the petitioner without giving sufficient opportunity to it to think and deliberate over the matter. There is no merit in that contention either. The writ petition is totally silent about the alleged coercion or lack of reasonable opportunity to the unit to properly respond to the show cause notice. The argument that since the manufacturing process has reduced substantially on account of the cut throat competition in the market, it is neither necessary to have the APCMs functional nor provide for any effluent treatment plant needs notice only to be rejected. So long as the unit is working at what ever levels of production and so long as there is no exemption granted by any provisions of the law to a unit we find it difficult 6 CWP No. 20767 of 2008. to say how the requirements of law can be circumvented by simply stating that the output has gone down. At any rate the question which is under consideration in the present proceedings is limited to finding out whether the order impugned in the present writ petition suffers from any error of jurisdiction or material irregularity. Learned counsel vehemently argued that the Environmental Engineer had in terms of a communication addressed by him to the Financial Manager District Industries, Kundli stated that the working of the unit did not result in any pollution. He urged that on the face of the said certificate it was not possible for the Board to issue a show cause notice or an order shutting down the unit. There is in our opinion no merit even in that contention. A careful reading of Annexure P-4 to the writ petition reliance whereupon was placed by Mr. Chahal, does not in our opinion show any certificate having been given by the Environmental Engineer as is sought to be assumed by Mr. Chahal. All that the letter refers to is "that the petitioner unit is engaged in the process of purification of commercial Acids." It also refers to the process of the distillation being in glass flasks through glass tubes and condensation by cooling process through water. The context in which the letter was addressed by the Environmental Engineer to the Financial Manager is also not very clear from the communication in question although it appears that there was some case pending in the Supreme Court arising from some decision rendered by the High Court of Gujarat. Be that as it may, whether the unit is causing any pollution and if so what measures need to be taken or what kind of ETP would be effective is a matter that has to be determined. The question whether the petitioner unit was causing any pollution has not been examined by any court or authority leave alone the Supreme Court in any earlier round of litigation.
It was lastly contended by Mr. Chahal that the issue regarding exemption of the unit which has already been sealed by the Pollution 7 CWP No. 20767 of 2008. Control Board, could be directed to be re-examined by an independent authority like a Sub-Committee to be appointed by the Central Pollution Control Board to identify whether or not the unit is causing any pollution and if so what measures would be essential to satisfy the requirements of law. Mr. Walia, we must say in fairness was not averse to any such sub- committee being appointed for getting the unit tested or the efficacy of the APCM and the ETP determined. The Central Pollution Control Board, it was submitted, be asked to appoint a sub committee to look into the working of the unit and to recommend suitable measures to control the pollution. We, therefore, see no reason to decline the limited prayer made by the petitioner. The fact that the unit had been sealed does not mean that it cannot re-start its activities provided it satisfies the authority concerned regarding the installation and the efficacy of APCM and ETP.
We accordingly direct that the Central Pollution Control Board shall constitute a Sub-Committee of experts familiar with the subject of pollution resulting from the purification of acids etc. to inspect the unit and to suggest ways and means by which the emissions and the discharge can be kept within permissible limit. It goes without saying that the committee so constituted shall be free to examine the measures if any already in existence or require any further augmentation of such measures. The committee can see the actual working of the unit before it can make any recommendations on the subject. We direct that at the request of the committee, the Haryana Pollution Control Board shall have the seals of the unit removed to enable the committee to inspect the same and to put the unit on trial run in order to enable the committee members to take samples or to check the working of the systems if any. We, however, make it clear that after the trial run is complete, the Board shall be free to reseal the unit which shall continue till such time the Central Pollution Control Board is satisfied with the installation of APCM and the ETP, if any suggested by the 8 CWP No. 20767 of 2008. Sub-Committee and till final orders on the same are passed by the said Board. We further make it clear that the time frame within which the unit will be put on trial run for the purposes of inspection by the Sub Committee shall be left to be determined by the Sub-Committee.
The Sub-Committee shall be constituted by the Central Pollution Control Board, within one month from today. The Committee shall undertake the process and complete the same within four weeks thereafter. Final orders on the subject shall be passed by the Central Pollution Control Board expeditiously but not later than four weeks from the date the Sub- Committee submits the report.
The writ petition is with the above directions disposed of. No order as to costs.
A copy of this order shall be given dasti to the counsel under the signatures of Court Master of the Court.
(T.S.Thakur) Chief Justice (Jasbir Singh) Judge December 15, 2008 Malik


Stephen Colbert in NZ: Jacinda Ardern, Lorde and BBQs
by RNZStephen Colbert in New Zealand: Jacinda Ardern, Lorde and BBQs
Stephen Colbert's series on his taxpayer-funded visit to New Zealand has launched on The Late Show.
Mr Colbert visited New Zealand in October, with Tourism New Zealand footing more than $100,000 of the comedian's bill.
The first episode of what he said would be a week of coverage of the trip began with Mr Colbert being picked up from Auckland Airport by Prime Minister Jacinda Ardern.
They engage in some back-and-forth, do some karaoke to Queen's Bohemian Rhapsody, Mr Colbert accidentally disables Ms Ardern's phone, and they're spotted by another motorist on the way from the airport to her home.
There, they're straight into an interview.
First question: "Can I be a citizen?".
Other topics include Ms Ardern's attempt to be cast in the Lord of the Rings trilogy, New Zealand politeness and lack of snakes, Ms Ardern's engagement to Clarke Gayford, New Zealand elections, the Christchurch mosque attacks and gun law reform.
The majority of the interview is light, and has moments like Mr Colbert offering to be Ms Ardern and Mr Gayford's marriage celebrant, daring Ms Ardern to call a snap election during the interview, and asking whether lack of snakes or women getting the vote was more important for New Zealand.
Afterwards, they had what Mr Colbert called a "New Zealand state dinner of sausages and white bread" - a barbecue.
Musician Lorde joins the party and gets pranked by Mr Colbert - who's still celebrating our lack of snakes.
The visit New Zealand will be highlighted throughout the week on The Late Show with Stephen Colbert.
Tourism New Zealand said this month US broadcaster CBS had funded most of the trip, but accommodation, some tourism experiences and meals for the 16 crew were covered by Tourism New Zealand.
The trip cost Tourism NZ $104,500 - including $58,200 on accommodation, $19,100 on attraction and activities, $14,500 on production expenses, $7900 on domestic travel and $4400 on meals.
The Late Show with Stephen Colbert is the US number one show on late night, boasting an average audience of 3.5 million people.
Tourism New Zealand said it expected the visit to generate an estimated $5 million worth of advertising revenue.


Make your installed Electron app look
sexy
with
Glasscord
Install it!
Uninstall
Got tired?
Uninstall it
.
The Team behind Glasscord
AryToNeX
A desperate girl - "end my life pls"
Bowser65
A weeb - "btw have i told you i use arch?"

This project is open-source, you can contribute on its
GitHub
page


Methods (0)
Types (0)
Constructors (0)
Telethon API
This documentation was generated straight from the scheme.tl
provided by Telegram. However, there is no official documentation per se
on what the methods, constructors and types mean. Nevertheless, this
page aims to provide easy access to all the available methods, their
definition and parameters.
Although this documentation was generated for Telethon, it may be useful for any other Telegram library out there.
Index
Methods
Currently there are {method_count} methods available for the layer
{layer}. The complete list can be seen here.
Methods, also known as requests, are used to interact with
the Telegram API itself and are invoked with a call to .invoke()
.
Only these can be passed to .invoke()
! You cannot
.invoke()
types or constructors, only requests. After this,
Telegram will return a result
, which may be, for instance,
a bunch of messages, some dialogs, users, etc.
Types
Currently there are {type_count} types. You can see the full list here.
The Telegram types are the abstract results that you receive
after invoking a request. They are "abstract" because they can have
multiple constructors. For instance, the abstract type User
can be either UserEmpty
or User
. You should,
most of the time, make sure you received the desired type by using
the isinstance(result, Constructor)
Python function.
When a request needs a Telegram type as argument, you should create
an instance of it by using one of its, possibly multiple, constructors.
Constructors
Currently there are {constructor_count} constructors. You can see the full list here.
Constructors are the way you can create instances of the abstract types described above, and also the instances which are actually returned from the functions although they all share a common abstract type.
Core types
Core types are types from which the rest of Telegram types build upon:
- int:
The value should be an integer type, like 42.
It should have 32 bits or less. You can check the bit length by
calling
a.bit_length()
, wherea
is an integer variable. - long: Different name for an integer type. The numbers given should have 64 bits or less.
- int128: Another integer type, should have 128 bits or less.
- int256: The largest integer type, allowing 256 bits or less.
- double: The value should be a floating point value, such as 123.456.
- Vector<T>:
If a type
T
is wrapped aroundVector<T>
, then it means that the argument should be a list of it. For instance, a valid value forVector<int>
would be[1, 2, 3]
. - string: A valid UTF-8 string should be supplied. This is right how Python strings work, no further encoding is required.
- Bool:
Either
True
orFalse
. - true:
These arguments aren't actually sent but rather encoded as flags.
Any truthy value (
True
,7
) will enable this flag, although it's recommended to useTrue
orNone
to symbolize that it's not present. - bytes:
A sequence of bytes, like
b'hello'
, should be supplied. - date:
Although this type is internally used as an
int
, you can pass adatetime
object instead to work with date parameters.
Full example
The following example demonstrates:
- How to create a
TelegramClient
. - Connecting to the Telegram servers and authorizing an user.
- Retrieving a list of chats (dialogs).
- Invoking a request without the built-in methods.
#!/usr/bin/python3 from telethon import TelegramClient from telethon.tl.functions.messages import GetHistoryRequest # (1) Use your own values here api_id = 12345 api_hash = '0123456789abcdef0123456789abcdef' phone = '+34600000000' # (2) Create the client and connect client = TelegramClient('username', api_id, api_hash) client.connect() # Ensure you're authorized if not client.is_user_authorized(): client.send_code_request(phone) client.sign_in(phone, input('Enter the code: ')) # (3) Using built-in methods dialogs, entities = client.get_dialogs(10) entity = entities[0] # (4) !! Invoking a request manually !! result = client(GetHistoryRequest( entity, limit=20, offset_date=None, offset_id=0, max_id=0, min_id=0, add_offset=0 )) # Now you have access to the first 20 messages messages = result.messages
As it can be seen, manually calling requests with
client(request)
(or using the old way, by calling
client.invoke(request)
) is way more verbose than using the
built-in methods (such as client.get_dialogs()
).
However, and given that there are so many methods available, it's impossible to provide a nice interface to things that may change over time. To get full access, however, you're still able to invoke these methods manually.


class BlastParser |
Description
Class mainly responsible for parsing blast input into BlastRecord
instances.
Author: Leo Przybylski<EMAIL_ADDRESS>Default Constructor
Constructs the BlastParser
from its attributes.
A RecordHandler
is required.
If the CommentHandler
is not provided,
a default is used.
Parameters
Method parse
Opens the file directed by the provided filename and parses it into BlastRecord
instances.
It then passes the BlastRecord
instances to the RecordHandler
Parameters
Method parseRecord
Takes a line from the blast output file and parses it into an array of fields
Parameters
Method isRecord
Determines if the given line is indeed a record. If it's not a record, it's probably a comment
Parameters
Method isComment
Determines if the given line is indeed a comment. If it's not a comment, it's probably a record
Parameters
Getter/Setter commentHandler
Getter/Setter for the commentHandler
Parameters
Returns
Gets the commentHandler
.
Only returns something if there is no parameter present.
Getter/Setter recordHandler
Getter/Setter for the recordHandler
Parameters
Returns
Gets the recordHandler
.
Only returns something if there is no parameter present.


|
SuperLU
5.3.0
|
Matrix type definitions. More...
Go to the source code of this file.
Data Structures | |
| struct | SuperMatrix |
| struct | NCformat |
| struct | NRformat |
| struct | SCformat |
| struct | SCPformat |
| struct | NCPformat |
| struct | DNformat |
| struct | NRformat_loc |
| struct | NRformat_loc3d |
Typedefs | |
| typedef struct NRformat_loc3d | NRformat_loc3d |
Enumerations | |
| enum | Stype_t { SLU_NC, SLU_NCP, SLU_NR, SLU_SC, SLU_SCP, SLU_SR, SLU_DN, SLU_NR_loc } |
| enum | Dtype_t { SLU_S, SLU_D, SLU_C, SLU_Z } |
| enum | Mtype_t { SLU_GE, SLU_TRLU, SLU_TRUU, SLU_TRL, SLU_TRU, SLU_SYL, SLU_SYU, SLU_HEL, SLU_HEU } |
Copyright (c) 2003, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from U.S. Dept. of Energy)
All rights reserved.
The source code is distributed under BSD license, see the file License.txt at the top-level directory.
| typedef struct NRformat_loc3d NRformat_loc3d |
| enum Dtype_t |
| enum Mtype_t |
| enum Stype_t |


--- $title: MRI Cloud $path: /{base}/ $view: /views/base.html $order: 2 public_facing: - name: Pipeline and Meganalysis Paper (pre-print) link: https://www.biorxiv.org/content/early/2018/04/24/188706 - name: Docker Container link: https://hub.docker.com/r/neurodata/m2g github_links: - name: NeuroData's MRI to Graphs pipeline (m2g) link: https://neurodata.io/m2g - name: NeuroParc link: https://github.com/neurodata/neuroparc - name: Science in the Cloud (sic) link: https://github.com/neurodata/sic web_services: - name: sic link: http://scienceinthe.cloud/ - name: Community Connectomics via Cloud Computing (c4) link: http://awesome.cs.jhu.edu/graph-services/c4/ references: - Kiar2018 - Kiar2017 - Kiar2018b - kiar2017example previous_pipeline_papers: - Gray2012 - GrayRoncal2013 related_papers: - Mhembere2013 ---
This page hosts connectomes produced with NeuroData's MRI Graphs pipeline (m2g). A 'projectome' is a large-scale mapping between regions of the brain, created from fMRI or DTI. Data are from a multitude of labs and experiments. The data are run through m2g, and after processing, we provide summary statistics, QA, and the projectomes themselves.
Links to the most recent collections of connectomes for each of the datasets below can be downloaded (as .zip folders) using the Download Connectomes
button.
This will download a zipped folder containing all connectomes from the given dataset. There is also a link to explore all files related to the processing of each dataset using m2g.
With this you can explore the directory structure and download individual files. The datasets are stored on the open-neurodata aws bucket, which supports more detailed downloading using
aws-cli.
The particular command for downloading all of the files generated by m2g using aws-cli can be copied to your
Clipboard by clicking on the "Copy AWS Command to Clipboard" button.
| Dataset | Covariates | Processed dMRI | Code |
|---|---|---|---|
| {{data.name}} | [@csv] |
{% if data.connectomes %}
Download Connectomes
{% endif %}
{% if data.tree %}
File Tree
{% endif %}
{% if data.aws %}
Copy AWS Command to Clipboard
{% endif %}
|
v{{data.ver}} |
| Dataset | Covariates | Processed fMRI | Code |
|---|---|---|---|
| {{data.name}} | [@csv] |
{% if data.connectomes %}
Download Connectomes
{% endif %}
{% if data.tree %}
File Tree
{% endif %}
{% if data.aws %}
Copy AWS Command to Clipboard
{% endif %}
|
v{{data.ver}} |
Data on this site are licensed under a ODC-By v1.0 license.


Before Change
target_update_frequency=20,
states=environment.states,
actions=environment.actions,
network=layered_network_builder(network_config)
)
agent = DQNAgent(config=agent_config)
runner = Runner(agent=agent, environment=environment)
def episode_finished(runner):
if runner.episode % 100 == 0:
After Change
from tensorforce.agents import DQNAgent
from tensorforce.execution import Runner
environment = MinimalTest(specification=[("int", ())])
network_config = [
dict(type="dense", size=32)
]


Configuring Network Integration FeaturesThis chapter describes how to configure advanced features such as asymmetric routing, connection forwarding, encryption, flow export, QoS, joining a Windows domain, simplified routing, and WCCP.Configuring Asymmetric Routing Features Configuring Connection Forwarding Features Configuring IPSec Encryption Configuring Subnet Side Rules Configuring Flow Statistics Applying QoS Policies Configuring Outbound QoS (Basic) Configuring Outbound QoS (Advanced) Configuring Inbound QoS Selecting WAN Paths Dynamically Joining a Windows Domain or Workgroup Configuring Simplified Routing Features Configuring WCCP Configuring Hardware-Assist Rules For details about basic and advanced deployment types, see the Steelhead Appliance Deployment Guide.


The tech world is varied and includes many jobs. One of the major problems facing the tech world as a whole is a shortage of programmers. It's an issue of supply and demand. The situation certainly bounces back and forth from year to year, but the overall trend in the USA is one where the supply of people getting involved in the tech world is less than the number of people the workforce could accommodate. There are numerous factors affecting this, including a lack of engagement in computer science in American schools and restrictions on visas to skilled foreigners. There are certainly many who argue this trend cannot last. Keeping IT departments properly staffed is an issue for many businesses.


Beer Lager
Add a beer
Add a Beer
View Wish List
Name of Beer*:
Add Beer to wish list:
No
Yes
Rate Beer:
Choose Rating
1
2
3
4
5
Comments:
The Wish List


:of the color gray
:tending toward gray blue-gray eyes
:dull in color
:having the hair gray :hoary
:clothed in gray
:lacking cheer or brightness in mood, outlook, style, or flavor
:dismal gloomy a gray day
:prosaically ordinary :dull uninteresting
:having an intermediate and often vaguely defined position, condition, or character an ethically gray area


Aides in the multi objective decision analysis process by simplifying the creation of value hierarchy tree plots, calculating and plotting single and multi attribute value function scores, and conducting sensitivity analysis. Linear, exponential, and categorical single attribute value functions are supported. For details see Parnell (2013, ISBN:978-1-118-17313-8) Kirkwood (1997, ISBN:0-534-51692-0).
| Version: | 0.1.0 |
| Depends: | R (≥ 2.10) |
| Imports: | stats, ggplot2, tidyr, dplyr, graphics, data.tree, gridExtra, viridisLite, Cairo |
| Suggests: | knitr, rmarkdown, testthat |
| Published: | 2018-07-30 |
| Author: | Josh Deehr [aut, cre], Christopher Smith [aut], Jason Freels [aut], Emily Meyer [aut] |
| Maintainer: | Josh Deehr <josh.deehr at gmail.com> |
| BugReports: | https://github.com/AFIT-R/DecisionAnalysis |
| License: | GPL-2 | GPL-3 [expanded from: GPL (≥ 2)] |
| NeedsCompilation: | no |
| CRAN checks: | DecisionAnalysis results |
| Reference manual: | DecisionAnalysis.pdf |
| Vignettes: |
Multi Objective Decision Analysis in __R__ |
| Package source: | DecisionAnalysis_0.1.0.tar.gz |
| Windows binaries: | r-devel: DecisionAnalysis_0.1.0.zip, r-release: DecisionAnalysis_0.1.0.zip, r-oldrel: DecisionAnalysis_0.1.0.zip |
| OS X binaries: | r-release: DecisionAnalysis_0.1.0.tgz, r-oldrel: DecisionAnalysis_0.1.0.tgz |
Please use the canonical form https://CRAN.R-project.org/package=DecisionAnalysis to link to this page.


黒の手番です。53 はどう動かしますか？


@* * Copyright 2017 HM Revenue & Customs * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *@ @import uk.gov.hmrc.play.views.html.helpers.{form} @import config.FrontendAppConfig @(emailVerificationModel: EmailVerificationModel, redirectOption: Int)(implicit request: Request[_], messages: Messages) @main_template(Messages("page.verification.EmailVerification.title")) {
@Messages("page.verification.EmailVerification.info.one") @emailVerificationModel.email@Messages("page.verification.EmailVerification.info.two")
@Messages("page.verification.EmailVerification.help.text.one") @Messages("page.verification.EmailVerification.help.text.two") @Messages("page.verification.EmailVerification.help.text.three") @Messages("page.verification.EmailVerification.help.text.four")


On 30 May 2020, 2 new articles were published in 2 journals.
Review of Kathryn Henne and Rita Shah, Routledge Handbook of Public Criminologies
Bad Blood: Secrets and Lies in A Silicon Valley Startup By John Carreyrou: Book Review


Top Secret
November 12, 1977
Attention Researchers
It has recently been confirmed that the Russian submarine known as 'The Vladimir' is in fact carrying nuclear weapons. Our Cyber Security Unit has been able to intercept a encrypted message sent to submarine commander Colonel Ourumov. It is of high importance that we decipher this message a soon as possible as we believe it to be a pin code to engage the submarines plutonium cores. It is confirmed that the RSA system has been used to perform the encryption. You will need to derive Colonel Ourumov's private key in order to decrypt the ciphertext. Good luck, the future of this nation depends on you! [military drum line]
all values below are in decimal format
Colonel Ourumov's Pulic key: n = 129653, e = 5
Cipher text sent to Colonel Ourumov: 41247


As you begin to look into colleges or if you are already in college, it's important to be aware of the problems that occur in college to see if it's safe or not.
Since many colleges are very diverse, there has been an increase in gender & sexual discrimination in which students question others sexual identitites and some aren't accepted beacuse of thier gender.
On some college campuses, there may be sexual assaults and it's a major problem that students should be aware of when they are in college and it's impoprtant that they know what should be done in that situation.
On many campuses there are high leves of violence. There are murder cases, shootouts, and other types of violence. It's important that all students are aware of this issue and know that this can occur in a college.
In some colleges high levels of drug use and heavy drinking can be seen. This is a problem that should be recongnized by all college studets and those getting ready for college.
Hazing involves harassment, abuse or humiliation used as a way of initiating a person into a group and in college, many students are involved in groups or clubs like sports teams, sororities, and other organizations. So this is another major problem students should be aware of.


Family Thermostat
Current temperature:
20
+
-
Reset
Energy Efficiency:
Medium
Power saving mode:
ON
OFF
Check international weather:


{common-edit-cluster.png width=373}
This shows the {Common_edit_number edit parameter} and {Common_edit_mode edit mode} {_parameter parameters}. The former is the parameter to which the Digital Chroma's {_parameter_control} is connected. The latter is whether it affects the A {_channel} of a channelized parameter, the B channel, or both in parallel.
The parameter button shows the parameter number the way it is shown in the Digital Chroma's display, as P and a number for a regular parameter, or X and a number for an {_extended_parameter}. This is most easily changed from the Digital Chroma's control panel by going into {_parameter_select_mode PARAM SELECT} mode and then pressing a numbered switch. It can also be set in the Toolkit by first manipulating the parameter on the main screen or in one of the {_popup cluster popups}, then displaying this cluster and tapping the parameter button. It can also be reset to its default, which is "P1: patch" by {_long-press long-pressing} it. And of course, you can change the mode with the three smaller buttons.


Report: Roberto Martinez wanted Tottenham job
Roberto Martinez fancied a return to the Premier League.
by Jay WilliamsBelgium manager Roberto Martinez was keen to take the Tottenham Hotspur job, according to The Daily Star.
Martinez was ready to give up with the Belgian national team project to move back to England. Having previously managed in the Premier League with Wigan Athletic and Everton, Martinez wanted the Tottenham job.
Spurs decided to part ways with Mauricio Pochettino during the week in a move which shocked a number of the fans. It didn’t take long before Jose Mourinho was named as his successor.
In between Tottenham sacking Pochettino and hiring Mourinho, Martinez was interested. After more than three years with Belgium, he eyed a return to the English top-flight.
Martinez has managed Swansea City, Wigan and Everton in the English league system. He won the League One title with Swansea and the FA Cup with Wigan – in the same year they were relegated. But his stint with Everton was less successful.
TBR’s view
Tottenham probably have the right candidate in Mourinho. Martinez might have been an interesting experiment but his track record is not as impressive as Mourinho’s.
Martinez might have won the FA Cup with minnows Wigan but he was also relegated. He was poor at Everton. And he could have done a better job with a talented Belgium team.
Have something to tell us about this article?
Let us know


// Select a snippet of code, then click the "Eval" button.
// This will run the connected devices/browsers.
// Compute a value, the return value is shown in the
// result panel.
1 + 2
// Send log message from connected devices/browsers.
// Use this in your code for debugging.
hyper.log('Hello World')
// Replace the browser content with the given HTML.
document.body.innerHTML = '
Hello World
'
// Now try this.
counter = 1
display = function() {
document.body.innerHTML =
'Counter: ' + counter + '
'
++counter
}
timer = setInterval(function() { display() }, 500)
// Then stop the timer.
clearInterval(timer)
// Start the timer again, by evaluating the code above.
// Then change the value of counter, while the timer
// is running. Also change the function display while
// the timer is running.
// Have fun!
// This is the message area where log messages and errors
// are displayed.
//
// Select one or more lines of code in the code area above.
// Then press "Eval Selection" to evaluate (run the code)
// on connected devices.
//
// "Node Eval" is special, it evaluates selected code in
// node-webkit, the platform on which this software is running.
// With this button, you can interactively develop and test
// node.js servers and functions in node-webkit. This is a
// very powerful feature.


Request Service
Services from Home Maintenance Hub are trusted, reliable, affordable and professional. Please fill out the form completely, and we will connect you with the best service provider near you.
Services from Home Maintenance Hub are trusted, reliable, affordable and professional. Please fill out the form completely, and we will connect you with the best service provider near you.


numtools
Toolkit for performing various basic number operations.
Usage
Require numtools
as you would with any other package:
const numtools = require('numtools');
Available Methods
Testing
Make sure you have the dev-dependencies installed. If you have mocha
installed globally, run:
mocha
Dependencies
Project
- None.
Development
| Package | GitHub | npm | Docs |
|---|---|---|---|
| Chai | chaijs/chai | chai | chaijs.com |
| Mocha | mochajs/mocha | mocha | mochajs.org |
| Rewire | jhnns/rewire | rewire | |
| Sinon | sinonjs/sinon | sinon | sinonjs.org |


SOEs must ‘cut costs, ramp up productivity to save credit rating’
‘SOEs, just like small businesses, must embrace change and technology to increase productivity and efficiency,’ said Osidon chief executive Hennie Ferreira.
by Eric NakiSA state-owned enterprises. Pictures: Neil McCartney, Nigel Sibanda, AFP & Gallo Images
Cutting costs and ramping up the productivity levels of the state-owned enterprises (SOEs) is the only way SA can counter its negative credit rating, a top business leader has advised.
IT accounting group Osidon chief executive Hennie Ferreira said the biggest obstacle to turning around the country’s negative credit rating was its debt, which was mostly caused by struggling SOEs.
He cited the example of Eskom which this week hired new CEO Andre de Ruyter from the private sector, which Ferreira said looked promising.
“Unfortunately, job and salary cuts will probably be part of the plan to turn [it] around. The biggest factor will be labour unions – as we can see with the current situation at SAA,” Ferreira said.
Moody’s has changed its outlook to negative and yesterday S&P was expected to release its ratings.
Ferreira believed: “The only way to turn the negative credit rating around is to turn around SOEs by drastically cutting costs and [ramping up] productivity levels,” he said.
Foreign investors use the reports of the rating agencies to make investment decisions. But with negative outlook, many economists believe that’s an omen for a junk status declaration.
“We need to position SA as a favourable investment destination by cutting red tape and deregulating the business environment.
“Investors are looking towards Africa and we have the potential to become an ‘investment paradise’. No other country in Africa can offer what we do as an investment destination,” Ferreira said.
He said SOEs, just like small businesses, must embrace change and technology to increase productivity and efficiency.
“We no longer have an option … technology has become an integral part of all industries in SA.”
Technology should not be equated to job losses – because of technology, new industries are created and new skill sets required.
He emphasised that training was fundamental to success. The private sector was just as responsible for training their employees as government is.
Osidon introduced the world’s first online digital accountant, aimed at helping small, medium and micro enterprises and entrepreneurs, and paving the way for job creation and increased compliance with the SA Revenue Service system.
– ericn@citizen.co.za


| 202 | (A) | that tyme Petir was pope and prechide in Rome |
| (C) | ---- no text ---- | |
| 198 | (D) | ¶ That tyme Petir was pope and prechid in Rome |
| 196 | (E) | ¶ That tyme petur was pope . & preched in rome |
| (Ex) | ---- no text ---- | |
| 201 | (L) | þat tyme peter was pope & preched in rome |
| 195 | (P) | þat tyme Peter was pape & preched in Rome |
| 196 | (U) | ¶ That tyme Petre was pope / and preched in Rome |
| (V) | ---- no text ---- |


| DOSE: |
8 hits |
oral |
LSD |
(blotter / tab) |
All the names in this story have been changed.
This is something that I have been meaning to write for some time. Back when I used to take LSD, I felt as if I was invincible to this 'bad trip' that people so often spoke of. What is this...bad trip? I knew it not. I was always in complete control of myself. I scoffed at those who encountered mental difficulties with drugs. I was young, naive, and very foolish.
I would dose ridiculous amounts of LSD, eat a few milligrammes of Xanax, and watch the show for hours on end. One particular night, I didn't get the Xanax, but I'm not sure it would have helped anyway. My friend Ralph had ten hits of the best LSD I have ever seen. He took two, and I took eight. My estimate is 800 microgrammes, based on the idea that each hit had at least 100 microgrammes. (but I really have no idea) You will see why shortly.
Within fifteen minutes, visuals had started and we were both laughing uncontrollably. After forty-five minutes, neither one of us could see straight in front of us. We could not read or even tell where we were. We were in his apartment at school, but the atmosphere was getting worse by the second. I had just eaten a burrito, and I went to the bathroom and vomited it up. When I looked in the toilet, it appeared to be full of blood. I looked at my arms, and it looked as if all my veins had burst and blood was all around me. I grabbed paper towels and cleaned myself up and headed back to the main room.
 I thought that he was against me. I figured that he must have been an agent of the DEA or something, so I started asking him his name over and over again. He got extremely frustrated with me and then he soon forgot his name. I thought that this was proof that he was operating undercover with a fake name. I began to ask him if he was a guy, and he replied, 'I hope you don't normally ask people these questions.' I believed that this answer was even more proof of his need to avoid questions to cover his true identity.  I disrobed then almost completely and threw my socks at him. I curled up on the floor and began to say my name over and over again.
'Letters make up my name. If my name is Raoul, then I am Raoul. That means that I am an R, an A, an O, a U, and an L. But I am clearly not those letters, so I must not be Raoul.'
Panic.
'I am not Raoul?'
'Then I am anything I want to be.'
'I am Justin Otis. I am Jason Forsberg. I am David Winburn. I am Shane Roth. I am Ryan Gray. I am Loren Cleary.'
I picked up the phone and dialed a friend and yelled at him for a while, then put my clothes back on.
I decided that I had to have a cigarette, so I left the apartment, leaving my friend behind. I walked a short distance and saw a picnic table full of people eating hamburgers and ran up to it and jumped on top of the table and screamed, 'I am a lunatic! Do you see people act like this? Ever?  Because I'm crazy. I'm the freak that your parents warned you about. I am the statistic in your psychology book! Have you ever read 'Fear and Loathing in Las Vegas'? I am Las Vegas!'
Well, it wasn't long before somebody called the cops and an undercover cop showed up and she pretended to want to help me. She found my pager in a pile of clothes of mine and asked what numbers were on there. I didn't know, so I told her to call them. I was on a college campus, where they had speaker call boxes at the bottom of the apartments. She called a few numbers, but got no answer. Then, the unthinkable happened. She saw the phone number of Maria, a girl who worked with me whom I had dated a few times previously. The cop called her and Maria answered. I heard her voice on the speaker phone and immediately became very embarrassed. The cop said, 'Hello. Do you know anybody named Raoul who would have your number on his pager?'
She replied that she did and that I worked with her. I walked up to the phone and yelled, 'Maria!'
'Yes?'
I softened my voice. 'Do you have a cigarette?'
'No,' she said quietly.
'Fuck!' I screamed and ran away from the phone.
The cop ended the phone conversation.   I understood the cosmic nature of all actions and perceived that I had become one with Fate - a sense of eternal predestination. It was as if I understood that what was happening was preordained and that it was my destiny that night to die - even if I had to do it myself. The cop told me that I would not kill myself and that everything would be fine.
Then the boys in blue showed up. Six squad cars in all, and the drug task force. I thought that media cameras were there and I remember thinking that helicopters were flying around. I walked up to the police officers and threw myself at the ground and asked them to take me away. For it was tonight that I was to be executed for horrendous behaviour. They told me to get up and sit down. I did.
The first cop broke the ice.
 I'm going to die.'
'No, you're not,' another office said.
Then the fun started when one officer piped up and asked, 'Do you have any more on you?'
'What? You want to know if I have more?  So you can get that big promotion? You profit-motivated swine! There is more here at stake than a bust! You want money? You can have mine! I have $187 here for you - take it!'
Silence from the police officers. Then, 'Well, who did you get it from?'
'What? Here we are again - back to busting people and making money off of my lunacy! You pigs make me sick!'
Then an officer said, 'Well, you might think differently when you sober up...'
Sober up? Sobriety? What's that? I had no concept of rationality or straight thinking. As far as I was concerned I was doomed for life in this semi-functional, yet fully-enlightened state.
Finally, one cop said to another, 'Call this guy a cab...'
They called a cab, gave me back my belongings and after spouting off nonsense for about thirty minutes, I got into the long awaited taxi and went home, and lay in bed all night thinking about what a fool I had been the previous night.
That night and my repulsive behaviour still haunts me to this day. I really don't do very many drugs anyway, but LSD is one that I will not ever touch ever again. Please be careful with LSD. I think it is highly unstable and can make you do or think things that you might have never before conceived of. I still shudder when I think of the things I said and did, and the damage that I did to friendships and relationships. Some have not healed yet - and that is a price I have to pay.
Experience Reports are the writings and opinions of the individual authors who submit them.
Some of the activities described are dangerous and/or illegal and none are recommended by Erowid.


| Scarab: Open Source Communications Framework |
| Scarab is an open source communcations library implementing protocols, formats, and interfaces for writing distributed applications, with an emphasis on low-end and lightweight implementations. Users can combine Scarab module implementations to build a messaging system to fit their needs, scaling from very simple messaging or data transfer all the way up to where CORBA can take over. Scarab implementations include support for such areas as distributed objects, remote procedure calls, XML messages, TCP transport, and HTTP transport. There are implementations of Scarab in Java, Python, Perl, and C. Scarab was initially developed to provide the Casbah Project with an easy to implement solution for distributing Casbah services among several scripting and compiled languages without requiring predefined object interfaces. The current version of the reference implementations of and document sets for Scarab is<EMAIL_ADDRESS>Source is available as gzipped tar file: Scarab-<EMAIL_ADDRESS>Future work:
Where can you help? Anywhere you want or can! Adopt the Perl or Python reference implementations or the web site. Write new implementations for different languages. Create applications that use Scarab. Create simpler examples. Write tutorials. Evangelize. Add support for new transports (HTTP, multiplexing, encryption, compression). Add support for new serialization formats (XML-RPC, SOAP, WDDX, IIOP). Submit bug reports, comments, and suggestions! NewsLDO library gets renamed Scarab March 4, 2000 LDO has been split into two seperate entities, Scarab, the library implementing the framework, and LDO, a set of reference protocols implementing RPCs and distributed objects. New XML Serialization draft October 6, 1999 The XML Serialization spec has been updated and expanded. The specification has been converted to the Internet RFC XML DTD and uses xml2rfc to convert the XML to RFC and Internet Draft format. Please read this spec and post technical and editorial comments and suggestions to the mailing list. |


Learn More
Post your jobs directly to JobPlanet in minutes. You'll get quality applicants sent directly to your inbox, no website required.
Post your jobs directly to JobPlanet in minutes. You'll get quality applicants sent directly to your inbox, no website required.
Post your jobs directly to JobPlanet in minutes. You'll get quality applicants sent directly to your inbox, no website required.


Toggle navigation
Information
Please Tell Us About Your Program:
Name
Program Name
Cost:
Free
Less than $1,000
$1,001-$2,000
More than $2,000
Meals Included?
Yes
No
College/University affiliation?
Yes
No
Program Description
Participants come from where?
Do you work with other programs?
Current challenges to program's success?
Number of participants per year:
Program website
Scholarships?
How is success measured?
In-person, online-only or combination?
Time of day offered?
Submit Button
Phone
Email
Program timeline
Ages
18 and under
18 and over
Data tracking past success of program?
Any additional benefits?
How do people find out about this program?
How is program funded?
Program description
Program phone number
Program location
Program partners?
How are parents involved?
Funded by CareerSource NCFL?
No
Yes
Serve a targeted population?
Comparable local programs that you know of?


/* <CoffeeScript> utils = require('./utils') timezoneJS = require('../lib/timezone-js.js').timezoneJS class Time </CoffeeScript> */ /** * @class tzTime.Time * * ## Basic usage ## * * {TimelineIterator, Timeline, Time} = require('../') * * Get Time objects from partial ISOStrings. The granularity is automatically inferred from how many segments you provide. * * d1 = new Time('2011-02-28') * console.log(d1.toString()) * # 2011-02-28 * * Spell it all out with a JavaScript object * * d2 = new Time({granularity: Time.DAY, year: 2011, month: 3, day: 1}) * console.log(d2.toString()) * # 2011-03-01 * * Increment/decrement and compare Times without regard to timezone * * console.log(d1.greaterThanOrEqual(d2)) * # false * * d1.increment() * console.log(d1.equal(d2)) * # true * * Do math on them. * * d3 = d1.add(5) * console.log(d3.toString()) * # 2011-03-06 * * Get the day of the week. * * console.log(d3.dowString()) * # Sunday * * Subtraction is just addition with negative numbers. * * d3.addInPlace(-6) * console.log(d3.toString()) * # 2011-02-28 * * If you start on the last day of a month, adding a month takes you to the last day of the next month, * even if the number of days are different. * * d3.addInPlace(1, 'month') * console.log(d3.toString()) * # 2011-03-31 * * Deals well with year-granularity math and leap year complexity. * * d4 = new Time('2004-02-29') # leap day * d4.addInPlace(1, 'year') # adding a year takes us to a non-leap year * console.log(d4.toString()) * # 2005-02-28 * * Week granularity correctly wraps and deals with 53-week years. * * w1 = new Time('2004W53-6') * console.log(w1.inGranularity(Time.DAY).toString()) * # 2005-01-01 * * Convert between any of the standard granularities. Also converts custom granularities (not shown) to * standard granularities if you provide a `rataDieNumber()` function with your custom granularities. * * d5 = new Time('2005-01-01') # goes the other direction also * console.log(d5.inGranularity('week_day').toString()) * # 2004W53-6 * * q1 = new Time('2011Q3') * console.log(q1.inGranularity(Time.MILLISECOND).toString()) * # 2011-07-01T00:00:00.000 * * ## Timezones ## * * Time does timezone sensitive conversions. * * console.log(new Time('2011-01-01').getJSDate('America/Denver').toISOString()) * # 2011-01-01T07:00:00.000Z * * @constructor * @param {Object/Number/Date/String} value * @param {String} [granularity] * @param {String} [tz] * * The constructor for Time supports the passing in of a String, a rata die number (RDN), or a config Object * * ## String ## * * There are two kinds of strings that can be passed into the constructor: * * 1. Human strings relative to now (e.g. "this day", "previous month", "next quarter", "this millisecond in Pacific/Fiji", etc.) * 2. ISO-8601 or custom masked (e.g. "I03D10" - 10th day of 3rd iteration) * * ## Human strings relative to now ## * * The string must be in the form `(this, previous, next) |granularity| [in |timezone|]` * * Examples * * * `this day` today * * `next month` next month * * `this day in Pacific/Fiji` the day that it currently is in Fiji * * `previous hour in America/New_York` the hour before the current hour in New York * * `next quarter` next quarter * * `previous week` last week * * ## ISO-8601 or custom masked ## * * When you pass in an ISO-8601 or custom mask string, Time uses the masks that are defined for each granularity to figure out the granularity... * unless you explicitly provide a granularity. This parser works on all valid ISO-8601 forms except orginal dates (e.g. `"2012-288"`) * It even supports week number form (`"2009W52-7"`) and we've added a form for Quarter granularity (e.g. `"2009Q4"`). * The canonical form (`"2009-01-01T12:34:56.789"`) will work as will any shortened subset of it (`"2009-01-01"`, * `"2009-01-01T12:34"`, etc.). Plus it will even parse strings in whatever custom granularity you provide based * upon the mask that you provide for that granularity. * * If the granularity is specified but not all of the segments are provided, Time will fill in the missing value * with the `lowest` value from _granularitySpecs. * * The ISO forms that omit the delimiters or use spaces as the delimeters are not supported. Also unsupported are strings * with a time shift indicator on the end (`...+05:00`). However, if you pass in a string with a "Z" at the end, Time * will assume that you want to convert from GMT to local (abstract) time and you must provide a timezone. * * There are two special Strings that are recognized: `BEFORE_FIRST` and `PAST_LAST`. You must provide a granularity if you * are instantiating a Time with these values. They are primarily used for custom granularities where your users * may mistakenly request charts for iterations and releases that have not yet been defined. They are particularly useful when * you want to iterate to the last defined iteration/release. * * ## Rata Die Number ## * * The **rata die number (RDN)** for a date is the number of days since 0001-01-01. You will probably never work * directly with this number but it's what Time uses to convert between granularities. When you are instantiating * a Time from an RDN, you must provide a granularity. Using RDN will work even for the granularities finer than day. * Time will populate the finer grained segments (hour, minute, etc.) with the approriate `lowest` value. * * ## Date ## * * You can also pass in a JavaScript Date() Object. The passing in of a tz with this option doesn't make sense. You'll end * up with the same Time value no matter what because the JS Date() already sorta has a timezone. I'm not sure if this * option is even really useful. In most cases, you are probably better off using Time.getISOStringFromJSDate() * * ## Object ## * * You can also explicitly spell out the segments in a specification Object in the form of * `{granularity: Time.DAY, year: 2009, month: 1, day: 1}`. If the granularity is specified but not all of the segments are * provided, Time will fill in the missing value with the appropriate `lowest` value from _granularitySpecs. * * ## granularity ## * * If you provide a granularity it will take precedence over whatever fields you've provided in your config or whatever segments * you have provided in your string. Time will leave off extra values and fill in missing ones with the appropriate `lowest` * value. * * ## tz ## * * Most of the time, Time assumes that any dates you pass in are timezone less. You'll specify Christmas as 12-25, then you'll * shift the boundaries of Christmas for a specific timezone for boundary comparison. * * However, if you provide a tz parameter to this constructor, Time will assume you are passing in a true GMT date/time and shift into * the provided timezone. So... * * d = new Time('2011-01-01T02:00:00:00.000Z', Time.DAY, 'America/New_York') * console.log(d.toString()) * # 2010-12-31 * * Rule of thumb on when you want to use timezones: * * 1. If you have true GMT date/times and you want to create a Time, provide the timezone to this constructor. * 2. If you have abstract days like Christmas or June 10th and you want to delay the timezone consideration, don't provide a timezone to this constructor. * 3. In either case, if the dates you want to compare to are in GMT, but you've got Times or Timelines, you'll have to provide a timezone on * the way back out of Time/Timeline */ /* <CoffeeScript> the way back out of Time/Timeline @beforePastFlag = '' switch utils.type(value) when 'string' s = value if (s.slice(-3, -2) == ':' and s.slice(-6, -5) in '+-') or s.slice(-1) == 'Z' if tz? # Remove the timezone stuff from the end if s.slice(-3, -2) == ':' and s.slice(-6, -5) in '+-' # s = s.slice(0, -6) throw new Error("tzTime.Time does not know how to deal with time shifted ISOStrings like what you sent: #{s}") if s.slice(-1) == 'Z' s = s.slice(0, -1) newCT = new Time(s, 'millisecond') jsDate = newCT.getJSDateFromGMTInTZ(tz) else throw new Error("Must provide a tz parameter when instantiating a Time object with ISOString that contains timeshift/timezone specification. You provided: #{s}.") else @_setFromString(s, granularity) tz = undefined when 'number' rdn = value if tz? newCT = new Time(rdn, 'millisecond') jsDate = newCT.getJSDateFromGMTInTZ(tz) else @_setFromRDN(rdn, granularity) when 'date' jsDate = value if tz? newCT = new Time(jsDate, 'millisecond') jsDate = newCT.getJSDateFromGMTInTZ(tz) unless tz? tz = 'GMT' when 'object' config = {} config.granularity = value.granularity config.beforePastFlag = value.beforePastFlag for segment in Time._granularitySpecs[value.granularity].segments config[segment] = value[segment] if tz? config.granularity = 'millisecond' newCT = new Time(config) jsDate = newCT.getJSDateFromGMTInTZ(tz) else @_setFromConfig(config) if tz? if @beforePastFlag in ['BEFORE_FIRST', 'PAST_LAST'] throw new Error("Cannot do timezone manipulation on #{@beforePastFlag}") if granularity? @granularity = granularity unless @granularity? @granularity = 'millisecond' newConfig = year: jsDate.getUTCFullYear() month: jsDate.getUTCMonth() + 1 day: jsDate.getUTCDate() hour: jsDate.getUTCHours() minute: jsDate.getUTCMinutes() second: jsDate.getUTCSeconds() millisecond: jsDate.getUTCMilliseconds() granularity: 'millisecond' newCT = new Time(newConfig).inGranularity(@granularity) @_setFromConfig(newCT) @_inBoundsCheck() @_overUnderFlow() ### `_granularitySpecs` is a static object that is used to tell Time what to do with particular granularties. You can think of each entry in it as a sort of sub-class of Time. In that sense Time is really a factory generating Time objects of type granularity. When custom timebox granularities are added to Time by `Time.addGranularity()`, it adds to this `_granularitySpecs` object. ### @_granularitySpecs = {} @_granularitySpecs['millisecond'] = { segments: ['year', 'month', 'day', 'hour', 'minute', 'second', 'millisecond'], mask: '####-##-##T##:##:##.###', lowest: 0, rolloverValue: () -> return 1000 } @_granularitySpecs['second'] = { segments: ['year', 'month', 'day', 'hour', 'minute', 'second'], mask: '####-##-##T##:##:##', lowest: 0, rolloverValue: () -> return 60 } @_granularitySpecs['minute'] = { segments: ['year', 'month', 'day', 'hour', 'minute'], mask: '####-##-##T##:##', lowest: 0, rolloverValue: () -> return 60 } @_granularitySpecs['hour'] = { segments: ['year', 'month', 'day', 'hour'], mask: '####-##-##T##', lowest: 0, rolloverValue: () -> return 24 } @_granularitySpecs['day'] = { segments: ['year', 'month', 'day'], mask: '####-##-##', lowest: 1, rolloverValue: (ct) -> return ct.daysInMonth() + 1 } @_granularitySpecs['month'] = { segments: ['year', 'month'], mask: '####-##', lowest: 1, rolloverValue: () -> return 12 + 1 } @_granularitySpecs['year'] = { segments: ['year'], mask: '####', lowest: 1, rolloverValue: () -> return 9999 + 1 } @_granularitySpecs['week'] = { segments: ['year', 'week'], mask: '####W##', lowest: 1, rolloverValue: (ct) -> if ct.is53WeekYear() return 53 + 1 else return 52 + 1 } @_granularitySpecs['week_day'] = { segments: ['year', 'week', 'week_day'], mask: '####W##-#' lowest: 1, rolloverValue: (ct) -> return 7 + 1 } @_granularitySpecs['quarter'] = { # !TODO: Support quarter_month and quarter_month_day segments: ['year', 'quarter'], mask: '####Q#', lowest: 1, rolloverValue: () -> return 4 + 1 } @_expandMask: (granularitySpec) -> mask = granularitySpec.mask if mask? if mask.indexOf('#') >= 0 i = mask.length - 1 while mask.charAt(i) != '#' i-- segmentEnd = i while mask.charAt(i) == '#' i-- granularitySpec.segmentStart = i + 1 granularitySpec.segmentLength = segmentEnd - i granularitySpec.regex = new RegExp(((if character == '#' then '\\d' else character) for character in mask.split('')).join('')) else # 'PAST_LAST' and other specials will have no mask granularitySpec.regex = new RegExp(mask) # The code below should run when Time is loaded. It mutates the _granularitySpecs object by converting # the mask into segmentStart, segmentLength, and regex. for g, spec of @_granularitySpecs # !TODO: Do consistency checks on _granularitySpecs in the loop below Time._expandMask(spec) Time[g.toUpperCase()] = g # It also preloads the tz files timezoneJS.timezone.zoneFileBasePath = '../files/tz' timezoneJS.timezone.init() _inBoundsCheck: () -> if @beforePastFlag == '' or !@beforePastFlag? unless @granularity throw new Error('@granularity should be set before _inBoundsCheck is ever called.') segments =<EMAIL_ADDRESS>for segment in segments gs = Time._granularitySpecs[segment] temp = this[segment] lowest = gs.lowest rolloverValue = gs.rolloverValue(this) if temp < lowest or temp >= rolloverValue if temp == lowest - 1 # Supports overflows of just 1 in one segment. If more than that, will fail this[segment]++ this.decrement(segment) else if temp == rolloverValue this[segment]-- this.increment(segment) else throw new Error("Tried to set #{segment} to #{temp}. It must be >= #{lowest} and < #{rolloverValue}") _setFromConfig: (config) -> utils.assert(config.granularity?, 'A granularity property must be part of the supplied config.') @granularity = config.granularity @beforePastFlag = if config.beforePastFlag? then config.beforePastFlag else '' segments =<EMAIL_ADDRESS>for segment in segments if config[segment]? this[segment] = config[segment] else this[segment] = Time._granularitySpecs[segment].lowest _setFromString: (s, granularity) -> if s in ['PAST_LAST', 'BEFORE_FIRST'] if granularity? @granularity = granularity @beforePastFlag = s return else throw new Error('PAST_LAST/BEFORE_FIRST must have a granularity') # "this month", "next day", "previous quarter", etc. sSplit = s.split(' ') if sSplit[0] in ['this', 'next', 'previous'] if sSplit[2] == 'in' and sSplit[3]? tz = sSplit[3] else tz = undefined zuluCT = new Time(new Date(), sSplit[1], tz) @_setFromConfig(zuluCT) if sSplit[0] == 'next' @increment() else if sSplit[0] == 'previous' @decrement() return for g, spec of Time._granularitySpecs if spec.segmentStart + spec.segmentLength == s.length or spec.mask.indexOf('#') < 0 # for special granularities like 'PAST_LAST' if spec.regex.test(s) granularity = g break if not granularity? throw new Error("Error parsing string '#{s}'. Couldn't identify granularity.") @granularity = granularity segments =<EMAIL_ADDRESS>stillParsing = true for segment in segments if stillParsing gs = Time._granularitySpecs[segment] l = gs.segmentLength sub = Time._getStringPart(s, segment) if sub.length != l stillParsing = false if stillParsing this[segment] = Number(sub) else this[segment] = Time._granularitySpecs[segment].lowest @_getStringPart = (s, segment) -> spec = Time._granularitySpecs[segment] l = spec.segmentLength st = spec.segmentStart sub = s.substr(st, l) return sub _setFromRDN: (rdn, granularity) -> config = {granularity: granularity} utils.assert(granularity?, "Must provide a granularity when constructing with a Rata Die Number.") switch granularity when 'week', 'week_day' # algorithm from http://en.wikipedia.org/wiki/Talk:ISO_week_date w = Math.floor((rdn - 1) / 7) d = (rdn - 1) % 7 n = Math.floor(w / 20871) w = w % 20871 z = w + (if w >= 10435 then 1 else 0) c = Math.floor(z / 5218) w = z % 5218 x = w * 28 + [15, 23, 3, 11][c] y = Math.floor(x / 1461) w = x % 1461 config['year'] = y + n*400 + c*100 + 1 config['week'] = Math.floor(w / 28) + 1 config['week_day'] = d + 1 @_setFromConfig(config) when 'year', 'month', 'day', 'hour', 'minute', 'second', 'millisecond', 'quarter' # algorithm from http://en.wikipedia.org/wiki/Julian_day#Gregorian_calendar_from_Julian_day_number # J = rdn + 1721425.5 # With it set like this dates like 2011-05-31 show up as 2011-06-00 J = rdn + 1721425 j = J + 32044 g = Math.floor(j / 146097) dg = j % 146097 c = Math.floor((Math.floor(dg / 36524) + 1) * 3 / 4) dc = dg - c * 36524 b = Math.floor(dc / 1461) db = dc % 1461 a = Math.floor((Math.floor(db / 365) + 1) * 3 / 4) da = db - a * 365 y = g * 400 + c * 100 + b * 4 + a m = Math.floor((da * 5 + 308) / 153) - 2 d = da - Math.floor((m + 4) * 153 / 5) + 122 config['year'] = y - 4800 + Math.floor((m + 2) / 12) config['month'] = (m + 2) % 12 + 1 config['day'] = Math.floor(d) + 1 config['quarter'] = Math.floor((config.month - 1) / 3) + 1 @_setFromConfig(config) else granularitySpec = Time._granularitySpecs[granularity] # Build spec for lowest possible value specForLowest = {granularity: granularity} for segment in granularitySpec.segments specForLowest[segment] = Time._granularitySpecs[segment].lowest beforeCT = new Time(specForLowest) beforeRDN = beforeCT.rataDieNumber() afterCT = beforeCT.add(1) afterRDN = afterCT.rataDieNumber() if rdn < beforeRDN @beforePastFlag = 'BEFORE_FIRST' return while true if rdn < afterRDN and rdn >= beforeRDN @_setFromConfig(beforeCT) return beforeCT = afterCT beforeRDN = afterRDN afterCT = beforeCT.add(1) afterRDN = afterCT.rataDieNumber() if afterCT.beforePastFlag == 'PAST_LAST' if rdn >= Time._granularitySpecs[beforeCT.granularity].endBeforeDay.rataDieNumber() @_setFromConfig(afterCT) @beforePastFlag == 'PAST_LAST' return else if rdn >= beforeRDN @_setFromConfig(beforeCT) return else throw new Error("RDN: #{rdn} seems to be out of range for #{granularity}") throw new Error("Something went badly wrong setting custom granularity #{granularity} for RDN: #{rdn}") _isGranularityCoarserThanDay: () -> </CoffeeScript> */ /** * @method granularityAboveDay * @member tzTime.Time * @private * @return {Boolean} true if the Time Object's granularity is above (coarser than) "day" level */ /* <CoffeeScript> for segment in<EMAIL_ADDRESS>if segment.indexOf('day') >= 0 return false return true getJSDate: (tz) -> </CoffeeScript> */ /** * @method getJSDate * @member tzTime.Time * @param {String} tz * @return {Date} * * Returns a JavaScript Date Object properly shifted. This Date Object can be compared to other Date Objects that you know * are already in the desired timezone. If you have data that comes from an API in GMT. You can first create a Time object from * it and then (using this getJSDate() function) you can compare it to JavaScript Date Objects created in local time. * * The full name of this function should be getJSDateInGMTasummingThisCTDateIsInTimezone(tz). It converts **TO** GMT * (actually something that can be compared to GMT). It does **NOT** convert **FROM** GMT. Use getJSDateFromGMTInTZ() * if you want to go in the other direction. * * ## Usage ## * * ct = new Time('2011-01-01') * d = new Date(Date.UTC(2011, 0, 1)) * * console.log(ct.getJSDate('GMT').getTime() == d.getTime()) * # true * * console.log(ct.inGranularity(Time.HOUR).add(-5).getJSDate('America/New_York').getTime() == d.getTime()) * # true * */ /* <CoffeeScript> if @beforePastFlag == 'PAST_LAST' return new Date(9999, 0, 1) if @beforePastFlag == 'BEFORE_FIRST' return new Date('0001-01-01') # !TODO: This may not work on all browsers utils.assert(tz?, 'Must provide a timezone when calling getJSDate') ct = this.inGranularity('millisecond') utcMilliseconds = Date.UTC(ct.year, ct.month - 1, ct.day, ct.hour, ct.minute, ct.second, ct.millisecond) offset = timezoneJS.timezone.getTzInfo(new Date(utcMilliseconds), tz).tzOffset utcMilliseconds += offset * 1000 * 60 newDate = new Date(utcMilliseconds) return newDate getISOStringInTZ: (tz) -> </CoffeeScript> */ /** * @method getISOStringInTZ * @member tzTime.Time * @param {String} tz * @return {String} The canonical ISO-8601 date in zulu representation but shifted to the specified tz * * console.log(new Time('2012-01-01').getISOStringInTZ('Europe/Berlin')) * # 2011-12-31T23:00:00.000Z */ /* <CoffeeScript> utils.assert(tz?, 'Must provide a timezone when calling getShiftedISOString') jsDate = @getJSDate(tz) return Time.getISOStringFromJSDate(jsDate) @getISOStringFromJSDate: (jsDate) -> </CoffeeScript> */ /** * @method getISOStringFromJSDate * @member tzTime.Time * @static * @param {Date} jsDate * @return {String} * * Given a JavaScript Date() Object, this will return the canonical ISO-8601 form. * * If you don't provide any parameters, it will return now, like `new Date()` except this is a zulu string. * * console.log(Time.getISOStringFromJSDate(new Date(0))) * # 1970-01-01T00:00:00.000Z */ /* <CoffeeScript> unless jsDate? jsDate = new Date() year = jsDate.getUTCFullYear() month = jsDate.getUTCMonth() + 1 day = jsDate.getUTCDate() hour = jsDate.getUTCHours() minute = jsDate.getUTCMinutes() second = jsDate.getUTCSeconds() millisecond = jsDate.getUTCMilliseconds() s = Time._pad(year, 4) + '-' + Time._pad(month, 2) + '-' + Time._pad(day, 2) + 'T' + Time._pad(hour, 2) + ':' + Time._pad(minute, 2) + ':' + Time._pad(second, 2) + '.' + Time._pad(millisecond, 3) + 'Z' return s getJSDateFromGMTInTZ: (tz) -> </CoffeeScript> */ /** * @method getJSDateInTZfromGMT * @member tzTime.Time * @param {String} tz * @return {Date} * * This assumes that the Time is an actual GMT date/time as opposed to some abstract day like Christmas and shifts * it into the specified timezone. * * Note, this function will be off by an hour for the times near midnight on the days where there is a shift to/from daylight * savings time. The tz rules engine is designed to go in the other direction so we're mis-using it. This means we are using the wrong * moment in rules-space for that hour. The cost of fixing this issue was deemed to high for chart applications. * * console.log(new Time('2012-01-01').getJSDateFromGMTInTZ('Europe/Berlin').toISOString()) * # 2012-01-01T01:00:00.000Z */ /* <CoffeeScript> if @beforePastFlag == 'PAST_LAST' return new Date(9999, 0, 1) if @beforePastFlag == 'BEFORE_FIRST' return new Date('0001-01-01') # !TODO: This may not work on all browsers utils.assert(tz?, 'Must provide a timezone when calling getJSDate') ct = this.inGranularity('millisecond') utcMilliseconds = Date.UTC(ct.year, ct.month - 1, ct.day, ct.hour, ct.minute, ct.second, ct.millisecond) offset = timezoneJS.timezone.getTzInfo(new Date(utcMilliseconds), tz).tzOffset utcMilliseconds -= offset * 1000 * 60 newDate = new Date(utcMilliseconds) return newDate getSegmentsAsObject: () -> </CoffeeScript> */ /** * @method getSegmentsAsObject * @member tzTime.Time * @return {Object} Returns a simple JavaScript Object containing the segments. This is useful when using utils.match * for holiday comparison * * t = new Time('2011-01-10') * console.log(t.getSegmentsAsObject()) * # { year: 2011, month: 1, day: 10 } */ /* <CoffeeScript> segments =<EMAIL_ADDRESS>rawObject = {} for segment in segments rawObject[segment] = this[segment] return rawObject getSegmentsAsArray: () -> </CoffeeScript> */ /** * @method getSegmentsAsArray * @member tzTime.Time * @return {Array} Returns a simple JavaScript Array containing the segments. This is useful for doing hierarchical * aggregations using Lumenize.OLAPCube. * * t = new Time('2011-01-10') * console.log(t.getSegmentsAsArray()) * # [ 2011, 1, 10 ] */ /* <CoffeeScript> segments =<EMAIL_ADDRESS>a = [] for segment in segments a.push(this[segment]) return a toString: () -> </CoffeeScript> */ /** * @method toString * @member tzTime.Time * @return {String} Uses granularity `mask` in _granularitySpecs to generate the string representation. * * t = new Time({year: 2012, month: 1, day: 1, granularity: Time.MINUTE}).toString() * console.log(t.toString()) * console.log(t) * # 2012-01-01T00:00 * # 2012-01-01T00:00 */ /* <CoffeeScript> if @beforePastFlag in ['BEFORE_FIRST', 'PAST_LAST'] s = "#{@beforePastFlag}" else s =<EMAIL_ADDRESS>segments =<EMAIL_ADDRESS>for segment in segments granularitySpec = Time._granularitySpecs[segment] l = granularitySpec.segmentLength start = granularitySpec.segmentStart before = s.slice(0, start) after = s.slice(start + l) s = before + Time._pad(this[segment], l) + after return s @_pad = (n, l) -> result = n.toString() while result.length < l result = '0' + result return result @DOW_N_TO_S_MAP = {0: 'Sunday', 1: 'Monday', 2: 'Tuesday', 3: 'Wednesday', 4: 'Thursday', 5: 'Friday', 6: 'Saturday', 7: 'Sunday'} @MONTH_TO_S_MAP = {1: 'January', 2: 'February', 3: 'March', 4: 'April', 5: 'May', 6: 'June', 7: 'July', 8: 'August', 9: 'September', 10: 'October', 11: 'November', 12: 'December'} @DOW_MONTH_TABLE = [0, 3, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4] dowNumber: () -> </CoffeeScript> */ /** * @method dowNumber * @member tzTime.Time * @return {Number} * Returns the day of the week as a number. Monday = 1, Sunday = 7 * * console.log(new Time('2012-01-01').dowNumber()) * # 7 */ /* <CoffeeScript> if @granularity == 'week_day' return @week_day if @granularity in ['day', 'hour', 'minute', 'second', 'millisecond'] y = @year if (@month < 3) then y-- dayNumber = (y + Math.floor(y/4) - Math.floor(y/100) + Math.floor(y/400) + Time.DOW_MONTH_TABLE[@month-1] + @day) % 7 if dayNumber == 0 return 7 else return dayNumber else return @inGranularity('day').dowNumber() dowString: () -> </CoffeeScript> */ /** * @method dowString * @member tzTime.Time * @return {String} Returns the day of the week as a String (e.g. "Monday") * * console.log(new Time('2012-01-01').dowString()) * # Sunday */ /* <CoffeeScript> return Time.DOW_N_TO_S_MAP[@dowNumber()] monthString: () -> </CoffeeScript> */ /** * @method monthString * @member tzTime.Time * @return {String} Returns the month as a String (e.g. "January") * * console.log(new Time('2012-01-01').monthString()) * # January */ /* <CoffeeScript> return Time.MONTH_TO_S_MAP[@month] rataDieNumber: () -> </CoffeeScript> */ /** * @method rataDieNumber * @member tzTime.Time * @return {Number} Returns the counting number for days starting with 0001-01-01 (i.e. 0 AD). Note, this differs * from the Unix Epoch which starts on 1970-01-01. This function works for * granularities finer than day (hour, minute, second, millisecond) but ignores the segments of finer granularity than * day. Also called common era days. * * console.log(new Time('0001-01-01').rataDieNumber()) * # 1 * * rdn2012 = new Time('2012-01-01').rataDieNumber() * rdn1970 = new Time('1970-01-01').rataDieNumber() * ms1970To2012 = (rdn2012 - rdn1970) * 24 * 60 * 60 * 1000 * msJSDate2012 = Number(new Date('2012-01-01')) * console.log(ms1970To2012 == msJSDate2012) * # true */ /* <CoffeeScript> if @beforePastFlag == 'BEFORE_FIRST' return -1 else if @beforePastFlag == 'PAST_LAST' return utils.MAX_INT else if<EMAIL_ADDRESS>return Time._granularitySpecs[@granularity].rataDieNumber(this) else y = @year - 1 yearDays = y*365 + Math.floor(y/4) - Math.floor(y/100) + Math.floor(y/400) ew = Math.floor((yearDays + 3) / 7) # algorithm for week/week_day from http://en.wikipedia.org/wiki/Talk:ISO_week_date if @month? monthDays = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334][@month - 1] if @isLeapYear() and @month >= 3 monthDays++ else if @quarter? monthDays = [0, 90, 181, 273][@quarter - 1] if @isLeapYear() and @quarter >= 2 monthDays++ else monthDays = 0 switch @granularity when 'year' return yearDays + 1 when 'month', 'quarter' return yearDays + monthDays + 1 when 'day', 'hour', 'minute', 'second', 'millisecond' return yearDays + monthDays + @day when 'week' return (ew + @week - 1) * 7 + 1 when 'week_day' return (ew + @week - 1) * 7 + @week_day # !TODO: I think the code below should work but the mere adding of a valueOf() method changes the type coercion so 134 tests start failing with this method added. I'll fix the tests and add this method some other time. # @MILLISECONDS_IN_A_MINUTE = 60 * 1000 # @MILLISECONDS_IN_AN_HOUR = 60 * Time.MILLISECONDS_IN_A_MINUTE # @MILLISECONDS_IN_A_DAY = 24 * Time.MILLISECONDS_IN_AN_HOUR # valueOf: () -> # ### # @method getTime # Lumenize.Time is not meant to be a drop in replacement for the JavaScript Date() Object. However, it's sometimes # nice to do Date math with operators (e.g. +, -, ==, etc.). This function allows you to compare Date() Objects # to Lumenize.Time Object with these operators. Think of it as poor man's operator overload. # @return {Number} The milliseconds since the Unix Epoch (1970-01-01). # # console.log(new Time('1970-01-01').valueOf()) # # 0 # ### # time = this.inGranularity(Time.MILLISECOND) # days = time.rataDieNumber() - new Time('1970-01-01').rataDieNumber() # return days * Time.MILLISECONDS_IN_A_DAY + time.hour * Time.MILLISECONDS_IN_AN_HOUR + time.minute * Time.MILLISECONDS_IN_A_MINUTE + Time.second * 1000 + Time.millisecond inGranularity: (granularity) -> </CoffeeScript> */ /** * @method inGranularity * @member tzTime.Time * @param {String} granularity * @return {Time} Returns a new Time object for the same date-time as this object but in the specified granularity. * Fills in missing finer granularity segments with `lowest` values. Drops segments when convernting to a coarser * granularity. * * console.log(new Time('2012W01-1').inGranularity(Time.DAY).toString()) * # 2012-01-02 * * console.log(new Time('2012Q3').inGranularity(Time.MONTH).toString()) * # 2012-07 */ /* <CoffeeScript> if @granularity in ['year', 'month', 'day', 'hour', 'minute', 'second', 'millisecond'] if granularity in ['year', 'month', 'day', 'hour', 'minute', 'second', 'millisecond'] tempGranularity = @granularity @granularity = granularity newTime = new Time(this) @granularity = tempGranularity return newTime return new Time(this.rataDieNumber(), granularity) daysInMonth: () -> </CoffeeScript> */ /** * @method daysInMonth * @member tzTime.Time * @return {Number} Returns the number of days in the current month for this Time * * console.log(new Time('2012-02').daysInMonth()) * # 29 */ /* <CoffeeScript> # !TODO: Error on granularities without month switch @month when 4, 6, 9, 11 return 30 when 1, 3, 5, 7, 8, 10, 12, 0 # Treating 0 like 12 for wrapping on decrement (bit of a hack but it works) return 31 when 2 if @isLeapYear() return 29 else return 28 isLeapYear: () -> </CoffeeScript> */ /** * @method isLeapYear * @member tzTime.Time * @return {Boolean} true if this is a leap year * * console.log(new Time('2012').isLeapYear()) * # true */ /* <CoffeeScript> if (@year % 4 == 0) if (@year % 100 == 0) if (@year % 400 == 0) return true else return false else return true else return false @YEARS_WITH_53_WEEKS = [4, 9, 15, 20, 26, 32, 37, 43, 48, 54, 60, 65, 71, 76, 82, 88, 93, 99, 105, 111, 116, 122, 128, 133, 139, 144, 150, 156, 161, 167, 172, 178, 184, 189, 195, 201, 207, 212, 218, 224, 229, 235, 240, 246, 252, 257, 263, 268, 274, 280, 285, 291, 296, 303, 308, 314, 320, 325, 331, 336, 342, 348, 353, 359, 364, 370, 376, 381, 387, 392, 398] is53WeekYear: () -> </CoffeeScript> */ /** * @method is53WeekYear * @member tzTime.Time * @return {Boolean} true if this is a 53-week year * * console.log(new Time('2015').is53WeekYear()) * # true */ /* <CoffeeScript> lookup = @year % 400 return lookup in Time.YEARS_WITH_53_WEEKS equal: (other) -> </CoffeeScript> */ /** * @method equal * @member tzTime.Time * @param {Time} other * @return {Boolean} Returns true if this equals other. Throws an error if the granularities don't match. * * d3 = new Time({granularity: Time.DAY, year: 2011, month: 12, day: 31}) * d4 = new Time('2012-01-01').add(-1) * console.log(d3.equal(d4)) * # true */ /* <CoffeeScript> utils.assert(@granularity == other.granularity, "Granulary of #{this} does not match granularity of #{other} on equality/inequality test") if @beforePastFlag == 'PAST_LAST' and other.beforePastFlag == 'PAST_LAST' return true if @beforePastFlag == 'BEFORE_FIRST' and other.beforePastFlag == 'BEFORE_FIRST' return true if @beforePastFlag == 'PAST_LAST' and other.beforePastFlag != 'PAST_LAST' return false if @beforePastFlag == 'BEFORE_FIRST' and other.beforePastFlag != 'BEFORE_FIRST' return false if other.beforePastFlag == 'PAST_LAST' and @beforePastFlag != 'PAST_LAST' return false if other.beforePastFlag == 'BEFORE_FIRST' and @beforePastFlag != 'BEFORE_FIRST' return false segments =<EMAIL_ADDRESS>for segment in segments if this[segment] != other[segment] return false return true greaterThan: (other) -> </CoffeeScript> */ /** * @method greaterThan * @member tzTime.Time * @param {Time} other * @return {Boolean} Returns true if this is greater than other. Throws an error if the granularities don't match * * d1 = new Time({granularity: Time.DAY, year: 2011, month: 2, day: 28}) * d2 = new Time({granularity: Time.DAY, year: 2011, month: 3, day: 1}) * console.log(d1.greaterThan(d2)) * # false * console.log(d2.greaterThan(d1)) * # true */ /* <CoffeeScript> utils.assert(@granularity == other.granularity, "Granulary of #{this} does not match granularity of #{other} on equality/inequality test") if @beforePastFlag == 'PAST_LAST' and other.beforePastFlag == 'PAST_LAST' return false if @beforePastFlag == 'BEFORE_FIRST' and other.beforePastFlag == 'BEFORE_FIRST' return false if @beforePastFlag == 'PAST_LAST' and other.beforePastFlag != 'PAST_LAST' return true if @beforePastFlag == 'BEFORE_FIRST' and other.beforePastFlag != 'BEFORE_FIRST' return false if other.beforePastFlag == 'PAST_LAST' and @beforePastFlag != 'PAST_LAST' return false if other.beforePastFlag == 'BEFORE_FIRST' and @beforePastFlag != 'BEFORE_FIRST' return true segments =<EMAIL_ADDRESS>for segment in segments if this[segment] > other[segment] return true if this[segment] < other[segment] return false return false greaterThanOrEqual: (other) -> </CoffeeScript> */ /** * @method greaterThanOrEqual * @member tzTime.Time * @param {Time} other * @return {Boolean} Returns true if this is greater than or equal to other * * console.log(new Time('2012').greaterThanOrEqual(new Time('2012'))) * # true */ /* <CoffeeScript> gt = this.greaterThan(other) if gt return true return this.equal(other) lessThan: (other) -> </CoffeeScript> */ /** * @method lessThan * @member tzTime.Time * @param {Time} other * @return {Boolean} Returns true if this is less than other * * console.log(new Time(1000, Time.DAY).lessThan(new Time(999, Time.DAY))) # Using RDN constructor * # false */ /* <CoffeeScript> return other.greaterThan(this) lessThanOrEqual: (other) -> </CoffeeScript> */ /** * @method lessThanOrEqual * @member tzTime.Time * @param {Time} other * @return {Boolean} Returns true if this is less than or equal to other * * console.log(new Time('this day').lessThanOrEqual(new Time('next day'))) # Using relative constructor * # true */ /* <CoffeeScript> return other.greaterThanOrEqual(this) _overUnderFlow: () -> if @beforePastFlag in ['BEFORE_FIRST', 'PAST_LAST'] return true else granularitySpec = Time._granularitySpecs[@granularity] highestLevel = granularitySpec.segments[0] highestLevelSpec = Time._granularitySpecs[highestLevel] value = this[highestLevel] rolloverValue = highestLevelSpec.rolloverValue(this) lowest = highestLevelSpec.lowest if value >= rolloverValue @beforePastFlag = 'PAST_LAST' # !TODO: This won't erase the other segments. Maybe that's OK. return true else if value < lowest @beforePastFlag = 'BEFORE_FIRST' return true else return false decrement: (granularity) -> </CoffeeScript> */ /** * @method decrement * @member tzTime.Time * @param {String} [granularity] * @chainable * @return {Time} * Decrements this by 1 in the granularity of the Time or the granularity specified if it was specified * * console.log(new Time('2016W01').decrement().toString()) * # 2015W53 */ /* <CoffeeScript> if @beforePastFlag == 'PAST_LAST' @beforePastFlag = '' granularitySpec = Time._granularitySpecs[@granularity] segments = granularitySpec.segments for segment in segments gs = Time._granularitySpecs[segment] this[segment] = gs.rolloverValue(this) - 1 else lastDayInMonthFlag = (@day == @daysInMonth()) granularity ?= @granularity granularitySpec = Time._granularitySpecs[granularity] segments = granularitySpec.segments this[granularity]-- if granularity is 'year' # Fix it if you decrement from a leap year to a non-leap year if @day > @daysInMonth() @day = @daysInMonth() else i = segments.length - 1 # start just before the last one which should equal granularity segment = segments[i] granularitySpec = Time._granularitySpecs[segment] while (i > 0) and (this[segment] < granularitySpec.lowest) # stop before going back to year this[segments[i - 1]]-- this[segment] = granularitySpec.rolloverValue(this) - 1 i-- segment = segments[i] granularitySpec = Time._granularitySpecs[segment] if granularity == 'month' and (@granularity != 'month') if lastDayInMonthFlag or (@day > @daysInMonth()) @day = @daysInMonth() @_overUnderFlow() return this increment: (granularity) -> </CoffeeScript> */ /** * @method increment * @member tzTime.Time * @param {String} [granularity] * @chainable * @return {Time} * Increments this by 1 in the granularity of the Time or the granularity specified if it was specified * * console.log(new Time('2012Q4').increment().toString()) * # 2013Q1 */ /* <CoffeeScript> if @beforePastFlag == 'BEFORE_FIRST' @beforePastFlag = '' granularitySpec = Time._granularitySpecs[@granularity] segments = granularitySpec.segments for segment in segments gs = Time._granularitySpecs[segment] this[segment] = gs.lowest else lastDayInMonthFlag = (@day == @daysInMonth()) granularity ?= @granularity granularitySpec = Time._granularitySpecs[granularity] segments = granularitySpec.segments this[granularity]++ if granularity is 'year' # !TODO: Add support for week granularity and 53 week years # Fix it if you increment from a leap year to a non-leap year if @day > @daysInMonth() @day = @daysInMonth() else i = segments.length - 1 # start just before the last one which should equal granularity segment = segments[i] granularitySpec = Time._granularitySpecs[segment] while (i > 0) and (this[segment] >= granularitySpec.rolloverValue(this)) # stop before going back to year this[segment] = granularitySpec.lowest this[segments[i - 1]]++ i-- segment = segments[i] granularitySpec = Time._granularitySpecs[segment] if (granularity is 'month') and (@granularity isnt 'month') if lastDayInMonthFlag or (@day > @daysInMonth()) @day = @daysInMonth() @_overUnderFlow() return this addInPlace: (qty, granularity) -> </CoffeeScript> */ /** * @method addInPlace * @member tzTime.Time * @chainable * @param {Number} qty Can be negative for subtraction * @param {String} [granularity] * @return {Time} Adds qty to the Time object. It uses increment and decrement so it's not going to be efficient for large values * of qty, but it should be fine for charts where we'll increment/decrement small values of qty. * * console.log(new Time('2011-11-01').addInPlace(3, Time.MONTH).toString()) * # 2012-02-01 */ /* <CoffeeScript> granularity ?= @granularity if qty == 0 return this if qty == 1 @increment(granularity) else if qty > 1 @increment(granularity) @addInPlace(qty - 1, granularity) else if qty == -1 @decrement(granularity) else # must be < -1 @decrement(granularity) @addInPlace(qty + 1, granularity) return this add: (qty, granularity) -> </CoffeeScript> */ /** * @method add * @member tzTime.Time * @param {Number} qty * @param {String} [granularity] * @return {Time} * Adds (or subtracts) quantity (negative quantity) and returns a new Time. Not efficient for large qty. * * console.log(new Time('2012-01-01').add(-10, Time.MONTH)) * # 2011-03-01 */ /* <CoffeeScript> newTime = new Time(this) newTime.addInPlace(qty, granularity) return newTime @addGranularity: (granularitySpec) -> </CoffeeScript> */ /** * @method addGranularity * @member tzTime.Time * @static * @param {Object} granularitySpec see {@link Time#_granularitySpecs} for existing _granularitySpecs * @cfg {String[]} segments an Array identifying the ancestry (e.g. for 'day', it is: `['year', 'month', 'day']`) * @cfg {String} mask a String used to identify when this granularity is passed in and to serialize it on the way out. * @cfg {Number} lowest the lowest possible value for this granularity. 0 for millisecond but 1 for day. * @cfg {Function} rolloverValue a callback function that will say when to rollover the next coarser granularity. * * addGranularity allows you to add your own hierarchical granularities to Time. Once you add a granularity to Time * you can then instantiate Time objects in your newly specified granularity. You specify new granularities with * granularitySpec object like this: * * granularitySpec = { * release: { * segments: ['release'], * mask: 'R##', * lowest: 1, * endBeforeDay: new Time('2011-07-01') * rolloverValue: (ct) -> * return Time._granularitySpecs.iteration.timeBoxes.length + 1 # Yes, it's correct to use the length of iteration.timeBoxes * rataDieNumber: (ct) -> * return Time._granularitySpecs.iteration.timeBoxes[ct.release-1][1-1].startOn.rataDieNumber() * }, * iteration: { * segments: ['release', 'iteration'], * mask: 'R##I##', * lowest: 1, * endBeforeDay: new Time('2011-07-01') * timeBoxes: [ * [ * {startOn: new Time('2011-01-01'), label: 'R1 Iteration 1'}, * {startOn: new Time('2011-02-01'), label: 'R1 Iteration 2'}, * {startOn: new Time('2011-03-01'), label: 'R1 Iteration 3'}, * ], * [ * {startOn: new Time('2011-04-01'), label: 'R2 Iteration 1'}, * {startOn: new Time('2011-05-01'), label: 'R2 Iteration 2'}, * {startOn: new Time('2011-06-01'), label: 'R2 Iteration 3'}, * ] * ] * rolloverValue: (ct) -> * temp = Time._granularitySpecs.iteration.timeBoxes[ct.release-1]?.length + 1 * if temp? and not isNaN(temp) and ct.beforePastFlag != 'PAST_LAST' * return temp * else * numberOfReleases = Time._granularitySpecs.iteration.timeBoxes.length * return Time._granularitySpecs.iteration.timeBoxes[numberOfReleases-1].length + 1 * * rataDieNumber: (ct) -> * return Time._granularitySpecs.iteration.timeBoxes[ct.release-1][ct.iteration-1].startOn.rataDieNumber() * }, * iteration_day: { # By convention, it knows to use day functions on it. This is the lowest allowed custom granularity * segments: ['release', 'iteration', 'iteration_day'], * mask: 'R##I##-##', * lowest: 1, * endBeforeDay: new Time('2011-07-01'), * rolloverValue: (ct) -> * iterationTimeBox = Time._granularitySpecs.iteration.timeBoxes[ct.release-1]?[ct.iteration-1] * if !iterationTimeBox? or ct.beforePastFlag == 'PAST_LAST' * numberOfReleases = Time._granularitySpecs.iteration.timeBoxes.length * numberOfIterationsInLastRelease = Time._granularitySpecs.iteration.timeBoxes[numberOfReleases-1].length * iterationTimeBox = Time._granularitySpecs.iteration.timeBoxes[numberOfReleases-1][numberOfIterationsInLastRelease-1] * * thisIteration = iterationTimeBox.startOn.inGranularity('iteration') * nextIteration = thisIteration.add(1) * if nextIteration.beforePastFlag == 'PAST_LAST' * return Time._granularitySpecs.iteration_day.endBeforeDay.rataDieNumber() - iterationTimeBox.startOn.rataDieNumber() + 1 * else * return nextIteration.rataDieNumber() - iterationTimeBox.startOn.rataDieNumber() + 1 * * rataDieNumber: (ct) -> * return Time._granularitySpecs.iteration.timeBoxes[ct.release-1][ct.iteration-1].startOn.rataDieNumber() + ct.iteration_day - 1 * } * } * Time.addGranularity(granularitySpec) * * * The `mask` must cover all of the segments to get down to the granularity being specified. The digits of the granularity segments * are represented with `#`. Any other characters can be used as a delimeter, but it should always be one character to comply with * the expectations of the Lumenize hierarchy visualizations. All of the standard granularities start with a 4-digit year to * distinguish your custom granularity, your highest level must start with some number of digits other than 4 or a prefix letter * (`R` in the example above). * * In order for the TimelineIterator to work, you must provide `rolloverValue` and `rataDieNumber` callback functions. You should * be able to mimic (or use as-is) the example above for most use cases. Notice how the `rataDieNumber` function simply leverages * `rataDieNumber` functions for the standard granularities. * * In order to convert into this granularity from some other granularity, you must provide an `inGranularity` callback [NOT YET IMPLEMENTED]. * But Time will convert to any of the standard granularities from even custom granularities as long as a `rataDieNumber()` function * is provided. * * **The `timeBoxes` property in the `granularitySpec` Object above has no special meaning** to Time or TimelineIterator. It's simply used * by the `rolloverValue` and `rataDieNumber` functions. The boundaries could come from where ever you want and even have been encoded as * literals in the `rolloverValue` and `rataDieNumber` callback functions. * * The convention of naming the lowest order granularity with `_day` at the end IS signficant. Time knows to treat that as a day-level * granularity. If there is a use-case for it, Time could be upgraded to allow you to drill down into hours, minutes, etc. from any * `_day` granularity but right now those lower order time granularities are only supported for the canonical ISO-6801 form. * */ /* <CoffeeScript> for g, spec of granularitySpec # !TODO: Need a way for the user to provide a loose stream of timebox dates that are converted into this format. Would cleanup situations where the timeboxes overlapped and error out on impossible situations like nested timeboxes. Use the startOn. Time._expandMask(spec) # !TODO: Add @label() and @end() methods. @_granularitySpecs[g] = spec # !TODO: Assert that we don't have a conflict with existing granularities and that the granularity equals the last segment. Assert that the endBefore date of one equals the startOn date of the next. Time[g.toUpperCase()] = g exports.Time = Time </CoffeeScript> */


--- layout: page title: About header-img: "img/about-bg.png" ---
An inside look into the journey towards becoming a computer programmer.


Toggle navigation
Blues[at]Work
Dashboard
By Location
Questionnaire
Add New Location (Admin Only)
Blues[at]Work
By Location
Questionnaire
Add New Location (Admin Only)
Overall Stress


Admin Login
Go
TMA Features
Asset Tracking
Vendor Management
Asset Transfers
Analytics
Graphical Reports
Many More....
Useful Solution For
Manufacturing
Film Industry
TV Channels
Hospitals
Hotels/Restaurants
Many more...
2014 © Gopalsystems. ALL Rights Reserved.
Privacy Policy
|
Terms of Service