|
Bouncy Castle Cryptography Library 1.46 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.bouncycastle.asn1.ASN1Encodable org.bouncycastle.asn1.x509.X509Name
public class X509Name
RDNSequence ::= SEQUENCE OF RelativeDistinguishedName RelativeDistinguishedName ::= SET SIZE (1..MAX) OF AttributeTypeAndValue AttributeTypeAndValue ::= SEQUENCE { type OBJECT IDENTIFIER, value ANY }
| Field Summary | |
|---|---|
static DERObjectIdentifier |
BUSINESS_CATEGORY
Deprecated. businessCategory - DirectoryString(SIZE(1..128) |
static DERObjectIdentifier |
C
Deprecated. country code - StringType(SIZE(2)) |
static DERObjectIdentifier |
CN
Deprecated. common name - StringType(SIZE(1..64)) |
static DERObjectIdentifier |
COUNTRY_OF_CITIZENSHIP
Deprecated. RFC 3039 CountryOfCitizenship - PrintableString (SIZE (2)) -- ISO 3166 codes only |
static DERObjectIdentifier |
COUNTRY_OF_RESIDENCE
Deprecated. RFC 3039 CountryOfResidence - PrintableString (SIZE (2)) -- ISO 3166 codes only |
static DERObjectIdentifier |
DATE_OF_BIRTH
Deprecated. RFC 3039 DateOfBirth - GeneralizedTime - YYYYMMDD000000Z |
static DERObjectIdentifier |
DC
Deprecated. |
static java.util.Hashtable |
DefaultLookUp
Deprecated. look up table translating common symbols into their OIDS. |
static boolean |
DefaultReverse
Deprecated. determines whether or not strings should be processed and printed from back to front. |
static java.util.Hashtable |
DefaultSymbols
Deprecated. default look up table translating OID values into their common symbols following the convention in RFC 2253 with a few extras |
static DERObjectIdentifier |
DMD_NAME
Deprecated. RFC 2256 dmdName |
static DERObjectIdentifier |
DN_QUALIFIER
Deprecated. dnQualifier - DirectoryString(SIZE(1..64) |
static DERObjectIdentifier |
E
Deprecated. email address in Verisign certificates |
static DERObjectIdentifier |
EmailAddress
Deprecated. Email address (RSA PKCS#9 extension) - IA5String. |
static DERObjectIdentifier |
GENDER
Deprecated. RFC 3039 Gender - PrintableString (SIZE(1)) -- "M", "F", "m" or "f" |
static DERObjectIdentifier |
GENERATION
Deprecated. |
static DERObjectIdentifier |
GIVENNAME
Deprecated. |
static DERObjectIdentifier |
INITIALS
Deprecated. |
static DERObjectIdentifier |
L
Deprecated. locality name - StringType(SIZE(1..64)) |
static DERObjectIdentifier |
NAME
Deprecated. id-at-name |
static DERObjectIdentifier |
NAME_AT_BIRTH
Deprecated. ISIS-MTT NameAtBirth - DirectoryString(SIZE(1..64) |
static DERObjectIdentifier |
O
Deprecated. organization - StringType(SIZE(1..64)) |
static java.util.Hashtable |
OIDLookUp
Deprecated. use DefaultSymbols |
static DERObjectIdentifier |
OU
Deprecated. organizational unit name - StringType(SIZE(1..64)) |
static DERObjectIdentifier |
PLACE_OF_BIRTH
Deprecated. RFC 3039 PlaceOfBirth - DirectoryString(SIZE(1..128) |
static DERObjectIdentifier |
POSTAL_ADDRESS
Deprecated. RFC 3039 PostalAddress - SEQUENCE SIZE (1..6) OF DirectoryString(SIZE(1..30)) |
static DERObjectIdentifier |
POSTAL_CODE
Deprecated. postalCode - DirectoryString(SIZE(1..40) |
static DERObjectIdentifier |
PSEUDONYM
Deprecated. RFC 3039 Pseudonym - DirectoryString(SIZE(1..64) |
static java.util.Hashtable |
RFC1779Symbols
Deprecated. look up table translating OID values into their common symbols following the convention in RFC 1779 |
static java.util.Hashtable |
RFC2253Symbols
Deprecated. look up table translating OID values into their common symbols following the convention in RFC 2253 |
static DERObjectIdentifier |
SERIALNUMBER
Deprecated. device serial number name - StringType(SIZE(1..64)) |
static DERObjectIdentifier |
SN
Deprecated. device serial number name - StringType(SIZE(1..64)) |
static DERObjectIdentifier |
ST
Deprecated. state, or province name - StringType(SIZE(1..64)) |
static DERObjectIdentifier |
STREET
Deprecated. street - StringType(SIZE(1..64)) |
static DERObjectIdentifier |
SURNAME
Deprecated. Naming attributes of type X520name |
static java.util.Hashtable |
SymbolLookUp
Deprecated. use DefaultLookUp |
static DERObjectIdentifier |
T
Deprecated. Title |
static DERObjectIdentifier |
TELEPHONE_NUMBER
Deprecated. id-at-telephoneNumber |
static DERObjectIdentifier |
UID
Deprecated. LDAP User id. |
static DERObjectIdentifier |
UNIQUE_IDENTIFIER
Deprecated. |
static DERObjectIdentifier |
UnstructuredAddress
Deprecated. |
static DERObjectIdentifier |
UnstructuredName
Deprecated. more from PKCS#9 |
| Fields inherited from class org.bouncycastle.asn1.ASN1Encodable |
|---|
BER, DER |
| Constructor Summary | |
|---|---|
protected |
X509Name()
Deprecated. |
|
X509Name(ASN1Sequence seq)
Deprecated. Constructor from ASN1Sequence the principal will be a list of constructed sets, each containing an (OID, String) pair. |
|
X509Name(boolean reverse,
java.util.Hashtable lookUp,
java.lang.String dirName)
Deprecated. Takes an X509 dir name as a string of the format "C=AU, ST=Victoria", or some such, converting it into an ordered set of name attributes. lookUp should provide a table of lookups, indexed by lowercase only strings and yielding a DERObjectIdentifier, other than that OID. and numeric oids will be processed automatically. |
|
X509Name(boolean reverse,
java.util.Hashtable lookUp,
java.lang.String dirName,
X509NameEntryConverter converter)
Deprecated. Takes an X509 dir name as a string of the format "C=AU, ST=Victoria", or some such, converting it into an ordered set of name attributes. lookUp should provide a table of lookups, indexed by lowercase only strings and yielding a DERObjectIdentifier, other than that OID. and numeric oids will be processed automatically. |
|
X509Name(boolean reverse,
java.lang.String dirName)
Deprecated. Takes an X509 dir name as a string of the format "C=AU, ST=Victoria", or some such, converting it into an ordered set of name attributes. |
|
X509Name(boolean reverse,
java.lang.String dirName,
X509NameEntryConverter converter)
Deprecated. Takes an X509 dir name as a string of the format "C=AU, ST=Victoria", or some such, converting it into an ordered set of name attributes with each string value being converted to its associated ASN.1 type using the passed in converter. |
|
X509Name(java.util.Hashtable attributes)
Deprecated. use an ordered constructor! The hashtable ordering is rarely correct |
|
X509Name(java.lang.String dirName)
Deprecated. Takes an X509 dir name as a string of the format "C=AU, ST=Victoria", or some such, converting it into an ordered set of name attributes. |
|
X509Name(java.lang.String dirName,
X509NameEntryConverter converter)
Deprecated. Takes an X509 dir name as a string of the format "C=AU, ST=Victoria", or some such, converting it into an ordered set of name attributes with each string value being converted to its associated ASN.1 type using the passed in converter. |
|
X509Name(java.util.Vector ordering,
java.util.Hashtable attributes)
Deprecated. Constructor from a table of attributes with ordering. |
|
X509Name(java.util.Vector ordering,
java.util.Hashtable attributes,
X509NameEntryConverter converter)
Deprecated. Constructor from a table of attributes with ordering. |
|
X509Name(java.util.Vector oids,
java.util.Vector values)
Deprecated. Takes two vectors one of the oids and the other of the values. |
|
X509Name(java.util.Vector oids,
java.util.Vector values,
X509NameEntryConverter converter)
Deprecated. Takes two vectors one of the oids and the other of the values. |
| Method Summary | |
|---|---|
boolean |
equals(java.lang.Object obj)
Deprecated. test for equality - note: case is ignored. |
boolean |
equals(java.lang.Object obj,
boolean inOrder)
Deprecated. |
static X509Name |
getInstance(ASN1TaggedObject obj,
boolean explicit)
Deprecated. Return a X509Name based on the passed in tagged object. |
static X509Name |
getInstance(java.lang.Object obj)
Deprecated. |
java.util.Vector |
getOIDs()
Deprecated. return a vector of the oids in the name, in the order they were found. |
java.util.Vector |
getValues()
Deprecated. return a vector of the values found in the name, in the order they were found. |
java.util.Vector |
getValues(DERObjectIdentifier oid)
Deprecated. return a vector of the values found in the name, in the order they were found, with the DN label corresponding to passed in oid. |
int |
hashCode()
Deprecated. |
DERObject |
toASN1Object()
Deprecated. |
java.lang.String |
toString()
Deprecated. |
java.lang.String |
toString(boolean reverse,
java.util.Hashtable oidSymbols)
Deprecated. convert the structure to a string - if reverse is true the oids and values are listed out starting with the last element in the sequence (ala RFC 2253), otherwise the string will begin with the first element of the structure. |
| Methods inherited from class org.bouncycastle.asn1.ASN1Encodable |
|---|
getDEREncoded, getDERObject, getEncoded, getEncoded |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final DERObjectIdentifier C
public static final DERObjectIdentifier O
public static final DERObjectIdentifier OU
public static final DERObjectIdentifier T
public static final DERObjectIdentifier CN
public static final DERObjectIdentifier SN
public static final DERObjectIdentifier STREET
public static final DERObjectIdentifier SERIALNUMBER
public static final DERObjectIdentifier L
public static final DERObjectIdentifier ST
public static final DERObjectIdentifier SURNAME
public static final DERObjectIdentifier GIVENNAME
public static final DERObjectIdentifier INITIALS
public static final DERObjectIdentifier GENERATION
public static final DERObjectIdentifier UNIQUE_IDENTIFIER
public static final DERObjectIdentifier BUSINESS_CATEGORY
public static final DERObjectIdentifier POSTAL_CODE
public static final DERObjectIdentifier DN_QUALIFIER
public static final DERObjectIdentifier PSEUDONYM
public static final DERObjectIdentifier DATE_OF_BIRTH
public static final DERObjectIdentifier PLACE_OF_BIRTH
public static final DERObjectIdentifier GENDER
public static final DERObjectIdentifier COUNTRY_OF_CITIZENSHIP
public static final DERObjectIdentifier COUNTRY_OF_RESIDENCE
public static final DERObjectIdentifier NAME_AT_BIRTH
public static final DERObjectIdentifier POSTAL_ADDRESS
public static final DERObjectIdentifier DMD_NAME
public static final DERObjectIdentifier TELEPHONE_NUMBER
public static final DERObjectIdentifier NAME
public static final DERObjectIdentifier EmailAddress
Note: if you're trying to be ultra orthodox, don't use this! It shouldn't be in here.
public static final DERObjectIdentifier UnstructuredName
public static final DERObjectIdentifier UnstructuredAddress
public static final DERObjectIdentifier E
public static final DERObjectIdentifier DC
public static final DERObjectIdentifier UID
public static boolean DefaultReverse
public static final java.util.Hashtable DefaultSymbols
public static final java.util.Hashtable RFC2253Symbols
public static final java.util.Hashtable RFC1779Symbols
public static final java.util.Hashtable DefaultLookUp
public static final java.util.Hashtable OIDLookUp
public static final java.util.Hashtable SymbolLookUp
| Constructor Detail |
|---|
protected X509Name()
public X509Name(ASN1Sequence seq)
public X509Name(java.util.Hashtable attributes)
it's is assumed the table contains OID/String pairs, and the contents of the table are copied into an internal table as part of the construction process.
Note: if the name you are trying to generate should be following a specific ordering, you should use the constructor with the ordering specified below.
public X509Name(java.util.Vector ordering, java.util.Hashtable attributes)
it's is assumed the table contains OID/String pairs, and the contents of the table are copied into an internal table as part of the construction process. The ordering vector should contain the OIDs in the order they are meant to be encoded or printed in toString.
public X509Name(java.util.Vector ordering, java.util.Hashtable attributes, X509NameEntryConverter converter)
it's is assumed the table contains OID/String pairs, and the contents of the table are copied into an internal table as part of the construction process. The ordering vector should contain the OIDs in the order they are meant to be encoded or printed in toString.
The passed in converter will be used to convert the strings into their ASN.1 counterparts.
public X509Name(java.util.Vector oids, java.util.Vector values)
public X509Name(java.util.Vector oids, java.util.Vector values, X509NameEntryConverter converter)
The passed in converter will be used to convert the strings into their ASN.1 counterparts.
public X509Name(java.lang.String dirName)
public X509Name(java.lang.String dirName, X509NameEntryConverter converter)
public X509Name(boolean reverse, java.lang.String dirName)
public X509Name(boolean reverse, java.lang.String dirName, X509NameEntryConverter converter)
public X509Name(boolean reverse, java.util.Hashtable lookUp, java.lang.String dirName)
reverse
- true if we should start scanning from the end (RFC 2553).lookUp
- table of names and their oids.dirName
- the X.500 string to be parsed.public X509Name(boolean reverse, java.util.Hashtable lookUp, java.lang.String dirName, X509NameEntryConverter converter)
reverse
- true if we should start scanning from the end, false otherwise.lookUp
- table of names and oids.dirName
- the string dirNameconverter
- the converter to convert string values into their ASN.1 equivalents| Method Detail |
|---|
public static X509Name getInstance(ASN1TaggedObject obj, boolean explicit)
obj
- tag object holding name.explicit
- true if explicitly tagged false otherwise.
public static X509Name getInstance(java.lang.Object obj)
public java.util.Vector getOIDs()
public java.util.Vector getValues()
public java.util.Vector getValues(DERObjectIdentifier oid)
public DERObject toASN1Object()
toASN1Object
in class ASN1Encodable
public boolean equals(java.lang.Object obj, boolean inOrder)
inOrder
- if true the order of both X509 names must be the same,
as well as the values associated with each element.public int hashCode()
hashCode
in class ASN1Encodable
public boolean equals(java.lang.Object obj)
equals
in class ASN1Encodable
public java.lang.String toString(boolean reverse, java.util.Hashtable oidSymbols)
reverse
- if true start at the end of the sequence and work back.oidSymbols
- look up table strings for oids.public java.lang.String toString()
toString
in class java.lang.Object
|
Bouncy Castle Cryptography Library 1.46 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |


What business owners need to know about balance sheets
by Raheem AdebayoThe balance sheet is one of the primary financial statements that can be used to manage your business on both a long-term and daily basis. While you may delegate the preparation of the balance sheet to an accountant or bookkeeper, it represents your business, so you should understand how to read and use it.
Business owners and CEOs often overlook their balance sheets in favour of the income statement, or profit and loss (P&L) statement, which is pillar of management. At a glance, the income statement reveals revenue, maybe gross profit, and net income but taking the time to zoom out and look at the big picture is a chance for you to evaluate your business.
- Are things working as you expected?
- Should you make changes to your strategy?
Why do a monthly balance sheet analysis?
 Your balance sheet also tracks owner and shareholder investments (equity), but that’s less important for most small businesses to keep an extremely close eye on.
 Here are the questions your balance sheet can answer for you that your other financial statements can’t address:
- How much money is in the bank?
This is probably one of the most frequent and most important questions that business owners ask themselves. Knowing what you have in the bank is the key to most financial decisions. The amount of cash that your business has on hand is listed in the assets section of your balance sheet and is classified as a “current asset.” Current assets are cash and other things that you can quickly turn into cash to pay your bills.
[READ MORE: Is there a legitimate Nigerian business that can guarantee 5-10% monthly interest?)
- Are you owed money?
Keeping track of how much money you are owed is also an important part of your financial position. You will find this number in the “accounts receivable” row on your balance sheet. If your customers don’t pay you in cash – you send them invoices and they pay later – this is where you will find what’s owed to you.
- How much inventory do you have on hand?
If you sell products, you deal with inventory. While your balance sheet doesn’t tell you exactly what products you have on hand and how many of each, it does tell you the value of that inventory. Keep in mind that the value of the inventory listed on your balance sheet is what you paid for that inventory, not what it might be worth if you sold it to customers. Inventory is a current asset because the assumption is that you can convert that inventory into cash relatively quickly.
- What other assets do you have?
If you have other assets, both other current assets and what are called “long term assets,” you will also find those listed on the balance sheet. Long term assets are things that you would typically hold for a longer period of time and are more difficult to convert into cash.
- What bills are outstanding?
Just like you will want to keep a close eye on who owes you money, you will also want to track how much money you owe to your vendors. Those accumulating bills will show up on the “accounts payable” line of your balance sheet. How much cash you have in the bank and how much your customers owe you will likely be factors, as you consider how quickly you want to pay those bills.
- How much do you owe?
In addition to bills from your vendors, your business is probably accumulating other debts. Those are called “current liabilities” and will show up on your balance sheet in that section.
Balance sheets are really all about comparison
Learn the following three keys to reading balance sheets to make the most of them:
- Begin by Tracking Equity Trends
Equity is the summary and culmination of everything that happens in your company. Over time, it reveals how well you are managing your company’s value. Use balance sheets distributed at the end of each period to track your company’s equity, which is the net worth of the business.
Equity = Assets – Liabilities + Net Income
- Consider Changes in Assets and Liabilities
After using assets and liabilities to calculate equity, consider them individually. These numbers on their own will reveal to you where your company’s cash goes each week, month or year. You can determine whether or not your company is growing by comparing these numbers from balance sheet to balance sheet. If assets increase more than liabilities, then the company is growing. If liabilities increase more rapidly than assets, then the company is losing value (equity). With this simple comparison, you can quickly assess how well you are managing the business.
[READ ALSO: Solomon Udoh’s experience is why you should monitor your investment performance constantly)
- Determine Your Liquidity by Calculating the Current Ratio
The current ratio also referred to as the working capital ratio, reveals a company’s liquidity or its ability to repay debts (both long-term and short-term obligations) by comparing all of a company’s liquid and illiquid assets to the company’s total liabilities. This ratio reveals much more than simply looking at your cash on hand from a balance sheet because total assets in the current ratio also includes receivables.
Current Ratio = Current Assets / Current Liabilities
A current ratio greater than one generally expresses a healthy financial state. A ratio above one means the company has more assets than liabilities and should not have a problem repaying debts or covering expenses.


Scratchy
Past Events
info
Scratchy
lock
Keep your doodles safely stashed away on the BSV blockchain with AES 128 encryption
mode_edit
Scratch Pad
account_circle
User Name
lock
Password
Fetch
send
Send
send
event
None
nada


Riley W. Clarke
Home
About
Research Interests
Contact
Bellingham, WA
(+1)<PHONE_NUMBER>
rclarke1995@gmail.com


Google Code offered in: English - Español - 日本語 - 한국어 - Português - Pусский - 中文(简体) - 中文(繁體)
As an AJAX app develops, the JavaScript part of it tends to grow. Eventually, the code itself is often large enough that merely downloading and installing it adds significant time to the application's startup.
To help with this issue, GWT provides Dead-for-now (DFN) code splitting. This article talks about what DFN code splitting is, how you start using it in an application, and how to improve an application that does use it.
Code splitting is only supported with certain linkers. The default iframe linker is supported, but the cross-site linker is not yet. If you have changed your application to use a non-default linker, check whether that linker supports code splitting.
To split your code, simply insert calls to the method GWT.runAsync at the places where you want the program to be able to pause for downloading more code. These locations are called split points.
A call to GWT.runAsync is just like a call to register any other event handler. The only difference is that the event being handled is somewhat unusual. Instead of being a mouse-click event or key-press event, the event is that the necessary code has downloaded for execution to proceed.
For example, here is the initial, unsplit Hello sample that comes with GWT:
public class Hello implements EntryPoint { public void onModuleLoad() { Button b = new Button("Click me", new ClickHandler() { public void onClick(ClickEvent event) { Window.alert("Hello, AJAX"); } }); RootPanel.get().add(b); } }
Suppose you wanted to split out the Window.alert call into a separate code download. The following code accomplishes this:
public class Hello implements EntryPoint { public void onModuleLoad() { Button b = new Button("Click me", new ClickHandler() { public void onClick(ClickEvent event) { GWT.runAsync(new RunAsyncCallback() { public void onFailure(Throwable caught) { Window.alert("Code download failed"); } public void onSuccess() { Window.alert("Hello, AJAX"); } }); } }); RootPanel.get().add(b); } }
In the place the code used to call Window.alert, there is now a call to GWT.runAsync. The argument to GWT.runAsync is a callback object that will be invoked once the necessary code downloads. Like with event handlers for GUI events, a runAsync callback is frequently an anonymous inner class.
That class must implement RunAsyncCallback, an interface declaring two methods. The first method is onFailure, which is called if any code fails to download. The second method is onSuccess, which is called when the code successfully arrives. In this case, the onSuccess method includes the call to Window.alert.
With this modified version, the code initially downloaded does not
include the string "Hello, AJAX"
nor any code necessary
to implement Window.alert. Once the button is clicked, the
call to GWT.runAsync will be reached, and that code will
start downloading. Assuming it downloads successfully,
the onSuccess method will be called; since the necessary code
has downloaded, that call will succeed. If there is a failure to
download the code, then onFailure will be invoked.
To see the difference in compilation, try compiling both versions
and inspecting the output. The first version will
generate cache.html files that all include the
string "Hello, AJAX"
. Thus, when the app starts up, this
string will be downloaded immediately. The second version, however,
will not include this string in the cache.html
files. Instead, this string will be located in cache.js files
underneath the deferredjs directory. In the second version,
the string is not loaded until the call to runAsync is
reached.
This one string is not a big deal for code size. In fact, the overhead of the runAsync run-time support could overwhelm the savings. However, you aren't limited to splitting out individual string literals. You can put arbitrary code behind a runAsync split point, potentially leading to very large improvements in your application's initial download size.
You've now seen the basic code-splitting mechanism that GWT provides. When you first try to split your own code, you might not split out as much as you hoped. You will try to split out some major subsystem, but there will be a stray reference to that subsystem somewhere reachable without going through a split point. That reference can be enough to pull much of the subsystem into the initial download.
Because of this challenge, effective code splitting requires iteration. You have to try one way, look at how it worked, then make modifications to get it working better. This section describes several tools that GWT provides for iterating toward better code splitting.
Figure 1: Fragments produced by code splitting
Before going further, it is important to understand exactly what fragments the code splitter divides your code into. That way you can examine how the splitting went and work towards improving it. Figure 1 gives a diagram of those fragments and the order they can load in.
One very important fragment is the initial download. For the iframe linker, it is emitted as a file whose name ends with cache.html. When the application starts up, the initial-download fragment is loaded. This fragment includes all the code necessary to run the application up, but not past, any split point. When you start improving your code splitting, you should probably start by trying to reduce the size of the initial download fragment. Reducing this fragment causes the application to start up quickly.
There are a number of other code fragments generated in addition to this initial one. For the iframe linker, they are located underneath a directory named deferredjs, and their filenames all end with cache.js. Each split point in the program will have an associated code fragment. In addition, there is a leftovers code fragment for code that is not associated with any specific split point. In Figure 1, the leftovers fragment is number 6.
The code fragment associated with a split point is of one of two kinds. Most frequently, it is an exclusive fragment. An exclusive fragment contains code that is needed only once that split point is activated. In Figure 1, split points 1, 3, and 5 each have an exclusive fragment. Less frequently, a split point gets an initial fragment. That happens if a split point is part of the initial load sequence, described below. In Figure 1, the initial load sequence is split point 2 followed by split point 4.
Unlike an exclusive fragment, an initial fragment does not rely on anything in the leftovers fragment, so it can load before the leftovers do. However, an initial fragment can be loaded only in its designated position in the initial load sequence; exclusive fragments have the benefit that they can be loaded in any order.
Now that you know how GWT splits up code in general, you will want to know how it splits up your code in particular. There are several tools for this, and they are all included in a Compile Report.
To obtain a compile report for your application, simply compile your application with the -compileReport option added. Your application should then have an output directory named compileReport. Open index.html in that directory to view a Compile Report for your application.
The first thing to look at in a compile report is the overall size breakdown of your application. Compile reports break down your application size in four different ways: by Java package, by code type, by type of literals (for code associated with literals), and by type of strings (for code associated with string literals).
By looking at these overall sizes, you can learn what parts of the code are worth paying more attention to when splitting. For that matter, you might well see something that is larger than it should be; in that case, you might be able to work on that part and shrink the total, pre-split size of the application.
Since you are working on code splitting, you will next want to look at the way the application splits up. Click on any code subset to see a size breakdown of the code in that fragment. The total program option describes all of the code in the program. The other options all correspond to individual code fragments.
At some point you will try to get something moved out of the initial download fragment, but the GWT compiler will put it there anyway. Sometimes you can quickly figure out why, but other times it will not be obvious at all. The way to find out is to look through the dependencies that are reported in the compile report.
The most common example is that you expected something to be left out of the initial download, but it was not. To find out why, browse to that item via the initial download code subset. Once you click on the item, you can look at a chain of dependencies leading back to the application's main entry point. This is the chain of dependencies that causes GWT to think the item must be in the initial download. Try to rearrange the code to break one of the links in that chain.
A less common example is that you expected an item to be exclusive to some split point, but actually it's only included in leftover fragments. In this case, browse to the item via the total program code subset. You will then get a page describing where the code of that item ended up. If the item is not exclusive to any split point, then you will be shown a list of all split points. If you click on any of them, you will be shown a dependency chain for the item that does not include the split point you selected. To get the item exclusive to some split point, choose a split point, click on it, and then break a link in the dependency chain that comes up.
By default, every split point is given an exclusive fragment rather than an initial fragment. This gives your application maximum flexibility in the order the split points are reached. However, it means that the first split point reached must pay a significant delay, because it must wait for the leftovers fragment to load before its own code can load.
If you know which split point in your app will come first, you can improve the app's performance by specifying an initial load sequence. To do so, you need to name your runAsync calls and then specify a list of those names in your module file.
To give a name to a runAsync call, add a class literal as the first argument to the call to runAsync, like this:
GWT.runAsync(SomeClass.class, new RunAsyncCallback() { // ... callback class's body ... }
This first argument must be a class literal, and it is ignored except to be used as a name for the call. Any class literal can be used. A common choice is to use the enclosing class that the call appears in.
Once you have named your calls, you can specify an initial load sequence with lines like the following:
<extend-configuration-property name="compiler.splitpoint.initial.sequence" value="com.yourcompany.yourprogram.SomeClass"/>
The value part of the line specifies a split point. It is interpreted as a fully qualified class name that must match a literal used in exactly one runAsync call.
For some applications, you will know not only the first split point reached, but also the second and maybe even the third. You can continue extending the initial load sequence by adding more lines to the configuration property. For example, here is module code to specify an initial load sequence of three split points.
<extend-configuration-property name="compiler.splitpoint.initial.sequence" value="com.yourcompany.yourprogram.SomeClass"/> <extend-configuration-property name="compiler.splitpoint.initial.sequence" value="com.yourcompany.yourprogram.AnotherClassClass"/> <extend-configuration-property name="compiler.splitpoint.initial.sequence" value="com.yourcompany.yourprogram.YetAnotherClass"/>
The down side to specifying an initial load sequence is that if the split points are reached in a different order than specified, then there will be an even bigger delay than before before that code is run. For example, if the third split point in the initial sequence is actually reached first, then the code for that split point will not load until the code for the first two split points finishes loading. Worse, if some non-initial split point is actually reached first, then all of the code for the entire initial load sequence, in addition to the leftovers fragment, must load before the requested split point's code can load. Thus, think very carefully before putting anything in the initial load sequence if the split points might be reached in a different order at run time.
GWT's code splitting is new, so the best idioms and patterns for using it are still in their infancy. Even so, here are a couple of coding patterns that look promising. Keep them in mind for your coding toolbox.
Frequently you will think of some part of your code as its own coherent module of functionality, and you'd like for that functionality to get associated with a GWT exclusive fragment. That way, its code will not be downloaded until the first time it is needed, but once that download happens, the entire module will be available.
A coding pattern that helps with this goal is to associate a class with the module and then to make sure that all code in the module is reachable only by calling instance methods on that class. Then, you can arrange for the only instantiation of that class in the program to be within a runAsync.
The overall pattern looks as follows.
public class Module { // public APIs public doSomething() { /* ... */ } public somethingElse() { /* ... */ } // the module instance; instantiate it behind a runAsync private static Module instance = null; // A callback for using the module instance once it's loaded public interface ModuleClient { void onSuccess(Module instance); vaid onUnavailable(); } /** * Access the module's instance. The callback * runs asynchronously, once the necessary * code has downloaded. */ public static void createAsync(final ModuleClient client) { GWT.runAsync(new RunAsyncCallback() { public void onFailure(Throwable err) { client.onUnavailable(); } public void onSuccess() { if (instance == null) { instance = new Module(); } client.onSuccess(instance); } }); } }
Whenever you access the module from code that possibly loads before the module, go through the static Module.createAsync method. This method is then an async provider: it provides an instance of Module, but it might take its time doing so.
Usage note: for any code that definitely loads after the module, store the instance of the module somewhere for convenience. Then, access can go directly through that instance without harming the code splitting.
The code splitter of GWT does not have any special support for prefetching. Except for leftovers fragments, code downloads at the moment it is first requested. Even so, you can arrange your own application to explicitly prefetch code at places you choose. If you know a time in your application that there is likely to be little network activity, you might want to arrange to prefetch code. That way, once the code is needed for real, it will be available.
The way to force prefetching is simply to call a runAsync in a way that its callback doesn't actually do anything. When the application later calls that runAsync for real, its code will be available. The precise way to invoke a runAsync to have it do nothing will depend on the specific case. That said, a common general technique is to extend the meaning of any method parameter that is already in scope around the call to runAsync. If that argument is null, then the runAsync callback exits early, doing nothing.
For example, suppose you are implementing an online address book. You might have a split point just before showing information about that contact. A prefetchable way to wrap that code would be as follows:
public void showContact(final String contactId) { GWT.runAsync(new RunAsyncCallback() { public void onFailure(Throwable caught) { cb.onFailure(caught); } public void onSuccess() { if (contactId == null) { // do nothing: just a prefetch return; } // Show contact contactId... } }); }
Here, if showContact is called with an actual contact ID,
then the callback displays the information about that contact. If,
however, it is called with null
, then the same code will
be downloaded, but the callback won't actually do anything.


The Emotion Continents
Each emotion is represented as a continent. The movement of the shapes reflects how our emotions vary in strength and frequency in peoples lives.
The States of an Emotion
Each emotion names a number of related but different states. These states vary not only in their nature, but in their intensity.
The Triggers of an Emotion
Triggers automatically bring forth an emotion without consideration.
The Actions of a State
Each emotional state typically results in a number of actions. Click on a state to see the constructive and destructive actions that can result.
The Mood of an Emotion
Moods are longer-lasting cousins of an emotion that cause the related emotion to be felt more frequently and intensely. It is not always apparent what triggers a mood.
Achieving Calm
Calm is a state of mind that is actively engaged in using intelligence and wisdom to evaulate the changing world.
About
Paul Ekman is an American psychologist who is a pioneer in the study of emotions and their relation to facial expressions. He has gained a reputation as "the best human lie detector in the world". Eve Ekman is currently a Post Doctoral Scholar at UCSF’s Osher Center for Integrative Medicine. Ekman’s research interests were inspired by her experience as a medical social worker in the emergency department of San Francisco General Hospital coupled with her training in the applied emotion regulation and mindfulness intervention: Cultivating Emotional Balance, CEB.
Donate
This project was generously supported by the Dalai Lama Trust. To give back, and to help bring more emotion awareness to the world, consider donating here.
Additional Resources
Here are some of the publications that guided us, or that you might be interested in seeking out to learn more.
Personality Trait
Each emotion has a corresponding personality trait that represents a longer term manifestation of an emotion.
Psychopathology
Each emotion relates to distinct psychopathologies, which describe a persistent behavior that interferes with one's ability to function.
Signal and Message
Description of what signals are
Partially-Charted Emotions
Half or less than half of emotion scientists believe there is convincing evidence that each of the following is an emotion.
The Scientific Basis For This Work
The Emotions Atlas is based on the consensus among scientists (in the choice of the five emotion continents and the relationship of emotions to moods, personality and psychopathology), the work of a few scientists who focused on the naming of states within emotions, dictionary definitions in the glossary, and theory or best guesses about the actions for each state and whether they are constructive or destructive. For more information, see "What Emotion Scientists Agree About", by Paul Ekman Perspectives in Psychological Science, in press.
Emotional Episode Timeline
Impediments and Antidotes
Here are some ways to counteract emotional states. Impediments apply to blocking a positive emotion, antidotes apply to reversing negative ones.
Intrinsic or Intentional?
Actions can be intrinsic (take place without intent) or intentional (active attempt to enact change) or both.


The Float Library provides a number of routines to modify data on the FP stack. These routines can be categorized in several major groups:
Float0(), FloatPoint5(), Float1(), FloatMinusPoint5(), FloatMinus1(),Float2(), Float5(), Float10(), Float3600(), Float16384(), Float86400()
FloatPi(), FloatPiDiv2(),FloatLg10(), FloatLn2(), FloatLn10(), FloatSqrt2()
The Constant Routines provide a means of quickly obtaining an often used number or an often used operation with a constant operand. Each of these functions pushes the constant FP value onto the top of the FP stack. (For example,
FloatMinusPoint5()
pushes -.5 onto the FP stack.)
FloatPi()
,
FloatPiDiv2()
,
FloatLg10()
,
FloatLn2()
,
FloatLn10()
, and
FloatSqrt2()
each push the specified transcendental constant onto the FP stack: p,p/2, the log of 10, the natural log of 2, the natural log of 10,and the square root of 2, respectively. (See also Transcendental Routines.)
FloatMultiply2(), FloatMultiply10(), FloatDivide2(), FloatDivide10(), Float10ToTheX()
FloatMultiply2(), FloatMultiply10(), FloatDivide2(), FloatDivide10()
perform the specified operations on the contents of S1, either multiplying or dividing the contents of S1 by 2 or 10, and push the result onto the FP stack. The original value in S1 is popped off of the stack.
Float10ToTheX()
pushes 10 to a passed exponent onto the FP stack.
FloatAbs(), FloatAdd(), FloatSub(), FloatDivide(), FloatMultiply(), FloatDIV(), FloatMod(),FloatFactorial(), FloatNegate(), FloatInverse()
The Math Routines perform various operations on numbers already placed on the FP stack. All of the following routines pop the operated numbers off of the stack and push the result onto S1.
FloatAdd()
adds the contents of S1 and S2, and pushes the result onto the top of the FP stack. The original values are popped off the stack.
FloatSub()
subtracts
the contents of S1 from the contents of S2, and pushes the result onto the top of the FP stack. The original values are popped off the stack.
Note that, in general, numbers will be pushed onto the stack in the order they would normally be operated on. For example, to obtain X1-X2, the programmer would first push X1, then X2, and call
FloatSub
, as in the following diagram:
since X1 would now be in location S2, while X2 is in location S1.
FloatMultiply()
multiplies the contents of S1 and S2 and pushes the result onto the top of the FP stack. The original values are popped off the stack.
FloatDivide()
divides the contents of S2 by the contents of S1 and pushes the result onto the top of the FP stack. The original values are popped off the stack.
FloatDIV()
performs a
FloatDivide()
, truncating the fractional portion of the number and returning only the integer result. The original values are popped off the stack.
FloatMod()
pushes S2 mod S1 (the remainder of
FloatDivide()
) onto the top of the FP stack. The original values are popped off the stack.
FloatAbs()
pushes the absolute value of S1 onto the top of the FP stack. The original value is popped off the stack.
FloatFactorial()
pushes the factorial (x!) of the value in S1 onto the top of the FP stack. The original value is popped off the stack.
FloatNegate()
negates the value in S1 and pushes the result onto the top of the FP stack. The
original value is popped off the stack.
FloatInverse()
pushes the inverse of the value in S1 (-S1) onto the top of the FP stack. The original value is popped off of the stack.
FloatMax(), FloatMin(), FloatLt0(), FloatEq0(), FloatGt0()
FloatMax()
performs a compare of the FP numbers in S1 and S2 and, if necessary, swaps the greater number into S1.
FloatMin()
performs a compare of the FP numbers in S1 and S2 and, if necessary, swaps the lesser number into S1.
FloatLt0(), FloatEq0(), FloatGt0()
check whether the FP number in S1 is less than zero, equal to zero, or greater than zero. The carry bit is set to TRUE if the relationship is true. The original value is popped off of the stack.
FloatFrac(), FloatTrunc(), FloatInt(), FloatIntFrac(), FloatRound()
FloatFrac()
pushes the fractional portion of S1 onto the FP stack. The original value is popped off of the stack.
FloatTrunc()
pushes the integral portion of the contents of S1 onto the FP stack. This amounts to a rounding of the FP number toward zero, so that
FloatTrunc()
performed on -7.8 would return -7. The original value is popped off the stack.
FloatInt()
rounds S1 down to its integral component, so that
FloatInt()
performed on -7.8 would return -8. Note that for negative numbers, this is different from
FloatTrunc()
. The original value is popped off the stack.
FloatIntFrac()
splits a number into its fractional and integral parts, with the fractional part in S1 and the integral part in S2. The original value is popped off the stack.
FloatRound()
rounds S1 to a given number of decimal places.
FloatRound()
passed with zero as an argument rounds S1 to the nearest integer, rounding up if greater than or equal to .5, rounding down if less than .5
FloatRandom(), FloatRandomN(), FloatRandomize()
FloatRandom()
pushes a random number between 0 (inclusive) and 1 (exclusive) onto the stack.
FloatRandomN()
pushes a random integer between 0 (inclusive) and N (exclusive) onto the stack.
FloatRandomize()
primes the random number generator. This routine expects a seed and some
RandomGenInitFlags
. If the flag RGIF_USE_SEED is passed, then a developer-supplied seed will be used. Otherwise, a seed based on the timer clock will be used.
FloatRandomize()
should always be called before any of the
FloatRandom()
routines to ensure a high degree of randomness.
The random number generation method uses the linear congruential method, an algorithm which ensures a high degree of randomness in the computation method.
Transcendental functions are functions that cannot be constructed using normal arithmetic routines. Care must be taken with the following routines to ensure that they are operating on a valid range of values. Otherwise, the routines will return an error.
FloatSin(), FloatCos(), FloatTan(), FloatArcSin(), FloatArcCos(), FloatArcTan(), FloatArcTan2(), FloatSinh(), FloatCosh(), FloatTanh(), FloatArcSinh(), FloatArcCosh(), FloatArcTanh()
FloatSin(), FloatCos()
, and
FloatTan()
perform the given operation on the contents of S1, pushing the result onto the FP stack. S1 must be expressed in radians. The original value is popped off of the stack.
FloatArcSin(), FloatArcCos()
, and
FloatArcTan()
perform
the given inverse operation on S1, pushing the result onto the FP stack. The result is given in radians. The original value is popped off of the stack.
FloatArcTan2()
calculates the arc tangent given cartesian coordinates
x
and
y
. The arctangent is calculated from the x-axis through the origin to the given point. The value returned is expressed in radians, between -p (exclusive) and +p (inclusive). The original values are popped off of the stack.
FloatSinh(), FloatCosh()
, and
FloatTanh()
perform the given hyperbolic operations on S1, pushing the result onto the FP stack. The original value is popped off of the stack.
FloatArcSinh(), FloatArcCosh()
, and
FloatArcTanh()
perform the given inverse hyperbolic operations on S1, pushing the result onto the FP stack. The original value is popped off of the stack.
FloatExp(), FloatExponential(), FloatLg(), FloatLog(), FloatLn(), FloatLn1plusX(), FloatSqr(), FloatSqrt()
FloatExp()
performs the exponentiation of
e
to the power of S1, pushing the result onto the FP stack. The original value is popped off of the stack.
FloatExponential()
performs the exponentiation of S2 to the power of S1, pushing the result onto the FP stack. The original values are popped off of the stack.
FloatLg()
performs the logarithm to the base 2 on S1, pushing the result onto the FP stack. The original value is popped off of the stack.
FloatLog()
performs the logarithm to the base 10 on S1. The original value is popped off the stack.
FloatLn()
performs the natural logarithm (log base
e
) on S1. The original value is popped off the stack.
FloatLn1plusX()
performs the natural log of (1 + S1). The original value is popped off the stack.
FloatSqr()
performs the square of S1, pushing
the result onto the FP stack. The original value is popped off the stack.
FloatSqrt()
performs the square root of S1, pushing the result onto the FP stack. The original value is popped off the stack.
At some point 80-bit FP numbers may need to be converted into different formats, or you may need to convert these differently formatted numbers into a floating point representation. The Math Library provides for this contingency.
FloatDwordToFloat(), FloatWordToFloat(), FloatFloatToDword()
FloatDwordToFloat()
converts a passed double-word signed integer into a floating point number, and pushes that number onto the FP stack.
FloatWordToFloat()
converts
a passed word signed integer into a floating point number, and pushes that number onto the FP stack.
FloatFloatToDword()
converts the FP number in S1 into a double-word signed integer. The FP number is converted into an integer by rounding the FP number to zero decimal places.
You can convert a FP number into a word value by using
FloatFloatToDword()
and just using the low word.
FloatGeos80ToIEEE64(), FloatGeos80ToIEEE32(), FloatIEEE64ToGeos80(), FloatIEEE32ToGeos80()
FloatGeos80ToIEEE64()
converts a GEOS FP number (80 bits) into a 64 bit floating point number (in C, a type of
double
).
FloatGeos80ToIEEE32()
converts a GEOS FP number (80 bits) into a 32 bit floating point number (in C, a type of
float
).
FloatIEEE64ToGeos80()
converts a 64 bit FP number into a GEOS 80 bit FP number (in C, a type of
long
double
).
FloatIEEE32ToGeos80()
converts a 32 bit FP number into a GEOS 80 bit FP number (in C, a type of
long
double
).


## Life Cycle of a Q-Directive ### Angular directives - compile and link An Angular developer might know the life cycle of a native Angular directive. Simply put, `$compile` is where all the magic begins. It is this service that breathes life into the simple custom attributes that exist in the DOM. A native directive has two phases: 1. Compile 2. Link When `$compile` is called on an element, it traverses the DOM tree of the element down up to its last descendants and adds behaviour to the directives as described in its directive registration system. It includes using `$parse` to parse any attribute values, executing any pre-defined templates, or executing any custom behaviour defined by the directive at the time of its registration. When the compilation is done, the second part is to link the directive with a `$scope` object. This is where the bindings happen. For the simplest directives like the interpolation directive (double braces like `{{hello}}`), Angular watches the content in the braces on the given `$scope` object, and whever it changes, it updates the DOM. ### Q-Directives - compile, update and render Q-Directives take a different approach. Like `$compile`, q-directives are compiled by using a special service called `qCompile`. However, this service is no rocket science. It adds special classes to the elements with q-directives on them. This is done for performance benefits of `getElementsByClassName` over other alternatives like `querySelectorAll`. It also compiles any template defined in the directive definition. Unlike Angular directives, in scenarios like `ng-repeat`, the compliation need not happen for each repetition. Once an element is q-compiled, it need not be compiled again, even if it is cloned. The state of a q-compiled element exists in the element itself. So unlike an Angular directive, a q-directive has three phases: 1. Compile 2. Update 3. Render The first phase is handled by the `qCompile` service. Whenever a watch directive like `q-watch` detects a change in the model, it calls `qUpdate(element)`. `qUpdate` is a service that calls the `update` function on each directive in the element and its descendants. That is where any model related logic on the directive exists. The `update` function of each directive is provided with the current scope and the value of the directive's attribute (if it is an attribute directive). After the update is complete, `render` is called on each directive, and the return value of the `update` function (or scope, if no return value was given) is passed to it. The linking has purposefully been broken down into `update` and `render`, so that the model logic can stay separate from the view logic.


YYAST is a library which completes Lex and Yacc by adding an Abstract Syntax Tree (AST) generator. The saved AST is designed to be easily parsed by compilers.
You can find the doxygen reference documentation here.
I really like writing parsers using Lex and Yacc, but found that I had to create and AST for each language I was developing. Therefor I created this library which you can use directly inside the lex and yacc files. It was designed so you write as little as code as possible in these files, so it does not distract from the grammar of the language.
The second problem I tried to solve; is that I would like to use high level programming languages for writing compilers. However integrating Lex and Yacc with for example Python is problematic. The parser created with this library will create files which are very easy to write a parser for in most languages.
Since I am hoping that YYAST will be used in as many as project as possible I have decided to release the YYAST library under a very permissive and compatible license. I have chosen the BSD 2-Clause License.
Copyright (c) 2011-2013, Take Vos All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
A file consists of a single Abstract Syntax Tree, described by nested nodes. All nodes are structured in the same way to facilitate easy parsing.
The root node acts like the header of the file, child nodes of the root contain the metadata of the file. The last child node of the root is the AST of the parsed file.
Every node in the file has the same structure. All Nodes are aligned to 64 bit boundary to ease parsing of the file when it is read in memory, some processors disallow reads from unaligned fields. All integer fields are in big endian, big endian is defacto standard for storage and transmission of information. The following table shows the header of every node.
| type | description |
|---|---|
| EightCC | Node name. |
| uint64_t | Node Size. |
| uint32_t | Line number. The top most line is zero. |
| uint32_t | Column number. The left most column is zero |
| uint32_t | File number. The first file (the main file) is zero. |
| uint16_t | Reserved, must be zero. |
| uint8_t | Reserved, must be zero. |
| uint8_t | Node type. |
Every node has a user defined name of 8 characters. Names that have less characters are padded with white spaces. A name which starts with an at '@' character are reserved by the yyast library for use as metadata in the header.
The following table shows the currently reserved named.
| name | parent | type | description |
|---|---|---|---|
| @ya 2013 | branch | Root node. | |
| @files | @ya 2013 | branch | A list of original source files. |
| @file | @files | text | Filename of an original source file. |
| @null | null | A leaf node which implying that the optional child is not in use. |
The size in bytes of the complete node; header + data. The data must be in multiple of 64 bits.
The position in the parsed file where the node was found. The first character in the file will have line zero, column zero. The first file (zero) is the main source file. The line and column numbers are 32 bit, this is the same size as LLVM line and column tracking.
Using line control it is possible for generated code to reference the original source code. The filenames of these original sources are located in the header.
If part of the location is unknown or out of bounds, then these fields will be set to 0xffffffff.
The node type describes how the data of a node is structured.
| Name | Value | Description |
|---|---|---|
| null | 0 | A unused positional parameter, as a child node. Its name is '@null'. |
| leaf | 1 | A node without data or children. |
| branch | 2 | A node with children. All children are concatenated into the data of this node. |
| text | 3 | A node with a null terminated UTF-8 text string, with null padding for 64 bit alignment. |
| positive integer | 4 | An unsigned integer in big endian format. The size of the integer is a multiple of 8 bytes. |
| negative integer | 5 | An unsigned integer in big endian format. The size of the integer is a multiple of 8 bytes. The integer has an implicit negative sign. |
| binary float | 6 | A 'big-endian' IEEE 754 floating point number in "binary64" or "binary128" format. |
| decimal float | 7 | A 'big-endian' IEEE 754 floating point number in "decimal64" or "decimal128" format. |
| list | 254 | A temporary list node. This node is never written to file. Its name is '@list'. |
| count | 255 | A temporary line count node. This node is never written to file. Its name is '@count'. |
These fields are unused for now and must contain zeros for forward compatibility reasons.
This is a short introduction to the YYAST API, you can find more detailed information in the doxygen generated reference.
The function prototypes and macros to be used within lex and yacc are located in the yyast/yyast.h header file. This file should be included in both the lex and yacc grammar files.
For flex:
%{ #include <yyast/yyast.h> %} %option noyywrap %%
For bison:
%{ #include <yyast/yyast.h> int yylex(); void yyerror(const char *message); %} %defines %error-verbose %verbose %%
YYAST includes a main function to create a basic parser application which outputs and AST. You can use this function by adding the following to the epilogue of the yacc grammar file. The third argument of ya_main() is the extension given to the AST file when the name of the AST file is not given on the command line.
%% void yyerror(const char *message) { ya_error(message); } int main(int argc, char *argv[]) { return ya_main(argc, argv, "tap"); }
Literals are interpreted by the lexer and passed to parser as a node, through yylval. YYAST includes a set of literal construction functions to parse common types of literals.
| function | description |
|---|---|
| ya_literal(name, type, buf, buf_len) | A generic literal function for encoding user defined types.. |
| ya_text(name, str, str_len) | A text literal, used for strings and identifiers. |
| ya_positive_integer(name, str, str_len, base) | A positive integer literal. |
| ya_negative_integer(name, str, str_len, base) | A negative integer literal. |
| ya_binary_float(name, type, str, str_len, base, size) | A binary float literal. |
An example for a set of negative and positive integer literals of different bases.
{D}+ { yylval = ya_positive_integer("int", &yytext[0], yyleng - 0, 10); return T_INT; } -{D}+ { yylval = ya_negative_integer("int", &yytext[1], yyleng - 1, 10); return T_INT; } 0[bB]{D}+ { yylval = ya_positive_integer("int", &yytext[2], yyleng - 2, 2); return T_INT; } -0[bB]{D}+ { yylval = ya_negative_integer("int", &yytext[3], yyleng - 3, 2); return T_INT; } 0[oO]{D}+ { yylval = ya_positive_integer("int", &yytext[2], yyleng - 2, 8); return T_INT; } -0[oO]{D}+ { yylval = ya_negative_integer("int", &yytext[3], yyleng - 3, 8); return T_INT; } 0[dD]{D}+ { yylval = ya_positive_integer("int", &yytext[2], yyleng - 2, 10); return T_INT; } -0[dD]{D}+ { yylval = ya_negative_integer("int", &yytext[3], yyleng - 3, 10); return T_INT; } 0[xX]{D}+ { yylval = ya_positive_integer("int", &yytext[2], yyleng - 2, 16); return T_INT; } -0[xX]{D}+ { yylval = ya_negative_integer("int", &yytext[3], yyleng - 3, 16); return T_INT; }
Since literals are already converted to proper nodes in Lex, the literal value can simply be assigned to $$.
expr : T_INT { $$ = $1; } | T_REAL { $$ = $1; } | T_STRING { $$ = $1; } ;
The YA_BRANCH function creates a new node with the childs given as arguments. The number of childs given on th argument is variable. The position of the branch is set to the same position of a child that appeared most early in the source file.
expr : expr '+' expr { $$ = YA_BRANCH("+", &$1, &$3); } | expr '-' expr { $$ = YA_BRANCH("-", &$1, &$3); } | expr '?' expr ':' expr { $$ = YA_BRANCH("?:", &$1, &$3, &$5); } ;
In some cases a child of the branch is optional, which mirrors optional parts in the grammar of an expression or a statement. In the following example the for loop has an optional else block. You can mark an unused child with YA_NULL.
statement : T_FOR expression T_IN expression '{' block_content '}' { $$ = YA_BRANCH("for ", &$2, &$4, &$6, YA_NULL); } | T_FOR expression T_IN expression '{' block_content '}' T_ELSE '{' block_content '}' { $$ = YA_BRANCH("for ", &$2, &$4, &$6, &$10); } ;
In the previous case we have seen that YA_BRANCH can accept variable children based on the grammar. But there are also cases where the number of children to a branch are variable based on the source file.
We use the YA_LIST function to assemble a temporary node. When an YA_LIST node is given as an argument to YA_LIST or YA_BRANCH then the children of YA_LIST become direct children of the node. For example a list literal is build up by the grammar in small steps. The result of this example is a single "list" branch node, with each expression branch node as a direct child of this node.list_item : expr { $$ = $1; } ; list_item_list : list_item { $$ = YA_LIST(&$1); } | list_item_list ',' list_item { $$ = YA_LIST(&$1, &$3); } ; list_content : { $$ = YA_EMPTYLIST; } | ',' { $$ = YA_EMPTYLIST; } | list_item_list { $$ = &1; } | list_item_list ',' { $$ = &1; } ; expr : '[' list_content ']' { $$ = YA_BRANCH("list", &$2); } ;
For the times you have a statement that act like a leave but isn't a literal.
statement : T_BREAK ';' { $$ = YA_LEAF("break"); } | T_CONTINUE ';' { $$ = YA_LEAF("continue"); } ;
The file is created by YA_HEADER, the result is passed to ya_start. It will cause the basic structure of the AST file to be created, including a list of filenames of the source code that is being tracked. YA_HEADER accepts a single node as argument. In the example below we see a source file that can have import statements, class definitions and functions at the top level. These are all nodes which are children of the top level "module" node.
%start module %% module_item : T_IMPORT fqname ';' { $$ = YA_BRANCH("import", &$2, YA_NULL); } | T_IMPORT fqname T_AS T_NAME ';' { $$ = YA_BRANCH("import", &$2, &$4); } | T_CLASS T_NAME '{' class_content '}' { $$ = YA_BRANCH("class", &$2, YA_NULL, &$4); } | T_CLASS T_NAME '(' sub_classes ')' '{' class_content '}' { $$ = YA_BRANCH("class", &$2, &$4, &$7); } | T_NAME '(' def_arguments ')' '{' block_content '}' { $$ = YA_BRANCH("function", &$1, &$3, &$6); } ; module_list : module_item { $$ = YA_LIST(&$1); } | module_list module_item { $$ = YA_LIST(&$1, &$2); } ; module_content : { $$ = YA_EMPTYLIST; } | module_list { $$ = YA_LIST(&$1); } ; module : module_content { $$ = YA_BRANCH("module", &$1); ya_start = YA_HEADER(&$$); } ;


A beautiful & handcrafted monitor stand to reduce neck and eye strain.
The Mastercraft Bamboo Monitor Riser is a sturdy and stylish platform that elevates your screen to a more comfortable viewing height. Placing your monitor at eye level has the potential to improve your posture and make you more comfortable while at work, helping you stay focused on the task at hand.
Featuring artisan craftsmanship, the simplicity of design creates extra desk space below your computer to allow notepads, pens, and USB sticks to be stored under the stand.
Bamboo Stand
Pledge $25 or moreYou get an ergonomic stand made of natural bamboo. You've helped us launch our promotional campaign, and you’ll be added to a special Backer member list.
101 left
Black Edition Stand
Pledge $75 or moreYou get a Black Special Edition computer stand and a personal thank you. You’ll be added to our Backer member list. Shipping is included.
64 left
Mahogany Special Edition
Pledge $200 or moreYou get two Special Edition Mahogany stands, a Backer T-Shirt, and a personal thank you. You’ll be added to our Backer member list. Shipping is included.
0 left
Want to support us in bringing Mastercraft Bamboo Monitor Riser out in the world?
Pledge with no reward
Choose to support us without a reward if you simply believe in our project. As a backer, you will be signed up to receive product updates via email.Bamboo Stand Pledge $25 or more
101 left
You get an ergonomic stand made of natural bamboo. You've helped us launch our promotional campaign, and you’ll be added to a special Backer member list.
Entrie your pleaged
Black Edition Stand Pledge $75 or more
64 left
You get a Black Special Edition computer stand and a personal thank you. You’ll be added to our Backer member list. Shipping is included.
Entrie your pleaged
Mahogany Special Edition Pledge $200 or more
0 left
You get two Special Edition Mahogany stands, a Backer T-Shirt, and a personal thank you. You’ll be added to our Backer member list. Shipping is included.
Your pledge brings us one step closer to sharing Mastercraft Bamboo Monitor Riser worldwide. You will get an email once our campaign is completed.


Porsha Williams’ Fans Are Happy To See Her Wearing Her Own Clothing
by Ron CollinsPorsha Williams shared a photo in which she’s advertising the Georgia Collection in collab with Just Fab Online. Fans love to see that she’s rocking her own pieces and they make sure to praise her in the comments.
‘Have you shopped my “Georgia collection” with @justfabonline yet? I love this look for the upcoming holidays. Or let’s be real I love this look for every day! Comment with your favorite style from my shop! #JustFabAmbassador #JustFabStyle ((Link in Bio))’ Porsha captioned her post.
Somoene asked: ‘@porsha4real Ma’am are you supposed to be in 2 boots yet??’ and another fan responded: ‘Porsha was in heels while she was with child😊😊’
One other follower wrote: ‘Justfab is affordable… my first time ever seeing a celebrity, wearing their clothing… the prices are going to go up next month 😩’
Another follower said: ‘Love the boots !!! But Ummmmm I want the shirt!!!! @porsha4real.’
A person wrote: ‘The whole outfit tho!! Where you get the whole outfit lol,’ and another one said: ‘I need these in red, black, and brown. Putting them on my Christmas list. 🧐’
Someone else said this: ‘Yes!!! My order just came in today ❤🔥 they look and feel great @porsha4real.’
Other than this, one of the latest episodes of RHOA shocked the public by revealing that Dennis McKinley was not faithful to his fiancée, Porsha during her pregnancy with their first child.
Despite the airing of the dramatic and humiliating discovery, Porsha expressed the desire to get married in front of the cameras.


{% extends "base.html" %} {% set active_page = "index" %} {% set content_title = "Dashboard" %} {% block jumbotron %}
I use Anki to learn Russian vocabulary, solidify grammar, and improve my reading. Statistics help keep me motivated.
Learn more »


Update History
Visual Update 1 is generally available for both Cloud and On-premises customers.
See Detailed Prior Update History for additional specifics about the periodic updates since the December, 2017 early adopter release.
- Add support for standalone bookmarks app.
Note: Does not style the Add Bookmark dialog, which displays in a separate browser window.
- Update display of Admin buttons that display for managing apps.
- Update display of Community Catalog Add Source dialog.
- Remove use of IBM Plex fonts.
- Update copyright statements, license, and other text for HCL.
- Fix truncated titles in the wikis left navigation panel.
- Fix display issue in Transfer Ownership dialog.
- Fix issue with checkbox display in CEC Highlights apps.
- Fix alignment and size of buttons that display when adding a file to a status update.
- Fix focus-hover display issue on Home page status tabs.
As of November, 2019, Visual Update 1 styles the following applications and pages:
- Home page
- My Contacts
- My Network
- Directory
- Profiles
- Account Settings
- Navigation bar
- Communities
- Actions
- Activities
- Blog
- Bookmarks
- Events
- Files
- Forums
- Ideation Blog
- Members
- Metrics
- Overview
- Recent updates
- Related Communities
- Status updates
- Surveys
- Wiki
- Stand-alone Apps
- Blogs
- Bookmarks
- Files
- Forums
- Wikis
- Classic Home Page
- Action Center
- Search History
- Search Results
- Orient Me
- OpenSocial apps
- Downloads and Setup
- Meetings launch page, but not the meeting room
- Notification Settings
- Navigation bar for the above applications and pages
- Notificaiton Center for the above applications and pages
These applications and pages are not yet styled.
- File viewer when opened from the new 'Orient Me' homepage
- Reports (Cloud only)
- HCL Docs (/docs URL)
- Community Library (On-premises only)
- Globalization Settings (On-premises only)
- Application Access Settings (On-premises only)


As presidential candidates descended on Iowa, this non-partisan group raised awareness of how big money undermines our political process.
Learn MoreEvery four years, Iowa becomes the center of the political universe in a unique spectacle called the Iowa caucuses. But the folksy, diner tours of past where front-runners and dark horses mingled with farmers, teachers, and union workers are under threat as the lure of unlimited dark money contributions give deep-pocketed special interests more and more influence.
Iowa Pays the Price emerged as a non-partisan, grassroots voice to demand accountability from politicans and show that big money was often working against the issues important to everyday Iowans.
Iowa Pays the Price emerged as a non-partisan, grassroots voice to demand accountability from politicans and show that big money was often working against the issues important to everyday Iowans.
Founded just a few months before the election, Iowa Pays the Price needed to rely heavily on digital and social media to organize, engage and raise awareness of a critical campaign issue.
We needed a consistent brand that could work across a wide variety of digital and print products -- from websites and display ads to t-shirts and placards. Our friends at Action Backed developed a number of concepts, but one idea clearly stood out. We wanted to show how everyday Iowans were losing their voice in the political process and a logo with dollars signs and zeros combined with traditional Iowa scenes obscured by the limitless zeroes of big money definitely drove home the concept.
Working with Action Backed, we created a WordPress site that could serve as a billboard for the organization and its mission. We used a compelling short video to quickly explain our mission and prominently featured a sign-up form to encourage people to join. We knew email would be important to this campaign so we put significant effort into list building through a series of acquisition ads. We launched Facebook, Twitter and YouTube accounts and used a variety of organic and paid promotion to help build a following.
We knew that there was no way we could match special interests' financing so we focused on building a grassroots campaign with strong volunteer efforts. We built advertising campaings to drive targeted audiences to content that featured authentic Iowa voices.
Our field staff traveled across Iowa to assess each candidate's position on commonsense campaign finance reform. Armed with smart phones, they traveled to town halls, county fairs, and soapbox tours to ask questions and get answers on video. Through these interviews and candidate's responses to a questionaire, we were able to let Iowans know where the candidates stood.
Right before the election we released a scorecard detailing each candidate's position on key aspects of limiting the influence of money on poltiics. We promoted the scorecard heavily through our digital channels and created individual share graphics targeted to supporters of different candidates that they could share online.
Ready to get to work? Let's start building a strategy to acheive your goals.
919.360.4800


Leaked documents expose inner workings of internment camps and mass surveillance in China’s far west Xinjiang region
by Associated PressLeaked documents expose inner workings of internment camps and mass surveillance in China’s far west Xinjiang region.


"The Machine Stops" by EM Forster, 1909. First listened to it on my '08 Sierra walk.
Values:
Joy in being in the body
Adventure
Meaningful work
Family
Love
Joy in language, stories, math, using the mind
Carfree living & environments, great public spaces
Growing and caring for living things including people
Walking, non-motorized travel, and the public space of public transit
Learning from inspiring people
Singing and violins
Having very few material possessions
Maintaining constant readiness
Sitting still
Developing longer-range plans and bigger projects and accomplishments--along the lines of A. Skurka, the long now, great virtue vs. small virtue
Long walks with others in the wilderness & organizing these; pilgrimages; long walks in beautiful social / urban environments--such as in parts of Europe, perhaps--and NYC
Water, the ocean, weather
Breathing
Dao/life force/creative energy/love/the sun
Growth and challenge
That was inspired by the app questions for the Odyssey wilderness therapy company.
Change Log
2009-05-21 New page started.
2009-11-03 Added links to social networking sites.
2010-01-20 Added link to calendar.
2010-01-22 Added link to photos.
2010-01-27 Added link to LinkedIn.
2010-02-04 Added link to CouchSurfing.
2010-02-10 Added link to delicious. Added dao to me note.
2010-02-17 Added link to The Machine Stops.
2010-02-19 Added list of values, links to groups, buzz
2010-02-23 Removed link to FB. . .I'll go with buzz


After reading the postings of experiences concerning Galanga, I went down to the local asian grocery, and asked the clerk about the root. I got a similar response to other people's stories... The clerk grinned, laughed, and led me to the Galanga. They did not have powdered galanga, just the root, so I bought two oz. and ground it myself, using a coffee grinder.
I mixed about 1/4 cup in a cup of OJ and downed it. I noticed very little effect, but I seemed a little anxious and irritable. It was so slight that I almost suspect it was a placebo effect. However, starting about an hour later and lasting nearly a day, I was wired. I felt very vibrant and energetic. Sort of like a large dose of caffeine without the shakes and negative effects.
Kinda fun, I guess. I hesitate to think of it as a 'drug'. I guess I really cannot be certain whether or not the experience was truly attributable to the galanga or not, but I plan to try it on a regular basis.
Experience Reports are the writings and opinions of the individual authors who submit them.
Some of the activities described are dangerous and/or illegal and none are recommended by Erowid.


DeepMind is the world leader in artificial intelligence research and its application for positive impact.
We’re on a scientific mission to push the boundaries of AI, developing programs that can learn to solve any complex problem without needing to be taught how.
If we’re successful, we believe this will be one of the most important and widely beneficial scientific advances ever made, increasing our capacity to understand the mysteries of the universe and to tackle some of our most pressing real-world challenges. From climate change to the need for radically improved healthcare, too many problems suffer from painfully slow progress, their complexity overwhelming our ability to find solutions. With AI as a multiplier for human ingenuity, those solutions will come into reach.
As in all long-term research efforts there are many hurdles ahead, but our team of renowned scientists and engineers is making exciting progress.


Yeah, yeah, yeah


Stomp Server Performance Comparisons
Table of Contents
Overview
Show data for a benchmark run on the platform:


Credits
Giving credit where credit is due and providing other developers (and myself) with helpful resources.
- Yandex Dictionary and Tranlate APIs for free translation and determining part of speech and gender tags
- Pixabay API for free image search
- Ruby on Rails for rapid development
- Paperclip to handle file uploads and storage
- Color Hex for help choosing colors and color hex codes
- Bootstrap Snippet for search form code
- Devise for user authentication and session management
- ActiveModel for implementing Rails classes that have certain model functionality, like validation, without having to implement a corresponding table in the database.
- This article on CSS tricks for help converting JQuery to Coffeescript
- Freepik for free candy icon
- Canter font is used in the logo
- Google fonts for the font Josefin Sans, which the headings, navigation links, footer, flashcards, and splash message on front page use.
- Bootstrap for the glyphicons and grid system used to display the flashcards, and rapid theming.


Do you want to change the world?
Are you a developer, or a non-profit organization?
Developers             OrganizationsStart Bootstrap has everything you need to get your new website up and running in no time! All of the templates and themes on Start Bootstrap are open source, free to download, and easy to use. No strings attached!
Get Started!Our templates are updated regularly so they don't break.
You can use this theme as is, or you can make changes!
We update dependencies to keep things fresh.
You have to make your websites with love these days!
Ready to start your next project with us? That's great! Give us a call or send us an email and we will get back to you as soon as possible!
123-456-6789


|
Smack | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jivesoftware.smackx.receipts.DeliveryReceiptManager
public class DeliveryReceiptManager
Manager for XEP-0184: Message Delivery Receipts. This class implements
the manager for DeliveryReceipt
support, enabling and disabling of
automatic DeliveryReceipt transmission.
| Method Summary | |
|---|---|
static void |
addDeliveryReceiptRequest(Message m)
Add a delivery receipt request to an outgoing packet. |
void |
addReceiptReceivedListener(ReceiptReceivedListener listener)
Get informed about incoming delivery receipts with a ReceiptReceivedListener . |
void |
disableAutoReceipts()
Helper method to disable automatic DeliveryReceipt transmission. |
void |
enableAutoReceipts()
Helper method to enable automatic DeliveryReceipt transmission. |
boolean |
getAutoReceiptsEnabled()
Check if AutoReceipts are enabled on this connection. |
static DeliveryReceiptManager |
getInstanceFor(Connection connection)
Obtain the DeliveryReceiptManager responsible for a connection. |
static boolean |
hasDeliveryReceiptRequest(Packet p)
Test if a packet requires a delivery receipt. |
boolean |
isSupported(java.lang.String jid)
Returns true if Delivery Receipts are supported by a given JID |
void |
processPacket(Packet packet)
Process the next packet sent to this packet listener. |
void |
removeReceiptReceivedListener(ReceiptReceivedListener listener)
Stop getting informed about incoming delivery receipts. |
void |
setAutoReceiptsEnabled(boolean new_state)
Configure whether the DeliveryReceiptManager should automatically
reply to incoming DeliveryReceipt s. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static DeliveryReceiptManager getInstanceFor(Connection connection)
connection
- the connection object.
public boolean isSupported(java.lang.String jid)
jid
-
public void processPacket(Packet packet)
PacketListener
A single thread is responsible for invoking all listeners, so it's very important that implementations of this method not block for any extended period of time.
processPacket
in interface PacketListener
packet
- the packet to process.public void setAutoReceiptsEnabled(boolean new_state)
DeliveryReceiptManager
should automatically
reply to incoming DeliveryReceipt
s. By default, this feature is off.
new_state
- whether automatic transmission of
DeliveryReceipts should be enabled or disabledpublic void enableAutoReceipts()
public void disableAutoReceipts()
public boolean getAutoReceiptsEnabled()
public void addReceiptReceivedListener(ReceiptReceivedListener listener)
ReceiptReceivedListener
.
listener
- the listener to be informed about new receiptspublic void removeReceiptReceivedListener(ReceiptReceivedListener listener)
listener
- the listener to be removedpublic static boolean hasDeliveryReceiptRequest(Packet p)
p
- Packet object to check for a DeliveryReceiptRequest
public static void addDeliveryReceiptRequest(Message m)
m
- Message object to add a request to
|
Smack | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |


--- layout: post title: "Registration disabled" date: 2007-08-14 comments: false categories: - Uncategorized ---


For many components, a label
attribute is available, which place a label in front
of the according component.
With the labelLayout
you can adjust this label.
The following examples use an input field to show, how this works.
Tag Library Documentation:
If the labelLayout
is not set, the value is 'flexLeft' by default.
The value 'none' has the same effect as just not set the label
attribute.
The labelLayout
is set to 'top'.
The segment layout is divided in two columns. The right one is three times bigger. The 'segmentLeft' and 'segmentRight' put the label in the left or in the right column.


| Date and Time | Speaker | Title & Abstract |
|---|---|---|
|
September 18
Monday 9-9:20am MAC |
Adam Prinkey
Math Sciences Department Florida Tech |
Title: Evolution of Interfaces for the Nonlinear Double Degenerate Parabolic Equation of Turbulent Filtration with Absorption
Abstract: We present a full classification of the short-time behavior of the interfaces and local solutions to the nonlinear double degenerate reaction-diffusion equation of turbulent filtration with strong absorption: |
|
September 18
Monday 9:20-9:40am MAC |
Ali Haqverdiyev
Math Sciences Department Florida Tech |
Title: Gradient Method in Besov Spaces for the Optimal Control of Parabolic Free Boundary Problems
Abstract: We pursue numerical analysis of the optimal control problem introduced recently as a variational formulation of the inverse Stefan problem in [U.G.Abdulla, Inverse Problems and Imaging, 7, 2(2013), 307-340 and 10, 4(2016), 869-898]. By employing Frechet differentiability result of the recent paper by [Abdulla et.al., Evolution Equations and Control Theory, 6, 3(2017), 319-344], iterative numerical algorithm based on the projective gradient method in Besov spaces is implemented. We pursue sensitivity analysis with respect to initial guess, and comparison of alternative approaches of simultaneous reconstruction vs. nested optimization of the control vector components. Numerical results are demonstrated for model examples with various levels of complexity. |
|
October 16
Monday 9-10am MAC |
Ali Al-Obaidi
Math Sciences Department Florida Tech |
Title: Modulated Random Measures On Hausdorff Topological Spaces
Abstract: In this seminar, we will introduce random measures on $\sigma$-compact Hausdorff spaces and define their stochastic integrals of functions of one and two variables. We further form a rigorous construction of a random measure perturbed by a stochastic process and target its stationary intensity often occurring in control theory. To obtain that intensity we modify and refine the classic Campbell's theorem for random measures. Examples of modulated Poisson measures are discussed. |
|
December 04
Monday 9-10am MAC |
Saleheh Seif
Math Sciences Department Florida Tech |
Title: Breast Cancer Detection via Electrical Impedance Tomography and Optimal Control Theory
Abstract: We analyze the inverse problem of breast cancer detection through Electrical Impedance Tomography. EIT is a non-invasive medical imaging method to recover electrical conductivity of the body from electrical measurements on its surface and potentials which are applied to the electrodes such that $\sum U_i=0$. Mathematical formulation of the problem is referred to as Calderon's inverse problem on the identification of the conductivity coefficient of the second order elliptic PDE from additional boundary measurements. We pursue variational formulation and consider the optimal control problem on the minimization of the $L_2$-norm declination of the flux on certain subset of the boundary for thesecond order elliptic PDE. |


Carlos Justiniano, HC.JS founder and a long-time programmer
I'm into full-stack JS development
I've consulted for numerous companies on commercial JS based products
What is clean code?
Code that is reasonably understandable
Code free of side effects
Code that is testable
AWARENESS IS HALF THE BATTLE
Identifying and labeling bad code
Poorly written code
Mental context switching and code complexity
Tech / code debt
Poorly written code
Very few of us set out to write poor code
In many environments business pressures stress code quality
Often clean code degrades to poor code over time
Mental context switches and code complexity
In computing a context switch is the basis of multitasking
In humans, a mental context occurs when you have to switch between various program states as you attempt to understand what a program is doing
The more complicated the code the more difficult the mental context switches
Definite correlation between the number of context switches and code complexity
Takeaway: seek to simplify
Technical debt ... referring to the eventual consequences of poor system design, software architecture or software development within a codebase. - Wikipedia
Why should you care?
Often the first person who has to deal with dirty code is the person who wrote it
Then others may have to deal - think Karma
There's a real cost to dealing with dirty code
QUICK TIPS
Quick tips for writing cleaner code
Write consistent looking code. Embrace a style guide.
Take care in naming your variables, functions and objects
Don't bring your Ruby, Python or {your_language_here} naming conventions - use JS naming conventions... i.e. camelCase, CapitalizeConstructorNames
Favor small functions and objects
Limit the number of lines of code in a file or module
To comment or not to comment?
It's the subject of some debate
We can agree that useless comments are worse than no comments
Con: Comment take work and can get out of date
Pro: Use comments to share an understanding that can't be easily be inferred from the code
Pro: Well structured comments can make the code easier to understand by providing visual separators
Tip: Consider JSDoc (http://usejsdoc.org/)
Example: JSDoc and Webstorm
/**
* transSingleExecute
* Execute a single transaction and handle commit or
* rollback, return promise
* @param transobj {object} - transaction object
* @param statements {array} - transactions statements
* @returns {promise|*|Q.promise}
*/
function transSingleExecute(transobj, statements) {
// :
return deferred.promise;
}
Don't use magic numbers
Magic numbers are numbers that appear in code which seem to come from nowhere
//Before
if (!this.loadedSubViews) { this.loadedSubViews = []; }
//After
if (!this.loadedSubViews) {
this.loadedSubViews = [];
}
Always include curly braces
//Before
if (!this.loadedSubViews)
this.loadedSubViews = [];
//After
if (!this.loadedSubViews) {
this.loadedSubViews = [];
}
TIPS FOR VARIABLES
Remember variable hoisting
In JavaScript variable declarations are handled before variable assignments
//Before
function foo() {
var pi = 3.14159265358979323846264338327950288419716;
var radius = 12;
console.log('PI, radius: ', pi, radius);
var circumference = 2 * pi * radius;
console.log('Circumference: ', circumference);
}
//After
function foo() {
var pi;
var radius;
var circumference;
pi = 3.14159265358979323846264338327950288419716;
radius = 12;
console.log('PI, radius: ', pi, radius);
circumference = 2 * pi * radius;
console.log('Circumference: ', circumference);
}
Move variable declarations to the top of their function scope
//approach #1
function foo() {
var pi, radius, circumference;
pi = 3.14159265358979323846264338327950288419716;
radius = 12;
console.log('PI, radius: ', pi, radius);
circumference = 2 * pi * radius;
console.log('Circumference: ', circumference);
}
//approach #2
function foo() {
var pi = 3.14159265358979323846264338327950288419716,
radius = 12,
circumference = 2 * pi * radius;
console.log('PI, radius: ', pi, radius);
console.log('Circumference: ', circumference);
}
Avoid single var abuse #1
//Before
function foo() {
var pi = 3.14159265358979323846264338327950288419716,
radius = 12,
circumference = 2 * pi * radius,
largerCircleCircumference = circumference * 10;
console.log('Larger circle circumference: ', largerCircleCircumference);
}
//After
function foo() {
var pi = 3.14159265358979323846264338327950288419716,
radius = 12,
circumference,
largerCircleCircumference;
circumference = 2 * pi * radius,
largerCircleCircumference = circumference * 10;
console.log('Larger circle circumference: ', largerCircleCircumference);
}
Avoid single var abuse #2
//Before
function foo() {
var pi = 3.14159265358979323846264338327950288419716,
radius = 12,
circumference,
largerCircleCircumference;
circumference = 2 * pi * radius;
largerCircleCircumference = circumference * 10;
console.log('Larger circle circumference: ', largerCircleCircumference);
}
//adding function declarations
function foo() {
var pi = 3.14159265358979323846264338327950288419716,
radius = 12,
circumference,
computeLargerCircle = function(factor) {
return circumference * 10;
};
circumference = 2 * pi * radius;
console.log('computeLargerCircle', computeLargerCircle);
console.log('Larger circle circumference: ', computeLargerCircle(10));
}
Avoid single var abuse #3
//Not great
function foo() {
var pi = 3.14159265358979323846264338327950288419716,
radius = 12,
circumference = function(radius) {
return 2 * pi * radius;
},
biggerCircle = function() {
return circumference(radius) * 2;
};
console.log('Bigger circle circumference: ', biggerCircle());
}
Avoid single var abuse #4
//Not great
function foo() {
var pi = 3.14159265358979323846264338327950288419716,
radius = 12,
circumference = function(radius) {
return 2 * pi * radius;
},
biggerCircle = function() {
return circumference(radius) * 2;
},
evenBiggerCircle = biggerCircle() * 2;
console.log('Bigger circle circumference: ', biggerCircle());
console.log('Even bigger circle circumference: ', evenBiggerCircle);
}
You don't have to assign vars right away
function foo() {
var pi, radius, evenBiggerCircle;
function circumference(radius) {
return 2 * pi * radius;
}
function biggerCircle() {
return circumference(radius) * 2;
}
pi = 3.14159265358979323846264338327950288419716;
radius = 12;
evenBiggerCircle = biggerCircle() * 2;
console.log('Bigger circle circumference: ', biggerCircle());
console.log('Even bigger circle circumference: ', evenBiggerCircle);
}
TIPS FOR CONDITIONALS
Avoid large conditional blocks #1
//Before
var getUserIDsToNotify = function(notifyTo, data) {
'use strict';
var userIDs = [];
var deferred = q.defer();
if (notifyTo === 'USERS') {
if (!data.user_ids) {
deferred.reject({success: false});
} else {
userIDs = data.user_ids;
deferred.resolve(userIDs);
}
} else if (notifyTo === 'GROUP') {
if (!data.group_id) {
deferred.reject({success: false});
} else {
groupLib.listGroupMembers(data.group_id)
.then(function(results) {
for (var index in results) {
userIDs.push(results[index].user_id);
}
deferred.resolve(userIDs);
})
.catch(function(error) {
deferred.reject(error);
});
}
} else if (notifyTo === 'ALL_GROUPS') {
// get all group ids and then users OR get all the users
groupLib.listAllGroupMembers()
.then(function(results) {
for (var index in results) {
userIDs.push(results[index].user_id);
}
deferred.resolve(userIDs);
})
.catch(function(error) {
deferred.reject(error);
});
}
return deferred.promise;
};
Avoid large conditional blocks #2
//After
function handleUsers(data, deferred) {
var userIDs = [];
if (!data.user_ids) {
deferred.reject({success: false});
} else {
userIDs = data.user_ids;
deferred.resolve(userIDs);
}
}
function handleGroup(data, deferred) {
var userIDs = [];
if (!data.group_id) {
deferred.reject({success: false});
} else {
groupLib.listGroupMembers(data.group_id)
.then(function(results) {
for (var index in results) {
userIDs.push(results[index].user_id);
}
deferred.resolve(userIDs);
})
.catch(function(error) {
deferred.reject(error);
});
}
}
function handleAllGroups(data, deferred) {
var userIDs = [];
groupLib.listAllGroupMembers()
.then(function(results) {
for (var index in results) {
userIDs.push(results[index].user_id);
}
deferred.resolve(userIDs);
})
.catch(function(error) {
deferred.reject(error);
});
}
function getUserIDsToNotify(notifyTo, data) {
'use strict';
var deferred = q.defer();
if (notifyTo === 'USERS') {
handleUsers(data, deferred);
} else if (notifyTo === 'GROUP') {
handleGroup(data, deferred);
} else if (notifyTo === 'ALL_GROUPS') {
handleAllGroups(data, deferred);
}
return deferred.promise;
};
TIPS FOR FUNCTIONS
Move nested functions to the top of the enclosing function after the var declarations
function foo() {
var pi, radius, evenBiggerCircle;
function circumference(radius) {
return 2 * pi * radius;
}
function biggerCircle() {
return circumference(radius) * 2;
}
pi = 3.14159265358979323846264338327950288419716;
radius = 12;
evenBiggerCircle = biggerCircle() * 2;
console.log('Bigger circle circumference: ', biggerCircle());
console.log('Even bigger circle circumference: ', evenBiggerCircle);
}


Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the
20,900.00
23,900.00
30000.00
Jeans at Crazy Prices
E-commerce Private Limited, Buildings Xyz Tower, New Delhi & South Delhi, New Delhi +91-1234567890, New Delhi, India


{%extends "base/page.html"%} {%block title%}Documentation comment{%endblock%} {%block contents%}
Your documentation comment has been received, and been posted to the pgsql-docs mailinglist. It will show up there as soon as it has cleared the moderator queue.
{%endblock%}


Smoothly, code changes be transfered from IDE to cloud without commit, push or pull.
Developers can share the same development environment and conduct joint debugging.
Amazing enhancement of Kubernetes and Helm, developers codes on Kubernetes with on friction.
By using Nocalhost, developers can focus on a certain service in the microservices, switch to development mode and debug easily.


00:00:00
P A U S E
S T O P
From
To
Interrupted
Content
Nurse
Doctor
Discussion
Work-related
Patient
Nurse
Equipment Setup
Personal
Family Member
Self
B A C K
D E L E T E
SAVE EVENT
12:00


Flipkart Lite – 70% increase in conversion
AliExpress – 104% increase in conversion
Housing.com
Wiki offline
Back