The sample CoffeesFrame.java
demonstrates how to integrate JDBC with a GUI API, in particular, the Swing API. It displays the contents of the COFFEES
database table in a table and contains fields and buttons that enable you to add rows to the table. The following is a screenshot of this sample:
The sample contains five text fields that correspond to each of the columns in the COFFEES
table. It also contains three buttons:
COFFEES
based on the data in the sample's table.COFFEES
table, replacing the existing data in the sample's table.This sample (which requires CoffeesTableModel
) demonstrates the following general steps to integrate JDBC with the Swing API:
TableModel
interfaceRowSetListener
interfaceThe TableModel
interface enables a Java Swing application to manage data in a JTable
object. The sample, CoffeesTableModel.java
, implements this interface. It specifies how a JTable
object should retrieve data from a RowSet
object and display it in a table.
Note: Although this sample displays the contents of the COFFEES
table in a Swing application, the class CoffeesTableModel
should work for any SQL table provided that its data can be represented with String
objects. (However, the fields that enable users to add rows to COFFEES
, which are specified in the class CoffeesFrame
, would have to be modified for other SQL tables.)
Before implementing the methods of the interface TableModel
, the constructor of the class CoffeeTableModel
initializes various member variables required for these implemented methods as follows:
public CoffeesTableModel(CachedRowSet rowSetArg) throws SQLException { this.coffeesRowSet = rowSetArg; this.metadata = this.coffeesRowSet.getMetaData(); numcols = metadata.getColumnCount(); // Retrieve the number of rows. this.coffeesRowSet.beforeFirst(); this.numrows = 0; while (this.coffeesRowSet.next()) { this.numrows++; } this.coffeesRowSet.beforeFirst(); }
The following describes the member variables initialized in this constructor:
CachedRowSet coffeesRowSet
: Stores the contents of the table COFFEES
.
This sample uses a RowSet
object, in particular, a CachedRowSet
object, rather than a ResultSet
object for two reasons. A CachedRowSet
object enables the user of the application to make changes to the data contained in it without being connected to the database. In addition, because a CachedRowSet
object is a JavaBeans component, it can notify other components when certain things happen to it. In this sample, when a new row is added to the CachedRowSet
object, it notifies the Swing component that is rendering its data in a table to refresh itself and display the new row.
ResultSetMetaData metadata
: Retrieves the number of columns in the table COFFEES
as well as the names of each of them.
int numcols, numrows
: Stores the number of columns and rows, respectively, in the table COFFEES
.
The CoffeesTableModel.java
sample implements the following methods from TableModel
interface:
Class<?> getColumnClass(int columnIndex)
: Returns the most specific superclass for all the cell values in the column.int getColumnCount()
: Returns the number of columns in the model.String getColumnName(int columnIndex)
: Returns the name of the column specified by the parameter columnIndex
.int getRowCount()
: Returns the number of rows in the model.Object getValueAt(int rowIndex, int columnIndex)
: Returns the value for the cell at intersection of the column columnIndex
and the row rowIndex
.boolean isCellEditable(int rowIndex, int columnIndex)
: Returns true if the cell at the intersection of the column rowIndex
and the row columnIndex
can be edited.The following methods have not been implemented because this sample does not allow users to directly edit the contents of the table:
void addTableModelListener(TableModelListener l)
: Adds a listener to the list that is notified each time a change to the data model occurs.void removeTableModelListener(TableModelListener l)
: Removes a listener from the list that is notified each time a change to the data model occurs.void setValueAt(Object aValue, int rowIndex, int columnIndex)
: Sets the value in the cell at the intersection of the column columnIndex
and the row rowIndex
to the object aValue
.The methods getColumnCount
and getRowCount
return the value of the member variables numcols
and numrows
, respectively:
public int getColumnCount() { return numcols; } public int getRowCount() { return numrows; }
The getColumnClass
method returns the data type of the specified column. To keep things simple, this method returns the String
class, thereby converting all data in the table into String
objects. The JTable
class uses this method to determine how to render data in the GUI application.
public Class getColumnClass(int column) { return String.class; }
The getColumnName
method returns the name of the specified column. The JTable
class uses this method to label each of its columns.
public String getColumnName(int column) { try { return this.metadata.getColumnLabel(column + 1); } catch (SQLException e) { return e.toString(); } }
The getColumnAt
method retrieves the value at the specified row and column in the row set coffeesRowSet
. The JTable
class uses this method to populate its table. Note that SQL starts numbering its rows and columns at 1, but the TableModel
interface starts at 0; this is the reason why the rowIndex
and columnIndex
values are incremented by 1.
public Object getValueAt(int rowIndex, int columnIndex) { try { this.coffeesRowSet.absolute(rowIndex + 1); Object o = this.coffeesRowSet.getObject(columnIndex + 1); if (o == null) return null; else return o.toString(); } catch (SQLException e) { return e.toString(); } }
Because this sample does not allow users to directly edit the contents of the table (rows are added by another window control), this method returns false
regardless of the values of rowIndex
and columnIndex
:
public boolean isCellEditable(int rowIndex, int columnIndex) { return false; }
The class CoffeesFrame
implements only one method from the interface RowSetListener
, rowChanged
. This method is called when a user adds a row to the table.
public void rowChanged(RowSetEvent event) { CachedRowSet currentRowSet = this.myCoffeesTableModel.coffeesRowSet; try { currentRowSet.moveToCurrentRow(); myCoffeesTableModel = new CoffeesTableModel(myCoffeesTableModel.getCoffeesRowSet()); table.setModel(myCoffeesTableModel); } catch (SQLException ex) { JDBCTutorialUtilities.printSQLException(ex); // Display the error in a dialog box. JOptionPane.showMessageDialog( CoffeesFrame.this, new String[] { // Display a 2-line message ex.getClass().getName() + ": ", ex.getMessage() } ); } }
This method updates the table in the GUI application.
The constructor of the class CoffeesFrame
initializes and lays out the Swing components. The following statement retrieves the contents of the COFFEES
table, stores the contents in the CachedRowSet
object myCachedRowSet
, and initializes the JTable
Swing component:
CachedRowSet myCachedRowSet = getContentsOfCoffeesTable(); myCoffeesTableModel = new CoffeesTableModel(myCachedRowSet); myCoffeesTableModel.addEventHandlersToRowSet(this); table = new JTable(); // Displays the table table.setModel(myCoffeesTableModel);
As mentioned previously, instead of a ResultSet
object to represent the contents of the COFFEES
table, this sample uses a RowSet
object, notably a CachedRowSet
object.
The method CoffeesFrame.getContentsOfCoffeesTable
retrieves the contents of the table COFFEES
.
The method CoffeesTableModel.addEventHandlersToRowSet
adds the event handler defined in the CoffeesFrame
class, which is the method rowChanged
, to the row set member variable CoffeesTableModel.coffeesRowSet
. This enables the class CoffeesFrame
to notify the row set coffeesRowSet
of any events, in particular, when a user clicks the button Add row to table, Update database, or Discard changes. When the row set coffeesRowSet
is notified of one of these changes, the method CoffeesFrame.rowChanged
is called.
The statement table.setModel(myCoffeesTableModel)
specifies that it use the CoffeesTableModel
object myCoffeesTableModel
to populate the JTable
Swing component table
.
The following statements specify that the CoffeesFrame
class use the layout GridBagLayout
to lay out its Swing components:
Container contentPane = getContentPane(); contentPane.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT); contentPane.setLayout(new GridBagLayout()); GridBagConstraints c = new GridBagConstraints();
See
How to Use GridBagLayout
for more information about using the layout GridBagLayout
.
See the source code for CoffeesFrame.java
to see how the Swing components of this sample are added to the layout GridBagLayout
.
The following statement adds a listener to the button Add row to table:
button_ADD_ROW.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { JOptionPane.showMessageDialog(CoffeesFrame.this, new String[] { "Adding the following row:", "Coffee name: [" + textField_COF_NAME.getText() + "]", "Supplier ID: [" + textField_SUP_ID.getText() + "]", "Price: [" + textField_PRICE.getText() + "]", "Sales: [" + textField_SALES.getText() + "]", "Total: [" + textField_TOTAL.getText() + "]" }); try { myCoffeesTableModel.insertRow(textField_COF_NAME.getText(), Integer.parseInt(textField_SUP_ID.getText().trim()), Float.parseFloat(textField_PRICE.getText().trim()), Integer.parseInt(textField_SALES.getText().trim()), Integer.parseInt(textField_TOTAL.getText().trim())); } catch (SQLException sqle) { displaySQLExceptionDialog(sqle); } } });
When a user clicks this button, it performs the following:
CoffeesTableModel.insertRow
, which adds the row to the member variable CoffeesTableModel.coffeesRowSet
.If an SQLException
is thrown, then the method CoffeesFrame.displaySQLExceptionDialog
creates a message dialog box that displays the content of the SQLException
.
The following statement adds a listener to the button Update database:
button_UPDATE_DATABASE.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { try { myCoffeesTableModel.coffeesRowSet.acceptChanges(); msgline.setText("Updated database"); } catch (SQLException sqle) { displaySQLExceptionDialog(sqle); // Now revert back changes try { createNewTableModel(); msgline.setText("Discarded changes"); } catch (SQLException sqle2) { displaySQLExceptionDialog(sqle2); } } } });
When a user clicks this button, the table COFFEES
is updated with the contents of the row set myCoffeesTableModel.coffeesRowSet
.
The following statement adds a listener to the button Discard changes:
button_DISCARD_CHANGES.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { try { createNewTableModel(); } catch (SQLException sqle) { displaySQLExceptionDialog(sqle); } } });
When a user clicks this button, the method CoffeesFrame.createNewTableModel
is called, which repopulates the JTable
component with the contents of the COFFEES
table.


JavaScript is disabled on your browser.
Skip navigation links
Overview
Package
Class
Tree
Deprecated
Index
Help
SEARCH:
All Classes
All Classes
Class Summary
Exception Summary
Class
Description
AuthenticationController
AuthenticationServices
AuthenticationServicesTest
BadConfirmPasswordException
ConnectionConfig
CsvDb
DatabaseTools
DataSourceConfig
EmptyOrderException
Initialiser
KitchenController
KitchenItemModel
KitchenModelTest
This is the test class for the KitchenModel.
KitchenServices
Main
ManagerServices
Services for the manager controller.
MangerController
Controller for Manager pahes.
MenuController
MenuControllerTest
MenuItemModel
MenuItemModelTest
This is the test class for the MenuItemModel.
MenuServices
MenuServicesTest
MenuTable
ModifyAvailabilityController
ModifyAvailabilityServices
OrderAdd
OrderItemModel
OrderItemModelTest
This is the test class for the MenuItemModel.
OrderList
This is the class for the OrderList from the menu.
OrderModel
OrderModelTest
This is the test class for the MenuItemModel.
PostOrderController
PostOrderModel
PostOrderModelTest
This is the test class for the MenuItemModel.
PostOrderServices
StaffModel
The Staff model.
StartController
StartServices
TableModel
TableModelTest
This is the test class for the MenuItemModel.
TestSuite
TimeServices
TooManyItemsException
WaiterAlreadyAssigned
This exception is called when a waiter tries to assign themselves to an order which has already got a waiter assigned to it.
WaiterController
WaiterServices


