Skip to content

Instantly share code, notes, and snippets.

View tonellotto's full-sized avatar

Nicola Tonellotto tonellotto

View GitHub Profile
# Copyright (c) 2013 Georgios Gousios
# MIT-licensed
# Edited to handle two new tables: postLinks and tags that are present in the 2014 dataset
create database stackoverflow DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
use stackoverflow;
create table badges (
Id INT NOT NULL PRIMARY KEY,
@tonellotto
tonellotto / gist:5024040587ed73db8f31
Created June 18, 2015 13:46
XML 2 SQL for Stack Overflow
#!/usr/bin/env python
# http://paste.org/8946 "no" 2009
# Updated by Tero Karvinen http://TeroKarvinen.com
import xml.sax.handler
import xml.sax
import sys
class SOHandler(xml.sax.handler.ContentHandler):
def __init__(self):
self.errParse = 0
@tonellotto
tonellotto / frozenlake8x8_valueiteration.py
Created August 1, 2018 11:44
Solution of FrozenLake8x8 environment using Value Iteration.
"""
Solving FrozenLake8x8 environment using Value-Itertion.
Author : Moustafa Alzantot ([email protected])
"""
import numpy as np
import gym
from gym import wrappers
@tonellotto
tonellotto / frozenlake8x8_policyiteration.py
Created August 1, 2018 11:46
Solution of FrozenLake8x8 environment using Policy Iteration.
"""
Solving FrozenLake8x8 environment using Policy iteration.
Author : Moustafa Alzantot ([email protected])
"""
import numpy as np
import gym
from gym import wrappers
def run_episode(env, policy, gamma = 1.0, render = False):
@tonellotto
tonellotto / gitcom.md
Created March 20, 2020 09:27 — forked from jednano/gitcom.md
Common git commands in a day-to-day workflow

Git Cheat Sheet

Initial Setup

Create an empty git repo or reinitialize an existing one

$ git init
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You 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
*
#!/bin/bash
## This gist contains instructions about cuda v10.1 and cudnn 7.6 installation in Ubuntu 18.04 for Tensorflow 2.1.0
### steps ####
# verify the system has a cuda-capable gpu
# download and install the nvidia cuda toolkit and cudnn
# setup environmental variables
# verify the installation
###
@tonellotto
tonellotto / geodesy_regex.py
Created June 22, 2021 15:19 — forked from cgudea/geodesy_regex.py
regular expressions for verifying common coordinate systems
# This program 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.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.