|
JavaTM 2 Platform Standard Ed. 5.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.logging.Logger
public class Logger
A Logger object is used to log messages for a specific system or application component. Loggers are normally named, using a hierarchical dot-separated namespace. Logger names can be arbitrary strings, but they should normally be based on the package name or class name of the logged component, such as java.net or javax.swing. In addition it is possible to create "anonymous" Loggers that are not stored in the Logger namespace.
Logger objects may be obtained by calls on one of the getLogger factory methods. These will either create a new Logger or return a suitable existing Logger.
Logging messages will be forwarded to registered Handler objects, which can forward the messages to a variety of destinations, including consoles, files, OS logs, etc.
Each Logger keeps track of a "parent" Logger, which is its nearest existing ancestor in the Logger namespace.
Each Logger has a "Level" associated with it. This reflects a minimum Level that this logger cares about. If a Logger's level is set to null, then its effective level is inherited from its parent, which may in turn obtain it recursively from its parent, and so on up the tree.
The log level can be configured based on the properties from the logging configuration file, as described in the description of the LogManager class. However it may also be dynamically changed by calls on the Logger.setLevel method. If a logger's level is changed the change may also affect child loggers, since any child logger that has null as its level will inherit its effective level from its parent.
On each logging call the Logger initially performs a cheap check of the request level (e.g. SEVERE or FINE) against the effective log level of the logger. If the request level is lower than the log level, the logging call returns immediately.
After passing this initial (cheap) test, the Logger will allocate a LogRecord to describe the logging message. It will then call a Filter (if present) to do a more detailed check on whether the record should be published. If that passes it will then publish the LogRecord to its output Handlers. By default, loggers also publish to their parent's Handlers, recursively up the tree.
Each Logger may have a ResourceBundle name associated with it. The named bundle will be used for localizing logging messages. If a Logger does not have its own ResourceBundle name, then it will inherit the ResourceBundle name from its parent, recursively up the tree.
Most of the logger output methods take a "msg" argument. This msg argument may be either a raw value or a localization key. During formatting, if the logger has (or inherits) a localization ResourceBundle and if the ResourceBundle has a mapping for the msg string, then the msg string is replaced by the localized value. Otherwise the original msg string is used. Typically, formatters use java.text.MessageFormat style formatting to format parameters, so for example a format string "{0} {1}" would format two parameters as strings.
When mapping ResourceBundle names to ResourceBundles, the Logger will first try to use the Thread's ContextClassLoader. If that is null it will try the SystemClassLoader instead. As a temporary transition feature in the initial implementation, if the Logger is unable to locate a ResourceBundle from the ContextClassLoader or SystemClassLoader the Logger will also search up the class stack and use successive calling ClassLoaders to try to locate a ResourceBundle. (This call stack search is to allow containers to transition to using ContextClassLoaders and is likely to be removed in future versions.)
Formatting (including localization) is the responsibility of the output Handler, which will typically call a Formatter.
Note that formatting need not occur synchronously. It may be delayed until a LogRecord is actually written to an external sink.
The logging methods are grouped in five main categories:
There are a set of "log" methods that take a log level, a message string, and optionally some parameters to the message string.
There are a set of "logp" methods (for "log precise") that are like the "log" methods, but also take an explicit source class name and method name.
There are a set of "logrb" method (for "log with resource bundle") that are like the "logp" method, but also take an explicit resource bundle name for use in localizing the log message.
There are convenience methods for tracing method entries (the "entering" methods), method returns (the "exiting" methods) and throwing exceptions (the "throwing" methods).
Finally, there are a set of convenience methods for use in the very simplest cases, when a developer simply wants to log a simple string at a given log level. These methods are named after the standard Level names ("severe", "warning", "info", etc.) and take a single argument, a message string.
For the methods that do not take an explicit source name and method name, the Logging framework will make a "best effort" to determine which class and method called into the logging method. However, it is important to realize that this automatically inferred information may only be approximate (or may even be quite wrong!). Virtual machines are allowed to do extensive optimizations when JITing and may entirely remove stack frames, making it impossible to reliably locate the calling class and method.
All methods on Logger are multi-thread safe.
Subclassing Information: Note that a LogManager class may provide its own implementation of named Loggers for any point in the namespace. Therefore, any subclasses of Logger (unless they are implemented in conjunction with a new LogManager class) should take care to obtain a Logger instance from the LogManager class and should delegate operations such as "isLoggable" and "log(LogRecord)" to that instance. Note that in order to intercept all logging output, subclasses need only override the log(LogRecord) method. All the other logging methods are implemented as calls on this log(LogRecord) method.
| Field Summary | |
|---|---|
static Logger |
global
The "global" Logger object is provided as a convenience to developers who are making casual use of the Logging package. |
| Constructor Summary | |
|---|---|
protected |
Logger(String name,
String resourceBundleName)
Protected method to construct a logger for a named subsystem. |
| Method Summary | |
|---|---|
void |
addHandler(Handler handler)
Add a log Handler to receive logging messages. |
void |
config(String msg)
Log a CONFIG message. |
void |
entering(String sourceClass,
String sourceMethod)
Log a method entry. |
void |
entering(String sourceClass,
String sourceMethod,
Object param1)
Log a method entry, with one parameter. |
void |
entering(String sourceClass,
String sourceMethod,
Object[] params)
Log a method entry, with an array of parameters. |
void |
exiting(String sourceClass,
String sourceMethod)
Log a method return. |
void |
exiting(String sourceClass,
String sourceMethod,
Object result)
Log a method return, with result object. |
void |
fine(String msg)
Log a FINE message. |
void |
finer(String msg)
Log a FINER message. |
void |
finest(String msg)
Log a FINEST message. |
static Logger |
getAnonymousLogger()
Create an anonymous Logger. |
static Logger |
getAnonymousLogger(String resourceBundleName)
Create an anonymous Logger. |
Filter |
getFilter()
Get the current filter for this Logger. |
Handler[] |
getHandlers()
Get the Handlers associated with this logger. |
Level |
getLevel()
Get the log Level that has been specified for this Logger. |
static Logger |
getLogger(String name)
Find or create a logger for a named subsystem. |
static Logger |
getLogger(String name,
String resourceBundleName)
Find or create a logger for a named subsystem. |
String |
getName()
Get the name for this logger. |
Logger |
getParent()
Return the parent for this Logger. |
ResourceBundle |
getResourceBundle()
Retrieve the localization resource bundle for this logger for the current default locale. |
String |
getResourceBundleName()
Retrieve the localization resource bundle name for this logger. |
boolean |
getUseParentHandlers()
Discover whether or not this logger is sending its output to its parent logger. |
void |
info(String msg)
Log an INFO message. |
boolean |
isLoggable(Level level)
Check if a message of the given level would actually be logged by this logger. |
void |
log(Level level,
String msg)
Log a message, with no arguments. |
void |
log(Level level,
String msg,
Object param1)
Log a message, with one object parameter. |
void |
log(Level level,
String msg,
Object[] params)
Log a message, with an array of object arguments. |
void |
log(Level level,
String msg,
Throwable thrown)
Log a message, with associated Throwable information. |
void |
log(LogRecord record)
Log a LogRecord. |
void |
logp(Level level,
String sourceClass,
String sourceMethod,
String msg)
Log a message, specifying source class and method, with no arguments. |
void |
logp(Level level,
String sourceClass,
String sourceMethod,
String msg,
Object param1)
Log a message, specifying source class and method, with a single object parameter to the log message. |
void |
logp(Level level,
String sourceClass,
String sourceMethod,
String msg,
Object[] params)
Log a message, specifying source class and method, with an array of object arguments. |
void |
logp(Level level,
String sourceClass,
String sourceMethod,
String msg,
Throwable thrown)
Log a message, specifying source class and method, with associated Throwable information. |
void |
logrb(Level level,
String sourceClass,
String sourceMethod,
String bundleName,
String msg)
Log a message, specifying source class, method, and resource bundle name with no arguments. |
void |
logrb(Level level,
String sourceClass,
String sourceMethod,
String bundleName,
String msg,
Object param1)
Log a message, specifying source class, method, and resource bundle name, with a single object parameter to the log message. |
void |
logrb(Level level,
String sourceClass,
String sourceMethod,
String bundleName,
String msg,
Object[] params)
Log a message, specifying source class, method, and resource bundle name, with an array of object arguments. |
void |
logrb(Level level,
String sourceClass,
String sourceMethod,
String bundleName,
String msg,
Throwable thrown)
Log a message, specifying source class, method, and resource bundle name, with associated Throwable information. |
void |
removeHandler(Handler handler)
Remove a log Handler. |
void |
setFilter(Filter newFilter)
Set a filter to control output on this Logger. |
void |
setLevel(Level newLevel)
Set the log level specifying which message levels will be logged by this logger. |
void |
setParent(Logger parent)
Set the parent for this Logger. |
void |
setUseParentHandlers(boolean useParentHandlers)
Specify whether or not this logger should send its output to it's parent Logger. |
void |
severe(String msg)
Log a SEVERE message. |
void |
throwing(String sourceClass,
String sourceMethod,
Throwable thrown)
Log throwing an exception. |
void |
warning(String msg)
Log a WARNING message. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final Logger global
The global logger is initialized by calling Logger.getLogger("global").
| Constructor Detail |
|---|
protected Logger(String name, String resourceBundleName)
The logger will be initially configured with a null Level and with useParentHandlers true.
name
- A name for the logger. This should
be a dot-separated name and should normally
be based on the package name or class name
of the subsystem, such as java.net
or javax.swing. It may be null for anonymous Loggers.resourceBundleName
- name of ResourceBundle to be used for localizing
messages for this logger. May be null if none
of the messages require localization.
MissingResourceException
- if the ResourceBundleName is non-null and
no corresponding resource can be found.| Method Detail |
|---|
public static Logger getLogger(String name)
If a new logger is created its log level will be configured based on the LogManager configuration and it will configured to also send logging output to its parent's handlers. It will be registered in the LogManager global namespace.
name
- A name for the logger. This should
be a dot-separated name and should normally
be based on the package name or class name
of the subsystem, such as java.net
or javax.swing
NullPointerException
- if the name is null.public static Logger getLogger(String name, String resourceBundleName)
If a new logger is created its log level will be configured based on the LogManager and it will configured to also send logging output to its parent loggers Handlers. It will be registered in the LogManager global namespace.
If the named Logger already exists and does not yet have a localization resource bundle then the given resource bundle name is used. If the named Logger already exists and has a different resource bundle name then an IllegalArgumentException is thrown.
name
- A name for the logger. This should
be a dot-separated name and should normally
be based on the package name or class name
of the subsystem, such as java.net
or javax.swingresourceBundleName
- name of ResourceBundle to be used for localizing
messages for this logger. May be null
if none of
the messages require localization.
MissingResourceException
- if the named ResourceBundle cannot be found.
IllegalArgumentException
- if the Logger already exists and uses
a different resource bundle name.
NullPointerException
- if the name is null.public static Logger getAnonymousLogger()
This factory method is primarily intended for use from applets. Because the resulting Logger is anonymous it can be kept private by the creating class. This removes the need for normal security checks, which in turn allows untrusted applet code to update the control state of the Logger. For example an applet can do a setLevel or an addHandler on an anonymous Logger.
Even although the new logger is anonymous, it is configured to have the root logger ("") as its parent. This means that by default it inherits its effective level and handlers from the root logger.
public static Logger getAnonymousLogger(String resourceBundleName)
This factory method is primarily intended for use from applets. Because the resulting Logger is anonymous it can be kept private by the creating class. This removes the need for normal security checks, which in turn allows untrusted applet code to update the control state of the Logger. For example an applet can do a setLevel or an addHandler on an anonymous Logger.
Even although the new logger is anonymous, it is configured to have the root logger ("") as its parent. This means that by default it inherits its effective level and handlers from the root logger.
resourceBundleName
- name of ResourceBundle to be used for localizing
messages for this logger.
May be null if none of the messages require localization.
MissingResourceException
- if the named ResourceBundle cannot be found.public ResourceBundle getResourceBundle()
public String getResourceBundleName()
public void setFilter(Filter newFilter) throws SecurityException
After passing the initial "level" check, the Logger will call this Filter to check if a log record should really be published.
newFilter
- a filter object (may be null)
SecurityException
- if a security manager exists and if
the caller does not have LoggingPermission("control").public Filter getFilter()
public void log(LogRecord record)
All the other logging methods in this class call through this method to actually perform any logging. Subclasses can override this single method to capture all log activity.
record
- the LogRecord to be publishedpublic void log(Level level, String msg)
If the logger is currently enabled for the given message level then the given message is forwarded to all the registered output Handler objects.
level
- One of the message level identifiers, e.g. SEVEREmsg
- The string message (or a key in the message catalog)public void log(Level level, String msg, Object param1)
If the logger is currently enabled for the given message level then a corresponding LogRecord is created and forwarded to all the registered output Handler objects.
level
- One of the message level identifiers, e.g. SEVEREmsg
- The string message (or a key in the message catalog)param1
- parameter to the messagepublic void log(Level level, String msg, Object[] params)
If the logger is currently enabled for the given message level then a corresponding LogRecord is created and forwarded to all the registered output Handler objects.
level
- One of the message level identifiers, e.g. SEVEREmsg
- The string message (or a key in the message catalog)params
- array of parameters to the messagepublic void log(Level level, String msg, Throwable thrown)
If the logger is currently enabled for the given message level then the given arguments are stored in a LogRecord which is forwarded to all registered output handlers.
Note that the thrown argument is stored in the LogRecord thrown property, rather than the LogRecord parameters property. Thus is it processed specially by output Formatters and is not treated as a formatting parameter to the LogRecord message property.
level
- One of the message level identifiers, e.g. SEVEREmsg
- The string message (or a key in the message catalog)thrown
- Throwable associated with log message.public void logp(Level level, String sourceClass, String sourceMethod, String msg)
If the logger is currently enabled for the given message level then the given message is forwarded to all the registered output Handler objects.
level
- One of the message level identifiers, e.g. SEVEREsourceClass
- name of class that issued the logging requestsourceMethod
- name of method that issued the logging requestmsg
- The string message (or a key in the message catalog)public void logp(Level level, String sourceClass, String sourceMethod, String msg, Object param1)
If the logger is currently enabled for the given message level then a corresponding LogRecord is created and forwarded to all the registered output Handler objects.
level
- One of the message level identifiers, e.g. SEVEREsourceClass
- name of class that issued the logging requestsourceMethod
- name of method that issued the logging requestmsg
- The string message (or a key in the message catalog)param1
- Parameter to the log message.public void logp(Level level, String sourceClass, String sourceMethod, String msg, Object[] params)
If the logger is currently enabled for the given message level then a corresponding LogRecord is created and forwarded to all the registered output Handler objects.
level
- One of the message level identifiers, e.g. SEVEREsourceClass
- name of class that issued the logging requestsourceMethod
- name of method that issued the logging requestmsg
- The string message (or a key in the message catalog)params
- Array of parameters to the messagepublic void logp(Level level, String sourceClass, String sourceMethod, String msg, Throwable thrown)
If the logger is currently enabled for the given message level then the given arguments are stored in a LogRecord which is forwarded to all registered output handlers.
Note that the thrown argument is stored in the LogRecord thrown property, rather than the LogRecord parameters property. Thus is it processed specially by output Formatters and is not treated as a formatting parameter to the LogRecord message property.
level
- One of the message level identifiers, e.g. SEVEREsourceClass
- name of class that issued the logging requestsourceMethod
- name of method that issued the logging requestmsg
- The string message (or a key in the message catalog)thrown
- Throwable associated with log message.public void logrb(Level level, String sourceClass, String sourceMethod, String bundleName, String msg)
If the logger is currently enabled for the given message level then the given message is forwarded to all the registered output Handler objects.
The msg string is localized using the named resource bundle. If the resource bundle name is null, or an empty String or invalid then the msg string is not localized.
level
- One of the message level identifiers, e.g. SEVEREsourceClass
- name of class that issued the logging requestsourceMethod
- name of method that issued the logging requestbundleName
- name of resource bundle to localize msg,
can be nullmsg
- The string message (or a key in the message catalog)public void logrb(Level level, String sourceClass, String sourceMethod, String bundleName, String msg, Object param1)
If the logger is currently enabled for the given message level then a corresponding LogRecord is created and forwarded to all the registered output Handler objects.
The msg string is localized using the named resource bundle. If the resource bundle name is null, or an empty String or invalid then the msg string is not localized.
level
- One of the message level identifiers, e.g. SEVEREsourceClass
- name of class that issued the logging requestsourceMethod
- name of method that issued the logging requestbundleName
- name of resource bundle to localize msg,
can be nullmsg
- The string message (or a key in the message catalog)param1
- Parameter to the log message.public void logrb(Level level, String sourceClass, String sourceMethod, String bundleName, String msg, Object[] params)
If the logger is currently enabled for the given message level then a corresponding LogRecord is created and forwarded to all the registered output Handler objects.
The msg string is localized using the named resource bundle. If the resource bundle name is null, or an empty String or invalid then the msg string is not localized.
level
- One of the message level identifiers, e.g. SEVEREsourceClass
- name of class that issued the logging requestsourceMethod
- name of method that issued the logging requestbundleName
- name of resource bundle to localize msg,
can be null.msg
- The string message (or a key in the message catalog)params
- Array of parameters to the messagepublic void logrb(Level level, String sourceClass, String sourceMethod, String bundleName, String msg, Throwable thrown)
If the logger is currently enabled for the given message level then the given arguments are stored in a LogRecord which is forwarded to all registered output handlers.
The msg string is localized using the named resource bundle. If the resource bundle name is null, or an empty String or invalid then the msg string is not localized.
Note that the thrown argument is stored in the LogRecord thrown property, rather than the LogRecord parameters property. Thus is it processed specially by output Formatters and is not treated as a formatting parameter to the LogRecord message property.
level
- One of the message level identifiers, e.g. SEVEREsourceClass
- name of class that issued the logging requestsourceMethod
- name of method that issued the logging requestbundleName
- name of resource bundle to localize msg,
can be nullmsg
- The string message (or a key in the message catalog)thrown
- Throwable associated with log message.public void entering(String sourceClass, String sourceMethod)
This is a convenience method that can be used to log entry to a method. A LogRecord with message "ENTRY", log level FINER, and the given sourceMethod and sourceClass is logged.
sourceClass
- name of class that issued the logging requestsourceMethod
- name of method that is being enteredpublic void entering(String sourceClass, String sourceMethod, Object param1)
This is a convenience method that can be used to log entry to a method. A LogRecord with message "ENTRY {0}", log level FINER, and the given sourceMethod, sourceClass, and parameter is logged.
sourceClass
- name of class that issued the logging requestsourceMethod
- name of method that is being enteredparam1
- parameter to the method being enteredpublic void entering(String sourceClass, String sourceMethod, Object[] params)
This is a convenience method that can be used to log entry to a method. A LogRecord with message "ENTRY" (followed by a format {N} indicator for each entry in the parameter array), log level FINER, and the given sourceMethod, sourceClass, and parameters is logged.
sourceClass
- name of class that issued the logging requestsourceMethod
- name of method that is being enteredparams
- array of parameters to the method being enteredpublic void exiting(String sourceClass, String sourceMethod)
This is a convenience method that can be used to log returning from a method. A LogRecord with message "RETURN", log level FINER, and the given sourceMethod and sourceClass is logged.
sourceClass
- name of class that issued the logging requestsourceMethod
- name of the methodpublic void exiting(String sourceClass, String sourceMethod, Object result)
This is a convenience method that can be used to log returning from a method. A LogRecord with message "RETURN {0}", log level FINER, and the gives sourceMethod, sourceClass, and result object is logged.
sourceClass
- name of class that issued the logging requestsourceMethod
- name of the methodresult
- Object that is being returnedpublic void throwing(String sourceClass, String sourceMethod, Throwable thrown)
This is a convenience method to log that a method is terminating by throwing an exception. The logging is done using the FINER level.
If the logger is currently enabled for the given message level then the given arguments are stored in a LogRecord which is forwarded to all registered output handlers. The LogRecord's message is set to "THROW".
Note that the thrown argument is stored in the LogRecord thrown property, rather than the LogRecord parameters property. Thus is it processed specially by output Formatters and is not treated as a formatting parameter to the LogRecord message property.
sourceClass
- name of class that issued the logging requestsourceMethod
- name of the method.thrown
- The Throwable that is being thrown.public void severe(String msg)
If the logger is currently enabled for the SEVERE message level then the given message is forwarded to all the registered output Handler objects.
msg
- The string message (or a key in the message catalog)public void warning(String msg)
If the logger is currently enabled for the WARNING message level then the given message is forwarded to all the registered output Handler objects.
msg
- The string message (or a key in the message catalog)public void info(String msg)
If the logger is currently enabled for the INFO message level then the given message is forwarded to all the registered output Handler objects.
msg
- The string message (or a key in the message catalog)public void config(String msg)
If the logger is currently enabled for the CONFIG message level then the given message is forwarded to all the registered output Handler objects.
msg
- The string message (or a key in the message catalog)public void fine(String msg)
If the logger is currently enabled for the FINE message level then the given message is forwarded to all the registered output Handler objects.
msg
- The string message (or a key in the message catalog)public void finer(String msg)
If the logger is currently enabled for the FINER message level then the given message is forwarded to all the registered output Handler objects.
msg
- The string message (or a key in the message catalog)public void finest(String msg)
If the logger is currently enabled for the FINEST message level then the given message is forwarded to all the registered output Handler objects.
msg
- The string message (or a key in the message catalog)public void setLevel(Level newLevel) throws SecurityException
If the new level is null, it means that this node should inherit its level from its nearest ancestor with a specific (non-null) level value.
newLevel
- the new value for the log level (may be null)
SecurityException
- if a security manager exists and if
the caller does not have LoggingPermission("control").public Level getLevel()
public boolean isLoggable(Level level)
level
- a message logging level
public String getName()
public void addHandler(Handler handler) throws SecurityException
By default, Loggers also send their output to their parent logger. Typically the root Logger is configured with a set of Handlers that essentially act as default handlers for all loggers.
handler
- a logging Handler
SecurityException
- if a security manager exists and if
the caller does not have LoggingPermission("control").public void removeHandler(Handler handler) throws SecurityException
Returns silently if the given Handler is not found or is null
handler
- a logging Handler
SecurityException
- if a security manager exists and if
the caller does not have LoggingPermission("control").public Handler[] getHandlers()
public void setUseParentHandlers(boolean useParentHandlers)
useParentHandlers
- true if output is to be sent to the
logger's parent.
SecurityException
- if a security manager exists and if
the caller does not have LoggingPermission("control").public boolean getUseParentHandlers()
public Logger getParent()
This method returns the nearest extant parent in the namespace. Thus if a Logger is called "a.b.c.d", and a Logger called "a.b" has been created but no logger "a.b.c" exists, then a call of getParent on the Logger "a.b.c.d" will return the Logger "a.b".
The result will be null if it is called on the root Logger in the namespace.
public void setParent(Logger parent)
It should not be called from application code.
parent
- the new parent logger
SecurityException
- if a security manager exists and if
the caller does not have LoggingPermission("control").
|
JavaTM 2 Platform Standard Ed. 5.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 2004, 2010 Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.


