Given two class definition, Car and Bus :
class Car
def honk
puts "Teen, Teen"
end| #!/bin/bash | |
| # Function to display usage information | |
| usage() { | |
| echo "Usage: $0 /path/to/input.mp4 [ /path/to/output_directory ]" | |
| exit 1 | |
| } | |
| # Check if at least one argument (input file) is provided | |
| if [ $# -lt 1 ]; then |
| NimbleCSV.define(TabSeparatedCSVParser, | |
| separator: "\t", | |
| escape: "\"", | |
| encoding: :utf8, | |
| trim_bom: false | |
| ) | |
| defmodule Parser(input_file) do | |
| def run(input_file) do | |
| input_file |
| defmodule S3Downloads do | |
| @moduledoc """ | |
| Use at your own risk. | |
| Code heavily borrowed from: | |
| - https://github.com/ex-aws/ex_aws/blob/main/lib/ex_aws/auth.ex | |
| - https://gist.github.com/chrismccord/37862f1f8b1f5148644b75d20d1cb073 | |
| """ |
| defmodule ConfigHelpers do | |
| @type config_type :: :str | :int | :bool | :json | |
| @doc """ | |
| Get value from environment variable, converting it to the given type if needed. | |
| If no default value is given, or `:no_default` is given as the default, | |
| an error is raised if the variable is not set. | |
| """ | |
| @spec get_env(String.t(), :no_default | any(), config_type()) :: any() |
| DBConnection.ConnectionPool.Supervisor | |
| |> Supervisor.which_children() | |
| |> Enum.each(fn {_, pid, _, _} -> | |
| [ | |
| {{_adapter_prot, starter_pid, _worker_no}, _worker_pid, :worker, [_conn_module]} | |
| | _ | |
| ] = children_list = Supervisor.which_children(pid) | |
| repo_name = | |
| starter_pid |
| # Generate EDDSA public key and private key | |
| {public_key, priv_key} = :crypto.generate_key(:eddsa, :ed25519) | |
| # Payload that need to be signed | |
| payload = "some_string" | |
| # Generate signature with both public key and private key | |
| signature = :public_key.sign(payload, :none, {:ed_pri, :ed25519, public_key, priv_key}, []) | |
| # Verify signature with public key |
| def create_isbn13(isbn_12) | |
| isbn_arr = isbn_12.to_s.chars.map(&:to_i) | |
| sumarr = isbn_arr.each.with_index.inject(0) { |sum,(value,index)| index.even? ? sum+(value*1) : sum+(value*3) } | |
| last_digit = (10 - (sumarr % 10)) % 10 | |
| isbn13 = isbn_12.to_s + last_digit.to_s | |
| end |
| import ( | |
| "fmt" | |
| "math/rand" | |
| "regexp" | |
| "golang.org/x/crypto/bcrypt" | |
| ) | |
| func ValidatePassword(hashedPassword, plainPassword string) (isValid bool) { | |
| hashedPasswordInBytes := []byte(hashedPassword) | |
| plainPasswordInBytes := []byte(plainPassword) |
| def cetakPola(size=1) | |
| arr = Array.new(size) { Array.new(size) } | |
| chars = (size**2).to_s.size | |
| maks = size-1 | |
| x = maks / 2 | |
| y = maks / 2 | |
| (1..size).each do |ps| | |
| start = (ps-1)**2 + 1 | |
| ends = ps**2 |