Skip to content

Instantly share code, notes, and snippets.

View diegozr1's full-sized avatar

D Z diegozr1

  • DevLatam
  • MX
View GitHub Profile
@diegozr1
diegozr1 / Person.java
Created May 31, 2015 01:50
A class with getters and setters in Java in order to use it as an Object in an Array of them
public class Person {
//attributes of the class
private String FirstName,
LastName;
private Integer Age,
Phone;
//Constructors for this class
@diegozr1
diegozr1 / Saludo.java
Created July 30, 2015 20:53
A simple application of OOP with Java
public class Saludo{
private String name;
public Saludo(){
this.name = "Default";
}
public Saludo(String name){
this.name = name;
@diegozr1
diegozr1 / copy.java
Last active September 7, 2020 18:28
A program for copying a text file using Java
/**
[Api Call Example "Copy a file"]
== How to run it ==
1 - Compile it
javac copy.java
@diegozr1
diegozr1 / buffed.java
Created October 4, 2015 18:58
ICPC 2015 Regional
public class buffed {
public static float[] calcularCentroMasa(String cadena ){
cadena = cadena.replaceAll(" ", "");
float counterx=0;
float countery=0;
float numVertex = Character.getNumericValue(cadena.charAt(0));
@diegozr1
diegozr1 / findBug.py
Created June 15, 2016 21:06
Python3 script for finding bugs in the cloud
import xml.etree.ElementTree as ET
import requests
import random
import json
# generate a random number to find bugs
def genrandomid():
num = random.randrange(3456, 61344)
return num
@diegozr1
diegozr1 / palindrome.java
Created August 11, 2016 02:15
Program to check if a word or phrase is Palindrome
public class palindrome {
/*
Compile it using javac palindrome.java
Runt it using java palindrome "anita lava la tina"
*/
public static void main(String args[]){
String d = args[0];
d = d.toLowerCase();
d = d.replaceAll("\\s","");
System.out.println(d);
@diegozr1
diegozr1 / index.html
Last active August 25, 2016 21:47
Create a popup when a mouse hovers a link in a website
<!DOCTYPE html>
<html>
<head>
<title>Here</title>
<link rel="stylesheet" type="text/css" href="styles.css">
</head>
<body>
<div class="profile">
<span class="label">Profile</span>
<div class="popup">
@diegozr1
diegozr1 / lexicalAnalyser.java
Last active September 14, 2017 07:56
A new language written in JavaCC for kids
PARSER_BEGIN(analizadorPESP)
class analizadorPESP {
public static void main(String[] args) throws ParseException, TokenMgrError
{
try {
analizadorPESP ae = new analizadorPESP(System.in);
ae.boot();
}catch(ParseException e){
System.out.println(" === Errores lexicos encontrados en codigo fuente PESP === \n "+e.getMessage());
}catch(TokenMgrError e){
@diegozr1
diegozr1 / loading.c
Created September 18, 2017 00:29
Loading simulation in c
#include <stdio.h>
#include <unistd.h>
int main()
{
char bar[] = {
'-',
'\\',
'|',
'/'
@diegozr1
diegozr1 / PESP.java
Last active October 26, 2017 23:38
Grammar added for the PESP language
/* PESP.jjt */
PARSER_BEGIN(analizadorPESP)
class analizadorPESP {
public static void main(String[] args) throws ParseException, TokenMgrError
{
try {
analizadorPESP ae = new analizadorPESP(System.in); // System.in
SimpleNode n = ae.Start();
n.dump(" ");