Spot Instance Request. More...
Public Member Functions | |
| (id) | - init |
| Default constructor for a new object. | |
| (void) | - addTag: |
| Adds a single object to tags. | |
| (NSString *) | - description |
| Returns a string representation of this object; useful for testing and debugging. | |
Properties | |
| NSString * | spotInstanceRequestId |
| NSString * | spotPrice |
| NSString * | type |
| NSString * | state |
| EC2SpotInstanceStateFault * | fault |
| NSDate * | validFrom |
| NSDate * | validUntil |
| NSString * | launchGroup |
| NSString * | availabilityZoneGroup |
| EC2LaunchSpecification * | launchSpecification |
| NSString * | instanceId |
| NSDate * | createTime |
| NSString * | productDescription |
| NSMutableArray * | tags |
| A list of tags for this spot instance request. |
Spot Instance Request.
| - (void EC2SpotInstanceRequest.)addTag: | (EC2Tag *) | tag |
Adds a single object to tags.
This function will alloc and init tags if not already done.
| - (NSString * EC2SpotInstanceRequest.)description |
Returns a string representation of this object; useful for testing and debugging.
| - (id EC2SpotInstanceRequest.)init |
Default constructor for a new object.
Callers should use the property methods to initialize this object after creating it.
- (NSString *) type [read, write, retain] |
Constraints:
Allowed Values: one-time, persistent


