Demographics
Uttarakhand is the 27th State of the Republic of India. It is the 20th Largest (in terms of Population) and 19th Largest (in terms of Area) state of India. The native people of Uttarakhand are generally called Uttarakhandi and sometimes specifically either Garhwali or Kumaoni depending on their place of origin in either the Garhwal or Kumaon region. There are 13 districts in Uttarakhand which are grouped into two divisions, Kumaon and Garhwal. Uttarakhand was carved out on 9 Nov 2000, from the state of Uttar Pradesh. Uttarakhand has a population of 10,116,752 (0.84% of India) according to the 2011 Census. It has an area of 53,483 sq. km (1.62% of India), comparable to the size of Costa Rica.
Ethnic groups
Uttarakhand has a multiethnic population spread across two geocultural regions:the Garhwal, and the Kumaon. A large portion of the
population is Rajput including members of the native Garhwali, Kumaoni and Gujjar communities, as well as a number of immigrants.
Uttarakhand has the highest percentage of Brahmins of any state in India, with approximately 20% of the population being Brahmin.
Languages
Hindi belonging to Indo-Aryan languages is the sole official language of Uttarakhand and is spoken by 87.95% of the population
(figure includes Garhwali, Kumaoni and Jaunsari as variants of Hindi). Sanskrit is given the status of second official language.
Many Tibeto-Burman languages are also spoken inthis region, including Bhoti, Jad, Rangkas, Darmiya, Byangsi, and Chaudangsi.
Economy
The Uttarakhand state is the second fastest growing state in India. It's gross state domestic product (GSDP) (at constant prices) more than doubled from₹24,786 crore in FY2005 to ₹60,898 crore in FY2012. The real GSDP grew at 13.7% (CAGR) during the FY2005–FY2012 period. The contribution of the service sector to the GSDP of Uttarakhand was just over 50% during FY 2012. Per capita income in Uttarakhand is ₹1,03,000 (FY 2013) which is higher than the national average of ₹74,920 (FY2013). According to the Reserve Bank of India, the total foreign direct investment in the state from April 2000 to October 2009 amounted to US$46.7 million. Like most of India, agriculture is one of the most significant sectors of the economy of Uttarakhand. Other key industries
include tourism and hydropower, and there is prospective development in IT, ITES, biotechnology, pharmaceuticals and automobile industries. The service sector of Uttarakhand mainly includes tourism, information technology, higher education, and banking. During 2005–2006, the state successfully developed three Integrated Industrial Estates (IIEs) at Haridwar, Pantnagar, and Sitarganj; Pharma City at Selaqui; Information Technology Park at Sahastradhara
(Dehradun); and a growth centre at Sigaddi (Kotdwar). Also in 2006, 20 industrial sectors in public private partnership mode were developed in the state.
Crops
Like most of India, agriculture is one of the most significant sectors of the economy of Uttarakhand. Basmati rice, wheat, soybeans, groundnuts, coarse cereals, pulses, and oil seeds are the most widely grown crops. Fruits like apples, oranges, pears, peaches, litchis, and plums are widely grown and important to the large food processing industry. Agricultural export zones have been set up in the state for leechi, horticulture, herbs, medicinal plants, and basmati rice. During 2010, wheat production was 831 thousand tonnes and rice production was 610 thousand tonnes, while the main cash crop of the state, sugarcane, had a production of 5058 thousand tonnes. As 86% of the state consists of hills, the yield per hectare is not very high. 86% of all croplands are in the plains while the remaining is from the hills.
Religion
More than four-fifths of Uttarakhand’s residents are Hindus. Muslims, Sikhs, Christians, Buddhists, and Jains make up the remaining population.
Government and Politics
Following the Constitution of India, Uttarakhand, like all Indian states, has a parliamentary system of representative democracy for its
government. The Governor is the constitutional and formal head of the government and is appointed for a five-year term by the
President of India on the advice of the Union government. The present Governor of the state is Krishan Kant Paul. The Chief Minister,
who holds the real executive powers, is the head of the party or coalition garnering the majority in the state elections. The current Chief
Minister of Uttarakhand is Trivendra Singh Rawat. The unicameral Uttarakhand Legislative Assembly consists of has 71 elected members,
known as Members of the Legislative Assembly or MLAs.The state also elects 5 members to Lok Sabha and 3 seats to Rajya Sabha of the Indian
Parliament. The judiciary consists of the Uttarakhand High Court, located at Nainital, and a system of lower courts. The present Chief Justice
of Uttarakhand is Justice K. M. Joseph.


STRENGTHS
- Creative
- Open-minded
- Diplomatic
- Driven
WEAKNESSES
Sometimes I get distracted, irritated and/or disillusioned, struggle to endure boring details/things I’m not interested in doing, get frustrated with people with ideas/approaches I don’t agree with.
WEEK THREE: UPDATED GOALS/LEARNING PLAN
Handle stress/lethargy more productively:
- Notice when I'm stressed/lethargic and check off what I could do to make it better
- Look after my body: drink more water, eat well, take regular breaks, stretch, take deep breaths
Deal with code-related problems more effectively
- Psuedocode
- Google it
- Ask for help more often
Priortise my time to mitigate stress and increase my ability to learn/engage:
- Spend 1-2 hours after class recapping concepts and continuing to work on problems
- Take an hour to reiterate particular concepts/problems that I need to reiterate
- Limit extra curricular activities to an amount that I can feasibly handle
- Give myself to time to reflect decompress each night through meditation and journaling


