Functions
The following functions are available globally.
-
Undocumented
-
Undocumented
-
Undocumented
-
Undocumented
-
Undocumented
-
Undocumented
-
Undocumented
-
Undocumented
-
Undocumented
-
Undocumented
-
Undocumented
-
Undocumented
-
Undocumented
-
Undocumented
-
Undocumented
-
Undocumented
-
Undocumented
-
Undocumented
-
Undocumented
-
Undocumented
-
Undocumented
-
Undocumented
-
Undocumented
-
Undocumented
-
Undocumented
-
Undocumented
-
Undocumented
-
Undocumented
-
Undocumented
-
Undocumented
-
Undocumented
-
Undocumented
-
Undocumented
-
Declaration
Swift
public func ∈<T: Equatable, S: Sequence> (lhs: T?, rhs: S?) -> Bool where S.Iterator.Element == T
-
Undocumented
-
Append
See morelhs
torhs
in-place.Declaration
Swift
public func <<<C: RangeReplaceableCollection, T>(lhs: inout C, rhs: T) where C.Iterator.Element == T
Parameters
lhs
A collection of
T
s which will receive the new element.rhs
An element to append to
lhs
-
Append the contents of
See morelhs
torhs
in-place.Declaration
Swift
public func <<<C: RangeReplaceableCollection, T: Sequence>(lhs: inout C, rhs: T) where C.Iterator.Element == T.Iterator.Element
Parameters
lhs
A sequence of
T
s whose contents will be appended tolhs
lhs
A sequence of
T
s whose contents will be appended tolhs
-
Append
See morelhs
torhs
in-place.Declaration
Swift
public func >><C: RangeReplaceableCollection, T>(lhs: T, rhs: inout C) where C.Iterator.Element == T
Parameters
lhs
An element to append to
rhs
rhs
A collection of
T
s which will receive the new element. -
Append the contents of
See morelhs
torhs
in-place.Declaration
Swift
public func >><C: RangeReplaceableCollection, T: Sequence>(lhs: T, rhs: inout C) where C.Iterator.Element == T.Iterator.Element
Parameters
lhs
A sequence of
T
s whose contents will be appended torhs
rhs
A collection of
T
s which will receive the new elements.
-
Given an [AnyObject] array, attempt to instantiate an array of objects from its elements and return it. If any of the instantiations fails, fail the entire lot.
Declaration
Swift
public func FromJSON<T: AferoJSONCoding>(_ json: [Any]?) -> [T]?
Parameters
json
An
[AnyObject]
arrayReturn Value
If all objects were successfully instantiated, an array of the objects. If any failed, nil.
-
Undocumented
-
Undocumented
-
Undocumented
-
Undocumented
-
Undocumented
-
Undocumented
-
Undocumented
-
Undocumented
-
Undocumented
-
Undocumented
-
Undocumented
-
Undocumented
-
Undocumented
-
Undocumented
-
Undocumented
-
Undocumented
-
Undocumented
-
Undocumented
-
Undocumented
-
Perform
perform
ononQueue
aftertimeInterval
seconds.Declaration
Swift
public func after(_ timeInterval: TimeInterval, onQueue: DispatchQueue = DispatchQueue.main, perform: @escaping ()->Void)
-
Undocumented
-
Undocumented
-
Given an array of optional values, and a function to convert the opt
Declaration
Swift
public func minimize<T, C: Comparable>(_ values: [T?], f: (T?)->C?) -> T?
-
Undocumented
-
Undocumented
-
Undocumented
-
Undocumented


Chapter 2 Meet the Growth Hacker
The question I encounter more than any other with people who are new to this topic isn’t, “How do I growth hack?” A surprising number of people are still at, “What the heck is growth hacking?” Since growth hacking is as much an art as a skill, you’re right to ask both questions in the beginning of your understanding of this exciting new approach to marketing. A “growth hacker” is a hybrid beast, a skilled mix of a technical genius and a marketer. He’s leading the way in the rapid development of a new “standard” business model. In the process, he’s making every definition of “marketing” you ever learned completely irrelevant.
2.1 The Growth Hacking Mindset
At the very least, growth hackers are rewriting the standard “best practices” of marketing. Many are doing so from the coding perspective of the genius geeks who built the Internet as we know it today. Growth hackers don’t see marketing as an activity, per se, but a fundamental aspect of how a product or service is designed and built. Subsequent versions or iterations are optimized and shared on the basis of ongoing evaluations of success. These evaluations and adjustments are assumed to be infinite and are repeated multiple times. The major goal is massive and rapid growth, not being wedded to any one design or operational model. In this mindset everything becomes fair game for the critical eye of the growth hacker. They don’t so much ask, “How well is our marketing email written?” as “How deliverable is our email?”
Marketing language is not as important as the mechanism that sends the email and encourages the message it contains to be passed on from one user to the next. A growth hacker won’t be satisfied with an attractive or well-laid out website, he’ll ask why the site doesn’t load 2 seconds faster and why the Facebook opt-in link isn’t more prominently placed. Such factors are no longer issues for the technical or design team, but for the growth hacker charged with winning the market. His end goal is always a self-perpetuating machine that is so well oiled, it constantly grows itself. Armed with the ability to track, test, and improve every imaginable Internet metric, growth hackers are not attracted to the enormous gambles that were once the lifeblood of the dot come world. They don’t do anything that is unnecessary or counterproductive, and they know the value of small, but highly elegant strategies.
2.2 Lessons Learned from Hotmail and Gmail
Take, for instance, the example of Hotmail, a classic in every growth hacking conversation. The simple strategy there was the answer to the question, “Can we put a message at the bottom of everyone’s screen who gets an email from our service?” That translated to an advertisement for the product on every email sent. In six months, Hotmail had 1 million members, a figure the service then doubled in just five weeks. When Microsoft bought Hotmail in December 1997 for $400 million, there were nearly 10 million users. Hotmail took exactly 30 months to acquire 30 million users! The initial investment in the service was $300,000. Most everyone I know would be happy with a profit margin of $399,700,000! When Google launched Gmail the company followed many of the same growth strategies. They built an excellent product, but created curiosity and buzz by making its initial use by invitation only. The number of potential invites was increased along with the existing user base, spreading Gmail usage and popularity from person to person. Now, Gmail is the dominant and best free email service with 425 million users reported in 2012.
2.3 Growth is the Focus
Growth hackers are charged with taking “nothing” and turning it into “something” as fast as they possibly can. To do so, the traditional marketing playbook goes out the window in favor of all things trackable, testable, and scalable. Once upon a time the buzz words of the business world were publicity, advertising, branding, and “mind share.” All growth hackers do is pursue growth. Their tools are things like email, pay-per-click, blogs, and platform APIs. Their mantra is almost Biblical, “And users beget users, who beget users, who beget . . . “
2.4 Fill a Need, No Matter What
The basic principle of marketing still applies, “Who are my customers and where are they?” In classic marketing, the strategy used to reach those customers was honed and refined, but the business and product remained basically the same. Growth hackers believe changing the entire business model is completely fair game. They’re not interested in just redesigning the cereal box, nor are they even dedicated to making the cereal! The only goal is to generate explosive reactions and complete loyalty from the customer. The best marketing decision is to fulfill a real and compelling need for those customers. If that means changing the business itself to reach them, the growth hacker says, “Let’s do it!” He is a relentless follower of the Socratic Method. Question every assumption repeatedly and beware complacency. Who is this product for? Why would someone use this product? Why do I use this product? Is this the right product for the job? Is this the right job for the product?
And on and on and on until you get the Holy Grail — Product Market Fit (PMF).
2.5 Match Making with Early Adopters
Matching the way products are marketed with the way prospects learn about and shop for those products is a crucial aspect of growth hacking. Early adopters are key to this process and can make or break a business launch. Any product or service that can, in the beginning, grab and keep the interest of early adopters that become loyal and fanatical users stands a much greater chance of achieving the kind of explosive growth that is the ultimate goal. If you’re launching a product or service and you don’t know where to find those early adopters?
It Takes a Tribe Building that army of passionate, loyal users is today’s version of branding. If you have that army, what some growth hackers call your “tribe,” you don’t have to worry so much about how you maintain your pre-existing brand as it relates to a specific product or service. Your tribe will be receptive to whatever you offer.
This is a lesson that self-published authors are learning. The new product model in self-publishing is the serial novel offered after the fashion of a television series. This type of fiction is shorter, and appears on a regular schedule. Fans are passionately loyalty to the characters and the world they inhabit, so they are hungry for each new book. As additional readers discover the books, they are equally hungry for all the titles in the existing catalog. Sales for older titles are generated at the same time that the desire for new titles is amplified. Some self-published authors have fewer than 1,000 loyal readers, but they are earning six-figure incomes, completely redefining the concept of what it means to be a “bestselling” author. Not all of these books are great works of literature. In fact, most of them aren’t. That’s not the point. The books sell, and they generate excellent long-term income for the authors. Is it any wonder that traditional publishers fear the growing power of independent authors and the rise of the ebook? Every startup, even if it’s a self-published zombie novel, is designed to be one thing — a growth engine.
2.7 How Do I Learn to be a Growth Hacker?
As I said earlier,
growth hacking
is as much an art as a science.
앞서 말했듯이 growth hacking
은 과학이라기 보다는 예술입니다.
The tools to grow one product or service won’t necessarily work for another.
하나의 제품 또는 서비스를 성장시키는 도구가 반드시 다른 제품이나 서비스에도 적용되는 것은 아닙니다.
This is not a set process of steps, or a “do this” and then “do that” way of thinking.
이것은 일련의 단계적 과정이 아니라서,“이렇게”한 다음“그렇게”생각하는 방식이 아닙니다.
In my opinion, one of the best ways to become a
growth hacker
is to study at the feet of masters.
제 생각에 growth hacker
가되는 가장 좋은 방법 중 하나는 마스터의 발밑에서 공부하는 것입니다.
To that end, I’m devoting the remainder of this book to profiling some of the most impressive (if not always the best known) examples of how products and services have benefited from innovative growth hacking techniques.
이를 위해 이 책의 나머지 부분에서는 제품과 서비스가 혁신적인 growth hacking 기술의 이점을 얻은 방법에 대한 가장 인상적인 (항상 가장 잘 알려진 것은 아니지만) 몇 가지 사례를 프로파일링하는 데 전념할 예정입니다.
“But wait,” you say. “If I’ve never heard of a company or a service, how can it be a success?”
“하지만 잠깐만, 회사 나 서비스에 대해 들어 본 적이 없다면 어떻게 이것을 성공이라고 할 수 있습니까?” 라는 의문을 가질 수 있습니다.
Because each of these entities has a dedicated set of core users.
이러한 각 엔터티에는 전용 핵심 사용자 그룹이 있기 때문입니다.
Growth hacking even redesigns what it means to be a success!
그로스 해킹은 성공의 의미까지 재 설계합니다!
Remember those self-published authors? Many are remodeling their homes and funding their children’s college education on the reading tastes of fewer than 1,000 dedicated readers.
자체 출판 저자를 기억하십니까? 그들 중 많은 사람들이 1,000 명 미만의 독자 취향 맞춘 저술의 댓가로 수익을 얻어 집을 리모델링하고 자녀의 대학 교육에 자금을 지원하고 있습니다.
To a Stephen King, a readership that small might not be a success, but to an indie author, it’s their ticket to a completely changed lifestyle.
Stephen King에게는 작은 독자층이 성공으로 간주되지 못할 수도 있지만 인디 작가에게는 완전히 변화된 라이프 스타일로가는 티켓입니다.
Both authors are “successes,” but their success is defined differently.
두 저자 모두“성공”이지만 그들의 성공은 다르게 정의됩니다.
Stephen King is an internationally recognized author.
Stephen King은 국제적으로 인정받는 작가입니다.
The indie guy? His mortgage is paid off and his kid is going to college. 인디 작가, 그는 수익을 얻어 대출금도 갚고 그의 아이는 대학에 갑니다.
That’s more than enough success in his book.
이는 그의 책을 통해 충분히 성공한 것 이상입니다.
As you begin to read the profiles that comprise the bulk of this book, take your first step toward becoming a
growth hacker
by throwing out both the rulebook and the dictionary.
이 책의 대부분을 구성하는 프로필을 읽기 시작하면서 룰북과 사전을 모두 버리고 growth hacker
가되기위한 첫 걸음을 내 딛으십시오.
You truly are about to enter a “brave new world,” and frankly, it’s a pretty exciting landscape out there!
진정으로 “용감한 신세계”로 들어 가려고합니다. 솔직히 말해서 정말 흥미로운 풍경입니다!