property Pattern: TCustomBitmap32;
This property determines the pattern that is used to fill a polygon. The pattern will be tiled across the polygons.
Please note that the draw transformation won't have any effect on the polygon. For that purpose please preprocess your pattern accordingly.


Waters: Trump Is 'Hurting Our Country,' 'Destroying the Presidency' | Breitbart
by Pam KeyOn Sunday’s broadcast of MSNBC’s “AM Joy,” Rep. Maxine Waters (D-CA) accused President Donald Trump and his cabinet of “hurting” the country.
On the Trump administration, Waters said, “I am going to be so happy when they’re all out of here. They are hurting our country. They are undermining our democracy, and they’re being very destructive. I hope the American people can see that if we allow this president and his cabinet to get away of what they are doing, they will be destroying the presidency and that office forever.”
Follow Pam Key on Twitter @pamkeyNEN


Sunday's Shows
Monday's Shows
Tuesday's Shows
Wednesday's Shows
Thursday's Shows
Friday's Shows
Saturday's Shows


Unity3D, C#, C++, C, Shader Lab: Cg/HLSL, Android Studios, java, javascript, python, MATLAB.
Indian Institute of Technology (IIT) Kanpur.
June 2013-July 2017
Science, Anime, Manga, Violin, Painting, Games, Arts and Craft, Music, Keyboard Piano, Writing, Reading.
Game Programmer
I am Neeraj S.Thakur, graduate from IIT Kanpur. I am a game programmer and developer; On path of becoming a game designer. If you liked my work (I like you already), let's get in contact.
<EMAIL_ADDRESS>+91<PHONE_NUMBER>
+91<PHONE_NUMBER>
Ever since I was a kid, I love Arts and Craft. I did a lot origami and made various wire structures and plastic toys in my spare time. I love listening to music. I started playing violin recently. I follow a number of sci-fi and fantasy genre movies and television shows (Have you watched Supernatural?). I am also an aspiring writer and written some short stories and blogs.
I love knowing new people and discussing about new technical advancements in game industry. If you are also a gaming enthusiast, we could probably talk for hours discussing about unique game mechanics (Portal or Monument Valley?).
Around here, we don't look backwards for very long. We KEEP MOVING FORWARD, opening up new doors and doing new things because we're curious and curiosity keeps leading us down new paths
-Walter E. Disney


