Skip to content

Instantly share code, notes, and snippets.

View nsikanikpoh's full-sized avatar

ns_sly nsikanikpoh

View GitHub Profile
@nsikanikpoh
nsikanikpoh / validating_http_parameters.md
Last active December 21, 2023 20:22 — forked from marekciupak/validating_http_parameters.md
Ruby on Rails: Validating HTTP parameters

Dry-Schema HTTP parameters

Let's say you need to handle the following action:

class UsersController < ApplicationController
  def update
    user = User.find(id)
    result = update_user(user, attrs)
    
#include "stdafx.h"
#include <iostream>
#include <utility>
using namespace std;
void FillSeatArray(pair<char, bool> arr[][4], int sizeDim1);
// Precondition: arr is a two dimensional array of type pair<char, bool>[4].
// sizeDim1 is the size of the first array dimesion.
// Postcondition: Each four element array of type pair<char, bool> is assigned values
// representing seats. The pair at index 0 is assigned 'A', 1 is assigned 'B',