Package org.thedryden.workmanager
Class WorkerPool
java.lang.Object
org.thedryden.workmanager.WorkerPool
public class WorkerPool
extends java.lang.Object
WorkerPool is designed for easily setting up a multi-threaded, but static, operations that include a number of features to make managing the entire process easier.
When working with WorkerPool there are 2 key concepts to keep in mind: pools and workers.
A pool is a collection of workers. When a pool is started up to the max thread count of workers in the pool will be started.
If there are some workers in the pool that must wait for the completion of one or more other workers in the pool before they can safely be started you can set a precedence constraint on that worker.
Precedence Constraints are simple a list of thread names (Strings) of the other "parent" workers that the "child" worker needs to wait for.
If a parent worker fails, the child worker will not be started.
Finally you can have more than one pool, allowing you to create larger logical blocks of code that will run in sequence.
Workers are objects that once started will do the actual work.
To create a worker simply create your own class that extends the worker class Worker.
That class has all of the required methods implemented, except, the worker method, which you will need to overwrite and implement with your own code.
The worker method expects critical errors to be thrown, where they will be caught by the class you extended, and the status will be updated to failed automatically.
Therefore you should only catch errors if they do not represent the class failing and you want your the code in that class to continue executing.
Remember that even if one worker fails, by default, all other workers in the pool will still run, and any other pools will still execute, that behavior is controlled by stopAllRunningOnFailure and dontStartNextPoolOnFailure respectively.
- Author:
- Matthew Dryden
-
Field Summary
Fields Modifier and Type Field Description static boolean
DEFAULT_EXIT_ON_ERROR
Default value for exit on errorstatic int
DEFAULT_MAX_THREAD_COUNT
Default maximum number of threads running at one timestatic boolean
DEFAULT_NO_NEW_THREADS_ON_FAILURE
Default value for stopAllRunningOnFailure.static long
DEFAULT_SECONDS_BEFORE_WARN
Default seconds before warningstatic long
DEFAULT_SECONDS_BETWEEN_MSG
Default seconds between status messagesstatic boolean
START_NEXT_POOL_ON_FAILURE
Default value for start next pool on failure -
Constructor Summary
Constructors Constructor Description WorkerPool()
Creates a new worker pool.WorkerPool(org.slf4j.Logger logger)
Creates a new WorkerPool that will use the passed logger. -
Method Summary
Modifier and Type Method Description WorkerPool
addPool(java.lang.String poolName)
Adds a pool of threads.WorkerPool
addPrecedenceConstraint(java.lang.String precedenceConstraint)
Adds a precedence constraint to the last worker added.WorkerPool
addPrecedenceConstraint(java.lang.String threadName, java.lang.String precedenceConstraint)
Adds a precedence constraint to the worker with the passed thread name.WorkerPool
addWorker(java.lang.String poolName, WorkerInterface newWorker)
Takes a pool name and adds a single worker to the end of that pools list of workers.WorkerPool
addWorker(WorkerInterface newWorker)
Adds a worker to the end of the pool associated with the last pool added with addPoolWorkerPool
appendThreadName(java.lang.String append)
Used to append a string to the thread name of the previously added worker.Status
getAllStatus()
Gets the composite status of all pools.int
getMaxThreadCount()
Returns the current value maxThreadCountjava.util.List<java.lang.String>
getPoolNames()
Returns a copy of the list of poolNames.int
getRetryAttempt(java.lang.String poolName)
Returns the number of retry attempts for the passed poolNameint
getRetryWaitSeconds(java.lang.String poolName)
Returns the number of seconds to wait after a failure to retrylong
getSecondsBeforeWarn()
Returns the time between warning messages.long
getSecondsBetweenMsg()
Returns the time between status messages.Status
getStatus(java.lang.String poolName)
Gets the composite status of an entire pool.Status
getStatus(java.lang.String... poolNames)
Gets the composite status of the passed pools.java.lang.String
getThreadName()
Returns the thread name of the last worker added.WorkerInterface
getWorker(java.lang.String threadName)
Takes a name of a worker that is in any pool, and returns that worker.boolean
isExitOnError()
If true when start, startPools, startAsyncAndJoin, or startOnePool is called at the end of execution of all pools, if the aggregate status for all pools is failure then start will cause System.exit(-1) to be called.boolean
isNoNewThreadsOnFailure()
Returns stopAllRunningOnFailureboolean
isStartNextPoolOnFailure()
Returns the value for the property: don't start next pool on failure.WorkerPool
joinPool(int waitMilliseconds, java.lang.String poolName)
Used in conjunction with any of Async methods to block execution until the passed poolName completes or waitMilliseconds elapses.WorkerPool
joinPools(int waitMilliseconds, java.lang.String... poolNames)
Used in conjunction with any of Async methods to block execution until the passed poolNames completes or waitMilliseconds elapses.WorkerPool
prependThreadName(java.lang.String prepend)
Used to prepend a string to the thread name of the previously added worker.WorkerPool
setExitOnError(boolean exitOnError)
Used to set exitOnError.WorkerPool
setMaxThreadCount(int maxThreadCount)
Sets the maximum number of threads that can be run at once.WorkerPool
setNoNewThreadsOnFailure(boolean noNewThreadsOnFailure)
If set to true then if any threads fail in a pool, no more workers in that pool will be started.WorkerPool
setNotInAll()
Sets the last worker added with either the addWorker method to the Not In All list.WorkerPool
setNotInAll(java.lang.String workerThreadName)
Takes a worker's thread name and adds it to the Not In All list.WorkerPool
setPools(java.util.List<java.lang.String> poolNames)
Allows you to pass a list of the name of all the thread pools you want to create.WorkerPool
setPrecedenceConstraint(java.lang.String threadName, java.util.Set<java.lang.String> precedenceConstraint)
Allows you to set the entire precedence constraint of the worker with the passed thread name.WorkerPool
setPrecedenceConstraint(java.util.Set<java.lang.String> precedenceConstraint)
Allows you to set the entire precedence constraint of the previously added worker.WorkerPool
setRetry(int retryAttempts, int retryWaitSeconds, boolean rerunSuccess)
For the last pool added sets a number of retry to attempt on a failure and the number of seconds to wait before after a failure before the retry.WorkerPool
setRetry(java.lang.String poolName, int retryAttempts, int retryWaitSeconds, boolean rerunSuccess)
For the passed poolName added sets a number of retry to attempt on a failure and the number of seconds to wait before after a failure before the retry.WorkerPool
setRunArg(java.lang.String[] runArg)
Used to control which pools / workers will run.WorkerPool
setRunArg(java.util.List<java.lang.String> runArg)
Used to control which pools / workers will run.void
setSecondsBeforeWarn(long secondsBeforeWarn)
Sets the number of seconds between sending warning status messages.WorkerPool
setSecondsBetweenMsg(long timeBetweenMsg)
Sets the number of seconds between sending status messages.WorkerPool
setStartNextPoolOnFailure(boolean startNextPoolOnFailure)
Used to set the value for the property: start next pool on failure.WorkerPool
setThreadName(java.lang.String threadName)
Used to overwrite the thread name of the previously added worker.WorkerPool
setWorkerRetry(int retryAttempts, int retryWaitSeconds)
For the last worker added sets a number of retry to attempt on a failure and the number of seconds to wait before after a failure before the retry.WorkerPool
setWorkerRetry(java.lang.String threadName, int retryAttempts, int retryWaitSeconds)
For the passed worker added sets a number of retry to attempt on a failure and the number of seconds to wait before after a failure before the retry.WorkerPool
setWorkers(java.lang.String poolName, java.util.List<WorkerInterface> workers)
Takes a pool name and a list of worker objects and sets / replaces the entire list of workers associated within that poolWorkerPool
setWorkers(java.util.List<WorkerInterface> workers)
Takes a list of worker objects and sets / replaces the entire list of workers associated with the last pool added with addPoolWorkerPool
start()
Starts all pools in the order they were added.WorkerPool
startAsync()
Starts all pools at the same time asynchronously.WorkerPool
startAsyncAndJoin()
Starts all pools at the same time asynchronously and then blocks execution until they complete.WorkerPool
startOnePool(java.lang.String poolName)
Starts the passed pool.WorkerPool
startOnePoolAsync(java.lang.String poolName)
Starts the passed pool, without blocking until completion.WorkerPool
startPools(java.lang.String... poolNames)
Starts the passed pools, running them one at a time in the order they were passed - not added.WorkerPool
startPoolsAsync(java.lang.String... poolNames)
Starts the passed pools, without blocking until completion.WorkerPool
startPoolsAsyncAndJoin(java.lang.String... poolNames)
Used to start multiple pool asynchronous, but then wait for all pools to complete before continuing.
-
Field Details
-
DEFAULT_MAX_THREAD_COUNT
public static final int DEFAULT_MAX_THREAD_COUNTDefault maximum number of threads running at one time- See Also:
- Constant Field Values
-
DEFAULT_NO_NEW_THREADS_ON_FAILURE
public static final boolean DEFAULT_NO_NEW_THREADS_ON_FAILUREDefault value for stopAllRunningOnFailure.- See Also:
- Constant Field Values
-
START_NEXT_POOL_ON_FAILURE
public static final boolean START_NEXT_POOL_ON_FAILUREDefault value for start next pool on failure- See Also:
- Constant Field Values
-
DEFAULT_SECONDS_BETWEEN_MSG
public static final long DEFAULT_SECONDS_BETWEEN_MSGDefault seconds between status messages- See Also:
- Constant Field Values
-
DEFAULT_SECONDS_BEFORE_WARN
public static final long DEFAULT_SECONDS_BEFORE_WARNDefault seconds before warning- See Also:
- Constant Field Values
-
DEFAULT_EXIT_ON_ERROR
public static final boolean DEFAULT_EXIT_ON_ERRORDefault value for exit on error- See Also:
- Constant Field Values
-
-
Constructor Details
-
WorkerPool
public WorkerPool()Creates a new worker pool. -
WorkerPool
public WorkerPool(org.slf4j.Logger logger)Creates a new WorkerPool that will use the passed logger. If null is passed for the logger one will be created for you.- Parameters:
logger
- a logger for the new WorkerPool. If null is passed for the logger one will be created for you.
-
-
Method Details
-
setMaxThreadCount
Sets the maximum number of threads that can be run at once.- Parameters:
maxThreadCount
- the new maximum number of threads that can be run at once.- Returns:
- this - for method chaining.
-
getMaxThreadCount
public int getMaxThreadCount()Returns the current value maxThreadCount- Returns:
- the current value maxThreadCount
-
setSecondsBetweenMsg
Sets the number of seconds between sending status messages. It is not guaranteed that status messages will be sent at exactly the provided time interval, particularly if the interval is less than 30 seconds.- Parameters:
timeBetweenMsg
- seconds between sending status messages while running.- Returns:
- this - for method chaining.
-
getSecondsBetweenMsg
public long getSecondsBetweenMsg()Returns the time between status messages.- Returns:
- the time between status messages.
-
getSecondsBeforeWarn
public long getSecondsBeforeWarn()Returns the time between warning messages.- Returns:
- the time between warning messages.
-
setSecondsBeforeWarn
public void setSecondsBeforeWarn(long secondsBeforeWarn)Sets the number of seconds between sending warning status messages. These messages differ from status messages only that they are sent with a Level of warning.- Parameters:
secondsBeforeWarn
- the new time between warning messages.
-
setNoNewThreadsOnFailure
If set to true then if any threads fail in a pool, no more workers in that pool will be started.- Parameters:
noNewThreadsOnFailure
- the new value for stopAllRunningOnFailure- Returns:
- this - for method chaining.
-
isNoNewThreadsOnFailure
public boolean isNoNewThreadsOnFailure()Returns stopAllRunningOnFailure- Returns:
- stopAllRunningOnFailure
-
isStartNextPoolOnFailure
public boolean isStartNextPoolOnFailure()Returns the value for the property: don't start next pool on failure.- Returns:
- the value for the property: don't start next pool on failure.
-
setStartNextPoolOnFailure
Used to set the value for the property: start next pool on failure. When this is false and either start or startPools is called they will not start the next pool if the previous pool failed. If this is true, then the next pool will start regardless of the status of the last pool.- Parameters:
startNextPoolOnFailure
- the new value for don't start next pool on failure.- Returns:
- this - for method chaining.
-
isExitOnError
public boolean isExitOnError()If true when start, startPools, startAsyncAndJoin, or startOnePool is called at the end of execution of all pools, if the aggregate status for all pools is failure then start will cause System.exit(-1) to be called. If false do nothing- Returns:
- the value for exitOnError
-
setExitOnError
Used to set exitOnError. If true when start, startPools, startAsyncAndJoin, or startOnePool is called at the end of execution of all pools, if the aggregate status for all pools is failure then start will cause System.exit(-1) to be called.- Parameters:
exitOnError
- the value you wish to set for exit on error- Returns:
- this - for method chaining
-
setPools
Allows you to pass a list of the name of all the thread pools you want to create.- Parameters:
poolNames
- a list of the name of all the thread pools you want to create.- Returns:
- this - for method chaining.
-
addPool
Adds a pool of threads. When you create a pool this way you can call the set and add Workers methods that don't require passing a pool name and they will automatically be attached to the last pool you added with this method.- Parameters:
poolName
- the name of a pool you want to create- Returns:
- this - for method chaining.
-
getPoolNames
public java.util.List<java.lang.String> getPoolNames()Returns a copy of the list of poolNames. Because this is a copy, editing this will not effect operations- Returns:
- a copy of the list of poolNames
-
setRetry
For the last pool added sets a number of retry to attempt on a failure and the number of seconds to wait before after a failure before the retry.- Parameters:
retryAttempts
- the number of times you wish to retry the pool in the even of a failureretryWaitSeconds
- the number of seconds to wait after a failure before you retry.rerunSuccess
- if true all workers will be rerun. If false then any workers that already completed with status success will be skipped.- Returns:
- this - for method chaining
-
setRetry
public WorkerPool setRetry(java.lang.String poolName, int retryAttempts, int retryWaitSeconds, boolean rerunSuccess)For the passed poolName added sets a number of retry to attempt on a failure and the number of seconds to wait before after a failure before the retry.- Parameters:
poolName
- the name of the pool you wish to configureretryAttempts
- the number of times you wish to retry the pool in the even of a failureretryWaitSeconds
- the number of seconds to wait after a failure before you retry.rerunSuccess
- if true all workers will be rerun. If false then any workers that already completed with status success will be skipped.- Returns:
- this - for method chaining
-
getRetryAttempt
public int getRetryAttempt(java.lang.String poolName)Returns the number of retry attempts for the passed poolName- Parameters:
poolName
- the pool name you wish to lookup a value for- Returns:
- the number of retry attempts for the passed poolName
-
getRetryWaitSeconds
public int getRetryWaitSeconds(java.lang.String poolName)Returns the number of seconds to wait after a failure to retry- Parameters:
poolName
- the pool name you wish to lookup a value for- Returns:
- the number of seconds to wait after a failure to retry
-
setWorkers
Takes a pool name and a list of worker objects and sets / replaces the entire list of workers associated within that pool- Parameters:
poolName
- the name of the pool you want to attach the list of workers to.workers
- the list of workers you with to set / replace the workers for the pool with- Returns:
- this - for method chaining.
-
setWorkers
Takes a list of worker objects and sets / replaces the entire list of workers associated with the last pool added with addPool- Parameters:
workers
- the list of workers you with to set / replace the workers for the pool with- Returns:
- this - for method chaining.
-
addWorker
Takes a pool name and adds a single worker to the end of that pools list of workers.- Parameters:
poolName
- the name of the pool you want to attach add the worker too.newWorker
- a single worker you wish to add to the pool- Returns:
- this - for method chaining.
-
addWorker
Adds a worker to the end of the pool associated with the last pool added with addPool- Parameters:
newWorker
- a single worker you wish to add to the pool- Returns:
- this - for method chaining.
-
setNotInAll
Sets the last worker added with either the addWorker method to the Not In All list. Workers in the Not In All pool will not be run if ALL arg is passed as the runArg, or no runArg is passed at all. To run these you must explicitly add the name of the name of the worker to the runArg.- Returns:
- this - for method chaining.
-
setNotInAll
Takes a worker's thread name and adds it to the Not In All list. Workers in the Not In All pool will not be run if ALL arg is passed as the runArg, or no runArg is passed at all. To run these you must explicitly add the name of the name of the worker to the runArg.- Parameters:
workerThreadName
- a threadName to add to the Not In All List- Returns:
- this - for method chaining.
-
setThreadName
Used to overwrite the thread name of the previously added worker.- Parameters:
threadName
- The new name for the thread- Returns:
- this - for method chaining
-
prependThreadName
Used to prepend a string to the thread name of the previously added worker.- Parameters:
prepend
- The string you wish to prepend to the thread name- Returns:
- this - for method chaining
-
appendThreadName
Used to append a string to the thread name of the previously added worker.- Parameters:
append
- The string you wish to append to the thread name- Returns:
- this - for method chaining
-
getThreadName
public java.lang.String getThreadName()Returns the thread name of the last worker added.- Returns:
- the thread name of the last worker added
-
setPrecedenceConstraint
Allows you to set the entire precedence constraint of the previously added worker. Pass null to remove any precedence constraints associated with the worker.- Parameters:
precedenceConstraint
- the new precedence constraints you wish the last worker added has.- Returns:
- this - for method chaining
-
addPrecedenceConstraint
Adds a precedence constraint to the last worker added.- Parameters:
precedenceConstraint
- the name of a thread you wish to complete before the last worker starts.- Returns:
- this - for method chaining
-
setPrecedenceConstraint
public WorkerPool setPrecedenceConstraint(java.lang.String threadName, java.util.Set<java.lang.String> precedenceConstraint)Allows you to set the entire precedence constraint of the worker with the passed thread name. Pass null to remove any precedence constraints associated with the worker.- Parameters:
threadName
- The name of the worker you are looking to edit.precedenceConstraint
- the new precedence constraints you wish the last worker added has.- Returns:
- this - for method chaining
-
addPrecedenceConstraint
public WorkerPool addPrecedenceConstraint(java.lang.String threadName, java.lang.String precedenceConstraint)Adds a precedence constraint to the worker with the passed thread name.- Parameters:
threadName
- The name of the worker you are looking to edit.precedenceConstraint
- the new precedence constraints you wish the last worker added has.- Returns:
- this - for method chaining
-
setWorkerRetry
For the last worker added sets a number of retry to attempt on a failure and the number of seconds to wait before after a failure before the retry.- Parameters:
retryAttempts
- the number of times you wish to retry the pool in the even of a failureretryWaitSeconds
- the number of seconds to wait after a failure before you retry.- Returns:
- this - for method chaining
-
setWorkerRetry
public WorkerPool setWorkerRetry(java.lang.String threadName, int retryAttempts, int retryWaitSeconds)For the passed worker added sets a number of retry to attempt on a failure and the number of seconds to wait before after a failure before the retry.- Parameters:
threadName
- the name of the worker you wish to modify.retryAttempts
- the number of times you wish to retry the pool in the even of a failureretryWaitSeconds
- the number of seconds to wait after a failure before you retry.- Returns:
- this - for method chaining
-
getWorker
public WorkerInterface getWorker(java.lang.String threadName) throws java.lang.ArrayIndexOutOfBoundsExceptionTakes a name of a worker that is in any pool, and returns that worker.- Parameters:
threadName
- the name of the Worker you are searching for- Returns:
- the worker, as a WorkerInterface
- Throws:
java.lang.ArrayIndexOutOfBoundsException
- thrown if the threadName is not in any pool
-
setRunArg
Used to control which pools / workers will run. The concept behind this is that when this package is called the user will be able to provide a argument to control what will and will not run in this package. If all is passed everything in the package, not market as "notInAll" will run. If a pool name is passed everything that will act like you passed the name of all workers in that pool. If you put a minus (-) in front of a worker / pool name than that worker / pool will be removed from execution.- Parameters:
runArg
- a list of pool / worker names.- Returns:
- this - for method chaining.
-
setRunArg
Used to control which pools / workers will run. The concept behind this is that when this package is called the user will be able to provide a argument to control what will and will not run in this package. If all is passed everything in the package, not market as "notInAll" will run. If a pool name is passed everything that will act like you passed the name of all workers in that pool. If you put a minus (-) in front of a worker / pool name than that worker / pool will be removed from execution.- Parameters:
runArg
- a list of pool / worker names.- Returns:
- this - for method chaining.
-
start
public WorkerPool start() throws java.lang.InterruptedException, DuplicateThreadNameException, CircularPrecedenceConstraintException, AlreadyRunningExceptionStarts all pools in the order they were added.- Returns:
- this - for method chaining.
- Throws:
java.lang.InterruptedException
- Thrown when a thread is waiting, sleeping, or otherwise occupied, and the thread is interrupted, either before or during the activity.DuplicateThreadNameException
- thrown if any thread name is duplicated, even across poolsCircularPrecedenceConstraintException
- thrown if two workers both list each other as Precedence ConstraintsAlreadyRunningException
- thrown if a pool that is already running is asked to start
-
startAsync
public WorkerPool startAsync() throws AlreadyRunningException, DuplicateThreadNameException, CircularPrecedenceConstraintExceptionStarts all pools at the same time asynchronously. Does not support startNextPoolOnFailure = false, since all pools are started at the same time. Note this does not block execution until it completes for that use startAsyncAndJoin- Returns:
- this - for method chaining.
- Throws:
DuplicateThreadNameException
- thrown if any thread name is duplicated, even across poolsCircularPrecedenceConstraintException
- thrown if two workers both list each other as Precedence ConstraintsAlreadyRunningException
- thrown if a pool that is already running is asked to start
-
startAsyncAndJoin
public WorkerPool startAsyncAndJoin() throws AlreadyRunningException, DuplicateThreadNameException, CircularPrecedenceConstraintException, java.lang.InterruptedExceptionStarts all pools at the same time asynchronously and then blocks execution until they complete. Does not support startNextPoolOnFailure = false, since all pools are started at the same time.- Returns:
- this - for method chaining
- Throws:
AlreadyRunningException
- thrown if a pool that is already running is asked to startDuplicateThreadNameException
- thrown if any thread name is duplicated, even across poolsCircularPrecedenceConstraintException
- thrown if two workers both list each other as Precedence Constraintsjava.lang.InterruptedException
- Thrown when a thread is waiting, sleeping, or otherwise occupied, and the thread is interrupted, either before or during the activity.
-
startOnePool
public WorkerPool startOnePool(java.lang.String poolName) throws java.lang.InterruptedException, DuplicateThreadNameException, CircularPrecedenceConstraintException, AlreadyRunningExceptionStarts the passed pool. Once completed this pool will be removed from the list of pools that will be started with the start method.- Parameters:
poolName
- The name of the pool of workers you wish to run- Returns:
- this - for method chaining.
- Throws:
java.lang.InterruptedException
- Thrown when a thread is waiting, sleeping, or otherwise occupied, and the thread is interrupted, either before or during the activity.DuplicateThreadNameException
- thrown if any thread name is duplicated, even across poolsCircularPrecedenceConstraintException
- thrown if two workers both list each other as Precedence ConstraintsAlreadyRunningException
- thrown if a pool that is already running is asked to start
-
startPools
public WorkerPool startPools(java.lang.String... poolNames) throws DuplicateThreadNameException, CircularPrecedenceConstraintException, java.lang.InterruptedException, AlreadyRunningExceptionStarts the passed pools, running them one at a time in the order they were passed - not added. Once completed these pools will be removed from the list of pools that will be started with the start method.- Parameters:
poolNames
- one or more poolName in a list or a array of poolNames- Returns:
- this - for method chaining
- Throws:
java.lang.InterruptedException
- Thrown when a thread is waiting, sleeping, or otherwise occupied, and the thread is interrupted, either before or during the activity.DuplicateThreadNameException
- thrown if any thread name is duplicated, even across poolsCircularPrecedenceConstraintException
- thrown if two workers both list each other as Precedence ConstraintsAlreadyRunningException
- thrown if a pool that is already running is asked to start
-
startOnePoolAsync
public WorkerPool startOnePoolAsync(java.lang.String poolName) throws AlreadyRunningException, DuplicateThreadNameException, CircularPrecedenceConstraintExceptionStarts the passed pool, without blocking until completion. Once completed this pool will be removed from the list of pools that will be started with the start method.- Parameters:
poolName
- The name of the pool of workers you wish to run- Returns:
- this - for method chaining.
- Throws:
DuplicateThreadNameException
- thrown if any thread name is duplicated, even across poolsCircularPrecedenceConstraintException
- thrown if two workers both list each other as Precedence ConstraintsAlreadyRunningException
- thrown if a pool that is already running is asked to start
-
startPoolsAsync
public WorkerPool startPoolsAsync(java.lang.String... poolNames) throws AlreadyRunningException, DuplicateThreadNameException, CircularPrecedenceConstraintExceptionStarts the passed pools, without blocking until completion. Once started a pool will be removed from the list of pools that will be started with the start method.- Parameters:
poolNames
- one or more poolName in a list or a array of poolNames- Returns:
- this - for method chaining
- Throws:
AlreadyRunningException
- thrown if a pool that is already running is asked to startDuplicateThreadNameException
- thrown if any thread name is duplicated, even across poolsCircularPrecedenceConstraintException
- thrown if two workers both list each other as Precedence Constraints
-
startPoolsAsyncAndJoin
public WorkerPool startPoolsAsyncAndJoin(java.lang.String... poolNames) throws AlreadyRunningException, DuplicateThreadNameException, CircularPrecedenceConstraintException, java.lang.InterruptedExceptionUsed to start multiple pool asynchronous, but then wait for all pools to complete before continuing. This is just a convince function that calls startPoolAysnc followed by joinPools (with 0 from waitMilliseconds).- Parameters:
poolNames
- one or more poolName in a list or a array of poolNames- Returns:
- this - for method chaining
- Throws:
AlreadyRunningException
- thrown if a pool that is already running is asked to startDuplicateThreadNameException
- thrown if any thread name is duplicated, even across poolsCircularPrecedenceConstraintException
- thrown if two workers both list each other as Precedence Constraintsjava.lang.InterruptedException
- Thrown when a thread is waiting, sleeping, or otherwise occupied, and the thread is interrupted, either before or during the activity.
-
joinPool
public WorkerPool joinPool(int waitMilliseconds, java.lang.String poolName) throws java.lang.InterruptedExceptionUsed in conjunction with any of Async methods to block execution until the passed poolName completes or waitMilliseconds elapses. If waitMilliseconds = 0 then it will wait forever for the execution to complete.- Parameters:
waitMilliseconds
- the maximum time this will wait for execution to complete. Pass if you don't want a maximum time.poolName
- The name of the pool you wish wait for.- Returns:
- this - for method chaining
- Throws:
java.lang.InterruptedException
- Thrown if the pool is still running after waitMilliseconds elapsed.
-
joinPools
public WorkerPool joinPools(int waitMilliseconds, java.lang.String... poolNames) throws java.lang.InterruptedExceptionUsed in conjunction with any of Async methods to block execution until the passed poolNames completes or waitMilliseconds elapses. If waitMilliseconds = 0 then it will wait forever for the execution to complete.- Parameters:
waitMilliseconds
- the maximum time this will wait for execution to complete. Pass if you don't want a maximum time.poolNames
- The name of the pools you wish wait for either as a list of parameters or a single array.- Returns:
- this - for method chaining
- Throws:
java.lang.InterruptedException
- Thrown if the pool is still running after waitMilliseconds elapsed.
-
getStatus
Gets the composite status of an entire pool.- Parameters:
poolName
- the name of the pool you want to check- Returns:
- the composite status of the pool
-
getStatus
Gets the composite status of the passed pools.- Parameters:
poolNames
- the name of the pools you want to check- Returns:
- the composite status of the pools
-
getAllStatus
Gets the composite status of all pools.- Returns:
- The composite status of all pools.
-


