Skip to content

Instantly share code, notes, and snippets.

@ash2005
ash2005 / App.java
Created September 29, 2016 12:45 — forked from rponte/App.java
Downloading file using Apache HttpClient (>= v4.2) with support to HTTP REDIRECT 301 and 302 when using HTTP method GET or POST
public class App {
public static void main(String[] args) throws MalformedURLException {
URL rightUrl = new URL("http://cursos.triadworks.com.br/assets/css/main.css");
URL redirectableUrl = new URL("http://www.triadworks.com.br/assets/css/main.css"); // redirected to cursos.triadworks.com.br
Downloader downloader = new Downloader();
System.out.println("Downloading file through right Url...");
/*
* valueOfBcdDigits takes an array of unsigned chars that is in BCD format, and
* convert the values into and int.
*
* Inputs -> digits: An unsigned char array
* digitSize: Size of digits
* Output -> Value of the BCD digits, or -1 if the digits are invalid.
*
*/
int valueOfBcdDigits(unsigned char *digits, int digitsSize)
@ash2005
ash2005 / gist:b6cbff923467fcc3eac7
Created January 14, 2016 03:21 — forked from vmlemon/gist:1320161
Modified GSM CardPeek script (UMTS)
--
-- This file is part of Cardpeek, the smartcard reader utility.
--
-- Copyright 2009-2011 by 'L1L1'
--
-- Cardpeek is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
@ash2005
ash2005 / BCD.java
Created January 14, 2016 03:17 — forked from neuro-sys/BCD.java
BCD Conversion in java
/**
* Copyright 2010 Firat Salgur
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*