Skip to content

Instantly share code, notes, and snippets.

View louismullie's full-sized avatar

L louismullie

View GitHub Profile
-- Function to split the input query and generate all contiguous combinations
CREATE FUNCTION split_to_table(@input_query VARCHAR(MAX))
RETURNS @result TABLE (combination VARCHAR(MAX))
AS
BEGIN
DECLARE @words TABLE (id INT IDENTITY(1,1), word VARCHAR(255))
DECLARE @total_words INT, @i INT, @j INT, @current_combination VARCHAR(MAX)
-- Step 1: Splitting the input string into words
INSERT INTO @words (word)
@louismullie
louismullie / carescape-parser.py
Last active June 15, 2023 20:08
CareScape parser
import re
from struct import iter_unpack
from quopri import decodestring
import magic
import matplotlib.pyplot as plt
import numpy as np
# Constants
UNITS = {
@louismullie
louismullie / ruby-project-stats.rb
Created June 17, 2012 20:13
Count the number of files, lines of code and comments in a Ruby project.
o = 0 # Number of files
n = 0 # Number of lines of code
m = 0 # Number of lines of comments
files = Dir.glob('/path/to/dir/**/*.rb')
files.each do |f|
next if FileTest.directory?(f)
o += 1
i = 0
lines = []
Hey dahani9091 (ChatGPT project)
novo_test = pd.read_csv("test.csv")
novo_test
df_cavity = pd.read_csv('/content/gdrive/MyDrive/Kaggle/cavity_pred_CUSTOM_A.csv', low_memory=False)
df_cavity = df_cavity.rename(columns={'variant': 'mutation_key'})
df_cavity
novo_test2 = novo_test.copy().rename({'protein_sequence': 'mutant_seq', 'seq_id': 'source_df_id'}, axis = 1)
novo_test2['sequence'] = 'VPVNPEPDATSVENVALKTGSGDSQSDPIKADLEVKGQSALPFDVDCWAILCKGAPNVLQRVNEKTKNSNRDRSGANKGPFKDPQKWGIKALPPKNPSWSAQDFKSPEEYAFASSLQGGTNAILAPVNLASQNSQGGVLNGFYSANKVAQFDPSKPQQTKGTWFQITKFTGAAGPYCKALGSNDKSVCDKNKNIAGDWGFDPAKWAYQYDEKNNKFNYVGK'
novo_test2 = novo_test2.apply(find_mut,axis=1)
@louismullie
louismullie / php-mail-form.php
Created March 12, 2012 13:47
PHP Mail Form
<!-- CONTACT.HTML -->
<form method='post' action='mailform.php'>
Email: <input name='email' type='text' /><br />
Subject: <input name='subject' type='text' /><br />
Message:<br />
<textarea name='message' rows='15' cols='40'>
</textarea><br />
<input type='submit' />
</form>
@louismullie
louismullie / gist:9726991
Last active September 23, 2022 02:39
OpenGL 3.0 SHA256
#version 130
#pragma optionNV(unroll all)
uint ROTLEFT(in uint a, in int b) { return (a << b) | (a >> (32-b)); }
uint ROTRIGHT(in uint a, in int b) { return (a >> b) | (a << (32-b)); }
uint CH(in uint x,in uint y,in uint z) { return (x & y) ^ (~x & z); }
uint MAJ(in uint x,in uint y,in uint z) { return (x & y) ^ (x & z) ^ (y & z); }
uint EP0(in uint x) { return ROTRIGHT(x,2) ^ ROTRIGHT(x,13) ^ ROTRIGHT(x,22); }
uint EP1(in uint x) { return ROTRIGHT(x,6) ^ ROTRIGHT(x,11) ^ ROTRIGHT(x,25); }
@louismullie
louismullie / textrank-sentence.rb
Last active September 13, 2022 07:02
An implementation of the TextRank algorithm for extractive summarization using Treat + GraphRank. Uses the number of non-stop-words with a common stem as a similarity metric between sentences.
require 'graph-rank'
require 'treat'
# Implements the PageRank algorithm for
# unsupervised extractive summarization.
#
# Reference: R. Mihalcea and P. Tarau, “TextRank:
# Bringing Order into Texts,” in Proceedings of
# EMNLP 2004. Association for Computational
# Linguistics, 2004, pp. 404–411.
@louismullie
louismullie / pi-monte-carlo.py
Created September 23, 2012 07:31
Monte Carlo Estimation of PI in Python
import random as r
import math as m
# Number of darts that land inside.
inside = 0
# Total number of darts to throw.
total = 1000
# Iterate for the number of darts.
for i in range(0, total):
@louismullie
louismullie / domain-name-catching.rb
Created April 15, 2012 01:48
Expired Domain Name Catching Script
domain = "www.test.com"
email = "test@gmail.com"
password = "test"
require 'whois'
require 'gmail'
client = Whois::Client.new
while true