Talk @ RubyConfIndia 2012. Ruby is a pure object oriented and really a beautiful language to learn and practice.
But most of us do not bother to know or care about what happens behind the scene when we write some ruby code. Say creating a simple Array, Hash, class, module or any object. How does this map internally to C code ?
Ruby interpreter is implemented in C and I will talk about the Interpreter API that we as ruby developers
should be aware of. The main purpose of the presentation is to understand the efforts and complexity behind
the simplicity offered. I would also like to touch upon the difference in implementation of some core data structures
in different ruby versions. Having known a part of C language implementation behind Ruby, I would also like to throw some light upon when and why would we need to write some ruby extensions in C.
RxJs - demystified provides an overview of reactive programming and RxJs. The key points covered are:
- Reactive programming focuses on propagating changes without explicitly specifying how propagation happens.
- Observables are at the heart of RxJs and emit values in a push-based manner. Operators allow transforming, filtering, and combining observables.
- Common operators include map, filter, reduce, buffer, and switchMap. Over 120 operators exist for tasks like error handling, multicasting, and conditional logic.
- Marble diagrams visually demonstrate how operators transform observable streams.
- Creating observables from events, promises, arrays and iterables allows wrapping different data sources in a uniform API
Kotlin InDepth Tutorial for beginners 2022Simplilearn
This tutorial by Simplilearn is based on Kotlin In-Depth Tutorial for 2022. This video is curated by industry experts based on the current IT standards and organized in the learning order. This Kotlin tutorial will help you with the fundamentals of kotlin programming language and also Android development with kotlin. This kotlin tutorial will guide you with critical skills, tips, and tricks required to be an expert in kotlin programming language.
In this tutorial, on the Kotlin tutorial, we will be learning about the important topics and basics of Kotlin language that one should know to understand Kotlin language. In this Kotlin tutorial for beginners, we will be learning about the Variables in Kotlin, String templates, if-else, and when statements. We will also learn about arrays, loops, ranges, and much more with help of hands-on examples.
Vue is a progressive JavaScript framework that can be used to build user interfaces. It is designed to be incrementally adoptable, with a small core library focused on the view layer. Components are custom elements that extend HTML and attach Vue behavior. Single file components allow cleaner code through preprocessing. VueRouter provides routing functionality for single page applications. Vuex is a state management pattern and library that serves as a centralized store for component data and enforces predictable state mutations.
Boost your productivity with Scala tooling!MeriamLachkar1
Our rich ecosystem provides developers with powerful tools that improve productivity on small or huge projects.
In this talk, I will present the tools that allow me to focus on my projects by making tedious tasks easier. From bootstrapping projects, to code linting and refactoring, from continuous integration and automatic publication and documentation rendering, come discover my favorite tools.
Talk @ RubyConfIndia 2012. Ruby is a pure object oriented and really a beautiful language to learn and practice.
But most of us do not bother to know or care about what happens behind the scene when we write some ruby code. Say creating a simple Array, Hash, class, module or any object. How does this map internally to C code ?
Ruby interpreter is implemented in C and I will talk about the Interpreter API that we as ruby developers
should be aware of. The main purpose of the presentation is to understand the efforts and complexity behind
the simplicity offered. I would also like to touch upon the difference in implementation of some core data structures
in different ruby versions. Having known a part of C language implementation behind Ruby, I would also like to throw some light upon when and why would we need to write some ruby extensions in C.
RxJs - demystified provides an overview of reactive programming and RxJs. The key points covered are:
- Reactive programming focuses on propagating changes without explicitly specifying how propagation happens.
- Observables are at the heart of RxJs and emit values in a push-based manner. Operators allow transforming, filtering, and combining observables.
- Common operators include map, filter, reduce, buffer, and switchMap. Over 120 operators exist for tasks like error handling, multicasting, and conditional logic.
- Marble diagrams visually demonstrate how operators transform observable streams.
- Creating observables from events, promises, arrays and iterables allows wrapping different data sources in a uniform API
Kotlin InDepth Tutorial for beginners 2022Simplilearn
This tutorial by Simplilearn is based on Kotlin In-Depth Tutorial for 2022. This video is curated by industry experts based on the current IT standards and organized in the learning order. This Kotlin tutorial will help you with the fundamentals of kotlin programming language and also Android development with kotlin. This kotlin tutorial will guide you with critical skills, tips, and tricks required to be an expert in kotlin programming language.
In this tutorial, on the Kotlin tutorial, we will be learning about the important topics and basics of Kotlin language that one should know to understand Kotlin language. In this Kotlin tutorial for beginners, we will be learning about the Variables in Kotlin, String templates, if-else, and when statements. We will also learn about arrays, loops, ranges, and much more with help of hands-on examples.
Vue is a progressive JavaScript framework that can be used to build user interfaces. It is designed to be incrementally adoptable, with a small core library focused on the view layer. Components are custom elements that extend HTML and attach Vue behavior. Single file components allow cleaner code through preprocessing. VueRouter provides routing functionality for single page applications. Vuex is a state management pattern and library that serves as a centralized store for component data and enforces predictable state mutations.
Boost your productivity with Scala tooling!MeriamLachkar1
Our rich ecosystem provides developers with powerful tools that improve productivity on small or huge projects.
In this talk, I will present the tools that allow me to focus on my projects by making tedious tasks easier. From bootstrapping projects, to code linting and refactoring, from continuous integration and automatic publication and documentation rendering, come discover my favorite tools.
Alphorm.com Formation React : Les fondamentauxAlphorm
Découvrez, dans cette formation, la bibliothèque React de Facebook.
Vous apprendrez à configurer votre machine de développement.
Vous verrez, grâce au développement d’une application simple les principaux concepts de React
Scala Intro training @ Lohika, Odessa, UA.
This is a basic Scala Programming Language overview intended to evangelize the language among any-language programmers.
This document provides an overview and introduction to React, a JavaScript library for building user interfaces. It discusses why React is used, how to set up a React environment, core React concepts like components, props, state, lifecycles and events. It also introduces React Native for building native mobile apps with React. The document emphasizes learning React through hands-on examples and practice.
Ce cours permet aux élèves n'ayant que peu ou pas d'expérience en programmation de créer des programmes Java. Les participants
sont initiés aux concepts, à la terminologie et à la syntaxe de programmation orientée objet, ainsi qu'aux étapes nécessaires pour créer
des programmes Java de base .
The document discusses GraphQL, a query language for APIs. It notes that GraphQL APIs are self-documenting as users can explore them using GraphiQL. It also explains that GraphQL requests are sent with a JSON body containing a "query" field with the GraphQL query string. The document is promoting a website that discusses building GraphQL APIs with .NET.
OSGi, Scripting and REST, Building Webapps With Apache SlingCarsten Ziegeler
This document discusses Apache Sling, an open source web framework that uses OSGi, Java Content Repository (JCR), and REST principles. It provides concise summaries of content and JCR, REST, scripting, and OSGi. Apache Sling addresses challenges of publishing dynamic web content at scale by leveraging these technologies in a modular and extensible way.
Practical and conceptual overview of Javascript prototype paradigm, how to use prototypes, how do they work, and how do they differ from classes, and why there are no real classes in Javascript.
Download for better quality.
Monads do not Compose. Not in a generic way - There is no general way of composing monads.
A comment from Rúnar Bjarnason, coauthor of FP in Scala: "They do compose in a different generic way. For any two monads F and G we can take the coproduct which is roughly Free of Either F or G (up to normalization)".
Another comment from Sergei Winitzki (which caused me to upload https://www.slideshare.net/pjschwarz/addendum-to-monads-do-not-compose): "It is a mistake to think that a traversable monad can be composed with another monad. It is true that, given `Traversable`, you can implement the monad's methods (pure and flatMap) for the composition with another monad (as in your slides 21 to 26), but this is a deceptive appearance. The laws of the `Traversable` typeclass are far insufficient to guarantee the laws of the resulting composed monad. The only traversable monads that work correctly are Option, Either, and Writer. It is true that you can implement the type signature of the `swap` function for any `Traversable` monad. However, the `swap` function for monads needs to satisfy very different and stronger laws than the `sequence` function from the `Traversable` type class. I'll have to look at the "Book of Monads"; but, if my memory serves, the FPiS book does not derive any of these laws." See https://www.linkedin.com/feed/update/urn:li:groupPost:41001-6523141414614814720?commentUrn=urn%3Ali%3Acomment%3A%28groupPost%3A41001-6523141414614814720%2C6532108273053761536%29
Talk given at DevTeach Montreal on RxJS - The Basics & The Future.
Example repo: https://github.com/ladyleet/rxjs-test
Have questions? Find me on twitter http://twitter.com/ladyleet
Jackrabbit is an open source content repository for Java that implements the JCR 2.0 specification. It provides a flexible, hierarchical content storage system with features like full text search, versioning, transactions, and observation. Jackrabbit entered the Apache incubator in 2004 and graduated in 2006. It provides APIs and implementations for embedding a content repository, accessing it remotely over RMI, or deploying it as a shared resource using a servlet container or J2EE application server. The document discusses Jackrabbit's architecture, configuration, indexing, data storage, content modeling, and common issues around content hierarchies and concurrent edits.
Defending against Java Deserialization VulnerabilitiesLuca Carettoni
Java deserialization vulnerabilities have recently gained popularity due to a renewed interest from the security community. Despite being publicly discussed for several years, a significant number of Java based products are still affected. Whenever untrusted data is used within deserialization methods, an attacker can abuse this simple design anti-pattern to compromise your application. After a quick introduction of the problem, this talk will focus on discovering and defending against deserialization vulnerabilities. I will present a collection of techniques for mitigating attacks when turning off object serialization is not an option, and we will discuss practical recommendations that developers can use to help prevent these attacks.
JavaScript for ABAP Programmers - 2/7 Data TypesChris Whealy
The document discusses data types in JavaScript compared to ABAP. It notes that JavaScript uses weak/dynamic typing where a variable's type is determined by its value, while ABAP uses strong/static typing where types are defined at declaration. It also covers the six main data types in JavaScript - Null, Undefined, Boolean, String, Number, and Object. Composite types like Array, Date, and Function are considered object types. The document provides examples of declaring and assigning values of different types to variables in JavaScript.
This document discusses object-oriented programming in JavaScript. It covers built-in objects like Object, Function, and Array. It also discusses creating custom objects using constructor functions and prototypes. Constructor functions allow initializing object state, while prototypes allow defining shared object behavior. JavaScript uses prototypal inheritance, where an object inherits directly from another object instance.
An Overview of Deserialization Vulnerabilities in the Java Virtual Machine (J...joaomatosf_
- The document discusses Java object serialization vulnerabilities and remote code execution.
- It provides background on serialization/deserialization and how it can allow object injection and improper input validation.
- A key vulnerability discussed is CVE-2015-7501, which affected Apache Commons Collections and allowed remote code execution through a "gadget chain" triggered during deserialization.
Ruby has several basic data types including integers, floats, strings, symbols, arrays, hashes, and sets. Integers can be Fixnums for smaller whole numbers or Bignums for larger numbers. Arrays can hold a group of values of different types and are defined with square brackets. Hashes use a key-value pair structure with keys that can be strings or symbols. Sets are an unordered collection of unique values that can be created in Ruby.
Правильная работа с часовыми поясами в Rails приложении — DevConf 2015Андрей Новиков
Презентация с рецептами по правильной работе с датой и временем в приложении на Ruby on Rails: как обрабатывать, передавать и хранить данные, чтобы избежать проблем.
Alphorm.com Formation React : Les fondamentauxAlphorm
Découvrez, dans cette formation, la bibliothèque React de Facebook.
Vous apprendrez à configurer votre machine de développement.
Vous verrez, grâce au développement d’une application simple les principaux concepts de React
Scala Intro training @ Lohika, Odessa, UA.
This is a basic Scala Programming Language overview intended to evangelize the language among any-language programmers.
This document provides an overview and introduction to React, a JavaScript library for building user interfaces. It discusses why React is used, how to set up a React environment, core React concepts like components, props, state, lifecycles and events. It also introduces React Native for building native mobile apps with React. The document emphasizes learning React through hands-on examples and practice.
Ce cours permet aux élèves n'ayant que peu ou pas d'expérience en programmation de créer des programmes Java. Les participants
sont initiés aux concepts, à la terminologie et à la syntaxe de programmation orientée objet, ainsi qu'aux étapes nécessaires pour créer
des programmes Java de base .
The document discusses GraphQL, a query language for APIs. It notes that GraphQL APIs are self-documenting as users can explore them using GraphiQL. It also explains that GraphQL requests are sent with a JSON body containing a "query" field with the GraphQL query string. The document is promoting a website that discusses building GraphQL APIs with .NET.
OSGi, Scripting and REST, Building Webapps With Apache SlingCarsten Ziegeler
This document discusses Apache Sling, an open source web framework that uses OSGi, Java Content Repository (JCR), and REST principles. It provides concise summaries of content and JCR, REST, scripting, and OSGi. Apache Sling addresses challenges of publishing dynamic web content at scale by leveraging these technologies in a modular and extensible way.
Practical and conceptual overview of Javascript prototype paradigm, how to use prototypes, how do they work, and how do they differ from classes, and why there are no real classes in Javascript.
Download for better quality.
Monads do not Compose. Not in a generic way - There is no general way of composing monads.
A comment from Rúnar Bjarnason, coauthor of FP in Scala: "They do compose in a different generic way. For any two monads F and G we can take the coproduct which is roughly Free of Either F or G (up to normalization)".
Another comment from Sergei Winitzki (which caused me to upload https://www.slideshare.net/pjschwarz/addendum-to-monads-do-not-compose): "It is a mistake to think that a traversable monad can be composed with another monad. It is true that, given `Traversable`, you can implement the monad's methods (pure and flatMap) for the composition with another monad (as in your slides 21 to 26), but this is a deceptive appearance. The laws of the `Traversable` typeclass are far insufficient to guarantee the laws of the resulting composed monad. The only traversable monads that work correctly are Option, Either, and Writer. It is true that you can implement the type signature of the `swap` function for any `Traversable` monad. However, the `swap` function for monads needs to satisfy very different and stronger laws than the `sequence` function from the `Traversable` type class. I'll have to look at the "Book of Monads"; but, if my memory serves, the FPiS book does not derive any of these laws." See https://www.linkedin.com/feed/update/urn:li:groupPost:41001-6523141414614814720?commentUrn=urn%3Ali%3Acomment%3A%28groupPost%3A41001-6523141414614814720%2C6532108273053761536%29
Talk given at DevTeach Montreal on RxJS - The Basics & The Future.
Example repo: https://github.com/ladyleet/rxjs-test
Have questions? Find me on twitter http://twitter.com/ladyleet
Jackrabbit is an open source content repository for Java that implements the JCR 2.0 specification. It provides a flexible, hierarchical content storage system with features like full text search, versioning, transactions, and observation. Jackrabbit entered the Apache incubator in 2004 and graduated in 2006. It provides APIs and implementations for embedding a content repository, accessing it remotely over RMI, or deploying it as a shared resource using a servlet container or J2EE application server. The document discusses Jackrabbit's architecture, configuration, indexing, data storage, content modeling, and common issues around content hierarchies and concurrent edits.
Defending against Java Deserialization VulnerabilitiesLuca Carettoni
Java deserialization vulnerabilities have recently gained popularity due to a renewed interest from the security community. Despite being publicly discussed for several years, a significant number of Java based products are still affected. Whenever untrusted data is used within deserialization methods, an attacker can abuse this simple design anti-pattern to compromise your application. After a quick introduction of the problem, this talk will focus on discovering and defending against deserialization vulnerabilities. I will present a collection of techniques for mitigating attacks when turning off object serialization is not an option, and we will discuss practical recommendations that developers can use to help prevent these attacks.
JavaScript for ABAP Programmers - 2/7 Data TypesChris Whealy
The document discusses data types in JavaScript compared to ABAP. It notes that JavaScript uses weak/dynamic typing where a variable's type is determined by its value, while ABAP uses strong/static typing where types are defined at declaration. It also covers the six main data types in JavaScript - Null, Undefined, Boolean, String, Number, and Object. Composite types like Array, Date, and Function are considered object types. The document provides examples of declaring and assigning values of different types to variables in JavaScript.
This document discusses object-oriented programming in JavaScript. It covers built-in objects like Object, Function, and Array. It also discusses creating custom objects using constructor functions and prototypes. Constructor functions allow initializing object state, while prototypes allow defining shared object behavior. JavaScript uses prototypal inheritance, where an object inherits directly from another object instance.
An Overview of Deserialization Vulnerabilities in the Java Virtual Machine (J...joaomatosf_
- The document discusses Java object serialization vulnerabilities and remote code execution.
- It provides background on serialization/deserialization and how it can allow object injection and improper input validation.
- A key vulnerability discussed is CVE-2015-7501, which affected Apache Commons Collections and allowed remote code execution through a "gadget chain" triggered during deserialization.
Ruby has several basic data types including integers, floats, strings, symbols, arrays, hashes, and sets. Integers can be Fixnums for smaller whole numbers or Bignums for larger numbers. Arrays can hold a group of values of different types and are defined with square brackets. Hashes use a key-value pair structure with keys that can be strings or symbols. Sets are an unordered collection of unique values that can be created in Ruby.
Правильная работа с часовыми поясами в Rails приложении — DevConf 2015Андрей Новиков
Презентация с рецептами по правильной работе с датой и временем в приложении на Ruby on Rails: как обрабатывать, передавать и хранить данные, чтобы избежать проблем.
This document discusses Ruby data types including numbers, text, arrays, hashes, ranges, symbols, and objects. It provides details on integer and float numbers, strings, string operations, arrays and common array methods, hashes and hash syntax, ranges and how they work, symbols and how they differ from strings, and Ruby objects and operations like equal?, conversions and tainting objects.
This document summarizes Yukihiro "Matz" Matsumoto's keynote speech on why Ruby is a good programming language. Matz discusses how Moore's Law has increased computing power and decreased costs, requiring more and better software. He argues that programming languages can influence human thought as much as natural languages. Ruby aims to be a productive, efficient language that is easy to learn and memorable. Its concise and consistent syntax helps reduce errors. Overall, Ruby is designed to be a fun and inspiring language for programmers.
This technical talk introduces Ruby as a programming language. It provides an overview of Ruby's history, basic features, and differences from other languages like Java and PHP. The document also discusses Ruby on Rails, meta programming in Ruby, and resources for learning Ruby.
17. typedef struct RVALUE {
union {
! struct {
! VALUE flags;
! struct RVALUE *next;
RVALUE !
!
!
} free;
struct RBasic basic;
struct RObject object;
! struct RClass klass;
слоты в куче - это RVALUE !
!
struct RFloat flonum;
struct RString string;
! struct RArray array;
union от всех возможных !
!
struct RRegexp regexp;
struct RHash hash;
системных типов ! struct RData data;
! struct RTypedData typeddata;
! struct RStruct rstruct;
тип определяется по флагам ! struct RBignum bignum;
! struct RFile file;
размер обычно 40 байт !
!
struct RNode node;
struct RMatch match;
! struct RRational rational;
! struct RComplex complex;
} as;
} RVALUE;
18. Корневые объекты
Главный тред и RubyVM
Машинный контекст: стек и регистры
Глобальные константы и переменные
в том числе из нативных гемов
Таблица классов
Generic ivars
Finalizers и at_exit
19. Корневой объект Корневой объект
Obj1 Obj2 Obj4
Obj3 Obj5
Obj7 Obj6
20. Корневой объект Корневой объект
Obj1 Obj2 Obj4
Obj3 Obj5
Obj7 Obj6
22. Mark & Sweep: mark
Корневой объект Корневой объект
Obj1 Obj2 Obj4
Obj3 Obj5
Obj7 Obj6
23. Mark & Sweep: mark
Корневой объект Корневой объект
Obj1 Obj2 Obj4
Obj3 Obj5
Obj7 Obj6
24. Mark & Sweep: sweep
Корневой объект Корневой объект
Obj1 Obj2 Obj4
Obj3
25. Виды ссылок
Из корневых объектов
Переменные класса
Переменные экземпляра
Содержимое контейнеров
Локальные переменные
26. Задачка
class A
def a &b; end;
def initialize
a(&:to_s)
end
end
def closure_method
A.new
end
closure_method
GC.start
puts ObjectSpace.each_object(A){}
что будет выведено на экран?
36. Правильный ответ
MRI кеширует результаты Symbol#to_proc
В замыкание proc может попасть сам объект
Объект и все, на что он ссылается - останется в памяти до
вытеснения из кеша
Это баг в ruby
На экран будет выведена единица
https://gist.github.com/4273437
37. Поиск утечек
Научиться воспроизводить
Понять что именно течет
Снять дамп
Понять почему течет
Дальше по желанию
38. Пример с рельсами
class LeakController < ApplicationController
def leak
($leak ||= []).push proc{ "some never-callback" }
render text: "ololo"
end
end
39. Понять что именно течет
class LeakController < ApplicationController
def leak
($leak ||= []).push proc{ "some never-callback" }
render text: "ololo"
end
def count
GC.start
render :json => HeapDump.count_objects([:ApplicationController] +
ApplicationController.subclasses.map{|c| c.name.to_sym})
end
def dump
fork { HeapDump.dump; exit }
render :text => "May be Dumped"
end
end