Skip to content

Instantly share code, notes, and snippets.

View gmfc's full-sized avatar
🏠
Working from home

Gabriel Melo Correia gmfc

🏠
Working from home
View GitHub Profile
@gmfc
gmfc / Main.java
Created February 3, 2014 16:40 — forked from cy6erGn0m/Main.java
package cg;
import org.fusesource.jansi.Ansi;
import org.fusesource.jansi.AnsiConsole;
/**
* User: Sergey Mashkov
* Date: 6/21/12
*/
public class Main {
@gmfc
gmfc / Testvetor.java
Created August 25, 2013 20:41
Vetor merge com teste usando jUnit.
package testvetor;
/**
*
* @author Gabriel
*/
public class Testvetor {
public static void main(String[] args) {
int a[] = {1, 3, 5, 7};
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package palindromos;
/**
*
* @author 31371477
@gmfc
gmfc / zalgo.js
Created July 21, 2013 01:00
Unicode javascript. "zalgo"
//those go UP
var zalgo_up = [
'\u030d', /* Ì */ '\u030e', /* ÌŽ */ '\u0304', /* Ì„ */ '\u0305', /* Ì… */
'\u033f', /* Ì¿ */ '\u0311', /* Ì‘ */ '\u0306', /* ̆ */ '\u0310', /* Ì */
'\u0352', /* ͒ */ '\u0357', /* ͗ */ '\u0351', /* ͑ */ '\u0307', /* ̇ */
'\u0308', /* ̈ */ '\u030a', /* ̊ */ '\u0342', /* ͂ */ '\u0343', /* ̓ */
'\u0344', /* ÌˆÌ */ '\u034a', /* ÍŠ */ '\u034b', /* Í‹ */ '\u034c', /* ÍŒ */
'\u0303', /* ̃ */ '\u0302', /* Ì‚ */ '\u030c', /* ÌŒ */ '\u0350', /* Í */
'\u0300', /* Ì€ */ '\u0301', /* Ì */ '\u030b', /* Ì‹ */ '\u030f', /* Ì */
public static int[] merge(Comparable[] arg1, Comparable[] arg2)
{
//convert arrays to collections (lists)
Collection coll1 = Arrays.asList(arg1);
Collection coll2 = Arrays.asList(arg2);
//Create a SortedSet from the first collection
SortedSet sorter = new TreeSet(coll1);
//Add the second collection
@gmfc
gmfc / estudo.java
Last active December 18, 2015 07:09
estudo.java
import javax.swing.*;
public class juncao {
public static void main(String [] args){
int[] vetA;
int[] vetB;
int[] vetC;
int tamVetor = -1;
do{
import javax.swing.*;
public class coord {
//Xf=(a*Xi+b)%m;
public static double seed = 1;
public static double a = 179424361;
public static double b = 11;
public static double m = 1000000000;
public static double dNom = 100000;
public static double[][] matriz;
import java.util.*;
class matriz{
public static void main(String[] args){
Scanner s = new Scanner(System.in);//Scanner inicializado em s
int[] vetor;//Vetor principal
String[] entrada;//Vetor de entrada
entrada = s.nextLine().split(" ");//Reparte a entrada e coloca no vetor de entrada separando por espaços.
@gmfc
gmfc / aula22.java
Last active December 17, 2015 18:59
import javax.swing.*;
class prog{
public static void main(String args[]){
int[] v1;
int[] v2;
int tamanho;
do{
tamanho = Integer.parseInt(JOptionPane.showInputDialog("Entre com o tamanho do vetor 1"));
import javax.swing.JOptionPane;
public class Vetores2 {
public static void main(String[] args) {
int a[] = {3, 10, 4, 2, 8};
int[] b = {10, 4, 12, 3, 23, 1, 8};
int[] c = new int[(int)Math.min(a.length, b.length)];
int i=0;
for(int f=0;f<a.length;f++){
for(int k=0;k<b.length;k++){