- By Edmond Lau
- Highly Recommended 👍
- http://www.theeffectiveengineer.com/
- They are the people who get things done. Effective Engineers produce results.
package bvti.coelho.view.components.ui.validators | |
{ | |
import mx.collections.ArrayCollection; | |
import mx.validators.ValidationResult; | |
import mx.validators.Validator; | |
import spark.components.TextInput; | |
public class InicialFinalValidator extends Validator | |
{ |
package andrerocker.util; | |
import java.lang.reflect.Field; | |
import java.util.HashMap; | |
import java.util.Iterator; | |
import javax.persistence.Entity; | |
import javax.persistence.Transient; | |
public class PesquisaUtil |
require 'resque/tasks' | |
require 'active_record' | |
env = ENV["RAILS_ENV"] || 'development' | |
database_config = YAML::load(File.open('config/database.yml')) | |
connection = ActiveRecord::Base.establish_connection(database_config[env]) | |
files = ['app/models/profile', 'app/workers/avatar'] | |
files.each { |file| require File.expand_path(file) } |
mysql> use rails_girls_sp; | |
Database changed | |
mysql> select count(sex) count, sex from persons group by sex; | |
+--------+------+ | |
| number | sex | | |
+--------+------+ | |
| 1887 | M | | |
| 3 | F | | |
+--------+------+ | |
2 rows in set, 1 warning (0.00 sec) |
private String serialize(Object object) { | |
try { | |
ByteArrayOutputStream buffer = new ByteArrayOutputStream(); | |
ObjectOutputStream output = new ObjectOutputStream(buffer); | |
output.writeObject(object); | |
output.flush(); | |
return Base64.encodeBase64String(buffer.toByteArray()); | |
} catch (Exception e) { |
#!/usr/bin/perl | |
# Author: Todd Larason <[email protected]> | |
# $XFree86: xc/programs/xterm/vttests/256colors2.pl,v 1.2 2002/03/26 01:46:43 dickey Exp $ | |
# use the resources for colors 0-15 - usually more-or-less a | |
# reproduction of the standard ANSI colors, but possibly more | |
# pleasing shades | |
# colors 16-231 are a 6x6x6 color cube | |
for ($red = 0; $red < 6; $red++) { |
import threading | |
def cegela(): | |
while True: | |
pass | |
map(lambda y: y.start(), map(lambda x: threading.Thread(target=cegela), range(0,4))) |
#!/bin/bash | |
# bash generate random alphanumeric string | |
# | |
# bash generate random 32 character alphanumeric string (upper and lowercase) and | |
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1) | |
# bash generate random 32 character alphanumeric string (lowercase only) | |
cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1 |
def connection | |
@conn ||= PG.connect({ | |
host: ARGV.first, | |
port: 26257, | |
dbname: 'cocksparrer', | |
user: 'root', | |
sslmode: 'require', | |
sslrootcert: 'util/certs/cock-master/ca.crt', | |
sslcert: 'util/certs/cock-master/client.root.crt', | |
sslkey: 'util/certs/cock-master/client.root.key', |