- Documentation
- Contribute
- Home
Treetop grammars are written in a custom language based on parsing expression grammars. Literature on the subject of parsing expression grammars (PEGs) is useful in writing Treetop grammars.
PEGs have no separate lexical analyser (since the algorithm has the same time-complexity guarantees as the best lexical analysers) so all whitespace and other lexical niceties (like comments) must be explicitly handled in the grammar. A further benefit is that multiple PEG grammars may be seamlessly composed into a single parser.
Treetop grammars look like this:
require "my_stuff"
grammar GrammarName
include Module::Submodule
rule rule_name
...
end
rule rule_name
...
end
...
end
The main keywords are:
grammar
: This introduces a new grammar. It is followed by a constant name to which the grammar will be bound when it is loaded.
include
: This causes the generated parser to include the referenced Ruby module (which may be another parser)
require
: This must be at the start of the file, and is passed through to the emitted Ruby grammar
rule
: This defines a parsing rule within the grammar. It is followed by a name by which this rule can be referenced within other rules. It is then followed by a parsing expression defining the rule.
A grammar may be surrounded by one or more nested module
statements, which provides a namespace for the generated Ruby parser.
Treetop will emit a module called GrammarName
and a parser class called GrammarNameParser
(in the module namespace, if specified).
Each rule associates a name with a parsing expression.  Their key feature is the ability to reference other expressions in the grammar by name.
Strings are surrounded in double or single quotes and must be matched exactly.
"foo"
'foo'
Character classes are surrounded by brackets. Their semantics are identical to those used in Ruby's regular expressions.
[a-zA-Z]
[0-9]
The anything symbol is represented by a dot (.
) and matches any single character.
An empty string matches at any position and consumes no input. It's useful when you wish to treat a single symbol as part of a sequence, for example when an alternate rule will be processed using shared code.
''
Nonterminal symbols are unquoted references to other named rules. They are equivalent to an inline substitution of the named expression.
rule foo
"the dog " bar
end
rule bar
"jumped"
end
The above grammar is equivalent to:
rule foo
"the dog jumped"
end
Parsers attempt to match ordered choices in left-to-right order, and stop after the first successful match.
"foobar" / "foo" / "bar"
Note that if "foo"
in the above expression came first, "foobar"
would never be matched.
Note also that the above rule will match "bar"
as a prefix of "barbie"
.
Care is required when it's desired to match language keywords exactly.
Sequences are a space-separated list of parsing expressions. They have higher precedence than choices, so choices must be parenthesized to be used as the elements of a sequence.
"foo" "bar" ("baz" / "bop")
Parsers will greedily match an expression zero or more times if it is followed by the star (*
) symbol.
'foo'*
matches the empty string, "foo"
, "foofoo"
, etc.Parsers will greedily match an expression one or more times if it is followed by the plus (+
) symbol.
'foo'+
does not match the empty string, but matches "foo"
, "foofoo"
, etc.An expression can be declared optional by following it with a question mark (?
).
'foo'?
matches "foo"
or the empty string.A generalised repetition count (minimum, maximum) is also available.
'foo' 2..
matches 'foo'
two or more times'foo' 3..5
matches 'foo'
from three to five times'foo' ..4
matches 'foo'
from zero to four timesLookahead assertions can be used to make parsing expressions context-sensitive. The parser will look ahead into the buffer and attempt to match an expression without consuming input.
Preceding an expression with an ampersand (&)
indicates that it must match, but no input will be consumed in the process of determining whether this is true.
"foo" &"bar"
matches "foobar"
but only consumes up to the end "foo"
. It will not match "foobaz"
.Preceding an expression with a bang (!)
indicates that the expression must not match, but no input will be consumed in the process of determining whether this is true.
"foo" !"bar"
matches "foobaz"
but only consumes up to the end "foo"
. It will not match "foobar"
.Note that a lookahead assertion may be used on any rule, not just a string terminal.
rule things
thing (!(disallowed / ',') following)*
end
Here's a common use case:
rule word
[a-zA-Z]+
end
rule conjunction
primitive ('and' ' '+ primitive)*
end
rule primitive
(!'and' word ' '+)*
end
Here's the easiest way to handle C-style comments:
rule c_comment
'/*'
(
!'*/'
(. / "\n")
)*
'*/'
end
Sometimes you must execute Ruby code during parsing in order to decide how to proceed. This is an advanced feature, and must be used with great care, because it can change the way a Treetop parser backtracks in a way that breaks the parsing algorithm. See the notes on below on how to use this feature safely.
The code block is the body of a Ruby lambda block, and should return true or false, to cause this parse rule to continue or fail (for positive sempreds), fail or continue (for negative sempreds).
&{ ... }
Evaluate the block and fail this rule if the result is false or nil!{ ... }
Evaluate the block and fail this rule if the result is not false or nilThe lambda is passed a single argument which is the array of syntax nodes matched so far in the
current sequence. Note that because the current rule has not yet succeeded, no syntax node has
yet been constructed, and so the lambda block is being run in a context where the names
of the
preceding rules (or as assigned by labels) are not available to access the sub-rules.
rule id
[a-zA-Z][a-zA-Z0-9]*
{
def is_reserved
ReservedSymbols.include? text_value
end
}
end
rule foo_rule
foo id &{|seq| seq[1].is_reserved } baz`
end
Match "foo id baz" only if id.is_reserved
. Note that id
cannot be referenced by name from foo_rule
,
since that rule has not yet succeeded, but id
has completed and so its added methods are available.
rule test_it
foo bar &{|s| debugger; true } baz
end
Match foo
then bar
, stop to enter the debugger (make sure you have said require "ruby-debug"
somewhere),
then continue by trying to match baz
.
Treetop, like other PEG parsers, achieves its performance guarantee by remembering which rules it has tried at which locations in the input, and what the result was. This process, called memoization, requires that the rule would produce the same result (if run again) as it produced the first time when the result was remembered. If you violate this principle in your semantic predicates, be prepared to fight Cerberus before you're allowed out of Hades again.


I trust that you completed your task successfully? If not, the forest must be in quite an uproar with those spirits careening about!


[§454M-9] Private right of action. Nothing in this chapter shall be construed to preclude any individual or entity that suffers loss as a result of a violation of this chapter from maintaining a civil action to recover damages and, as provided by statute, attorney's fees. [L 2009, c 106, pt of §1]


Mostly in music organized in parts, there are frequently rests that last for more than one measure.
In MEI, these rests are encoded using the special element <multiRest/>
. It uses plain
integers in the @num
attribute to specify the number of measures which the performer of that
part is supposed to rest.
Please encode a <multiRest/>
lasting for 15 measures.


{% extends 'base.html' %} {% set title = 'Your account was closed' %} {% set crumbs = [(None, title)] %} {% set meta = (('robots', 'noindex'),) %} {% block content %} {{ _('Your account was sucessfully closed!') }} {{ _('We\'re sorry to see you go.') }} {% endblock %}
{{ _('We\'re sorry to see you go.') }}


Restore an Unsubscribed Member
- Login to the HOG[SCAN] Mailer for your environment.
- From the navbar on the left click Audience to expand it. By default, the Contacts page is displayed with the Overview tab selected.
- On the Contacts page click the Unsubscribed tab
- Scroll down a little and click the Manage unsubscribe page button. see image below
- In the page that pops up scroll down to the Subscription link section
- Click the Copy icon to copy the link to your clipboard. The wording will change to Copied.
- Paste this link into the email being sent to the member who unsubscribed but wants to subscribe again to receive campaigns.
- In the email;
- Let the member know they have to click the link
- Let them know that after clicking the link they will see a message informing them that an activation email has been sent to their email address
- Let them know they must open that email to complete the sign-up process as there is another step to take.
Note1: It may go to their junk/spam folder so have them look for it there. It will have a title of Subscriber Activation.
Note2: When I tried this the email was in my junk/spam folder almost immediately. When the member I was trying to restore tried, it took almost four hours for the email to arrive in their junk/spam folder.
- Let them know that after clicking the link in the email a new tab will open with a Subsription confirmed message and email address has been successfully subscribed where email address is their email address.
- When the member has successfully completed all steps, you will see their name removed from the Unsubscribed list and looking at your list of members you will see that their account is marked Active.
The following are screenshots of what the member sees when following the steps in your email;
- After clicking the link provided, a browser tab opens that looks like the following. This is where the member fills in the email address that they used when unsubscribing and their First and Last names.
- After clicking on the Subscribe button in the previous image the member will see a pop-up similar to the following.
- This is from the email that will more than likely go to the member's junk/spam folder. The body of the email looks like the following image. The member must click the Subscriber Activation link to complete the process.
- After clicking the Subscriber Activation link the member will see a browser pop-up similar to the following.
That's it! The member has successfully resubscribed and will receive future campaigns.


Guitar owned by Grateful Dead's Jerry Garcia to be auctioned
SAN FRANCISCO -- A guitar owned and played by The Grateful Dead's Jerry Garcia is going up for auction. Experts estimate the 'Alligator', a Fender Stratocaster, will go for between $250,000 and $400,000.
Garcia last used the instrument at Roosevelt Stadium in Jersey City in 1973.
Alligator is believed to have been given to Garcia in 1970 by Graham Nash in appreciation of Garcia's guitar work on Nash's solo album "Songs For Beginners."
The personal collection of more than 70 lots also includes additional guitars, paintings by Garcia, his large collection of comics, as well as his Hawaiian shirts.
A public exhibition in San Francisco will be held Friday through Sunday. The items will be in Los Angeles on December 5-9. The auction date is December 10.


|
|
|
Mainpage
Movies
About Us
Contact Us
|
Walt Disney Animation Studios
|
Our Studio
You can design and create, and build the most wonderful place in the world.
But it takes people to make the dream a reality." - Walt Disney
Combining masterful artistry and storytelling with groundbreaking technology, Walt Disney Animation Studios is a filmmaker-driven animation studio responsible
for creating some of the most beloved films ever made. Located in Burbank, WDAS continues to build on its rich legacy of innovation and creativity, stretching
from the first fully-animated feature film, 1937's Snow White and the Seven Dwarfs, to 2013's Academy Award®-winning Frozen, the biggest animated film of all time.
Among the studio's timeless creations are Cinderella, Sleeping Beauty, The Jungle Book, Beauty and the Beast, The Lion King, Tangled, Wreck-It Ralph, Big Hero 6,
Zootopia, and the upcoming feature Moana..
Here at Walt Disney Animation Studios, employees continually enhance their development, learning, and creative growth through a wide variety of classes, from
custome drawing instruction by our own artists, to seminars on film making techniques by masters of the craft, to technological demonstrations from in-house experts.
Maintaining a work-life balance is important and we’ve created an environment that reflects that philosophy. In short, our people make our films great, and
we strive to build a culture that feeds and respects the creative spirit.
|


$!httpInclude.include("/top.htm")
$!httpInclude.include("/seller/nav_head.htm")
$!httpInclude.include("/seller/nav.htm?op=store_set")
卖家中心
>
店铺地图
店铺设置
店铺幻灯
店铺地图
店铺认证
输入地址：
$!httpInclude.include("/footer.htm")


{% extends '_layouts/layout.html' %} {% block page_title %} {% endblock %} {% block content %}
They will check your answers and give you advice on what to do next
If there are any new symptoms, or if the condition gets worse, call NHS 111 for advice.
If you're not registered with a GP, read advice on how to join an NHS GP practice


If there is no access token or the access token is invalid, click the Login button below.
{{ token_json }}
Existing webhooks can be retreived from the /restapi/v1.0/subscription endpoint. Filter the resulting records on deliveryMode.transportType is set to WebHook.
{{ webhook_response }}
To create a webhook edit the eventFilters property if desired, and then click the Create Webhook button below.
More info:


Mehedi Hasan Shuvo
Bio:"NewB in programming.Trying to learn python,html,css etc".
Company Name:Dekko Isho Group
Designation: Intern
Currently live in :Dhaka


Abandoned 'unicorn' puppy has tail on his head and he's completely magical
The amazing little pup was taken in by a rescue centre and named Narwhal the Little Magical Furry Unicorn
by Luke Matthews, https://www.mirror.co.uk/authors/luke-matthews/A puppy with a tail growing from the middle of its forehead has become a viral superstar after he was abandoned and left in the 'freezing cold'.
Rescue organisation Mac's Mission found the pup, who also had a foot injury, on the street along with another older dog and took them both under its wing.
Staff named the adorable doggo 'Narwhal the Little Magical Furry Unicorn' and he quickly established a huge fan base after videos were uploaded on Facebook .
The Missouri-based centre 'specialises in special' and looks to help dogs which have been abused, injured or have birth defects who would die without their help.
In an update, the centre answered the question on every Narwhal fan's lips - the tail unfortunately doesn't wag when he gets excited.
The puppy was taken to the vets, after being reassured by staff it wasn't going to be scary, to try and find out why the tail is there, if it was connected, and most importantly, if it can wag.
After the appointment, the centre wrote : "The extra tail is not connected to anything and has no real use other than making him the COOLEST PUPPY EVER!
"One of our followers said 'it appears they assembled the puppy wrong. Always follow the directions people!'
"This is a true experience of having 'extra parts' during assembly.
"Dr. Heuring said there is no real reason at this time for the unicorn tail to be removed (and we all wish it wagged)
"Pretty sure the staff at Cape Small also gushed all over this little nugget!

Little Narwhal, assumed to be a half dog half unicorn mix, isn't ready for adoption yet as staff want to monitor the tail and ensure it doesn't become a problem, but fans have already predicted the 'longest adoption line in history'.
One said: "Honestly the tail just makes him even cuter! And what great news that it's not causing any trouble up there!"
Another said: "He is destined for great things! I can feel it when I look at his little face, he's adorable and awesome!"
Click here to learn more about Mac's Mission and donate to their amazing work.


Puppies are cute
By Adelaide
I love puppies and kitties.
Names for dogs and cats
Polly
Bailey
Dexter
Suzy
Cupcake


Review: Spawn (1997)
by Luke Buckmaster
Comic books are often the origins to some very entertaining films. Which, when you think about it, makes a lot of sense. After all, who wouldn't appreciate seeing Batman battle some bad dudes or an agency of Men in Black protecting the Earth from intergalactic warfare? For me, comics are a source of entertainment and fun. But the creation of a film based on Todd McFarlane's popular hero "Spawn" is unfortunately never much fun at all.
Bearing a definite resemblance to the sets from the Batman series; the dark and gothic surroundings of Spawn help prepare us for the depressing time that lies ahead, where the question "Why did I come and see this again?" will be asked one too many times.
The film (and the comic series) is based around the peculiar experiences of Al Simmons (Michael Jai White). Being one of the finest professional assassins in the world, Simmons is more than aware of his talents yet underestimates those of the people around him. So after a stylish assassination at the beginning of the film (which incidentally was one of my favorite parts), he makes it perfectly clear that he "cares" about innocent people losing their lives. This alone is an unforgivable mistake. Michael Jai White wants us to believe that this soon-to-be hero can be as emotional and sensitive as anybody else. He has no problem in firing missiles or using impressive artillery, but later on complains that people's lives were in danger. Even if we push aside the fact that no one really wants to see an emotional-at-times-and-ruthless-at-other-times hero, White gives Spawn about as much emotion as a prison meatloaf - which you could imagine is not terribly impressive. Anyway, after a sudden outburst of emotion and ethics, Simmons soon finds himself burned to death with a face that looks like a toasted Pop Tart. He then goes on his merry old way to the fiery realms of hell (which, by the way, is fabulously animated) and makes a pact with the devil: he is able to return to Earth to see his beloved wife Wanda (Theresa Randle) if he agrees to lead Hell's Army in a battle to destroy mankind. As you may have guessed, Simmons heartily agrees and finds himself back on Earth - 5 years after his apparent death.
However a few things have changed. Wanda is now married to Simmons' former colleague Jason Wynn (Martin Sheen) and are producing sons and daughters whilst living a happy family life. And if this wasn't enough to get used to, he is rapidly introduced to the devil's number one assistant Clown (John Leguizamo) and Cogliostro (Nicol Williamson), who helps Simmons harness some new fighting abilities and works along side him in many fiendish battles. So as Simmons discovers that he is no longer human and always dressed in a mysterious black suit and red cape, he struggles to decide whether he should let the forces of evil prevail or to defend the Earth at any cost. Born into darkness and sworn to justice, Spawn is a hero to be reckoned with.
It doesn't take many brains to guess that Spawn is not going to get much more complicated than the old good versus evil skit; and although it wants us to feel for the character of Al Simmons, most audiences will be looking forward to the fighting scenes but not much else. To save the film from total failure, Spawn's dazzling eye candy is state of the art computer generated effects. The team from Industrial Light and Magic has once again distracted us from a fairly weak film by placing us in the middle of a special effects bonanza of the highest degree.
Fans of the comic books will get a thrill to find their hero right in front of their eyes, and the impressive sets of Spawn give a perfect conversion from the dark, gloomy comic artwork. But director Mark Dippe went no further than this, and Spawn fails to achieve many interesting aspects that would create fans rather than reward them.
It's interesting to note that the film spends all of its time explaining how the hero emerged, so in the grand scheme of things the end of the film is really right at the start of the comic series. Which is actually something pleasing considering that Spawn is a fairly modern character and unknown to many - so the possibility of a sequel or a series of films is not unlikely.
Spawn seems to me to be a movie you can like a lot better when you look back on it, where you remember how good the special effects were but not really care when you're watching them. The film is solid and consistent with average action, a below average plot, dismal acting and great special effects. Is it worth seeing? Well the cinema, when I got out of my chair and began to walk out, I asked myself "What kind of people would really love that film?" Of course, the answer hit me almost suddenly when one of my friends blurted out "Wasn't that awesome!" You got it - teenagers.
2 out of 5 stars Spawn's dazzling screen mayhem will appeal to some teens, but most people should wait for this one to hit the video shelves so they can fast forward to the semi entertaining battle scenes and a creative depiction of the undead.
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


Welcome!
What are we going to talk about?
-
Since 2010, we've entered into a new phase in web design and development.
The Responsive idea was conceived to solve a problem.
Technology always evolves, trends always change. Now websites grow in their ambition and complexity,
we are not longer building pages, we are building dynamic and interactive Responsive web applications.
-
We are going to share advanced and emerging techniques for improving Responsive applications.
Focusing on "The Good Parts", avoiding the classic pitfalls, with the emphasis on latest trends and revealing what RWD really can do for you.
Simply put: Responsive Web Design is:
- Flexible, grid-based layout
- Flexible media: images; and
video;
- @media queries
RWD is just the beginning.
"The Good Parts" are on top of it:
- Mobile First
- Progressive Enhancement
- Automatic Tests
"Responsive Web Design is one of the most important technologies to appear in recent years.
But using RWD badly may be worse than not offering it at all", Craig Buckler
a better RWD definition
Responsive Web Design is the practice of creating reliable future friendly websites; that fluidly respond
to deliver the right user experience for the right environment at the right time.
Case study: RWD video
"Plan for the fact that whatever you implement will be deprecated", @grigs
Case study: Performance
- Mobile First development and Mobile First Design
- Treat Performance As Design
- Focus only the most important data
- Progressive Enhancement:
"As web creators we need to see performance as design", @elementByIdea
Case study: Testing Tools
- Browser based Testing Tools
- Brand Simulators: iOS, Android, Blackberry, etc.
- Testing performance
-
Remote debugging:
Android.
iOS.
- Real devices testing
- Automated Test:
"Mobile devices require software development teams to focus on only the most important data and actions in an application.", Luke Wroblewski
Case study: Measure units and pixel perfect on Responsive
"The Post-PSD Era", @brad_frost
Case study: CSS3 hot topics
Case study: HTML5 hot topics
"SVG is not meant to be used for pixel manipulation", net.tutsplus.com
Case study: HTML5 hot topics
"Mobile is a user state, not a device", @Cennydd
Case study: Using icon webfonts instead of images
Diversity is not a bug, it's an opportunity', @stephanierieger
RWD is not effortless, but it's worth it.
It's requires a lot of effort to create a Future-friendly Web.
Being a Responsive Developer is like surfing in an ocean of technologies and living in a culture of innovation,
feeling like we are not just developers;
"We are artists of the code"
Gratitude!
Questions?
- Further questions:
- My other presentations:
- Special Thanks to:


{{constraints.size}} Foreign Key Constraints
| Constraint Name | Child Column | Parent Column | Delete Rule | ||
|---|---|---|---|---|---|
| {{name}} |
|
|
{{deleteRuleName}} |
Check Constraints
| Table | Constraint Name | Constraint |
|---|---|---|
| {{table.name}} | {{name}} | {{checkConstraints.keySet}} |
| None detected |


--- layout: page title: Marcelo Brandalero subtitle: use-site-title: true ---
Hi, I am Marcelo Brandalero, currently a post-doctoral researcher in the Chair for Computer Engineering at the Brandenburg University of Technology Cottbus-Senftenberg. My research interests lie in computer architecture, reconfigurable systems, performance and power-efficient embedded systems and approximate computing. I have recently received the Dr. Degree from the Universidade Federal do Rio Grande do Sul (UFRGS), in Brazil. I also hold a Computer Engineer Degree from the same institution.
This is my newly-redesigned personal webpage and blog, where I'll be writing about my experiences and crazy ideas. Feel free to browse around, but notice that most of it is still under construction.
If you want to get in touch, please check the Contact page.


OpenCache Research
OpenCache is possible thanks to a number of academic research projects:
OpenCache-related research includes:
- M. Broadbent, P. Georgopoulos, V. Kotronis, B. Plattner, and N. Race. OpenCache: Leveraging SDN to demonstrate a customisable and configurable cache. In Computer Communications Workshops (INFOCOM WKSHPS), 2014 IEEE Conference on, pages 151-152. IEEE, 2014. DOI.
- M. Broadbent, D. King, S. Baildon, N. Georgalas, and N. Race. OpenCache: A software-defined content caching platform. In Network Softwarization (NetSoft), 2015 1st IEEE Conference on, pages 1-5. IEEE, 2015.DOI.
- M. Broadbent and N. Race. OpenCache: exploring efficient and transparent content delivery mechanisms for video-on-demand. In Proceedings of the 2012 ACM conference on CoNEXT student workshop, pages 15-16. ACM, 2012. DOI.
- P. Georgopoulos, M. Broadbent, A. Farshad, B. Plattner, and N. Race. Using Software Defined Networking to enhance the delivery of Video-on-Demand. Computer Communications, 69:79-87, 2015. DOI.
- P. Georgopoulos, M. Broadbent, B. Plattner, and N. Race. Cache as a service: leveraging SDN to efficiently and transparently support Video-on-Demand on the last mile. In Computer Communication and Networks (ICCCN), 2014 23rd International Conference on, pages 1-9. IEEE, 2014. DOI.


Being a ruby enthusiast for a few years now, i dont think twice to mention that rails is the killer app for ruby. Rails was all possible because of ruby’s flexibility and ruby became famous due to rails’s simplicity and focus on productivity. Rails is an opinionated framework with simplest implementation of MVC which makes it super fast to get to build things even for beginners.
Having said that, ruby’s powerful, programmer friendly design helped in the evolution of a lot of other frameworks which might not have sung so well like rails but are cool enough to have a try at. Below are some of them that i would like to mention.
1) Sinatra -
Sinatra is the next most famous ruby framework after rails. It is minimalistic web framework and lightness is the core of it. Tries to be non opinionated as much as it can. This is the most famous and suitable option when you need to build simple and single page webapps and ship to production fast. Though a number of templates and helpers are added in the later versions it does not look promising to build complex apps yet.
Homepage - http://www.sinatrarb.com/
Documentation - http://www.sinatrarb.com/intro.html
Github - https://github.com/sinatra/sinatra/
2) RubyMotion -
Build mobile apps with ruby! Yes ! RubyMotion is a cross platform framework to build Android, iOS and Mac OSX apps using ruby code. Ruby code is compiled to native apis on each of these devises. RubyMotion looks promising and there are already a number of apps out on app store and google play which are built on this. Though it looks cool for rubyists, performance of the apps compared to that of the native mobile apps seem to be a bit on the southern side.
Homepage - http://www.rubymotion.com Features - http://www.rubymotion.com/tour/features/
3) Lotus -
Personally i feel Lotus very interesting since the very little exploration i could do with it. It is a modular framework with container architecture by default where multiple apps are run with the same ruby process. Though it is MVC, it maintans the separation of concerns there by staying highly non opinionated. As each component is standalone, this can be used for full stack webapps and micro services architectures.
Homepage - http://lotusrb.org/
Guides - http://lotusrb.org/guides/
Github - https://github.com/lotus/lotus
4) Padrino -
Padrino is a full stack web framework built on top of Sinatra. It claims to help developers with a number of helpers and little bit of functional support to build larger and more complex systems while keeping the lightness of Sinatra to some extent. Their github’s README has a clean and precise explanation of the framework.
Homepage - http://padrinorb.com/
Guides - http://padrinorb.com/guides/standalone-usage-in-sinatra/
Github - https://github.com/padrino/padrino-framework
5) Cuba -
Cuba is a minimalistic ruby micro framework to build weapps. It calls itself to be inspired by ‘rum’, a minimalistic rack mapper. While i m unsure about its’s popularity as framework, except for the github stars, it looks like something to give a try at if you want a lean and micro ruby framework.
Homepage - http://cuba.is/
Github - https://github.com/soveran/cuba
Guides - http://theguidetocuba.io/


Android Developer
I'm currently doing my engineering from JSSATE Bengaluru in CSE department. I am tech enthusiast and I am into Android Development and PC gaming.
Skills Summary
Python for Data Science


|
||||||||||
| PREV NEXT | FRAMES NO FRAMES |
| Packages that use InputSupplier | |
|---|---|
| com.google.common.io |
| Uses of InputSupplier in com.google.common.io |
|---|
| Methods in com.google.common.io that return InputSupplier | |
|---|---|
InputSupplier<InputStream> |
FileBackedOutputStream.getSupplier()
Returns a supplier that may be used to retrieve the data buffered by this stream. |
static InputSupplier<InputStream> |
ByteStreams.join(InputSupplier<? extends InputStream>... suppliers)
Varargs form of ByteStreams.join(Iterable) . |
static InputSupplier<Reader> |
CharStreams.join(InputSupplier<? extends Reader>... suppliers)
Varargs form of CharStreams.join(Iterable) . |
static InputSupplier<InputStream> |
ByteStreams.join(Iterable<? extends InputSupplier<? extends InputStream>> suppliers)
Joins multiple InputStream suppliers into a single supplier. |
static InputSupplier<Reader> |
CharStreams.join(Iterable<? extends InputSupplier<? extends Reader>> suppliers)
Joins multiple Reader suppliers into a single supplier. |
static InputSupplier<ByteArrayInputStream> |
ByteStreams.newInputStreamSupplier(byte[] b)
Returns a factory that will supply instances of ByteArrayInputStream that read from the given byte array. |
static InputSupplier<ByteArrayInputStream> |
ByteStreams.newInputStreamSupplier(byte[] b,
int off,
int len)
Returns a factory that will supply instances of ByteArrayInputStream that read from the given byte array. |
static InputSupplier<FileInputStream> |
Files.newInputStreamSupplier(File file)
Returns a factory that will supply instances of FileInputStream
that read from a file. |
static InputSupplier<InputStream> |
Resources.newInputStreamSupplier(URL url)
Returns a factory that will supply instances of InputStream that
read from the given URL. |
static InputSupplier<InputStreamReader> |
Files.newReaderSupplier(File file,
Charset charset)
Returns a factory that will supply instances of InputStreamReader that read a file using the given character set. |
static InputSupplier<InputStreamReader> |
CharStreams.newReaderSupplier(InputSupplier<? extends InputStream> in,
Charset charset)
Returns a factory that will supply instances of InputStreamReader ,
using the given InputStream factory and character set. |
static InputSupplier<StringReader> |
CharStreams.newReaderSupplier(String value)
Returns a factory that will supply instances of StringReader that
read a string value. |
static InputSupplier<InputStreamReader> |
Resources.newReaderSupplier(URL url,
Charset charset)
Returns a factory that will supply instances of InputStreamReader that read a URL using the given character set. |
static InputSupplier<InputStream> |
ByteStreams.slice(InputSupplier<? extends InputStream> supplier,
long offset,
long length)
Returns an InputSupplier that returns input streams from the
an underlying supplier, where each stream starts at the given
offset and is limited to the specified number of bytes. |
| Methods in com.google.common.io with parameters of type InputSupplier | ||
|---|---|---|
static void |
Files.copy(InputSupplier<? extends InputStream> from,
File to)
Copies to a file all bytes from an InputStream supplied by a
factory. |
|
static long |
ByteStreams.copy(InputSupplier<? extends InputStream> from,
OutputStream to)
Opens an input stream from the supplier, copies all bytes from the input to the output, and closes the input stream. |
|
static long |
ByteStreams.copy(InputSupplier<? extends InputStream> from,
OutputSupplier<? extends OutputStream> to)
Opens input and output streams from the given suppliers, copies all bytes from the input to the output, and closes the streams. |
|
static
|
CharStreams.copy(InputSupplier<R> from,
Appendable to)
Opens a Readable object from the supplier, copies all characters
to the Appendable object, and closes the input. |
|
static
|
Files.copy(InputSupplier<R> from,
File to,
Charset charset)
Copies to a file all characters from a Readable and
Closeable object supplied by a factory, using the given
character set. |
|
static
|
CharStreams.copy(InputSupplier<R> from,
OutputSupplier<W> to)
Opens Readable and Appendable objects from the
given factories, copies all characters between the two, and closes
them. |
|
static boolean |
ByteStreams.equal(InputSupplier<? extends InputStream> supplier1,
InputSupplier<? extends InputStream> supplier2)
Returns true if the supplied input streams contain the same bytes. |
|
static boolean |
ByteStreams.equal(InputSupplier<? extends InputStream> supplier1,
InputSupplier<? extends InputStream> supplier2)
Returns true if the supplied input streams contain the same bytes. |
|
static long |
ByteStreams.getChecksum(InputSupplier<? extends InputStream> supplier,
Checksum checksum)
Computes and returns the checksum value for a supplied input stream. |
|
static byte[] |
ByteStreams.getDigest(InputSupplier<? extends InputStream> supplier,
MessageDigest md)
Computes and returns the digest value for a supplied input stream. |
|
static InputSupplier<InputStream> |
ByteStreams.join(InputSupplier<? extends InputStream>... suppliers)
Varargs form of ByteStreams.join(Iterable) . |
|
static InputSupplier<Reader> |
CharStreams.join(InputSupplier<? extends Reader>... suppliers)
Varargs form of CharStreams.join(Iterable) . |
|
static long |
ByteStreams.length(InputSupplier<? extends InputStream> supplier)
Returns the length of a supplied input stream, in bytes. |
|
static InputSupplier<InputStreamReader> |
CharStreams.newReaderSupplier(InputSupplier<? extends InputStream> in,
Charset charset)
Returns a factory that will supply instances of InputStreamReader ,
using the given InputStream factory and character set. |
|
static
|
ByteStreams.readBytes(InputSupplier<? extends InputStream> supplier,
ByteProcessor<T> processor)
Process the bytes of a supplied stream |
|
static
|
CharStreams.readFirstLine(InputSupplier<R> supplier)
Reads the first line from a Readable & Closeable object
supplied by a factory. |
|
static
|
CharStreams.readLines(InputSupplier<R> supplier)
Reads all of the lines from a Readable & Closeable object
supplied by a factory. |
|
static
|
CharStreams.readLines(InputSupplier<R> supplier,
LineProcessor<T> callback)
Streams lines from a Readable and Closeable object
supplied by a factory, stopping when our callback returns false, or we
have read all of the lines. |
|
static InputSupplier<InputStream> |
ByteStreams.slice(InputSupplier<? extends InputStream> supplier,
long offset,
long length)
Returns an InputSupplier that returns input streams from the
an underlying supplier, where each stream starts at the given
offset and is limited to the specified number of bytes. |
|
static byte[] |
ByteStreams.toByteArray(InputSupplier<? extends InputStream> supplier)
Returns the data from a InputStream factory as a byte array. |
|
static
|
CharStreams.toString(InputSupplier<R> supplier)
Returns the characters from a Readable & Closeable object
supplied by a factory as a String . |
| Method parameters in com.google.common.io with type arguments of type InputSupplier | |
|---|---|
static InputSupplier<InputStream> |
ByteStreams.join(Iterable<? extends InputSupplier<? extends InputStream>> suppliers)
Joins multiple InputStream suppliers into a single supplier. |
static InputSupplier<Reader> |
CharStreams.join(Iterable<? extends InputSupplier<? extends Reader>> suppliers)
Joins multiple Reader suppliers into a single supplier. |
|
||||||||||
| PREV NEXT | FRAMES NO FRAMES |


Hello world
There are two many dues in JI.
Vv186 Honors Mathematics II
Vg101 Introduction to Programming


| Argument | Description |
|---|---|
| reservationId | The id of the reservation returned by the create_reservation command |
| Argument | Description |
|---|---|
| reservationId | The id of the reservation returned by the create_reservation command |
| Argument | Description |
|---|---|
| reservationId | The id of the reservation returned by the create_reservation command |
| routes | Route to be connected (space separated values) E.g. "{TG/IXIA/XM12_02:11/15 Ciena_3930-11:9} {Ciena_3930-11:11 PE12:ge-1/3/1}" |
| Argument | Description |
|---|---|
| reservationName | The name/description of the reservation. Note that multiple reservations with the same name can be added in RM. The difference is the reservation id. |
| reservationDuration | Duration in minutes of the reservation |
| reservationUser | The user who is making the reservation. This has to be provisioned in the QS Resource Manager DB prior to running the script. Should be the same username used at the logon. |
| routes | This is where you tell the RM how and what to connect in your topology. In the example below i want to create a topology with 4 routes. Each route (or endpoint) has a source and a target resource and in the RM client are the connectors between the devices. Each route is delimited by {} and has 2 resources separated by space and another value for the sharing (specify the word "shared" for a shared route). If no sharing value is specified then the route will be considered not shared. The routes argument value should be included in double quotes. routes input examples: Example 1. "{TG/IXIA/XM12_02:11/15 Ciena_3930-11:9} {Ciena_3930-11:11 PE12:ge-1/3/1 shared} {Ciena_3960-11:11 PE11:xe-4/0/0} {Ciena_3960-11:7 TG/IXIA/XM12_02:11/16}" Example 2 with dual media ports "{TG/Spirent/STC_01:4/1/copper Ciena_3960-14:1/copper}" |
| Argument | Description |
|---|---|
| reservationName | The name/description of the reservation. Note that multiple reservations with the same name can be added in RM. The difference is the reservation id. |
| reservationDuration | Duration in minutes of the reservation |
| reservationUser | The user who is making the reservation. This has to be provisioned in the QS Resource Manager DB prior to running the script. Should be the same username used at the logon. |
| topologyFullPath | The full path of the topology which you want to load. This has been previously built in the RM GUI. |
| Argument | Description |
|---|---|
| user | The user must be present in the RM DB with access to the desired domain |
| password | |
| domain | Domain where user has access |
| Argument | Description |
|---|---|
| reservationId | The id of the reservation returned by the create_reservation command |
| Argument | Description |
|---|---|
| reservationId | The id of the reservation returned by the create_reservation command |
| routes | Route to be disconnected (space separated values) E.g. "{TG/IXIA/XM12_02:11/15 Ciena_3930-11:9} {Ciena_3930-11:11 PE12:ge-1/3/1}" |
| Argument | Description |
|---|---|
| reservationId | The reservation id returned in the create_reservation command. |
| Argument | Description |
|---|---|
| resourceId | The resource id it has the same format as in the "create_reservation" command / "routes" parameter. However only the "parent" resource is specified Examples: TG/IXIA/XM12_02 TG/Spirent/STC_01 Ciena_3930-11 Ciena_3930-11 PE12 |
| Argument | Description |
|---|---|
| routes | |
| juniperRouters |


Xmake is a lightweight modern C/C++ project build tool based on Lua. Its main features are: easy to use syntax, more readable project maintenance, and a consistent build experience across platforms.
This article mainly explains the installation process of xmake under various platforms.
Install the Master version
Usually we only need to install the script with a one-click installation script.
Using curl
Bash <(curl -fsSL https://raw.githubusercontent.com/tboox/xmake/master/scripts/get.sh)
Using wget
Bash <(wget https://raw.githubusercontent.com/tboox/xmake/master/scripts/get.sh -O -)
Using powershell
Invoke-Expression (Invoke-Webrequest 'https://raw.githubusercontent.com/tboox/xmake/master/scripts/get.ps1' -UseBasicParsing).Content
Note: If the ps script execution prompt fails, you can try to execute in administrator mode.
Install Windows version
Using the installation package
Windows provides a pre-made nsis installation package, we can download the installation package directly from github’s Releases download page.
- Download the windows installation package from [Releases] (https://github.com/xmake-io/xmake/releases)
- Run the installer xmake-[version].exe
Using scoop
Scoop install xmake
MacOS
$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
$ brew install xmake
or:
- Download the pkg installation package from [Releases] (https://github.com/xmake-io/xmake/releases)
- Double click to run
Or install the master version:
# Install the master version using homebrew
$ brew install xmake --HEAD
# or directly call the shell to download and install
$ bash <(curl -fsSL https://raw.githubusercontent.com/tboox/xmake/master/scripts/get.sh)
Linux
Install on archlinux:
$ yaourt xmake
Or download the deb package to install:
- Download the deb installation package from [Releases] (https://github.com/xmake-io/xmake/releases)
- Run:
dpkg -i xmake-xxxx.deb
Termux
The latest version of xmake already supports termux well, and we usually only need to execute the above one-click installation script. If it fails, please refer to the following to pull the source code to compile and install.
Source compilation and installation
Installation
Note: Remember, xmake is not recommended to install under root, so try not to pull down the source to compile and install!
$ git clone --recursive https://github.com/xmake-io/xmake.git
$ cd ./xmake
$ ./scripts/get.sh __local__
$ source ~/.xmake/profile
If you think the source of github is too slow, you can pull it through gitee’s image source: clone --recursive https://gitee.com/tboox/xmake.git
Note: Since the current xmake source maintains dependencies via git submodule, you need to add the --recursive
parameter to pull all submodules at the same time. Please do not download the tar.gz source directly, because github does not automatically package submodules. Code.
If you forget to add --recursive
when git clone, you can also execute git submodule update --init
to pull all submodules, for example:
$ git clone https://github.com/xmake-io/xmake.git
$ cd ./xmake
$ git submodule update --init
$ ./scripts/get.sh __local__
Note: ./get.sh __local__
is installed to ~/.local/xmake
, and then loaded by source ~/.xmake/profile
, so after the installation, the current terminal fails to execute xmake, If the prompt is not found, manually execute source ~/.xmake/profile
, and the next time you open the terminal, you don’t need it.
Uninstall
$ ./scripts/get.sh __uninstall__
Just update the installation lua script
This developer needs to debug the xmake source locally:
$ ./scripts/get.sh __local__ __install_only__
Root installation
Xmake is not recommended for root installation, because this is very insecure. If the user has to download the root, if the prompt xmake fails to run, please pass the --root
parameter as prompted or set XMAKE_ROOT=y
. The environment variable is forcibly enabled, provided that the user needs to pay attention to the risk of incorrect operating system file files under root.
Dependency issues
- If you encounter problems with readline, please install readline-devel or libreadline-dev dependencies. This is optional. It is only needed when the
xmake lua
command executes REPL. - If you want to speed up compilation, you can install ccache, xmake will automatically detect and use, which is also optional.
Other installation methods
Note: This is also the source code compilation and installation, but the installation path will be directly written to /usr/
, which requires root privileges, so unless special circumstances, this installation method is not recommended, it is recommended to use the ./get. Sh __local__
way to install, the installation path of the two installation methods is different, do not mix.
Compile and install via make:
$ make build; sudo make install
Install to other specified directories:
$ sudo make install prefix=/usr/local
Uninstall:
$ sudo make uninstall
Update Upgrade
Starting with v2.2.3, the xmake update
command has been added to quickly update and upgrade itself. The default is to upgrade to the latest version. Of course, you can also specify to upgrade or roll back to a version:
$ xmake update 2.2.4
We can also specify an update to the master/dev branch version:
$ xmake update master
$ xmake update dev
Update from the specified git source
$ xmake update github:xmake-io/xmake#master
$ xmake update gitee:tboox/xmake#dev # gitee mirror
If xmake/core hasn’t moved, just update the xaake lua script changes, you can add -s/--scriptonly
to quickly update the lua script.
$ xmake update -s dev
Finally, if we want to uninstall xmake, it is also supported: xmake update --uninstall


This demo will showcase functionality that will allow the creation of video chapters. A chapter consists of a title, source, start time, and end time. When a chapter is opened it will change the HTML5 video element's source to the chapter's source, seek to the start time, then play to the end time.
To add a chapter, click the "Toggle Chapter Add" button, input the chapter information in the form, then click the "Add Chapter" button. The table of contents to the right will display all chapters. Click on the title link to open a chapter. Alternatively, click "Play All" to play all chapters sequentially.


Internet Security Systems
Server Bezel
Bezels to help the ISS servers stand amid black and gray server rooms.
ISS iconography
Using three dimenmensional icons show the ISS ecosystem.
ISS Brochure
Printed and digital materials ranging from one page flyers, brochures, and advertisements


Amanda Tarr
Unafffiliated
Speech-Language Pathologist and Therapy Supervisor, Platte Valley Medical Center (SCL Health)
B.S. - Northwestern University, Speech and Hearing Sciences M.S. - Portland State University, Speech Pathology Colorado license as a speech-language pathologist CCC-SLP from American Speech and Hearing Association
80204
Hillary Clinton - 2016 ActBlue 2020 Elizabeth Warren 2019-20 Joe Biden 2020
Colorado Speech-Language-Hearing Association (CSHA) 2017-2020
As VP of Public Policy, President and Past President of CSHA, I have represented the speech-language pathologists and audiologists in the state of Colorado. I have worked with our lobbyist and local legislators to pass bills relevant to our profession. I have helped organize our annual conference and attend monthly Board meetings. I have also represented our state organization at national conferences.
I feel that independent and non-partisan redistricting is imperative to upholding the integrity of our voting system. Districts have been historically drawn to favor one party or another, which has skewed voting results and tends to be unfair to lower income neighborhoods, especially those whose residents are of color. Voting is an American right and should be as fair and balanced as possible.
As an unaffiliated voter, I am not particular to either party. Although I tend to vote one way, I do not identify as a member of any party member. I am so passionate about voting districts being logical and non-partisan that I will scrutinize things rationally and impartially. I will use that logic to share my opinions with the group and hopefully help see my point. This committee was voted upon by the people of Colorado for that exact purpose.
In my job as operations supervisor, I have to solve unexpected problems and difficulties every day. I look at the problem, determine possible solutions and conclude which would be most fair and efficient. I often discuss possible solutions with a colleague (or colleagues) to get input and arrive at a consensus based solution.
Female


Greetings! I am Jenn, and I truly believe introductions are one of the most awkward things ever. But, since it is helpful to learn about people, I shall have one. Click links below to view sections.
TLDR: Was in the mental health field, but providing therapy is definitely not for me. Like you other 90's kids, I played with html back in middle school. So here I am trying to revisit and expand on those dead and lost skills.
| Education | Experience | Publications | Miscellaneous | Favorites |
After getting my doctorates, I felt like taking on another challenge to expand my set of skills even more. Throughout my academic career, I realized I enjoyed most of the data crunching and running statistical programs. I really found the "behind-the-scenes" work exciting, and heard that a coding career would encompass a similar type of workstyle. Back in middle school, I would design layouts for websites for free website platforms, such as geocities, angelfire, xanga, and myspace. Unfortunately, these were all deleted, and I lost my portfolio of work, in addition to my passion to continue coding back then. Now that I'm older, and heard of a possibility to regain the skills I once had (and learn a breadth and depth of much more!), I decided to take the opportunity.
In terms of my academic career, my research interests included studying the experiences of those underrepresented in STEM fields. I always admired those who were able to take on the challenge of being in a place that they may not felt they belonged in, especially how they navigated barriers and persevered. As I'm entering my life into a career, I think that being able to be in the tech industry would achieve one of my goals I've always had.
return to topGiven such a long time I've been in academia, please see below for some of the papers I published duriing my academic career.
Some of my current interests include trying to gain more understanding of full-stack development. I'm interested in broadening my knowledge to learn of the powerful tools a developer has in creating their space in the web. On another note, my first pet I ever had was a hamster, and its name was Zsa Zsa. It was so cute, but its lifespan was only about 2 years. Afterwards, I never had a pet because of the heartbreak of losing one /sadface. I also enjoy food. Food is a necessity, and when I say food, I mean all kinds of food. I especially love spicy food! Szechuan handpulled noodles are one of my favorites. In terms of what I do to pass time, I like to browse youtube for cute animals. Please check out this Cat Spa for a way to fall asleep and relax.
return to topSparks is referred to me by "oppa" or the ugly pet name "bby". He is my favorite person in the whole wide world. Also the person who inspired me to go into coding. While he may be a pain in the butt sometimes, he treats me well and I wouldn't ask for anything else!
On the picture to the right, you can see him holding our child named Jasmine.
Some of the things I enjoy doing most are:


Shop
Donate
Payment
Payment Successfull!
Your purchase successfully went through. Thank you for your business with the PTSA!
Heads up!
PTSA payments must be done directly with PTSA. Clicking the button will take you to the PTSA page to log in and pay.
Log In
$3.00
Pencils
Short description of PTSA product would go here and include brief details about the product.
$25.00
Polos
Short description of PTSA product would go here and include brief details about the product.
$30.00
Pants
Short description of PTSA product would go here and include brief details about the product.
$20.00
Baseball Caps
Short description of PTSA product would go here and include brief details about the product.
$2.00
Stickers
Short description of PTSA product would go here and include brief details about the product.
$4.00
Keychains
Short description of PTSA product would go here and include brief details about the product.


@(user: models.User) @* Administrator Dashboard -- provides a menu for admins to manage different parts of the system. *@ @stylesheets = { } @javascripts = { } @main("Admin Dashboard - Careers From Here")(stylesheets)(javascripts)(user) {
Click here to:


@import play.filters.csrf.CSRF.Token @(viewerUrl: String, actualUrl: String, previewEnv: String, composerUrl: String, proxyBase: String, path: String, googleTrackingId: String, csrfToken: Option[Token]) @main("Viewer", googleTrackingId) { @if(previewEnv == "preview") { DRAFT } else { @previewEnv } Mobile web Get app preview link @if(previewEnv == "preview") { Having trouble? Try this Social share Copy taste Mobile checked & verified Desktop Block ads } else { Social share Desktop View on theguardian.com } Print version @if(previewEnv == "preview") { To enable desktop preview you need to check and verify mobile first } Copy taste presents you with a distraction free view of the article content. If you have any feedback please email the Digital CMS team


Posted by moiling on June 10, 2019
Posted by moiling on May 6, 2019
Posted by moiling on May 1, 2019
Posted by moiling on April 21, 2019
Posted by moiling on April 11, 2019
Posted by moiling on April 9, 2019
超级喜欢「用」计算机画画～ 目前正「一生悬命」学习中！


Back To Article
Let me Pop up
Here i am
×
Thank to pop me out of that button, but now i'm done so you can close this window.


In this tutorial, I am going to use the Spray-Client, DataStacks Cassandra driver and Akka to build an application that downloads tweets and then stores their id, text, name and date in a Cassandra table.It shows you how to build a simple Akka application with just a few actors, how to use Akka IO to make HTTP requests, and how to store the data in Cassandra. It also demonstrates approaches to testing of such applications, including performance tests.
Learn how to construct Akka-based command-line applications;how to test them (using TestKit)and Specs2; and how to use Spray-Client to make asynchronous HTTP requests.
I begin by constructing the core of our system. It contains three actors two that interact with the tweet database and one that downloads the tweets. The TwitterReadActor
reads from the Cluster
, the TweetWriteActor
writes into the Cluster
, and the TweetScanActor
downloadsthe tweets and passes them to the TweetWriteActor
to be written. These dependencies are expressed in the actors' constructors
class TweetReadActor(cluster: Cluster) extends Actor {
...
}
class TweetWriterActor(cluster: Cluster) extends Actor {
...
}
class TweetScanActor(tweetWrite: ActorRef, queryUrl: String => String) extends Actor {
...
}
The constructor parameter of the read and write actors is just the Cassandra Cluster
instance; the scan actor takes an ActorRef
of the write actor and a function that given a String
query can construct the query URL to download the tweets. (This is how I construct keyword searches, for example.)
To construct our application, all we need to do is to instantiate the actors in the right sequence
val system = ActorSystem()
def queryUrl(query: String): String = ???
val cluster: Cluster = ???
val reader = system.actorOf(Props(new TweetReaderActor(cluster)))
val writer = system.actorOf(Props(new TweetWriterActor(cluster)))
val scanner = system.actorOf(Props(new TweetScannerActor(writer, queryUrl)))
I shall leave the implementation of cluster
and queryUrl
as ???
the kink in the chain, logical inconsistency in otherwise perfect system, a.k.a. the bottom type.
Now that we have the structure in place, we can take a look at the TwitterWriterActor
. It receives instances of Tweet
, which it writes to the tweets
keyspace in Cassandra.
class TweetWriterActor(cluster: Cluster) extends Actor {
val session = cluster.connect(Keyspaces.akkaCassandra)
val preparedStatement = session.prepare("INSERT INTO tweets(key, user_user, text, createdat) VALUES (?, ?, ?, ?);")
def receive: Receive = {
case tweets: List[Tweet] =>
case tweet: Tweet =>
}
}
To save the tweets, we need to connect to the correct keyspace, which gives us the Cassandra Session
. Because we try to be as efficient as possible, we will take advantage of Cassandra's PreparedStatement
s and BoundStatement
s. The PreparedStatement
is a pre-chewed CQL statement, a BoundStatement
is a PreparedStatemnt
whose parameter values are set.
So, this gives us the hint of the what the saveTweet
function needs to do.
class TweetWriterActor(cluster: Cluster) extends Actor {
val session = cluster.connect(Keyspaces.akkaCassandra)
val preparedStatement = session.prepare("INSERT INTO tweets(key, user_user, text, createdat) VALUES (?, ?, ?, ?);")
def saveTweet(tweet: Tweet): Unit =
session.executeAsync(preparedStatement.bind(tweet.id.id, tweet.user.user, tweet.text.text, tweet.createdAt))
def receive: Receive = {
case tweets: List[Tweet] =>
case tweet: Tweet =>
}
}
The only thing that remains to be done is to use it in the receive
partial function.
class TweetWriterActor(cluster: Cluster) extends Actor {
val session = cluster.connect(Keyspaces.akkaCassandra)
val preparedStatement = session.prepare("INSERT INTO tweets(key, user_user, text, createdat) VALUES (?, ?, ?, ?);")
def saveTweet(tweet: Tweet): Unit =
session.executeAsync(preparedStatement.bind(tweet.id.id, tweet.user.user, tweet.text.text, tweet.createdAt))
def receive: Receive = {
case tweets: List[Tweet] => tweets foreach saveTweet
case tweet: Tweet => saveTweet(tweet)
}
}
So, we have code that saves instances of Tweet
to the keyspace in our Cassandra cluster.
Reading the data is ever so slightly more complex we would like to support the count and find all operations. Then, we need to be able to construct Cassandra queries; then, given a Cassandra Row
, we need to be able to turn it into our Tweet
object. Naturally, we also want to take advantage of the asynchronous nature of the Cassandra driver. Luckily, things won't be that complex. Let me begin with the structure of the TweetReaderActor
.
object TweetReaderActor {
case class FindAll(maximum: Int = 100)
case object CountAll
}
class TweetReaderActor(cluster: Cluster) extends Actor {
val session = cluster.connect(Keyspaces.akkaCassandra)
val countAll = new BoundStatement(session.prepare("select count(*) from tweets;"))
def receive: Receive = {
case FindAll(maximum) =>
// reply with List[Tweet]
case CountAll =>
// reply with Long
}
}
In the companion object, I have defined the FindAll
and CountAll
messages that our actor will react to; I have also left in the code that gives us the Session
and then used the Session
to construct a BoundStatement
that counts all rows. Next up, we need to be able to construct an instance of Tweet
given a Row
.
class TweetReaderActor(cluster: Cluster) extends Actor {
...
def buildTweet(r: Row): Tweet = {
val id = r.getString("key")
val user = r.getString("user_user")
val text = r.getString("text")
val createdAt = r.getDate("createdat")
Tweet(id, user, text, createdAt)
}
...
}
Again, nothing too dramatic we simply pick the values of the columns in the row and use them to make an instance of Tweet
. Now, let's wire in the Cassandra magic. We would like to execute (asynchronously) some query; map the rows returned from that query execution to turn them into the tweets; and then pipe the result to the sender. (The italic text gives plenty of hints, so let's just get the code in.)
class TweetReaderActor(cluster: Cluster) extends Actor {
val session = cluster.connect(Keyspaces.akkaCassandra)
val countAll = new BoundStatement(session.prepare("select count(*) from tweets;"))
import scala.collection.JavaConversions._
import cassandra.resultset._
import context.dispatcher
import akka.pattern.pipe
def buildTweet(r: Row): Tweet = {...}
def receive: Receive = {
case FindAll(maximum) =>
val query = QueryBuilder.select().all().from(Keyspaces.akkaCassandra, "tweets").limit(maximum)
session.executeAsync(query) map(_.all().map(buildTweet).toList) pipeTo sender
case CountAll =>
session.executeAsync(countAll) map(_.one.getLong(0)) pipeTo sender
}
}
Let me dissect the FindAll
message handler. First, I construct the query
usingCassandra's QueryBuilder
. This is ordinary Cassandra code.
What follows is much more interesting I call the executeAsync
method on the session
,which returns ResultSetFuture
. Using implicit conversion in cassandra.resultset._
, I turn the ResultSetFuture
into Scala's Future[ResultSet]
. This allows me to use the Future.map
method to turn the ResultSet
into List[Tweet]
.
Calling session.executeAsync(query) map
expects as its parameter a function from ResultSet
to some type B
. In our case, B
is List[Tweet]
. The ResultSet
contains the method all()
, which returns java.util.List[Row]
. To be able to map
over the java.util.List[Row]
, we need to turn it into the Scala List[Row]
. To do so, we bring in the implicit conversions in scala.collection.JavaConversions
. And now, we can complete the parameter of the Future.map
function.
session.executeAsync(query) map(_.all().map(buildTweet).toList)
therefore gives us Future[List[Tweet]]
, which is tantalizingly close to what we need. We do not want to block for the result, and we are too lazy to use the onSuccess
function, because all that it would do is to pass on the result to the sender
. So, instead, we pipe the success of the future to the sender
That completes the picture, explaining the entire line session.executeAsync(query) map(_.all().map(buildTweet).toList) pipeTo sender
.
Before I move on, I need to explain where the Cluster
value comes from. Thinking about the system we are writing, we may need to have different values of Cluster
for tests and for the main system. Moreover, the test Cluster
will most likely need some special setup. Because I can't decide just yet, I'd simply define that there is a CassandraCluster
trait that returns the Cluster
; and to give implementations that do the right thing one that loads the configuration from the ActorSystem
's configuration, and one that is hard-coded to be used in tests.
trait CassandraCluster {
def cluster: Cluster
}
The configuration-based implementation and the test configuration differ only in the values they use to make the Cluster
instance.
// in src/scala/main
trait ConfigCassandraCluster extends CassandraCluster {
def system: ActorSystem
private def config = system.settings.config
import scala.collection.JavaConversions._
private val cassandraConfig = config.getConfig("akka-cassandra.main.db.cassandra")
private val port = cassandraConfig.getInt("port")
private val hosts = cassandraConfig.getStringList("hosts").toList
lazy val cluster: Cluster =
Cluster.builder().
addContactPoints(hosts: _*).
withCompression(ProtocolOptions.Compression.SNAPPY).
withPort(port).
build()
}
// in src/scala/test
trait TestCassandraCluster extends CassandraCluster {
def system: ActorSystem
private def config = system.settings.config
import scala.collection.JavaConversions._
private val cassandraConfig = config.getConfig("akka-cassandra.test.db.cassandra")
private val port = cassandraConfig.getInt("port")
private val hosts = cassandraConfig.getStringList("hosts").toList
lazy val cluster: Cluster =
Cluster.builder().
addContactPoints(hosts: _*).
withPort(port).
withCompression(ProtocolOptions.Compression.SNAPPY).
build()
}
This allows me to mix in the appropriate trait and get the properly configured Cluster
. But there's a little twist when it comes to tests for the tests, I want to have the cluster in a well-known state. To solve this, I create the CleanCassandra
trait that resets the Cluster
given by some CassandraCluster.cluster
.
trait CleanCassandra extends SpecificationStructure {
this: CassandraCluster =>
private def runClq(session: Session, file: File): Unit = {
val query = Source.fromFile(file).mkString
query.split(";").foreach(session.execute)
}
private def runAllClqs(): Unit = {
val session = cluster.connect(Keyspaces.akkaCassandra)
val uri = getClass.getResource("/").toURI
new File(uri).listFiles().foreach { file =>
if (file.getName.endsWith(".cql")) runClq(session, file)
}
session.shutdown()
}
override def map(fs: => Fragments) = super.map(fs) insert Step(runAllClqs())
}
When I mix in this trait into my test, it registers the runAllClqs()
steps to be executed before all other steps in the test.
And so, I can write my first test that verifies that the TwitterReaderActor
and TwitterWriterActor
indeed work as expected. The body of the test is rather long, but it is not too difficult to conceptually follow what is happening.
class TweetActorsSpec extends TestKit(ActorSystem())
with SpecificationLike with TestCassandraCluster with CleanCassandra with ImplicitSender {
sequential
val writer = TestActorRef(new TweetWriterActor(cluster))
val reader = TestActorRef(new TweetReaderActor(cluster))
"Slow & steady" >> {
def write(count: Int): List[Tweet] = {
val tweets = (1 to count).map(id => Tweet(id.toString, "@honzam399", "Yay!", new Date))
tweets.foreach(writer !)
Thread.sleep(1000) // wait for the tweets to hit the db
tweets.toList
}
"Single tweet" in {
val tweet = write(1).head
reader ! FindAll(1)
val res = expectMsgType[List[Tweet]]
res mustEqual List(tweet)
}
"100 tweets" in {
val writtenTweets = write(100)
reader ! FindAll(100)
val readTweets = expectMsgType[List[Tweet]]
readTweets must containTheSameElementsAs(writtenTweets)
}
}
}
We are mixing in a lot of components to assemble the test. First of all, we ar extending the TestKit
, giving it an ActorSystem()
as constructor parameter; we next mix in Specs2's SpecificationLike
, then our Cassandra test environment, completing the picture with the ImplicitSender
to allow us to examine the responses.
The actual body of the "Slow & steady"
specification verifies that we can write read single and 100 tweets.
Before you run the test, you must make sure that you have Cassandra running and that you've created the right keyspaces. To make your life easier, you can simply run the CQL scripts in src/data
. You need to run--in sequence
keyspaces.cql
Then, in the correct keyspace:
tables.cql
words.cql
Onwards Now that we know that we can safely store and retrieve the tweets from Cassandra, we need to write the component that is going to download them. In our system, this is the TweetScannerActor
. It receives a message of type String
, and it performs the HTTP request to download the tweets. (To keep this tutorial simple, I'm using the convenient Twitter proxy at "http//twitter-search-proxy.herokuapp.com/search/tweets. In any case, the task for the scanner actor is to construct the HTTP request, receive the response, turn it into List[Tweet]
and send that list to the ActorRef
of the TweetWriterActor
.
class TweetScannerActor(tweetWrite: ActorRef, queryUrl: String => String)
extends Actor with TweetMarshaller {
import context.dispatcher
import akka.pattern.pipe
private val pipeline = sendReceive ~> unmarshal[List[Tweet]]
def receive: Receive = {
case query: String => pipeline(Get(queryUrl(query))) pipeTo tweetWrite
}
}
It is actually that simple We use Spray-Client to construct the HTTP pipeline, which makes HTTP request (sendReceive
), and passes the raw HTTP response to be unmarshalled (that is, turned into instance of types in our systems).
The pipeline
starts its job when it is applied to HttpRequest
; in our case, Get(url: String)
represents a mechanism that can construct such HttpRequest
s. When applied to the query
, the function queryUrl
returns the actual URL for the pipeline to work on.
Execution of the pipeline
returns Future[List[Tweet]]
, which we can happily pipeTo
the tweetWrite
actor.
The only job that remains is for us to implement the unmarshaller. In Spray-Client's case unmarshaller is a typeclass and the implementation is an instance of the typeclass. The easiest way to think about typeclasses is to imagine that typeclass is a trait which defines behaviour for some type, and that the typeclass instance is the implementation of that trait for some type.
In Spray-Client's case, the typeclass is trait Unmarshaller[A]
, whose apply
method takes HttpEntity
and returns Deserialized[A]
. The name apply
should ring some bells--and indeed, Unmarshaller[A]
is in essence an alias for trait Unmarshaller[A] extends (HttpEntity => Deserialized[A])
. (Yes, you can extend (A = B) in Scala, which is syntactic sugar for trait Unmarshaller[A] extends Function1[HttpEntity, Deserialized[A]]
.) Now, the unmarshal
directive we used earlier is defined as
def unmarshal[A : Unmarshaller]: HttpResponse => A
The : Unmarshaller
is a context bound on the type parameter A
, which causes the compiler to expand the function into
def unmarshal[A](implicit ev: Unmarshaller[A]): HttpResponse => A
The unmarshal
function expects an instance of the typeclass Unmarshaller
for some type A
; in our case, we specify the type A
to be List[Tweet]
. We can make a mental substitution of A
for List[Tweet]
and arrive at unmarshal[List[Tweet]](implicit ev: Unmarshaller[List[Tweet]]): ...
. To make the application work, there needs to be a value of type Unmarshaller[List[Tweet]]
in the current implicit scope. When we give such value, we say that we are giving instance of the Unmarshaller
typeclass.
trait TweetMarshaller {
type Tweets = List[Tweet]
implicit object TweetUnmarshaller extends Unmarshaller[Tweets] {
val dateFormat = new SimpleDateFormat("EEE MMM d HH:mm:ss Z yyyy")
def mkTweet(status: JsValue): Deserialized[Tweet] = {
val json = status.asJsObject
...
}
def apply(entity: HttpEntity): Deserialized[Tweets] = {
val json = JsonParser(entity.asString).asJsObject
...
}
}
}
Our typeclass instance is the TweetUnmarshaller
singleton, which extends Unmarshaller[Tweets]
. Notice that I have also defined a type alias type Tweets = List[Tweet]
so that I don't have to write too many square brackets. By extending Unmarshaller[Tweets]
, we must implement the apply
method, which is applied to the HttpEntity
and should return either deserialized tweets or indicate an error.
We nearly have everything in place. But how do we satisfy ourselves that the TweetScannerActor
indeed works?
TweetScannerActor
To test the scanner fully, we would like to use a well-known service. But where do we get it? We can't really use the live service, because the tweets keep changing. It seems that the only way would be for us to implement a mock service and use it in our tests.
class TweetScanActorSpec extends TestKit(ActorSystem())
with SpecificationLike with ImplicitSender {
sequential
val port = 12345
def testQueryUrl(query: String) = s"http://localhost:$port/q=$query"
val tweetScan = TestActorRef(new TweetScannerActor(testActor, testQueryUrl))
"Getting all 'typesafe' tweets" >> {
"should return more than 10 last entries" in {
val twitterApi = TwitterApi(port)
tweetScan ! "typesafe"
Thread.sleep(1000)
val tweets = expectMsgType[List[Tweet]]
tweets.size mustEqual 4
twitterApi.stop()
success
}
}
}
When constructing the TweetScannerActor
, we give it the testActor
and a function that returns URLs on localhost
on some port
. In the body of the example, we start the mock TwitterApi
on the given port; and use our TweetScannerActor
to make the HTTP request. Because we gave the testActor
as the writer ActorRef
, we should now be able to see the List[Tweet]
that would have been sent to the TweetWriterActor
.
Because our mock tweetset contains four tweets, we can make the assertion that the list indeed contains four tweets. (I leave more extensive testing as exercise for the reader.)
I am now satisfied that the components in the system work as expected; I can therefore assemble the App
object, which brings everything together in a command-line interface. I give you the Main
object
object Main extends App with ConfigCassandraCluster {
import Commands._
import akka.actor.ActorDSL._
def twitterSearchProxy(query: String) = s"http://twitter-search-proxy.herokuapp.com/search/tweets?q=$query"
implicit lazy val system = ActorSystem()
val write = system.actorOf(Props(new TweetWriterActor(cluster)))
val read = system.actorOf(Props(new TweetReaderActor(cluster)))
val scan = system.actorOf(Props(new TweetScannerActor(write, twitterSearchProxy)))
// we don't want to bother with the ``ask`` pattern, so
// we set up sender that only prints out the responses to
// be implicitly available for ``tell`` to pick up.
implicit val _ = actor(new Act {
become {
case x => println(">>> " + x)
}
})
@tailrec
private def commandLoop(): Unit = {
Console.readLine() match {
case QuitCommand => return
case ScanCommand(query) => scan ! query.toString
case ListCommand(count) => read ! FindAll(count.toInt)
case CountCommand => read ! CountAll
case _ => return
}
commandLoop()
}
// start processing the commands
commandLoop()
// when done, stop the ActorSystem
system.shutdown()
}
We have the main commandLoop()
function, which reads the line from standard input, matches it against the commands and sends the appropriate messages to the right actors. It also mixes in the "real" source of Cassandra Cluster
values and specifies the live function that constructs the URL to retrieve the tweets.
TwitterApi
The TwitterApi
is the mock version of the real Twitter Proxy API. It makes it easy to write repeatable and independent tests of the TweetScannerActor
. Under the hood, it is implemented using Spray-Can and the HTTP Akka Extension. The intention is that upon construction it binds to the given port and responds to every GET request with the given body. To shutdown the API, you must call the stop()
method. To give me greater control over the construction of the class, I define the constructor as private and give a companion object whose apply
method returns properly constructed and bound TwitterApi
.
class TwitterApi private(system: ActorSystem, port: Int, body: String) {
val blackHoleActor = system.actorOf(Props(new Actor {
def receive: Receive = Actor.emptyBehavior
}))
private class Service extends Actor {
def receive: Receive = {
case _: Http.Connected =>
sender ! Http.Register(self)
case HttpRequest(HttpMethods.GET, _, _, _, _) =>
sender ! HttpResponse(entity = HttpEntity(body))
case _ =>
}
}
private val service = system.actorOf(Props(new Service).withRouter(RoundRobinRouter(nrOfInstances = 50)))
private val io = IO(Http)(system)
io.tell(Http.Bind(service, "localhost", port = port), blackHoleActor)
def stop(): Unit = {
io.tell(Http.Unbind, blackHoleActor)
system.stop(service)
system.stop(io)
}
}
object TwitterApi {
def apply(port: Int)(implicit system: ActorSystem): TwitterApi = {
val body = Source.fromInputStream(getClass.getResourceAsStream("/tweets.json")).mkString
new TwitterApi(system, port, body)
}
}
Calling TwitterApi(1234)
with an implicit ActorSystem
in scope (for example in a TestKit
test) loads the body from a well-known location on the classpath and then constructs the TwitterApi
instance, passing it the ActorSystem
, port
, and body
. In the body of the TwitterApi
class, I have an Actor
that serves the HTTP requests, which is then used in the Bind
message sent to the io
extension.
The service is bound to the HTTP server until the stop()
method is called. The stop()
method unbinds the service
, and stops it and the io
extension.  I am trying to find if people are happy or unhappy about the tweets. To do so, I use a list of positive and negative words, which I store in my Cassandra positivewords
and negativewords
tables.


--- creation_epoch:<PHONE_NUMBER> lastmod_epoch:<PHONE_NUMBER> categories: ['Computer Problems'] title: Another thing to backup - Product Key Stickers on laptops --- So I was working on a family member's laptop. The Windows product key on the bottom had faded really bad to be almost unreadable. Some laptops have the product key under the battery where it won't get rubbed and faded so much, but most don't. The serial number was also pretty much gone although I have seen one netbook that actually protected the s/n with a clear coating. Another annoyance of product key activation having to worry about losing the key and thus having higher costs to fix something.
Short lesson is to make a backup of the entire bottom of your laptop to make sure you have everything even just 2 years down the road otherwise you may be stuck buying your OS again. I just make a scanned photocopy of the entire bottom.


PGM is a 1-channel ASCII image format. You can make a PGM file in GIMP.
Image editing overrides vectors. Click on a canvas to increase a pixel's luminosity. Click holding the Shift key to reduce it.
Only the outline is supported. No filling, no coloring.
| ← there's more. | + Github & Twitter & Hacker News |


Angular is as of 2018 one of the most popular JavaScript-based front-end web application framework.
Interestingly, it is also one of the JavaScript frameworks that depart the most from JavaScript and even ES6, because it uses TypeScript as the language of choice. Using TypeScript improves maintainability and efficiency by adding type checking, which allows compile-time error detection, and also possibly refactoring.
Because it is at the same time new, weird, and efficient, this makes Angular developers very demanded on the market.
The number of resources available on the web about Angular is tremendous, and so is the number of concepts that one has to master to be proficient at angular, so we will not even try to introduce or define any of those concepts here.
Instead, I will simply enumerate them a small quizz, that will allow fellow developers to assez how well they know the framework.


+38-057-340-03-12,
+(38)-057-340-33-70
Dr. Andrey V. Yanovsky
B. Verkin Institute for Low Temperature Physics & Engineering
47, Nauky Ave.
61103 Kharkiv UKRAINE
Graduated from Kharkov State University in 1996.
PhD Phys & Math, ILTPE, 2000.
Started work at ILTPE in 1996 as a post graduate, 1999- 2004 junior researcher, 2004 - 2008 researcher, from 2008 - senior researcher.
Research Area : Size-effects and kinetic properties of low-dimensional systems, spin transport phenomena, computer simulations. (See: Research group of R.N. Gurzhi, A.I. Kopeliovich, A.N. Kalinenko and A.V. Yanovskiy )