Features
✔ { HTML5 + JS + CSS }
✔ jQuery
✔ Responsive
✔ Folders & Categories
✔ Fully Customizable
✔ Open Source
Watch Demo


An example of using the pouchdb-element suite:
Input your local database name
Optionally input your remote address and include the database name.
If you don't do this your document will be stored in your local database and will not be
stored remotely.
To log in you must have used a remote database:
Username:
Password:
User: [[user]]
Error: [[authError]]
Okay, so let's take a look at tinkering with this pouchdb-document:
Document value stored in your database (not including metadata) : [[doc.val]]
Error: [[docError]]
Finally lets take a gandar at views:


> Docs > Http Client
Use HttpClient
.send()
to send a request and receive the response (asynchronously):
Async<HttpResponse> send(HttpRequest request)
For example
HttpClient client = new HttpClient(); HttpRequest request = HttpRequest.toGet("https://example.com"); Async<HttpResponse> asyncRes = client.send( request );
Or use the convenience method doGet(absoluteUri)
Async<HttpResponse> asyncRes = client.doGet( "https://example.com" );
Features include - proxy
, authentication
, cookies
, etc.
The HttpClient
API is asynchronous, see Async Programming. To demonstrate:
Async<String> asyncBody = client .doGet( "https://example.com" ) // Async<HttpResponse> .peek(response -> out.println(response.status())) .then(response -> response.bodyString(MAX_CHARS)) // Async<String> .peek(System.out::println) .finally_(client::close) ;
The response body must be closed to free the underlying connection. In the previous example, the response.bodyString()
method will close the body upon completion; bodyBytes()
would do the same.
An HttpClient
should be closed
eventually.
You may not care about Async
API; you just want to use HttpClient
in a traditional, synchronous way.
This can be done by the sync()
method on Async
actions, for example
HttpResponse response = client.doGet("https://example.com").sync(); System.out.println(response.status()); String body = response.bodyString(MAX_CHARS).sync(); System.out.println(body);
Of course, sync()
blocks the current thread, therefore you should not do this in an async environment, like in an HttpHandler
.
To submit a form to a server, you can populate a FormData
, then convert it toRequest
:
FormData form = new FormData("POST", "http://localhost:8080/upload") .param("title", "A Kitty") .file ("image", "cat.gif"); HttpRequest request = form.toRequest(); client.send(request);
HttpClient
configuration is done by HttpClientConf
, typically in the builder pattern. For example,
HttpClient client = new HttpClientConf() .proxy("<IP_ADDRESS>", 8080) .trafficDump(System.err::print) .newClient();
See also


| {{expenseThings.amount | currency:"$":2}} | {{expenseThings.name}} | {{expenseThings.category}} | {{expenseThings.format}} | {{expenseThings.notes}} |
| {{incomeThings.amount | currency:"$":2}} | {{incomeThings.name}} | {{incomeThings.category}} | {{incomeThings.format}} | {{incomeThings.notes}} |
Daily Expenditures Month-to-Month


$foo
construct)
${exp}
construct)
IF
/ WHEN
/ UNLESS
, ELSE
/ ELSIF
— conditional execution AIF
/ AWHEN
— like IF
/ WHEN
, but store the condition in $it
REPEAT
— to repeat stuff MAP
/ FOREACH
— iterate an array MAPHASH
— iterate an object (hash) CONTINUE
and BREAK
— for loop control LET
— define variables WITH
— modify the scope chain BLOCK
— define reusable template blocks WRAP
, CONTENT
— call a wrapper with an additional block of text EXPORT
— define a BLOCK that can be used in another template LITERAL
— include literal text SYNTAX
— temporarily change the reader character $( ... )
A “template engine” is a tool able to transform some text into another, by interpreting/replacing various patterns in the source text. YAJET is such a tool designed for client-side (JavaScript, in-browser) transformation.
YAJET is a compiler, in the sense that it transforms your template into executable JavaScript code; after compiling a template you get a function which you can call with data required to fill your template, and it returns it rendered.
 The syntax is always creepy. YAJET is no exception from this fundamental rule, but still I think it's better than others. It has a nice lispy syntax for directives, that feels much better than the sheer ugliness that other template toolkits propose. But it also strives to keep simple things simple:
$foo
— insert variable foo
$foo|html
— insert variable foo, HTML escaped
$$
— insert a literal dollar sign
${ a() + b() }
— insert sum of a() and b()
${ a() + b() => html }
— insert sum of a() and b(), HTML escaped
$(REPEAT (3 => i)
Item $i
 $)
— display 3 items
Rather than encouraging you to write pieces of literal JavaScript in your templates2, YAJET defines some high-level directives that allow you to traverse lists, define blocks, conditionals and so on with a cleaner syntax; and it translates them into running JavaScript in a proper way. So you don't write, for example:
<?js for (var i = 0; i < list.length; ++i) { ?> <?js var el = list[i] ?>
#{el}
 <?js } ?>
(the example above is from Tenjin). In YAJET you write it like this:
$(MAP (el => list)
$el
 $)
Or if you like the Perl style, you can do3: $(FOREACH (list)
$_
$)
.
There was an explosion of “jQuery template engines” lately, generated
by jQuery's outstanding support for CSS selectors—people4
write

 to introduce a DIV containing the
