This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class ArtifactsWhenUsingDialogFont { | |
| public static void main(String... args) throws Exception { | |
| PrinterJob job = PrinterJob.getPrinterJob(); | |
| job.setPrintService(PrintServiceLookup.lookupDefaultPrintService()); | |
| job.setPrintable(new Printable(){ | |
| @Override | |
| public int print(Graphics graphics, PageFormat pageFormat, int pageIndex) throws PrinterException { | |
| graphics.translate( (int) pageFormat.getImageableX(), (int) pageFormat.getImageableY() ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <html> | |
| <head> | |
| <script src="jquery-2.0.3.min.js"></script> | |
| <script src="underscore-min.js"></script> | |
| <script src="mustache.js"></script> | |
| <script> | |
| $(function(){ | |
| $('.btn').click(function(e) { | |
| var user = $.parseJSON( _.unescape( $(this).next().text() ) ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package stackoverflow; | |
| public class Hexdump { | |
| public static void main(String[] args) { | |
| // This is mocked. Get the actual filename | |
| String filename = "Qwertypsadfksadf"; | |
| // Log the hexdump | |
| System.out.println(hexdump(filename)); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package stackoverflow; | |
| import java.awt.Color; | |
| import java.awt.image.BufferedImage; | |
| import java.sql.Blob; | |
| import java.sql.Connection; | |
| import java.sql.PreparedStatement; | |
| import java.sql.ResultSet; | |
| import java.util.Arrays; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package stackoverflow; | |
| import java.io.UnsupportedEncodingException; | |
| import java.net.URLDecoder; | |
| import java.net.URLEncoder; | |
| import java.util.HashSet; | |
| import java.util.Iterator; | |
| import java.util.LinkedHashMap; | |
| import java.util.Map; | |
| import java.util.Map.Entry; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import commands, re | |
| import pprint | |
| class Engine: | |
| def __init__(self): | |
| self.data = dict() | |
| def updateSourceEvent(self): | |
| self.updateData() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ? | |
| help | |
| logout | |
| reboot | |
| adsl | |
| atm | |
| brctl | |
| cat | |
| ethctl | |
| ddns |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| trait MyOption[A] { outer => | |
| import MyOption._ | |
| def fold[B](map: A => B, getOrElse: => B): B | |
| } | |
| object MyOption { | |
| def none[A]: MyOption[A] = |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Requires python-imaging on Ubuntu | |
| import PIL.Image, random, time | |
| class AlexRand(random.Random): | |
| '''This replicates how PHP does randint()''' | |
| def randint(self, a, b): | |
| self.seed() | |
| return super(AlexRand, self).randint(a, b) | |
| image = PIL.Image.new("1",(512,512)) # Creates a 512x512 bitmap |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Python 2.x | |
| import random | |
| import itertools | |
| tasks = ['account', 'gestione classi', 'registro insegnanti', | |
| 'registro di classe', 'corsi di studio', 'gestione materie', 'bacheca', | |
| 'giornalino', 'pon', 'gestione circolari', 'gestione locali', | |
| 'inventario', 'viaggi', 'tasse'] | |
| assignees = ["Marco", "Gabriele", "Raffaele"] |