Enter Vimeo ID or vimeo URL :
Enter spreadsheet URL (by clicking on "file>publish on the web" in GSpreadsheet) :
Enter your interview's tab name :


Change city
Contact Us
Work
Entertainment
Style
Food
☰
Alternative hangouts for women
Written by you, for you!
Latest articles...
Top 10 Places to Work in London
Top 10 Cool Museums in London
10 Exciting New Place to Eat in London
Previous
Next


START!
We use our advanced machine learning algorithms, including Neural Networks to provide you better results
If 67% write 6.7
Example:If 67% write 6.7
Example: Data Science, Machine Learning, IoT, Cloud Computing, Android Development, IOS


Home
Time Management
About Us
Login
-->
HealthDemic
We are an organization dedicated to make life easier during this dreadful Pandemic.


|
io.github.snarks.reactivestore.utils.Empty |
The status when a cache or store has nothing in it
|
|
io.github.snarks.reactivestore.utils.Failed |
The status when the loading had failed
|
|
io.github.snarks.reactivestore.utils.LoadStatus |
Represents the status of a cache or store
|
|
io.github.snarks.reactivestore.utils.Loaded |
The status when the cache or store has something in it
|
|
io.github.snarks.reactivestore.utils.Loading |
The status when a cache or store is currently loading something
|
|
io.github.snarks.reactivestore.utils.PendingStatus |
Statuses that are meant to be just temporary
|
|
io.github.snarks.reactivestore.caches.ReactiveCache |
An observable container that loads and stores a single value
|
|
io.github.snarks.reactivestore.stores.ReactiveStore |
An observable container that loads and stores multiple values
|
|
io.github.snarks.reactivestore.caches.SimpleCache |
A basic implementation of ReactiveCache
|
|
io.github.snarks.reactivestore.stores.SimpleStore |
A basic implementation of ReactiveStore
|
|
io.github.snarks.reactivestore.utils.StableStatus |
Statuses where there's no pending action in the store or cache
|
|
io.github.snarks.reactivestore.utils.Updater |
A function that transitions one LoadStatus to the next
|
|
io.github.snarks.reactivestore.utils.Updaters |
Provides commonly used Updater implementations
|


{% extends "errors/error.html" %} {% block error %}
You've uploaded something just too big for your own good. No thanks! {{message}}


Core War is a programming PC game firstly introduced in 1984. In the game, two or more battle programs (or we call them "warriors") compete for control of one virtual computer. These warriors are written in an abstract assembly language called Redcode, which is designed for Core War particularly. Therefore fundamental knowledge of assembly language programming is required to play this game.
At the beginning of a game, each battle program is loaded into memory at a random location, after which each program executes one instruction in turn. The objective of the game is to cause the processes of opposing programs to terminate (which happens if they execute an invalid instruction), leaving the victorious program in sole possession of the machine.
Our mission is to bring the game into the mobile era, allowing broader access for knowing, studying and playing this game.
To narrow down the software functionality, we considered various user cases and sketched out personas which represent two typical categories of target users: Core War novice and veteran.
As there are no mobile adaptations of the game on either Android or iOS platforms so far, we need to seek our own way for game to develop on the mobile end. The classic version of Core War contains considerable settings as well as functionalities, which give rise to great development complexity and difficulty. Considering the fact that not all the functionalities are necessary for all players, and that we have a time constraint, we decided to simplify the game while keeping its essential logics. To get a better understanding of the game and make a decision on which settings should be remained or removed, we studied the previous software by exmaining and investigating Core War players for advice. Following are two programs of Core War on PC.
The main features of the game was first determinted based on the suggestions from experienced Core War players as well as the user cases above. We developed three versions of the prototype in total. They evolved alongside with the development process. The clickable prototype is made using Keynote with its nice animation.