0.02
The academy was founded on the principles of friendship making, crayon eating and absolute, unregulated, deplorable, degenerate behaviour.
0
SolPunks are NFTs on the Solana blockchain. Each of these 10,000 SolPunks has attributes that make them unique.
0
Aurory is a gaming platform based on the play-to-earn mechanism, a PvE/PvP gaming project using NFTs. 10,000 Aurorians, IDO in October.
0
Dirtypanda Is A Collection Of 8,000 Lazy Badass Pandas Who Cuss And Bitch At Everything. Each Panda Is Unique And They All Eat A Lot!
0
Each frakt is one uniquely generated art piece. There are 5 different types of shapes and 4 color schemes and a limited supply of 10,000 frakts
0
Meerkat Millionaires Country Club Is A Generative Art NFT Series Composed Of 9,999 Hand-Drawn Combinations Of Meerkats.
0
The Bold Badgers Squad is a collection of 10,000 unique Bold Badgers NFT having built their burrow on the Solana blockchain.
0
Galactic Gecko Space Garage is an NFT Social Adventure Club featuring 10,000 warrior turned space racing geckos. “Sponsor” a Galactic Gecko !
0
8,888 uniquely generated and collectible llamas with proof of ownership stored on the Solana blockchain. Purchase from Sollama !


