This document summarizes Yusuke Endoh's presentation on esoteric and obfuscated Ruby programming at the 2018 Bath Ruby Conference. It discusses programming in Ruby using only limited letters or symbols, and creating self-descriptive and funny Ruby programs. Examples shown include Ruby code using only numbers, underscores, or other limited characters to represent strings, as well as programs that reconstruct themselves when evaluated.
The document discusses various built-in functions in Python including numeric, string, and container data types. It provides examples of using list comprehensions, dictionary comprehensions, lambda functions, enumerate, zip, filter, any, all, map and reduce to manipulate data in Python. It also includes references to online resources for further reading.
The document discusses best practices for securely implementing cryptography and discusses common cryptography algorithms and implementations such as hashing, symmetric encryption, asymmetric encryption, and password hashing. It emphasizes using proven implementations like those in Django and OpenSSL and enabling HTTPS to securely transmit data. The document also cautions that securely managing cryptographic keys is critical for encryption to provide security.
Programming a game involves several phases: setup, running the game, listening for user input and enemy movement, handling world events, and tracking state changes. It is like following a recipe by defining variables for data like eggs and sugar, and functions for actions like whisking and baking. JavaScript and Canvas allow drawing on a web page, like loading an image for a player ship and painting a background. The next step is adding movement to the space game.
The document provides instructions for building a basic space shooter game using JavaScript and canvas. It demonstrates how to load assets like images, handle input events from keyboard keys to control player movement, create enemy objects that move across the screen, detect collisions between lasers and enemies, and add game states to track lives and score. The game loop redraws the game objects on an interval to animate their movement. Event handling is implemented through an event emitter to avoid messy code. The final sections provide a demo of the moving game elements and lasers firing, along with tips for continuing to learn game development.
Nestoria is a property search engine that indexes millions of properties every day. Since mid 2006 the product has evolved into a service must run on multiple devices and browsers. In this talk I introduce Nestoria New Design and the context in which this project was born, and discuss some of the challenges our company has faced during the project. This talk was presented as part of the Commercial Computing Lecture Series at the University of Birmingham.
The document discusses using HTML5 and JavaScript to create games. It provides an overview of key game development concepts like media resource control, graphics acceleration, and networking protocols. It then introduces Crafty, an open source JavaScript game engine, demonstrating how to set up a game scene, control sprites, handle player input, fire bullets, and spawn asteroids using Crafty's component-based system.
The document discusses the features of document databases, key-value stores, and relational databases. It provides examples of storing and querying document data using JavaScript objects and MongoDB. It notes that document databases allow storing rich, schema-less documents and require less querying than relational databases. The presentation argues that document databases are well-suited for dynamic, flexible data like blogs and user data, and are easier to develop for than relational databases in many cases. It acknowledges tradeoffs around ACID compliance and durability in single-server setups.
This document discusses using MongoDB as an alternative to PostgreSQL. It provides examples of using MongoDB with PHP and Lithium frameworks. Key points include:
- MongoDB can be used instead of PostgreSQL for applications with dynamic schemas and large amounts of data.
- The document shows examples of basic CRUD operations in MongoDB using PHP drivers and comparisons to PostgreSQL queries.
- Importing and exporting data from MongoDB in JSON or extended JSON formats is covered, including date handling differences from traditional RDBMS.
- Server-side programming in MongoDB using JavaScript is mentioned as an advantage over traditional databases.
The document discusses various built-in functions in Python including numeric, string, and container data types. It provides examples of using list comprehensions, dictionary comprehensions, lambda functions, enumerate, zip, filter, any, all, map and reduce to manipulate data in Python. It also includes references to online resources for further reading.
The document discusses best practices for securely implementing cryptography and discusses common cryptography algorithms and implementations such as hashing, symmetric encryption, asymmetric encryption, and password hashing. It emphasizes using proven implementations like those in Django and OpenSSL and enabling HTTPS to securely transmit data. The document also cautions that securely managing cryptographic keys is critical for encryption to provide security.
Programming a game involves several phases: setup, running the game, listening for user input and enemy movement, handling world events, and tracking state changes. It is like following a recipe by defining variables for data like eggs and sugar, and functions for actions like whisking and baking. JavaScript and Canvas allow drawing on a web page, like loading an image for a player ship and painting a background. The next step is adding movement to the space game.
The document provides instructions for building a basic space shooter game using JavaScript and canvas. It demonstrates how to load assets like images, handle input events from keyboard keys to control player movement, create enemy objects that move across the screen, detect collisions between lasers and enemies, and add game states to track lives and score. The game loop redraws the game objects on an interval to animate their movement. Event handling is implemented through an event emitter to avoid messy code. The final sections provide a demo of the moving game elements and lasers firing, along with tips for continuing to learn game development.
Nestoria is a property search engine that indexes millions of properties every day. Since mid 2006 the product has evolved into a service must run on multiple devices and browsers. In this talk I introduce Nestoria New Design and the context in which this project was born, and discuss some of the challenges our company has faced during the project. This talk was presented as part of the Commercial Computing Lecture Series at the University of Birmingham.
The document discusses using HTML5 and JavaScript to create games. It provides an overview of key game development concepts like media resource control, graphics acceleration, and networking protocols. It then introduces Crafty, an open source JavaScript game engine, demonstrating how to set up a game scene, control sprites, handle player input, fire bullets, and spawn asteroids using Crafty's component-based system.
The document discusses the features of document databases, key-value stores, and relational databases. It provides examples of storing and querying document data using JavaScript objects and MongoDB. It notes that document databases allow storing rich, schema-less documents and require less querying than relational databases. The presentation argues that document databases are well-suited for dynamic, flexible data like blogs and user data, and are easier to develop for than relational databases in many cases. It acknowledges tradeoffs around ACID compliance and durability in single-server setups.
This document discusses using MongoDB as an alternative to PostgreSQL. It provides examples of using MongoDB with PHP and Lithium frameworks. Key points include:
- MongoDB can be used instead of PostgreSQL for applications with dynamic schemas and large amounts of data.
- The document shows examples of basic CRUD operations in MongoDB using PHP drivers and comparisons to PostgreSQL queries.
- Importing and exporting data from MongoDB in JSON or extended JSON formats is covered, including date handling differences from traditional RDBMS.
- Server-side programming in MongoDB using JavaScript is mentioned as an advantage over traditional databases.
The document discusses the JavaScript utility library Lodash and whether it is needed. It notes that Lodash provides many useful functions but that modern JavaScript, including ES5 and ES6, include array and object methods that provide similar functionality to Lodash functions like map, filter, reduce, forEach, find, includes, merge, keys and values. The document recommends using built-in JavaScript methods over Lodash where possible but importing individual Lodash functions if a needed function is not supported by a target browser.
The document discusses RxJS, a library for reactive programming using Observables that provide an API for asynchronous programming with observable streams. It provides code examples of using RxJS to handle events, AJAX requests, and animations as Observables. It also compares RxJS to Promises and native JavaScript event handling, and lists several frameworks that use RxJS like Angular and Redux.
The Ring programming language version 1.5.4 book - Part 40 of 185Mahmoud Samir Fayed
This document discusses using the Ring programming language to build web applications with CGI (Common Gateway Interface). It provides examples of:
1. Configuring Apache web server to support Ring CGI files with the .ring extension.
2. A basic "Hello World" Ring CGI program and one using the Web library to generate HTML.
3. An example of an HTTP GET form to collect user data and display it, demonstrating features of the Web library like generating forms, tables, text boxes.
4. It outlines other Web library features like files upload, templates, and CRUD/users samples to quickly create web apps in Ring.
Universal JavaScript allows rendering the same JavaScript code on both the server and client. It involves:
1. Server-rendering the initial HTML and JavaScript for faster load times and SEO.
2. Hydrating the server-rendered app with client-side JavaScript to support interactivity.
3. Bundling both server and client code together to share components and logic between server and client rendering.
This document discusses CouchDB and a project called sensmon that uses CouchDB to store sensor data from an Arduino. Key points:
- Motokazu Nishimura introduces CouchDB and its features like JavaScript and JSON support.
- The sensmon project collects data from an Arduino's sensors and stores it in CouchDB using HTTP POST requests.
- Data is visualized from CouchDB views using the Flot library to plot temperature over time.
- A related project, sensmon-calendar, uses CouchDB map/reduce to summarize temperature data by day.
The document describes how to perform analytics using MongoDB without exporting the data to a relational database. It discusses iterating on queries to understand the data schema and metrics, developing queries to calculate metrics, and operationalizing the results into dashboards. The process involves projecting and transforming the data through aggregation pipelines to group and calculate values like counts and sums on the metrics of interest.
Cukeup nyc ian dees on elixir, erlang, and cucumberlSkills Matter
Elixir, Erlang, and Cucumberl
Elixir is a new Ruby-inspired programming language that uses the powerful concurrent machinery of Erlang behind the scenes. Cucumberl is a port of Cucumber to Erlang. Let's see what happens when we put them together.
In this talk, we'll discuss:
How Erlang's concurrency makes it easier to write robust programs
Elixir's approachable syntax
How to test Erlang and Elixir programs using Cucumberl
Attendees will walk away with a solid introduction to the principles of Erlang, and an appreciation of the way Elixir brings the joy of Ruby to the solidity of the Erlang runtime.
Amir Salihefendic: Redis - the hacker's databaseit-people
Redis, the hacker's database:
- simple_queue: feature set, comparison with Celery and Rq
- redis_graph: available options, integration with other tools, and the big-O performance
- bitmapist, idea, archtecture, reports based on cohorts
- optionally: tagged-logger / ormist (lightweight Object-to-Redis mapper)
- optionally: scripting possibility of Lua, Lua-jit (almost as fast as C)
This document contains a presentation on Python programming. It introduces Python basics like printing "Hello World", using Python as a calculator, strings and other data types, functions, classes, conditional statements like if/else, and repetition with while loops. The presentation covers Python concepts in 10 sections and includes code examples for each topic.
The document describes the structure of various user activity log collections stored in different databases. It includes collections for errors, access logs, attribute changes, status changes, and purchase charges with details on the fields captured for each user event.
The document discusses MongoDB's aggregation framework. It provides examples of using aggregation operations like $group, $match, $sort, $limit, $project, and $unwind to summarize and analyze data. Specifically, it shows examples of counting campgrounds by rating, finding the top cities for campgrounds, finding the most appearing comic book characters, and analyzing data on "geeks" in Paris. The document also discusses how indexes can optimize aggregation pipelines and how pipelines can be split between shards for performance.
Test driven game development silly, stupid or inspired?Eric Smith
The document contains code snippets written in C++ and C# for a game. It discusses scheduling repeated method calls, testing a scheduler class, loading game assets and levels, and testing level loading. It also contains code for a state machine, updating the view, and shared interfaces between classes.
Desarrollo de módulos en Drupal e integración con dispositivos móvilesLuis Curo Salvatierra
Drupal allows developers to create modules that extend its functionality. Modules can define nodes, blocks, forms, permissions and interact with Drupal's database and layers using hooks. Developers can create custom content types, blocks, and forms as well as define permissions and schema using hooks like hook_node_info(), hook_block(), hook_form(), hook_perm(), and hook_schema(). Modules interact with the database for operations like insert, update, delete using the database abstraction layer and hooks like hook_load(), hook_insert(), hook_update(), hook_delete(). This allows Drupal to be extended and customized for different use cases.
Our favorite language is now powering everything from event-driven servers to robots to Git clients to 3D games. The JavaScript package ecosystem has quickly outpaced past that of most other languages, allowing our vibrant community to showcase their talent. The front-end framework war has been taken to the next level, with heavy-hitters like Ember and Angular ushering in the new generation of long-lived, component-based web apps. The extensible web movement, spearheaded by the newly-reformed W3C Technical Architecture Group, has promised to place JavaScript squarely at the foundation of the web platform. Now, the language improvements of ES6 are slowly but surely making their way into the mainstream— witness the recent interest in using generators for async programming. And all the while, whispers of ES7 features are starting to circulate…
JavaScript has grown up. Now it's time to see how far it can go.
The Ring programming language version 1.9 book - Part 48 of 210Mahmoud Samir Fayed
The document discusses using the Natural library in Ring to define a domain-specific language for natural language commands. It provides an example program that:
1) Loads the Natural library and defines a new NaturalLanguage class to set up the language name, commands path, and package name.
2) Defines two sample commands - Hello and Count - in separate files that are called by the language.
3) Runs a sample natural language program file containing usages of those commands and outputs the results.
4) Explains how to define new commands using the DefineNaturalCommand object's syntax methods, and provides examples of different command syntax definitions.
5) Optionally allows setting operators to enclose commands for a L
The document describes a game where the player controls buckets that can move left and right. It includes code for modeling the buckets, tests to verify the buckets can move, and code for a sprite to represent the buckets on screen. It then expands on this to add a bomber that moves between random locations, drops bombs, and has its own sprite. Tests are included to verify the bomber's behavior.
Processing is a data visualization programming language built on top of Java. It has a strictly typed structure with classes and inheritance. The language uses setup() and draw() methods similarly to OpenGL, with draw() being called continuously. Processing can be used to draw shapes and images, perform math functions, and manipulate the canvas through transformations. It has also been ported to JavaScript as Processing.js to run on HTML5 canvases in web browsers.
The document provides an overview of the Ruby programming language with sections on installation, data types, operators, control structures, methods, classes and modules. It discusses key aspects of Ruby like its object oriented nature, dynamic typing, syntax and cross-platform capabilities. The document serves as a quick tour of the Ruby language covering its basic concepts, structures and features.
This document contains details about a student project titled "TicketBEKA?" for online ticket booking. It includes the student's name and details, project details on the subject and title. It describes the need for an online ticket booking system and outlines the coding done using Python and MySQL to allow users to book movie, play and sports tickets. It discusses hardware and software requirements, database tables, screenshots of the Python code and interface, and future enhancements that could be made. It concludes with thanking those who helped and sources consulted.
Michael Schwern presents Method::Signatures, a module that allows defining Perl subroutines with function signatures in a syntax inspired by Perl 6. It works by rewriting the code at compile time using Devel::Declare rather than a source filter. Key features demonstrated include required and optional parameters, named and positional arguments, aliases, and more. While powerful, the module is still a work in progress, with debugging support and better error handling needing further work. The goal is to implement a "signatures" pragma for inclusion in Perl 5.
This document summarizes the key changes between Ruby 1.8 and Ruby 1.9. Some major changes include improved performance, new syntax features like hash and proc literals, changes to the parser and standard library, improved regular expressions, and new enumerable methods. Ruby 1.9 also introduced better multilingual support through encoding changes to strings. Overall, the document outlines many backwards incompatible changes and warns that Ruby 1.9 is transitional as it prepares for Ruby 2.0.
The document discusses the JavaScript utility library Lodash and whether it is needed. It notes that Lodash provides many useful functions but that modern JavaScript, including ES5 and ES6, include array and object methods that provide similar functionality to Lodash functions like map, filter, reduce, forEach, find, includes, merge, keys and values. The document recommends using built-in JavaScript methods over Lodash where possible but importing individual Lodash functions if a needed function is not supported by a target browser.
The document discusses RxJS, a library for reactive programming using Observables that provide an API for asynchronous programming with observable streams. It provides code examples of using RxJS to handle events, AJAX requests, and animations as Observables. It also compares RxJS to Promises and native JavaScript event handling, and lists several frameworks that use RxJS like Angular and Redux.
The Ring programming language version 1.5.4 book - Part 40 of 185Mahmoud Samir Fayed
This document discusses using the Ring programming language to build web applications with CGI (Common Gateway Interface). It provides examples of:
1. Configuring Apache web server to support Ring CGI files with the .ring extension.
2. A basic "Hello World" Ring CGI program and one using the Web library to generate HTML.
3. An example of an HTTP GET form to collect user data and display it, demonstrating features of the Web library like generating forms, tables, text boxes.
4. It outlines other Web library features like files upload, templates, and CRUD/users samples to quickly create web apps in Ring.
Universal JavaScript allows rendering the same JavaScript code on both the server and client. It involves:
1. Server-rendering the initial HTML and JavaScript for faster load times and SEO.
2. Hydrating the server-rendered app with client-side JavaScript to support interactivity.
3. Bundling both server and client code together to share components and logic between server and client rendering.
This document discusses CouchDB and a project called sensmon that uses CouchDB to store sensor data from an Arduino. Key points:
- Motokazu Nishimura introduces CouchDB and its features like JavaScript and JSON support.
- The sensmon project collects data from an Arduino's sensors and stores it in CouchDB using HTTP POST requests.
- Data is visualized from CouchDB views using the Flot library to plot temperature over time.
- A related project, sensmon-calendar, uses CouchDB map/reduce to summarize temperature data by day.
The document describes how to perform analytics using MongoDB without exporting the data to a relational database. It discusses iterating on queries to understand the data schema and metrics, developing queries to calculate metrics, and operationalizing the results into dashboards. The process involves projecting and transforming the data through aggregation pipelines to group and calculate values like counts and sums on the metrics of interest.
Cukeup nyc ian dees on elixir, erlang, and cucumberlSkills Matter
Elixir, Erlang, and Cucumberl
Elixir is a new Ruby-inspired programming language that uses the powerful concurrent machinery of Erlang behind the scenes. Cucumberl is a port of Cucumber to Erlang. Let's see what happens when we put them together.
In this talk, we'll discuss:
How Erlang's concurrency makes it easier to write robust programs
Elixir's approachable syntax
How to test Erlang and Elixir programs using Cucumberl
Attendees will walk away with a solid introduction to the principles of Erlang, and an appreciation of the way Elixir brings the joy of Ruby to the solidity of the Erlang runtime.
Amir Salihefendic: Redis - the hacker's databaseit-people
Redis, the hacker's database:
- simple_queue: feature set, comparison with Celery and Rq
- redis_graph: available options, integration with other tools, and the big-O performance
- bitmapist, idea, archtecture, reports based on cohorts
- optionally: tagged-logger / ormist (lightweight Object-to-Redis mapper)
- optionally: scripting possibility of Lua, Lua-jit (almost as fast as C)
This document contains a presentation on Python programming. It introduces Python basics like printing "Hello World", using Python as a calculator, strings and other data types, functions, classes, conditional statements like if/else, and repetition with while loops. The presentation covers Python concepts in 10 sections and includes code examples for each topic.
The document describes the structure of various user activity log collections stored in different databases. It includes collections for errors, access logs, attribute changes, status changes, and purchase charges with details on the fields captured for each user event.
The document discusses MongoDB's aggregation framework. It provides examples of using aggregation operations like $group, $match, $sort, $limit, $project, and $unwind to summarize and analyze data. Specifically, it shows examples of counting campgrounds by rating, finding the top cities for campgrounds, finding the most appearing comic book characters, and analyzing data on "geeks" in Paris. The document also discusses how indexes can optimize aggregation pipelines and how pipelines can be split between shards for performance.
Test driven game development silly, stupid or inspired?Eric Smith
The document contains code snippets written in C++ and C# for a game. It discusses scheduling repeated method calls, testing a scheduler class, loading game assets and levels, and testing level loading. It also contains code for a state machine, updating the view, and shared interfaces between classes.
Desarrollo de módulos en Drupal e integración con dispositivos móvilesLuis Curo Salvatierra
Drupal allows developers to create modules that extend its functionality. Modules can define nodes, blocks, forms, permissions and interact with Drupal's database and layers using hooks. Developers can create custom content types, blocks, and forms as well as define permissions and schema using hooks like hook_node_info(), hook_block(), hook_form(), hook_perm(), and hook_schema(). Modules interact with the database for operations like insert, update, delete using the database abstraction layer and hooks like hook_load(), hook_insert(), hook_update(), hook_delete(). This allows Drupal to be extended and customized for different use cases.
Our favorite language is now powering everything from event-driven servers to robots to Git clients to 3D games. The JavaScript package ecosystem has quickly outpaced past that of most other languages, allowing our vibrant community to showcase their talent. The front-end framework war has been taken to the next level, with heavy-hitters like Ember and Angular ushering in the new generation of long-lived, component-based web apps. The extensible web movement, spearheaded by the newly-reformed W3C Technical Architecture Group, has promised to place JavaScript squarely at the foundation of the web platform. Now, the language improvements of ES6 are slowly but surely making their way into the mainstream— witness the recent interest in using generators for async programming. And all the while, whispers of ES7 features are starting to circulate…
JavaScript has grown up. Now it's time to see how far it can go.
The Ring programming language version 1.9 book - Part 48 of 210Mahmoud Samir Fayed
The document discusses using the Natural library in Ring to define a domain-specific language for natural language commands. It provides an example program that:
1) Loads the Natural library and defines a new NaturalLanguage class to set up the language name, commands path, and package name.
2) Defines two sample commands - Hello and Count - in separate files that are called by the language.
3) Runs a sample natural language program file containing usages of those commands and outputs the results.
4) Explains how to define new commands using the DefineNaturalCommand object's syntax methods, and provides examples of different command syntax definitions.
5) Optionally allows setting operators to enclose commands for a L
The document describes a game where the player controls buckets that can move left and right. It includes code for modeling the buckets, tests to verify the buckets can move, and code for a sprite to represent the buckets on screen. It then expands on this to add a bomber that moves between random locations, drops bombs, and has its own sprite. Tests are included to verify the bomber's behavior.
Processing is a data visualization programming language built on top of Java. It has a strictly typed structure with classes and inheritance. The language uses setup() and draw() methods similarly to OpenGL, with draw() being called continuously. Processing can be used to draw shapes and images, perform math functions, and manipulate the canvas through transformations. It has also been ported to JavaScript as Processing.js to run on HTML5 canvases in web browsers.
The document provides an overview of the Ruby programming language with sections on installation, data types, operators, control structures, methods, classes and modules. It discusses key aspects of Ruby like its object oriented nature, dynamic typing, syntax and cross-platform capabilities. The document serves as a quick tour of the Ruby language covering its basic concepts, structures and features.
This document contains details about a student project titled "TicketBEKA?" for online ticket booking. It includes the student's name and details, project details on the subject and title. It describes the need for an online ticket booking system and outlines the coding done using Python and MySQL to allow users to book movie, play and sports tickets. It discusses hardware and software requirements, database tables, screenshots of the Python code and interface, and future enhancements that could be made. It concludes with thanking those who helped and sources consulted.
Michael Schwern presents Method::Signatures, a module that allows defining Perl subroutines with function signatures in a syntax inspired by Perl 6. It works by rewriting the code at compile time using Devel::Declare rather than a source filter. Key features demonstrated include required and optional parameters, named and positional arguments, aliases, and more. While powerful, the module is still a work in progress, with debugging support and better error handling needing further work. The goal is to implement a "signatures" pragma for inclusion in Perl 5.
This document summarizes the key changes between Ruby 1.8 and Ruby 1.9. Some major changes include improved performance, new syntax features like hash and proc literals, changes to the parser and standard library, improved regular expressions, and new enumerable methods. Ruby 1.9 also introduced better multilingual support through encoding changes to strings. Overall, the document outlines many backwards incompatible changes and warns that Ruby 1.9 is transitional as it prepares for Ruby 2.0.
The document discusses techniques for writing readable code, including:
- Code should be easy for others to understand by using clear naming conventions, comments only where needed, and simple control flow.
- Surface-level readability can be improved through specific and unambiguous naming, consistent formatting, and avoiding overly long or generic names.
- Loops and logic should read like natural language to make the flow of execution easy to follow. This includes ordering conditional statements positively first and breaking down complex expressions.
- Code can be made more scannable through proper indentation and grouping of related lines together into blocks. Overall the goal is to minimize the time it takes someone new to understand the code.
PostgreSQL as seen by Rubyists (Kaigi on Rails 2022)Андрей Новиков
PostgreSQL has become the most popular RDBMS in the Ruby ecosystem in the last decade. It has a great set of built-in features, including a variety of versatile data types, both common and very specific.
But when we load data from the database to our application code, we're working with Ruby data types: classes from the standard library, Rails, or other gems. So while they can seem to be the same as their PostgreSQL counterparts, they are not absolutely identical, and sometimes that could lead to surprising behavior.
In this talk, I would like to explore the power of data types in PostgreSQL and Ruby and how to work with them properly to use both Ruby and PostgreSQL on 100% of their power!
RubyEnRails2007 - Dr Nic Williams - DIY SyntaxDr Nic Williams
The document discusses various ways to improve Ruby and ActiveRecord syntax through custom methods and techniques like method missing. It provides examples of mapping database queries to method calls for cleaner code, handling multi-database connections, and generating classes on demand through constant missing. The overall goal is to explore how Ruby syntax and patterns can be enhanced for more readable and intuitive code.
This document summarizes garbage collection in Ruby. It discusses the mark-and-sweep algorithm used in Ruby 1.8 and the introduction of lazy sweeping in Ruby 1.9.3 to improve performance. Ruby 2.0 switched to a bitmap marking GC and rewrote the mark phase to be non-recursive. Ruby 2.1 introduced new tuning variables, RGenGC with generational collection, and GC events. The document also briefly discusses memory management approaches in other languages like Python.
He will start you at the beginning and cover prerequisites; setting up your development environment first. Afterward, you will use npm to install react-native-cli. The CLI is our go to tool. We use it to create and deploy our app.
Next, you will explore the code. React Native will look familiar to all React developers since it is React. The main difference between React on the browser and a mobile device is the lack of a DOM. We take a look a many of the different UI components that are available.
With React Native you have access to all of the devices hardware features like cameras, GPS, fingerprint reader and more. So we'll show some JavaScript code samples demonstrating it. We will wrap up the evening by deploying our app to both iOS and Android devices and with tips on getting ready for both devices stores.
Groovy is a dynamic language for the Java Virtual Machine that aims to bring dynamic capabilities like Python and Ruby to Java developers. It has many features inspired by dynamic languages like closures, duck typing and metaprogramming, but also maintains compatibility with Java by having a Java-like syntax and the ability to interoperate with Java code. Groovy code can either be run directly from scripts or compiled into Java bytecode to be used within Java applications.
A Recovering Java Developer Learns to GoMatt Stine
As presented at OSCON 2014.
The Go programming language has emerged as a favorite tool of DevOps and cloud practitioners alike. In many ways, Go is more famous for what it doesn’t include than what it does, and co-author Rob Pike has said that Go represents a “less is more” approach to language design.
The Cloud Foundry engineering teams have steadily increased their use of Go for building components, starting with the Router, and progressing through Loggregator, the CLI, and more recently the Health Manager. As a “recovering-Java-developer-turned-DevOps-junkie” focused on helping our customers and community succeed with Cloud Foundry, it became very clear to me that I needed to add Go to my knowledge portfolio.
This talk will introduce Go and its distinctives to Java developers looking to add Go to their toolkits. We’ll cover Go vs. Java in terms of:
* type systems
* modularity
* programming idioms
* object-oriented constructs
* concurrency
Ruby is an object-oriented scripting language that is dynamically typed and supports duck typing. It was created in the 1990s by Yukihiro "Matz" Matsumoto and has gained popularity through its use in web frameworks like Ruby on Rails. This document provides an overview of the Ruby language, including its history, basic syntax like strings and methods, core data types, control structures, classes and inheritance. It also discusses tools used by Ruby developers like RubyGems, interactive Ruby shells, and practical applications of Ruby for web development, testing, and automation through scripting. Finally, it mentions the international Ruby community and local user groups.
This document discusses language boxes, which allow for modular and composable language extensions to a host language. Language boxes provide mechanisms for making fine-grained language changes, scoping those changes, and integrating tools like editors and debuggers. Language changes are represented as transformations to the host language's grammar. Dynamic grammars allow grammars to execute behaviors at runtime instead of during compilation. Language boxes support multiple coexisting language extensions through grammar transformations and avoid conflicts between extensions.
This document provides an overview of the IronRuby programming language and how it allows Ruby code to run on the .NET Common Language Runtime (CLR).
Some key points covered include:
- IronRuby allows Ruby code to leverage .NET libraries and frameworks like ASP.NET and WPF.
- The Dynamic Language Runtime (DLR) plays a key role in enabling IronRuby to run Ruby code on the CLR.
- IronRuby makes it possible to embed and extend C# applications with Ruby code through features like MEF.
- This merging of Ruby and .NET opens up new possibilities for developers to choose the right language for each task and blend multiple languages together in a single application.
Ruby was created in 1995 by Yukihiro Matsumoto who wanted a scripting language more powerful than Perl and more object-oriented than Python. It draws inspiration from Perl for its syntax, Smalltalk for its object model, and Lisp for its meta-programming capabilities. Ruby is an interpreted, object-oriented language with dynamic typing where everything is an object and supports features like classes, modules, blocks and iterators. The Ruby on Rails framework further popularized Ruby for web development.
In celebration of Maker Week, the Virginia Tech Northern Virginia Center hosted a 3DPrinting Day. This presentation is on how to use OpenSCAD (http://openscad.org) for 3D modeling.
Gisting is an implementation of Google\'s MapReduce framework for processing and extracting useful information from very large data sets. At the time of this writing, the code is available for PREVIEW at http://github.com/mchung/gisting. I am currently working to release this framework for general usage.
Esoteric, Obfuscated, Artistic Programming in Rubymametter
The document describes a talk given by Yusuke Endoh on esoteric and obfuscated programming in Ruby. Some key points:
- Endoh is a committer for MRI Ruby and works on performance improvements at Cookpad.
- He demonstrates programming in Ruby using only symbol characters to produce "Hello, World!" output.
- Endoh also shows code written using only alphabetic characters to produce the same output, by abusing features of Ruby's open classes and control structures.
- The goal is to explore Ruby's power and flexibility by writing very unusual code, inspired by esoteric programming languages like Brainfuck.
Ruby plays to many programming paradigms. It's an object-oriented language that can be used in a functional or an imperative/procedural way. But Ruby does not often get used as a logic programming language. In this talk I'll explore logic programming using Ruby. What is it, and is it a tool you want to add to your toolbox? We'll touch on several libraries, we'll primary look at an implementation of minikanren (http://minikanren.org/) for Ruby.
This document provides a summary of Taro Matsuzawa's career and activities from 1981 to 2011. It notes that he was involved with various computer-related clubs and organizations in Japan, including English language societies and Linux communities. It also discusses his work on open source projects like Mozilla and Pantomime, an open source email library for iOS.
Similar to Esoteric, Obfuscated, Artistic Programming in Ruby (20)
The document discusses improvements to error diagnostics in Ruby 3.1 through a new feature called error_highlight. It summarizes how error_highlight works, problems encountered during its implementation, and solutions to those problems. Key challenges included ensuring compatibility with error handling tests and logs, correcting incorrect underline locations, and improving support in frameworks like Rails. The feature is now expanded to support more exception types and frameworks through collaboration across the Ruby community.
I apologize, upon reviewing the content I do not feel comfortable executing arbitrary code or summarizing esoteric programs without understanding their purpose or effects. Could you please provide some context about this submission?
Enjoy Ruby Programming in IDE and TypeProfmametter
- TypeProf is a static type analyzer for Ruby that can infer types without annotations by analyzing code and tests.
- A new TypeProf extension for VSCode provides modern IDE features like on-the-fly type checking, method signature hints, and error reporting without needing type annotations.
- The extension demonstrates how TypeProf can enhance the development experience in Ruby by bringing features like autocompletion and error checking traditionally requiring type systems.
TypeProf for IDE: Enrich Development Experience without Annotationsmametter
The document discusses TypeProf for IDE, a VSCode extension powered by TypeProf, a static type analyzer for Ruby. It allows achieving aspects of modern development experience like on-the-fly error reporting and type inference without type annotations. The demo shows features like method signature hints, error reporting, and completion working through the language server protocol. Future work includes improving parser robustness and optimizing analysis performance.
Type Profiler: Ambitious Type Inference for Ruby 3mametter
Type Profiler is a tool that performs type inference for Ruby code without requiring any type annotations. It analyzes Ruby code and generates type signatures in the RBS format. The goals of Type Profiler are to enable better tooling support for Ruby like autocompletion, catch bugs earlier, and provide type-guided development experiences. It uses inter-procedural analysis to infer types based on method usages rather than just analyzing methods in isolation. Type Profiler was demonstrated on simple, real-world, and library code examples, generating RBS that was mostly accurate while also highlighting current limitations. Future plans include improving support for more Ruby features and frameworks to enable analyzing plain Ruby code and applications.
A Static Type Analyzer of Untyped Ruby Code for Ruby 3mametter
- Matz's plan for Ruby 3 includes Ruby Signature (RBS), Type inference for non-annotated code (Type Profiler), and type checking for annotated code.
- RBS is the standard language for describing Ruby program types and will ship with Ruby 3. Type Profiler infers types for non-annotated Ruby code by running code in a "type-level".
- A demonstration of Type Profiler showed it generating prototypes of signatures for the ao.rb and optcarrot codebases in under a minute, though improvements are still needed to handle more language features.
This document summarizes Yusuke Endoh's talk on plans for Ruby 3 types. It discusses Matz's plan to include type signatures in Ruby 3 to enable optional static type checking. Two approaches are proposed: 1) A level-1 type checker without signatures that can detect possible errors through type inference. 2) A level-2 checker with signatures that verifies code complies with provided signatures. The talk introduces Type Profiler, an experimental tool that uses abstract interpretation to infer types in Ruby code and detect possible errors, as an example of approach 1. The goal is to enable static analysis with little impact on the Ruby programming experience.
A Type-level Ruby Interpreter for Testing and Understandingmametter
Type Profiler is a type analyzer for Ruby 3 that analyzes non-annotated Ruby code. It runs Ruby code at the type level to find potential errors and prototype type signatures. It forks execution for branches and reuses results when possible. While not perfect, it provides basic type checking capabilities for Ruby without requiring type annotations. The author acknowledges limitations and many areas for future work to improve Type Profiler.
This document summarizes a talk given by Yusuke Endoh on transcendental programming in Ruby. It discusses encoding an entire Ruby program as a double helix DNA sequence using Gödel numbering and then decoding and executing it. It also presents a Ruby program that generates a QR code encoding the string "Hello World" and another that acts as a quine, clock, and font generator by outputting the current time as ASCII art code.
Cookpad Hackarade #04: Create Your Own Interpretermametter
The document describes a hackarade session on writing a Ruby interpreter in Ruby. The goal is to write a "MinRuby" interpreter that implements a small subset of Ruby and runs Ruby programs. It provides a parser gem and evaluator skeleton. The tasks are to complete the evaluator by solving problems like arithmetic, variables, branches, functions etc and make all test programs pass. More advanced problems include writing the parser and supporting more features. The files are available online for reference.
This document summarizes the results of TRICK 2018, a contest for esoteric Ruby programming. It announces the winners in various categories as judged by a panel. The winners include programs that generate the maximum number of warnings, function as a minimal interactive Ruby interpreter, render a 3D Christmas tree visualization, use Unicode spaces creatively, and push Ruby's syntax to its limits in confusing yet valid ways. The judges provide comments praising the clever techniques and achievements in obfuscating Ruby code.
Hellfest 2024 Reveals The Guardian of Darkness.docxNevesxtee
Two years after debuting their massive 15-meter Lemmy sculpture, the French rock and metal festival Hellfest has unveiled another stunning installation: La Gardienne des Tenebres
Bad Cinderella vs The Heist at the Ball.pptxmijilata
This powerpoint summarizes and compares the book The Heist at the Ball by J.M. Knight and the musical Bad Cinderella by Andrew Lloyd webber. version 1 since I will probably have to redo it later
Bad Cinderella is a 2021 musical that ran on Broadway for 12 months and abruptly shut down. ALW actually had a little controversy at the end because hd didn't show up to the last show and instead wrote a letter for the stars to read after taking their bows. The show received mostly bad reviews,
similar to The Heist at the Ball by J.M. Knight, which is a book very similar about a boy who wants to rob a castle and make money for his girl. It's also a cinderella story but instead of her being the main character it's her love interest. There was bad reception for this too. Thought it would be funny to compare.
The Adventures of Captain Carrottop - If you like it, enter the sitemyloveking96
The sun was setting over the city, casting a warm orange glow over the towering skyscrapers. Captain Carrottop, with his bright orange hair and green eyes, was perched on the rooftop of the highest building, his carrot-shaped cape fluttering in the gentle breeze. He was on high alert, his super vision scanning the streets below for any sign of trouble
2. And Now for Something
Completely Different — in Ruby
Yusuke Endoh (@mametter)
Cookpad Inc.
Bath Ruby Conference 2018
(2018/03/23)
3. Yusuke Endoh (@mametter)
• MRI committer
– Was the release manager for 2.0
– Implemented coverage.so,
keyword arguments, etc.
• Branch coverage (Ruby 2.5)
• Working at Cookpad Inc.
– Cookpad employs
two full-time Ruby committers
(Koichi Sasada and me)
4. • A recipe sharing platform service
– Monthly Average Users: 90 million
– https://cookpad.com/uk
PR: Cookpad Inc.
5. • A recipe sharing platform service
– Monthly Average Users: 90 million
– https://cookpad.com/uk
PR: Cookpad Inc.
We're hiring!
HQ is in Bristol
Aim to be No.1 in 100 countries
(Now in 22 Languages and 68 Countries)
6. Today's Topic
• "Completely different" Ruby programs
– Ruby can do anything!
• Agenda
– 1. Ruby with limited letters
– 2. Funny, self-descriptive Ruby programs
8. A Ruby program
require "1234567890"
164494982952174876928097944808592
345203368399394864831728762954025
223544083864187912864887414172728
297936126807895282322033562499828
91940559064073941914244494205218
9. Demo
• "Hello, world!" program by using only
numbers
– You can encode not only Hello world,
but also any Ruby programs
$ ruby H3110.rb
Hello, Bath & Bristol Ruby!
$
Hello world only by numbers
11. Internal: Gödel numbering
• A technique to encode
any given string to a natural number
– In: a byte array 𝑛1, 𝑛2, 𝑛3, 𝑛4, 𝑛5, …
– Out:2 𝑛1 × 3 𝑛2 × 5 𝑛3 × 7 𝑛4 × 11 𝑛5 × ⋯
– To decode it, use prime factorization
• The gem uses much easier way
– Encoding: str.unpack("H*")[0].hex
– Decoding: [num.to_s(16)].pack("H*")
Hello world only by numbers
12. Internal: Ruby's black magic
• How to get the number
– It is just placed at the toplevel of code
• My answer:
– ObjectSpace.each_object(Integer)
• Unsure if this is portable, but it works anyway
– Try to decode all enumerated integers,
identify the desired Ruby code, and eval
– See the source code (32 lines) in detail
• https://github.com/mame/1234567890
Hello world only by numbers
13. How to install
Hello world only by numbers
$ gem install 1234567890_
Don't forget underscore!
(rubygems.org required at least one letter)
15. Demo
• "Hello, world!" program written using
only underscores
$ ruby __hello__.rb
Hello, Bath & Bristol Ruby!
$
Hello world only by "_"
16. Internal: Base-6
• Encode the Gödel number in Base-6
• Represent each digit with underscores
– Use length (n+1) for digit n
• Why base-6 is chosen?
– To minimize the expected code length:
log 𝑏 126 × ൗ𝑏
2 + 1 + 1
Hello world only by "_"
304313…
____ _ _____ ____ __ ____ …
18. Summary
• Ruby beats letter limitation
• More?
– See my RubyConf 2017 talk
begin begin begin public begin begin def each
clear rescue begin begin begin end end end
concat begin dup ensure concat begin clear
concat concat concat concat concat concat size
concat begin begin begin size end end end
begin size end ensure begin clear end end end
concat begin dup ensure concat begin clear
begin concat concat size end until hex
concat concat concat concat begin size end
concat concat begin size end rescue upcase
begin concat begin concat size end end
begin size end ensure begin clear end end end
concat begin dup ensure concat begin clear
concat begin concat size end unless begin end
begin concat concat concat begin size end end
@_="_"=~/$/;_=@_+@_;$><<(""<<(_*_*_+@_)*_*_*_<<
((_+@_)*_*_*_+@_)*_*_+@_<<(((_+@_)*_*_+@_)*_+@_
)*_ *_ << ( ( (_+@_ )*_*_+
@_) * _+ + @_) * _*_ <<((((+
_+@_)*_ * _+ + +@_ )*_+@_)*
_++ @_ )* _ ++@_ <<((_*_+@_
)*_ + + + @_)* _*_ <<_*_*_*_*
_<< ( (_ * _ +@_) *_*_*_++@_
)*_<<(((_++@_)*_+@_)*_*_+@_)*_*_+@_<<((_+@_)*_*
_*_*_ +@_)* _<<( ( (_+ +@_
)*_ ++ @_ ) *_+
@_) *_*_*_+ @_<< ( _* _ *_*_*_++
@_) *_+@_<< (((( _ ++ + +@_)*
_*_ ++ @_ )* _ +@_)*_++
@_)*_ +@_<< (((( _+ + @_)*_*_+
@_)*_+@_)*_+@_)*_<<(((_+@_)*_*_*_+@_)*_+@_)*_<<
_*_*_*_*_+@_<<(_*_+@_)*_)#_$`/^|:()[_-|?|_||:`/
Only symbols Only alphabets
22. Internal
• Reconstruct self
• Reshape itself
as the next number
– Embedded font data
– Fizzbuzz
– Shaping
• Output the result
• Make it "executable
ASCII-art"
Self-descriptive FizzBuzz
eval(s=s=
%w@proc{|
n|z=32.ch
r;k="[#{n
+=1}]";u=
":>==;<==?"[m=n**4
%-15,m+13]||"#{$f=
k}";d="Y.E.#{c=64.
chr}*'')";$f||d<<z
+k;t="eval(s=s=%w#
{c+s=s[0,
334]}#$f#
";25.time
s{|y|m=u.
bytes.map
{|v|t<<s;
(0..[62-v
,2].min).
map{|x|"i
f0zgl11p0
zghuhku744d8hzeg41qtfx7xs7t
wflr".to_i(36)[x+32+v*3-y/5
*44]<1?z*9:t.slice!(0,9)}<<
z}.join.rstrip;y>23&&m[-9,9
]=d;puts(m)}}[1]#pY.E.@*'')
23. Quine
• A program that outputs itself
• Trick
– Step 1. Reconstruct self as a string
– Step 2. Print it
• Additional step makes Quine "funny"
eval s="puts('eval s='+s.inspect)"
Self-descriptive FizzBuzz
25. Executable ASCII-art
• Write a code with no space and backslash
• Wrap it with "eval(%w(" and ").join)"
• You can shape your code as you like
puts"Hello,world!"
eval(%w(puts"Hello,world!").join)
eval(%w(pu
ls "H
el lo
,w or
ld!")*"")#
#=> Hello,world!
27. Quine-relay
• A Ruby code
• that generates Rust code
• that generates Scala code
• …
• that generates REXX code
• that generates the original Ruby code
128 languages
involved
in total
Quine-relay
28. Quine-relay
• A Ruby code
• that generates Rust code
• that generates Scala code
• …
• that generates REXX code
• that generates the original Ruby code
128 languages
involved
in total
Quine-relay
30. Internal
– Step 1. Reconstruct self as a string
– Step 2. Wrap Python's Hello world
– Step 3. Print it
Quine-relay
eval s="puts( 'eval s='+s.dump )"
Ruby's Quine
print( "Hello!" )
+Python's Hello world
eval s="puts('print('+('eval s='+s.dump).dump+')')"
↓RubyPython Quine
31. Internal
• In theory: Repeat this process for 127
languages
• In practical: The naïve approach
explodes the size of intermediate code
– To avoid this problem, it uses many tricks
• compression algorithm
• on-time code generation
• etc.
– See the generator in detail
https://github.com/mame/quine-relay/blob/master/src/code-gen.rb
Quine-relay
32. Monumental Quine
A column object 3D model data
Ruby code
is inscribed
You can buy it at Shapeways!
https://www.shapeways.com/shops/mametter
Execute
the code
3D
printer
33. Internal
• The shorter is code, the cheaper ☺
– 3D printing fee: $15 per one line
– The code does not contain complex-glyph letters
("3", "8", "g") to omit them from font data
33
eval(_=%[b='DEILMQTVY';eval((%[a=(-1)EE0.5;f=->EfVf.each_slice(2)Y;c=->wVz=->dVd.mapVd=d.rotate(1)YY
;Q=->k,l,mV((m-k)E(l-k).conT).arQ<0Y;y=[];x=0.99;o,T=w.partitionV|n|d=0;z[n].mapV|k,l|y<<f[k,x,k,1,l
,1,l,x];d+=k.conTElY;d.arQ<0Y;f[o,T,[[0,d=2IEa,d+15,15]],o.map(Dd=:reverse),T.map(Dd),[]].mapV|o,T|T
.mapV|h|z[h].max_byV|u,|u.realY;Y.sort_byV|i,|-i.realY.mapV|h|i,=h;v=0;o.mapV|n|z[n].mapV|x|m,l,E,k=
x;e=(i-m).arQEE2;v<eDD(d=Q[k,m,l])^(Q[k,m,i]^d|(Q[m,l,i]^d))DDo.allMV|n|z[n].allMV|k,l|[i,m,k,l].uni
q.size<4||Q[i,k,l]==Q[m,k,l]||Q[i,m,k]==Q[i,m,l]YYDD(v=e;w=n;T=Ex,m,Eh,i)YY;w[0..-1]=TY;o.mapV|v|t,=
s=z[v];n=->rVk,m,l=r;k=k[2],l,m[2];r[I]=Q[Ek]DDv.allMV|q|z[k].anyMV|k,l|q==k||Q[k,q,l]YYY;z[s].mapV|
k,l,m|l[0,2]=k,m;n[l]Y;(s[I..-1].mapVt=t[1]until(t[I]);k,m=l=t;m[0],k[1]=t;n[m];n[t=k];lY<<t).mapV|k
,m,l|y<<f[k[2],x,l,x,m[2],x]YY;x=1Y;yY;e=0;%[`^Tx52t<^cd,7/w(kabvbEz5arIwIa17.=c'slxr=-'4|e)EwkMI,_^
pvMVhsnME.rLw_k)^tp>+TIEduE45u>mv%^Y=Vny-`zce)k`heIt%`Vzf;c2nk4d|Vp^D_,,|kDDL2r_sDy%%fiMV6cYE)5`,m/k
YQ/;IEezMVv,QchILY|p%%i<vstDt)=M7vLcT>=4Q2(vwael61//<ck>-l67uQ;2Tq,c_'qEIcm1cL;i++2-tYdbenq%pxr;2'Vn
(uDa)n)zf4w)%5vh;ssV5kI;)z;2=+Toe<VL_D0`VLu;ook_y+eT`>IeT9-(i<MiVdd)ib_y+x`s^_u>M1s/mYQvEY`vMxu%Y0u5
7Qaoh2<Mkd'vtkp^zTc`E->Ep+icop_u0%=-zv,omq`Qz/41DV'`f9L5`M'bVxx%/;qLtq12%q:V'9,fD,ovu%qr|+e+rudI`Ir0
5chVd+Q5`II76rY0laT%b(I>Y%EQ1xf^|r,1)%4--zQa'<qxL-7Y0+|'vvbIxso0usv;%.I:pLQbe5a),Vu|91(0EIv^T>c5Dmd:
9-I15%Lp/>>z57^,Th2>%la0;5`dE1<xvrd09^9zz<.t,LpofrTTsQi'u5;Lwp7+zmm`'>qy;f6)||Ikw_0wdMM5<hmn64wbQ_rD
m'>so7b..4qy`nQrz%Vf7Ii^epY(x=|49Lh(=>sI_sbofb7|qM,unaD%^i:|;_tEEnb-DDt`t%I2h;0x5f^yhs,pbLf+m^e>yqzQ
'%::|^=,5-b=^_1x1se`kp,%wq4T%;'E.:Dsp_V-0||,)=;.a|<%0QY:;t:fEmk:4|_%o-.:aooq/6mThdvz4`uQqY1r'em.5'z1
2p7e%%pp6ebMM,m`5QpYx'd`,`6a4T)6Q.k.E.YsdiE^ox9pyrsr%|(kfn=y9q`6;=V<z%9(0cf^yp=:Irw-c/y>%iie%)y-1i(y
'V-n^uTva%l0Q>,yz;E0:LbV'eTb6MIb``Da.__ihbacxY|fc6>pTtl;ivVt,q>/%w,=hnI+i90>10u59te,Ildw4p94x`iwvs`f
+^)w1M>%wf^].bytesV|i|e=eE59+(i-5)%L9Y;Q=->iVk=e%i;e/=i;kY;d=VI2=>c[[]]Y;54.upto(1I0)V|h|d[h%L9+I7]=
c[(0..Q[5]).mapVl=o=T=[];n=0;(-2..Q[17]).mapV[l=Q[2],o=Q[1I]+Q[21]Ea+1+a]Y.flat_mapV|m,n|E,(h,)=[[o,
l],[(o+o=n)/2,0]][0..lDl=m]Y.mapV|o,l|n=l<1M((n==0ML:1).upto(L)V|k|T<<h+kE(n-h)/4+kEkE(o-2En+h)/64Y;
h=o;0):oY;TY]Y;n=[];m=0;v=aEE0.04;z=15/v.arQ;w=-0.2I;h='eval(_=%['+_+'])';h.tr(b,']+b+%[').bytesV|o|
q=-w+s=wEm+=1;r=vEp=vEEmEz;d[o].mapV|v|n<<v.mapV|v,l|T,k=v.rect;[(p+(r-p)ET/=15)El,q+wET-k]YY;m<101D
Dn+=[f[p,q,r,s,E[r,0]E(m/100),r,2,p,2],f[p,2,r,2,k=rET=0.976,2,TE=p,2],f[T,2,k,2,k,x=-715,T,x],f[T,x
,k,x,r,x,p,x],f[p,x,r,x,r,s-l=690,p,q-l,E[p,x+2]E(1/m)]];Y;T=VY;k=VY;l=''<<I2;m=n.mapV|i|(p,q),(r,s)
,(t,u)=Ei;p-=r;r-=t;Mf+l+i.mapV|m|[[T,:v,Em],[k,:vn,(rE(q-s)-pE(s-u))Ea,(p.conTEr).imaQ]].mapV|T,o,p
,w|T[[o,E(p.rect<<w).mapV|p|(pE500).round/z/10Y]El]||=T.size+1YE'//'YElY;o=''<<I5;puts(%(Q%squine')%
l,o+%V'+(eval(%[Y+h+%V]);exit);'Y,T.keys,k.keys,m,o+M');]).tr(b,'%)27>fiz|'.tr('x%-|','%-'<<125)));'
[[[ Monumental Quine (c) 2015 Yusuke Endoh -- tested with ruby 2.2.1 -- built on 2015/04/01 ]]]'])
Embedded TrueType Font Data
+ Renderer
Triangulation Algorithm
for Font Polygons
3D Model Generator
Monumental Quine
38. Demo
• Works as an ordinary Quine
$ ruby lquine.rb > lquine2.rb
$ diff –s lquine.rb lquine2.rb
lquine.rb and lquine2.rb are identical
Lipogram Quine
41. Demo
• You can delete any one letter
• It automatically restore itself!
$ sed s/a//g lquine.rb > broken.rb
$ ruby broken.rb > broken2.rb
$ diff –s broken.rb broken2.rb
broken.rb and broken2.rb are identical
Lipogram Quine
42. Internal
• Main trick:
– This code executes code2
• The string literal is just ignored
• If "a" is removed:
– This code executes code1 and terminates
Lipogram Quine
"#a{ code1;exit }"; code2
"#{ code1;exit }"; code2
String interpolation!
44. More? Read my book!
• "The World of
Obfuscated,
Esoteric, Artistic
Programming"
– Contains about 40
codes like this talk
– Written in Japanese
45. Related contests
• International Obfuscated C Code Contest
(IOCCC)
– A programming contest for hard-to-read
programs written in C language
• Transcendental Ruby Imbroglio Contest
for rubyKaigi (TRICK)
– The judges (including I) held TRICK twice
– TRICK FINAL is now open (~ 2018/03/31)
• https://github.com/tric/trick2018
• Winners will be awarded at RubyKaigi 2018
46. Conclusion
• Ruby is incredibly flexible
– You can use Ruby with broken keyboards
(only numbers, or only underscores)
– You can write artistic and super-robust
Quine in Ruby
• Ruby Programming is fun
– Even without practicality
– If you like practicality, join
• One more thing…