Skip to content

Instantly share code, notes, and snippets.

Ruby Association Certified Ruby Examination Silver Sample Questions

Q1. Which of the following have true values in Ruby? (Choose two.)

  • (a) ""
  • (b) 0
  • (c) false
  • (d) nil

Ruby Association Certified Ruby Examination Gold Sample Questions

Q1. Assume that the following code must have the stated execution result.

__(1)__
x.each_line { |line| puts line }

[Execution Result]
apple
@sean2121
sean2121 / kxsc7-2050.md
Created August 22, 2017 05:09
KXSC7-2050の作成例
K

問題1. 選択肢の中からRubyの予約語ではないものを2つ選択してください。

  • A.super
  • B.begin
  • C.try
  • D.goto

問題2. 以下のコードを実行した出力として正しいものを1つ選択してください。

def foo (a, *b)
 p a
@sean2121
sean2121 / gist:61c1c74b01c668ffe95818c97c13ecee
Last active April 15, 2018 03:27
IoTシステムをRubyで作ろう!GR-CITRUSでセンサープログラミング

必要なもの

  • Windows or Mac
  • GR-CITRUS、WA-MIKAN
  • マイクロUSBケーブル
  • ブレッドボード
  • ジャンパワイヤー(オスオス)
  • LED
  • CDSセル
  • 抵抗
  • 温湿度センサーモジュール
#include<stdio.h>
#include<math.h>
float distance(double, double, double, double);
int main(void)
{
//点P
double latitude_s = 35.658581;
double longitude_s = 139.745433;
@sean2121
sean2121 / to_mw.c
Last active February 19, 2018 14:56
float to_mw(float mjma)
{
float mw = mjma - 0.171 ;
return mw;
}
module EEW
module Calculator
include Math
#PGVから求めた震度を返す。
#IINSTR =2.68+1.72log(PGV) (4<IINSTR<7)
def shindo(latitude_s, longitude_s, mjma, depth, latitude_e, longitude_e)
d = two_points_distance(latitude_s, longitude_s, latitude_e, longitude_e, depth)
mw = mjma_to_mw(mjma)
fl = falut_length(mw)
workflows:
version: 2
build-test-and-deploy:
jobs:
- build
- test1:
requires:
- build
- test2:
requires:
version: 2.0
jobs:
checkout_code:
docker:
- image: circleci/ruby:2.4-node
- image: circleci/postgres:9.4.12-alpine
working_directory: ~/circleci-demo-workflows
steps:
- checkout