Hello, I am Zhenkai from Team Wolf Corp (#12525). In FTC autonomous period, computer vision allows your robot to identify and distinguish scoring elements and make the optimal move. In this tutorial, I will cover the basics of EasyOpenCV and how to identify SkyStones from the 2019-2020 season. This tutorial assumes basic knowledge of FTC programming using Java.
| # This is example how to rescue from exception ActionDispatch::Http::MimeNegotiation::InvalidType | |
| # and show nice JSON error in your API | |
| module API | |
| class BaseController < ActionController::API | |
| def process_action(*args) | |
| super | |
| rescue ActionDispatch::Http::MimeNegotiation::InvalidType => exception | |
| # set valid Content-Type to be able to call render method below | |
| request.headers['Content-Type'] = 'application/json' | |
| render status: 400, json: { errors: [exception.message] } |
| # gem install benchmark-memory activesupport builder nokogiri rabl ox libxml-ruby | |
| require 'benchmark' | |
| require 'benchmark-memory' | |
| require 'builder' | |
| require 'active_support/core_ext/hash/conversions' | |
| require 'rabl' | |
| require 'nokogiri' | |
| require 'libxml' | |
| require 'ox' |
This guide is for Rails 5.1 or lower. Starting in 5.2, all these issues have been made irrelevant.
Optimistic Locking assumes that a database transaction conflict is very rare to happen. It uses a version number of the record to track the changes. It raise an error when other user tries to update the record while it is lock.
usage
Just add a lock_version column to the table you want to place the lock and Rails will automatically check this column before updating the record.
Pessimistic locking assumes that database transaction conflict is very likely to happen. It locks the record until the transaction is done. If the record is currently lock and the other user make a transaction, that second transaction will wait until the lock in first transaction is release.
usage
Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)
First one found from of
Note: This guide works with Ruby 2.6+ through Ruby 3.x, with modern Ruby 3.x features highlighted where applicable. Core metaprogramming concepts remain consistent across Ruby versions.
This document has been collaboratively updated and modernized through an interactive process with Claude Code, revised with examples, visual diagrams, and Ruby 3.x compatibility.
| #!/bin/bash | |
| mkdir -p ~/.ssh | |
| # generate new personal ed25519 ssh keys | |
| ssh-keygen -o -a 100 -t ed25519 -f ~/.ssh/id_ed25519 -C "rob thijssen <rthijssen@gmail.com>" | |
| ssh-keygen -o -a 100 -t ed25519 -f ~/.ssh/id_robtn -C "rob thijssen <rob@rob.tn>" | |
| # generate new host cert authority (host_ca) ed25519 ssh key | |
| # used for signing host keys and creating host certs |