This page will import data from the model.json file and create environment, zone, thing and device objects on the server. You can modify this page to pull data from your own data source.


Copyright © 2011 by The University of Oxford and The Chebfun Developers. Please see the software license for usage restrictions.
The Chebfun system provides "numerical computing with functions." Many familiar MATLAB commands are extended to appropriate interpretations for functions of one variable, and Chebfun often feels symbolic but runs at the speed of numerics. More precisely our vision is to achieve for functions what floating-point arithmetic achieves for numbers: rapid computation in which each successive operation is carried out exactly apart from a rounding error that is very small in relative terms.
For more information about Chebfun, visit www.maths.ox.ac.uk/chebfun/.


The construction of ℝ
using Cauchy sequences of rationals can be generalized to any absolute
value on ℚ
. For any prime p, the completion of ℚ
with repsect to the p-adic norm creates a field
ℚ_p
and a ring ℤ_p
.
padic_norm.lean
defines the p-adic valuation ℤ → ℕ
, extends it to ℚ
, and defines
padic_norm {p} : prime p → ℚ → ℚ
. Note that this does not lead to a useful instance of
has_norm
since p
cannot be inferred from the input, and it is not a norm for
composite p
. padic_norm
is shown to be a non-archimedean absolute value.p
and [fact p.prime]
. padic_rationals.lean
defines ℚ_[p]
as the Cauchy completion of
ℚ
wrt padic_norm p
using the same mechanisms as data/real/basic.lean
. It is immediately a
field. The norm lifts to padic_norm_e : ℚ_[p] → ℚ
, which is cast to ℝ
and gives us a
normed_field
instance. ℚ_[p]
is shown to be Cauchy complete.padic_integers.lean
defines ℤ_[p]
as the subtype {x : ℚ_[p] \\ ∥x∥ ≤ 1}
. It instantiates
local_ring
and normed_ring
and is Cauchy complete.hensel.lean
proves Hensel's lemma over ℤ_[p]
, described by Gouvêa (1997) as the "most
important algebraic property of the p-adic numbers." For F : polynomial ℤ_[p]
and a : ℤ_[p]
with ∥F.eval a∥ < ∥F.derivative.eval a∥^2
, then there exists a unique z
such that
F.eval z = 0 ∧ ∥z - a∥ < ∥F.derivative.eval a∥
; furthermore,
∥F.derivative.eval z∥ = ∥F.derivative.eval a∥
. The proof is an adaptation of
a writeup by Keith Conrad and
uses Newton's method to construct a sequence in ℤ_[p]
converging to the unique solution.


We ensure that all API Engine payment details and transactions adhere to Payment Card Industry Data Security Standards (PCI-DSS) Procedures.


