Skip to content

Instantly share code, notes, and snippets.

/*
* Copyright 1993-2010 NVIDIA Corporation. All rights reserved.
*
* NVIDIA Corporation and its licensors retain all intellectual property and
* proprietary rights in and to this software and related documentation.
* Any use, reproduction, disclosure, or distribution of this software
* and related documentation without an express license agreement from
* NVIDIA Corporation is strictly prohibited.
*
* Please refer to the applicable NVIDIA end user license agreement (EULA)
@FedericoPonzi
FedericoPonzi / SendMail.java
Created May 19, 2018 10:26
An example to send HTML mail with attachment in java. No ssl/tls. Raw
package me.fponzi;
import javax.activation.DataHandler;
import javax.activation.DataSource;
import javax.activation.FileDataSource;
import javax.mail.*;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeBodyPart;
import javax.mail.internet.MimeMessage;
import javax.mail.internet.MimeMultipart;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.Random;
/**
* Created by Federico Ponzi on 19/02/17.
* https://www.linkedin.com/pulse/performance-array-vs-linked-list-modern-computers-dat-hoang-tien
*/
public class Benchmark
{
import java.util.StringTokenizer;
import java.util.TreeMap;
class FrequenzeDiParoleInUnaStringa
{
private String stringa; //La stringa da analizzare
private TreeMap<String, Integer> dictionary = new TreeMap<String, Integer>(); //Inizializzo il TreeMap
FrequenzeDiParoleInUnaStringa(String stringa)
{
@FedericoPonzi
FedericoPonzi / cuda-versions.txt
Created January 15, 2018 09:05
For reference, on linux, the previous CUDA toolkits required the following minimum driver versions
CUDA 9.1: 387.xx
CUDA 9.0: 384.xx
CUDA 8.0 375.xx (GA2)
CUDA 8.0: 367.4x
CUDA 7.5: 352.xx
CUDA 7.0: 346.xx
CUDA 6.5: 340.xx
CUDA 6.0: 331.xx
CUDA 5.5: 319.xx
CUDA 5.0: 304.xx
@FedericoPonzi
FedericoPonzi / menu.php
Created January 4, 2018 09:34
A very simple menu.php for automatically higlight the page based on the name. For semi-static websites.
<?php
class MenuItem{
var $name;
var $url;
var $icon;
function __construct($n, $u, $i)
{
$this->name = $n;
$this->url = $u;
$this->icon = $i;
@FedericoPonzi
FedericoPonzi / wrap_malloc.c
Created November 15, 2017 14:26
Malloc/callloc ecc wrappers from bwa source
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#ifdef USE_MALLOC_WRAPPERS
/* Don't wrap ourselves */
# undef USE_MALLOC_WRAPPERS
#endif
#include "malloc_wrap.h"
@FedericoPonzi
FedericoPonzi / 21.cpp
Created November 5, 2017 15:34
This is my first attempt to learn CUDA, and is the solution for the problem 21 on project euler.
#include <iostream>
#include <math.h>
#include <vector>
#include <map>
#include <string>
using namespace std;
void divide(int N, long* m){
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "inc/env.h"
Env **environment;
/**
* This sould be a K-V hashmap. I will rewrite it someday (maybe)
*/
==Phrack Inc.==
Volume One, Issue 7, Phile 3 of 10
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
The following was written shortly after my arrest...
\/\The Conscience of a Hacker/\/
by