Skip to content

Instantly share code, notes, and snippets.

@Neah-Ko
Neah-Ko / anndata_h5py_profile.py
Last active January 31, 2024 11:16
anndata h5py profile
import os
import sys
import psutil
import inspect
import time
from pathlib import Path
import h5py as hp
import anndata as ad
from anndata.experimental import sparse_dataset
@Neah-Ko
Neah-Ko / VIP_cnag.yml
Last active April 25, 2024 10:44
conda yml env file for cellxgene VIP docker image
name: base
channels:
- bioconda
- conda-forge
- defaults
dependencies:
- _libgcc_mutex=0.1
- backcall=0.2.0
- backports=1.0
- backports.functools_lru_cache=1.6.1
#!/bin/python3
# 2 Partition problem
# input: n integers 1 <= i <= n
# question: can we split those ingers into two sets, such that we minimize the difference between the sums ?
#
# Using branch & bound
#def branch()
#def lower_bound()
lambda = [100, 10, 1, .1, .01, .001];
wx = zeros(length(lambda),Y-1);
figure;
for i = 1:length(lambda)
% signature : SoftSVM_SGD(D, T, lambda, n)
[w, his, bis] = SoftSVM_SGD(D, 200, lambda(i), 1);
wx(i,:) = w;
% plotting
subplot(floor(length(lambda)/3),3,i);
set(gca, 'YScale', 'log');
% Zebra enigma inspiration
:- op(100, xfy, on).
X on List :- member(X, List).
% Across / Beside
% We imagine people disposed on the table in the order 1, 2 | 3, 4 and not 1, 3 | 2, 4
% We define indexof function (for some odd reason nth0/3 didn't worked)
% indexof(_Element, _Index, _List).
indexof(E, 0, L) :- L = [E | _]. % if E is first element of List : 0
indexof(E, N1, [_ | R]) :- indexof(E, N, R), N1 is N+1. % else increment
/* intersect predicate */
intersect([], L2). % empty list matches
intersect([HL1 | RL1], L2) :- member(HL1, L2) ; % if heads of L1 member of L2
RL1 = [_], intersect(RL1, L2). % or if any character of L1 (we recursively send the rest, and the head will be read each time).
% RL1 must be nonempty so it don't maches base case. RL1 = [_] ie. list isn't empty
/* all_intersect predicate */
all_intersect([], L2). % empty list matches
all_intersect([HL1 | RL1], L2) :- intersect(HL1, L2), % we try intersect on the head
all_intersect(RL1, L2). % and we call recursively on the tail
/* Base predicates */
on(b1, b2).
on(b3, b4).
on(b4, b5).
on(b5, b6).
just_left(b2, b6).
just_left(b6, b7).
/* above predicate */
above(X, Y) :- on(X, Y) ; /* X is above Y if directly on it*/
@Neah-Ko
Neah-Ko / defi-humancoders.md
Last active December 2, 2016 06:59 — forked from camilleroux/defi-humancoders.md
Rendu défi Human Coders

Équipe Dahunicorn

  • Projet: "Recenser les actions pour les migrants en france"
  • Lieu: Bourget du lac

Langages utilisés

-PHP
-JavaScript
-Bash
-Python
-Perl