Skip to content

Instantly share code, notes, and snippets.

View fabriciofx's full-sized avatar
🎯
Focusing

Fabrício Cabral fabriciofx

🎯
Focusing
  • Brazil
  • 02:05 (UTC -03:00)
View GitHub Profile
package br.com.triadworks.core.hibernate;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.hibernate.Criteria;
import org.hibernate.HibernateException;
import org.hibernate.criterion.CriteriaQuery;
import org.hibernate.criterion.SQLProjection;
import org.hibernate.type.Type;
@fabriciofx
fabriciofx / EnumDescribable.java
Created October 18, 2015 21:28 — forked from francofabio/EnumDescribable.java
vraptor4 gson enum serialization
public interface EnumDescribable {
String getDescription();
}
import java.util.Arrays;
public class Cpf {
public static void main(String[] args) {
int[] d = new int[9];
for(int i = 0; i < d.length; i++) {
d[i] = args[0].charAt(i) - '0';
}
System.out.println(Arrays.toString(d));
import java.util.Arrays;
public class Cnpj {
public static void main(String[] args) {
int[] d = new int[12];
for(int i = 0; i < d.length; i++) {
d[i] = args[0].charAt(i) - '0';
}
System.out.println(Arrays.toString(d));
2018-08-08 16:09:41,434 7568 [DEBUG] - XmlConfiguration is now operational
2018-08-08 16:09:41,485 7568 [INFO ] - ============================================================
2018-08-08 16:09:41,663 7568 [INFO ] - Chocolatey v0.10.11
2018-08-08 16:09:41,676 7568 [DEBUG] - Chocolatey is running on Windows v 10.0.17134.0
2018-08-08 16:09:41,681 7568 [DEBUG] - Attempting to delete file "C:/ProgramData/chocolatey/choco.exe.old".
2018-08-08 16:09:41,685 7568 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\choco.exe.old".
2018-08-08 16:09:41,699 7568 [DEBUG] - Command line: "C:\ProgramData\chocolatey\choco.exe" install jre8
2018-08-08 16:09:41,705 7568 [DEBUG] - Received arguments: install jre8
2018-08-08 16:09:41,757 7568 [DEBUG] - RemovePendingPackagesTask is now ready and waiting for PreRunMessage.
2018-08-08 16:09:41,768 7568 [DEBUG] - Sending message 'PreRunMessage' out if there are subscribers...
2018-08-08 16:09:41,485 7568 [INFO ] - ============================================================
2018-08-08 16:09:41,663 7568 [INFO ] - Chocolatey v0.10.11
2018-08-08 16:09:42,117 7568 [INFO ] - Installing the following packages:
2018-08-08 16:09:42,125 7568 [INFO ] - jre8
2018-08-08 16:09:42,133 7568 [INFO ] - By installing you accept licenses for the packages.
2018-08-08 16:09:44,248 7568 [INFO ] - [NuGet] Installing 'jre8 8.0.181'.
2018-08-08 16:09:44,352 7568 [INFO ] - [NuGet] Successfully installed 'jre8 8.0.181'.
2018-08-08 16:09:44,360 7568 [INFO ] -
jre8 v8.0.181 [Approved]
2018-08-08 16:09:44,382 7568 [INFO ] - jre8 package files install completed. Performing other installation steps.
C:\ProgramData\chocolatey\logs>choco install jre8
Chocolatey v0.10.11
Installing the following packages:
jre8
By installing you accept licenses for the packages.
jre8 v8.0.181 [Approved]
jre8 package files install completed. Performing other installation steps.
Searching if new version exists...
ERROR: Specified cast is not valid.
// Programa para verificar se um ponto pertence a um plano
// Sheyla Cantalupo
#include <iostream>
using namespace std;
struct Ponto{
int x;
int y;
};
@fabriciofx
fabriciofx / main.c
Created April 1, 2020 00:10 — forked from mlocati/main.c
Enable/disable/check color support for Windows (ENABLE_VIRTUAL_TERMINAL_PROCESSING flag)
#define _WIN32_WINNT 0x0600
#include <stdio.h>
#include <windows.h>
#include <fileapi.h>
#ifndef ENABLE_VIRTUAL_TERMINAL_PROCESSING
#define ENABLE_VIRTUAL_TERMINAL_PROCESSING 0x0004
#endif
@fabriciofx
fabriciofx / win10colors.cmd
Created April 1, 2020 00:11 — forked from mlocati/win10colors.cmd
ANSI Colors in standard Windows 10 shell
@echo off
setlocal
call :setESC
cls
echo %ESC%[101;93m STYLES %ESC%[0m
echo ^<ESC^>[0m %ESC%[0mReset%ESC%[0m
echo ^<ESC^>[1m %ESC%[1mBold%ESC%[0m
echo ^<ESC^>[4m %ESC%[4mUnderline%ESC%[0m