"ETHAM "perhaps another name for Khetam, or “fortress,” on the Shur or great wall of Egypt, which extended from the Mediterranean to the Gulf of Suez. Here the Israelites made their third encampment (Exodus 13:20; Numbers 33:6). The camp was probably a little to the west of the modern town of Ismailia. Here the Israelites were commanded to change their route(Exodus 14:2), and “turn” towards the south, and encamp before Pi-hahiroth. (See EXODUS; PITHOM.)
"ETHAM "perhaps another name for Khetam, or “fortress,” on the Shur or great wall of Egypt, which extended from the Mediterranean to the Gulf of Suez. Here the Israelites made their third encampment (Exodus 13:20; Numbers 33:6). The camp was probably a little to the west of the modern town of Ismailia. Here the Israelites were commanded to change their route(Exodus 14:2), and “turn” towards the south, and encamp before Pi-hahiroth. (See EXODUS; PITHOM.)


Bike ride to the store with the toddler all swaddled up on the back. Beautiful way to enjoy the winter sunshine. Now for some cocoa.
1/22/2011, 4:39:46 PM
Favs: 0
Retweets: 0
link--- layout: tweet ---
Bike ride to the store with the toddler all swaddled up on the back. Beautiful way to enjoy the winter sunshine. Now for some cocoa.
1/22/2011, 4:39:46 PM
Favs: 0
Retweets: 0
link


Typedefs | |
| typedef void(* | grib_free_proc )(const grib_context *c, void *data) |
| Grib free procedure, format of a procedure referenced in the context that is used to free memory. | |
| typedef void *(* | grib_malloc_proc )(const grib_context *c, size_t length) |
| Grib malloc procedure, format of a procedure referenced in the context that is used to allocate memory. | |
| typedef void *(* | grib_realloc_proc )(const grib_context *c, void *data, size_t length) |
| Grib realloc procedure, format of a procedure referenced in the context that is used to reallocate memory. | |
| typedef void(* | grib_log_proc )(const grib_context *c, int level, const char *mesg) |
| Grib loc proc, format of a procedure referenced in the context that is used to log internal messages. | |
| typedef void(* | grib_print_proc )(const grib_context *c, void *descriptor, const char *mesg) |
| Grib print proc, format of a procedure referenced in the context that is used to print external messages. | |
| typedef size_t(* | grib_data_read_proc )(const grib_context *c, void *ptr, size_t size, void *stream) |
| Grib data read proc, format of a procedure referenced in the context that is used to read from a stream in a resource. | |
| typedef size_t(* | grib_data_write_proc )(const grib_context *c, const void *ptr, size_t size, void *stream) |
| Grib data read write, format of a procedure referenced in the context that is used to write to a stream from a resource. | |
| typedef off_t(* | grib_data_tell_proc )(const grib_context *c, void *stream) |
| Grib data tell, format of a procedure referenced in the context that is used to tell the current position in a stream. | |
| typedef off_t(* | grib_data_seek_proc )(const grib_context *c, off_t offset, int whence, void *stream) |
| Grib data seek, format of a procedure referenced in the context that is used to seek the current position in a stream. | |
| typedef int(* | grib_data_eof_proc )(const grib_context *c, void *stream) |
| Grib data eof, format of a procedure referenced in the context that is used to test end of file. | |
Functions | |
| grib_context * | grib_get_context (grib_handle *h) |
| Retreive the context from a handle. | |
| grib_context * | grib_context_get_default (void) |
| Get the static default context. | |
| grib_context * | grib_context_new (grib_context *c) |
| Create and allocate a new context from a parent context. | |
| void | grib_context_delete (grib_context *c) |
| Frees the cached definition files of the context. | |
| void | grib_gts_header_on (grib_context *c) |
| Set the gts header mode on. | |
| void | grib_gts_header_off (grib_context *c) |
| Set the gts header mode off. | |
| void | grib_gribex_mode_on (grib_context *c) |
| Set the gribex mode on. | |
| void | grib_gribex_mode_off (grib_context *c) |
| Set the gribex mode off. | |
| void | grib_context_set_user_data (grib_context *c, void *udata) |
| Sets user data in a context. | |
| void * | grib_context_get_user_data (grib_context *c) |
| get userData from a context | |
| void | grib_context_set_memory_proc (grib_context *c, grib_malloc_proc griballoc, grib_free_proc gribfree, grib_realloc_proc gribrealloc) |
| Sets memory procedures of the context. | |
| void | grib_context_set_persistent_memory_proc (grib_context *c, grib_malloc_proc griballoc, grib_free_proc gribfree) |
| Sets memory procedures of the context for persistent data. | |
| void | grib_context_set_buffer_memory_proc (grib_context *c, grib_malloc_proc griballoc, grib_free_proc gribfree, grib_realloc_proc gribrealloc) |
| Sets memory procedures of the context for large buffers. | |
| void | grib_context_set_path (grib_context *c, const char *path) |
| Sets the context search path for definition files. | |
| void | grib_context_set_dump_mode (grib_context *c, int mode) |
| Sets context dump mode. | |
| void | grib_context_set_print_proc (grib_context *c, grib_print_proc printp) |
| Sets the context printing procedure used for user interaction. | |
| void | grib_context_set_logging_proc (grib_context *c, grib_log_proc logp) |
| Sets the context logging procedure used for system (warning, errors, infos . | |
| void | grib_multi_support_on (grib_context *c) |
| Turn on support for multiple fields in single grib messages. | |
| void | grib_multi_support_off (grib_context *c) |
| Turn off support for multiple fields in single grib messages. |
| typedef int(* grib_data_eof_proc)(const grib_context *c, void *stream) |
Grib data eof, format of a procedure referenced in the context that is used to test end of file.
| c | : the context where the tell will apply | |
| *stream | : the stream |
| typedef size_t(* grib_data_read_proc)(const grib_context *c, void *ptr, size_t size, void *stream) |
Grib data read proc, format of a procedure referenced in the context that is used to read from a stream in a resource.
| c | : the context where the read will apply | |
| *ptr | : the resource | |
| size | : size to read | |
| *stream | : the stream |
| typedef off_t(* grib_data_seek_proc)(const grib_context *c, off_t offset, int whence, void *stream) |
Grib data seek, format of a procedure referenced in the context that is used to seek the current position in a stream.
| c | : the context where the tell will apply | |
| offset | : the offset to seek to | |
| whence | : If whence is set to SEEK_SET, SEEK_CUR, or SEEK_END, the offset is relative to the start of the file, the current position indicator, or end-of-file, respectively. | |
| *stream | : the stream |
| typedef off_t(* grib_data_tell_proc)(const grib_context *c, void *stream) |
Grib data tell, format of a procedure referenced in the context that is used to tell the current position in a stream.
| c | : the context where the tell will apply | |
| *stream | : the stream |
| typedef size_t(* grib_data_write_proc)(const grib_context *c, const void *ptr, size_t size, void *stream) |
Grib data read write, format of a procedure referenced in the context that is used to write to a stream from a resource.
| c | : the context where the write will apply | |
| *ptr | : the resource | |
| size | : size to read | |
| *stream | : the stream |
| typedef void(* grib_free_proc)(const grib_context *c, void *data) |
Grib free procedure, format of a procedure referenced in the context that is used to free memory.
| c | : the context where the memory freeing will apply | |
| data | : pointer to the data to be freed must match |
| typedef void(* grib_log_proc)(const grib_context *c, int level, const char *mesg) |
Grib loc proc, format of a procedure referenced in the context that is used to log internal messages.
| c | : the context where the logging will apply | |
| level | : the log level, as defined in log modes | |
| mesg | : the message to be logged |
| typedef void*(* grib_malloc_proc)(const grib_context *c, size_t length) |
Grib malloc procedure, format of a procedure referenced in the context that is used to allocate memory.
| c | : the context where the memory allocation will apply | |
| length | : length to be allocated in number of bytes |
| typedef void(* grib_print_proc)(const grib_context *c, void *descriptor, const char *mesg) |
Grib print proc, format of a procedure referenced in the context that is used to print external messages.
| c | : the context where the logging will apply | |
| descriptor | : the structure to be printed on, must match the implementation | |
| mesg | : the message to be printed |
| typedef void*(* grib_realloc_proc)(const grib_context *c, void *data, size_t length) |
Grib realloc procedure, format of a procedure referenced in the context that is used to reallocate memory.
| c | : the context where the memory allocation will apply | |
| data | : pointer to the data to be reallocated | |
| length | : length to be allocated in number of bytes |
| void grib_context_delete | ( | grib_context * | c | ) |
Frees the cached definition files of the context.
| c | : the context to be deleted |
| grib_context* grib_context_get_default | ( | void | ) |
Get the static default context.
| void* grib_context_get_user_data | ( | grib_context * | c | ) |
get userData from a context
| c | : the context from which the user data will be retreived |
| grib_context* grib_context_new | ( | grib_context * | c | ) |
Create and allocate a new context from a parent context.
| c | : the context to be cloned, NULL for default context |
| void grib_context_set_buffer_memory_proc | ( | grib_context * | c, | |
| grib_malloc_proc | griballoc, | |||
| grib_free_proc | gribfree, | |||
| grib_realloc_proc | gribrealloc | |||
| ) |
Sets memory procedures of the context for large buffers.
| c | : the context to be modified | |
| griballoc | : the memory allocation procedure to be set |
| gribfree | : the memory freeing procedure to be set |
| void grib_context_set_dump_mode | ( | grib_context * | c, | |
| int | mode | |||
| ) |
Sets context dump mode.
| c | : the context to be modified | |
| mode | : the log mode to be set |
| void grib_context_set_logging_proc | ( | grib_context * | c, | |
| grib_log_proc | logp | |||
| ) |
Sets the context logging procedure used for system (warning, errors, infos .
..) messages
| c | : the context to be modified | |
| logp | : the logging procedure to be set |
| void grib_context_set_memory_proc | ( | grib_context * | c, | |
| grib_malloc_proc | griballoc, | |||
| grib_free_proc | gribfree, | |||
| grib_realloc_proc | gribrealloc | |||
| ) |
Sets memory procedures of the context.
| c | : the context to be modified | |
| griballoc | : the memory allocation procedure to be set |
| gribfree | : the memory freeing procedure to be set |
| void grib_context_set_path | ( | grib_context * | c, | |
| const char * | path | |||
| ) |
Sets the context search path for definition files.
| c | : the context to be modified | |
| path | : the search path to be set |
| void grib_context_set_persistent_memory_proc | ( | grib_context * | c, | |
| grib_malloc_proc | griballoc, | |||
| grib_free_proc | gribfree | |||
| ) |
Sets memory procedures of the context for persistent data.
| c | : the context to be modified | |
| griballoc | : the memory allocation procedure to be set |
| gribfree | : the memory freeing procedure to be set |
| void grib_context_set_print_proc | ( | grib_context * | c, | |
| grib_print_proc | printp | |||
| ) |
Sets the context printing procedure used for user interaction.
| c | : the context to be modified | |
| printp | : the printing procedure to be set |
| void grib_context_set_user_data | ( | grib_context * | c, | |
| void * | udata | |||
| ) |
Sets user data in a context.
| c | : the context to be modified | |
| udata | : the user data to set |
| grib_context* grib_get_context | ( | grib_handle * | h | ) |
Retreive the context from a handle.
| h | : the handle used to retreive the context from |
| void grib_gribex_mode_off | ( | grib_context * | c | ) |
Set the gribex mode off.
Grib files won't be always compatible with gribex.
| c | : the context to be deleted |
| void grib_gribex_mode_on | ( | grib_context * | c | ) |
Set the gribex mode on.
Grib files will be compatible with gribex.
| c | : the context to be deleted |
| void grib_gts_header_off | ( | grib_context * | c | ) |
Set the gts header mode off.
The GTS headers will be deleted.
| c | : the context to be deleted |
| void grib_gts_header_on | ( | grib_context * | c | ) |
Set the gts header mode on.
The GTS headers will be preserved.
| c | : the context to be deleted |
| void grib_multi_support_off | ( | grib_context * | c | ) |
Turn off support for multiple fields in single grib messages.
| c | : the context to be modified |
| void grib_multi_support_on | ( | grib_context * | c | ) |
Turn on support for multiple fields in single grib messages.
| c | : the context to be modified |


object apache_lookup_uri ( string $filename )
This performs a partial request for a URI. It goes just far enough to obtain all the important information about the given resource. This function is only supported when PHP is installed as an Apache module.
An object of related URI information. The properties of this object are: status the_request status_line method content_type handler uri filename path_info args boundary no_cache no_local_copy allowed send_bodyct bytes_sent byterange clength unparsed_uri mtime request_time


WITNESS LIST Criminal Jurisprudence Committee (Subcommittee on Civil Commitment of Violent Offenders) March 27, 1998-9:30A Civil Commitment/Violent Offenders On: Briscoe, Judy (TX Youth Commission) Collier, Bryan (TDCJ/Parole Division) Dow, Susan (TX Juvenile Probation) Fabelo, Tony (Criminal Justice Policy) Gilbert, Don (TX MHMR) Marin, Linda (TX CURE) McLane, Marsha (TDCJ/Parole Division) McVey, Catherine (TDCJ/Programs/Services) Rodriquez, Victor (Board Pardons/Paroles)


Your passion
Your Goal
Your Career
- A walk-through
Pragyan Social Responsibility, Pragyan '13
A Quote to begin with
In the road of life, you will see a lot of people walking along on the path. Don't just follow them! Take your own path! You will see a whole new world!
What actually matters?!
These are the keypoints to be considered before deciding any career, before pursuing your future goals
- Your Passion/Interest (Actually thats all that matters!)
- Scope/Opportunities
- Does it match your strengths?
- Are you really interested?! (Ask again!)
Because admiration is different from passion!
So what are the options available?
Doctor | Engineer
Thats it?!
No!
Not at all!
Confused?!
This might give a better picture!
There are still a lot of courses left out there!
Search online!
Ask others!
Go explore outside and
try to find your passion!
Few online links that may be useful:
Few sites that you might lookup:
And another link..
(A clear chart with all details for many entrance exams!)
http://goo.gl/TngqV
Do a SWOT analysis!
Later, We'll discuss about this in detail!
Archaeology
- Interested in History, Mystery?
- Curious about Heritage sites, Ancient temples, Angkor wat, Aadhichanallur?
- Inspired by Harappa and Mohenjadaro, Indiana Jones?
Fundae: Did you know Erumbeeswarar Temple in Thiruverumbur is a heritage site?
Find yourself at,
Banaras Hindu University, ASI, many more!
Find your passion at,
- Archaeological Survey of India (ASI)
- Indian Council of Historical Research (ICHR)
- National Museum
Refer to,
Liberal Arts
- Have varied interests?
- Interested in literature
- Creativity, your own expressive methods?
- Inspired by Mano, Pappaiyya?
Refer to,
Political Science
“Only those who are crazy enough to think they can change the world, end up changing the world”
- Want to make an impact in society?
- You have that leader in you?
- Be the change you want to see in the society!
Find your passion at,
- TamilNadu Arts & Science College
- Madras University
- Loyola
- Annamalai University
- Delhi University
Refer to,
Photography
- Passion, Interest, Films?
- Are you the Srikanth from Nanban?
- Remember that photographers were the crucial reasons behind Vietnam war’s start/end, Korean Revolution, European Revolution!
Refer to,
Journalism / Mass Commn.
- News, Travel, Reaching the people
- Have the power to bring the change!
Find your passion at,
- Pondicherry University
- Asian College of Journalism, Chennai
- Madras Christian College, Chennai
- Annamalai University
Refer to,
Law
- Do you live by a set of rules?
- Do you want to bring order to the society?
- Be the next Gandhi, Ambedkar!
Find your passion at,
- Madras University
- Dr. Ambedkar Law University
- Govt Law College, Trichy, Thirunelveli, Coimbatore
Refer to,
Army, Navy, Airforce
- Service, Patriotism, Bravery, Intelligence, Dedication
Find your passion at,
- National Defence Academy, Khadakvasla (W. Bengal)
- Indian Military Academy, Dehra Dun (Uttaranchal)
- Rashtriya Indian Military College, Dehra Dun (Uttaranchal)
- Officer’s Training School, Chennai
Refer to,
Sports & Physical Education
Change the ill-state and join the league!
Find your passion at,
- Madras University
- Bharathiyar University, Coimbatore
- Madurai Kamaraj University, Madurai
Refer to,
Animation
- Multimedia, movies, design?
- Be on the names of Disney
- Start the next Pixar!
Refer to,
Cinema, Dramatrix, Entertainment
- Acting, Direction?
- Become the next Kamal haasan, Mani Rathnam, Shankar!
Find your passion at,
- Madras Film Institute
- Chennai film School
- South India Film Institute
Commerce / Economics / Finance
- Feeling bad about how our economy works?
- Want to drive the future companies and societies?
- You have a solution for inclusive development?
- Become the next Amartya Sen!
Find your passion at,
- Madras Christian College
- Pachaiyappa's
- Presidency College
Science
- Inspired by Science?
- Curious of Current Discoveries, LHC, string theory, nano-technology?
- Want to do your research?
- Can even join engineering in future!
- Nobel Prize, why not us?
Find your passion at,
- Chennai Mathematical Institute
- IISER [Indian Institute of Science, Education, Research], Pune
- IISc, Bangalore
- TIFR, Mumbai
Refer to,
Vocational Courses
Don't forget the Vocational Courses, Correspondence courses from IGNOU and many other Universities!
There are lots of options! Choose wisely!
Career Prospects
[Take these into consideration!]
- Passion
- Work-Life Balance
- Work Satisfaction
- Impact on Society
- Work Place and Perks
- Climbing the corporate ladder
Finishing touch :)
We are all trying so hard to be mediocre in life with our tasteless ambitions and goals!
Go, Find your passion!
And challenge the world of mediocrity!
Next on,
Refer to this slide deck for information related to CS


