Category: programming

  • Pundit: NoMethodError (undefined method `verify_authorized’ for [WhateversController])

    Pundit: NoMethodError (undefined method `verify_authorized’ for [WhateversController])

    Sometimes, having done things several times before can make you miss the OBVIOUS. After adding after_action :verify_authorized to my ApplicationController to verify that Pundit was being used for authorization, I got the following error in rspec: 2) Jobs GET /jobs works! (now write some real specs) Failure/Error: get jobs_path NoMethodError: undefined method `verify_authorized’ for # […]

  • Programming Style: Language Specific Domains

    My Beginner and C Days The visual presentation of the code has mattered to me, from the first days I wrote C code in Microsoft editor. In those days, it was a Microsoft C 5.0 IDE on either DOS or OS/2. #include “stdio.h” main() { int rows,columns,ROW, COLUMN; scanf(“%d %d”,&ROW,&COLUMN); rows = 0; columns = […]

  • Naive palindrome substring check written in C.

    Below is a quick and naive implementation of a palindrome substring checker written in C. All characters are considered part of the palindrome (i.e. whitespace and punctuation is not filtered out). Substrings of larger palindromes are also printed separately. #include #include /* * printPalindromes – prints all palindromes in * a string, including substrings of […]