variable foo
. I don't like this style. YAJET is appropriate for
any kind of text templates—it was not designed specifically for
HTML, although that's mostly what I use it for.
Other than the boring variable interpolation, we have the following:
$foo|html
will HTML-escape
the value of foo).
IF
/ WHEN
/ UNLESS
, ELSE
, ELSIF
).
REPEAT
). They allow you to repeat a part
of the template a few times.
MAP
and MAPHASH
) – MAP
to
traverse a list and MAPHASH
to iterate an object (hash table).
BREAK
or CONTINUE
.
LET
) and dynamic scope manipulation (WITH
).
BLOCK
and EXPORT
). Useful to declare blocks that
can be called, multiple times, as a function. EXPORT
declares
functions that can be called from a different template.
WRAP
-pers. They receive some content
and are able to output something before and after it. The content
is processed as template.
You need to load yajet.js, and to create an instance like this:
var yajet = new YAJET({ reader_char : "$", with_scope : false, filters : { foo: function(val) { /*...*/ }, bar: function(val) { /*...*/ } } });
All arguments are optional. Then to compile a template, you do this:
var func = yajet.compile("You said: $this.foo $this.bar");
and to execute it:
alert( func({ foo: "hello", bar: "world!" }) );
The function returned by “yajet.compile” receives one argument, and that
argument is available in your templates via the JavaScript this
keyword.
This is the default behavior, because I think it's the best one in general,
but if you don't like to use the this.
prefix to access the members you
can pass with_scope: true
in the constructor. It wraps the generated
function in a with(this) { ... }
block, so the above would become:
var yajet = new YAJET({ with_scope: true }); var func = yajet.compile("You said: $foo $bar"); // and call it the same way: alert( func({ foo: "hello", bar: "world!" }) );
It's more convenient, but it's slower. How much slower depends on how
big is your template and how many variables there are. If you want a
comparison for a large number of iterations with and without the
with
statement, see this file (Firebug is required for timing the
operations; watch the Firebug console; it also works in Chrome with
its JavaScript console; Chrome is even slower than Firefox for the
with
case).
Template syntax is triggered by a single special character called the
“reader char”. By default this character is $
, but you can use
anything else by passing the reader_char
constructor argument. I
personally would prefer to use some Unicode character, for instance:
var yajet = new YAJET({ reader_char: "•" }); var tmpl = yajet.compile("You said •this.foo •this.bar");
YAJET parses the template as text, leaving it unchanged, until it encounters the “reader char”. What follows in this document will assume that $ is the reader character (the default). A few types of constructs are recognized:
$$
— inserts a literal $ character.
$-
— skips the following whitespace.
$#
— comment (ignore) until the end of the line.
$foo
, $foo.bar
— inserts the value of the variable foo, foo.bar etc.
${ foo.bar.baz() }
— evaluates the given JavaScript expression and
inserts the return value, if any.
$(DIRECTIVE ... $)
— processes the contents according to some
rules which are particular for DIRECTIVE
.
$( ... )
— inserts literal JavaScript code (must not be ill-formed!).
$foo
construct)
To insert a variable you can say $foo
, $foo.bar
, etc. This case
is quite simple. The parser will stop at a character which isn't a
letter, a digit, an underscore, a dot or a pipe. The pipe is for
conveniently filtering the value: $foo|html
will HTML-escape the
value of foo before inserting it into the output.
Note that when the dot or pipe is followed by a non-word character,
then they are not considered part of the token and are left as is.
Thus you can safely say “Your name is |$user.name| and score is $score.”
Filters are functions that take one argument and should return the
modified value. You can easily define your own filters (more on this
later). Filters can be combined, for example: $foo|upcase|html
will
first make foo uppercase, then apply the html filter to the upcased
string.
$$
.
$foo|bar
to get the value of “foo”, followed by a
literal pipe, followed by the text "bar". Instead you should write
it like this: ${foo}|bar
(the next session discusses the ${foo}
construct).
${exp}
construct)
This is similar to “simple interpolation”, in that the value of the
expression gets inserted into the output. For example ${a+b}
will
insert the sum of a and b. The scanner is smart enough to read
arbitrarily complex expressions, provided that they are properly
balanced (you need to be careful about literal RegExp-s for now;
more on this in Known issues).
So, an example of a perfectly valid call is:
${ // Comments are ignored, so they can contain the closing bracket: } (function(arg){ // you can use the brackets in your expression too, // because the scanner won't stop until it's properly balanced return arg.a + arg.b + arg.text; })({  a: 5, b: 10, text: "(foo}" // strings too }) }
The expression is evaluated at runtime and its value is inserted into
the template output only if it's not null. The above would output
"15(foo}
".
As already noted, the $foo
construct allows filtering the value through
some function using a convenient syntax like $foo|html
. At the time of
this writing the filters available by default are:
html
— encodes HTML special characters
upcase
— converts the string to uppercase
downcase
— lowercase the string
trim
— removes leading and trailing whitespace
plural
— useful for returning "no elements", "one element", "3 elements" depending on a numeric value.
It's easy to define custom filters when you construct the YAJET object:
var yajet = new YAJET({ filters: { md5: function(value) { return md5_hex_of(value); // return the modified value } } });
… and in your template: $password|md5
.
There is also a syntax that allows for filters within the ${exp}
construct. But since we parse valid JavaScript code, and since the pipe is
a valid JavaScript character (“bitwise or”), we have to use something
different. The idea was, thus, that such expressions will be parsed as a
list; the first element of the list is the expression itself, and any
additional elements are filters. For example:
${ this.getLabel(), upcase, html }
will convert into something like this:
output_string(
apply_html_filter(
apply_upcase_filter(
this.getLabel()
)
)
)
Since the comma doesn't look very nice for this particular case, the “list reader” also allows a few aliases. Syntactic sugar, baby! You can also use:
“=>”
“,”
“..”
“;”
So the above example can also be written like this:
${ this.getLabel() => upcase => html } ${ this.getLabel() => upcase, html } ${ this.getLabel() .. upcase; html }
These special separators only work for the “list reader”, which is used in
the ${exp}
-like constructs (and several others). Also, note that filters
are only interpreted in the top-level elements of this list, so for instance
the following won't apply the "html" filter to “foo”: ${ something(foo, html) }
. It will just call, instead, the function something
, passing the
variables foo
and html
, which is expected behavior.
When used in the ${exp}
construct, filters can receive additional
arguments. For example, assuming you have some date formatting library, you
can easily define a filter that formats a Date object according to the
arguments:
var yajet = new YAJET({ filters: { format_date: function(date, format) { // ... now return the *date* formatted according to *format* } } });
and in the template:
“Today is: ${ new Date() => format_date("YYYY-MM-DD") }”
The first argument of your filter is always the value from the template (in
the above case, the Date object created with new Date()
), and the other
arguments are passed following the filter name ("YYYY-MM-DD").
You would use “plural” like this:
1. We got ${ count => plural("no items", "one item", "two items", "# items") } 2. We got ${ count => plural([ "no items", "one item", "two items", "# items" ]) } 3. We got ${ count => plural("no items|one item|two items|# items") }
Besides the implicit argument (count
) plural accepts multiple
arguments (case 1 above), or a single array argument (case 2) or a
string (case 3) that specifies the formats separated by a pipe
character. In all cases, the arguments specify how to display the
numeric value. If it's zero, it selects the first argument; if it's
one, it selects the second, and so on. If it's bigger than the number
of arguments, it selects the last one. #
is replaced with the
number. So the above displays "We got no items" when count is zero,
"We got one item" when count is 1, "We got two items" when count is 2
and "We got # items" when count is bigger (where # is replaced with the value of count).
So far we are able to introduce arbitrary JavaScript variables and expressions in the template. However that's hardly enough. First off, the expressions must be well-formed, so there is no way to start a JavaScript block somewhere and end it some place else. The following is invalid for obvious reasons:
${ if (link != null) { } $link ${ } }
I emphasize that the lack of support for partial expressions is a
feature, not a limitation. This will never be “fixed”. To support
constructs like the above but without encouraging bad style or awful
syntax, we have a few special processing directives. Let's call these
the $(BAR ... $)
construct. To start with, here is how you would
write the above code:
$(IF (link != null) $link $)
All blocks end with a closing paren; no need for “{/IF}”, “.IF”, “END”, “<? } ?>” etc. This has an incredible advantage6: if your editor can properly match parens, you can immediately see where a block starts or ends by just moving the caret to the ending/opening paren.
Note that the processing instructions are not case-sensitive. I prefer to use UPPERCASE for them so that they stand out visually.
The $(BAR ... $)
construct has the following properties:
$(
(so it's a normal paren, not a bracket)
$)
$)
terminator
The block of text is parsed normally, so it's interpreted as plain text
until $
(the reader char) is encountered, then what follows the reader
char is processed by the rules I described in this document.
Following I will describe the directives available at this time. I think the set of them is quite comprehensive and allows you to express any kind of template in a simple and consistent manner.
IF
/ WHEN
/ UNLESS
, ELSE
/ ELSIF
— conditional execution
IF
and WHEN
are synonyms, while UNLESS
is the antonym. WHEN
seems more
appropriate for cases where you don't have an ELSE
clause. They support one
argument which must be a condition enclosed in parens. Examples:
$(WHEN (user_id == null) Please login $) $(UNLESS (user_id != null) Please login $) $(IF (a  b))
B is smaller
 $(ELSE)
A and B are equal
 $)
Note that you can use ELSE
or ELSIF
inside UNLESS
or WHEN
blocks
too, although I would not advise to use this style:
$(UNLESS (a == b) they are different $(ELSE) they are equal $)
You should also note that ELSE
and ELSIF
are not actually parsed like
other instructions. They don't take a block of text, and thus they don't
need to end with $)
. Whether to do it this way was hard to decide, but
since ELSE
and ELSIF
normally continue an IF block, instead of ending
it, it seems to make sense this way. The same applies to $(BREAK)
and
$(CONTINUE)
directives.
AIF
/ AWHEN
— like IF
/ WHEN
, but store the condition in $it
These two come from the anaphoric macro collection from Hell and I
find them quite useful for cases where the block inside the IF
is
not very big. They help with the following case:
$(LET ((foo => this.looongComputation())) $(WHEN (foo) ... do something with $foo $) $)
The two anaphoric macros (which are synonyms) allow you to avoid the boilerplate:
$(AWHEN (this.looongComputation()) .. do something with $it $)
The variable $it
is created by the macro and takes the value of the
condition, and the text block is executed only if7:
$it
is not null
and not undefined
$it
is not false
8
$it
is not an empty array
$it
is not an empty string
It expands to this code:
(function(it){ if (it != null && it !== false && !(it instanceof Array && it.length == 0) && !(it === "")) { // splice the block of code here } }).call(this, this.looongComputation());
OK, now that you agree that this is useful, but are depressed by the
sheer lack of inspiration in picking the name it
, let me show you
that you can actually name the variable:
$(AWHEN (this.looongComputation() => that)  .. do something with $that $)
Also, for cases when you are unhappy with the default falsity rules, you can state the full condition as well:
$(AIF (this.looongComputation() => foo, foo > 5) $foo is now this.looongComputation() but this is displayed only if it's greater than 5. $(ELSE) And you can still use $foo here. $)
REPEAT
— to repeat stuff
To repeat a part of the template you can use REPEAT
. For example,
the following outputs “foo” 3 times: $(REPEAT (3) foo $)
. In
various cases you might need to know the current iteration too, so you
can pass a variable name for it:
$(REPEAT (5, i) Item $i $)
The variable i
takes values from 1 to 5 (inclusively) and the output will
be “Item 1 Item 2 ” etc. In some cases you might want to specify an
interval (so that you start from something else than 1), so the following is
allowed:
$(REPEAT (5 .. 10 => i) Page $i $)
Note that the arguments are parsed using the “list reader”, so you can use syntactic sugar to separate them (although a simple comma would do).
MAP
/ FOREACH
— iterate an array
Again, MAP
and FOREACH
are synonyms. You can use them to do something
for each element of an array. For example the following outputs links
contained in an array:
$(MAP (link => links) $link.text|html $)
That's assuming that links
is an array of objects, each containing
address
, tooltip
and text
. You could of course use a literal
object:
$(MAP (link => [ { address : "http://www.google.com/", tooltip : "Search engine", text : "Google" }, { address : "http://www.ymacs.org/", tooltip : "AJAX code editor", text : "Ymacs" } ]) $link.text|html $)
Sometimes you also need to know the current step of the iteration. For example if you want to output some links that are separated with a pipe, you need to know not to output the pipe before the first, or after the last link. We could write it like this:
$(MAP (i, link => links) $(WHEN (i > 0) | $) $link.text|html $)
or
$(MAP (i, link => links) ${ i > 0 ? "|" : "" } $link.text|html $)
A special case of MAP
/ FOREACH
allows you to pass only the array, and
no key or index variables. In this case the special variable $_
(which I
will call the Perlism) gets assigned to the current element, and more, the
loop body is lexically scoped to each element using a JavaScript with
block (I know, your mom told you not to play the with
statement, but mine
didn't9 :-p).
So using this style the first example would become:
$(MAP (links) $text|html $)
address
, tooltip
and text
access the specific property of each
element.
Just a last example showing the Perlism:
$(FOREACH ([ "foo", "bar", "baz" ]) $_ $)
will output “foo bar baz”. The $_
variable is
bound to each element. Note that because YAJET is doing The Right Thing, the following will work as expected:
$(MAP ([ "foo", "bar", "baz" ]) $(MAP ([ 1, 2, 3 ]) inside: $_ $) outside: $_ $)
When “inside”, $_
will take the values from 1 to 3; “outside” it
will take "foo", "bar" then "baz".
MAPHASH
— iterate an object (hash)
MAPHASH
is MAP
's analogue for hashes. It iterates over all properties
of an object, binding a variable for the key and another for the value. You
must specify names for these variables. Example, assuming that users
is a
hash that maps user IDs to some user objects (each of them having a
getName()
method):
$(MAPHASH (uid, obj => users) User $uid has name ${ obj.getName() }
 $)
CONTINUE
and BREAK
— for loop control
These don't take any arguments, and also don't take a block of text,
so the expected syntax is $(CONTINUE)
and $(BREAK)
. They can
appear in the text block of some looping construct, be it REPEAT
,
MAP
, FOREACH
or MAPHASH
, and they do the same as their
JavaScript counterparts, that is: CONTINUE
will go to the next
iteration, skipping any code between it and the end of the loop, and
BREAK
will immediately end the loop.
I'm giving an example just to illustrate the syntax:
$(REPEAT (10 => i) $(WHEN (i > 5) $(BREAK) $) $i $)
The above will print numbers from 1 to 5.
LET
— define variables
You can define new variables with LET
. It introduces a new lexical
scope, so the variables that you define are only available in its
block of text. If variables with the same name already exist, they
are shadowed while the LET
block is in effect. After the LET
block ends, previous bindings come back to life.
$(LET ((a => 10) (b => 20)) $a + $b = ${ a + b } $)
Since LET
takes a block of text, it ends with the normal block terminator
$)
. Here's an example to demonstrate scope:
$( var x = "outside" /* literal JS block, described later */ ) $(LET ((x => 10)) $x is 10 $(LET ((x => 20)) $x is 20 $) $x is back 10 $) $x is "outside"
LET
operates by introducing an anonymous function, so it's
compatible with all browsers. JavaScript 1.7 introduced a let
statement for declaring block-scoped variables, and it's supported by
Firefox, but unfortunately no other browser has it at the
moment10.
WITH
— modify the scope chain
When you have an object that has properties you need to access, you can use
a WITH
block to make for a more convenient syntax, so instead of saying
$object.foo
you would be able to say only $foo
. Assuming that link
contains address
, tooltip
and text
, the following two are equivalent:
$link.text|html $(WITH (link) $text|html $)
WITH
can be used with literal objects as well:
$(WITH ({ foo: 10, bar: 20 }) $foo + $bar = ${ foo + bar } $)
thus emulating a LET
block, but it's less efficient because it uses the
JavaScript with statement.
BLOCK
— define reusable template blocks
A BLOCK
doesn't immediately print anything into the template output;
instead it defines a function that returns its processed block of
text.
The syntax is straightforward. It expects a name for the function,
followed by a list of arguments in parens (if there are no arguments,
put ()
like you do for a plain JavaScript function). Then continue
with the block of text that the function should expand into:
$(BLOCK display_link(link) $link.text|html $)  ${ display_link({ address: "/", title: "Home page", text: "Home" }) }  $(FOREACH (i => links) ${ display_link(i) } $)
Note that the call to display_link
is inside a ${...}
block, so
that the returned value gets inserted into the output.
Combining BLOCK
and LET
or WITH
we can define closures:
$(WITH ({ value: 0 }) $(BLOCK counter()
Counter is ${ ++value }
 $) $) ${ counter() } -- now it's 1 ${ counter() } -- now it's 2 ${ counter() } -- now it's 3
Doing the above with LET
is a bit more tricky because LET
creates its
own environment, so the BLOCK
that you define within it is actually local
to the LET
block. The following won't work:
$(LET ((value => 0)) $(BLOCK counter()
Counter is ${ ++value }
 $) $) ${ counter() } -- error, counter is not defined!
It's easy to see why if you see the code that gets generated for the above. It looks like the following:
(function(){ var value = 0; function counter() { output("Counter is " + (++value)); }; })(); output( counter() ); // but there's no free lunch
To do this with a LET
block we would have to export the function; we can
use an outside variable for that:
$( var counter ) $(LET ((value => 0)) $( counter = _counter  ) $(BLOCK _counter()
Counter is ${ ++value }
 $) $) ${ counter() } -- now it works.
WRAP
, CONTENT
— call a wrapper with an additional block of text
BLOCK
-s can be used as wrappers. A wrapper is a function that
receives a bit of text and puts something before and after it. For
example, to define a wrapper that creates a table we can say:
 $(BLOCK table(cols)

 $(MAP (label => cols) $label	 $)

 $(CONTENT)

 $)  $(WRAP table([ "Name", "Phone", "Email" ])
 Foo	 123-1234	<EMAIL_ADDRESS>

 Bar	 1234-123	<EMAIL_ADDRESS>
 $)
You can note that the wrapper is a normal function (BLOCK
) and it
can take arguments. To send the arguments with a WRAP
block, just
make it look like a normal function call. If there are no arguments,
you still need to insert the parens ()
. When it's calling your
block, WRAP
sends an additional hidden argument that contains the
text which is expanded by $(CONTENT)
. For now this argument is a
function that renders the text, and $(CONTENT)
simply calls this
function.
EXPORT
— define a BLOCK that can be used in another template
EXPORT
is like BLOCK
, but the function that it creates is
“exported” and can be called from different templates. The assumption
for this to work is that all templates are compiled with the same
YAJET object instance (since it will maintain some runtime environment
for this case).
Here's a quick example:
var yajet = new YAJET(); yajet.compile("$(EXPORT foo(arg) foo got $arg $)"); var t1 = yajet.compile("$(IMPORT (foo)) ${ foo('bar') }"); alert(t1()); // displays "foo got bar" var t2 = yajet.compile("$(PROCESS foo('baz'))"); alert(t2()); // displays "foo got baz" // call the exported function directly alert(yajet.process("foo", null, [ "something" ])); // displays "foo got something"
Above you can see a few ways to call an exported block. One is by
calling $(IMPORT (block_name))
first, which will actually make it
available as a local function, which you can then use as if it were
defined with BLOCK
. The second way is using $(PROCESS block_name())
. PROCESS
expects that the name of the block that you
type there is a function created with EXPORT
and compiled before
the call to PROCESS
.
It might be important to understand that compile() actually runs your
template once when it contains EXPORT
-ed functions, so that they get
into the YAJET instance. This shouldn't be a problem—in practice,
you will have templates that contain only export blocks, where you
will put utilities. For example, above we don't store the result of
yajet.compile for the first template, since all it does is just export
the function. The exported function gets into the YAJET object
instance.
Some notes:
WRAP
in a different template to call an exported
function as wrapper, without having to IMPORT
it first. Note
however that if some BLOCK
or other function with the same name
exists in the current template, it will take precedence.
yajet.process(exported_name, self, [ more, args ])
. The self
argument is accessible as this within the block, and the last is
an array of more arguments that are passed to the function.
LITERAL
— include literal text With this directive you can include a literal block of text. No constructs within it are expanded. Example:
$this.foo -- here it's replaced with the value of the variable $(LITERAL "STOP" $this.foo -- here it's left untouched STOP)
The LITERAL
directive takes one string as an argument. That string
immediately followed by a closing paren is expected to end the literal
block of text. In the above example we state that “STOP)” should end
the text. Note that the closing paren is implied, and required:
$(LITERAL "FOO" The following doesn't end the block: FOO but the following does: FOO)
SYNTAX
— temporarily change the reader character When you need to display the current reader char literally, many times in a block of text, rather than typing it twice each time it's sometimes more convenient to temporarily change it to something different. Example:
Price: $$ $this.price TAX: $$ $this.tax This is a dollar sign: $$  $(SYNTAX # Price: $ #this.price TAX: $ #this.tax This is a dollar sign: $ #) $this.tax -- back to previous reader char
SYNTAX
takes a single char argument (the first non-white-space
character that follows the directive) and that char becomes the
reader_char
while its block of text is in effect. Note that to end
the block of text you need to include the normal block terminator, but
using the new reader char—so we need #)
instead of $)
in the above sample.
$( ... )
Finally, you can include literal JavaScript code, if needed, by
placing a space after the open bracket. The code inside $( ... )
must be valid JavaScript and by this I mean properly balanced (you
cannot open a paren in such a block and close it in another).
For example, if you need to change the value of some variable which is already defined, you can do this:
$( myVar = doSomething() ) ^-- note this space.
Unlike a ${ ... }
block, which would allow the above code as well,
this one won't place the result into the template output. Also,
unlike a ${ ... }
block, this one allows multiple statements
separated with a semicolon:
$( foo = "bar"; moreSideEffects(); i = 10 )
YAJET aims to do The Right Thing. If you've ever written Lisp or C macros, then you know that it's dangerous to invent variable names, or to use a macro argument more than once. YAJET is essentially a macro expander and it's built around these good principles.
For example, a dumb implementation would translate $(FOREACH (link => links) ...STUFF... $)
into this:
for (var i = 0; i < links.length; ++i) { var link = links[i]; // ... do STUFF }
However the above code has two problems:
STUFF
defines a variable named i
, then it will collide
with the loop variable.
links
is not a real array, but say, a (possibly expensive, and
perhaps with weird side effects) function call that returns an array,
then it will be called for each iteration… twice.
If FOREACH
would really expand into the above code, then the following
sample would suffer from both problems:
$(FOREACH (link => this.getLinksFromServer()) $( var i = link.text.length ) $(WHEN (i > 30) ... truncate text $) ... $)
The resulted code would be:
for (var i = 0; i < this.getLinksFromServer().length; ++i) { var link = this.getLinksFromServer()[i]; var i = link.text.length; if (i > 30) { ... truncate text } ... }
… which means that this.getLinksFromServer() will be called twice for each step, and also that the loop would be stopped arbitrarily when we encounter a link whose text has more characters than the number of links. That would break in unexpected and hard to debug ways.
What YAJET actually generates for the above case looks like this:
(function(__GSY12){ for (var __GSY13 = __GSY12.length, __GSY14 = 0; __GSY14 < __GSY13; ++__GSY14) { var link = __GSY12[__GSY14]; var i = link.length; if (i > 30) { ... truncate text } ... } }).call(this, this.getLinksFromServer());
The variables that aren't explicitly named in the template get unique
names with the prefix __GSY
, so you should be safe as long as you
don't use the __GSY
prefix yourself. Also, there are a few other
internal variables that YAJET has to use:
__EXPORTS
– an array where we store exported blocks
__BUF
– a string holding the output buffer
OUT
and VUT
I prefixed those that I assumed won't be generally useful with two
underscores. OUT
and VUT
are not prefixed because they are needed
for custom directives. Both of them are functions that currently do
the same thing11: they take one argument and if it's not null
they insert it into the output.
You can note in the code above that the loop block is embedded in a function, so that it doesn't affect outside variables. Creating lambdas everywhere has other implications that we need to be careful about:
Imagine this loop:
$(MAP (a => [1, 2, 3, 4, 5]) $(LET ((b => a)) $(WHEN (b > 3) $(BREAK) $) $b $) $)
If $(BREAK)
would translate into the plain JavaScript break
statement, it would be a syntax error because LET
introduces an
anonymous function (in order not to mess with outer variables). The
above block expands into something like the following, which is the
right thing:
(function (__GSY31) { for (var __GSY32 = __GSY31.length, __GSY33 = 0; __GSY33 < __GSY32; ++__GSY33) { try { var a = __GSY31[__GSY33]; (function () { var b = a; if (b > 3) { throw __YAJET.X_BREK; // this is BREAK } VUT(b); }).call(this); } catch (ex) { if (ex === __YAJET.X_CONT) { // here we handle CONTINUE continue; } if (ex === __YAJET.X_BREK) { // and here we handle BREAK break; } throw ex; } } }).call(this, [1, 2, 3, 4, 5]);
So BREAK
and CONTINUE
are handled with exceptions, which has an
interesting implication: if you know that some function will only
be called from loops, then you can safely use BREAK
and CONTINUE
within it. But only if you know that. ;-)
this
Put simply, YAJET will “copy” this
to all functions that it creates
or calls itself, so that this
will still refer to your template
argument even if you're inside some loop or other automatically
generated function.
YAJET allows you to add custom directives fairly easily, though you'll
have to dig somewhat uncharted territory. You need to pass a
directives
hash to the constructor, in which you map directive name
to a parser function. Your function is responsible for parsing any
arguments that you want your directive to support, and to generate any
code that your directive should expand into.
Let's start with an easy one:
var yajet = new YAJET({ directives: { author: function(c) { c.out("OUT('Mihai Bazon <mihai.bazon@gmail.com>');"); c.assert_skip(")"); } } });
The above defines a directive that doesn't take any arguments. You
can notice that your parser function receives one argument—it's an
object that stores the current context and provides some helper API
for you to do your stuff. Above I used the out
method, to output
code that should be part of the compiled template, and assert_skip
to force an error unless the template continues with a closing paren.
In a template compiled with the above object instance, we can now type
$(AUTHOR)
, and it will expand into this:
OUT('Mihai Bazon <mihai.bazon@gmail.com>');
In turn, when the template is executed, OUT
will put its argument
into the output stream.
Your directive handler is free to parse any syntax that you desire, but after it finishes the “normal” parser resumes execution for the remainder of the code. The “normal” is: assume plain text until we meet the reader char, then parse according to the rules described in this document.
Again, this isn't for everyone so I won't get into much detail—please feel free to read the source to figure out more. I'll just summarize the API that the context object exposes:
peek()
— return the current character.
next()
— return the current character and skip to the next one.
rest()
— return the rest of the characters (thus, what's left to parse),
out(str)
— insert str
into the generated JavaScript code.
set_output(array)
— set a new output array; subsequent out()
calls will push data into this array. Returns the previous output.
skip_ws(noComments)
— skip forward whitespace and comments. The
optional noComments
argument can be used (pass true
) to avoid
skipping comments.
assert(str)
— throw an error if rest()
does not start with
str
(when str
is a string) or does not match str
(when str
is a RegExp).
assert_skip(str)
— like assert(str)
, but call skip_ws()
before checking, and skip str
if it follows (otherwise throw
exception like assert
).
skip(str)
— if rest()
starts with str
or matches str
(when
it's a RegExp), skip the matched part.
looking_at(str)
— return an object if rest()
starts with str
or matches str
(when it's a RegExp); returns undefined otherwise.
The object contains: "match" which is the full matched text,
"length" which is the length of the match and "groups" in the case
when str
is a regexp (the result of regexp.match
).
block_open(open, close)
— call out(open)
to start a new block,
and push close
so that it gets output when $)
is encountered.
close
is an optional argument (it defaults to "}" when not passed,
since it's the usual JS block terminator). It can be a function, in
which case it's simply called when $)
is found, and it's
responsible for pushing any required code to end the current block
using c.out
.
block_close()
— close the current block (you shouldn't need to
call this manually).
read_balanced(wantList)
— read balanced expression. The current
character must be some open paren, and it will read, skipping
strings, comments and whitespace, until the paren is closed. The
optional wantList
argument specifies if the return value should be
an array that contains the elements of the parsed list, or just a
string. Return null
if no list starts now.
read_string()
— read and return a JavaScript string. The
current character must be a string quote. Return the string if it
was available, or null otherwise.
read_simple_token()
— try to read and return if available a
JavaScript identifier. Note that the syntax is somewhat extended in
that it will return for instance "foo.bar|baz" as a single token.
read_valist()
— parse and return a variable list such as those
used for LET
. A side effect is that this also outputs the var
declaration.
to_js_string(str)
— adds quotes and escapes special characters
(newlines, tabs, quotes and backslashes) in str
to form a
JavaScript string.
trim(str)
— remove leading and trailing whitespace from str
and
return the trimmed string.
map(a, f, obj)
— for each element of array a
call function f
in
the context of obj
and collect the returned values.
EX_PARSE(error_str)
— throw a parse exception.
directives
— a hash containing the directives
that you passed
in constructor. You can insert new directives at “compile-time”
into this hash. This hack is used in the SWITCH
example below.
You should understand that your custom directives run at compile time. So “c.out” does not produce the final template result;
instead, it should produce JavaScript code that generates the final
result when executed. This is why our sample above doesn't simply say
c.out("author...")
, instead it has to say
c.out("OUT('author...');")
. The OUT
function is available at
run-time and inserts text as part of the final result.
SWITCH
For a non-trivial example, here's how to implement a SWITCH
directive. It has the same semantics as the standard JavaScript
SWITCH
— that is, depending on the value of some expression, it
selects and executes a CASE
. The DEFAULT
case is executed when no
other case matches the expression. We will in fact make use of the
standard JavaScript switch
for this.
var directives = { "switch": function(c) { // SWITCH expects one expression in parens: var args = c.read_balanced(true); var expr = args[0]; // here is the argument // save old meaning of CASE and DEFAULT, if any var old_case = c.directives["case"]; var old_defa = c.directives["default"]; // inject the CASE directive c.directives["case"] = function(c) { var args = c.read_balanced(true); var expr = args[0]; c.set_output(save); c.block_open( "case " + expr + ":", function() { c.out("break;"); c.set_output([]); } ); }; // and the DEFAULT directive c.directives["default"] = function(c) { c.set_output(save); c.block_open( "default:", function() { c.out("break;"); c.set_output([]); } ); }; // finally, open the switch block and prepare to close // and restore everything when the block ends. c.block_open( // open "switch (" + expr + ") {", // close function() { c.set_output(save); c.directives["case"] = old_case; c.directives["default"] = old_defa; c.out("}"); } ); // any text between these directives is not interesting. var save = c.set_output([]); } }; var yajet = new YAJET({ directives: directives });
And now, you can use SWITCH
in your templates:
$(SWITCH ("foo") $(CASE ("bar") This won't be written. $) $(CASE ("foo") But this will. $) $(DEFAULT And this not. $) $)
The implementation of SWITCH
needs to be a bit complex. We insert
the CASE
and DEFAULT
directives when our SWITCH
directive runs
(that is, when the template is compiled), but remove them once the
SWITCH
block is ended (since they don't make sense outside
SWITCH
). We need to use set_output
to change the output array to
some temporary one which we will discard, because otherwise the
whitespace between $(SWITCH (...)
and the first $(CASE)
will be
transformed into code, and it won't be valid JavaScript syntax. And
we need to be careful to set the output back to the saved value when
needed12.
This topic is advanced so I will stop here. If you want to write your own directives, you are assumed to have some good JavaScript knowledge and dig through the code for more (and/or ask on the YAJET group, but preferably after you have something to show us).
The JavaScript scanner is not “complete”, although it's smart enough to skip comments and strings while looking for a closing paren. Literal regexps are tricky to figure out, so I left this out for now. What this means is that you should be careful about parens in literal RegExp-s. Since the parser does not allow for unbalanced parens, the following should not be a problem:
$( if (/(a|b)/.test("bar")) { matches(); } else { no_match(); } )
All parens are properly closed, so there's no reason why our parser should miss the closing paren. However, the following will break stuff:
$( if (/\)/.test(")")) { ... } )
Although it is valid JavaScript inside, having the closing paren in the
RegExp will confuse YAJET. It looks quite ugly, too—for such cases,
encode the paren as \x29
. Note that you have to escape open parens as
well (\x28
), and same goes for all the other types of brackets such as
[
, ]
, {
and }
.
While YAJET is smart enough to scan complicated constructs, it will not do any syntax checking on its own. It just scans your template and generates JS code. Then it compiles a function (using the Function constructor). At this point the browser (its JavaScript engine) does the proper syntax checking and error reporting. If anything goes wrong, you do get an error, but it's less informative than it could be. If you're using Firebug or Google Chrome, the generated code will show up in the console so you get a chance to see what's wrong, but don't trust the line number or file that its displayed there.
I don't see me writing a full JavaScript parser anytime soon, so for the time being we will have to live with this. It's still pretty good. ;-)
Currently YAJET keeps all whitespace in the generated
source13. There is a directive that allows you to say
“kill following whitespace” ($-
, that is, the reader char followed
by a minus sign) but it's not very convenient. For example:

 $(IF (true) foo $(ELSE) bar $)

results in this output:

 foo

Generally, it's not what one would expect. We can make it look better with the “kill whitespace” directive, but it's totally unintuitive:

$- $(IF (true) foo$- $(ELSE) bar$- $)

This outputs better:

 foo

So the default behavior should probably be:
$)
) followed only by
whitespace, then that whitespace + the newline will be eaten.
Need to think about it a bit more. However, fortunately in HTML whitespace is not too important.
If you have any questions please post them on the YAJET Google Group.
Copyright (c) 2010, Mihai Bazon, Dynarch.com. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1 The misspelling is intentional. Various combinations of the letters Y, A, J, T, E from “Yet Another JavaScript Template Engine” led to the name YAJET. YAJET stands for “Yet Another JavaScript Emplate Tengine”. Sounds buzzy, isn't it? Also, JET-s are fast, and so is YAJET.
2 You can still put literal JavaScript inside using $( ... )
, but it has to be properly balanced.
3 I added this because it was easy, and it can be useful for one-liners, but I vote against it for blocks bigger than a few lines.
4 Pure comes first on Google when we search “JavaScript template engine”. Have you notice how exaggeratedly creepy is the syntax for rendering with directives? I guess we truly live in a “worse is better” world, but I'm still trying to do The Right Thing.
5 This is a double-feature: we have good documentation and lots of features for small code. ;-)
6 Sarcasm intended. I still can't figure out why all other template solutions insist on not using plain parens.
7 Note that the JavaScript rules for falsity are
different, and I think less useful: an empty array will stand true
,
while the number 0 (zero) is false
.
8 BTW, did you know that in JavaScript the expression (0 == false) evaluates to true in conditionals?
9 Seriously though, everything under an with
block is
s…l…o…w… – so, while this makes for a nice syntax, you should not
use it where speed is critical.
10 Since I'm not sure what are the benefits of the let
keyword from JavaScript 1.7 compared to using an anonymous function, I
decided not to add a browser check for this. When more browsers will
support it I'll change my mind. But the template syntax will remain
the same.
11 VUT
however might change in the future. OUT
is intended
to output plain text, while VUT
is meant to output the value of an
expression.
12 The fact that JavaScript properly supports closures plays a key role into all this, but I'm tired of saying this all over. :-)
13 Speaking of it, most (all?) template engines do the same.
Date: 2010-05-30 12:46:37 CEST
HTML generated by org-mode 6.21b in emacs 23


Across: 1. He took limiest mix, said to include lemon, in the cast (4 4 2 3) 10. Potter about, putting energy into constructing part of canopy (7) 11. A crime organised by a country (7) 12. Surfaces at tree six or so (9) 13. Retro erotica based on using old computers (5) 14. Member of ruling family swapped sides at first, but likely to remain true (5) 16. I pity club set ... the exposure! (9) 18. Proceeding with extreme caution by end of trial (9) 20. Holy spirit with some guitar action (5) 22. Given a cricket team with a mantra... (5) 23,27. ...soft chaps would rather be at the fair, where 9 dn is a showgirl (9 6 7) 25. Corresponding longer recording is let out (7) 26. Endure shaking ground all around the Earth (7) 27. see 23 Down: 2. Too accepting of time in the open (7) 3. Green terraces provide instructive response to a rap (5) 4. Unprepared, devil has to wrestle with familiar French address (9) 5. Wild sex around about dawn led to medical checks (5) 6. He parties wildly and then gets treatment (9) 7. Paper adapted by artist (7) 8. Rapidly rising 12ac of late cash aids endless races (13) 9. Ploy Norman Mailer lost without pal featuring in 1 ac (7 6) 15. Piece of music with dubious tie to film (9) 17. Lost gold billing due to having subtitles, perhaps (9) 19. More inquisitive about one who is not so peaceful (7) 21. It is shown to reduce penalties relating to the code (7) 23. Yes-man ignored a feminist (5) 24. Supervillain put bin out, bearing burden (5)


HEAD
this is a plane figure consisting of a three straight sides and three angles.
Equilateral
Scalene
Isosceles
a triangle having two equal sides and two angles
a triangle having all of its sides equal including its angles
a triangle whose angles are different and none of its sides are equal


climate change curriculum scientific science global change. documents students Climate political provinces Canadian Science warming consensus education curricula human coverage environmental {border-style Canada different secondary Environmental px;} #ffffff;} Table anthropogenic Curriculum change, issue knowledge province textbooks government impacts public school analysis emissions learning objectives teachers Change Education Interviewee core topic Learning issues Ontario cause concern controversy debate development evidence instance, scientists topics ("It’s British In: collab: editor. greenhouse subject teaching Available Change. However, Manitoba New Research approach associated carbon courses current from: humans important increased like mitigation provide review statements Alberta Sciences address curriculum. described design educational fix focus high level mandatory noted policies process provincial px; research risks study subjects support understanding {font-family "It’s Education. Global Green It’s Nature Party course covered does font-size increase influence interviews issue. lead literacy major make people process. provided question social suggest supported teach textbook writing Arctic Canada, Canada. Earth’s Fig GHG Human Psychology Science. United action agree based benefits community consensus, consensus. curriculum, data document documents, double; existence information interviewees need negative peer-reviewed positive provinces, questions relevant responsible result risk taken topics. used view ways young "Experts "We (see .°C Box Climatic Columbia Controversies Gr. IPCC Interviewees Maibach Science, Social Students University able agreed balance believe border-color border-width capita causes causing changes citizens comprehensive conservative content controversies course, developers economic education. effects encouraged especially examples factors fossil future gas greater health impact included international interviewee levels natural physical policy possible recent regarding related report role schools shown solid; targets teacher temperature understand use warming. way writers written {font-style {font-weight –): (e.g., ./journal.pone..t Cognitive Conservative Edward Environment Framework Government Grade Intergovernmental Island Kahan Learning: Leiserowitz Northwest Nova Panel Prince Saskatchewan Scotia Teachers Textbooks Trudeau acceptance activities additional addressed agreement approaches arguments asked balanced best bold categories caused certain citizenship context continue controversial courier; courses. democratic developed did differences diseases effect effectiveness efforts election em; energy fuel grade human-caused independent indicates individual individuals just leadership little majority materials members new non-mandatory ocean overwhelming participate present pressure pt;} received reduce resources results said, scope score sea shows similar student terms themes time topics, uncertainty want warming, water weigh years


JavaScript is disabled on your browser.
Skip navigation links
Overview
Package
Class
Tree
Deprecated
Index
Help
Prev Letter
Next Letter
Frames
No Frames
All Classes
SEARCH:
JavaScript is disabled on your browser.
A
C
D
E
F
G
H
I
M
P
R
S
T
U
V
G
getAllHw()
- Method in class service.
HomeworkService
Function which returns an Iterable containing all the homeworks from repository
getAllSt()
- Method in class service.
StudentService
Function which returns an Iterable containing all the students from repository
getCurrWeek()
- Method in class domain.entities.
Homework
Current Week getter
getCurrWeek()
- Method in class tests.
HomeworkTest
getDeadlineWeek()
- Method in class domain.entities.
Homework
DeadLine Week getter
getDeadlineWeek()
- Method in class tests.
HomeworkTest
getDescription()
- Method in class domain.entities.
Homework
Description getter
getDescription()
- Method in class tests.
HomeworkTest
getEmail()
- Method in class domain.entities.
Student
Function to get the emial of the student
getEmail()
- Method in class tests.
StudentTest
getGroup()
- Method in class domain.entities.
Student
Function to get the grouo
getGroup()
- Method in class tests.
StudentTest
getHomeworkDim()
- Method in class service.
HomeworkService
Function to get the number of homework from the repository
getID()
- Method in interface domain.entities.
HasID
getID()
- Method in class domain.entities.
Homework
Overriding Hash method
getID()
- Method in class domain.entities.
Student
Overriding methods from HasID Interface
getID()
- Method in class tests.
HomeworkTest
getID()
- Method in class tests.
StudentTest
getName()
- Method in class domain.entities.
Student
Function to get the name
getName()
- Method in class tests.
StudentTest
getProfName()
- Method in class domain.entities.
Student
Function to get professor name
getProfName()
- Method in class tests.
StudentTest
getRecvWeek()
- Method in class domain.entities.
Homework
RecvWeek getter
getRecvWeek()
- Method in class tests.
HomeworkTest
getStudentDim()
- Method in class service.
StudentService
Function to get the number of students from the repository
A
C
D
E
F
G
H
I
M
P
R
S
T
U
V
Skip navigation links
Overview
Package
Class
Tree
Deprecated
Index
Help
Prev Letter
Next Letter
Frames
No Frames
All Classes
JavaScript is disabled on your browser.


About the project : Give into the sublime concept of Life is beautiful at SLV Splendour. A lavish Address that brings all happy emotions under one roof for a defining moment of fulfillment. Discover the joys of a bright, bountiful and blissful living like never before. Splendour combines the best of architectural excellence and creative thinking to construct a world which is exclusive and exciting. Find out how it is to redefine your living spaces with something that is interesting innovative and refreshingly original. A world vivid in imagination colour, beauty and serenity awaits you. Come and discover the magic of spring. Enjoy life like never before.
310, 1st floor, 39th B'Cross 9th main 5th Block, Jayanagar Bangalore-560041
+91<PHONE_NUMBER> /<PHONE_NUMBER>
sales@slvassociates.com


--- layout: post title: Basil and Macadamia Nut Pesto date: 2011-03-05 10:30:01.000000000 -05:00 categories: - Gastronomic Explosions - aka Yummy Food/Recipes tags: - Basil and macadamia nut pesto - fresh pesto - Gluten free - pesto status: publish type: post published: true meta: aktt_notify_twitter: 'no' _edit_last: '1' dsq_thread_id: '1188070759' author: login: cint email<EMAIL_ADDRESS>display_name: Jacinta first_name: Jacinta last_name: '' ---
We have been buying beautiful bunches of fresh basil in our weekly organic order. It's fragrance is divine. I love making pesto this time of year while basil is at it's peak. The following recipe doesn't last very long around these parts as we can't stop eating it. Can be served with so many dishes, on pizza, with meat, veggies or as a dip. Enjoy!
Ingredients:
2 bunches fresh basil
1/3 cup parmesan cheese, grated
2 cloves fresh garlic
1/3 cup macadamia nuts, lightly toasted
1/3 cup oil (I use half olive oil, half rice bran oil)
salt to taste
Method:
Place all ingredients in food processor except oil. Blend until well combined. Pour oil into the mix in a steady stream while food processor is going until combined. Pour into a prepared jar.
Store in fridge. Can be frozen. I find the best way to do this is to put the pesto in sealable ice cube trays. This makes perfect size portons for adding to your dishes.


XSS
A vulnerable input field which may allow attacker to inject JavaScript and HTML payloads
Task: Popup a alert
Submit


emuDB
Format
wrassp
EMU-webApp
emuR
function and object indexemuR
- package functions
wrassp
implementation
EMU-webApp
implementation
emuDB
?emuDB
occur in and what is their phonetic context?emuDB
differ with respect to their first spectral moment?\footnote{The original version of this use case was written by Florian Schiel as part of the emuR_intro
vignette that is part of the emuR
package.
EMU-webApp-websocket-protocol
Version 2.0
->
sequence operatoremu.query()
wrassp
emu.query()
Example:
It appears that the OR operator |
was mistakenly ignored when used in conjunction with the inequality operator !=
:
emu.query(template = "ae",
pattern = "*",
query = "[Text != beautiful | futile ^ Phoneme = u:]")
yielded:
## moving data from Tcl to R
## Read 4 records
## segment list from database: ae
## query was: [Text!=beautiful|futile ^ Phoneme=u:]
## labels start end utts
## 1 new 475.802 666.743 msajc057
## 2 futile<PHONE_NUMBER>.000 msajc010
## 3 to 1091.000 1222.389 msajc010
## 4 beautiful 2033.739 2604.489 msajc003
The query engine of the emuR
package respects the presence of the OR operator in such queries:
query(emuDBhandle = ae,
query = "[Text != beautiful | futile ^ Phoneme == u:]",
resultType = "emusegs")
## segment list from database: ae
## query was: [Text!=beautiful|futile ^ Phoneme=u:]
## labels start end utts
## 1 to 1091.025 1222.375 0000:msajc010
## 2 new 475.825<PHONE_NUMBER>:msajc057
Some queries in the legacy EMU system required blanks around certain operators to be present or absent as well as parentheses to be present or absent. If this was not the case the legacy query engine sometimes returned cryptic errors, sometimes crashing the current R session. The query engine of the emuR
package is much more robust against missing or superfluous blanks or parentheses.
To our knowledge, the order of a segment list in the legacy EMU system was never predictable or explicitly defined. In the new system, if the result type of the query()
function is set to "emuRsegs"
the resulting list is ordered by UUID, session, bundle and sample start position. If the parameter calcTimes
is set to FALSE
it is ordered by UUID, session, bundle, level, seq_idx. If it is set to "emusegs"
the resulting list is ordered by the fields utts and start.
emuR
accepts the double equal character string ==
(recommended) as well as the single =
equal character string as an equal operator.=~
(matching) and !~
(non-matching) operators. It is worth noting that the regular expression pattern is always meant to consume the entire label string i.e. wrapping the RegEx in "^ RegEx $"
is not necessary. If substring matching is desired this must be formulated explicitly (e.g. ".*substring.*"
)
query("andosl", "Text =~ .*tz.*")


Machine learning and Deep learning always fascinates me. I always try to learn new things and build something out of it. I have certifications and hands-on on Machine Learning.
I started my career with Java and C++ then comes Python and this language taught me simplicity in code while doing heavy work. Now Python is my favourite programming language.
Framework Designing came into my arsenal with experience, With my work experience I got to know many things about data and process. That helps me to think out of the box. I have designed framework around data and process automation.
Blogging is my way to connect with other people who have same interest as me. When I get time, I put my thoughts into writing. these are happy hour for me.


Efficient least-squares imaging with sparsity promotion and compressive sensing
This application is available only in the software release for members of SINBAD consortium.
This software release includes an parallel framework in Matlab for L1 migration [1,2], which based on the ideas from compressive-sensing and stochastic optimization, where the least-squares imaging result are computed from random subsets of the data via curvelet-domain sparsity-promotion. There are two different subset sampling strategies are considered in this package: randomized source encoding, and drawing sequential shots firing at random source locations from marine data with missing near and far offsets. In both cases, we obtain excellent inversion results compared to conventional methods at reduced computational costs. There is also a small example based on a small one- layer model which can allow users to test the algorithm in a short time
Author: Xiang Li Date : April, 2013
Contents
Downloading & Dependencies
The code can be found in the SLIM sofware release under /applications/Imaging/L1MIGRATIONbasic/.
The code has been tested with Matlab b2012b and requires the Parallel Computing Toolbox.
This code uses the following packages, also found in the tools part of the SLIM software release.
- utilities/SPOT - object oriented framework for matrix-free linear algebra.
- utilities/pSPOT - parallel extension of SPOT.
- transforms/CurveLab-2.1.2-SLIM/ - Curvelet transform toolbox
Running & Parallelism
All the examples and results are produced by the scripts found in this software release under /applications/Imaging/L1MIGRATIONbasic/. Start matlab from that directory or run startup in that directory to add the appropriate paths.
To run the scripts follow the instrictions in the README file enclosed with the code. The scripts can be run in serial mode but parallel mode is advised.
Read more about SLIM's approach to parallel computing in Matlab.
Examples and results
Scripts to reproduce imaging from one-layer model, as well as results from sevaral papers [1],[2] can be foundin the scripts directory. The results are shown here.
References
[1] Felix J. Herrmann and Xiang Li, âEfficient least-squares imaging with sparsity promotion and compressive sensingâ, Geophysical Prospecting, vol. 60, p. 696-712, 2012.
[2] Felix J. Herrmann and Xiang Li, âRandomized dimensionality reduction for full-waveform inversionâ, in EAGE Technical Program Expanded Abstracts, 2010.
Acknowledgements
The synthetic Compass model was provided by the BG-GROUP, see also the disclaimer.


Dallas Buyers Club
Apr 7, 2009. Adam Lambert April 7 "Mad World" American Idol Performance. Adam Lambert performed Tears for. Fears' Mad World on the I like TV show and Special Download American Idol Episodes is my favorite TV show.
Apr 7, 2009. Adam Lambert April 7 "Mad World" American Idol Performance. Adam Lambert performed Tears for. Fears' Mad World on the I like TV show and Special Download American Idol Episodes is my favorite TV show.
Videos/performances. Media North America, Inc. Licensed by Fremantle. Media Enterprises. www americanidol com Want to advertise on Americanidol. com?
Lambert auditioned for the eighth season of American Idol in. all liked the performance, Cowell called it "indulgent rubbish" Advancing to the top 8, he sang the 2001 Michael Andrews and Gary Jules arrangement of "Mad World" Top 9, Top Downloads, "Play That Funky Music"
Adam Lambert - American Idol Performances on PhotoBucket Adam Lambert. Top 9 - Top Downloads Week Adam brought it Adam received a standing ovation from, yes, Simon as he closed. the show with "Mad World" by Tears for Fears:
Apr 8, 2009 Adam Lambert mesmerizes American Idol fans and judges with a chose to close the show with his stripped down performance of "Mad World," which To download Adam Lambert's performances or any other performances
A documentary about wounded veterans that Roger championed gets a screening at the Rehabilitation Institute of Chicago and screenings in New York and Los Angeles…
Watch the video for Adam Lambert Mad World (American Idol Studio Version) at Last fm Adam Mitchel Lambert (born January 29, 1982) is a singer, songwriter
Mad World appears on the album American Idol: Season 8. This is the most popular song by Adam Lambert from his series of American Idol performances
Apr 9, 2009. DOWNLOAD: http://russelites blogspot com/2010/04/american-idol-8-top-8- Adam Lambert Mad World Top 8 Performance at American Idol
Jun 25, 2010 Mad World (Studio Recording). - Adam Lambert [Download]by Adam Lambert Mad World Top 8 Performance at American Idol 2009 live Feb 11, 2010 Watch Later Mad World (Studio Recording) - Adam Lambert [Download]by Adam Lambert - Best of American Idol Performancesby
May 21, 2009 Mad World by Adam Lambert 7 Heartless by Kris What Hurts the Most ( American Idol Studio. Version) Danny Gokey 132 Big Girls Don't
An open letter from Woody Allen; an Edna Krabappel tribute; the possibility of a "Prometheus 2"; why film festivals reject good films; the return of…
Angie Miller's. Idol Journey. As we say goodbye to Angie Miller, we take a moment to relive her American Idol experience. Aug 19, 2013. Season 8 runner-up Adam Lambert was the frontrunner throughout the entire competition for delivering high-octane vocal performances that
Balder and Dash
Apr 10, 2009 Watch the video «Adam Lambert - "Mad World" (American Idol Studio Version)» uploaded by YouL00K on Dailymotion
MZS
Lambert auditioned for the eighth season of American. Idol in San Francisco, California liked the performance, Cowell called it "indulgent rubbish" Andrews and Gary Jules arrangement of "Mad World"
Interviews
Apr 7, 2009. AMERICAN IDOL went. over tonight way over Those of us watching on our DVRs missed the final. performance of the night from Adam Was Adam's Mad World performance your favorite on American Idol? To stay up to date on the latest news about Adam Lambert, click the "Subscribe" button on
Thumbnails
Dec 10, 2012 Before taking the stage with his friend Lambert, who gave a memorable performance. of "Mad World" when he was on "American Idol," gushed Adam Lambert - Mad. World (live) from Idol Fan 3 years ago not yet rated American Idol 5/19/2009 : Adam sings "Mad World" I own nothing. All rights belong to
Chaz's Blog
Aug 12, 2009. BEST American Idol Performance ever!by spam2194,130,414 views; 3:25. Watch Later Adam Lambert Mad World. Top 8 Performance at
Thumbnails
Feb 11, 2010. Watch Later Mad World (Studio Recording). - Adam Lambert [Download]by Adam Lambert - Best of American. Idol Performancesby Mar 13, 2010 Adam Lambert performs "Mad World" a song by Gary Jules which is a cover. of the British band Tears for Fears, and Gets A Standing Ovation
Interviews
Top 8, "Mad World", Safe Top 7, "Born to Be Wild" Top 2, "Mad World" (Adam's Choice) "Change is Gonna Come"
Thumbnails
Sep 20, 2013 Today we celebrate Adam Lambert, who will perform at the two-day festival. saw him audition on American Idol four years ago and we haven't gotten Who could forget Adam's performance of Mad. World on Idol that blew
Thumbnails
Season 8 of American Idol had it's share. of great performances, stellar highs, and I originally got it for Adam Lambert's version. of "Mad World", but found the Apr 8, 2009. Adam Lambert stole Tuesday's "American Idol" with a cover. of Gary Jules' version of Tears for Fears' "Mad World " "American Idol" Season 8: Live Performances photos: "American Idol" Season 8: Live Performances
Thumbnails
Watch Adam Lambert's Performance. on American Idol: 17. 05 13 Login or register ring of fire, mad world & whole lotta love. are history Adam made Eye- wink More details on the songs sung by Adam Lambert on American Idol Details on the original performances. with options for purchase are included. "Mad World," originally released in 1982, was the first significant chart hit by Tears for Fears.
Balder and Dash
What were the Adam Lambert American Idol performances of season eight? a standing ovation from Simon Cowell after. he performed the song "Mad World. " May 14, 2011 Tags: American Idol, American Idol Greatest Performance Tournament, Adam Lambert's Mad World gave. me the chills it was so magnificent
Balder and Dash
Apr 7, 2009 Simon Cowell liked Adam Lambert's "American Idol" performance so Adam Lambert, "Mad World": You want to know why I got so irked at the
Thumbnails
Dec 10, 2012. One of Adam Lambert's best-known performances on "American Idol" was his rendition of Tears for Fears' "Mad World" Years later, he got on Mad World appears on the album American Idol: Season 8. This is the most popular song by Adam Lambert from his series of American Idol performances
Interviews
Apr 7, 2009 Adam Lambert April 7 "Mad World" American Idol Performance Adam Lambert performed Tears for Fears' Mad World on the American Idol
MZS
Jan 18, 2012 10 Top 'American Idol' Game Changers of All Time: Adam Lambert, Idol has seen many game-changing contestants. and performances in its and White, the haunting Mad World and the dramatic Ring Of Fire, but more


Algeria presidential election: Five candidates announced
Algerians will head to polls on December 12 to vote in the country's contested presidential election amid protests.
Algeria's electoral authority has said the country's presidential election next month will be contested by five candidates - all part of the political establishment that has drawn the ire of months-long protests demanding the departure of the ruling elite.
The contenders are former Prime Ministers Abdelmadjid Tebboune and Ali Benflis, former Culture Minister Azzedine Mihoubi, former Tourism Minister Abdelkader Bengrine and Abdelaziz Belaid, head of the El Mostakbal Movement party.
More:
Mohamed Chorfi, the head of the electoral body, told reporters in the capital, Algiers, on Sunday that the final list of candidates for the December 12 poll will be passed to the constitutional council for final validation.
An original 23 candidates had applied but only five made the final list, according to Chorfi. Rules for candidates included gathering 50,000 signatures from citizens on voting lists from at least 50 regions.
Observers expect a weak turnout.
Political crisis
Authorities say the vote would be the only way to get out of a crisis Algeria has been facing since the resignation of President Abdelaziz Bouteflika in April under pressure from protesters.
Polls planned for July 4 were postponed due to a lack of viable candidates, plunging the country into a constitutional crisis, as interim President Abdelkader Bensalah's mandate expired that month.
Although authorities met some protesters' demands by detaining several former officials, including two former prime ministers and several prominent businessmen over corruption charges, protesters say they do not trust those currently in power to ensure democratic elections, citing their past links to Bouteflika, who ruled for 20 years.
"There will be full transparency in the handling of the presidential election," Chorfi said in his announcement.
Mass protests
The announcement came a day after tens of thousands of Algerians marched for a 37th consecutive week to demand an overhaul of the political system.
Angry at unemployment, corruption and an elderly elite seen as out of touch with the young, Algerians began taking to the streets on February 22 to protest, initially against ailing Bouteflika's plans to remain in office, and then for the removal of all remnants of a secretive political and military establishment that has dominated the country for decades.
The demonstrators have repeatedly demanded key figures of the ruling elite step down and credible institutions be established before elections are held.
The army, led by powerful chief of staff Lieutenant General Ahmed Gaid Salah, is seen as the main player in Algeria's politics. Gaid Salah has also promised transparency and fairness for the December 12 vote.


There are going to be a series of buttons to select from based off of what you are trying to insure, credit, your age, and your gender.
All of these prices will be based off of a yearly price of a 2018 model of the car.The first question is what type of car you are trying to insure.
The second one will be which range of credit fits you best.
The third question is what is your age?
The last question is what is your gender?


Dairy Free Meal Plan
Vegeterian Meal Plan
Blank Meal Planner
Chicken Bacon Casear Salad
Chicken and Bacon Cabonara
Chicken and Chorizo Pasta
Dairy-Free Beef Curry
Avo and Beef Wraps
Roast Chicken and vegetables


Knight leads Dartmouth over Florida Gulf Coast 55-49
HANOVER, N.H. (AP) - Chris Knight posted 13 points as Dartmouth topped Florida Gulf Coast 55-49 on Monday night.
James Foye had 12 points for Dartmouth. Aaryn Rai added 10 points. Ian Sistare had seven rebounds for the Big Green which started the season 2-0 for the first time since the 2004-05 season.
Zach Scott had 16 points for the Eagles (0-3), who were held to just six field goals and 20 points in the second half. Caleb Catto added 12 points. Justus Rainwater had nine rebounds.
Dartmouth matches up against Merrimack on Friday. Florida Gulf Coast takes on Mercer on the road on Friday.
For more AP college basketball coverage: https://apnews.com/Collegebasketball and http://twitter.com/AP_Top25
Elements of this story were generated by Automated Insights, http://www.automatedinsights.com/ap, using data from STATS LLC, https://www.stats.com
Sign up for Daily Newsletters
Copyright © 2019 The Washington Times, LLC.
Please read our comment policy before commenting.


vote/votes
6.5/1422
popularity
102.
original title
Dumbo
genre
drama
A young elephant, whose oversized ears enable him to fly, helps save a struggling circus, but when the circus plans a new venture, Dumbo and his friends discover dark secrets beneath its shiny veneer.


Across: 1. Notes in tiny manuscript (6) 4. Old country song about sailor (6) 9. 150 to return for Mass (4) 10. Go over area to find shrew (10) 11. Feeling of resentment created by rugged characters (6) 12. Refers to woodsman (8) 13. Friend takes a choir into local (9) 15. Rex appears in intelligence document (4) 16. Seamus O'Hoolihan takes in part of London (4) 17. Games turn into quarrels! (9) 21. It may be unhealthy to interrupt endlessly (8) 22. Country woman has material in abundance (6) 24. Are 1acs sold here - or their producers? (5 5) 25. Authentic version of Lear (4) 26. Quick! Journalist is in river! (6) 27. Force Mark right inside (6) Down: 1. West Side girl carries the French disease (7) 2. Well-known for not having a bear (5) 3. Bach met with a tragedy! (7) 5. Turn to Brighton, maybe (6) 6. Top people at lakeside restaurant (9) 7. Very old worker carried nice arrangement (7) 8. Fire Iris in scam with allowance! (13) 14. Move white rose, or else! (9) 16. Shoots King in lips! (7) 18. A Frenchman holds fashionable ointment (7) 19. Terrapin quietly left the country (7) 20. Ragged but sedate (6) 23. Regular van loads contain grub (5)


Home
My Goals
Shop
My Goal
By the end of August, I will have solved at least 100 difficult level Leetcode problems
Progress
LV. 8
Lv. 9
Share
Tweet


| About Dailyrotten |
|
Feedback
If you like this page, hate it, or would like to suggest changes,
<EMAIL_ADDRESS>is listening. This page
is experimental and somewhat different from what we usually offer, so please
do send your feedback.
Adding Stories
If you are a rotten newshound and you would like to suggest a story,
visit our submit page to
send us the URL. Stories that are accepted will have your name credited.
Posting Comments
In order to post comments to stories, you will have to
create an account.
Accounts will generally be validated within 24 hours, and of
course will be disabled if there is abuse.
Viewership
On the first full day this page went live, 100,000 people visited this Rotten
News page. Of course that was the day after the WTC attacks, so that number is
somewhat distorted. Right now this page gets between 50,000 and 75,000 people
every day.
Linking
We encourage everyone to link to this page; if you like it, others probably
will as well.
Other Rotten
Rotten
Gaping Maw
Celebrity Morgue
Mugshots
Rotten Store
Rate My Poo
Rate My Kitten
Rate My Finger
Penny Postcards
Phallic
Boners
Home
Make Dailyrotten your start page
|
|
|
June 04, 2002
MTV Execs to Sign in Blood
Mirror | Submitted by: delilah
"Ozzy Osbourne demanded that a UKP 15 million deal to film a second
"fly on the wall" series about his family should be signed in BLOOD.
The oddball star and his wife Sharon also said they wanted a new house
and psychotherapy for their pets for life."
|
|
Read article...
|
|
Japan's World Cup Delusion
Slate | Submitted by: commhealy
"Japan, which builds superhighways for teeny villages, billion-yen bridges
to empty islands, and flood-control dams for streams that couldn't soak your
basement, today introduces its latest public works boondoggle: 10 World Cup
stadiums—shapely, modern, spectacular white elephants."
|
|
Read article...
|
|
Bulls rampage through OKC streets
KOCO-TV 5 Oklahoma City | Submitted by: metaload
A group of cows broke loose and ran through the streets of Oklahoma City on Monday. They escaped while in transit from one pen to another at the local stockyards. One liberated bull ran into a motorcycle policeman and two patrol cars, it was eventually shot and killed after charging a child. Another knocked a homeowner down entering her fence.
|
|
Read article...
|
|
Dog trainer's son mauled on family property
Minneapolis Star Tribune | Submitted by: Epicurious Crabcake
"After family members noticed Colter Kumpost missing Sunday, they
began looking for him and found him with a German shepherd standing
over his body, the sheriff's office said. Crown Kennel, which has
been operating since 1985, has a strong interest in breeding
German shepherds for what they were originally intended, according
to the kennel's Web site."
|
|
Read article...
|
|
Saint Harry Potter
BBC | Submitted by: delilah
"A priest who uses magic tricks to entertain his congregation has asked
the Pope to name a patron saint of conjurers, magicians, and wizards."
He seems unaware of the Church's negative position on such things.
|
|
Read article...
|
|
Horny dolphins
Reuters UK | Submitted by: vertigo42
"Swimmers have been warned to stay away from a sexually frustrated
dolphin off a seaside resort after it tried to lure unwary humans out
to sea in a bid to mate with them."
|
|
Read article...
|
|
Filipino knifing live on TV, followup
Philippine Daily Inquirer | Submitted by: Pinoyz
"The nation watched in horror Friday as a pre-dawn hostage confrontation
in Pasay City captured on television segued into a bloody climax, with
a deranged knife-wielding man stabbing dead a shrieking 4-year-old boy
before being gunned down by policemen." A followup from yesterday, the 2nd
link is video footage of the incident.
|
|
Read article... and
This article...
|
|
Thank God for that tree
Richmond Times-Dispatch | Submitted by: Tugboat
Truck Driver asleep at the wheel, veers off interstate into resedential neighboorhood clipping the bedroom off one house and slammed into a tree in front of another house. "Thank God for that tree, man," said Bradley, gazing into his neighbor's yard. "Because if it wasn't for that tree, there wasn't anything in the truck's way to stop it, until it started to tear up some more houses."
The rig clipped 2203 and sheered off the corner of 2201, where three children and three adults were sleeping. (What were all 6 doing in one bedroom?) Picture of scene!
|
|
Read article...
|
|
Balloon headed dummy foils balloon heads
Canoe | Submitted by: Pandora
In a classic case of cartoonish escape, this guy used a baloon headed
dummy to confuse the guards at Drumheller penitentiary so he could escape:
"It looks like he used a balloon for a head and glued hair to it. He used
something to stuff a pair of coveralls and put them in his bed to
make it appear as if he was sleeping."
|
|
Read article...
|
|
Bail revoked in mass robbery
Baltimore Sun | Submitted by: Streaker
Threats of murder and rape, forced nudity, illegal swimming. "...five men charged with brazenly robbing 42 people at gunpoint in a remote area of the Loch Raven Reservoir [near Baltimore].
|
|
Read article...
|
|
Uraguay: Argentinians "Bunch of Thieves"
Nando Times | Submitted by: f00f
"The problem with the Argentines is that they are a bunch of thieves from start to finish. You know the amount of corruption in Argentina," Batlle was quoted as telling an interviewer on the tape, which was carried by Radio Rivadavia.
|
|
Read article...
|
|
Oklahoma students in racoon piss incident
Edmond Sun | Submitted by: Just Jesus
"A teacher and custodian were hurt May 16 when they tried to stop
a group of students from leaving the premises after they allegedly
chucked urine-filled water balloons onto students in the Commons
area, Principal Bob Morrison said."
|
|
Read article...
|
|
|
|
|