This guide introduces techniques for debugging Ruby on Rails applications.
After reading this guide, you will know:
One common task is to inspect the contents of a variable. In Rails, you can do this with three methods:
debug
to_yaml
inspect
debug
The debug
helper will return a <pre> tag that renders the object using the YAML format. This will generate human-readable data from any object. For example, if you have this code in a view:
~~~html+erb <%= debug @post %>
Title: <%= @post.title %>
You'll see something like this:
~~~yaml
--- !ruby/object:Post
attributes:
updated_at: 2008-09-05 22:55:47
body: It's a very helpful guide for debugging your Rails app.
title: Rails debugging guide
published: t
id: "1"
created_at: 2008-09-05 22:55:47
attributes_cache: {}
Title: Rails debugging guide
to_yaml
Displaying an instance variable, or any other object or method, in YAML format can be achieved this way:
~~~html+erb <%= simple_format @post.to_yaml %>
Title: <%= @post.title %>
The `to_yaml` method converts the method to YAML format leaving it more readable, and then the `simple_format` helper is used to render each line as in the console. This is how `debug` method does its magic.
As a result of this, you will have something like this in your view:
~~~yaml
--- !ruby/object:Post
attributes:
updated_at: 2008-09-05 22:55:47
body: It's a very helpful guide for debugging your Rails app.
title: Rails debugging guide
published: t
id: "1"
created_at: 2008-09-05 22:55:47
attributes_cache: {}
Title: Rails debugging guide
inspect
Another useful method for displaying object values is inspect
, especially when working with arrays or hashes. This will print the object value as a string. For example:
~~~html+erb <%= [1, 2, 3, 4, 5].inspect %>
Title: <%= @post.title %>
Will be rendered as follows:
[1, 2, 3, 4, 5]
Title: Rails debugging guide ~~~
It can also be useful to save information to log files at runtime. Rails maintains a separate log file for each runtime environment.
Rails makes use of the ActiveSupport::Logger
class to write log information. You can also substitute another logger such as Log4r
if you wish.
You can specify an alternative logger in your environment.rb
or any environment file:
Rails.logger = Logger.new(STDOUT) Rails.logger = Log4r::Logger.new("Application Log")
Or in the Initializer
section, add any of the following
config.logger = Logger.new(STDOUT) config.logger = Log4r::Logger.new("Application Log")
TIP: By default, each log is created under Rails.root/log/
and the log file name is environment_name.log
.
When something is logged it’s printed into the corresponding log if the log level of the message is equal or higher than the configured log level. If you want to know the current log level you can call the Rails.logger.level
method.
The available log levels are: :debug
, :info
, :warn
, :error
, :fatal
, and :unknown
, corresponding to the log level numbers from 0 up to 5 respectively. To change the default log level, use
config.log_level = :warn # In any environment initializer, or Rails.logger.level = 0 # at any time
This is useful when you want to log under development or staging, but you don’t want to flood your production log with unnecessary information.
TIP: The default Rails log level is info
in production mode and debug
in development and test mode.
To write in the current log use the logger.(debug|info|warn|error|fatal)
method from within a controller, model or mailer:
logger.debug "Person attributes hash<EMAIL_ADDRESS>logger.info "Processing the request..." logger.fatal "Terminating application, raised unrecoverable error!!!"
Here’s an example of a method instrumented with extra logging:
class PostsController < ApplicationController # ... def create @post = Post.new(params[:post]) logger.debug "New post<EMAIL_ADDRESS>logger.debug "Post should be valid: #{@post.valid?}" if @post.save flash[:notice] = 'Post was successfully created.' logger.debug "The post was saved and now the user is going to be redirected..." redirect_to(@post) else render action: "new" end end # ... end
Here’s an example of the log generated when this controller action is executed:
Processing PostsController#create (for <IP_ADDRESS> at 2008-09-08 11:52:54) [POST]
Session ID: BAh7BzoMY3NyZl9pZCIlMDY5MWU1M2I1ZDRjODBlMzkyMWI1OTg2NWQyNzViZjYiCmZsYXNoSUM6J0FjdGl
vbkNvbnRyb2xsZXI6OkZsYXNoOjpGbGFzaEhhc2h7AAY6CkB1c2VkewA=--b18cd92fba90eacf8137e5f6b3b06c4d724596a4
Parameters: {"commit"=>"Create", "post"=>{"title"=>"Debugging Rails",
"body"=>"I'm learning how to print in logs!!!", "published"=>"0"},
"authenticity_token"=>"2059c1286e93402e389127b1153204e0d1e275dd", "action"=>"create", "controller"=>"posts"}
New post: {"updated_at"=>nil, "title"=>"Debugging Rails", "body"=>"I'm learning how to print in logs!!!",
"published"=>false, "created_at"=>nil}
Post should be valid: true
Post Create (0.000443) INSERT INTO "posts" ("updated_at", "title", "body", "published",
"created_at") VALUES('2008-09-08 14:52:54', 'Debugging Rails',
'I''m learning how to print in logs!!!', 'f', '2008-09-08 14:52:54')
The post was saved and now the user is going to be redirected...
Redirected to #<Post:0x20af760>
Completed in 0.01224 (81 reqs/sec) | DB: 0.00044 (3%) | 302 Found [http://localhost/posts]
Adding extra logging like this makes it easy to search for unexpected or unusual behavior in your logs. If you add extra logging, be sure to make sensible use of log levels to avoid filling your production logs with useless trivia.
When running multi-user, multi-account applications, it’s often useful
to be able to filter the logs using some custom rules. TaggedLogging
in Active Support helps in doing exactly that by stamping log lines with subdomains, request ids, and anything else to aid debugging such applications.
logger = ActiveSupport::TaggedLogging.new(Logger.new(STDOUT)) logger.tagged("BCX") { logger.info "Stuff" } # Logs "[BCX] Stuff" logger.tagged("BCX", "Jason") { logger.info "Stuff" } # Logs "[BCX] [Jason] Stuff" logger.tagged("BCX") { logger.tagged("Jason") { logger.info "Stuff" } } # Logs "[BCX] [Jason] Stuff"
debugger
gemWhen your code is behaving in unexpected ways, you can try printing to logs or the console to diagnose the problem. Unfortunately, there are times when this sort of error tracking is not effective in finding the root cause of a problem. When you actually need to journey into your running source code, the debugger is your best companion.
The debugger can also help you if you want to learn about the Rails source code but don’t know where to start. Just debug any request to your application and use this guide to learn how to move from the code you have written deeper into Rails code.
You can use the debugger
gem to set breakpoints and step through live code in Rails. To install it, just run:
$ gem install debugger
Rails has had built-in support for debugging since Rails 2.0. Inside any Rails application you can invoke the debugger by calling the debugger
method.
Here’s an example:
class PeopleController < ApplicationController def new debugger @person = Person.new end end
If you see this message in the console or logs:
***** Debugger requested, but was not available: Start server with --debugger to enable *****
Make sure you have started your web server with the option --debugger
:
$ rails server --debugger => Booting WEBrick => Rails 3.2.13 application starting on http://<IP_ADDRESS>:3000 => Debugger enabled ...
TIP: In development mode, you can dynamically require \'debugger\'
instead of restarting the server, even if it was started without --debugger
.
As soon as your application calls the debugger
method, the debugger will be started in a debugger shell inside the terminal window where you launched your application server, and you will be placed at the debugger’s prompt (rdb:n)
. The n is the thread number. The prompt will also show you the next line of code that is waiting to run.
If you got there by a browser request, the browser tab containing the request will be hung until the debugger has finished and the trace has finished processing the entire request.
For example:
@posts = Post.all (rdb:7)
Now it’s time to explore and dig into your application. A good place to start is by asking the debugger for help. Type: help
(rdb:7) help
ruby-debug help v0.10.2
Type 'help <command-name>' for help on a specific command
Available commands:
backtrace delete enable help next quit show trace
break disable eval info p reload source undisplay
catch display exit irb pp restart step up
condition down finish list ps save thread var
continue edit frame method putl set tmate where
TIP: To view the help menu for any command use help <command-name>
at the debugger prompt. For example: help var
The next command to learn is one of the most useful: list
. You can abbreviate any debugging command by supplying just enough letters to distinguish them from other commands, so you can also use l
for the list
command.
This command shows you where you are in the code by printing 10 lines centered around the current line; the current line in this particular case is line 6 and is marked by =>
.
(rdb:7) list
[1, 10] in /PathTo/project/app/controllers/posts_controller.rb
1 class PostsController < ApplicationController
2 # GET /posts
3 # GET /posts.json
4 def index
5 debugger
=> 6 @posts = Post.all
7
8 respond_to do |format|
9 format.html # index.html.erb
10 format.json { render :json => @posts }
If you repeat the list
command, this time using just l
, the next ten lines of the file will be printed out.
(rdb:7) l
[11, 20] in /PathTo/project/app/controllers/posts_controller.rb
11 end
12 end
13
14 # GET /posts/1
15 # GET /posts/1.json
16 def show
17 @post = Post.find(params[:id])
18
19 respond_to do |format|
20 format.html # show.html.erb
And so on until the end of the current file. When the end of file is reached, the list
command will start again from the beginning of the file and continue again up to the end, treating the file as a circular buffer.
On the other hand, to see the previous ten lines you should type list-
(or l-
)
(rdb:7) l-
[1, 10] in /PathTo/project/app/controllers/posts_controller.rb
1 class PostsController < ApplicationController
2 # GET /posts
3 # GET /posts.json
4 def index
5 debugger
6 @posts = Post.all
7
8 respond_to do |format|
9 format.html # index.html.erb
10 format.json { render :json => @posts }
This way you can move inside the file, being able to see the code above and over the line you added the debugger
.
Finally, to see where you are in the code again you can type list=
(rdb:7) list=
[1, 10] in /PathTo/project/app/controllers/posts_controller.rb
1 class PostsController < ApplicationController
2 # GET /posts
3 # GET /posts.json
4 def index
5 debugger
=> 6 @posts = Post.all
7
8 respond_to do |format|
9 format.html # index.html.erb
10 format.json { render :json => @posts }
When you start debugging your application, you will be placed in different contexts as you go through the different parts of the stack.
The debugger creates a context when a stopping point or an event is reached. The context has information about the suspended program which enables a debugger to inspect the frame stack, evaluate variables from the perspective of the debugged program, and contains information about the place where the debugged program is stopped.
At any time you can call the backtrace
command (or its alias where
) to print the backtrace of the application. This can be very helpful to know how you got where you are. If you ever wondered about how you got somewhere in your code, then backtrace
will supply the answer.
(rdb:5) where
#0 PostsController.index
at line /PathTo/project/app/controllers/posts_controller.rb:6
#1 Kernel.send
at line /PathTo/project/vendor/rails/actionpack/lib/action_controller/base.rb:1175
#2 ActionController::Base.perform_action_without_filters
at line /PathTo/project/vendor/rails/actionpack/lib/action_controller/base.rb:1175
#3 ActionController::Filters::InstanceMethods.call_filters(chain#ActionController::Fil...,...)
at line /PathTo/project/vendor/rails/actionpack/lib/action_controller/filters.rb:617
...
You move anywhere you want in this trace (thus changing the context) by using the frame _n_
command, where n is the specified frame number.
(rdb:5) frame 2
#2 ActionController::Base.perform_action_without_filters
at line /PathTo/project/vendor/rails/actionpack/lib/action_controller/base.rb:1175
The available variables are the same as if you were running the code line by line. After all, that’s what debugging is.
Moving up and down the stack frame: You can use up [n]
(u
for abbreviated) and down [n]
commands in order to change the context n frames up or down the stack respectively. n defaults to one. Up in this case is towards higher-numbered stack frames, and down is towards lower-numbered stack frames.
The debugger can list, stop, resume and switch between running threads by using the command thread
(or the abbreviated th
). This command has a handful of options:
thread
shows the current thread.thread list
is used to list all threads and their statuses. The plus + character and the number indicates the current thread of execution.thread stop _n_
stop thread n.thread resume _n_
resumes thread n.thread switch _n_
switches the current thread context to n.This command is very helpful, among other occasions, when you are debugging concurrent threads and need to verify that there are no race conditions in your code.
Any expression can be evaluated in the current context. To evaluate an expression, just type it!
This example shows how you can print the instance_variables defined within the current context:
@posts = Post.all
(rdb:11) instance_variables
["@_response", "@action_name", "@url", "@_session", "@_cookies", "@performed_render", "@_flash", "@template", "@_params", "@before_filter_chain_aborted", "@request_origin", "@_headers", "@performed_redirect", "@_request"]
As you may have figured out, all of the variables that you can access from a controller are displayed. This list is dynamically updated as you execute code. For example, run the next line using next
(you’ll learn more about this command later in this guide).
(rdb:11) next
Processing PostsController#index (for <IP_ADDRESS> at 2008-09-04 19:51:34) [GET]
Session ID: BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNoSGFzaHsABjoKQHVzZWR7AA==--b16e91b992453a8cc201694d660147bba8b0fd0e
Parameters: {"action"=>"index", "controller"=>"posts"}
/PathToProject/posts_controller.rb:8
respond_to do |format|
And then ask again for the instance_variables:
(rdb:11) instance_variables.include? "@posts"
true
Now @posts
is included in the instance variables, because the line defining it was executed.
TIP: You can also step into irb mode with the command irb
(of course!). This way an irb session will be started within the context you invoked it. But be warned: this is an experimental feature.
The var
method is the most convenient way to show variables and their values:
var
(rdb:1) v[ar] const <object> show constants of object
(rdb:1) v[ar] g[lobal] show global variables
(rdb:1) v[ar] i[nstance] <object> show instance variables of object
(rdb:1) v[ar] l[ocal] show local variables
This is a great way to inspect the values of the current context variables. For example:
(rdb:9) var local
__dbg_verbose_save => false
You can also inspect for an object method this way:
(rdb:9) var instance Post.new
@attributes = {"updated_at"=>nil, "body"=>nil, "title"=>nil, "published"=>nil, "created_at"...
@attributes_cache = {}
@new_record = true
TIP: The commands p
(print) and pp
(pretty print) can be used to evaluate Ruby expressions and display the value of variables to the console.
You can use also display
to start watching variables. This is a good way of tracking the values of a variable while the execution goes on.
(rdb:1) display @recent_comments
1: @recent_comments =
The variables inside the displaying list will be printed with their values after you move in the stack. To stop displaying a variable use undisplay _n_
where n is the variable number (1 in the last example).
Now you should know where you are in the running trace and be able to print the available variables. But lets continue and move on with the application execution.
Use step
(abbreviated s
) to continue running your program until the next logical stopping point and return control to the debugger.
TIP: You can also use step+ n
and step- n
to move forward or backward n
steps respectively.
You may also use next
which is similar to step, but function or method calls that appear within the line of code are executed without stopping. As with step, you may use plus sign to move n steps.
The difference between next
and step
is that step
stops at the next line of code executed, doing just a single step, while next
moves to the next line without descending inside methods.
For example, consider this block of code with an included debugger
statement:
class Author < ActiveRecord::Base has_one :editorial has_many :comments def find_recent_comments(limit = 10) debugger @recent_comments ||= comments.where("created_at > ?", 1.week.ago).limit(limit) end end
TIP: You can use the debugger while using rails console
. Just remember to require "debugger"
before calling the debugger
method.
$ rails console
Loading development environment (Rails 3.2.13)
>> require "debugger"
=> []
>> author = Author.first
=> #<Author id: 1, first_name: "Bob", last_name: "Smith", created_at: "2008-07-31 12:46:10", updated_at: "2008-07-31 12:46:10">
>> author.find_recent_comments
/PathTo/project/app/models/author.rb:11
)
With the code stopped, take a look around:
(rdb:1) list
[2, 9] in /PathTo/project/app/models/author.rb
2 has_one :editorial
3 has_many :comments
4
5 def find_recent_comments(limit = 10)
6 debugger
=> 7 @recent_comments ||= comments.where("created_at > ?", 1.week.ago).limit(limit)
8 end
9 end
You are at the end of the line, but… was this line executed? You can inspect the instance variables.
(rdb:1) var instance
@attributes = {"updated_at"=>"2008-07-31 12:46:10", "id"=>"1", "first_name"=>"Bob", "las...
@attributes_cache = {}
@recent_comments
hasn’t been defined yet, so it’s clear that this line hasn’t been executed yet. Use the next
command to move on in the code:
(rdb:1) next
/PathTo/project/app/models/author.rb:12
@recent_comments
(rdb:1) var instance
@attributes = {"updated_at"=>"2008-07-31 12:46:10", "id"=>"1", "first_name"=>"Bob", "las...
@attributes_cache = {}
@comments = []
@recent_comments = []
Now you can see that the @comments
relationship was loaded and @recent_comments defined because the line was executed.
If you want to go deeper into the stack trace you can move single steps
, through your calling methods and into Rails code. This is one of the best ways to find bugs in your code, or perhaps in Ruby or Rails.
A breakpoint makes your application stop whenever a certain point in the program is reached. The debugger shell is invoked in that line.
You can add breakpoints dynamically with the command break
(or just b
). There are 3 possible ways of adding breakpoints manually:
break line
: set breakpoint in the line in the current source file.break file:line [if expression]
: set breakpoint in the line number inside the file. If an expression is given it must evaluated to true to fire up the debugger.break class(.|\#)method [if expression]
: set breakpoint in method (. and # for class and instance method respectively) defined in class. The expression works the same way as with file:line.(rdb:5) break 10
Breakpoint 1 file /PathTo/project/vendor/rails/actionpack/lib/action_controller/filters.rb, line 10
Use info breakpoints _n_
or info break _n_
to list breakpoints. If you supply a number, it lists that breakpoint. Otherwise it lists all breakpoints.
(rdb:5) info breakpoints
Num Enb What
1 y at filters.rb:10
To delete breakpoints: use the command delete _n_
to remove the breakpoint number n. If no number is specified, it deletes all breakpoints that are currently active..
(rdb:5) delete 1
(rdb:5) info breakpoints
No breakpoints.
You can also enable or disable breakpoints:
enable breakpoints
: allow a list breakpoints or all of them if no list is specified, to stop your program. This is the default state when you create a breakpoint.disable breakpoints
: the breakpoints will have no effect on your program.The command catch exception-name
(or just cat exception-name
) can be used to intercept an exception of type exception-name when there would otherwise be is no handler for it.
To list all active catchpoints use catch
.
There are two ways to resume execution of an application that is stopped in the debugger:
continue
[line-specification] (or c
): resume program execution, at the address where your script last stopped; any breakpoints set at that address are bypassed. The optional argument line-specification allows you to specify a line number to set a one-time breakpoint which is deleted when that breakpoint is reached.finish
[frame-number] (or fin
): execute until the selected stack frame returns. If no frame number is given, the application will run until the currently selected frame returns. The currently selected frame starts out the most-recent frame or 0 if no frame positioning (e.g up, down or frame) has been performed. If a frame number is given it will run until the specified frame returns.Two commands allow you to open code from the debugger into an editor:
edit [file:line]
: edit file using the editor specified by the EDITOR environment variable. A specific line can also be given.tmate _n_
(abbreviated tm
): open the current file in TextMate. It uses n-th frame if n is specified.To exit the debugger, use the quit
command (abbreviated q
), or its alias exit
.
A simple quit tries to terminate all threads in effect. Therefore your server will be stopped and you will have to start it again.
The debugger
gem can automatically show the code you’re stepping through and reload it when you change it in an editor. Here are a few of the available options:
set reload
: Reload source code when changed.set autolist
: Execute list
command on every breakpoint.set listsize _n_
: Set number of source lines to list by default to n.set forcestep
: Make sure the next
and step
commands always move to a new lineYou can see the full list by using help set
. Use help set _subcommand_
to learn about a particular set
command.
TIP: You can save these settings in an .rdebugrc
file in your home directory. The debugger reads these global settings when it starts.
Here’s a good start for an .rdebugrc
:
set autolist set forcestep set listsize 25
A Ruby application (on Rails or not), can leak memory - either in the Ruby code or at the C code level.
In this section, you will learn how to find and fix such leaks by using tool such as Valgrind.
Valgrind is a Linux-only application for detecting C-based memory leaks and race conditions.
There are Valgrind tools that can automatically detect many memory management and threading bugs, and profile your programs in detail. For example, a C extension in the interpreter calls malloc()
but is doesn’t properly call free()
, this memory won’t be available until the app terminates.
For further information on how to install Valgrind and use with Ruby, refer to Valgrind and Ruby by Evan Weaver.
There are some Rails plugins to help you to find errors and debug your application. Here is a list of useful plugins for debugging:


Base moneyfield
model value: {{ model }} is number = {{ isNumber }}
Base moneyfield with a limit of 9 999,99$
Base moneyfield with initialized model
value should be: {{ definedModel }}
Label
Placeholder
Required
Waiting
Disabled
Read only
Messages
Static error (default)
Helper message
Valid message
Sizes
max-width should be set at none to override default settings
Tag style
Localization


area
Power (W)
Energy (J)
Energy (%)
stack
step
Smoothing
Show IPC graph
Power (W)
Time (µs)
Smoothing
IPC
Time (µs)


We extend services!
- revolutionize proactive users
- grow transparent applications
- syndicate turn-key convergence
- seize back-end e-business
- enhance turn-key interfaces
- enable seamless web services
- embrace end-to-end initiatives
- enhance 24/7 initiatives
- facilitate out-of-the-box e-commerce
- whiteboard plug-and-play paradigms
- facilitate e-business niches
- maximize e-business e-services
- generate customized schemas
- mesh open-source portals


Trigonometry is a branch of mathematics that deal with angles, lengths and heights of triangles and relations between different parts of circles and other geometrical figures. Maths Formulas – Trigonometric Ratios and identities are very useful and learning the below formulae help in solving the problems better. Trigonometry formulas are essential for solving questions in Trigonometry Ratios and Identities in Competitive Exams.
Trigonometric Identities are equalities that involve trigonometric functions and are
true for every value of the occurring variables where both
sides of the equality are defined. Geometrically, these are
identities involving certain functions of one or more angles.
Trigonometric Ratio relationship between the measurement of the angles and the length of the side of the right triangle. These formulas relate lengths and areas of particular circles or triangles. On the next page you’ll find identities. The identities don’t refer to particular geometric figures but hold for all angles.
Formulas for arcs and sectors of circles
You can easily find both the length of an arc and the area of a sector for an angle θ in a circle of radius r.
Length of an arc. The length of the arc is just the radius r times the angle θ where the angle is measured in radians. To convert from degrees to radians, multiply the number of degrees by π/180.
Arc = rθ.
Trigonometric Formulas – Right Angle
The most important formulas for trigonometry are those for a right triangle. If θ is one of the acute angles in a triangle, then the sine of theta is the ratio of the opposite side to the hypotenuse, the cosine is the ratio of the adjacent side to the hypotenuse, and the tangent is the ratio of the opposite side to the adjacent side
Pythagorean theorem, the well-known geometric theorem that the sum of the squares on the legs of a right triangle is equal to the square on the hypotenuse (the side opposite the right angle)—or, in familiar algebraic notation, (P)2 + (B)2 = (H)2
Applying Pythagoras theorem for the given right-angled theorem, we have:
(Perpendicular)2 + (Base)2 = (Hypotenuse)2
⇒ (P)2 + (B)2 = (H)2
- tan(x) = sin(x) / cos(x)
- sin(x) = cos(x) / cot(x)
- cos(x) = cot(x) / csc(x)
- cot(x) = csc(x) / sec(x)
- csc(x) = sec(x) / tan(x)
- sec(x) = tan(x) / sin(x)
- cos(x) = sin(x) / tan(x)
- sin(x) = tan(x) / sec(x)
- tan(x) = sec(x) / csc(x)
- sec(x) = csc(x) / cot(x)
- csc(x) = cot(x) / cos(x)
- cot(x) = cos(x) / sin(x)
Trigonometric Formulas PDF
Let us assume an angle of θ1 lying in the 1st quadrant and an
angle θ in quadrant one and two combined.
So let us see how signs change with respect to the quadrant
they lie in.
- In Q1 all Trigonometric Ratios are positive. (Angles between 00 – 900)
- In Q2 all trigonometric ratios of sinθ and cosecθ are positive. (Angles between 900 – 1800)
- In Q3 all trigonometric ratios of cosθ and secθ are positive. (Angles between 1800 – 2700)
- In Q4 all trigonometric ratios of tanθ and cotθ are positive. (Angles between 2700 – 3600)
θ is the angle made between the x-axis and the line, in the anti-clockwise direction. If we move in the clockwise direction, the angle will be taken as – θ. We know that in quadrant 4, only cosθ and secθ will be positive, the others will be negative, therefore-
- Sin (– θ) = – Sin θ
- Cos (– θ) = Cos θ
- Tan (– θ) =– Tan θ
- Sec (– θ) = + Sec θ
- Cot (– θ) = – Cot θ
We need to understand that trigonometric ratios would change for angles- 90o ± θ and 270o ± θ and they will remain same for 180o ± θ and 360o ± θ. Let’s see what happens when we add or subtract θ from 90o ± θ and 270o ± θ
- Sec (90o + θ ) = Cos θ
- Cot (90o – θ ) = Cos θ
- Tan (90o + θ ) = – Cot θ
- Tan (90o – θ ) = Cot θ
- Sec (90o + θ ) = Cosec θ
- Sec (90o + θ ) = Cosec θ
- Sin (270o – θ ) = – Cos θ
- Sin (270o – θ ) = – Cos θ
This is because any angle that is 2700+θ will fall in quadrant
4 and in this quadrant only trigonometric ratios of cos
and sec are positive. So the above will be negative. 2700-θ
will fall in the quadrant 3 and in this quadrant trigonometric
ratios of tan and cot are positive, so it will again be
negative. For 180o ± θ and for
360o ± θ, the signs will remain
the same.
- Sin (360o + θ ) = Sin θ
- Sin (360o – θ ) = – Sin θ
For 3600+θ, the angle will complete one full rotation and then lie in quadrant 1 where all trigonometric ratios are positive. So there are 2 important things to remember-
- The sign of the trigonometric ratios change based on the value of θ.
-
sin becomes cos and cos becomes sin for 900+θ and for
2700+θ and it remains the same for 1800+θ
and for 3600+θ.
Trigonometry Formulas | Trigonometric Identities
After looking at the trigonometric ratios, let us move on to trigonometric identities, which are the basics of most trigonometry formulas. The above identities hold true for any value of θ.


Journey of
[ Silicon Valley ]
Presented by : Mostafa Kamal & Jamal Uddin
.
.
.
.
Tech Lover & Coder
About
- San Francisco , California ,US
- Silicon Valley (person)
- Tech Industrial Town
- Most Favorite IT company
- Population is around 4 million
- Highest median house prices in the US
- 28% of jobs are in high-tech
- 15% more men than women
Tour
- DAC TO SFO
- 20h (1 stop)
- $2000(round trip)
- Accomodations($100-$150 per night)
Transport
- 4 independet rail system
- ride sharing
- car sharing
- bike sharing
Tech environment
- auto drive car
- drones
- robots
- bitcoin
Event
- Hackathons
- Meetup
- conference
- google i/o
- Apple developer conf.
Accomodations
- costy
- metropolitan area
- Coworking Spaces
- Hackerspaces
culture
- friendly
- geeky
- Hobby(drone,chess,gaming)
- HBO(media)
[ Dhaka Might Be Silicon Valley ]
@code4mk


Class SWActiveRecordBehavior
- statusAttribute (string) : This is the column name where status is
stored
If this attribute doesn't exist for a model, the Workflow behavior is automatically disabled and a warning is logged.
In the database, this attribute must be defined as a VARCHAR() whose length should be large enough to contains a complete status name with format workflowId/nodeId.
example :task/pending postWorkflow/to_review
Default : 'status' - defaultWorkflow (string) : workflow name that should be used by
default for the owner model
If this parameter is not set, then it is automatically created based on the name of the owner model, prefixed with 'workflowNamePrefix' defined by the workflow source component. By default this value is set to 'sw' and so, for example 'Model1' is associated by default with workflow 'swModel1'.
Default : SWWorkflowSource->workflowNamePrefix . ModelName - autoInsert (boolean) :
If TRUE, the model is automatically inserted in the workflow (if not already done) when it is saved. If FALSE, it is developer responsability to insert the model in the workflow.
Default : true - workflowSourceComponent (string) :
Name of the workflow source component to use with this behavior.
By ddefault this parameter is set to swSource (seeSWPhpWorkflowSource
) - enableEvent (boolean) :
If TRUE, this behavior will fire SWEvents. Note that even if it is true, this doesn't garantee that SW events will be fired as another condition is that the owner component provides SWEvent handlers.
Default : true - transitionBeforeSave (boolean) :
If TRUE, SWEvents are fired and possible transitions tasks are executed before the owner model is actually saved. If FALSE, events and task transitions are processed after save.
It has no effect if the transition is done programatically by a call to swNextStatus(), but only if it is done when the owner model is saved.
Default : true
- CBehavior
- SWActiveRecordBehavior
Methods summary
public
reference
|
|
protected
boolean
|
#
canFireEvent( CComponent $owner, string $className )
Checks that the owner component is able to handle workflow events that could be fired by this behavior |
public
|
#
swGetStatus( )
If the owner component is inserted into a workflow, this method returns the SWNode object that represent this status, otherwise NULL is returned. |
public
boolean
|
#
swIsEventEnabled( )
Event may be enabled by configuration (when the behavior is attached to the
owner component) but it can be automatically disabled if the owner component
does not define handlers for all SWEvents (i.e events fired when the owner
component evolves in the workflow). |
public
|
#
swIsStatus( mixed $status )
Test if the owner component is currently in the status passed as argument. |
public
boolean
|
#
swStatusEquals( mixed $status = null )
Test if the current status is the same as the one passed as argument. A call to swStatusEquals(null) returns TRUE only if the owner component is not in a workflow. |
public
boolean
|
#
swHasStatus( )
Test if the owner component is currently inserted in a workflow. This method is equivalent to swGetStatus()!=null. |
public
|
#
swGetWorkflowId( )
Returns the current workflow Id the owner component is inserted in, or NULL if the owner component is not inserted into a workflow. |
public
|
#
attach( mixed $owner )
Overloads parent attach method so at the time the behavior is about to be
attached to the owner component, the behavior is initialized.
During the initialisation, following actions are performed:
|
public
string
|
#
swGetDefaultWorkflowId( )
Finds out what should be the default workflow to use with the owner model. To
find out what is the default workflow, this method perform following tests :
|
public
boolean
|
#
swInsertToWorkflow( string $workflowId = null )
Insert the owner component into the workflow whose id is passed as argument. If NULL is passed as argument, the default workflow is used. If no error occurs, when this method ends, the owner component's status is the initial node of the selected workflow. |
public
|
#
swRemoveFromWorkflow( )
Removes the owner component from its current workflow. An exception is thrown if the owner model is not in a final status (i.e a status with no outgoing transition). |
public
array
|
#
swGetNextStatus( )
This method returns a list of nodes that can be actually reached at the time the method is called. To be reachable, a transition must exist between the current status and the next status, AND if a constraint is defined, it must be evaluated to true. |
public
array
|
#
swGetAllStatus( )
Returns all statuses belonging to the workflow the owner component is inserted in or is related to. If the owner component is not inserted in a workflow or related to no workflow, an empty array is returned. |
public
boolean
|
#
swIsNextStatus( mixed $nextStatus )
Checks if the status passed as argument can be reached from the current status.
This occurs when
|
public
|
#
swCreateNode( string $str )
Creates a new node from the string passed as argument. If $str doesn't contain a workflow Id, this method uses the workflowId associated with the owner model. The node created here doesn't have to exist within a workflow. This method is mainly used by the SWValidator |
public
boolean
|
#
swIsFinalStatus( status $status = null )
Checks if the status passed as argument, or the current status (if NULL is passed) is a final status of the corresponding workflow. By definition a final status as no outgoing transition to other status. |
public
boolean
|
#
swIsInitialStatus( mixed $status = null )
Checks if the status passed as argument, or the current status (if NULL is passed) is the initial status of the corresponding workflow. An exception is raised if the owner model is not in a workflow and if $status is null. |
public
boolean
|
#
swValidate( string $attribute, mixed $value )
Validates the status attribute stored in the owner model. This attribute is
valid if :
|
public
boolean
|
#
swSetStatus( mixed $nextStatus, mixed $params = null )
Set the owner component into the status passed as argument. If a transition could be performed, the owner status attribute is updated with the new status value in the form workflowId/nodeId. This method is responsible for firing SWEvents and executing workflow tasks if defined for the given transition. |
public
|
#
events( )
Attach event handlers. The behavior registers its own mandatory event handlers
in case the owner model is a CActiveRecord instance.
|
public
boolean
|
#
beforeSave( Event $event )
Depending on the value of the owner status attribute, and the current status, this method performs an actual transition. |
public
|
|
public
|
|
public
|
#
enterWorkflow(
Default implementation for the onEnterWorkflow event. |
public
|
#
onEnterWorkflow(
This event is raised after the record instance is inserted into a workflow. This may occur at construction time (new) if the behavior is initialized with autoInsert set to TRUE and in this case, the 'onEnterWorkflow' event is always fired. Consequently, when a model instance is created from database (find), the onEnterWorkflow is fired even if the record has already be inserted in a workflow (e.g contains a valid status). |
public
|
#
leaveWorkflow(
Default implementation for the onEnterWorkflow event. |
public
|
#
onLeaveWorkflow(
This event is raised after the record instance is removed from a workflow. This occures when the owner status attribut is set to NULL, for instance by calling $c->swNextStatus() |
public
|
#
beforeTransition(
Default implementation for the onBeforeTransition event. |
public
|
#
onBeforeTransition(
This event is raised before a workflow transition is applied to the owner instance. |
public
|
#
processTransition(
Default implementation for the onProcessTransition event. |
public
|
#
onProcessTransition(
This event is raised when a workflow transition is in progress. In such case,
the user may define a handler for this event in order to run specific
process. |
public
|
#
afterTransition(
Default implementation for the onAfterTransition event. |
public
|
#
onAfterTransition(
This event is raised after the onProcessTransition is fired. It is the last
event fired during a non-final transition. |
public
|
#
finalStatus(
Default implementation for the onFinalStatus event. |
public
|
#
onFinalStatus(
This event is raised at the end of a transition, when the destination status is a final status (i.e the owner model has reached a status from where it will not be able to move). |
Magic methods summary
Constants summary
string |
SW_LOG_CATEGORY
|
'application.simpleWorkflow' |
|
string |
SW_I8N_CATEGORY
|
'simpleworkflow' |
Properties summary
public
string
|
$statusAttribute |
#
This is the column name where status is stored. |
public
string
|
$defaultWorkflow |
#
workflow name that should be used by default for the owner model. |
public
boolean
|
$autoInsert | |
public
string
|
$workflowSourceComponent |
#
name of the workflow source component |
public
boolean
|
$enableEvent | |
public
boolean
|
$transitionBeforeSave | |
protected
string
|
$eventClassName |
#
name of the class the owner should inherit from in order for SW events to be enabled. |


{{Other uses}} {{Redirect|Pennoni|the college|Pennoni Honors College}} {{Infobox prepared food | name = Penne | image = | caption = Whole wheat penne rigate, uncooked (left) and cooked (right) | alternate_name = | country = Italy | region = | creator = | course = | type = Pasta | served = | main_ingredient = | variations = Penne lisce, penne rigate, pennoni, mostaccioli | calories = | other = }}
Penne ({{IPA-it|ˈpenːe}}) is a type of pasta with cylinder-shaped pieces. Penne is the plural form of the Italian penna, deriving from Latin penna (meaning "feather" or "quill"), and is a cognate of the English word pen.
Contents |
In Italy, penne are produced in two main variants: "penne lisce" (smooth) and "penne rigate" (furrowed), the latter having ridges on each penna. There is also pennoni ("big quills"), which is a wider version of penne.<ref>{{cite web|url=http://www.thenibble.com/REVIEWS/MAIN/pastas/glossary6.asp |title=Pasta Shapes |publisher=Thenibble.com |date= |accessdate=2013-02-21}}</ref>
In United States the same or similar shape, usually slightly larger, is called mostaccioli (meaning "little mustache" in some Italian dialects; it can also be either smooth or ridged in texture).<ref>{{cite web|url=http://pasta-products-creamette.newworldpasta.com/Mostaccioli-Rigati-ZX00151000025501CT00ZX15 |title=Creamette - Our Products - Mostaccioli Rigati |publisher=Pasta-products-creamette.newworldpasta.com |date= |accessdate=2013-02-21}}</ref>
Penne is traditionally cooked al dente and served with pasta sauces such as pesto, marinara, or arrabbiata. Penne is a popular ingredient in pasta salads. Penne is a versatile pasta for many applications because of its practical design; the hollow center and ridges allow it to hold sauce, while the angular ends act as scoops.{{Original research?|date=February 2013}}
{{reflist}}
{{Commons category|Penne}}
{{Pasta}}


?6
7
8
9
10
The
New
York
copyright
reserved
botanical
Garden
THE
NEW
YORK
BOTANICAL
GARDEN
EXPLORATION
OF
CUBA
NORTH
lllr
PROVINCE
OF
PlNAR
DEL
RlO
""W/CAN
Bahia
Honda
to
El
Rosario
/ÀÀ4-Of
v'
-/l
À
ÀO’,!
'
J.
A.
Shafer,
Colleotor
January
29,
isij
NO
D
O
.
BY
MILDRED
E.
MATHIAS
01501044
Legend -
Level of confidence that token is an accurately-transcribed word
extremely low
very low
low
undetermined
medium
high
very high


The document node
Encoding of the loaded XML document
List of errors occurred.
Whether there were error occurred while loading the XML document.
The root element node
Adds the given namespace declaration to the specified node, or root node if no node is given.
Load XML from the given string. The encoding
parameter must be correct.
Passes through to given node's lookupNamespaceURI()
, and back track to
ancestors if not found in the node.
Passes through to given node's lookupPrefix()
, and back track to
ancestors if not found in the node.
Converts the XML document to string according to given options. Defaults to pretty print and keeps comment.
Generated using TypeDoc
A wrapper over xmldom-ts. There are some convenient methods.
There are many gaps between the standard DOM feature set provided by browsers. I've tried to modify the original
xmldom-ts
package but failed. The original project doesn't provide apackage-lock.json
.tsc
spills a whole lot of errors on it.


| Modifier and Type | Class and Description |
|---|---|
class |
Vote
Class for combining classifiers.
|
| Modifier and Type | Class and Description |
|---|---|
class |
InputMappedClassifier
Wrapper classifier that addresses incompatible
training and test data by building a mapping between the training data that a
classifier has been built with and the incoming test instances' structure.
|
| Modifier and Type | Class and Description |
|---|---|
class |
AbstractFileLoader
Abstract superclass for all file loaders.
|
class |
AbstractFileSaver
Abstract class for Savers that save to a file
Valid options are:
-i input arff file
The input filw in arff format. |
class |
ArffLoader
Reads a source that is in arff (attribute relation
file format) format.
|
class |
ArffSaver
Writes to a destination in arff text format.
|
class |
C45Loader
Reads a file that is C45 format.
|
class |
C45Saver
Writes to a destination that is in the format used
by the C4.5 algorithm.
|
class |
CSVLoader
Reads a source that is in comma separated format (the default).
|
class |
CSVSaver
Writes to a destination that is in CSV
(comma-separated values) format.
|
class |
DatabaseLoader
Reads Instances from a Database.
|
class |
DatabaseSaver
Writes to a database (tested with MySQL, InstantDB,
HSQLDB).
|
class |
DictionarySaver
Writes a dictionary constructed from string
attributes in incoming instances to a destination.
|
class |
JSONLoader
Reads a source that is in the JSON format.
|
class |
JSONSaver
Writes to a destination that is in JSON format.
|
class |
LibSVMLoader
Reads a source that is in libsvm format.
|
class |
LibSVMSaver
Writes to a destination that is in libsvm format.
|
class |
MatlabLoader
Reads a Matlab file containing a single matrix in ASCII format.
|
class |
MatlabSaver
Writes Matlab ASCII files, in single or double
precision format.
|
class |
SerializedInstancesLoader
Reads a source that contains serialized Instances.
|
class |
SerializedInstancesSaver
Serializes the instances to a file with extension bsi.
|
class |
SVMLightLoader
Reads a source that is in svm light format.
|
class |
SVMLightSaver
Writes to a destination that is in svm light
format.
|
class |
XRFFLoader
Reads a source that is in the XML version of the ARFF format.
|
class |
XRFFSaver
Writes to a destination that is in the XML version
of the ARFF format.
|
| Modifier and Type | Class and Description |
|---|---|
class |
AddUserFields
A filter that adds new attributes with user
specified type and constant value.
|
class |
FixedDictionaryStringToWordVector
Converts String attributes into a set of attributes
representing word occurrence (depending on the tokenizer) information from
the text contained in the strings.
|
class |
OrdinalToNumeric
An attribute filter that converts ordinal nominal attributes into numeric ones
|
class |
ReplaceMissingWithUserConstant
Replaces all missing values for nominal, string,
numeric and date attributes in the dataset with user-supplied constant
values.
|
| Modifier and Type | Class and Description |
|---|---|
class |
EnvironmentField
Widget that displays a label and a combo box for selecting environment
variables.
|
class |
FileEnvironmentField
Widget that displays a label, editable combo box for selecting environment
variables and a button for brining up a file browser.
|
class |
PropertySheetPanel
Displays a property sheet where (supported) properties of the target object
may be edited.
|
| Modifier and Type | Class and Description |
|---|---|
class |
Associator
Bean that wraps around weka.associations.
|
class |
AttributeSummarizer
Bean that encapsulates displays bar graph summaries for attributes in a data
set.
|
class |
AttributeSummarizerCustomizer
GUI customizer for attribute summarizer.
|
class |
Classifier
Bean that wraps around weka.classifiers
|
class |
ClassifierCustomizer
GUI customizer for the classifier wrapper bean
|
class |
DataVisualizer
Bean that encapsulates weka.gui.visualize.VisualizePanel
|
class |
DataVisualizerCustomizer
GUI customizer for data visualizer.
|
class |
FlowByExpression
A bean that splits incoming instances (or instance streams) according to the
evaluation of a logical expression.
|
class |
FlowByExpressionCustomizer
Customizer for the FlowByExpression node
|
class |
ImageSaver
Component that can accept ImageEvents and save their encapsulated
images to a file.
|
class |
ImageSaverCustomizer
Customizer for the ImageSaver component.
|
class |
Join |
class |
JoinCustomizer
Customizer component for the Join step
|
class |
Loader
Loads data sets using weka.core.converter classes
|
class |
LoaderCustomizer
GUI Customizer for the loader bean
|
class |
ModelPerformanceChart
Bean that can be used for displaying threshold curves (e.g.
|
class |
ModelPerformanceChartCustomizer
GUI customizer for model performance chart.
|
class |
Saver
Saves data sets using weka.core.converter classes
|
class |
SaverCustomizer
GUI Customizer for the saver bean
|
class |
ScatterPlotMatrix
Bean that encapsulates weka.gui.visualize.MatrixPanel for displaying a
scatter plot matrix.
|
class |
SerializedModelSaver
A bean that saves serialized models
|
class |
SerializedModelSaverCustomizer
GUI Customizer for the SerializedModelSaver bean
|
class |
Sorter
Sorts incoming instances in ascending or descending
order according to the values of user specified attributes.
|
class |
SorterCustomizer
Customizer for the Sorter step
|
class |
SubstringLabeler
A bean that finds matches in string attribute values (using either substring
or regular expression matches) and labels the instance (sets the value of a
new attribute) according to the supplied label for the matching rule.
|
class |
SubstringLabelerCustomizer
Customizer class for the Substring labeler step
|
class |
SubstringLabelerRules
Manages a list of match rules for labeling strings.
|
class |
SubstringReplacer
A bean that can replace substrings in the values of string attributes.
|
class |
SubstringReplacerCustomizer
Customizer for the SubstringReplacer
|
class |
SubstringReplacerRules
Manages a list of match and replace rules for replacing values in string
attributes
|
class |
TextSaver
Simple component to save the text carried in text events out to a file
|
class |
TextSaverCustomizer
Customizer for the TextSaver component.
|
| Modifier and Type | Class and Description |
|---|---|
class |
AddUserFieldsCustomizer
Customizer for the AddUserFields filter.
|
| Modifier and Type | Class and Description |
|---|---|
class |
GOEStepEditorDialog
A step editor dialog that uses the GOE mechanism to provide property editors.
|
class |
StepEditorDialog
Base class for step editor dialogs.
|
| Modifier and Type | Class and Description |
|---|---|
class |
ASEvaluatorStepEditorDialog
Step editor dialog for the ASEvaluator step
|
class |
AttributeSummarizerStepEditorDialog
Step editor dialog for the attribute summarizer step
|
class |
BlockStepEditorDialog
Step editor dialog for the Block step
|
class |
BoundaryPlotterStepEditorDialog
Editor dialog for the boundary plotter step
|
class |
ClassAssignerStepEditorDialog
Step editor dialog for the ClassAssigner step
|
class |
ClassifierPerformanceEvaluatorStepEditorDialog
GUI step editor dialog for the ClassifierPerformanceEvaluator step
|
class |
ClassValuePickerStepEditorDialog
Editor dialog for the ClassValuePicker step.
|
class |
DataGridStepEditorDialog
Step editor dialog for the data grid
|
class |
DataVisualizerStepEditorDialog
Editor dialog for the DataVisualizer step
|
class |
ExecuteProcessStepEditorDialog
Step editor dialog for the ExecuteProcess step
|
class |
FlowByExpressionStepEditorDialog
Step editor dialog for the FlowByExpression step
|
class |
JobStepEditorDialog
Editor dialog for the Job step.
|
class |
JoinStepEditorDialog
Step editor dialog for the Join step
|
class |
LoaderStepEditorDialog
Provides a custom editor dialog for Loaders.
|
class |
ModelPerformanceChartStepEditorDialog
Step editor dialog for the ModelPerformanceChart step
|
class |
NoteEditorDialog
Editor dialog for Notes
|
class |
SaverStepEditorDialog
Editor dialog for the saver step
|
class |
SendToPerspectiveStepEditorDialog
Dialog for the SendToPerspective step
|
class |
SetVariablesStepEditorDialog
Editor dialog for the
SetVariables step |
class |
SorterStepEditorDialog
Step editor dialog for the Sorter step
|
class |
StorePropertiesInEnvironmentStepEditorDialog
Editor dialog for the StorePropertiesInEnvironment step.
|
class |
SubstringLabelerStepEditorDialog
Step editor dialog for the SubstringLabeler step
|
class |
SubstringReplacerStepEditorDialog
Step editor dialog for the SubstringReplacer step
|
Copyright © 2018 University of Waikato, Hamilton, NZ. All Rights Reserved.


--- # # By default, content added below the "---" mark will appear in the home page # between the top bar and the list of recent posts. # To change the home page layout, edit the _layouts/home.html file. # See: https://jekyllrb.com/docs/themes/#overriding-theme-defaults # published: false layout: default title: Blog description: Mark Fleming's practical marketing solutions and strategies for content, digital, analytics, and marketing automation. image: assets/web-image.jpg --- {% if site.paginate %} {% assign posts = paginator.posts %} {% else %} {% assign posts = site.posts %} {% endif %}
{%- if site.show_excerpts -%} {{ post.excerpt }} {%- endif -%}


Papers
The following list is also available as an ADS library.
- Christe et al. 2016: FOXSI-2: Upgrades of the Focusing Optics X-ray Solar Imager for its Second Flight
-
Ishikawa et al. 2014: Development of double-sided silicon strip detectors for solar hard x-ray observation
-
Krucker et al. 2014: First Images from the Focusing Optics X-Ray Solar Imager
-
Krucker et al. 2013: The focusing optics x-ray solar imager (FOXSI): instrument and first flight
- Krucker et al. 2011: The Focusing Optics X-ray Solar Imager (FOXSI)
Support or Contact
If you have questions please use the following .


{% extends "templates/partials/base.html" %}
{% block title %}{% parent %} - 404{% endblock %}
{% block content %}
We couldn't find anything at this url.
But maybe you'd like to look at our projects?
{% set returnTo = {to: 'Home', url: '/'} %}
{% include 'templates/partials/prefooter.html' %}
{% endblock %}


TAL error-handling
The TAL on-error attribute provides a mechanism to handle errors in rendering, avoiding a complete failure to render a page. A parallel in many programming languages is a try/catch construct.
Syntax
tal:on-error="MODE EXPRESSION"
The MODE
& EXPRESSION
parts of an on-error statement work identically to
a tal:content
attribute. All that differs is the method of
invocation.
Invoking an error handler
If an unhandled error is encountered whilst rendering a page with TAL, an on-error attribute is searched in the current element (where the error was raised). If it is found then it is used, treated like a TAL content attribute. If no on-error attribute is found then the parent element is searched, and so on moving upwards through the hierarchy through the element's ancestors.
In the example below, if an error was raised whilst evaluating the TALES expression
Model/CurrentUser/Name
then the entire paragraph would be replaced with
There was a problem determining your log-in status. If, on the other hand, that evaluated
successfully but there was en error whilst evaluating Model/CurrentUser/GetProfileUrl
then the
hyperlink text would be replaced with Error! Cannot get profile URL but the paragraph itself would
still be rendered.

You are logged in as
Joseph Bloggs.

Your profile


About
Costa Rica extends majestically from the Pacific Ocean to the Caribbean Sea, and its distance is barely 200 miles.
Here, visitors enjoy lovely tropical beaches, grand adventures, the wonders of nature, and scintillating culture; all the necessary components of an ideal vacation. No wonder, thousands have made Costa Rica their top travel choice!
Text taken for demo purposes from the Costa Rica Tourism Board site. By all means, do feel free to visit if you wish.
Featured picture is by Ford Quarterman, in Playa Barrigona, Costa Rica.