Skip to content

Instantly share code, notes, and snippets.

View alexchiri's full-sized avatar

Alexandru (Alex) Chirițescu alexchiri

View GitHub Profile

Keybase proof

I hereby claim:

  • I am alexchiri on github.
  • I am alexchiri (https://keybase.io/alexchiri) on keybase.
  • I have a public key whose fingerprint is EA37 C382 D1BC A831 B58D 57CF 8D3E 2673 7FC0 5747

To claim this, I am signing this object:

@alexchiri
alexchiri / TimeTravelling.output
Created September 8, 2013 12:25
Output of running the TimeTravelling.java main method.
Greetings from the present: Sun Sep 08 14:24:43 CEST 2013
Greetings from the past: Mon Jun 24 14:24:43 CEST 2013
Attempt to get back in the present no 1: Sat Sep 07 14:24:43 CEST 2013
Attempt to get back in the present no 1: Sun Sep 08 14:24:43 CEST 2013
@alexchiri
alexchiri / TimeTravelling.java
Last active December 22, 2015 14:18
Playing around with the add method of the Calendar.
import java.util.Calendar;
public class TimeTravelling {
public static void main(String[] args) {
Calendar now = Calendar.getInstance();
System.out.println("Greetings from the present: " + now.getTime());
Calendar twoMonthsAndTeoWeeksAgo = Calendar.getInstance();
twoMonthsAndTeoWeeksAgo.setTime(now.getTime());
public static void main(java.lang.String[]);
flags: ACC_PUBLIC, ACC_STATIC
Code:
stack=3, locals=4, args_size=1
0: new #2 // class java/util/ArrayList
3: dup
4: invokespecial #3 // Method java/util/ArrayList."<init>":()V
7: astore_1
8: aload_1
Classfile /C:/Users/alex/IdeaProjects/Tests/out/production/Tests/com/alexchiri/bytecode/ASimpleClass.class
Last modified 27-jan-2013; size 1319 bytes
MD5 checksum 441505122fb6fa3d285243a382ddef46
Compiled from "ASimpleClass.java"
public class com.alexchiri.bytecode.ASimpleClass
SourceFile: "ASimpleClass.java"
minor version: 0
major version: 51
flags: ACC_PUBLIC, ACC_SUPER
package com.alexchiri.bytecode;
import java.util.ArrayList;
import java.util.List;
/**
* Alexandru Chiritescu
* 27-1-13
*/
public class ASimpleClass {
Random number of money bags to load the safe with: 12
Loading bank 'Cool bank' with 12 money bags!
Loading safe with 12 money bags!
Team Kansas is ready to go!
Team Charlie's Angels is ready to go!
Team Lottery ticket is ready to go!
Team Who wants to be a millionaire? is ready to go!
(Bank:Cool bank) Opening safe under gunpoint for 'Kansas'
Team Kansas can only steal 3 money bags.
package com.alexchiri;
import com.alexchiri.bank.Bank;
import com.alexchiri.bank.MoneyBag;
import com.alexchiri.robber.Heist;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
package com.alexchiri.bank;
import java.util.List;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
/**
* Alexandru Chiritescu
* 13-1-13
*/
Random number of money bags to load the safe with: 3
Loading bank 'Cool bank' with 3 money bags!
Loading safe with 3 money bags!
Team Skeets is ready to go!
(Bank:Cool bank) Opening safe under gunpoint for main
Team Skeets can only steal 2 money bags.
(Bank:Cool bank) Removing 2 money bags from the safe for ForkJoinPool-1-worker-1
(Bank:Cool bank) Robbery ended and in the Safe we have 1 money bags left!