Skip to content

Instantly share code, notes, and snippets.

View pakal's full-sized avatar

Pascal Chambon pakal

View GitHub Profile
@pakal
pakal / MSP430G2553_SPI_RAM_TEST
Created April 20, 2024 21:16 — forked from anonymous/MSP430G2553_SPI_RAM_TEST
Interfaces low cost SPI SRAM (or FRAM) to a MSP430G2553 LaunchPad board
// Inspired by Rick Kimball's 23K256 Test for MSP430F2013
// This code was compiled using Energia and runs on a standard LaunchPad
// The basic SPI SRAM support fits into 290 bytes on MSP430G2553
// Increases to 422 bytes with streaming test
//#include <msp430.h>
//#include <stdint.h>
// Compiled using Energia
// Note the changes BIT0 is now the DEBUG_PIN and BIT4 is the SS_PIN.
@pakal
pakal / hash_table_and_stacks.py
Created February 4, 2021 14:40
hash table and stacks stub
# Python program to demonstrate stack implementation using a linked list. #
class Node:
def __init__(self, value):
self.value = value
self.next = None
class Stack:

La classe Pharmacie gère des clients et des médicaments. Un client est caractérisé par un nom et un crédit. Le crédit représente la somme que ce client doit à la pharmacie. Le crédit peut être négatif si le client a versé plus d'argent que le montant. Un médicament est caractérisé par un nom (chaîne de caractères), un prix (nombre) et un stock (entier).

Les méthodes à compléter sur la Pharmacie auront les caractéristiques suivantes:

affichage(...) permet d'afficher les clients et leurs crédits respectifs ainsi que les médicaments et leurs stocks respectifs.

approvisionnement(..) permet d'approvisionner le stock d'un médicament. Le nom du médicament à approvisionner ainsi que la quantité à ajouter au stock doivent être lus depuis le terminal. Lorsque le nom du médicament est introduit, il faut vérifier qu'il s'agit bien d'un nom connu dans la liste des médicaments de la pharmacie. Le programme doit boucler jusqu'à introduction d'un nom correct. Cette procédure de vérification sera prise en charge par la mé

@pakal
pakal / git-command.md
Last active January 18, 2020 18:02 — forked from aquelito/git-command.md
GIT - Ligne de commande principale
title category
Git config
Git

Rappel

Ne pas oublier : l'aide en ligne de commande.

@pakal
pakal / rsdecorator.py
Created January 20, 2019 10:50
An alternative to @decorator which allows you to easily fiddle with pre-resolved arguments, before transferring control to the wrapped function.
# -*- coding: utf-8 -*-
from __future__ import print_function, unicode_literals
import sys, types, inspect, functools
from decorator import decorator
from functools import partial
IS_PY3K = sys.version_info >= (3,)
if IS_PY3K:
@pakal
pakal / django_allauth_use_cases
Last active June 28, 2019 07:29
Shows non-ajax-friendly 302 responses in many workflows, for django-allauth module app.
"""
This file demonstrates writing tests using the unittest module. These will pass
when you run "manage.py test".
Replace this with more appropriate tests for your application.
"""
from django.test import TestCase
import json