Skip to content

Instantly share code, notes, and snippets.

import org.jasig.cas.authentication.principal.UsernamePasswordCredentials;
import org.springframework.security.crypto.bcrypt.BCrypt;
import org.springframework.beans.factory.InitializingBean;
import org.jasig.cas.adaptors.jdbc.AbstractJdbcUsernamePasswordAuthenticationHandler;
/**
* Class that given a table, username field and password field will query a
* database table to see if the user exists. If the user exists, the
* encrypted password, from the datbase, will be compared to the plain
* text password, from the credentials, by using the BCrypt tools.
@ukasiu
ukasiu / Makefile
Created October 28, 2013 09:25
Makefile na jtp i wdi
#jtp
%: %.c
gcc -Wall -O2 -ansi -pedantic -std=c99 -lm -o bin/$@ $<
#wdi
%: %.cpp
g++ -O2 $< -o bin/$@
@ukasiu
ukasiu / ostatnia_cyfra_silni.cpp
Last active December 25, 2015 12:49
No, mała liczba, to sprawdziłem metodą dość brutalną podstawiając pod modulo dość dużą potęgę 10 i też mi wyszło 8. Pytanie tylko jak zrobić krótki a zarazem poprawny kod ;)
#include<iostream>
#define ULL unsigned long long
using namespace std;
ULL tenn(ULL n) {
ULL w=1,ten=1;
while(w<=n) {
w*=5; ten*=10;
}
return ten;