Ruby and Rails Introduction by Rubyrails.Ninja

Total Page:16

File Type:pdf, Size:1020Kb

Ruby and Rails Introduction by Rubyrails.Ninja Ruby and Rails Introduction by rubyrails.ninja Ruby is a programming language created in 1995. It was influenced by other programming languages such as Perl, Smalltalk, Eiffel, Ada and Lisp. Ruby is friendly for beginners. Ruby’s community is big and there are a lot of documentations available. There are also a lot of ready-to-use tools that are called Ruby gems. Rails is the Ruby's web development toolkit that allows you to develop fast web application. It was create in 2005. Rails framework uses also gems to facilitate and accelarate development. The community is very active and open source oriented. Let’s go into Ruby and Rails programming ! Mini course curriculum I Ruby language a) Dynamic types b) Loops and iterators c) Errors handling d) Native libraries e) Classes and modules f) Gems g) Irb console and files .rb h) What to do with Ruby ? II Rails framework a) MVC (model, view, controller) b) Gemfile c) Bundle and Rake d) Routes e) Config directory f) Lib directory g) Server and console h) Scaffolding I Ruby language a) Dynamic types You don’t have to choose one type for your Ruby’s variable : # this is a comment a = 1 puts a.class # this is a fixnum integer a = "string" puts a.class # this is a string a = 3,23 puts a.class # this is a float a = [] puts a.class # this is an array a = Object.new puts a.class # this is a personal object a = 2.0 puts a.class puts a.to_i puts a.to_i.class a = "my wonderful string" a.is_a?(String) # true a.respond_to?(:to_s) # true In Ruby, everything is an object! Basic types are threated as object too : a=25420 # integer a.succ # a successor , a + 1 a.to_s a.class b = "abracadabra" # string b.size b << "alcatraz" b.start_with?("ab", "abra") b.include?("bra") b.split("a").reject(&:empty?) # split command cuts your # string with the choosen caracter into array and # delete empty record c = [1,2,3,4,5,6,7,8,9,0] # array c.first c.take(3) c.include?(5) c.drop(3) c.push(1) c << 2 << 3 c.reverse c.delete_if {|x| x <= 5 } d = [ ["label 1",1,0],["label 2",2,0.2], ["label 3",3,0],["label 4",4,0.4] ] # multi dimensional array d.map { |x| x[0] if x[1] > 1 && x[2].is_a?(Float) }.compact! # Keeps the first sub array element if the second sub # array element is # superior to integer 1 and if the # third sub array element is a float. The result is # cleaned from nil element with compact command. # the ! Caracter is used to destruct the original object # to replace with new datas e = { "the_one" => 10, "the_two" => 6, "the_three" => 12 } # hash with key / value puts e["the_one"] # the_one is the key b) Loops and iterators i, max = 0, 5 while i <= max do puts "#{i} is not the max" i+=1 end i, max = 0, 5 until i >= max do puts "#{i} is not the max" i+=1 end for i in 0..5 puts "#{i} is inferior to 6" end (0..5).each do |i| puts "#{i} is inferior to 6" end 5.times do puts "one time" end # there are also array iterators a = ["one","two","three","for","five","six","seven","eight"] a.each do |record| puts record end a.each_slice(2) { |my_slice| puts my_slice} a.each_with_index do |record,index| puts "#{record} #{index}" end # and for hashs a = {"zero" => 0, "one" =>1, "two" =>2, "three" => 3} a.each_key {|key| puts key} a.each {|key, value| puts "#{key} is #{value}" } c) Errors handling #begin rescue ensure i, max, max_retry = 0, 100, 5 begin # i+=1 # some code using i rescue Exception => e # if an error occurs in begin bloc # puts e.message # retry if i < max_retry ensure # doing important things here end until i >= max # raise def inverse(x) raise ArgumentError, "Argument is not numeric" unless x.is_a? Numeric 1.0 / x end puts inverse(2) puts inverse("not a number") d) Native Libraries Ruby language have a lot of standard libraries for basic objects : String, Integer, Float, Array, Hash. But there are also libraries for more complex objects : Class, Complex, Math, Enumerable, Time, File, Dir, IO, Thread, Process, Exception, .. a = Time.now b = Math.sqrt(4) file = File.open(filename, 'r') filenames = Dir.entries("test_directory") e) Classes and modules When you need to create programs, you can use modules and classes to build your thinking. Imagine that we wanted to create a program that collects tweets and analyzes them to find specific elements using machine learning. Then we will create a module that can be called TweetsAnalysis with two classes. The first is the one that would be used to interact with Twitter (connexion, tweets extraction). The second class will be used to analyze the tweets. module TweetsAnalysis class TwitterInteraction def initialize # do some inits end def connect # specific method to connect Twitter API end def method # do other stuffs end end class TweetsAnalyser def initialize # do some inits end def method # do other stuffs end end end credentials = [login,password,API_code] include TweetsAnalysis twit = TwitterInteraction.new twit.connect(credentials) collected_datas = twit.method analyser = TweetsAnalyser.new analyser.method(collected_datas) f) Gems Ruby has a dedicated package manager : Rubygems. This manager allows you to install and use external packages. There are a lot of different gems available .. you can install them using the command "ruby gem install the_gem_you_want" # Browser automation .. require 'watir-webdriver' browser = Watir::Browser.new :chrome # open browser browser.goto("https://rubyrails.ninja") # go to page # Playing with twitter .. require 'twitter_oauth' @twitter_client = TwitterOAuth::Client.new( :consumer_key => '', :consumer_secret => '', :token => '', :secret => '' ) res = @twitter_client.update('I can schedule my tweets!') # Do you want to use google speech-to-text API ? require 'speech' audio = Speech::AudioToText.new("my_audio_file.wav") puts audio.to_text # HTTP Protocols require 'net/http' require "uri" uri = URI.parse("https://rubyrails.ninja") response = Net::HTTP.get_response(uri) # Will print response.body Net::HTTP.get_print(uri) # Playing with Youtube .. # This snippet will get every user id that comment on # the youtube channels you choose require 'yt' ls_channel_url= ["https://www.youtube.com/user/whatyouwant"] Yt.configure do |config| config.client_id = '' config.client_secret = 'secret' config.api_key = 'api key' end ls_comments_user = [] # global list ls_channel_url.each do |url| # for each channel channel = Yt::Channel.new url: url videos = channel.videos # get video list comment_user = [] # channel list videos.each do |vid| # for each video in channel cnt=video.comment_count # get comment count comment_user << vid.comment_threads.take(cnt).map(&:author_display_name) # add comments author’s name to channel list end ls_comments_user << comment_user.flatten # add channel list to global list end result = ls_comments_user.flatten.uniq # result : global list of users who comment specific channels g) Irb console and files .rb There are two ways to execute Ruby code. You can create a file with .rb extension in order to execute this file with the ruby interpreter. Example, create a file my_first_program.rb with the code below. Once done, execute it with the command line "ruby my_first_program.rb test 2 0.35" #!/usr/bin/env ruby # encoding: UTF-8 def main argv argv.each do |record| puts record end end main(ARGV) The second way to execute Ruby code is the live console. Just type "irb" in your terminal and the prompt appears. 2.2.5 :001 > def method(parameters) 2.2.5 :002?> parameters.each do |record| 2.2.5 :003 > puts record 2.2.5 :004?> end 2.2.5 :005?> end => :method 2.2.5 :006 > method(["test",1,0.35]) test 1 0.35 => ["test", 1, 0.35] h) What to do with Ruby ? Well … you can build almost everything with it. From blockchain to machine learning, without forget browser automation, facebook marketing, image or audio processing, natural language processing, …, there are no limits. The only limits you will meet are your thinking limits:) There are different ways to package your code. You can build scripts (file.rb) to acheive specific tasks as shown in the previous pages and execute them in terminal. You can create an application with a GUI (graphical user interface) with the "shoesrb". You can make websites, email autoresponder, chatbots and web application with Rails framework. As you see, with a bit of work, you can acheive all your dreams:) I am here to help you to do that ! Let’s see now how Rails works.. II Rails framework a - MVC Rails is the Ruby web framework. This framework has been created in order to facilitate and to accelarate web application creation. Creating a Rails application is quick because everything you create is fully covered. You can use the database of your choice : MySQL, PostgreSQL, SQLite, MongoDB, Redis, RDDB, couchDB, rethinkDB, strokeDB. Let’s see what MVC is. The browser execute controller that interact with model and the database through ActiveRecord. The controller can then use the views to render informations and routing through ActionView. Another more detailled view here : Ruby and Rails is a fullstack framework. It can handle both front-end and back-end. The front-end is the client part. It is composed of html, javascript and stylesheet (css). You can use Ruby on Rails components into the front-end to make dynamic webpages. The back-end is the server side. Ruby on Rails allow you to interact directly with the database. Someone fill a form and that will create the database entries automatically. Simple ! To simply create a Rails application : rails new my_new_app You can now create anything you want in your rails app : rails g controller my_controller rails g model my_model rails g mailer my_mailer Once your application is created, you can noticed that there is a particular tree.
Recommended publications
  • TECHNICAL STANDARDS a Standards Validation Committee of Industry Representatives and Educators Reviewed and Updated These Standards on December 11, 2017
    SOFTWARE AND APP DESIGN 15.1200.40 TECHNICAL STANDARDS A Standards Validation Committee of industry representatives and educators reviewed and updated these standards on December 11, 2017. Completion of the program prepares students to meet the requirements of one or more industry certification: Cybersecurity Fundamentals Certificate, Oracle Certified Associate, Java SE 8 Programmer, Certified Internet Web (CIW) - JavaScript Specialist, CompTIA A+, CompTIA IT Fundamentals, CSX Cybersecurity Fundamentals Certificate, and Microsoft Technology Associate (MTA). The Arizona Career and Technical Education Quality Commission, the validating entity for the Arizona Skills Standards Assessment System, endorsed these standards on January 25, 2018. Note: Arizona’s Professional Skills are taught as an integral part of the Software and App Design program. The Technical Skills Assessment for Software and App Design is available SY2020-2021. Note: In this document i.e. explains or clarifies the content and e.g. provides examples of the content that must be taught. STANDARD 1.0 APPLY PROBLEM-SOLVING AND CRITICAL THINKING SKILLS 1.1 Establish objectives and outcomes for a task 1.2 Explain the process of decomposing a large programming problem into smaller, more manageable procedures 1.3 Explain “visualizing” as a problem-solving technique prior to writing code 1.4 Describe problem-solving and troubleshooting strategies applicable to software development STANDARD 2.0 RECOGNIZE SECURITY ISSUES 2.1 Identify common computer threats (e.g., viruses, phishing,
    [Show full text]
  • Bigchaindb Server Documentation Release 1.2.0
    BigchainDB Server Documentation Release 1.2.0 BigchainDB Contributors Nov 13, 2017 Contents 1 Introduction 1 2 Quickstart 3 3 Production Nodes 5 4 Clusters 13 5 Production Deployment Template 15 6 Develop & Test BigchainDB Server 65 7 Settings & CLI 73 8 The HTTP Client-Server API 85 9 The Events API 103 10 Drivers & Tools 107 11 Data Models 109 12 Transaction Schema 117 13 Vote Schema 121 14 Release Notes 123 15 Appendices 125 Python Module Index 169 HTTP Routing Table 171 i ii CHAPTER 1 Introduction This is the documentation for BigchainDB Server, the BigchainDB software that one runs on servers (but not on clients). If you want to use BigchainDB Server, then you should first understand what BigchainDB is, plus some of the spe- cialized BigchaindB terminology. You can read about that in the overall BigchainDB project documentation. Note that there are a few kinds of nodes: •A dev/test node is a node created by a developer working on BigchainDB Server, e.g. for testing new or changed code. A dev/test node is typically run on the developer’s local machine. •A bare-bones node is a node deployed in the cloud, either as part of a testing cluster or as a starting point before upgrading the node to be production-ready. •A production node is a node that is part of a consortium’s BigchainDB cluster. A production node has the most components and requirements. 1.1 Setup Instructions for Various Cases • Quickstart • Set up a local BigchainDB node for development, experimenting and testing • Set up and run a BigchainDB cluster There are some old RethinkDB-based deployment instructions as well: • Deploy a bare-bones RethinkDB-based node on Azure • Deploy a RethinkDB-based testing cluster on AWS Instructions for setting up a client will be provided once there’s a public test net.
    [Show full text]
  • User Guide for HCR Estimator 2.0: Software to Calculate Cost and Revenue Thresholds for Harvesting Small-Diameter Ponderosa Pine
    United States Department of Agriculture User Guide for HCR Forest Service Estimator 2.0: Software Pacific Northwest Research Station to Calculate Cost and General Technical Report PNW-GTR-748 Revenue Thresholds April 2008 for Harvesting Small- Diameter Ponderosa Pine Dennis R. Becker, Debra Larson, Eini C. Lowell, and Robert B. Rummer The Forest Service of the U.S. Department of Agriculture is dedicated to the principle of multiple use management of the Nation’s forest resources for sustained yields of wood, water, forage, wildlife, and recreation. Through forestry research, cooperation with the States and private forest owners, and management of the National Forests and National Grasslands, it strives—as directed by Congress—to provide increasingly greater service to a growing Nation. The U.S. Department of Agriculture (USDA) prohibits discrimination in all its programs and activities on the basis of race, color, national origin, age, disability, and where applicable, sex, marital status, familial status, parental status, religion, sexual orientation, genetic information, political beliefs, reprisal, or because all or part of an individual’s income is derived from any public assistance program. (Not all prohibited bases apply to all programs.) Persons with disabilities who require alternative means for communication of program information (Braille, large print, audiotape, etc.) should contact USDA’s TARGET Center at (202) 720-2600 (voice and TDD). To file a complaint of discrimination, write USDA, Director, Office of Civil Rights, 1400 Independence Avenue, SW, Washington, DC 20250-9410 or call (800) 795-3272 (voice) or (202) 720-6382 (TDD). USDA is an equal opportunity provider and employer. Authors Dennis R.
    [Show full text]
  • Ola Bini Computational Metalinguist [email protected] 698E 2885 C1DE 74E3 2CD5 03AD 295C 7469 84AF 7F0C
    JRuby For The Win Ola Bini computational metalinguist [email protected] http://olabini.com/blog 698E 2885 C1DE 74E3 2CD5 03AD 295C 7469 84AF 7F0C onsdag 12 juni 13 Logistics and Demographics onsdag 12 juni 13 LAST MINUTE DEMO onsdag 12 juni 13 JRuby Implementation of the Ruby language Java 1.6+ 1.8.7 and 1.9.3 compatible (experimental 2.0 support) Open Source Created 2001 Embraces testing Current version: 1.7.4 Support from EngineYard, RedHat & ThoughtWorks onsdag 12 juni 13 Why JRuby? Threading Unicode Performance Memory Explicit extension API and OO internals Libraries and legacy systems Politics onsdag 12 juni 13 InvokeDynamic onsdag 12 juni 13 JRuby Differences Most compatible alternative implementation Native threads vs Green threads No C extensions (well, some) No continuations No fork ObjectSpace disabled by default onsdag 12 juni 13 Simple JRuby onsdag 12 juni 13 Java integration Java types == Ruby types Call methods, construct instances Static generation of classes camelCase or snake_case .getFoo(), setFoo(v) becomes .foo and .foo = v Interfaces can be implemented Classes can be inherited from Implicit closure conversion Extra added features to Rubyfy Java onsdag 12 juni 13 Ant+Rake onsdag 12 juni 13 Clojure STM onsdag 12 juni 13 Web onsdag 12 juni 13 Rails onsdag 12 juni 13 Sinatra onsdag 12 juni 13 Trinidad onsdag 12 juni 13 Swing Swing API == large and complex Ruby magic simplifies most of the tricky bits Java is a very verbose language Ruby makes Swing fun (more fun at least) No consistent cross-platform GUI library for Ruby
    [Show full text]
  • Package 'Rethinker'
    Package ‘rethinker’ November 13, 2017 Type Package Title RethinkDB Client Version 1.1.0 Author Miron B. Kursa Maintainer Miron B. Kursa <[email protected]> Description Simple, native 'RethinkDB' client. URL https://github.com/mbq/rethinker Suggests testthat Imports rjson License GPL-3 RoxygenNote 6.0.1 NeedsCompilation no Repository CRAN Date/Publication 2017-11-13 11:20:29 UTC R topics documented: close.RethinkDB_connection . .2 close.RethinkDB_cursor . .2 cursorNext . .3 cursorToList . .3 drainConnection . .4 isCursorEmpty . .5 isOpened . .5 openConnection . .6 print.RethinkDB_connection . .6 print.RethinkDB_cursor . .7 r...............................................7 Index 10 1 2 close.RethinkDB_cursor close.RethinkDB_connection Close RethinkDB connection Description Closes connection and stops all associated callbacks and/or sync cursor. Usage ## S3 method for class 'RethinkDB_connection' close(con, ...) Arguments con Connection to close. ... Ignored. close.RethinkDB_cursor Close cursor Description Closes a given cursor and stops its associated query. Should be called on the current cursor before a new sync query is invoked on the same connection. Usage ## S3 method for class 'RethinkDB_cursor' close(con, ...) Arguments con Cursor to close. ... Ignored. cursorNext 3 cursorNext Pull next object from a cursor Description Pulls a datum from a given cursor, sending continuation queries when needed. Usage cursorNext(cursor, inBatch = FALSE) Arguments cursor Cursor to pull from; a result of r()$...$run(...). inBatch If set to TRUE, enables batch mode, i.e., returning the whole local cache (this is usually NOT the whole data available under cursor) rather than a single result. Values other than TRUE or FALSE are invalid. Value In a default mode, a list representing the returned response JSON, or NULL if no data is available.
    [Show full text]
  • Rubinius Rubini Us Rubini.Us Rubini.Us Rubini.Us Rubinius History and Design Goals
    Rubinius Rubini us Rubini.us rubini.us http:// rubini.us Rubinius http://godfat.org/slide/2008-12-21-rubinius.pdf History and Design Goals Architecture and Object Model History and Design Goals Architecture and Object Model Evan Phoenix February of 2006 RubySpec MSpec Engine Yard C VM Shotgun C VM Shotgun C++ VM CxxTest LLVM History and Design Goals Architecture and Object Model Reliable, Rock Solid Code Reliable, Rock Solid Code Full Test Coverage 健康 Clean, Readable Code Clean, Readable Code Little Lines in Each File Clean, Readable Code Macro, Code Generator, Rake Task Clean, Readable Code CMake Clean, Readable Code CMake Clean, Readable Code C++ Object to Ruby Object 1 to 1 Mapping 清新 健康 清新 Modern Techniques Modern Techniques Pluggable Garbage Collectors Modern Techniques Pluggable Garbage Collectors • Stop-and-Copy Modern Techniques Pluggable Garbage Collectors • Stop-and-Copy • Mark-and-Sweep Modern Techniques Optimizers Modern Techniques Git, Rake, LLVM Squeak the Smalltalk-80 Implementation Squeak Slang Squeak • Alan Kay • Dan Ingalls • Adele Goldberg Smalltalk Xerox PARC Smalltalk Object-Oriented (differ from Simula and C++) Smalltalk GUI Smalltalk MVC History and Design Goals Architecture and Object Model Real Machine C++ Virtual Machine Real Machine kernel/bootstrap C++ Virtual Machine Real Machine kernel/platform kernel/bootstrap C++ Virtual Machine Real Machine kernel/common kernel/platform kernel/bootstrap C++ Virtual Machine Real Machine kernel/delta kernel/common kernel/platform kernel/bootstrap C++ Virtual Machine Real
    [Show full text]
  • Linux on Z Platform ISV Strategy Summary
    Linux on IBM Z / LinuxONE Open Source Ecosystem Status and Strategy for NY/NJ Linux Council Meeting on March 1, 2019 Enyu Wang Program Director, Ecosystem Strategy and Business Development [email protected] As an enterprise platform WHY ARE WE INVESTING IN OPEN SOURCE ECOSYSTEM? IBM Z / Open Source Ecosystem / Mar 1, 2019 / © 2019 IBM Corporation 2 TREND: Enterprise Going Open Source • 83% hiring managers surveyed for the 2018 Open Source Jobs report said hiring open source talent was a priority this year • Some of the biggest trends in enterprise IT, such as containers and hybrid cloud, rely on open source technologies including Linux and Kubernetes IBM Z / Open Source Ecosystem / Mar 1, 2019 / © 2019 IBM Corporation 3 OPEN SOURCE Building Blocks for Enterprise Digital Transformation IBM Z / Open Source Ecosystem / Mar 1, 2019 / © 2019 IBM Corporation 4 OUR MISSION Provide a Rich and Robust Ecosystem to Clients. Help Accelerate their Digital Transformation IBM Z / Open Source Ecosystem / Mar 1, 2019 / © 2019 IBM Corporation 5 Rich Open Source Ecosystem on Linux on Z/LinuxONE Analytics/ Distributions Hypervisors PaaS / IaaS Languages Runtimes Management Database ML LPA R IBM Cloud Private Community Versions LLVM vRealize LXD (Ubuntu) Apache Tomcat DPM Db2 IBM Z / Open Source Ecosystem / Mar 1, 2019 / © 2019 IBM Corporation 6 Building an Open Ecosystem Isn’t Just Porting… IBM Z / Open Source Ecosystem / Mar 1, 2019 / © 2019 IBM Corporation 7 Composition of Open Source Ecosystem on Z – a combination of community based projects and vendor
    [Show full text]
  • Ruby on Rails
    Ruby.learn{ |stuff| } ● What is Ruby? ● What features make it interesting to me (and maybe you)? ● A quick, idiosyncratic tour of the Ruby ecosphere. Tuesday Software Lunch Talk: March 4, 2008 What is it? ● a dynamic, object-oriented, open source programming language... ● with a uniquely (but not too uniquely), expressive syntax ● dynamically or “duck” typed ● influenced by Perl, Smalltalk, Eiffel, Ada and Lisp ● has aspects of functional and imperative programming styles History ● created by Yukihiro “Matz” Matsumoto on Feb 24 1993, released to public in 1995 ● “Ruby” coined in comparison to “Perl” Philosophy (the “Ruby Way”) ● emphasize programmer needs over computer needs ● encourage good design, good APIs ● Principle of Least Surprise (POLS) – the language should behave in such a way as to minimize confusion for experienced users ● “Everything should be a simple as possible, but no simpler.” - Einstein ● orthogonality ● change at runtime is not to be feared Interesting Stuff... ● Is Not a Ruby tutorial – http://tryruby.hobix.com/ – Programming Ruby: The Pragmatic Programmer's Guide – our just google it – you want something totally different? ● http://poignantguide.net/ruby/ ● Is what I find interesting/different/well done about Ruby. Everything's an Object ● no exceptions Falsiness ● only false and nil are falsey. Not 0. Symbols ● labels ● lightweight strings with no behaviour ● often used as hash keys Blocks ● another name for a Ruby block is a “closure” ● clo-sure [kloh-zher] – noun. A function that is evaluated in an environment containing one or more bound variables. Procs ● anonymous subroutines or closures with a life of their own Adding Methods to Classes ● You can add methods to an object at runtime in several ways..
    [Show full text]
  • Conflict Resolution Via Containerless Filesystem Virtualization
    Dependency Heaven: Conflict Resolution via Containerless Filesystem Virtualization Anonymous Author(s) Abstract previous installation, effectively preventing concurrent ver- Resolving dependency versioning conflicts in applications sions of that library from coexisting. The same is true for is a long-standing problem in software development and packages whose executable names does not change across deployment. Containers have become a popular way to ad- releases; unless the user renames the existing executable dress this problem, allowing programs to be distributed in a files prior to the installation of a new version it is notpos- portable fashion and to run them under strict security con- sible to keep both installations around. The problem with straints. Due to the popularity of this approach, its use has that approach is that it breaks package managers, as the re- started to extend beyond its original aim, with users often named files will not be featured in the package manager’s creating containers bundling entire Linux distributions to database and, consequently, will not be tracked anymore. run mundane executables, incurring hidden performance Further, unless executables depending on the renamed files and maintenance costs. This paper presents an alternative are modified to reflect their new path, users need todefine approach to the problem of versioning resolution applied to which executable to activate at a given time, usually through locally-installed applications, through a virtualization tool tricky management of symbolic
    [Show full text]
  • Jruby: Enterprise
    JRuby Enterprise 2.0 James Crisp Josh Price ThoughtWorks Agenda • What are Ruby and JRuby? • Benefits and Drawbacks • Where to use? • Demos • Case studies Ruby • Created by Yukihiro Matsumoto in 1993 • Open Source • Vibrant community • Dynamically typed • Pure OO • Syntactically flexible for DSLs • Advanced meta programming Ruby Runtimes • MRI Matz’s Ruby Interpreter in C (Ruby 1.8.6) • YARV Yet another Ruby VM (Ruby 1.9) • IronRuby .NET, DLR (alpha) • Rubinius Alternative VM • xRuby Compiler in Java • JRuby on the JVM Java platform Today’s Java Platform JRuby • Java implementation of Ruby • Open Source • Full time developers from Sun and ThoughtWorks • Charles Nutter, Thomas Enebo, Ola Bini et al • Allows Ruby to call Java code and vice versa Timeline • Started around 2001 by Jan Arne Petersen • JRuby 1.0 released in June 2007 • JRuby 1.1 RC2 just released • 1.1 release out soon Why JRuby? • Ruby / Rails productivity & tools • Java libraries and interoperability • Run on any OS / JVM / App server • Leverage existing infrastructure & ops skills • Politics – it's just a WAR JRuby advantages • Native vs Green Threading • World class garbage collection • Unicode • Runs the same on all platforms • JIT & AOT compilation JRuby disadvantages • Large memory footprint • Longer startup times • No native C extensions • Not technically complete Ruby Demo A Simple Ruby Class class RubyDemo < Demo def say_hello 5.times { puts “Hi from Ruby!” } end def greet(guests) guests.collect { |g| “Welcome #{g.name}” } end end >> RubyDemo.new.greet(josh, james)
    [Show full text]
  • Dmitry Omelechko
    Dmitry Omelechko E-mail : [email protected] Phone : skype: dvarkin8 Address: Olevska 3 В, Kyiv, Ukraine Objective I have a more than 15 years of experience in IT industry, and I was involved in design and development of several long- term reliable, scalable and high-load platforms and applications, which gave me solid experience of software design. More than 10 years, I prefer functional programming and I have strong understanding of concurrent, scaled and parallel approaches. I'm good team player with strong self-motivation. I always do my best to build great solution for customers needs. Qualifications Programming Languages. Erlang/OTP Elixir/LFE (pet projects) Clojure / ClojureScript Python LISP (Alegro, SBCL) Perl C Data Science Recommendation Systems. DBMS PostgreSQL / EnterpriseDB / GreenPlum (PL/pgSQL, PL/Python). Riak MongoDB RethinkDB Cassandra Datomic KDB+ (pet) Hazelcast / Aerospike Redis / Memcache Application Servers and Frameworks Cowboy / Mochiweb / Ring / Runch Nginx / Apache / Haproxy RabbitMQ / 0mq / Kafka Storm / Samza Django/web.py/TurboGears/Plone/Zope Dmitry Omelechko 1 Histrix Riak / Redux / GraphQL / Om Next Ejabberd Erlyvideo / Flussonic AWS / Google Cloud / Heroku Networks OSPF/BGP/DNS/DHCP, VPNs, IPSec, Software Farewalls (Iptables, PF). Cisco/Extreme networks/Juniper routers and commutators. Clouds Google Cloud Amazon Cloud and AWS Heroku Operating Systems Ubuntu / Gentoo / Slackware OpenBSD Development Tools Emacs / Vim / IntelliJ Idea. git / svn / cvs Rebars / Erlang.mk / Leiningen EUnit / Common Test / Proper / Tsung Ansible / Terraform Methodologies Scrum / Kanban / TDD Work experience SBTech mar 2016 — present Tech Lead Data Science, Bets Recommendation System, User profiling system. Bet Engines sep 2015 — mar 2016 CTO Own startup. System for calculation huge Mathematical models in Excel.
    [Show full text]
  • Safety of High Speed Magnetic Levitation Transportation Systems, Titled, Review of German Safety Requirements for the Transrapid System
    PB91129684 Safety of High Speed U.S. Department Magnetic Levitation of Transportation Federal Railroad Transportation Systems Administration Office of Research and Development Preliminary Safety Review of Washington, DC 20590 Transrapid Maglev System Robert M. Dorer William T. Hathaway REPRODUCED BY U.S. DEPARTMENT OF COMMERCE NATIONAL TECHNICAL INFORMATION SERVICE SPRINGFIELD, VA 22161 NOTICE This document is disseminated under the sponsorship of the Department of Transportation in the interest of information exchange. The United States Government assumes no liability for its contents or use thereof. NOTICE The United States Government does not endorse products or manufacturers. Trade or manufacturers' names appear herein solely because they are considered essential to the object of this report. Technical Repart Dacumentation Poge 1. Report No. , ,.._··-·----• ,1.,,.,.•••ion No. 3. Recipient' 1 C•tolo9 No. DOT/FRA/ORD-90/09 PB91-129684 •• Title ond Subtitl• 5. Ret1ort Cate Safety of High Speed Magnetic Levitation November 1990 Transportation Systems: Preliminary Safety 6. Performing Orgoni 1ation Code Review of the Transrapid Maglev System DTS-73 B. P•rfonnint OrgOftitatfon R•port No. 7. Author1 a) DOT-VNTSC-FRA-90-3 Robert M. Dorer and William T. Hathaway 9. fi••&'"'"~t Oll'i"l:'zat;ae_ N~of!ld Addrosa t t. 10. Wark Un;t No. (TRAIS) . p men o ranspor a 1on RR193/Rl019 Research and Special Programs Administration l I. Contract or Grant No. John A. Volpe National Transportation Systems Center Cambridge, MA 02142 13. Type of Re,ort encl Period Co•ered 12. Sponsoring Agency Nome and Addre11 Interim Report U.S. Department of Transportation Sept.
    [Show full text]