Skip to content

Instantly share code, notes, and snippets.

View Taresin's full-sized avatar

Dougy Lee Taresin

View GitHub Profile
@Taresin
Taresin / __sydney_trains_baseline_script_story.md
Last active February 5, 2025 03:50
Write a python script that creates a baseline betweenness centrality scores for the Sydney trains network

Scripting Story

I’ll need to interact with the Neo 4J database using the Python driver.

The package that I used was the neo4J library.

Install that and import the graph database driver.

from neo4j import GraphDatabase
@Taresin
Taresin / _sydney_trains_betweenness.cypher
Created February 3, 2025 11:27
Calculating the betweenness centrality property of Sydney Trains nodes
CALL gds.graph.project.cypher(
'projection_trains',
'MATCH (s:Stop) RETURN id(s) AS id',
'MATCH (s:Stop)-[:NEXT_STOP]->(t:Stop) RETURN id(s) AS source, id(t) AS target, "NEXT_STOP" AS type'
);
CALL gds.betweenness.write('projection_trains', {
writeProperty: 'betweennessCentrality'
});
@Taresin
Taresin / _create_station_relationships.py
Last active February 3, 2025 09:41
Adding all the train stations on the Sydney trains network into a knowledge graph
import os
# Iterate through all .txt files in "data" folder
if not os.path.exists("output"):
os.makedirs("output")
station_list = set()
for file in os.listdir("data"):
if file.endswith(".txt"):
text = open("data/{}".format(file), "r").read().split("\n")
@Taresin
Taresin / harry_potter_relationships.cypher
Last active February 2, 2025 10:20
Fetching and processing CSV data of the character relationships of Harry Potter
// Basic import from a CSV file hosted online
LOAD CSV WITH HEADERS FROM 'https://raw.githubusercontent.com/efekarakus/potter-network/master/data/characters.csv' AS character
CREATE (c:Character {
id: character.id,
name: character.name,
bio: character.bio
});
LOAD CSV WITH HEADERS FROM 'https://raw.githubusercontent.com/efekarakus/potter-network/master/data/relations.csv' AS relationship
@Taresin
Taresin / dates.csv
Last active January 31, 2025 06:09
Creating a random set of Tinder users and pairing them up in dates
a b
98 43
39 93
28 99
28 41
74 51
74 48
18 30
51 10
51 44
# ==============================================================================
# Title: Taxi-V3 OpenAI Gym Environment Update
# Author: Taresin
# Date: 26/02/2024
#
# Description: This code is an update to a previously existing Gist for OpenAI Gym
# environments. It incorporates fixes the functionality
# with compatibility to the new Gymnasium library. The update is based on the original work found in Aske Plaat's
# book "Deep Reinforcement Learning" and the original code by Geffy available at
# https://gist.github.com/geffy/b2d16d01cbca1ae9e13f11f678fa96fd
#!/usr/bin/env bash
# Creates a file called test.txt
FILE_NAME="chmod_game.txt"
get_random() {
shuf -i 0-$1 -n 1
}
owner=$(get_random 7)

Keybase proof

I hereby claim:

  • I am taresin on github.
  • I am taresin (https://keybase.io/taresin) on keybase.
  • I have a public key ASBU-DG4Gf0t4K8krrJKUhIfGEMAWWyh6lKcjz9KKIPAOgo

To claim this, I am signing this object:

@Taresin
Taresin / output.txt
Created June 16, 2020 02:47
COSC2138 - Week 3 Lab exercises
Question 1
-----------
Test Case 1
Input: Freddy
Non-numerical input occurred
Answer: -1
Test Case 2
Input: 40Freddy
Non-numerical input occurred
@Taresin
Taresin / output.txt
Last active June 15, 2020 11:04
COSC2138 - Week 2 Lab exercises
Left Aligned
*
**
***
****
*****
******
*******
********
*********