The document discusses several tools for Ruby on Rails development:
1. Konacha - A JavaScript testing framework for testing CoffeeScript or JavaScript in Rails applications.
2. SideKiq - Provides a way to run background jobs in Rails applications using Redis for fast performance.
3. SunSpot - Allows adding full-text search to Rails applications using the Solr search engine.
4. Sinatra - A DSL for quickly building Ruby web applications, including examples of basic routes and templates.
5. Foreman - A tool for managing multiple process types (web servers, workers, etc.) used in a Rails project using a single Procfile.
Leveraging Completable Futures to handle your query results AsynchrhonouslyDavid Gómez García
The challenges of developing applications recently have increased. With the popularity of cloud environments, the scalability required by new architectures and the need to support more load efficiently, there has been an increase in attention that we need to pay to concurrency and efficiency.
One strategy to achieve that efficiency consists of distributing the modules of your application in several different smaller components running concurrently. But one of the problems that arise from such distribution of running modules comes when you need to send a request (and wait for the response) to several different modules. How do you design that request(s)-response(s) to be as efficient as possible?
CompletableFutures was introduced with Java 8 but has evolved over the years with every new version of Java released. In this talk, we will take a look at it, to:
understand how to use CompletableFutures,
how they can help us to split our workload into different request and coordinate them asynchronously and concurrently
How you can chain behavior to the responses.
How you can use CompletableFuture in your design to create APIs that enable your users to get the most of your Component/library/module.
Testing Android apps based on Dagger and RxJava Droidcon UKFabio Collini
Writing reliable tests is not easy for many reasons, especially when asynchronous code is involved. Some libraries can be used to create a testable architecture (for example Dagger and RxJava) and to simplify testing (Mockito, AssertJ and DaggerMock). In this talk you'll learn how to write JVM and Espresso tests with particular attention on how to replace real objects with mocks and how to test asynchronous RxJava code. In this talk, you will also explore:
how to take advantage of Mockito and other libraries to write good JVM and Espresso tests in both Java and Kotlin
how to use DaggerMock (an open source library available on github to avoid boilerplate code in tests
how to test asynchronous RxJava code using a JVM test
Android brings to the table a whole new set of building blocks:. Each has its own unique properties. Building an app is mashing them together in a unique way. Often, there are multiple approaches to seemingly the same result. Knowing what component to use when is often a balance of art and science. In this talk, we’ll explore the main building blocks of Android: activities, services, providers, receivers as well as intents that glue them all together. We’ll learn about properties and variations of each. By the end of this talk, you should know how to write a straw-man implementation of basic building blocks, when to use them, and how to connect them together. This talk is based on Ice Cream Sandwich release of Android.
Leveraging Completable Futures to handle your query results AsynchrhonouslyDavid Gómez García
The challenges of developing applications recently have increased. With the popularity of cloud environments, the scalability required by new architectures and the need to support more load efficiently, there has been an increase in attention that we need to pay to concurrency and efficiency.
One strategy to achieve that efficiency consists of distributing the modules of your application in several different smaller components running concurrently. But one of the problems that arise from such distribution of running modules comes when you need to send a request (and wait for the response) to several different modules. How do you design that request(s)-response(s) to be as efficient as possible?
CompletableFutures was introduced with Java 8 but has evolved over the years with every new version of Java released. In this talk, we will take a look at it, to:
understand how to use CompletableFutures,
how they can help us to split our workload into different request and coordinate them asynchronously and concurrently
How you can chain behavior to the responses.
How you can use CompletableFuture in your design to create APIs that enable your users to get the most of your Component/library/module.
Testing Android apps based on Dagger and RxJava Droidcon UKFabio Collini
Writing reliable tests is not easy for many reasons, especially when asynchronous code is involved. Some libraries can be used to create a testable architecture (for example Dagger and RxJava) and to simplify testing (Mockito, AssertJ and DaggerMock). In this talk you'll learn how to write JVM and Espresso tests with particular attention on how to replace real objects with mocks and how to test asynchronous RxJava code. In this talk, you will also explore:
how to take advantage of Mockito and other libraries to write good JVM and Espresso tests in both Java and Kotlin
how to use DaggerMock (an open source library available on github to avoid boilerplate code in tests
how to test asynchronous RxJava code using a JVM test
Android brings to the table a whole new set of building blocks:. Each has its own unique properties. Building an app is mashing them together in a unique way. Often, there are multiple approaches to seemingly the same result. Knowing what component to use when is often a balance of art and science. In this talk, we’ll explore the main building blocks of Android: activities, services, providers, receivers as well as intents that glue them all together. We’ll learn about properties and variations of each. By the end of this talk, you should know how to write a straw-man implementation of basic building blocks, when to use them, and how to connect them together. This talk is based on Ice Cream Sandwich release of Android.
Redux saga: managing your side effects. Also: generators in es6Ignacio Martín
Explanation of redux-saga for its use in React and React Native. Contains an explanation about ES6 generators, used in sagas, with emphasis in generators to manage async code.
In this presentation speaker considered theoretical basics of using the redux-saga library, which was created for facilitating the organization of the so-called “side effects” (for example, asynchronous operations). The event participants obtained practical tips on using saga in real-life projects.
This presentation by Igor Nesterenko (Lead Software Engineer, Consultant, GlobalLogic, Kharkiv) was delivered at GlobalLogic Kharkiv JS TechTalk #2 on August 17, 2018.
In this talk we explain the basics of Typed Actors as they are to land in Akka as a stable module in 2018. Typed Actors ("Akka Typed") re-introduce typesafety to concurrency and distributed systems thanks to the abstraction of a typed actor reference.
Testing Android apps based on Dagger and RxJavaFabio Collini
In this talk, you will learn:
how to take advantage of Mockito and other libraries to write good JVM and Espresso tests
how to use DaggerMock (an open source library available on github https://github.com/fabioCollini/DaggerMock) to avoid boilerplate code in tests
how to test asynchronous RxJava code using a JVM test
Writing reliable tests is not easy for many reasons, especially when asynchronous code is involved. Some libraries can be used to create a testable architecture (for example Dagger and RxJava) and to simplify testing (Mockito, AssertJ and DaggerMock). In this talk we’ll see how to write JVM and Espresso tests with particular attention on how to replace real objects with mocks and how to test asynchronous RxJava code.
Compose is stable, it's time to integrate it into our apps! But it can be harder than expected and there are some questions to answer. Can the same architecture of a View-based app be reused or should we change it? Should the Compose code be aware of the architecture at all? And should the non UI code be changed to start using Compose? What can be replaced with a Composable, only the layouts or also something else?
Probably the best answer to all these questions is “it depends”, in this talk we’ll see some reasons and how to leverage Compose and the other tools to create a good architecture. Compose is more than just a UI framework and it can seem appealing to use it in a big portion of an app, a good architecture can be useful to limit this portion and use it only when necessary.
Lambdas and Streams Master Class Part 2José Paumard
These are the slides of the talk we made with Stuart Marks at Devoxx Belgium 2018. This second part covers the Stream API, reduction and the Collector API.
What is the state of lambda expressions in Java 11? Lambda expressions are the major feature of Java 8, having an impact on most of the API, including the Streams and Collections API. We are now living the Java 11 days; new features have been added and new patterns have emerged. This highly technical Deep Dive session will visit all these patterns, the well-known ones and the new ones, in an interactive hybrid of lecture and laboratory. We present a technique and show how it helps solve a problem. We then present another problem, and give you some time to solve it yourself. Finally, we present a solution, and open for questions, comments, and discussion. Bring your laptop set up with JDK 11 and your favorite IDE, and be prepared to think!
Redux saga: managing your side effects. Also: generators in es6Ignacio Martín
Explanation of redux-saga for its use in React and React Native. Contains an explanation about ES6 generators, used in sagas, with emphasis in generators to manage async code.
In this presentation speaker considered theoretical basics of using the redux-saga library, which was created for facilitating the organization of the so-called “side effects” (for example, asynchronous operations). The event participants obtained practical tips on using saga in real-life projects.
This presentation by Igor Nesterenko (Lead Software Engineer, Consultant, GlobalLogic, Kharkiv) was delivered at GlobalLogic Kharkiv JS TechTalk #2 on August 17, 2018.
In this talk we explain the basics of Typed Actors as they are to land in Akka as a stable module in 2018. Typed Actors ("Akka Typed") re-introduce typesafety to concurrency and distributed systems thanks to the abstraction of a typed actor reference.
Testing Android apps based on Dagger and RxJavaFabio Collini
In this talk, you will learn:
how to take advantage of Mockito and other libraries to write good JVM and Espresso tests
how to use DaggerMock (an open source library available on github https://github.com/fabioCollini/DaggerMock) to avoid boilerplate code in tests
how to test asynchronous RxJava code using a JVM test
Writing reliable tests is not easy for many reasons, especially when asynchronous code is involved. Some libraries can be used to create a testable architecture (for example Dagger and RxJava) and to simplify testing (Mockito, AssertJ and DaggerMock). In this talk we’ll see how to write JVM and Espresso tests with particular attention on how to replace real objects with mocks and how to test asynchronous RxJava code.
Compose is stable, it's time to integrate it into our apps! But it can be harder than expected and there are some questions to answer. Can the same architecture of a View-based app be reused or should we change it? Should the Compose code be aware of the architecture at all? And should the non UI code be changed to start using Compose? What can be replaced with a Composable, only the layouts or also something else?
Probably the best answer to all these questions is “it depends”, in this talk we’ll see some reasons and how to leverage Compose and the other tools to create a good architecture. Compose is more than just a UI framework and it can seem appealing to use it in a big portion of an app, a good architecture can be useful to limit this portion and use it only when necessary.
Lambdas and Streams Master Class Part 2José Paumard
These are the slides of the talk we made with Stuart Marks at Devoxx Belgium 2018. This second part covers the Stream API, reduction and the Collector API.
What is the state of lambda expressions in Java 11? Lambda expressions are the major feature of Java 8, having an impact on most of the API, including the Streams and Collections API. We are now living the Java 11 days; new features have been added and new patterns have emerged. This highly technical Deep Dive session will visit all these patterns, the well-known ones and the new ones, in an interactive hybrid of lecture and laboratory. We present a technique and show how it helps solve a problem. We then present another problem, and give you some time to solve it yourself. Finally, we present a solution, and open for questions, comments, and discussion. Bring your laptop set up with JDK 11 and your favorite IDE, and be prepared to think!
**********Evaluator.java****************
package evaluator;
import java.util.*;
import operand.Operand;
import operator.Operator;
public class Evaluator {
private Stack<Operand> operandStack;
private Stack<Operator> operatorStack;
private StringTokenizer tokenizer;
private static final String DELIMITERS = "+-*^/() ";
public Evaluator() {
operandStack = new Stack<Operand>();
operatorStack = new Stack<Operator>();
}
public int eval(String expression) {
int result = 0;
String token;
Operator hashOpr = Operator.operators.get("#");
oprStack.push(hashOpr);
String delimiters = "+-*/#!";
// The 3rd argument is true to indicate that the delimiters should be used
// as tokens, too. But, we'll need to remember to filter out spaces.
this.tokenizer = new StringTokenizer(expression, DELIMITERS, true);
while (this.tokenizer.hasMoreTokens()) {
// filter out spaces
if (!(token = this.tokenizer.nextToken()).equals(" ")) {
// check if token is an operand
if (Operand.check(token)) {
operandStack.push(new Operand(token));
} else {
if (!Operator.check(token)) {
System.out.println("*****invalid token******");
System.exit(1);
}
// TODO Operator is abstract - this line will need to be fixed:
// ( The Operator class should contain an instance of a HashMap,
// and values will be instances of the Operators. See Operator class
// skeleton for an example. )
Operator newOperator = null; // new Operator( token );
while (operatorStack.peek().priority() >= newOperator.priority()) {
// note that when we eval the expression 1 - 2 we will
// push the 1 then the 2 and then do the subtraction operation
// This means that the first number to be popped is the
// second operand, not the first operand - see the following code
Operator oldOpr = operatorStack.pop();
Operand op2 = operandStack.pop();
Operand op1 = operandStack.pop();
operandStack.push(oldOpr.execute(op1, op2));
}
operatorStack.push(newOperator);
}
}
}
// Control gets here when we've picked up all of the tokens; you must add
// code to complete the evaluation - consider how the code given here
// will evaluate the expression 1+2*3
// When we have no more tokens to scan, the operand stack will contain 1 2
// and the operator stack will have + * with 2 and * on the top;
// In order to complete the evaluation we must empty the stacks (except
// the init operator on the operator stack); that is, we should keep
// evaluating the operator stack until empty
// Suggestion: create a method that takes an operator as argument and
// then executes the while loop; also, move the stacks out of the main
// method
return 0;
}
/**
* Class to help test your Evaluator:
* javac EvaluatorTester
* java EvaluatorTester "1+2" "3*5"
*/
public static void main(String[] args) {
Evaluator evaluator = new Evaluator();
for (String arg : args) {
System.out.format("%s = %d\n", arg, evaluator.eval(arg));
}
}
}
************************************Operand.Java**************************************************
package operand;
public class Operand {
public .
Java9 Beyond Modularity - Java 9 más allá de la modularidadDavid Gómez García
These are the slides I used for my "Java 9 beyond modularity" at several different local meetups and conferences in Spain during 2017
Java 9 is about to reach its public release scheduled for September 2017. If we ask what are the new features that this new version will include, probably the first that comes to our head is modularity.
But java 9 brings with a lot of features beyound Jigsaw, JPMS or modularity. In this talk we will talk about at least 9 other new features that include this new version of Java that are interesting and maybe will end up being more used than the modularity itself for those who embrace the new version.
Those are changes that come to complement and improve even more the set of new tools (like Streams, Optionals, etc...) that Java 8 brought to us.
We'll take a look at small changes in language syntax (such as new ways of using try-with-resources), changes in Collections APIs and Streams, new tools like VarHandles, new APIs such as the Flow API, and As we allow the inclusion of reactive programming with Java.
Do you want to see in Java 9 beyond modularity? Do you want to have a more complete view of what you can provide? Let's take a look toghether!
Part presentation, part debate about the future of the language while touching base on the current state of the industry with respect to ES6/ES2015, and the possibilities of using it today in web applications and frameworks, the different options, and the things to keep in mind. Additionally, we will do a walk-through on the new features included in ES7/ES2016 draft, and those that are being discussed for ES8/ES2017.
Workshop JavaScript Testing. Frameworks. Client vs Server Testing. Jasmine. Chai. Nock. Sinon. Spec Runners: Karma. TDD. Code coverage. Building a testable JS app.
Presentado por ing: Raúl Delgado y Mario García
…or how to play with EcmaScript shortcoming.
This talk discuss about how I implemented a clear, elegant, succinct and safe syntax to do Pattern Matching in modern JavaScript.
As present at FluentConf 2014 on March 11th, 2014.
AngularJS is one of the most popular, and powerful, JavaScript frameworks for building rich client-side applications. AngularJS is both simultaneously both simple to use and extremely full featured. With AngularJS a little goes a long way, but to make the most of it, you need to know what you’re doing.
In this workshop we will build a complex application to help exercise all of the salient points of the AngularJS framework.
Topics covered include, ngResource, directives, fitlers, routing, templates, controllers, testing, and more.
Code can be found at: https://github.com/markbates/fluent-2014
Presented at LA Ruby Conf on February 8th, 2014. A high level overview of Go, golang, and how it relates to Ruby. Packages such as Martini, Lineman.js, sqlx, Ginkgo, and more are covered.
Presented at RubyConf 11/10/2013
Introduced in Ruby 2.0, TracePoint is meant to help developers better instrument their code for debugging and performance reasons, but there's more to TracePoint than that!
In this talk we'll learn about TracePoint while building several example projects. Once we know the basics we'll use TracePoint to do things to Ruby that we couldn't have done otherwise.
By the end of this talk you'll be able to frighten and amaze your friends when you show them things like true abstract classes and interfaces in Ruby, just like Java! Yikes!
The world of JavaScript client-side frameworks is overflowing with contenders vying for the crown, but which one do you choose for your next project? Which one has what it takes?
In this talk we’ll look at the “Big 3”, AngularJS, Ember.js, and Backbone.js. We’ll compare them head to head, toe to toe. We’ll look at the pros and cons of each one. How do they handle form bindings? Talking to APIs? Code organization? Routing? Etc?
Who’ll come out victorious in this battle of the JavaScript frameworks, or will we all just come out bloodied and bruised on the other side? Guess we’ll find out!
Presented at Confoo (Montreal, Cananda)
Let's spend some time seeing how easy it can be to set up Mocha and Chai, a testing framework for JavaScript/CoffeeScript, in your application. We'll learn how to test that our jQuery or Backbone code is doing what it supposed to. It's really not as hard as you think it might be.
Presented at Confoo (Montreal, Canada) on 3/1/2013
In this talk I’ll show you how to build your application and get a working, well tested, and useable API in the process, with almost no extra overhead. I’ll also show you how to do it without making your controllers a mess of respond_to blocks. If anything, you’re controllers will become cleaner and leaner.
Presented on 8/14/2012 at BostonRb. This talk provides a nice intro and overview of what RubyMotion is and whether or not it's worth incorporating into your development toolkit.
Testing JavaScript/CoffeeScript with Mocha and ChaiMark
Presented at the Burlington Ruby Conference on July 28th.
Learn just how easy it is to test your JavaScript and CoffeeScript code. Don't be scared by events, DOM interactions, or AJAX requests any more!
Testing your JavaScript and/or CofffeeScript applications is not nearly as difficult as you think. Learn how to quickly setup Jasmine in your Rails application and start testing your *script applications now!
A fun filled tour through distributed programming with the Ruby standard library.
Presented on February 2nd, 2012 at RubyFuza in Cape Town, South Africa.
Distributed Programming with Ruby/Rubyconf 2010Mark
This talk will guide you through the various different aspects of building distributed applications with Ruby. While this talk will not do a deep dive into any technology we will look at libraries that ship with Ruby, such as DRb and Rinda, as well as other 3rd party libraries that are available, during the discussion and examples. We'll talk about remote method invocation (RMI), message queues, asynchronous tasks, map reduce, and background jobs, just to name a few. The discussion will include what those terms all mean and when and where you may want to use a particular technology.
5. 1. Konacha
http://www.metacasts.tv
PROJNIGHT213
Thursday, February 7, 13
6. JavaScript/CoffeeScript
testing for Rails
http://www.metacasts.tv
PROJNIGHT213
Thursday, February 7, 13
7. CoffeeScript JavaScript
describe
"Calculator",
-‐> describe("Calculator",
function()
{
beforeEach
-‐>
beforeEach(function()
{
@calculator
=
new
Calculator()
this.calculator
=
new
Calculator();
});
context
"add",
-‐>
context("add",
function()
{
it
"adds
two
numbers",
-‐>
@calculator.add(2,
2).should.eql(4)
it("adds
two
numbers",
function()
{
this.calculator.add(2,
2).should.eql(4);
context
"null
numbers",
-‐>
});
it
"throws
an
exception",
-‐>
context("null
numbers",
function()
{
expect(=>
@calculator.add(1,
null)
it("throws
an
exception",
function()
{
).to.throw(NullNumberError)
var
_this
=
this;
expect(function()
{
_this.calculator.add(1,
null);
}).to["throw"](NullNumberError);
});
});
});
});
http://www.metacasts.tv
PROJNIGHT213
Thursday, February 7, 13
8. More Info
https://github.com/jfirebaugh/konacha
http://visionmedia.github.com/mocha/
http://chaijs.com/
http://www.metacasts.tv/casts/unit-testing-javascript-in-rails
http://www.metacasts.tv
PROJNIGHT213
Thursday, February 7, 13
9. 2. SideKiq
http://www.metacasts.tv
PROJNIGHT213
Thursday, February 7, 13
10. Super fast
background workers
http://www.metacasts.tv
PROJNIGHT213
Thursday, February 7, 13
11. class
MyWorker
include
Sidekiq::Worker
sidekiq_options
unique:
true
def
perform(some_attributes)
#
do
some
work
here
end
end
MyWorker.perform_async(some_attributes)
http://www.metacasts.tv
PROJNIGHT213
Thursday, February 7, 13
13. More Info
http://sidekiq.org/
https://github.com/mperham/sidekiq
http://www.metacasts.tv
PROJNIGHT213
Thursday, February 7, 13
14. 3. SunSpot
http://www.metacasts.tv
PROJNIGHT213
Thursday, February 7, 13
15. Simple full-text
search using Solr
http://www.metacasts.tv
PROJNIGHT213
Thursday, February 7, 13
16. class
Post
<
ActiveRecord::Base
searchable
do
text
:title,
:body
text
:comments
do
Post.search
do
comments.map
{
|comment|
comment.body
}
fulltext
'best
pizza'
end
with
:blog_id,
1
integer
:blog_id
with(:published_at).less_than
Time.now
integer
:author_id
order_by
:published_at,
:desc
integer
:category_ids,
multiple:
true
paginate
page:
2,
per_page:
15
time
:published_at
facet
:category_ids,
:author_id
string
:sort_title
do
end
title.downcase.gsub(/^(an?|the)b/,
'')
end
end
end
http://www.metacasts.tv
PROJNIGHT213
Thursday, February 7, 13
17. More Info
http://sunspot.github.com/
https://github.com/sunspot/sunspot
http://lucene.apache.org/solr/
http://www.metacasts.tv
PROJNIGHT213
Thursday, February 7, 13
18. 4. Sinatra
http://www.metacasts.tv
PROJNIGHT213
Thursday, February 7, 13
19. A DSL for quickly
creating Ruby Web Apps
http://www.metacasts.tv
PROJNIGHT213
Thursday, February 7, 13
20. require
'sinatra'
get
'/'
do
'Hello
world!'
end
http://www.metacasts.tv
PROJNIGHT213
Thursday, February 7, 13
21. require
'sinatra'
get
'/'
do
erb
:index
end
__END__
@@
index
<div>Hello
World!</div>
http://www.metacasts.tv
PROJNIGHT213
Thursday, February 7, 13
22. require
'sinatra/base'
require
'./todo'
require
'sinatra/twitter-‐bootstrap'
require
'./url_helpers'
class
TodoApp
<
Sinatra::Base
register
Sinatra::Twitter::Bootstrap::Assets
helpers
UrlHelpers
get
"/todos"
do
@todos
=
Todo.all
erb
:index
end
get
"/todos/new"
do
@todo
=
Todo.new
erb
:form
end
get
"/todos/:id"
do
@todo
=
Todo.find(params[:id])
redirect
edit_todo_path(@todo)
end
get
"/todos/:id/edit"
do
@todo
=
Todo.find(params[:id])
erb
:form
end
post
"/todos"
do
Todo.create(params[:todo])
redirect
todos_path
end
put
"/todos/:id"
do
@todo
=
Todo.find(params[:id])
@todo.update_attributes(params[:todo])
redirect
todos_path
end
delete
"/todos/:id"
do
@todo
=
Todo.find(params[:id])
@todo.destroy
redirect
todos_path
end
end
use
Rack::MethodOverride
run
TodoApp
http://www.metacasts.tv
PROJNIGHT213
Thursday, February 7, 13
23. More Info
http://www.sinatrarb.com/
https://github.com/sinatra/sinatra
http://www.metacasts.tv/casts/building-a-sinatra-application-pt-1
http://www.metacasts.tv/casts/building-a-sinatra-application-pt-2
http://www.metacasts.tv/casts/gettings-started-with-sinatra
http://www.metacasts.tv
PROJNIGHT213
Thursday, February 7, 13
24. 5. Foreman
http://www.metacasts.tv
PROJNIGHT213
Thursday, February 7, 13
25. Manage Application
Commands
http://www.metacasts.tv
PROJNIGHT213
Thursday, February 7, 13