BDD in JavaScript V: CucumberJS and The Browser, II
2014 February 12th by todd anderson
"Whoa. Whoa. Whoa.
In the previous article I addressed the available libraries and practices to have your CucumberJS specs running in a browser environment, as well as introduced a new project begun by me: cucumberjs-browser.
I had originally had the entirety of this post in the previous post, but felt that it was a little bit of information overload. As such, I decided to split them into two posts.
The intent of this article is to address incorporating cucumberjs-browser into our current Grocery List Application example and continue developing features that involve User Interaction with the DOM.
> code
Supported files related to this and any subsequent posts on this topic will be available at:
https://github.com/bustardcelly/cucumberjs-examples
cucumberjs-browser
The cucumberjs-browser CLI tool was created to provide a means in which to write my Features, Step Definitions and support files as I normally would for a project, and bundle them to be run in a browser and provide custom reporting.
First order of business for incorporating the cucumberjs-browser tool into the Grocery List applicaiton project we have been working through in this series is to install the tool:
$npm install -g cucumberjs-browser
(you may need to sudo
)
That should install the tool and now be accessible from the command line. The README is the best place to find the most up-to-date infromation about the tool, but the general usage is as follows:
$ cucumberjs-browser [-o outdir] [-f format] [--tmpl template] [--features features]
We'll get into how we will use it with our project and the options in a bit, but before then...
Fail first
In a pervious article in this series, we added an add-item
feature that detailed the scenarios of adding and accessible an item from a collection of the Grocery List application. This is still a valid logical feature that normally I would not modify to incorporate User Interaction when incorporating Features related to the application being browser-based. Instead, I would create a new Feature that details how a User can add and view new item in a browser environment.
Let's define our spec:
/features/add-item-view.feature
Feature: Shopper can add and view new item in Grocery List
As a shopper using the browser-based app
I want to add an item to my grocery list view
So that I can remember to buy that item at the grocery store
Background: Grocery List Application is Open
Given I have opened the grocery list application
Scenario: Submit of valid item adds item to list
Given I have an empty grocery list view
When I provide a valid grocery list item name
And I select to add an item
Then The item is added to the grocery list view
Scenario: Submit of valid item adds item to collection
Given I have an empty grocery list view
When I provide a valid grocery list item name
And I select to add an item
Then The item is accessible from the grocery list collection
We have declared two Scenarios that define the Feature criteria in which a User interacts with DOM elements to add and view a new item to the Grocery List application.
Running that produces the expected undefined
steps notification:
$ npm run test
.UUU.UUUU.UUUU........
4 scenarios (2 undefined, 2 passed)
21 steps (10 undefined, 11 passed)
Given I have an empty grocery list view
We have a few things we need to address, but before we get into the nitty-gritty, let's turn this red in true TDD fashion while filling out our API expectation of the Given in each of the Scenarios
_/features/stepdefinitions/add-item-view.steps.js
var assert = require('assert');
module.exports = function() {
'use strict';
this.World = require('../support/world').World;
this.Given(/^I have an empty grocery list view$/, function(callback) {
this.emptyGroceryListView();
assert.equal(this.getGroceryListView().childNodes.length, 0);
callback();
});
});
$ npm run test
.F.F.F........
(::) failed steps (::)
...
Failing scenarios:
/Users/toddanderson/Documents/workspace/custardbelly/cucumberjs-example/features/add-item-view.feature:9 # Scenario: Select of Add Item opens input
/Users/toddanderson/Documents/workspace/custardbelly/cucumberjs-example/features/add-item-view.feature:14 # Scenario: Submit of valid item adds item to list
/Users/toddanderson/Documents/workspace/custardbelly/cucumberjs-example/features/add-item-view.feature:20 # Scenario: Submit of valid item adds item to collection
5 scenarios (3 failed, 2 passed)
22 steps (3 failed, 8 skipped, 11 passed)
Huge explosion. Red everywhere. Dogs and cats, living together. Mass hysteria.
That's good, we expect the world to crash with nothing to support our claims of an "empty grocery list view". What does that even mean in the current context? We haven't even a web page to view our Grocery List. These all are issues we need to address in resolving just this single Step Definition.
Client-Side Script
This is a good point to discuss the client-side script that will act as our main entry point for the browser-based Grocery List Application.
If you have been following along with the examples in this series, we have been slowly building up specs for our Grocery List Application, yet it has been done so while testing under the Node-based CucumberJS CLI tool. Nothing wrong with that, and in fact we have a good starting point in which we can ensure that a proper collection model is maintained with regards to adding and accessing items.
However, now we are moving to a browser environment and need to address how we will load and interact with our application within the browser context. Because we have been developing node modules (to be tested under CucumberJS specs) which utilize the CommonJS module format we can easily bundle our scripts for the browser using the wonderful browserify tool.
Disclaimer: Hats off to Ben Clinkenbeard for finally persuading me to look into browserify over my years-long obsession with RequireJS.
Browserify
It is too much for this article to address browserify and its history and attributes. There are several articles that are google-able that explain what browserify is, how to use it, and its virtues and disadvantages over AMD. I implore you to check them out and make a sound judgement as it relates to your team and project requirements.
That said, I have found browserify extremely beneficial and am going to use it for the examples in this series in delivering the client-side scripts.
First order of business is to install browserify as you would any project-local node module:
$ npm install browserify
Now we need to define how we want our module to be bundled for the browser. If we are talking a single entry point - which most main files are - I prefer to define a global name to assign our module so it is easily accessible on the DOM. Keeping in mind that we are primarily bundling our code so we can do TDD, we define an proper output directory that won't get mixed up with our distribution:
$ mkdir test/script && \
node node_modules/.bin/browserify script/app.js -o test/script/app.js -s grocerylist
With that command, we created the output directory for our main file - app.js
- and bundled the script/app.js file with any dependencies (which currently were only script/model/grocery-list.js). As well, our module is accessible on the window
object as grocerylist
.
Index File
So we have our bundled scripts and an exposed entry to our application through window.grocerylist
, and now we need a way to access and view the application - an html file.
Because we will be using the cucumberjs-browser tool to bundle our features and specs to be run under a browser environment, we will copy and modify the default template shipped with that tool to suit our needs for our application.
At this stage, we are simply going to add a script
tag for our application bundle we created in the previous section:
template/testrunner.html
<!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<script src="lib/cucumber.js"></script>
<script src="features.js"></script>
<% _.each(modules, function(module) { %>
<script src="<%= module.filepath %>"></script>
<% }); %>
<% if(listener.exists) { %>
<script src="script/<%= listener.filename %>"></script>
<% }; %>
</head>
<body>
<script>
(function(window) {
// Need to concat all *.features > browserify.standalone = cukefeatures
var features = window.cukefeatures.split('&crarr').join('\n');
// Need to concat all support + step_definitions, and export as a function
var support = function() {
this.Given = this.When = this.Then = this.defineStep;
// Would be put on window if /support/world found.
if('world' in window) {
this.World = window['world'].World;
}
<% _.each(steps, function(step) { %>
window['<%= step.name %>'].call(this);
<% }); %>
};
var runtime = Cucumber(features, support);
<% if(listener.exists) { %>
runtime.attachListener(window.cukelistener.instance());
<% }; %>
runtime.start(function(){
<% if(listener.exists) { %>
window.cukelistener.instance().complete();
<% } else { %>
console.log(Array.prototype.slice.call(arguments));
<% }; %>
});
}(window));
</script>
<script src="./script/app.js"></script>
</body>
</html>
Most of what is in this page template is copied from the cucumberjs-browser project. The only addition - at this point - is the script appended within the body
that will load our app bundle.
If we were to run the cucumberjs-browser tool and generate our bundled app, specs and template:
$ cucumberjs-browser -o test --tmpl template/testrunner.html -f tap
That will generate the JavaScript bundle files for the Features, Step Definitions and support files we have been creating and curating in this series, along with the templated HTML file with our resources defined and place them in a /test directory.
If we were to open that HTML file - /test/cucumberjs-testrunner.html - and opened the Console of our developer tools, we would see a TAP report of our test... failing :)
If we were to change the format option:
$ cucumberjs-browser -o test --tmpl template/testrunner.html -f ui
We would see those same failing tests, but this time on the DOM.
We have gone from failing on the command line to failing in the browser... isn't it glorious :)
Automate all the things
We had previously automated our testing under the node-based environment; it was a simple as setting up a file watcher and issuing a command to run the CucumberJS CLI tool on change.
Our process has now become a little more involved, but not anything too complex (thanks to the wonderful npm community!) that an automated build and test procedure couldn't be implemented. The only difference is that feedback will now reside in the DOM and/or Console of a browser - so instead of coding in an editor and watching it fail on the command line, we are now going to need to focus on failures reported in the browser as we TDD.
watch script
Just as we had done in a previous article, we are going to create a new script that will essentially do the following:
- start a livereload server
- start a local server to serve the testrunner
- launch the testrunner in a browser
- bundle the app and run the cucumberjs-browser tool
- watch and reload the testrunner in the browser on change to source files
To accomplish this task, we are going to use a couple more npm modules; in particular:
I invite you to go check each of those projects out as I won't go into much detail about each of them in this article. It should be noted, however, that you will need to install the LiveReload browser extension(s) in order to properly use the watch
script:
cuke-browser-watcher.js
#!/usr/bin/env node
var fs = require('fs');
var path = require('path');
var watch = require('node-watch');
var child_process = require('child_process');
var mkdirp = require('mkdirp');
var browserify = require('browserify');
var http = require('http');
var tinylr = require('tiny-lr');
var connect = require('connect');
var open = require('open');
var S = require('string');
var outdir = 'test';
var browserCukes;
var livereloadPort = 35729;
var connectPort = 8080;
var JS_EXT = /^.*\.js/i;
var options = ['-f', 'ui',
'-o', outdir,
'--tmpl', 'template/testrunner.html'];
// [TASKS]
// a. re-bundle the app.
var bundleApplication = function(f, callback) {
return function() {
browserify(__dirname + '/script/app.js')
.bundle({
standalone: 'app'
})
.pipe(fs.createWriteStream(path.resolve(outdir + '/script/app.js')))
.on('close', function() {
console.log('changed app.js...');
if(callback) {
callback();
}
});
};
};
// b. rerun cucumberjs-browser tool.
var cuke = function(f, callback) {
return function() {
var filename = S(path.basename(f, '.js').split('.').join('-')).camelize().s;
browserCukes = child_process.spawn('cucumberjs-browser', options)
.on('exit', function() {
console.log('changed ' + filename + '...');
if(callback) {
callback();
}
});
};
};
// 1. Recursive mkdir /test/script if not exist.
mkdirp.sync(outdir + '/script');
// 2. Create tiny-livereload server.
var lr = tinylr();
lr.listen(livereloadPort, function() {
console.log('livereload listening on ' + livereloadPort + '...');
});
// 3. Start server on localhost.
var app = connect().use(connect.static(__dirname + '/test'));
var server = http.createServer(app).listen(connectPort, function() {
console.log('local server started on ' + connectPort + '...');
console.log('Note: Remember to start the livereload browser extension!');
console.log('http://feedback.livereload.com/knowledgebase/articles/86242-how-do-i-install-and-use-the-browser-extensions-');
cuke('./features/support/world', function() {
bundleApplication('./script/app.js', function() {
open('http://localhost:' + connectPort + '/cucumber-testrunner.html');
})();
})();
});
// 4. Watch source and generate bundles.
watch(['./features', './script'], {recursive:true}, function(filename) {
// Used to resolve when running operation(s) are complete.
var resolver;
var running = false;
var resolveWatch = function(limit) {
var count = 0;
running = true;
return function() {
if(++count === limit) {
count = 0;
running = false;
}
else {
running = true;
}
};
};
if(!running && filename.match(JS_EXT)) {
var bundleAppInvoke = bundleApplication(filename, function() {
lr.changed({
body: {
files: ['script/app']
}
});
resolver();
});
if(/^script?/i.test(filename)) {
resolver = resolveWatch(1);
bundleAppInvoke();
}
else if(/^features?/i.test(filename)) {
resolver = resolveWatch(2);
cuke(filename, function() {
lr.changed({
body: {
files: [filename]
}
});
resolver();
bundleAppInvoke();
})();
}
}
});
This watch
script is very similar to the one we created previously. Aside from moving the bundler tasks outside of the watch()
, the main difference is that we now start a tiny-livereload
server and http
server running on port 8080 before starting the watch
task.
Running this will also automatically launch the testrunner in your default browser. It is important to note that, in order for the reload on file change to work, you must enable the LiveReload browser extension for that browser.
As we have done before, we can add this to our package scripts
:
package.json
{
"name": "cucumberjs-examples",
...
"scripts": {
"test": "node node_modules/.bin/cucumber-js",
"watch": "node cuke-watcher.js",
"watch-browser": "node cuke-browser-watcher"
}
...
}
Open up the terminal and enter the following command:
$ npm run watch-browser
... and we are all set to keep TDD'ing with an automated watch
script that will reload the browser on change to our step definitions and application source files!
Back to Passing
We side-stepped our development to address a few key issues: bundling scripts for the browser and automating tests against cucumberjs-browser. With our watch
script up and running, we can see we are in the red still - let's start turning steps green :)
First order of business is that our first Given step for the Add Item View Feature is interfacing with a currently non-existant API on the World. We eschewed the need for an additional Web Driver library which would provide a conventient API through a browser facade. At this stage, I think we can reasonably have our World provide that API and not need to include more external libraries.
It might even be a reasonable discussion that such Web Drivers are not needed at all in such circumstances, but I won't go there for the moment as that gets into a discussion about integration testing vs unit testing and BDD practice - ie, a can of worms ;)
Modifying Our World
Now that we know we are running our tests in the browser, we have access to the global window
and can reference the DOM without restriction to running CucumberJS under node.
Let's modify our World to expose the API we are invoking from our Given in the Add Item View __Feature:
/features/support/world.js
'use strict';
var World = function World(callback) {
this.window = window;
this.app = window.app;
this.groceryListApplication = undefined;
this.openGroceryList = function() {
return this.app.newSession();
};
this.createGroceryItem = function() {
return 'apple';
};
this.emptyGroceryListView = function() {
this.app.empty();
};
callback();
};
module.exports.World = World;
There is actually a quite bit changed from our previous World:
- Removed
require()
of app module - Added access to
app
reference onwindow
from our browserified bundle - Changed reference to
app
that creates a new session - Added
emptyGroceryListView
method to World
So we took the World into a browser environment with its referencing the app, but we are still (as expected) failing - this time alerting us to:
- Cannot call method 'newSession' of undefined at World.openGroceryList
which is stemming from our previously defined Background step definition:
Background: Grocery List Application is Open
Given I have opened the grocery list application
This actually stems from a much larger problem: accessing the the application module on the window
before it has finished being loaded by the browser. As such, we will need to modify this step definition to ensure that the DOM has completed load before we can move forward in interactinf with the World API that now exposes communication to the DOM.
_/features/stepdefinitions/background-open-application.step.js
'use strict';
var assert = require('assert');
module.exports = function() {
this.World = require('../support/world').World;
this.Given(/^I have opened the grocery list application$/, function(callback) {
(function(world) {
world.domload(function() {
world.groceryListApplication = world.openGroceryList();
assert(world.groceryListApplication, 'Grocery List Application is required to be open for editability.');
callback();
});
}(this));
});
};
Now we are offloading our assertion and callback to the complete of DOM load through the World to ensure that we have successfully loaded the application.
This will now fail on - Object #<World> has no method 'domload', so let's get that fixed up:
/features/support/world.js
'use strict';
var World = function World(callback) {
this.window = process.browser ? window : {};
this.app = undefined;
this.groceryListApplication = undefined;
var defineGlobals = function(w, doc) {
this.app = w.app;
};
this.domload = function(callback) {
(function(world) {
if(document.readyState === 'complete') {
defineGlobals.call(world, window, document);
callback();
}
else {
var delegate = document.addEventListener ? 'addEventListener' : 'attachEvent';
var eventType = document.addEventListener ? 'load' : 'onload';
window[delegate](eventType, function() {
defineGlobals.call(world, window, document);
callback();
});
}
}(this));
};
this.openGroceryList = function() {
return this.app.newSession();
};
this.createGroceryItem = function() {
return 'apple';
};
callback();
};
module.exports.World = World;
Woohoo! Now we are back with the exception Object #<World> has no method 'emptyGroceryListView' that got us in this mess... BUT the previous tests we had passing are now passing again :)
For the sake of getting too "noisy" with code and explanations, for the following edits - unless an explanation is deemed worthy - I will just roll along with modifications to the test and source and show the series of failures.
/features/support/world.js
'use strict';
var World = function World(callback) {
this.window = process.browser ? window : {};
this.app = undefined;
this.groceryListApplication = undefined;
...
this.emptyGroceryListView = function() {
this.groceryListApplication.empty();
};
callback();
};
module.exports.World = World;
- Object #<World> has no method 'empty' at World.emptyGroceryListView
/script/app.js
...
var application = {
init: function(list) {
this.list = list;
return this;
},
empty: function() {
this.list.empty();
}
};
...
- Object #<World> has no method 'getGroceryListView' at World
/features/support/world.js
'use strict';
var World = function World(callback) {
this.window = process.browser ? window : {};
this.app = undefined;
this.groceryListApplication = undefined;
...
this.getGroceryListView = function() {
this.groceryListApplication.$listview;
};
callback();
};
module.exports.World = World;
- Cannot read property 'childNodes' of undefined at World
/script/app.js
...
var application = {
init: function(list) {
this.list = list;
this.$listview = document.querySelector('#grocery-list');
return this;
},
empty: function() {
var gl = this.$listview;
while (gl.hasChildNodes()) {
gl.removeChild(gl.lastChild);
}
this.list.empty();
}
};
...
- Cannot read property 'childNodes' of null at World
/template/testrunner.html
<!doctype html>
<html>
<body>
...
<ul id="grocery-list"></ul>
<script src="./script/app.js"></script>
</body>
</html>
And we are back to green!... and pending. Let's move on to our next step definition:
When I provide a valid grocery list item name
_/features/stepdefinitions/add-item-view.steps.js
...
var enteredItem;
this.Given(/^I have an empty grocery list view$/, function(callback) {
this.emptyGroceryListView();
assert.equal(this.getGroceryListView().childNodes.length, 0);
callback();
});
this.When(/^I provide a valid grocery list item name$/, function(callback) {
enteredItem = this.createGroceryItem();
this.enterNewGorceryListItem(enteredItem);
callback();
});
...
Back in the red!
- Object #<World> has no method 'enterNewGorceryListItem' at World
/features/support/world.js
var World = function World(callback) {
this.window = process.browser ? window : {};
this.app = undefined;
this.groceryListApplication = undefined;
var defineGlobals = function(w, doc) {
this.app = w.app;
};
...
this.enterNewGorceryListItem = function(item) {
this.groceryListApplication.enterNewItem(item);
};
callback();
};
module.exports.World = World;
- Object #<Object> has no method 'enterNewItem' at World.enterNewGorceryListItem
/script/app.js
...
var application = {
init: function(list) {
this.list = list;
this.$listview = document.querySelector('#grocery-list');
this.$itemInputView = document.querySelector('#item-input');
return this;
},
empty: function() {
var gl = this.$listview;
while (gl.hasChildNodes()) {
gl.removeChild(gl.lastChild);
}
this.list.empty();
},
enterNewItem: function(item) {
this.$itemInputView.value = item;
}
};
...
- Cannot set property 'value' of null at Object.application.enterNewItem
/template/testrunner.html
<!doctype html>
<html>
<body>
...
<ul id="grocery-list"></ul>
<form>
<label for="itemInput">Item name:</label>
<input id="item-input" name="itemInput" type="text"></item>
</form>
<script src="./script/app.js"></script>
</body>
</html>
Back to pending! Next step:
And I select to add an item
_/features/stepdefinitions/add-item-view.steps.js
...
this.When(/^I select to add an item$/, function(callback) {
this.clickAddGroceryListItem();
callback();
});
...
- Object #<World> has no method 'clickAddGroceryListItem' at World.
/features/support/world.js
var World = function World(callback) {
this.window = process.browser ? window : {};
this.app = undefined;
this.groceryListApplication = undefined;
var defineGlobals = function(w, doc) {
this.app = w.app;
};
...
this.createClickEvent = function() {
var event = document.createEvent('MouseEvents');
event.initEvent('click', true, false);
return event;
};
this.clickAddGroceryListItem = function() {
var clickevent = this.createClickEvent();
this.groceryListApplication.$addbutton.dispatchEvent(clickevent);
};
...
callback();
};
module.exports.World = World;
- Cannot call method 'dispatchEvent' of undefined at World.clickAddGroceryListItem
/script/app.js
var application = {
init: function(list) {
this.list = list;
this.$listview = document.querySelector('#grocery-list');
this.$itemInputView = document.querySelector('#item-input');
this.$addbutton = document.querySelector('#add-button');
return this;
},
empty: function() {
var gl = this.$listview;
while (gl.hasChildNodes()) {
gl.removeChild(gl.lastChild);
}
this.list.empty();
},
enterNewItem: function(item) {
this.$itemInputView.value = item;
}
};
- Cannot call method 'dispatchEvent' of null at World.clickAddGroceryListItem
/template/testrunner.html
<!doctype html>
<html>
<body>
...
<ul id="grocery-list"></ul>
<form>
<label for="itemInput">Item name:</label>
<input id="item-input" name="itemInput" type="text"></item>
<button id="add-button" type="button">add</button>
</form>
<script src="./script/app.js"></script>
</body>
</html>
Back to pending! We're getting into assertion territory :) Next step:
Then The item is added to the grocery list view
_/features/stepdefinitions/add-item-view.steps.js
...
this.Then(/^The item is added to the grocery list view$/, function(callback) {
assert.equal(this.getGroceryListViewItemAtIndex(0), enteredItem, 'Entered item should be first in empty list.');
callback();
});
...
- Object #<World> has no method 'getGroceryListViewItemAtIndex' at World
/features/support/world.js
var World = function World(callback) {
this.window = process.browser ? window : {};
this.app = undefined;
this.groceryListApplication = undefined;
var defineGlobals = function(w, doc) {
this.app = w.app;
};
...
this.getGroceryListViewItemAtIndex = function(index) {
return this.groceryListApplication.$listview.childNodes[index].textContent;
}
...
callback();
};
module.exports.World = World;
- Cannot read property 'textContent' of undefined at World.getGroceryListViewItemAtIndex
/script/app.js
...
var application = {
init: function(list) {
this.list = list;
this.$listview = document.querySelector('#grocery-list');
this.$itemInputView = document.querySelector('#item-input');
this.$addbutton = document.querySelector('#add-button');
(function(app) {
app.$addbutton.addEventListener('click', function(event) {
var item = app.$itemInputView.value;
app.addItemToView(item);
});
}(this));
return this;
},
empty: function() {
var gl = this.$listview;
while (gl.hasChildNodes()) {
gl.removeChild(gl.lastChild);
}
this.list.empty();
},
enterNewItem: function(item) {
this.$itemInputView.value = item;
},
addItemToView: function(item) {
var li = document.createElement('li');
var text = document.createTextNode(item);
li.appendChild(text);
this.$listview.appendChild(li);
}
};
...
By adding a click
handler to the button
, we are updating the view by adding a li
element to the list view.
And we're back to pending! One last step:
Then The item is accessible from the grocery list collection
_/features/stepdefinitions/add-item-view.steps.js
...
this.Then(/^The item is accessible from the grocery list collection$/, function(callback) {
assert.equal(this.groceryListApplication.list.getItemIndex(enteredItem), 0, 'Added item should be found at first index.');
callback();
});
...
Utilizing the getItemIndex()
method we created in passing the collection features from a previous article, we get back to failing.
- Added item should be found at first index. at World
/script/app.js
...
var application = {
init: function(list) {
this.list = list;
this.$listview = document.querySelector('#grocery-list');
this.$itemInputView = document.querySelector('#item-input');
this.$addbutton = document.querySelector('#add-button');
(function(app) {
app.$addbutton.addEventListener('click', function(event) {
var item = app.$itemInputView.value;
app.addItemToView(item);
app.list.add(item);
});
}(this));
return this;
},
...
};
...
In adding a call to list.add()
in the button handler within we just defined an update to the view, we bring ourselves to full green!
Considerations
If you have following along in getting these new browser-based Features to pass in that environment, I have taken some liberties with regards to architecture and process with the hopes to not add noise to the task at hand.
In reality, we should consider the next phase as a Refactor. The particular areas in which I see issues that I would address and.or discuss with my team are:
- Implementing view update based on collection events
- Templatize-ing the main view to be wrapped in production and injecting as a partial to the testrunner template
- Building the application to be deployed as a web-based application and User Tested
I am sure there are more, and that you have a few ideas as well, but these are at least three aspects of the architecture of the project and product that can be tackled with assurance now that we have a test harness for the features criteria :)
Conclusion
If you made it down this far, I do appreciate you taking the time to follow along - I know this was a bit of a long one.
I hoped to have demonstrated the process of going from Features to Step Definitions to implementation code to pass criteria all while living in a real browser environment using the cucumberjs-browser and test automation. On the surface, it may seem like quite a process, but my personal experience is that BDD forces you into thinking about minimilistic design while putting your code under a test harness from which you can maintain and add new features with assurance.
Source for examples related to this post can be found in the 0.5.0.post tag on my Github account.
To Come
There are a few extra productivity tidbits I have picked up while working with the wondeful CucumberJS tool in developing several applications for both the web and server.
Who knows... I have had a blast going through the articles in this series demonstrating TDD using the BDD tool, CucumberJS. I might just continue to evolve the example to a fully-functional application just as I had done in the Making of a Test-Driven Grocery List Application series which focused on the Jasmine library.
Additionally, I am invested in the cucumberjs-browser I created during (and as a result) of this series and hope to write some more articles on its structure, usage and any additions/fixes that are made and I welcome you to help me in making cucumberjs-browser a great tool in being able run your specs in a real browser environment without having to change your current workflow in defining Features, Step Definitions and support files.
Cheers!


