This document discusses using Gradle for building projects in multiple languages. Gradle's domain specific language is based on Groovy, which allows for concise syntax. Gradle supports building Java, C++, Ruby, and other languages through plugins. It can also be used to build documentation and publish artifacts to repositories. Migrating from other build systems like Ant, Maven, and Make to Gradle is also discussed.
Slides of my talk at the September 2017 adaptTo() conference, Berlin. https://adapt.to/2017/en/schedule/get-the-cattle-out--let-s-build-a-large-scale-sling-rendering-pr.html
Video of that talk at https://www.youtube.com/watch?v=8bH9envZXik
MongoDB World 2018: Tutorial - Got Dibs? Building a Real-Time Bidding App wit...MongoDB
This document provides instructions for setting up a real-time bidding app that uses change streams in MongoDB. It includes steps to:
1. Install prerequisites like MongoDB and Node.js.
2. Create the server including setting up MongoDB, creating API endpoints, and connecting the server to MongoDB.
3. Create the client including making a request to the server API to fetch all documents and render them.
It then outlines future steps to add functionality for placing bids in real-time using change streams. The source code provided includes TODO comments to guide completing the implementation.
The document discusses the Java Content Repository (JCR) and the Sling framework, which builds on JCR to enable scriptable web applications. It provides an overview of using Sling to develop a simple blog application with only 46 lines of code through JavaScript scripts and RESTful interfaces. The document also demonstrates more advanced features of Sling like content observation and generation of image thumbnails through an OSGi bundle.
This document discusses using the mruby programming language as middleware code. Some key points:
- mruby allows embedding Ruby code into middleware applications like web servers. This provides a powerful programming environment for Rubyists to write middleware code.
- ngx_mruby is an example of using mruby with the nginx web server. It allows placing Ruby code handlers and variables in the nginx configuration file.
- Advantages of mruby include producing a single binary without separate Ruby files, and ability to embed Ruby runtime and code directly into middleware applications like web servers.
- The document demonstrates sample ngx_mruby code for content handlers, variables, and initialization/worker scripts. It
The document discusses how to contribute code to the Ruby programming language. It provides instructions for obtaining the Ruby source code, running tests on the Ruby codebase, and submitting patches to the Ruby bug tracking system. The tests include language tests, framework tests, and extension tests. The goal is to help developers get started testing and contributing to the Ruby core.
Large-scaled Deploy Over 100 Servers in 3 MinutesHiroshi SHIBATA
Large-scaled Deploy Over 100 Servers in 3 Minutes
Deployment strategy for next generation involves creating OS images using Packer and cloud-init that allow deploying over 100 servers within 3 minutes through automation. The strategy uses Puppet for configuration management and builds minimal and application-specific images to reduce bootstrap time. All deployment operations are implemented through a CLI tool for rapid and automated scaling.
This talk covers several techniques for extending Ruby programs using C and C++. Examples are shown for foreign function interface techniques, inline native code and a gem that wraps Ruby's C API with C++ classes and templates.
This document discusses using Gradle for building projects in multiple languages. Gradle's domain specific language is based on Groovy, which allows for concise syntax. Gradle supports building Java, C++, Ruby, and other languages through plugins. It can also be used to build documentation and publish artifacts to repositories. Migrating from other build systems like Ant, Maven, and Make to Gradle is also discussed.
Slides of my talk at the September 2017 adaptTo() conference, Berlin. https://adapt.to/2017/en/schedule/get-the-cattle-out--let-s-build-a-large-scale-sling-rendering-pr.html
Video of that talk at https://www.youtube.com/watch?v=8bH9envZXik
MongoDB World 2018: Tutorial - Got Dibs? Building a Real-Time Bidding App wit...MongoDB
This document provides instructions for setting up a real-time bidding app that uses change streams in MongoDB. It includes steps to:
1. Install prerequisites like MongoDB and Node.js.
2. Create the server including setting up MongoDB, creating API endpoints, and connecting the server to MongoDB.
3. Create the client including making a request to the server API to fetch all documents and render them.
It then outlines future steps to add functionality for placing bids in real-time using change streams. The source code provided includes TODO comments to guide completing the implementation.
The document discusses the Java Content Repository (JCR) and the Sling framework, which builds on JCR to enable scriptable web applications. It provides an overview of using Sling to develop a simple blog application with only 46 lines of code through JavaScript scripts and RESTful interfaces. The document also demonstrates more advanced features of Sling like content observation and generation of image thumbnails through an OSGi bundle.
This document discusses using the mruby programming language as middleware code. Some key points:
- mruby allows embedding Ruby code into middleware applications like web servers. This provides a powerful programming environment for Rubyists to write middleware code.
- ngx_mruby is an example of using mruby with the nginx web server. It allows placing Ruby code handlers and variables in the nginx configuration file.
- Advantages of mruby include producing a single binary without separate Ruby files, and ability to embed Ruby runtime and code directly into middleware applications like web servers.
- The document demonstrates sample ngx_mruby code for content handlers, variables, and initialization/worker scripts. It
The document discusses how to contribute code to the Ruby programming language. It provides instructions for obtaining the Ruby source code, running tests on the Ruby codebase, and submitting patches to the Ruby bug tracking system. The tests include language tests, framework tests, and extension tests. The goal is to help developers get started testing and contributing to the Ruby core.
Large-scaled Deploy Over 100 Servers in 3 MinutesHiroshi SHIBATA
Large-scaled Deploy Over 100 Servers in 3 Minutes
Deployment strategy for next generation involves creating OS images using Packer and cloud-init that allow deploying over 100 servers within 3 minutes through automation. The strategy uses Puppet for configuration management and builds minimal and application-specific images to reduce bootstrap time. All deployment operations are implemented through a CLI tool for rapid and automated scaling.
This talk covers several techniques for extending Ruby programs using C and C++. Examples are shown for foreign function interface techniques, inline native code and a gem that wraps Ruby's C API with C++ classes and templates.
Slides used during a Webinar on Feb 11, 2009 that introduces the Day CRX Version 1.4.1. CRX is a content application platform based on JSR-170 and a RESTful web framework. Learn more on www.day.com/crx
The document discusses testing Ruby code used in ngx_mruby, an open source project that embeds the mruby scripting language into the nginx web server. It proposes a testing approach using a dummy implementation of the ngx_mruby API to test the Ruby code in isolation without needing nginx. Sample code shows how to set up dummy request and connection classes to mimic the ngx_mruby environment, as well as a memcached class to test code that interacts with memcached. A skeleton test case demonstrates how to write tests using this approach with the Test::Unit framework to test specific behaviors like restricting requests based on cookie sessions.
This document summarizes a presentation about the future of the Rake gem and domain-specific languages (DSLs) in Ruby.
The presentation discusses:
1. How Rake works as a Make-like program implemented in Ruby syntax with tasks and dependencies. Rake files use standard Ruby syntax.
2. Examples of common patterns for building internal DSLs in Ruby using class/module methods, method definition, implicit/explicit code blocks, and instance evaluation.
3. How popular Ruby gems like Rake, Bundler, and Thor use DSL techniques and inherit from each other to provide domain-specific interfaces.
This document summarizes a presentation given by @joker1007 and @tagomoris on hijacking Ruby syntax. It discusses various Ruby features like bindings, tracepoints, and refinements that can be used to modify Ruby's behavior. It then demonstrates several "hacks" that leverage these features, including finalist, overrider, and abstriker which add method modifiers, and binding_ninja which allows implicitly passing a binding. Other hacks discussed are with_resources and deferral which add "with" and "defer" statements to Ruby. The presentation emphasizes how these modifications are implemented using hooks, bindings, tracepoints and other Ruby internals.
How to develop Jenkins plugin using to ruby and Jenkins.rbHiroshi SHIBATA
- The document discusses developing Jenkins plugins using Ruby and the jpi tool. It covers generating a sample wrapper plugin, configuring the plugin, and building and releasing the plugin through jpi commands.
- The speaker demonstrates creating a sample "rbenv" plugin with jpi to configure Ruby versions and gems for builds.
- Commands like jpi new, generate, build, server and release are used to generate the plugin scaffolding, configure the wrapper, build the plugin file, host it locally for testing, and prepare it for release.
This document provides an overview and examples of using ngx_mruby, which allows embedding the mruby scripting language in the nginx web server. It introduces ngx_mruby and how it works, provides instructions for building and installing ngx_mruby, and gives several code examples for common tasks like content handling, logging, redirection, and authorization using ngx_mruby. Key features covered include accessing nginx variables and requests, sharing data across request phases and worker processes, and integrating mruby gems.
Experiments in Sharing Java VM Technology with CRubyMatthew Gaudet
IBM is developing a just-in-time (JIT) compiler called Testarossa based on its Open Runtime (OMR) toolkit. The goal is to integrate the JIT compiler into MRI Ruby to improve performance without changing how MRI works. So far, the JIT supports most opcodes and can run Rails applications, but performance gains are modest. IBM hopes to collaborate with the Ruby community to further optimize Ruby and help make it faster.
This document discusses testing code written for mruby, a lightweight Ruby implementation. It proposes using the mruby runtime itself to test code, rather than Ruby, by using the mruby-mtest library. This allows testing mruby code directly using the same binaries and libraries as production. Sample code shows how to structure tests and set up a test runner to execute tests against the mruby binary. Testing code with mruby provides faster, more direct testing compared to using Ruby.
Asynchronous I/O in NodeJS - new standard or challenges?Dinh Pham
The document discusses asynchronous I/O in Node.js and compares processing models using processes, threads, and events. It explains how Node.js uses an event-driven and asynchronous model with callbacks to handle non-blocking I/O. It also discusses challenges with callbacks and introduces flow control libraries that can help address issues with readability and debugging of asynchronous code.
This document provides an introduction to testing the Ruby programming language. It discusses how to set up a development environment to run Ruby's core tests, describes the various test suites and tasks, and provides examples of test files. The document encourages contributors to test Ruby by cloning its repository, running the test suites locally, focusing tests in specific areas, and submitting patches for new or updated tests.
The document discusses testing practices for the Ruby programming language. It provides details on how to run various test suites that are part of the Ruby source code repository, including:
1. Running the "make test" command which runs sample tests, known bug tests, and tests defined in the test/ directory.
2. Running "make test-all" which runs core library and standard library tests under the test/ directory.
3. Running "make check" which builds encodings and extensions, runs all test tasks including test frameworks like Test::Unit and Minitest.
4. It also discusses strategies for merging test changes from external repositories like RubyGems and RDoc back into the Ruby source code
Leave end-to-end testing to Capybara. Capybara is a web testing tool that simulates user interactions with a website. It allows automating browser interactions for scenarios and features using domain-specific languages like Cucumber. Capybara supports using different drivers like Selenium for JavaScript interactions and HtmlUnit for non-JavaScript sites. Specifying the driver and JavaScript support in tests allows running tests across different environments.
The document discusses the strategy for building and testing the programming language Hiroshi. It covers:
1. The Ruby Core team which maintains the language and includes over 80 volunteers.
2. The testing strategy for Ruby which involves testing at different levels from the interpreter to libraries. Extensive tests are run on Linux, Windows and macOS.
3. The CI environments used for Ruby development including GitHub Actions, Travis CI and AppVeyor, as well as internal VM clusters. Test results are collected on Ruby CI and discussed on Slack.
JRuby 9000 - Taipei Ruby User's Group 2015Charles Nutter
The document discusses JRuby 9000, a new version of JRuby that runs on a new runtime based on an intermediate representation (IR). Some key points:
- JRuby 9000 includes major performance improvements like just-in-time compiling of blocks and optimized define_method performance.
- The new runtime represents code as IR instructions instead of an AST for better optimization capabilities. It allows registering passes to optimize the IR.
- Future work includes improved inlining, numeric specialization to use primitives on the JVM, and leveraging ahead-of-time compilation capabilities being added to the JVM to improve startup time.
- The overall goal is to continue optimizing JRuby to perform
This document discusses how to create Mackerel plugins using mruby. It explains what Mackerel plugins are, the required format, and how to write command line tools and classes in mruby. It then provides an example of implementing Redis commands like SCARD and SMEMBERS in mruby-redis by reading the C source and making additions. This allows monitoring Redis set data with Mackerel. Finally, it shows a sample Mackerel plugin for monitoring Sidekiq job counts.
Nodejs Event Driven Concurrency for Web ApplicationsGanesh Iyer
We describe the event-driven concurrency model used by Nodejs, a JavaScript server-side scripting platform. An overview of the traditional thread based approach(used by Apache) is also given. We compare both the approaches. An Introduction to Nodejs programming is provided and some useful packages are discussed.
The document discusses a computer programmer who is also a guitarist and leads an Agile software development team. It includes code snippets from programming languages like Ruby. There are also descriptions of using source control tools like Git for managing branches, tags, and cherry-picking commits.
The document summarizes the key points about RubyGems 3 & 4 from Hiroshi SHIBATA's presentation at RubyKaigi 2018. It discusses RubyGems 2.7, including support for older Ruby versions. It then covers plans for RubyGems 3.0, such as removing deprecated code, and RubyGems 4.0, which may include non-backwards compatible changes.
Apache thrift-RPC service cross languagesJimmy Lai
This slides illustrate how to use Apache Thrift for building RPC service and provide demo example code in Python. The example scenario is: we have a prepared machine learning model, and we'd like to load the model in advance as a server for providing prediction service.
introduction-infra-as-a-code using terraformniyof97
This document provides a summary of the challenges faced when manually configuring and deploying infrastructure and applications without using infrastructure as code tools. It describes issues that arose when installing dependencies for a Ruby on Rails application locally and on Amazon EC2 instances. It then introduces infrastructure as code using Docker to containerize applications and define environments as code. Docker images for a Sinatra backend and Rails frontend are built and linked together using Docker Compose. The document advocates for using infrastructure as code tools like Docker and Terraform to avoid manual configuration issues and facilitate consistent deployments across environments.
Slides used during a Webinar on Feb 11, 2009 that introduces the Day CRX Version 1.4.1. CRX is a content application platform based on JSR-170 and a RESTful web framework. Learn more on www.day.com/crx
The document discusses testing Ruby code used in ngx_mruby, an open source project that embeds the mruby scripting language into the nginx web server. It proposes a testing approach using a dummy implementation of the ngx_mruby API to test the Ruby code in isolation without needing nginx. Sample code shows how to set up dummy request and connection classes to mimic the ngx_mruby environment, as well as a memcached class to test code that interacts with memcached. A skeleton test case demonstrates how to write tests using this approach with the Test::Unit framework to test specific behaviors like restricting requests based on cookie sessions.
This document summarizes a presentation about the future of the Rake gem and domain-specific languages (DSLs) in Ruby.
The presentation discusses:
1. How Rake works as a Make-like program implemented in Ruby syntax with tasks and dependencies. Rake files use standard Ruby syntax.
2. Examples of common patterns for building internal DSLs in Ruby using class/module methods, method definition, implicit/explicit code blocks, and instance evaluation.
3. How popular Ruby gems like Rake, Bundler, and Thor use DSL techniques and inherit from each other to provide domain-specific interfaces.
This document summarizes a presentation given by @joker1007 and @tagomoris on hijacking Ruby syntax. It discusses various Ruby features like bindings, tracepoints, and refinements that can be used to modify Ruby's behavior. It then demonstrates several "hacks" that leverage these features, including finalist, overrider, and abstriker which add method modifiers, and binding_ninja which allows implicitly passing a binding. Other hacks discussed are with_resources and deferral which add "with" and "defer" statements to Ruby. The presentation emphasizes how these modifications are implemented using hooks, bindings, tracepoints and other Ruby internals.
How to develop Jenkins plugin using to ruby and Jenkins.rbHiroshi SHIBATA
- The document discusses developing Jenkins plugins using Ruby and the jpi tool. It covers generating a sample wrapper plugin, configuring the plugin, and building and releasing the plugin through jpi commands.
- The speaker demonstrates creating a sample "rbenv" plugin with jpi to configure Ruby versions and gems for builds.
- Commands like jpi new, generate, build, server and release are used to generate the plugin scaffolding, configure the wrapper, build the plugin file, host it locally for testing, and prepare it for release.
This document provides an overview and examples of using ngx_mruby, which allows embedding the mruby scripting language in the nginx web server. It introduces ngx_mruby and how it works, provides instructions for building and installing ngx_mruby, and gives several code examples for common tasks like content handling, logging, redirection, and authorization using ngx_mruby. Key features covered include accessing nginx variables and requests, sharing data across request phases and worker processes, and integrating mruby gems.
Experiments in Sharing Java VM Technology with CRubyMatthew Gaudet
IBM is developing a just-in-time (JIT) compiler called Testarossa based on its Open Runtime (OMR) toolkit. The goal is to integrate the JIT compiler into MRI Ruby to improve performance without changing how MRI works. So far, the JIT supports most opcodes and can run Rails applications, but performance gains are modest. IBM hopes to collaborate with the Ruby community to further optimize Ruby and help make it faster.
This document discusses testing code written for mruby, a lightweight Ruby implementation. It proposes using the mruby runtime itself to test code, rather than Ruby, by using the mruby-mtest library. This allows testing mruby code directly using the same binaries and libraries as production. Sample code shows how to structure tests and set up a test runner to execute tests against the mruby binary. Testing code with mruby provides faster, more direct testing compared to using Ruby.
Asynchronous I/O in NodeJS - new standard or challenges?Dinh Pham
The document discusses asynchronous I/O in Node.js and compares processing models using processes, threads, and events. It explains how Node.js uses an event-driven and asynchronous model with callbacks to handle non-blocking I/O. It also discusses challenges with callbacks and introduces flow control libraries that can help address issues with readability and debugging of asynchronous code.
This document provides an introduction to testing the Ruby programming language. It discusses how to set up a development environment to run Ruby's core tests, describes the various test suites and tasks, and provides examples of test files. The document encourages contributors to test Ruby by cloning its repository, running the test suites locally, focusing tests in specific areas, and submitting patches for new or updated tests.
The document discusses testing practices for the Ruby programming language. It provides details on how to run various test suites that are part of the Ruby source code repository, including:
1. Running the "make test" command which runs sample tests, known bug tests, and tests defined in the test/ directory.
2. Running "make test-all" which runs core library and standard library tests under the test/ directory.
3. Running "make check" which builds encodings and extensions, runs all test tasks including test frameworks like Test::Unit and Minitest.
4. It also discusses strategies for merging test changes from external repositories like RubyGems and RDoc back into the Ruby source code
Leave end-to-end testing to Capybara. Capybara is a web testing tool that simulates user interactions with a website. It allows automating browser interactions for scenarios and features using domain-specific languages like Cucumber. Capybara supports using different drivers like Selenium for JavaScript interactions and HtmlUnit for non-JavaScript sites. Specifying the driver and JavaScript support in tests allows running tests across different environments.
The document discusses the strategy for building and testing the programming language Hiroshi. It covers:
1. The Ruby Core team which maintains the language and includes over 80 volunteers.
2. The testing strategy for Ruby which involves testing at different levels from the interpreter to libraries. Extensive tests are run on Linux, Windows and macOS.
3. The CI environments used for Ruby development including GitHub Actions, Travis CI and AppVeyor, as well as internal VM clusters. Test results are collected on Ruby CI and discussed on Slack.
JRuby 9000 - Taipei Ruby User's Group 2015Charles Nutter
The document discusses JRuby 9000, a new version of JRuby that runs on a new runtime based on an intermediate representation (IR). Some key points:
- JRuby 9000 includes major performance improvements like just-in-time compiling of blocks and optimized define_method performance.
- The new runtime represents code as IR instructions instead of an AST for better optimization capabilities. It allows registering passes to optimize the IR.
- Future work includes improved inlining, numeric specialization to use primitives on the JVM, and leveraging ahead-of-time compilation capabilities being added to the JVM to improve startup time.
- The overall goal is to continue optimizing JRuby to perform
This document discusses how to create Mackerel plugins using mruby. It explains what Mackerel plugins are, the required format, and how to write command line tools and classes in mruby. It then provides an example of implementing Redis commands like SCARD and SMEMBERS in mruby-redis by reading the C source and making additions. This allows monitoring Redis set data with Mackerel. Finally, it shows a sample Mackerel plugin for monitoring Sidekiq job counts.
Nodejs Event Driven Concurrency for Web ApplicationsGanesh Iyer
We describe the event-driven concurrency model used by Nodejs, a JavaScript server-side scripting platform. An overview of the traditional thread based approach(used by Apache) is also given. We compare both the approaches. An Introduction to Nodejs programming is provided and some useful packages are discussed.
The document discusses a computer programmer who is also a guitarist and leads an Agile software development team. It includes code snippets from programming languages like Ruby. There are also descriptions of using source control tools like Git for managing branches, tags, and cherry-picking commits.
The document summarizes the key points about RubyGems 3 & 4 from Hiroshi SHIBATA's presentation at RubyKaigi 2018. It discusses RubyGems 2.7, including support for older Ruby versions. It then covers plans for RubyGems 3.0, such as removing deprecated code, and RubyGems 4.0, which may include non-backwards compatible changes.
Apache thrift-RPC service cross languagesJimmy Lai
This slides illustrate how to use Apache Thrift for building RPC service and provide demo example code in Python. The example scenario is: we have a prepared machine learning model, and we'd like to load the model in advance as a server for providing prediction service.
introduction-infra-as-a-code using terraformniyof97
This document provides a summary of the challenges faced when manually configuring and deploying infrastructure and applications without using infrastructure as code tools. It describes issues that arose when installing dependencies for a Ruby on Rails application locally and on Amazon EC2 instances. It then introduces infrastructure as code using Docker to containerize applications and define environments as code. Docker images for a Sinatra backend and Rails frontend are built and linked together using Docker Compose. The document advocates for using infrastructure as code tools like Docker and Terraform to avoid manual configuration issues and facilitate consistent deployments across environments.
The talk focuses on the processes and requirements to ship a software, which was written with MacRuby, to the end user. I present libraries and tools, that are helpful for this purpose and show how to use them.
This document describes the challenges of manually configuring and deploying infrastructure for Ruby on Rails and Sinatra applications. It introduces infrastructure as code using Docker and Terraform to define and deploy two microservices—a Sinatra backend and Rails frontend—to Amazon ECS. Docker is used to package each application into images to ensure consistency across environments. Terraform will configure and deploy the necessary AWS resources. Using these tools reduces manual effort and errors compared to traditional deployment methods.
This document describes the challenges of manually configuring and deploying infrastructure for Ruby on Rails and Sinatra applications. It introduces infrastructure as code using Docker and Terraform to define and deploy two microservices—a Sinatra backend and Rails frontend—to Amazon ECS. Docker is used to package each application into images to ensure consistency across environments. Terraform will configure and deploy the necessary AWS resources. Using these tools reduces manual effort and errors compared to traditional deployment methods.
Infrastructure as code: running microservices on AWS using Docker, Terraform,...Yevgeniy Brikman
This is a talk about managing your software and infrastructure-as-code that walks through a real-world example of deploying microservices on AWS using Docker, Terraform, and ECS.
In this deck from the Stanford HPC Conference, Christian Kniep from Docker, Inc. gives a tutorial on linux containers.
"This tutorial provides a detailed overview of the components needed to run containerized applications and explores how distributed HPC applications can be tackled. We’ll explain the concept of Linux Containers and describe the bits and pieces participants will explore following step-by-step examples.
The workshop will introduce the predominant forms of orchestration in the industry; what problems they solve and how to approach the problem.
Attendees will explore the benefits and drawbacks of orchestrators first hand with their own small exemplary stack deployments.
Finally the workshop will introduce how HPC and Big Data workloads can be tackled on-top of these service-oriented clusters."
Watch the video: https://youtu.be/LJinZpCTyk0
Learn more: http://www.docker.com/
and
http://hpcadvisorycouncil.com
Sign up for our insideHPC Newsletter: http://insidehpc.com/newsletter
K8s in 3h - Kubernetes Fundamentals TrainingPiotr Perzyna
Kubernetes (K8s) is an open-source system for automating deployment, scaling, and management of containerized applications. This training helps you understand key concepts within 3 hours.
The document describes a presentation about data processing with CDK (Cloud Development Kit). It includes an agenda that covers CDK and Projen, serverless ETL with Glue, Databrew with continuous integration/continuous delivery (CICD), and using Amazon Comprehend with S3 object lambdas. Constructs are demonstrated for building architectures with CDK across multiple programming languages. Examples are provided of using CDK to implement Glue workflows, Databrew CICD pipelines, and combining Comprehend with S3 object lambdas for PII detection and redaction.
Kubered -Recipes for C2 Operations on KubernetesJeffrey Holden
This document provides recipes for containerizing and deploying common C2 frameworks like Cobalt Strike and Merlin on Kubernetes. It discusses using Docker to containerize the C2 payloads, creating Kubernetes deployments, services, and ingress resources to expose the containers. It also covers using Nginx Ingress and Istio service mesh with Envoy sidecars to provide redirection and traffic manipulation capabilities for C2 infrastructure on Kubernetes.
The document discusses RubyCocoa, which bridges the Ruby and Objective-C programming languages allowing Ruby code to access Cocoa frameworks, describes its history and key contributors, and provides an example of how RubyCocoa allows Ruby code to call methods on Objective-C classes similarly to how it is done in Objective-C. It also lists additional resources for learning more about RubyCocoa, Cocoa, and Objective-C.
The Hitchhiker's Guide to Faster Builds. Viktor Kirilov. CoreHard Spring 2019corehard_by
C++ is known for things such as performance, expressiveness, the lack of a standard build system and package management, complexity and long compile times. The inability to iterate quickly is one of the biggest killers of productivity. This talk is aimed at anyone interested in improving the last of these points - it will provide insights into why compilation (and linking) take so long for C++ and will then provide an exhaustive list of techniques and tools to mitigate the problem, such as: - tooling and infrastructure - hardware, build systems, caching, distributed builds, diagnostics of bottlenecks, code hygiene - techniques - unity builds, precompiled headers, linking (static vs shared libraries) - source code modification - the PIMPL idiom, better template use, annotations - modules - what they are, when they are coming to C++ and what becomes obsolete because of them
The document discusses the tools and practices used by a Ruby development team, including using RVM for managing Ruby versions and gemsets, Postgres.app for the database, Pow for local development, Git for version control, GitHub pull requests for code reviews, CircleCI for continuous integration and deployment to Heroku, Capistrano or Mina for deployment automation, and services like Rollbar and HipChat for error tracking and communication. Consistent coding styles, Sublime Text settings, and code quality practices like testing and reviews are also recommended.
Custom CI/CD pipelines often don’t adapt well to existing platforms. OCluster is a cluster management system that’s currently deployed on thousands of cores powering various CI systems for the OCaml community. It composes recognized software components, from snapshotting filesystems to containers and virtualization management, in order to provide a lightweight and highly portable execution environment across operating systems and architectures. In this talk, we’ll present OCluster use cases, and how it fits into the OCurrent framework.
The document discusses 5 things the author wishes they knew about Gitlab CI:
1. Jobs can be set as interruptible to stop long-running tasks.
2. Caching can be used and configured to pull or push cache between jobs to improve performance.
3. Slow tests can be split into separate jobs or run last to speed up pipelines.
4. Hidden jobs and anchors can be used to reuse configuration parts.
5. Self-hosted runners can save money and provide more flexibility compared to Gitlab shared runners.
A Check of the Open-Source Project WinSCP Developed in Embarcadero C++ BuilderAndrey Karpov
We regularly check open-source C/C++ projects, but what we check are mostly projects developed in the Visual Studio IDE. For some reason, we haven't paid much attention to the Embarcadero C++ Builder IDE. In order to improve this situation, we are going to discuss the WinSCP project I have checked recently.
P.S. C++ Builder support in PVS-Studio had been dropped after version 5.20. If you have any questions, feel free to contact our support.
This document provides an overview of containerization and Docker. It covers prerequisites, traditional application deployment challenges, container components like namespaces and cgroups, major Docker concepts like images and containers, common Docker commands, building Dockerfiles, and Docker workflows and best practices. Hands-on exercises are included to build and run containers.
Ähnlich wie Writing a Gem with native extensions (20)
How to Get CNIC Information System with Paksim Ga.pptxdanishmna97
Pakdata Cf is a groundbreaking system designed to streamline and facilitate access to CNIC information. This innovative platform leverages advanced technology to provide users with efficient and secure access to their CNIC details.
Generating privacy-protected synthetic data using Secludy and MilvusZilliz
During this demo, the founders of Secludy will demonstrate how their system utilizes Milvus to store and manipulate embeddings for generating privacy-protected synthetic data. Their approach not only maintains the confidentiality of the original data but also enhances the utility and scalability of LLMs under privacy constraints. Attendees, including machine learning engineers, data scientists, and data managers, will witness first-hand how Secludy's integration with Milvus empowers organizations to harness the power of LLMs securely and efficiently.
HCL Notes and Domino License Cost Reduction in the World of DLAUpanagenda
Webinar Recording: https://www.panagenda.com/webinars/hcl-notes-and-domino-license-cost-reduction-in-the-world-of-dlau/
The introduction of DLAU and the CCB & CCX licensing model caused quite a stir in the HCL community. As a Notes and Domino customer, you may have faced challenges with unexpected user counts and license costs. You probably have questions on how this new licensing approach works and how to benefit from it. Most importantly, you likely have budget constraints and want to save money where possible. Don’t worry, we can help with all of this!
We’ll show you how to fix common misconfigurations that cause higher-than-expected user counts, and how to identify accounts which you can deactivate to save money. There are also frequent patterns that can cause unnecessary cost, like using a person document instead of a mail-in for shared mailboxes. We’ll provide examples and solutions for those as well. And naturally we’ll explain the new licensing model.
Join HCL Ambassador Marc Thomas in this webinar with a special guest appearance from Franz Walder. It will give you the tools and know-how to stay on top of what is going on with Domino licensing. You will be able lower your cost through an optimized configuration and keep it low going forward.
These topics will be covered
- Reducing license cost by finding and fixing misconfigurations and superfluous accounts
- How do CCB and CCX licenses really work?
- Understanding the DLAU tool and how to best utilize it
- Tips for common problem areas, like team mailboxes, functional/test users, etc
- Practical examples and best practices to implement right away
Taking AI to the Next Level in Manufacturing.pdfssuserfac0301
Read Taking AI to the Next Level in Manufacturing to gain insights on AI adoption in the manufacturing industry, such as:
1. How quickly AI is being implemented in manufacturing.
2. Which barriers stand in the way of AI adoption.
3. How data quality and governance form the backbone of AI.
4. Organizational processes and structures that may inhibit effective AI adoption.
6. Ideas and approaches to help build your organization's AI strategy.
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...Jeffrey Haguewood
Sidekick Solutions uses Bonterra Impact Management (fka Social Solutions Apricot) and automation solutions to integrate data for business workflows.
We believe integration and automation are essential to user experience and the promise of efficient work through technology. Automation is the critical ingredient to realizing that full vision. We develop integration products and services for Bonterra Case Management software to support the deployment of automations for a variety of use cases.
This video focuses on integration of Salesforce with Bonterra Impact Management.
Interested in deploying an integration with Salesforce for Bonterra Impact Management? Contact us at sales@sidekicksolutionsllc.com to discuss next steps.
Have you ever been confused by the myriad of choices offered by AWS for hosting a website or an API?
Lambda, Elastic Beanstalk, Lightsail, Amplify, S3 (and more!) can each host websites + APIs. But which one should we choose?
Which one is cheapest? Which one is fastest? Which one will scale to meet our needs?
Join me in this session as we dive into each AWS hosting service to determine which one is best for your scenario and explain why!
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Speck&Tech
ABSTRACT: A prima vista, un mattoncino Lego e la backdoor XZ potrebbero avere in comune il fatto di essere entrambi blocchi di costruzione, o dipendenze di progetti creativi e software. La realtà è che un mattoncino Lego e il caso della backdoor XZ hanno molto di più di tutto ciò in comune.
Partecipate alla presentazione per immergervi in una storia di interoperabilità, standard e formati aperti, per poi discutere del ruolo importante che i contributori hanno in una comunità open source sostenibile.
BIO: Sostenitrice del software libero e dei formati standard e aperti. È stata un membro attivo dei progetti Fedora e openSUSE e ha co-fondato l'Associazione LibreItalia dove è stata coinvolta in diversi eventi, migrazioni e formazione relativi a LibreOffice. In precedenza ha lavorato a migrazioni e corsi di formazione su LibreOffice per diverse amministrazioni pubbliche e privati. Da gennaio 2020 lavora in SUSE come Software Release Engineer per Uyuni e SUSE Manager e quando non segue la sua passione per i computer e per Geeko coltiva la sua curiosità per l'astronomia (da cui deriva il suo nickname deneb_alpha).
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfMalak Abu Hammad
Discover how MongoDB Atlas and vector search technology can revolutionize your application's search capabilities. This comprehensive presentation covers:
* What is Vector Search?
* Importance and benefits of vector search
* Practical use cases across various industries
* Step-by-step implementation guide
* Live demos with code snippets
* Enhancing LLM capabilities with vector search
* Best practices and optimization strategies
Perfect for developers, AI enthusiasts, and tech leaders. Learn how to leverage MongoDB Atlas to deliver highly relevant, context-aware search results, transforming your data retrieval process. Stay ahead in tech innovation and maximize the potential of your applications.
#MongoDB #VectorSearch #AI #SemanticSearch #TechInnovation #DataScience #LLM #MachineLearning #SearchTechnology
Driving Business Innovation: Latest Generative AI Advancements & Success StorySafe Software
Are you ready to revolutionize how you handle data? Join us for a webinar where we’ll bring you up to speed with the latest advancements in Generative AI technology and discover how leveraging FME with tools from giants like Google Gemini, Amazon, and Microsoft OpenAI can supercharge your workflow efficiency.
During the hour, we’ll take you through:
Guest Speaker Segment with Hannah Barrington: Dive into the world of dynamic real estate marketing with Hannah, the Marketing Manager at Workspace Group. Hear firsthand how their team generates engaging descriptions for thousands of office units by integrating diverse data sources—from PDF floorplans to web pages—using FME transformers, like OpenAIVisionConnector and AnthropicVisionConnector. This use case will show you how GenAI can streamline content creation for marketing across the board.
Ollama Use Case: Learn how Scenario Specialist Dmitri Bagh has utilized Ollama within FME to input data, create custom models, and enhance security protocols. This segment will include demos to illustrate the full capabilities of FME in AI-driven processes.
Custom AI Models: Discover how to leverage FME to build personalized AI models using your data. Whether it’s populating a model with local data for added security or integrating public AI tools, find out how FME facilitates a versatile and secure approach to AI.
We’ll wrap up with a live Q&A session where you can engage with our experts on your specific use cases, and learn more about optimizing your data workflows with AI.
This webinar is ideal for professionals seeking to harness the power of AI within their data management systems while ensuring high levels of customization and security. Whether you're a novice or an expert, gain actionable insights and strategies to elevate your data processes. Join us to see how FME and AI can revolutionize how you work with data!
Ivanti’s Patch Tuesday breakdown goes beyond patching your applications and brings you the intelligence and guidance needed to prioritize where to focus your attention first. Catch early analysis on our Ivanti blog, then join industry expert Chris Goettl for the Patch Tuesday Webinar Event. There we’ll do a deep dive into each of the bulletins and give guidance on the risks associated with the newly-identified vulnerabilities.
1. Writing a Gem
with native extensions
Tristan Penman
Melbourne Ruby Meetup, August 2018
A whirlwind tour
2. What are they?
Native extensions allow you to extend the functionality
available in Ruby by writing code in natively compiled
languages such as C, C++, or even Rust.
This talk shows how native extensions can be used to
interact with a third-party library written in C.
The final code from this talk can be found on Github:
https://github.com/tristanpenman/simple-clipboard
Native extensions
A brief introduction
3. Native extensions
Examples
• Byebug - a debugger for Ruby, that uses Ruby's TracePoint API
for execution control and the Debug Inspector API for call
stack navigation. Written as a C extension for speed.
• nokogiri - an HTML and XML parser. Uses native libraries for
speed and ensure standards compliance.
• RMagick - bindings for the ImageMagick image manipulation
library.
• sqlite3 - bindings for the SQLite3 database engine.
4. libclipboard
libclipboard is a cross-platform clipboard library
Simple C-based API:
clipboard_new - create a context through which to access
the user's clipboard
clipboard_free - free any memory allocated by
clipboard_new
clipboard_text - read the contents of the clipboard as text
clipboard_set_text - replace the contents of the clipboard
with new text
6. simple_clipboard
We will use a native extension to wrap libclipboard with a
Module that we can use in Ruby code:
module SimpleClipboard
def get_text
#TODO: Return current contents ofclipboard,ornil
raise NotImplementedError
end
def set_text(new_text)
#TODO: Update clipboard; return previous contents, ornil
raise NotImplementedError
end
end
7. Extending Ruby using C
To create our native extension we need two files:
extconf.rb
simple_clipboard.c
8. Extending Ruby using C
require 'mkmf'
$LOCAL_LIBS << '-lclipboard'
if RUBY_PLATFORM =~ /darwin/
$LDFLAGS <<' -framework AppKit'
end
create_header
create_makefile 'simple_clipboard/simple_clipboard'
extconf.rb
9. Extending Ruby using C
simple_clipboard.c (1/2)
#include <ruby.h>
#include <libclipboard.h>
VALUEget_text(VALUE _self) {
VALUE result = Qnil;
char *text = clipboard_text(cb);
if (text) {
result =rb_str_new(text, strlen(text));
free(text);
}
return result;
}
// continued on next slide...
10. Extending Ruby using C
simple_clipboard.c (2/2)
// continued from previous slide
VALUEset_text(VALUE _self, VALUE str) {
// omitted, since it is similar to get_text
}
voidInit_simple_clipboard() {
VALUE m =rb_define_module("SimpleClipboard");
rb_define_module_function(m, "get_text", get_text, 0);
rb_define_module_function(m, "set_text", set_text, 1);
}
11. Run 'ruby extconf.rb' to generate:
Header file (extconf.h, which is redundant in this case)
Makefile
(also mkmf.log)
Run ’make’ to compile the extension
On Mac OS X, creates a .bundle file
On Linux, creates a .so
On Windows, creates a .dll
Extending Ruby using C
12. 2.3.3:001> require './simple_clipboard'
=>true
2.3.3:002> SimpleClipboard.get_text
=>"Extending Ruby using C"
2.3.3:003> SimpleClipboard.set_text "Hello world"
=>"Extending Ruby using C"
2.3.3:004> SimpleClipboard.get_text
=>"Hello world"
Extending Ruby using C
IRB session
13. Extending Ruby using C
In a nutshell
For an extension named 'xyz' we need:
An extconf.rb file and source file called 'xyz.c'
In the 'xyz.c' file, a function called Init_xyz
A native extension is free to:
define modules, classes and methods that operate on
Ruby values, via an opaque C datatype 'VALUE'
Call existing Ruby code
Crash the current process
And more generally, call 'undefined behavior'
14. How to include C code in a gem
Okay, safety be damned, we want performance…
or legacy functionality…
or something.
15. lib/
simple_clipboard/
version.rb
simple_clipboard.rb
simple_clipboard.gemspec
How to include C code in a gem
Layout without a native extension
16. How to include C code in a gem
Layout with a native extension
ext/
simple_clipboard/
extconf.rb
simple_clipboard.c
lib/
simple_clipboard/
version.rb
simple_clipboard.rb
simple_clipboard.gemspec
17. #Boilerplate omitted
Gem::Specification.new do |s|
s.name ='simple_clipboard'
s.version =SimpleClipboard::VERSION
s.date ='2018-07-24'
s.summary ='Simple clipboardexample gem'
s.authors =['TristanPenman']
s.email ='tristan@tristanpenman.com'
s.licenses =['MIT']
#continued on next slide...
How to include C code in a gem
simple_clipboard.gemspec (1/2)
18. #continued from previous slide...
s.extensions =['ext/simple_clipboard/extconf.rb']
#Tell bundler where to findthe code forour gem
s.require_paths =['lib']
#Files toinclude in bundle
s.files =['ext/simple_clipboard/simple_clipboard.c',
'lib/simple_clipboard.rb',
'lib/simple_clipboard/version.rb']
end
How to include C code in a gem
simple_clipboard.gemspec (2/2)
19. How to include C code in a gem
Run 'gem build simple_clipboard.gemspec':
Does not actually compile native extension
Creates 'simple_clipboard-0.0.1.gem'
Run 'gem install simple_clipboard-0.0.1.gem'
This is when bundler will build the native extension
And this why, when things go wrong while building gems
such as nokigiri, that you can get very complex error
messages
20. $ gem install simple_clipboard-0.0.1.gem
How to include C code in a gem
Example
Building native extensions. This could take a while...
Successfully installed simple_clipboard-0.0.1
Parsing documentation forsimple_clipboard-0.0.1
Done installing documentation for simple_clipboard after 0 seconds
1 gem installed
21. 2.3.3 :001 >require 'simple_clipboard'
=> true
2.3.3 :002 > SimpleClipboard.get_text
=> "Extending Ruby using C"
2.3.3 :003 > SimpleClipboard.set_text "Hello world"
=> "Extending Ruby using C"
2.3.3 :004 > SimpleClipboard.get_text
=> "Hello world"
Extending Ruby using C
IRB session
22. Testing native extensions
require "bundler/gem_tasks"
require "rspec/core/rake_task"
require 'rake/extensiontask'
desc "simple_clipboard unit tests"
RSpec::Core::RakeTask.new(:spec) do|t|
t.pattern ="spec/*_spec.rb"
t.verbose =true
End
#continued on next slide...
Rakefile (1/2)
24. Testing native extensions
1. Run 'rake' to compile and run tests
2. Run 'rake compile' to only compile native extension
Compiles the native extension, then copies
simple_clipboard.[bundle|so|dll] file into 'lib/simple_clipboard'
3. Run 'rake spec' to only run tests
Assumes that native extension (e.g. simple_clipboard.bundle) has
already been copied to 'lib/simple_clipboard' directory
Rake tasks
25. Resources
• Useful reference implementation of a
Gem with a native extension:
https://github.com/neilslater/ruby_nex_c
• Core documentation:
https://ruby-doc.org/core-
2.3.3/doc/extension_rdoc.html
(Beware the version number in this link)
• Pat Shaughnessy’s book:
Ruby Under a Microscope
26. Resources
• RubyGems documentation
https://guides.rubygems.org/gems-with-extensions/
• Aaron Bedra's Extending Ruby guide
http://aaronbedra.com/extending-ruby
• Chris Lalancette's in-depth series on writing Ruby extensions
in C, which covers numerous topics:
http://clalance.blogspot.com/2011/01/writing-ruby-
extensions-in-c-part-1.html
(12 parts in total)