| 380 | (A) | Off this wankiłłe werlde that thay hade were fowndyn |
| 384 | (C) | And of þis wantone worme . is wondur to here |
| 385 | (D) | And of þat wantoun worme is wondur to here |
| (E) | ---- no text ---- | |
| (Ex) | ---- no text ---- | |
| 394 | (L) | Of þis wlonfulle worde þer þei werre fondyn |
| 368 | (P) | Of þese wankyłł folke þer þai war funden |
| 378 | (U) | And of this wanton worme / is wonder to here |
| (V) | ---- no text ---- |


Page Not Found We are sorry. Despite our byte elves' best effort we could not find the page you requested!


Website
Name
HOME
More
Sign In/
Sign Up
About
About You or About Yourself.
!Anything
Have a nice day :-)
>
Contact Us Via<EMAIL_ADDRESS>Copyright© 2020 dev code- akshat1222


Command Line: auto-completion
Issue 2934: 1.6a7 console and auto-complete (needs "window." prefix)
Steps to reproduce
- Open Firebug
- Enable and switch to the Console panel
-
Type
doc
into the Command Line and then press Tab
⇒ The Command Line should auto-complete the text to document
.
-
Type
.
into the Command Line and then press Backspace
⇒ The Command Line should contain document
.
-
Press
Enter
⇒ The Command Line should be empty.
-
Press
↑
⇒ The Command Line should contain document
again.
-
Press
↓
⇒ The Command Line should be empty again.
-
Press
↑
⇒ The Command Line should contain document
again.
-
Press
Escape
⇒ The Command Line should be empty again.
-
Type
document.id.
into the Command Line and then press Tab
⇒ The Command Line should contain document.id.
.
-
Press
Enter
Expected result
- Basic Command Line auto-completion features should work.
Issue 3598: Commandline completion when defining objects/strings
Steps to reproduce
- Open Firebug
- Enable and switch to the Console panel
-
Type the following texts into the Command Line, press
Tab
followed by
Enter
to clear the Command Line.
[{w
a = [{w
a = [{w
a = "w
"w
Expected result
- None of these should auto-complete
window
.
Issue 3592: commandline completion should recognize regular expressions
Steps to reproduce
- Open Firebug
- Enable and switch to the Console panel
-
Type the following texts into the Command Line, press
Tab
followed by
Enter
to clear the Command Line.
/hi
/hi/i
Expected result
- None of these should auto-complete.
Issue 3600: Commandline completion rotates suggestions unnecessarily
Steps to reproduce
- Open Firebug
- Enable and switch to the Console panel
- Execute
aaaaaBBB = 1; aaaaaCCC = 2; aaaaaD = 3;
in the Command Line.
-
Type
aa
into the Command Line and then press Tab
⇒ The Command Line should contain aaaD
.
-
Press
Escape
⇒ The Command Line should contain aa
with aaaD
as completion suggestion.
-
Press
Escape
again
⇒ The Completion List Popup should be closed
⇒ The Command Line should still contain aa
with aaaD
as completion suggestion.
-
Press
Escape
again
⇒ The Command Line should still contain aa
, but there shouldn't be a completion suggestion.
-
Type
aa
into the Command Line
⇒ The Command Line should not have any completion suggestion.
-
Press
Escape
again
⇒ The Command Line should be empty again.
-
Type
aa
into the Command Line and then press ↑
followed by Tab
⇒ The Command Line should contain aaaaaBBB
.
-
Press
Enter
-
Type
aa
into the Command Line and then press ↓
followed by Tab
⇒ The Command Line should contain aaaaaBBB
.
-
Press
↓
⇒ The Command Line should be empty again.
-
Type
aa
into the Command Line and then press →
followed by Tab
⇒ The Command Line should contain aaaaaD
.
-
Press
Enter
Expected result
- None of these should auto-complete.


Chrome Native Bridge example
Run the
chat.js
script in Node, then click the button below to start.
Connect to chat
Send


I've done a little more work on the emoncms myelectric dashboard interface (version 8.0.8 of emoncms https://github.com/emoncms/emoncms/releases/tag/8.0.8)
There's improved responsive design, the number of bars displayed depends on the width of the display, the bar chart height also changes to better fit the screen.
The dashboard settings can now be accessed via the wrench icon top-right.
and the main thing is that its now possible to use different feed types to generate the daily kwh bar graph. Its possible to use watt hour or kwh elapsed feeds (using the approach explained here: http://openenergymonitor.org/emon/node/3995). Its possible to use the daily feed type as generated by the power_to_kwhd input processor and its possible to use timestore or phpfiwa (php - fixed interval with averaging) instantaneous power feeds as these generate hourly averaged layers which can then be used to generate average daily power thats then converted to daily kwh by multiplying by 0.024.
Here are some screens of what it looks like:
Desktop/Laptop view:
Mobile view:
Config interface:
The bar graph feed type dropdown select input has the following options: watt hours elapsed, kwh elapsed, kwh per day, power (Watts) to select the feed type that you want to use, as each feed type is handled differently but all can be used to generate daily kwh values.
There's a lot of things Id like to do to expand this pre-built dashboard interface: add the option to create different tabs for different household circuits, solar pv, building thermal performance, tooltips, energy cost information, option to see last 24h realtime data and so on.
Here are some concepts of what Im thinking, (left most one already developed). Ultimately it might be possible to create an account in emoncms and then when an emontx gets detected it could fire up a wizard that then asks what channel is the emontx measuring home electric on, which channel is solar pv and so on, emoncms would then autoconfigure the input processing and create the applicable dashboard interfaces:
Re: myelectric dashboard improvements v8.0.8
very very nice ! congrats !
Re: myelectric dashboard improvements v8.0.8
Nicely presented and very easy to read on a phone.
Is there any read-only access to the page - (without sending the API key in the URL).
Paul
Re: myelectric dashboard improvements v8.0.8
Good job, Trystan! You solved all of the issues and now My Electricity panel is a great interface for mobile device ! Maybe one tip for future development - for me would be great to have stacked bar option - I have separate heating and separate warm water preparation consumption feed. In a dashboard Im using these two feeds kwh/d showed as a stacked bar and to get them to this mobile device would be great.
Anyhow - your other concepts look pretty cool and I cant wait to them. Now Im studying your cookbook about Emoncms architecture to be able to participate in future development of this great system and not just sit and wait.
Good luck and thanks for your effort!
Re: myelectric dashboard improvements v8.0.8
Thanks!
Paul: not yet, it could have a make public option like the other dashboards i guess.
rbreuss: i agree that would be nice.This tutorial might be useful too http://openenergymonitor.blogspot.co.uk/2013/12/tutorial-on-how-to-create-emoncms-module.html
Re: myelectric dashboard improvements v8.0.8
Re; Twitter post tonight asking for feedback...
The information is clear & concise with a nice contemporary design, and having used it for a week or so, I've grown to like it!
I'm sure that not everyone would agree, but I would prefer to lose the top header & menu option - especially if there is a 'public option'.
This would free up some real estate, possibly leaving some space for 'tabs' to be introduced, and reduce the temptation to look behind the scenes at inputs/feeds/dashboards etc.
Also, would there be a way allow users to add/select what tabs that they would like to see, so for example, not everyone is monitoring solar, some are monitoring gas/water/temp/whatever. Maybe add tabs via a library? (and should it be called 'myelectric'?)
Paul
Re: myelectric dashboard improvements v8.0.8
Super Trystan, well done,
I like the solar and the house options. I am thinking this could be a great replacement for the emonglcd if used on a small android tablet mounted on a wall. This is what we are hoping to do with ours as it has even more presence than the small lcd of the Glcd. Great work keep it up!
Regards
Nathan
Re: myelectric dashboard improvements v8.0.8
Paul, Nathan, thankyou for the comments
Paul: Yes might be interesting to look at how the tabs could be moved to the top menu and then a settings button that provided access to inputs, feeds etc. I was thinking to initially put the tabs in the space above the top gray line.
Yes some kind of configuration interface a way to add multiple tabs of say the 'myelectric' view for different monitored circuits and whether you have pv or room temperature monitoring. I agree 'myelectric' as a module name will need to be changed soon as this module develops.
Nathan: We've been wondering about this too, being able to use web technologies to make the display is nice, I have the myelectric dashboard as a bookmark on my mobile home screen and dock it when its in the house so that its always showing the dashboard.
Re: myelectric dashboard improvements v8.0.8
I am currently using an old HTC Desire phone as my display unit sitting in a stand charger. Needs an app to keep wifi running then just view a dashboard in a browser.
These new dashboards look great. I really need to upgrade my Emoncms but I really do not want to as it will be a faf as the Pi runs a load of other stuff as well.
Re: myelectric dashboard improvements v8.0.8
I am thinking a app for iphone/pad and android would be the best option but personally have no idea how to do it. Must have a look into it and see how hard it is.
Cheers
Nathan
Re: myelectric dashboard improvements v8.0.8
This is an old question asked, but some may still be looking for a solutition ::
Is there any read-only access to the page - (without sending the API key in the URL)
I modified my myelectric_controller.php to check for the read key (atleast not exposing my write key), but this does not get around NOT using your api key altogether ..
if ($route->action == "view" && $session['read']) $result = view
This way you can see your myelectric changing the link by inserting the read apikey :)


PyCon India, this year was held at New Delhi at the JNU Convention Center.
Dev Sprints
During the Dev Sprint, Farhaan and Vivek were sprinting on Fedora Infrastructure projects primarily helping people contribute to Pagure.
Other projects/orgs like SciPy, Red Hat team, FOSSAsia, Junction etc were also sprinting.
The Dev Sprint turned out to have a good participation and couple of PRs were sent out by the participations. More than that, it’s more about participants getting to know about on how to contribute.
Red Hat Booth
Red Hat being a PyCon India sponsor did set-up a booth. Praveen, Suraj, Trishna, Ganesh, Rupali were talking to people, explaining them about different topics ranging from contributing to open source to products & services Red Hat provides.
I did stumble upon the booth a couple of times and helped them out to know how to contribute the Fedora Infrastructure project.
The booth was shared with PyLadies Pune (Kudos to Rupali, for letting them share the booth)
Talks
I mostly spend my time at the hallway talking/discussing stuffs with people. But I do attend the interesting talks.
I attended the talk by @rtnrpo and @bamachrn. Sadly both their talks were in the same slot.
@bamachrn explained the complete CentOS Community Container Pipeline.
@rtnpro talked on how we went ahead and built ircb by implementing Realtime microservices with server-side Flux.
Recently, I have been trying to work on my knowledge on licenses. @anwesha talk was one good talk which gave an idea on why to use a license, which license to choose when and other pros and cons.
DGPLUG Annual Meet
Every year at PyCon India, we have our annual DGPLUG meet at the conference, where people from different part of the country and we can meet each other once a year. We discussed what they gained from this year’s training. What’s wrong? What’s stopping them from contributing. We were joined by Sartaj, he shared valuable ideas and how to work on thinking process to contribute.
PyLadies
This year PyCon India had a presence of Pyladies. During the Open Space session, there was a open discussion about PyLadies and where Jeff Rush, Van Lindberg, Paul Everitt, Dmitry Filippov joined to share their experience in community.
Btw, we did have a really nice PyLadies umbrella as prop at the PyLadies booth.


{{answer.text}}
{{answer.text}}
Please select questions based on tags or all.
Score
| Score: | {{score}} of {{ answers.length }} |
| Score %: | {{scorePercentage | percent}} |


Journey through Reactive Manifesto leveraging Akka
### 1. Responsive
System responds in a timely manner if at all possible
### 2. Resilient
System stays responsive in the face of failure (replication, containment, isolation and delegation)
### 3. Elastic
System stays responsive under varying workload
### 4. Message-Driven
- Asynchronous message-passing (asynchronous boundaries)
- Loose coupling, isolation, location transparency
- Load management (back-pressure)
Actor Model - Quick overview
Higher level of abstraction for building highly concurrent, distributed, and resilient message-driven applications
Akka Stream - Quick overview
Akka Persistence - Quick overview
Enables stateful actors to persist their internal state so that it can be recovered when an actor is started, restarted after a crash
Akka Cluster - Quick overview
Fault-tolerant decentralized peer-to-peer based cluster
DEMO
[Code & slides available at: https://github.com/HimanshuArora1234/Reactive-Akka-Presentation](https://github.com/HimanshuArora1234/Reactive-Akka-Presentation)
### Thanks very much


List
Axure Kit
Carbon
Updates
Common widgets
Style effects
Variables
Selection group
Repeater
Dynamic panel
Introduction
Axure elements
Utilities
UI shell
Tooltip
Toggle
Tile
Text input
Tag
Tabs
Structured list
Slider
Select
Search
Radio button
Progress indicator
Pagination
Overflow menu
Number input
Notification
Modal
Loading
List
Link
Inline loading
Form
File upoader
Dropdown
Date picker
Data table
Content switcher
Code snippet
Checkbox
Button
Breadcrumb
Accordion
Components
Typography
Spacing
Icons
Color
Design elements
Library index
Getting started
Components
Privacy
Have questions? Open an issue on GitHub.
Last updated 29 January 2020
Copyright © 2020 IBM
Terms of Use
Contribute
IBM.com
Unordered list
Library section:
Interactions:
Text
–
Unordered list level 1
–
Unordered list level 1
–
Unordered list level 2
Unordered list level 2
Unordered list level 2
Unordered list level 1
–
Ordered list
Library section:
Interactions:
Text
–
Ordered list level 1
3.
Ordered list level 1
2.
Ordered list level 2
c.
Ordered list level 2
b.
Ordered list level 2
a.
1.
Ordered list level 1


| Package | Description |
|---|---|
| weka.core | |
| weka.core.converters | |
| weka.core.expressionlanguage.weka | |
| weka.experiment | |
| weka.gui | |
| weka.gui.boundaryvisualizer | |
| weka.gui.experiment | |
| weka.gui.explorer | |
| weka.gui.sql |
| Class and Description |
|---|
| Stats
A class to store simple statistics.
|
| Class and Description |
|---|
| DatabaseUtils
DatabaseUtils provides utility functions for accessing the experiment
database.
|
| Class and Description |
|---|
| Stats
A class to store simple statistics.
|
| Class and Description |
|---|
| ClassifierSplitEvaluator
A SplitEvaluator that produces results for a
classification scheme on a nominal class attribute.
|
| Compute
Interface to something that can accept remote connections and execute
a task.
|
| CrossValidationResultProducer
Generates for each run, carries out an n-fold
cross-validation, using the set SplitEvaluator to generate some results.
|
| CSVResultListener
Takes results from a result producer and assembles
them into comma separated value form.
|
| DatabaseResultListener
Takes results from a result producer and sends them
to a database.
|
| DatabaseUtils
DatabaseUtils provides utility functions for accessing the experiment
database.
|
| Experiment
Holds all the necessary configuration information for a standard type
experiment.
|
| InstanceQueryAdapter
An interface implemented by InstanceQuery and any user class that is
to be passed as the first argument to
InstanceQuery.retrieveInstances(InstanceQueryAdapter, ResultSet).
|
| PairedStats
A class for storing stats on a paired comparison (t-test and correlation)
|
| PairedTTester
Calculates T-Test statistics on data stored in a set of instances.
|
| PropertyNode
Stores information on a property of an object: the class of the object with
the property; the property descriptor, and the current value.
|
| RemoteExperimentEvent
Class encapsulating information on progress of a remote experiment
|
| RemoteExperimentListener
Interface for classes that want to listen for updates on RemoteExperiment
progress
|
| ResultListener
Interface for objects able to listen for results obtained
by a ResultProducer
|
| ResultMatrix
This matrix is a container for the datasets and classifier setups and their
statistics.
|
| ResultProducer
This interface defines the methods required for an object
that produces results for different randomizations of a dataset.
|
| SplitEvaluator
Interface to objects able to generate a fixed set of results for
a particular split of a dataset.
|
| Stats
A class to store simple statistics.
|
| Task
Interface to something that can be remotely executed as a task.
|
| TaskStatusInfo
A class holding information for tasks being executed
on RemoteEngines.
|
| Tester
Interface for different kinds of Testers in the Experimenter.
|
| Class and Description |
|---|
| PropertyNode
Stores information on a property of an object: the class of the object with
the property; the property descriptor, and the current value.
|
| Class and Description |
|---|
| RemoteExperimentListener
Interface for classes that want to listen for updates on RemoteExperiment
progress
|
| Task
Interface to something that can be remotely executed as a task.
|
| TaskStatusInfo
A class holding information for tasks being executed
on RemoteEngines.
|
| Class and Description |
|---|
| Experiment
Holds all the necessary configuration information for a standard type
experiment.
|
| RemoteExperiment
Holds all the necessary configuration information for a distributed
experiment.
|
| ResultMatrix
This matrix is a container for the datasets and classifier setups and their
statistics.
|
| Class and Description |
|---|
| InstanceQuery
Convert the results of a database query into instances.
|
| Class and Description |
|---|
| DatabaseUtils
DatabaseUtils provides utility functions for accessing the experiment
database.
|
Copyright © 2018 University of Waikato, Hamilton, NZ. All Rights Reserved.


--- layout: page title: About header-img: "img/about-bg.png" ---
Electrical engineer, Started to become a Software engineer with Flatiron school.


| PostgreSQL 9.0.10 Documentation | ||||
|---|---|---|---|---|
| Prev | Up | Chapter 18. Server Configuration | Next |
For convenience there are also single letter command-line option switches available for some parameters. They are described in Table 18-2. Some of these options exist for historical reasons, and their presence as a single-letter option does not necessarily indicate an endorsement to use the option heavily.
Table 18-2. Short option key
| Short option | Equivalent |
|---|---|
| -A x | debug_assertions = x |
| -B x | shared_buffers = x |
| -d x | log_min_messages = DEBUGx |
| -e | datestyle = euro |
| -fb, -fh, -fi, -fm, -fn, -fs, -ft | enable_bitmapscan = off, enable_hashjoin = off, enable_indexscan = off, enable_mergejoin = off, enable_nestloop = off, enable_seqscan = off, enable_tidscan = off |
| -F | fsync = off |
| -h x | listen_addresses = x |
| -i | listen_addresses = '*' |
| -k x | unix_socket_directory = x |
| -l | ssl = on |
| -N x | max_connections = x |
| -O | allow_system_table_mods = on |
| -p x | port = x |
| -P | ignore_system_indexes = on |
| -s | log_statement_stats = on |
| -S x | work_mem = x |
| -tpa, -tpl, -te | log_parser_stats = on, log_planner_stats = on, log_executor_stats = on |
| -W x | post_auth_delay = x |


{{ tweet.name }}
{{ tweet.screenname }} {{ tweet.date
}}
{{ tweet.text }}
It’s been already more than 6 months that the first Global Startup Weekend in the world dedicated to Artificial Intelligence took place in 11 cities around the world. In September 2017, during two weekends, one hundred web developers, graphic designers, business experts, engineers, researchers and students interested in the entrepreneurial experience worked intensively on functional startup prototypes. This global initiative is more than a simultaneous event in several places around the world: it is federating a genuine community around artificial intelligence, democratising its use, and making it more diverse, inclusive and impactful by removing boundaries.
{{ tweet.name }}
{{ tweet.screenname }} {{ tweet.date
}}
{{ tweet.text }}


Menu
Hello, I am a full-stack web developer living in Virginia. I am building web applications primarily using React and Node Express.
I am constantly developing my skills, and would be a great addition to your team.
I am drawn to the creative and technical challenges of web development, and it inspires me to be engaged in different projects.
I enjoy knowing that what I create will be used by real people and will enhance their lives. Working in a team to create outstanding products is very appealing to me,
I love to meet interesting people who are dedicated to their work.
I am proficient in both front-end and back-end development, here is some of the tech I use to create modern and fully functional applications:
Messaging browser app using React for the client, users can create accounts and add other users as contacts. They can send and receive messages in real time. Account security is ensured via password encryption using Bcrypt, and endpoints are protected using sessions, CORS is used to add a further level of security to the app. Real time messsaging is handled through Pusher, an API that is used in the front and back end to allow real-time communication by utilizing web sockets.
With this application, a user has a place to store notes. Full functionality includes the ability to delete, edit, retrieve and create new notes, using a clean and easy to use UI. Lambda Notes is a 2 part project that consists of a backend CRUD API, and a front end client sending and requesting data. Using Axios, the client submits CRUD operations to the back-end.
S&J Architecture is a landing page for a fictional company, this beautiful and modern UI was built to match the provided design files and assets. Some notable features of this web page include, fully responsive design and mobile version. Its a multi-page website, that uses Javascript for additional functionality to provide an engaging and easy to use experience for the user.


@JvmStatic val MAE: SingleOutputFitnessFunction<Double>
Mean absolute error fitness function.
Simply sums up the absolute differences between the outputs and takes the mean.


Upon examaning all the values important to me, I found it hard to focus on only a couple of them, because they are all related in some way. They represent important human qualities, and they represent how we treat ourselves, each other, and the world around us. But the value I chose to reflect upon is enthusiasm.
The values I decided to inspect closer were: Ambition, Community, Competence, Creativity, Enthusiasm, Growth, Hospitality, Inspiration, Integrity, Music, Nature, Quality, Romance. What I found really interesting about this list was that it's almost split down the middle of qualities that are directly related to me, and qualities that are directed towards other people around me. But I'm going to focus in on one in particular, enthusiasm.
Enthusiasm sounds like a silly one perhaps. Next to ambition and integrity, it doesn't sound as "deep," but it is a quality that I have always strive to have. Have you ever met somebody who is so "into" what they do, that they convince you that it's the greatest thing ever? It's an incredibly captivating feeling. Being around a positive and enthusiastic person inspires a lot of joy, and it can make even the toughest tasks enjoyable.
In my years playing a wide variety of gigs as a musician, enthusiasm is always something I look for in band-mates. Not all gigs are great. In fact most of them are not great. But the people I like to surround myself with are the people who make the best out of bad situations. They're the type of people who bring other's up with them, even if there is no reason to be high spirited. This is the type of person I have always strive to be.
As I touched on last week in light of "stereotype threat," positive affirmation is best cure. I sometimes think to myself whether truly enthusiastic people are actually that "into" what they're doing, or whether they understand themselves enough to know that they can "pump themselves up" by using enthusiasm as a positive affirmation. It's not a bad idea.
Next time hour 3 goes by on the same challenge, and your ready to throw your computer and give up, think to yourself "How cool is this! I'm creating something with my brain, and even though it's not working, look how close I am to getting it! I definitely wouldn't have been able to get this far 9 weeks ago!" Exclamation mark's aside, you get the point.
Enthusiasm is infectious. It inspires others to grow, be ambitious, be creative, have integrity, and so many of the other important values in life.


AUTOSTART
IAUC:
TC-WEB:
synch
Last sync: undefined
My Cars
Market Price
Settings
My Lists
Help
search
Search DLM personal database
search
Search DLM personal database
search
Search DLM personal database
Content Title
Content
⇤
←
→
⇥
Date


Mastermind
Welcome to Mastermind
Please choose a difficulty level and enter your name:
Easy
Normal
Hard


- SERVICES
- Venues
- Photography
- Flowers
- Receiption
- See All Services
- CHAPEL
- Meet the Staff
- View a Wedding
- Login
- My Account Page
- Careers
- Contact Us
- NEED TO KNOW
- Wedding Blog
- Testimonials
- FAQs
- What Sets Us Apart
- Marriage Licensing
- Contracts
- MEDIA AND PARTNERS
- Digital Brochure
- Chapel Videos
- Become a Partner
- Login
- Address
- Phone Number


Home Page
Pat's Salmon Cookie Stand Shopping Page
Shipping Information
Orders confirmed and will be shipped within 2 business days. Tracking number will be emailed
First Name:
Last Name:
Address:
Apt/Suite/Lot:
City:
State:
Zip:
NEXT


Content
- Testing solidity smart contract
- Writing tests in javascript, typescript and solidity
- Openzeppelin helpers, waffle, truffle
Testing solidity smart contracts
- Testing is the primary job of developer
- Little time spend writing solidity code and more utilized writing contract
TDD Overview
- Fully understand the requirement
- Create automated tests that test the requirement
- Create the coding logic -- test it by running the automated test(s)
- Once the automated test(s) pass, the coding then fulfills the requirement
- Refactor the code for better maintainability, run the automated test(s) again to ensure it still works
Functional Tests
- Unit tests : Keep units small, test single or very small groups of functions/methods or parameters at a time.
- Integration tests : Interact with external class, module or datasource.
Unit tests
- Good unit tests
- Run fast (they have short setups, run times, and breakdowns).
- Run in isolation (you should be able to reorder them).
- Use data that makes them easy to read and to understand.
- Use real data (e.g. copies of production data) when they need to.
- Represent one step towards your overall goal.
Integration tests
- Good for uncovering whether all the parts work together or not.
Test frameworks (Truffle use them under hood)
Hooks in Mocha
before()
— Runs once before the first test case in the block
beforeEach()
— Runs before each test case
afterEach()
— Runs after each test case
after()
— Runs once after the last test case in the block
- Sequence of Hooks
before() -> beforeEach() -> test() -> afterEach() -> after()
Demo
- Writing tests using Truffle
- Writing tests for Hardhat
Coverage
- Given the nature of smart contract development, where data is literal value, testing practises needs to be stringent. 100% code coverage is not maximum to aim, its must.
Achieving 100% Coverage
- Positive test
- Test that code behaves as expected when valid data is given.
- Negative tests
- Test that code behaves as expected when invalid data is given.
Solidity code coverage tools


This report will be disclosed to the prisoner.
Consider how you present sensitive information in this section - do not record VLO details.
The VPS should be submitted with this report if possible.


Wonky Drum Seq
The Wonky Drum Sequencer was design in collaboration with STEIM during project "A Square dreams A Sphere". It is a MIDI step sequencer that process a virtual drum machine.
The instrument it's been used as a guideline to give a 4 days workshop where the participants followed step by step the process of designing the controller.
All the files needed to reproduce the Wonky Drum seq are available here And it is possible to make one using the common Fablab machines. The Wonky Drum Seq is released with a Creative Commons BY-NC-SA licence The project is funded by the Netherlands Creative Industries Fond
×


Alignment control classes include .justify-content-center and .justify-content-end:
.justify-content-center
.justify-content-end


| Authors: | Jon Tirsen |
|---|---|
| Version: | 1.0 - May 2009 |
Google Wave's primary means of access control is the list of addresses that participate on a wavelet and what access accounts has to these addresses. This white paper outlines how the wave platform stores, exchanges and enforces access control.
This whitepaper is part of a series. All of the whitepapers can be found on Google Wave Federation Protocol site.
Wave access control is defined as:
Access from individuals to accounts and accounts to addresses is defined and enforced inside each wave provider and not specified in the standard. Address access is modeled as a graph where each edge in the graph grants access from one address to another address. These edges are stored in waves and are authorized by the wave provider that controls the domain of the addresses. The access edges can be exchanged between wave providers through the normal wave federation protocols.
Typically an account has access to a canonical address which is the entry point for an account into this graph, although this is wave provider specific. Operations are authorized at the source of each wave provider. If authorization spans multiple wave providers the operation needs to be sent and verified along the path of each of the involved wave providers. Different levels of access to a wavelet is still to be defined.
Each wave provider chooses how they authenticate their users. In Google Wave we use a simple username and password scheme for individuals. Robots are contacted by the Google Wave provider through a well-defined URL and are therefore authenticated that way.
Address access can be seen as a directed graph of address to address edges where each edge is restricted by access settings.
The entry point into the graph for a user or a robot is their canonical address.
There are multiple types of access which indicate what address A can do as address B.
<grant<EMAIL_ADDRESS><EMAIL_ADDRESS>until="2009-06-14T13:31Z"> <access>INDEX</access> <access>READ</access> </grant>
An operation always contains the path of authorization from the canonical address to the address the account wants to perform an operation as excluding any initial WRITE edges. Using the information available in the access wave the client builds the path and inserts it into the operation that it sends to its wave provider. After it has optimistically applied the operation to the wave in the client it sends it to its wave provider who then signs and forwards the operation to the next wave provider in the path. Every wave provider on the path will validate and sign the operation before it is finally forwarded and applied at the wave provider that owns the wavelet. This final wave provider is responsible for verifying all the signatures.
If an authorization fails, the client has typically already optimistically applied the operation to the wave so will either need to reverse those operations or indicate an error to the user. In a well-behaved system this should only occur if an access edge has been removed or changed and this change has yet to be forwarded to the clients wave provider. In this case the access wave would access edges that are no longer valid.
Groups are implemented on top of this generic access framework. Each group has an address and members. Group membership is expressed as the following edge for each member of the group:
As you can see an important detail of groups in wave is that being a member of a group does not allow you to directly write into a wave which that group is addressed to. Instead it lets you add yourself as a direct participant to that wave.
A group can be a member of another group which looks like this:
This means that wavelets addressed to both Group 1 and Group 2 will be written into the member's index and the member can read and "write" (add self as a participant) to all these wavelets.
Read-only groups mean that the "add myself" access is lacking:
An address can be a read-write member of a nested group even though it's a read-only member of an outer group:
This means the member can become a participant of wavelets addressed to Group 1 but not to wavelets addressed to Group 2.
Delegation allows an account to perform operations with another address as the author. Google Wave currently uses this for two cases:
This last case is represented as the following edge:
This provides Google Wave infrastructure services full access to act as a user, while being authenticated as a service account.
Google Wave will eventually support some level of access control on a wavelets but requirements and implementation plans have yet to be determined. For example:


Hi! My name is Isabella Broch, and I'm an illustrator and multimedia designer in training. I currently offer commissions for character art. If you're interested, please contact me at<EMAIL_ADDRESS>I am always learning new things and expanding my skillset.


{% extends "layout.html" %} {% set active_page = 'About' %} {% block content %}
Web app powered by Flask. Written by Barak Nehmad, 2016. Follow this project on GitHub!
Wanna report a bug or request a feature?


In general, Tabletop Games are designed with at least two or three players in mind. Often there's no way to automate the physical base game, needing human players to make the decisions for each side. In the case of many Tabletop RPGs, a Game Master is required to fill the various roles that the players cannot, otherwise the story would be spoiled.
But Solo Tabletop Games avert this - they can be played with just one player.
So why would anyone play them alone? Well, some people could be living in a small town where few share their interest in tabletop gaming. Their schedules might not allow them to attend local tabletop gaming meetups. Some people want the interaction of games as opposed to watching TV or movies, but want to get away from screens. Others just want to be alone, though many probably just want to get the most use out of their purchases. Most hobby tabletop games cost at least $20 to $60, and some cost $100 or more.
Whatever the reason, games can make this possible because of their mechanics: dice rolling and separate card decks that determine what sort of challenges or effects that occur. Others provide a solitaire variant, turning a game into a Self-Imposed Challenge. Another way is the game comes with an "AI" - in this case, a set of actions and rules that trigger based on what card is drawn, roll results, or player decisions.
There's plenty of House Rules by fans to allow their favorite games for solo play. To help narrow things down, examples listed as variants should be official.
Not to be confused with tabletop games based on Solo: A Star Wars Story.
Examples
- The 2005 version of Arkham Horror and its spin-offs Elder Sign and Eldritch Horror are listed for one to eight players. Game encounters and events are made by a separate deck of cards, while a character template covers the actions of the Big Bad.
- Chainsaw Warrior was marketed as a "Solo Board Game'' right on the box, though its main components are cards—the board was just used to track the player's status. Here, the player is a cybernetic supersoldier who must save New York from a zombie apocalypse by closing a dimensional rift within an hour.
- The 2011 version of Mage Knight allows one to four players. For solo play, there is a simulated player.
- Tiny Epic Galaxies has the players in the role of an expanding Space Empire. The retail version includes a solo option, by having several different AI boards. The difficulty of these Rogue Galaxies go from Beginner to Epic.
- XCOM: Enemy Unknown - the Board Game is for one to four players, who battle against aliens whose actions are determined by chance. There is also an app required, which gives random events and helps with combat calculation.
- The Omega Virus allows one to four players. The antagonist is controlled by a talking electronic console placed in the center of the board, making solo play akin to a computer game. A solo player only misses out on the chance for player characters to attack each other—and hear the Virus comment on the brazen lack of cooperation.
- Minion Hunter is a cooperative board game for one to six players. Enemy activity is controlled entirely by dice rolls and a deck of shuffled cards.
- Several standalone Warhammer 40,000 Gaiden Games have solo options, including Execution Force and Bommerz Over da Sulfur River.
- The Piecepack Wiki has a list of single-player piecepack games.
- Terraforming Mars has rules for solo play, where instead of trying to have more points than your opponents when you collectively complete the terraforming process, you try to do the terraforming by yourself in a limited number of generations.
- Solitaire with its many variants, using a deck of standard cards. The Klondike version is the best-known type of solo tabletop game, with many computer variants, including the famous version included with Microsoft Windows starting with version 3.0 in 1990. Some variations like Spider use two decks shuffled together. Others use more or use "stripped" decks.
- Death Angel is solo or co-operative. Events are determined by a deck of cards, and the genestealers just keep on attacking automatically.
- Flip City is listed for one to four players. Using variant rules, every time the player reshuffles their deck, they remove one card from the common pool. The player must achieve a victory condition before the card pool is empty.
- Friday is a solo-only deckbuilder, with the player as the titular character trying to help Robinson Crusoe survive.
- The Deck Building Game Legendary has a solitaire-only spin offs based on the ALIEN and Predator movies.
- Fantasy Flight Games' The Lord of the Rings: The Card Game is played by either 1 or 2 players. Encounters and enemies are drawn from separate decks.
- One Deck Dungeon is an RPG-style card game in the style of Roguelikes. The titular Deck contains all the monsters and treasure cards, and the Boss Monster is a template that is played when the players reach the end.
- The Pathfinder Adventure Card game is a Card Game/RPG hybrid that could be played solo. A series of cards - the Adventure Path - decide what other cards the player will encounter- monsters, locations, and cool stuff for the players.
- Race for the Galaxy gained a solo option with The Gathering Storm expansion. Here, an "AI" template using dice and chits to simulate an opponent.
- The Oniverse games are all solo/co-operative, set in a dream world with an Art Brute aesthetic.
- Onirim uses a single deck of cards to simulate a Dream maze. The player must make combos or special cards to navigate the maze, find all the door cards, and get out before the deck is empty. Opposing the player are Nightmares that forces card loss, and in general make it more difficult to succeed.
- Sylvion is a tower defense game, where the cards are arranged form the outline of a grid and the enemy cards move towards the target. Not only is the enemy are self-running, the game also comes with expansions and rules to increase the difficulty.
- Star Realms and its fantasy spin-off Hero Realms have official solo/co-op challenge cards. These challenges automatically attack, then removes a card from the trade row. A new card is added, and another effect occurs based on the drawn card's alignment.
- The publishers of Thunderstone released an official variant - with a few rule changes, the single player can play the deckbuilder without the need for others. It helps that the enemies also have their own deck and when drawn are laid down into a row.
- XenoShyft, being basically a tower defense game, can be played solo. The enemy cards are drawn from a separate deck, and the player fights each drawn card down a line.
- Ani-Mayhem could be played solo, since Disaster cards would activate either right away or before the player could make any moves.
- Magic: The Gathering has published three solo/co-operative Challenge Decks for its Theros block: Face the Hydra, Battle the Horde, and Journey into Nyx. Each deck has their own unique cards, and is self-running with its own special rules. The player wins depending on if they fulfill the right conditions.
- The Mythos CCG is based on the Cthulhu Mythos. There are solo rules in which events and threats are placed in a separate deck. When the player moves to a new location or passes a turn, the Threat deck activates. Here, the player must complete his Adventures before running out of Sanity points.
- Surprisingly for a CCG from 1999, the Tomb Raider CCG had solo rules. Avoiding the problem of most card games based on video games, Tomb Raider was able to recreate the exploration and adventure aspect.
- All games set in the Oniverse are solo-player with a 2-player cooperative variant. The Oniverse includes (among others):
- Onirim, a card game where the player uses keys to unlock doors before the deck runs out. This task is complicated with nightmares located throughout the deck, which force the player to choose between several negative effects if drawn. The second edition adds several additional mini-expansions, which can be mixed together or played separately.
- Castellion, a tile-laying game where the player must protect their castle from invaders. Each tile has a special ability, and if the tiles are in a certain layout, it gives additional bonuses like being able to reorganize tiles or gain additional time before needing to satisfy the level requirements. There are three different levels, each adding an additional layer of complexity, and easier/harder variants for each level.
- Sylvion (of no relation to "Sylveon"), a combination deckbuilder/castle defense style game where the player has to organize woodland efforts to save the Sylvan forest's denizens from a menacing forest fire. Players draft their deck before trading turns with the game, trying to both extinguish encroaching flames and revitalize the forest that's been already burned. If the blaze becomes too much for the forest to recover after the enemy deck is depleted, it's game over.
- Nautilion, a take on roll-and-move where the player rolls 3 dice and allots them to either their own submarine, an opposing vessel, and the Darkhouse, which can potentially cause negative events depending on what value was given to it. The player has to make their way across a path to the other side before the opposing sub does, and collect a complete set of crew members on the way, who can only be placed in certain spots relative to the previous members already on the ship. Fortunately, there are ways to change results to something more in the player's favour.
- The Dungeon Masters Guide in the 1st Edition of Advanced Dungeons & Dragons had a random dungeon generator based on dice rolls with notes on how to use it for solo play - as long as the player had a little self-discipline to play any encountered monsters intelligently and keep his and his character's knowledge of traps etc. separate it was perfectly usable.
- Dwarfstar Games in the 1980's released two solo-only roleplaying games: Barbarian Prince and Star Smuggler. Using boards and various pieces to keep track of the player's progress and options, the games also used a paragraph booklet which detailed information on events and actions. However, this meant the player had to reference the booklet often.
- Steve Jackson Games' Fighting Fantasy books were an early experiment to create single-player Tabletop RPG gameplay by mixing it with the Gamebooks format.
- Four Against Darkness is a dungeon crawler designed for solo play only. Rooms, events, encounters and the like are decided by dice rolls and roll result tables.
- Mythic Role Playing features independent Game Master Emulation rules composed of charts and tables that allow a player to randomize events with dice rolls. The GM Emulation rules outshine the game itself and are highly recommended by solo roleplayers.
- In the official rules for the Pocket Edition of OGRE has this option: just have the titular supertank head straight for the objective and attack anything in range. All the player has to do is roll the dice for it. The official website also provides variants to decide the Ogre's actions - including using cards or dice rolls.
- The States of Siege series by Victory Point Games is a series of historical solo scenarios. Hapsburg Eclipse and Ottoman Sunset deals with World War I, with the player taking the roles of Austria-Hungry or the Ottoman Empire, respectively.
- Osprey's The Men Who Would Be Kings includes an option to play against "Mr. Babbage" who is unfortunately not present in the club, but has left a series of rules according to which he plays his miniature wargames. There are some basic concepts (always assault if possible when playing natives) and tables to determine whether an opposing unit flees the table or regenerates.


.
This module covers Citizenship & Naturalization.
Learn to drive in United States in this module!
Find a home in this module.


My name is Joe and I'm a web and android developer.
Let's connect and see what we can develop together!


HOME

ABOUT
Search
TIME:
2Kio Events
"Challenge yourself by taking
part in an organised event and
achieve your personal Goals"
Get Started
Contacts
Copyright © Tukio 2018


Does not supports cyrillic, emotes, some characters and clipboard paste
But it supports spaces, selection (on single line), home/end keys and scrolling


In general, the Lagragian for a system with n general coordinates can be
To write down equation of motion, we need the following terms,
Then equation of motion is
Generally, we can’t solve this system. But there is an interesting limit. The system may have equilibrium points. We can study systems oscillating around equilibrium points.
At equilibrium, the system can stay steady, i.e., \(\dot q_j^0 = 0\). This gives us
for all j.
Now for small deviations, we can expand the system around equilibrium points.
Then
So we have the Lagrangian for small oscillations,
Typing indices using LaTeX is so annoying. So we’ll use matrix notations and Lagragian becomes
in which \(T\) and \(V\) matrices are n by n real and symmetric.
(We need to diagonalize T and V. First question comes to us is:
Is is possible to diagonalize both T and V at the same time?
We can have a look at the surface \(\tilde p T p = C\), which is a elliptical surface with coordinates \(p\).)
Use the following transformation
Then transpose
So we have the new Lagragian
Define \(T^{-1/2} V T^{-1/2} \equiv V'\).
Next we need to diagonalize V’ by using its eigen vectors.
is equivalent to
with \(b = T^{1/2} a\). So we have
is same as
in which \(\lambda\) is the eigen value of this function.
Harmonic oscillators are described by
which has solution
where \(\omega = \pm \sqrt{ \frac{k}{m} }\) and the final solution is determined by the second initial condition, i.e., the first order derivative of displacement.
© 2017, Lei Ma. | Created with Sphinx and . | On GitHub | Neutrino Notebook Statistical Mechanics Notebook | Index | Page Source


Tesla falls after its Cybertruck’s shatterproof windows break in a live demonstration
by Carmen Reinicke, Business Insider US- Tesla revealed its electric truck, called the Cybertruck, in a live event Thursday. During a demonstration, two “armor glass” windows were smashed by a metal ball.
- Shares fell as much as 4.1% in early trading Friday after the event.
- Tesla CEO Elon Musk said that the company would fix the problem “in post.”
- Watch Tesla trade live on Markets Insider.
Tesla is cracking under pressure, much like the windows on its electric truck.
Shares of the electric-vehicle company fell as much as 4.1% in early trading Friday after it revealed its electric truck, called the Cybertruck, in a live event Thursday evening.
The truck has long been hyped by CEO Elon Musk for its futuristic design, inspired by the movie “Blade Runner.” During the live demonstration, however, things took an unexpected turn when Tesla’s lead designer Franz von Holzhausen threw a metal ball at not one but two of the truck’s “armor glass” windows, smashing them.
Musk was caught off guard and uttered an expletive before saying the ball “didn’t go through – that’s a plus side,” and telling the audience that Tesla would fix the problem “in post.”
The unveiling of the Tesla Cybertruck comes as competition in electric vehicles heats up. Recently, Ford unveiled its own mustang-inspired electric SUV, called the Mach-E, which analysts at Credit Suisse said could threaten Tesla’s position as the top EV maker in the US.
In addition, General Motors CEO Mary Barra announced Thursday that the company’s electric pickup truck will launch in 2021, Reuters reported. That’s around the same time that Tesla’s Cybertruck will hit the market, according to the report.
Tesla has gained about 6% year-to-date through Thursday’s close.


## Basic Usage
Explaining q-directives briefly is hard, and to keep things simple, let us break it down into four parts:
1. The `q` directive.
2. DOM manipulating q-directives like `q-show`, `q-hide`, `q-text`, `q-html`.
3. Q-directives that add watchers like `q-watch`, `q-watch-deep`, `q-watch-collection` and `q-watch-group`.
4. The `q-compile` directive.
### The q directive
As mentioned before, q-directives are **not** native Angular directives. They do not register with the Angular directive system, but instead follow their own registration system. But the `q` directive is an exception. `q` is an Angular native directive that acts as a bridge between Angular's directive system and the q-directive system.
Look at the example below:
```html
Hello
Hello
```
Notice how the presence of the `q` directive makes all the difference.
### DOM maniplating directives
DOM manipulating directives are pretty simple. They (you guessed it) manipulate DOM in some or other way. They work pretty similar to angular directives, with the exception that they don't add any watchers. Here's an example that uses the `q-attr` directive to show the gravatar image for a user:
```html
```
### Watch directives
DOM manipulating q-directives don't add watchers. That part is delegated to a special watcher directives. Adding a `q-watch` directive on a node adds a watcher on the current scope for the value assigned to the `q-watch` attribute. Whenever that value changes, the directive triggers an update on the element, which updates all the DOM manipulating directives on that element and its descendants. And yes, this operation is performance optimized, and is an O(n) operation, where n = the number of directives you have on the element and its descendants.
To reference the example from the introduction:
```html
Hello there,
!
Your registered username is , and email is .
You have liked posts.
```
There are 4 `q-text` directives here. However there is only one watcher reegistered (by `q-watch`). Whenever anything in `user` changes (ensured by the `q-watch-deep` directive), all the q-directives inside that DOM element get updated at the same time.
### Compile directive
Well, one shortcoming of `q-directives` is that if you use them, you cannot use native Angular directives along with it. You may, but they will probably not work as expected. The `q-compile` directive comes in handy in that case. `q-compile` is not a q-directive, but is a native Angular directive. Since q-directive compilation and native Angular directives compilation works differently and at different times (Angular directives are compiled before q-directives are), adding a `q-compile` directive alongside your Angular directive is like telling Angular, "hey, hold your horses, let q-directives compile first, and then you may do your stuff".
Under the hood, it is basically a high priority terminal directive that pauses the compilation of Angular directives on the element it is added on, compiles the q-directives, and resumes the compilation of Angular directives by calling `$compile`.
Here's an example:
```html
```
Notice how the presence of the `q-compile` directive made all the difference.


SpriteWidget
SpriteWidget is a toolkit for building complex, high performance animations and 2D games with Flutter. Your sprite render tree lives inside a widget that mixes seamlessly with other Flutter and Material widgets. You can use SpriteWidget to create anything from an animated icon to a full fledged game.
This guide assumes a basic knowledge of Flutter and Dart. Get support by posting a question tagged spritewidget
on StackOverflow.
You can find examples in the example directory, or check out the complete Space Blast game.
Adding SpriteWidget to your project
SpriteWidget is available as a standard package. Just add it as a dependency to your pubspec.yaml and you are good to go.
dependencies:
flutter:
sdk: flutter
spritewidget:
Creating a SpriteWidget
The first thing you need to do to use SpriteWidget is to setup a root node that is used to draw it's contents. Any sprite nodes that you add to the root node will be rendered by the SpriteWidget. Typically, your root node is part of your app's state. This is an example of how you can setup a custom stateful widget with a SpriteWidget:
import 'package:flutter/material.dart';
import 'package:spritewidget/spritewidget.dart';
class MyWidget extends StatefulWidget {
@override
MyWidgetState createState() => new MyWidgetState();
}
class MyWidgetState extends State<MyWidget> {
NodeWithSize rootNode;
@override
void initState() {
super.initState();
rootNode = new NodeWithSize(const Size(1024.0, 1024.0));
}
@override
Widget build(BuildContext context) {
return new SpriteWidget(rootNode);
}
}
The root node that you provide the SpriteWidget is a NodeWithSize, the size of the root node defines the coordinate system used by the SpriteWidget. By default the SpriteWidget uses letterboxing to display its contents. This means that the size that you give the root node will determine how the SpriteWidget's contents will be scaled to fit. If it doesn't fit perfectly in the area of the widget, either its top and bottom or the left and right side will be trimmed. You can optionally pass in a parameter to the SpriteWidget for other scaling options depending on your needs.
When you have added the SpriteWidget to your app's build method it will automatically start running animations and handling user input. There is no need for any other extra setup.
Adding objects to your node graph
Your SpriteWidget manages a node graph, the root node is the NodeWithSize that is passed in to the SpriteWidget when it's created. To render sprites, particles systems, or any other objects simply add them to the node graph.
Each node in the node graph has a transform. The transform is inherited by its children, this makes it possible to build more complex structures by grouping objects together as children to a node and then manipulating the parent node. For example the following code creates a car sprite with two wheels attached to it. The car is added to the root node.
Sprite car = new Sprite.fromImage(carImage);
Sprite frontWheel = new Sprite.fromImage(wheelImage);
Sprite rearWheel = new Sprite.fromImage(wheelImage);
frontWheel.position = const Offset(100, 50);
rearWheel.position = const Offset(-100, 50);
car.addChild(frontWheel);
car.addChild(rearWheel);
rootNode.addChild(car);
You can manipulate the transform by setting the position, rotation, scale, and skew properties.
Sprites, textures, and sprite sheets
To load image resources, the easiest way is to use the ImageMap
class. The ImageMap
can load one or multiple images at once.
The Image
class isn't automatically imported through flutter/material, so you may need to add an import at the top of your file.
import 'dart:ui' as ui show Image;
Now you can load images using the ImageMap
. Note that the loading methods are asynchronous, so this example code will need to go in an asynch method. For a full example of loading images see the Weather Demo.
ImageMap images = new ImageMap(rootBundle);
// Load a single image
ui.Image image = await images.loadImage('assets/my_image.png');
// Load multiple images
await images.load(<String>[
'assets/image_0.png',
'assets/image_1.png',
'assets/image_2.png',
]);
// Access a loaded image from the ImageMap
image = images['assets/image_0.png'];
The most common node type is the Sprite node. A sprite simply draws an image to the screen. Sprites can be drawn from Image objects or SpriteTexture objects. A texture is a part of an Image. Using a SpriteSheet you can pack several texture elements within a single image. This saves space in the device's gpu memory and also make drawing faster. Currently SpriteWidget supports sprite sheets in json format and produced with a tool such as TexturePacker. It's uncommon to manually edit the sprite sheet files. You can create a SpriteSheet with a definition in json and an image:
SpriteSheet sprites = new SpriteSheet(myImage, jsonCode);
SpriteTexture texture = sprites['texture.png'];
The frame cycle
Each time a new frame is rendered to screen SpriteWidget will perform a number of actions. Sometimes when creating more advanced interactive animations or games, the order in which these actions are performed may matter.
This is the order things will happen:
- Handle input events
- Run animation actions
- Call update functions on nodes
- Apply constraints
- Render the frame to screen
Read more about each of the different phases below.
Handling user input
You can subclass any node type to handle touches. To receive touches, you need to set the userInteractionEnabled property to true and override the handleEvent method. If the node you are subclassing doesn't have a size, you will also need to override the isPointInside method.
class EventHandlingNode extends NodeWithSize {
EventHandlingNode(Size size) : super(size) {
userInteractionEnabled = true;
}
@override handleEvent(SpriteBoxEvent event) {
if (event.type == PointerDownEvent)
...
else if (event.type == PointerMoveEvent)
...
return true;
}
}
If you want your node to receive multiple touches, set the handleMultiplePointers property to true. Each touch down or dragged touch will generate a separate call to the handleEvent method, you can distinguish each touch by its pointer property.
Animating using actions
SpriteWidget provides easy to use functions for animating nodes through actions. You can combine simple action blocks to create more complex animations.
To execute an action animation you first build the action itself, then pass it to the run method of a nodes action manager (see the Tweens section below for an example).
Tweens
Tweens are the simplest building block for creating an animation. It will interpolate a value or property over a specified time period. You provide the ActionTween class with a setter function, its start and end value, and the duration for the tween.
After creating a tween, execute it by running it through a node's action manager.
Node myNode = new Node();
ActionTween myTween = new ActionTween<Offset> (
(a) => myNode.position = a,
Offset.zero,
const Offset(100.0, 0.0),
1.0
);
myNode.actions.run(myTween);
You can animate values of different types, such as floats, points, rectangles, and even colors. You can also optionally provide the ActionTween class with an easing function.
Sequences
When you need to play two or more actions in a sequence, use the ActionSequence class:
ActionSequence sequence = new ActionSequence([
firstAction,
middleAction,
lastAction
]);
Groups
Use ActionGroup to play actions in parallel:
ActionGroup group = new ActionGroup([
action0,
action1
]);
Repeat
You can loop any action, either a fixed number of times, or until the end of times:
ActionRepeat repeat = new ActionRepeat(loopedAction, 5);
ActionRepeatForever longLoop = new ActionRepeatForever(loopedAction);
Composition
It's possible to create more complex actions by composing them in any way:
ActionSequence complexAction = new ActionSequence([
new ActionRepeat(myLoop, 2),
new ActionGroup([
action0,
action1
])
]);
Handle update events
Each frame, update events are sent to each node in the current node tree. Override the update method to manually do animations or to perform game logic.
MyNode extends Node {
@override
update(double dt) {
// Move the node at a constant speed
position += new Offset(dt * 1.0, 0.0);
}
}
Defining constraints
Constraints are used to constrain properties of nodes. They can be used to position nodes relative other nodes, or adjust the rotation or scale. You can apply more than one constraint to a single node.
For example, you can use a constraint to make a node follow another node at a specific distance with a specified dampening. The dampening will smoothen out the following node's movement.
followingNode.constraints = [
new ConstraintPositionToNode(
targetNode,
offset: const Offset(0.0, 100.0),
dampening: 0.5
)
];
Constraints are applied at the end of the frame cycle. If you need them to be applied at any other time, you can directly call the applyConstraints method of a Node object.
Perform custom drawing
SpriteWidget provides a default set of drawing primitives, but there are cases where you may want to perform custom drawing. To do this you will need to subclass either the Node or NodeWithSize class and override the paint method:
class RedCircle extends Node {
RedCircle(this.radius);
double radius;
@override
void paint(Canvas canvas) {
canvas.drawCircle(
Offset.zero,
radius,
new Paint()..color = const Color(0xffff0000)
);
}
}
If you are overriding a NodeWithSize you may want to call applyTransformForPivot before starting drawing to account for the node's pivot point. After the call the coordinate system is setup so you can perform drawing starting at origo to the size of the node.
@override
void paint(Canvas canvas) {
applyTransformForPivot(canvas);
canvas.drawRect(
new Rect.fromLTWH(0.0, 0.0, size.width, size.height),
myPaint
);
}
Add effects using particle systems
Particle systems are great for creating effects such as rain, smoke, or fire. It's easy to setup a particle system, but there are very many properties that can be tweaked. The best way of to get a feel for how they work is to simply play around with the them.
This is an example of how a particle system can be created, configured, and added to the scene:
ParticleSystem particles = new ParticleSystem(
particleTexture,
posVar: const Point(100, 100.0),
startSize: 1.0,
startSizeVar: 0.5,
endSize: 2.0,
endSizeVar: 1.0,
life: 1.5 * distance,
lifeVar: 1.0 * distance
);
rootNode.addChild(particles);
Libraries
- spritewidget
- A sprite toolkit built on top of Flutter.
Dart
- dart:async
- Support for asynchronous programming, with classes such as Future and Stream. [...]
- dart:collection
- Classes and utilities that supplement the collection support in dart:core. [...]
- dart:convert
- Encoders and decoders for converting between different data representations, including JSON and UTF-8. [...]
- dart:core
- Built-in types, collections, and other core functionality for every Dart program. [...]
- dart:developer
- Interact with developer tools such as the debugger and inspector. [...]
- dart:math
- Mathematical constants and functions, plus a random number generator. [...]
- dart:typed_data
- Lists that efficiently handle fixed sized data (for example, unsigned 8 byte integers) and SIMD numeric types. [...]
- dart:ui
- Built-in types and core primitives for a Flutter application. [...]
- dart:io
- File, socket, HTTP, and other I/O support for non-web applications. [...]
- dart:isolate
- Concurrent programming using isolates: independent workers that are similar to threads but don't share memory, communicating only via messages. [...]


We know you have questions, and we’ve got answers. Use our personalized tool to ease all of your worries and get you set up for success on day one.
You may not even know what it is you don’t know, but relax - we made a list for you!
Check out all of the things we think you should know about your school before you even step on campus.