I wrote my first line of code in an introduction to web design elective while in school for graphic design. When I saw my code become something visual in the browser, I was fascinated. After finishing the class, I put coding aside for a while and continued on with my plans to be a freelance graphic designer. When I heard about Nashville Software School I saw my opportunity to start a career in software development, and I went for it. Now I can’t imagine anything else I would rather do.
HTML 5
CSS 3
Javascript
React
Python
Django
Git
GitHub
Grunt
SQLite
jQuery
VS Code
Bootstrap
Photoshop
Illustrator


Working in Live Elearning website help4code.com with Collaborate Team members.
Institute - Revenath choure college of Technology and Management
Grade - Running
School - Govt. Excellence Higher Secondary School
Grade - First Devision
School - Sankalps Higher Secondary School
Grade - First Devision
1680
Python
700
C/C++
1000
Data Structure and Algorithm
600
Machine Learning
600
Data science
Here we also provide our customers to Graphic Desiging and Logo Desigining support.
Modern and mobile-ready website that will help of your marketing.
We provide Software Developement service to build a software on the bases of requirement of client.
We provide IT Support to our client to solve there problem regarding project.
I also like to do Natural Photograpy And we also provide this serives to our client.
We provide Data Pre-processing and Visualization support to Our customer.
I'm available for freelancing projects. Conatct me for web development, Python Software development, data Pre-processing & visualizations and get your project done.


Settings
Labels
Predictions
Events
Next Page
Prev Page
Next Second
Prev Second
New Event
SZ
arrow_drop_down


TileManage class manages storing, loading and rendering of tiles. It serves two main features: 1. Render all the tiles during the actual game. 2. Render tiles for the tile editor.
More...
#include <TileManager.hpp>
|
| static void | loadTileTypes (std::string path) |
| | Load tiles' config file and bind each tile type with its relative path. More...
|
| |
| static std::string | getTilePath (int type) |
| | Get a specific tile type's relative path by the input tile type. More...
|
| |
|
|
static std::unordered_map< int, std::string > | tilePaths |
| | A static unordered_map which bind each tile type to its relative path.
|
| |
|
|
int ** | tilemap |
| |
|
int | col |
| |
|
int | row |
| |
|
int | tileWidth |
| |
|
int | tileHeight |
| |
|
Vec2 | pos |
| |
|
int | tilesCount |
| |
TileManage class manages storing, loading and rendering of tiles. It serves two main features: 1. Render all the tiles during the actual game. 2. Render tiles for the tile editor.
◆ TileManager()
| TileManager::TileManager |
( |
int |
tileWidth, |
|
|
int |
tileHeight, |
|
|
Vec2 |
pos = Vec2(0, 0) |
|
) |
| |
Three arguments constructor of TileManager object.
- Parameters
-
| tileWidth | An integer indicates the number of horizontal tiles in a row. |
| tileHeight | An integer indicates the number of vertical tiles in a column. |
| pos | A Vec2 object indicates the start pocess position of the entire grid. |
◆ convertToGameObjects()
| GameObject** TileManager::convertToGameObjects |
( |
| ) |
|
Calls the render functions to render each individual tile.
- Parameters
-
- Returns
- A pointer to a pointer of a GameObject
◆ getColNum()
| int TileManager::getColNum |
( |
| ) |
|
Get the column number of the entire tile grid.
- Returns
- An integer indicates the column number of the entire tile grid.
◆ getPos()
| Vec2 TileManager::getPos |
( |
| ) |
|
◆ getRowNum()
| int TileManager::getRowNum |
( |
| ) |
|
Get the row number of the entire tile grid.
- Returns
- An integer indicates the row number of the entire tile grid.
◆ getTileCount()
| int TileManager::getTileCount |
( |
| ) |
|
◆ getTileHeight()
| int TileManager::getTileHeight |
( |
| ) |
|
Get the height of each single tile.
- Returns
- An integer indicates the height of each single tile.
◆ getTilePath()
| static std::string TileManager::getTilePath |
( |
int |
type | ) |
|
|
inlinestatic |
Get a specific tile type's relative path by the input tile type.
- Parameters
-
| type | index of our tileTypes |
- Returns
- string that representst the path of that tile
◆ getTileTypeAt()
| int TileManager::getTileTypeAt |
( |
int |
row, |
|
|
int |
col |
|
) |
| |
Get the tile type at a specified position.
- Parameters
-
| row | An integer indicates the row number of that specified position. |
| col | An integer indicates the column number of that specified position. |
- Returns
- An integer(enum) indicates the tile type of that specified position.
◆ getTileWidth()
| int TileManager::getTileWidth |
( |
| ) |
|
Get the width of each single tile.
- Returns
- An integer indicates the width of each single tile.
◆ loadLevelMap()
| void TileManager::loadLevelMap |
( |
std::string |
path | ) |
|
Load the level map according to the input file path.
- Parameters
-
| path | A string indicates the path of the level map file. |
◆ loadTileTypes()
| static void TileManager::loadTileTypes |
( |
std::string |
path | ) |
|
|
inlinestatic |
Load tiles' config file and bind each tile type with its relative path.
- Parameters
-
| path | A string object indicates the path of tiles' config file. |
◆ saveLevelMap()
| void TileManager::saveLevelMap |
( |
std::string |
path | ) |
|
Save the current level to the input file path.
- Parameters
-
| path | A string indicates the path of the level map file to be saved. |
The documentation for this class was generated from the following file:
- /home/rumanstheddy/Documents/Edu/test/finalproject-final-pog/Engine/include/TileManager.hpp


The Spanish period
Because the Spanish colonizers could not understand Baybayin, it was just a matter of time before they introduced their own system --- the Roman Alphabet. Unfortunately, this meant banning all pre-Hispanic forms of writing including Baybayin. This led to a drastic decline in Tagalog script, especially for Filipinos who lived in lowland areas. Early Filipinos who live in easy-to-reach areas had their culture eradicated more quickly than those who lived in remote villages and hard-to-reach areas.
Mindanao and Palawan, for example, were able to preserve most of their ancient culture, including their scripts and system of writing, because the Spanish colonizers were not able to oppress them as much. Any culture that was foreign to the Spanish were banned. Hundreds of written accounts narrate a regular burning of pre-Hispanic scripts by Spanish friars as they believe they contain evil incantations and curses which could hurt the Friars’ beliefs.
Ironically, the system of writing which they were afraid of was also the same system of writing that they used to spread Christianity. Spanish Friars managed to convince the natives to convert to Christianity by using Baybayin as their medium of translation. To make up for the language difference, Baybayin had to be tweaked to translate Spanish words. This reformation of Baybayin came when Fr. Francisco Lopez published an Ilokano Doctrina. One new rule that he introduced to the system of writing was to place a cross mark below the Baybayin characters to cancel the vowel. An example of this could be found in Doctrina Christiana that is still preserved until today.
On a funny turn of fate, what helped the Spanish colonize us faster also brought its end. Baybayin was used as a uniting force by Andres Bonifacio in 1892. It symbolized the Filipinos’ unity against their oppressors which could be translated to nationalism. Perhaps, the best example of this could be the Katipunan flag of the Magdiwang faction showcased the Baybayin character KA during the Spanish revolution.
Andres Bonifacio mentions in his poem Ang Dapat Mabatid ng mga Tagalog that the early Tagalogs used to live in prosperity before the Spaniards came. Education was for everyone and everyone was literate with their own native writing systems, including women and children, a dire contrast from the Spanish times.


by Santosh Pradhan on August 24, 2017
Salesforce Authentication Mechanisms
In this chapter, we would discuss and work on following ways of authenticating a user
I wrote some articles about whatever was on our heads and most people liked it.
In this chapter, we would discuss and work on following ways of authenticating a user
Working with your existing Salesforce Orgs
Just enter your email then we will send an email about the latest articles


Sloane Stephens (born March 20, 1993) is an American tennis player. She has won five singles titles, including her first major
at the 2017 US Open. With the victory, she became the lowest ranked player (83rd) to ever win the women's singles title and the first American woman outside
the Williams sisters to win a Grand Slam since Jennifer Capriati in 2002. She has also reached the semi-finals of the 2013 Australian Open, defeating
Serena Williams in the quarterfinals and won her first title at the 2015 Citi Open. Stephens holds a career-high singles ranking of world No. 11.
In 2010, Sloane signed an endorsment deal with Under Armour.


Stocks Data Visualization
Year
Low
Open
Close
High
Number of Events
Stocks Data Prediction
Year:
Month:
Date:
Opening Stock Price:


Web Development
What I can do
Check out some web-based applications and websites what I have done.
My name is Ella. I'm a mixture of web designer and developer. As a designer, my aim is to develop functional and memorable interfaces & create meaningful user experiences for mobile and the web. As a developer, in turn, I focus on writing reliable, elegant and efficient code. I'm always intrested in cool stuff and finding a better way to create something new.
Modern Web Development. Media Technology. ICT. Metropolia UAS, Helsinki, Finland.
Front End Developer
Web Designer
WordPress
What I can do
Check out some web-based applications and websites what I have done.
What I want to do
UI / User Interface
UX / User Experience
School project
First there was only a lot of data.
Then things were done.
Finally it all made sense.
Ask me more.
My passion
When I'm not designing or programming you will probably find me exploring and photographing cool places.


Ordering sportswear with a custom print can reveal your inner artist with the chance of self design .
Rosinka
More than just a buying app, but rather a communication channel with customers.
Giftmaker
Buying gift cards ala iTunes experience have never been easier.
Technology
Swift
Java
Available servers
Rest Api
Shopify
Magento
1C-bitrix
Components
Autorization
Catalog
Cart
Order history
Payment
Autorization
In Fact, these tips enabled me to generate over $47,000 in
mortgage commissions in less than 30 days! Keep reading and I will share 3 key elements to
creating an effective direct mail advertising campaign:Key Element #1: The prospect list – Mail to a
targeted list of prospects. Here are a couple of ways.
Catalog
In the catalog it is possible to have categories and subcategories of goods;
select various options for products; offer similar products for cross-selling.
The home page features large banners calling for action and the main categories.
Users can also run a search.
Cart
All details of a purchase are available at a glance with key informations,
navigation options, to add or deduct from a cart, continue shopping or proceed to payment.
Making shopping process smooth with friendly and simplified UI/UX.
Order history
Display in ascending order the history of purchases, total expense, date,
number of goods and order status: cancelled, completed, accepted or en route.
Payment
Secure payment via the Shopify payment gateway including options for Apple Pay and Android Pay.


Application emulating end stations in intelligent home system, which are used to measure physical quantities and interact with switches. Application has a comprehensive graphical user interface, which allows testing of other system layers and recording of statistical data about emulation contributing to system analysis.
Application was created as bachelor's thesis on FIT VUT in Brno
Author: Filip Sutovsky - xsutov00@stud.fit.vutbr.cz


This page links to two tutorials demonstrating various aspects of the use of JAAS (Java Authentication and Authorization Service):
The authentication technology used for these tutorials is very basic, just ensuring that the user specifies a particular name and password. Thus, these tutorials can be run by everyone.
com.sun.security.auth
Packagecom.sun.security.auth.callback
Packagecom.sun.security.auth.login
Packagecom.sun.security.auth.module
PackageSimilar tutorials for JAAS authentication and authorization, but which demonstrate the use of a Kerberos LoginModule and thus which require a Kerberos installation, can be found at
These two tutorials are a part of the Java GSS-API and JAAS sequence of tutorials that utilize Kerberos as the underlying technology for authentication and secure communication.