Skip to content

Instantly share code, notes, and snippets.

View zaccone's full-sized avatar
🏠
Working from home

Marek Denis zaccone

🏠
Working from home
View GitHub Profile
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(int argc, char **argv)
{
size_t size;
scanf("%lu", &size);
int *arr = (int *)malloc(size * sizeof(int));
memset(arr, 0, sizeof(arr));
for (unsigned long i = 0; i < size; i++) {
@zaccone
zaccone / stack.c
Created September 5, 2016 18:11
Generic stack in ANSI C
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef struct stack {
size_t capacity;
size_t size;
size_t pos;
size_t us;
void *container;
} stack;
#include <stdio.h>
#include <string.h>
static const size_t LETTERS = 26;
void permutations(char *str, size_t idx, size_t size, char *letters)
{
if (idx == size) {
printf("%s\n", str);
return;
}
int hash(const int x, const int y)
{
int hash = 17;
hash = ((hash + x) << 5) - (hash + x);
hash = ((hash + y) << 5) - (hash + y);
return hash;
}
#!/bin/sh
apt-get -y update
apt-get -u upgrade
apt-get -u autoremove
apt-get -u clean
apt-get -u dist-upgrade
do-release-upgrade
eppn:myself@testshib.org
GROUPS:Electrons;Muons;Neutrino;Protons;Quarks
{
"group_ids": [],
"user": {
"domain": {
"id": "Federated"
},
"type": "ephemeral",
"id": "maro"
},
"group_names": [
{ "rules":
[
{
"local": [
{
"user": {
"id": "maro"
}
},
{
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#define BUF_SIZE 128
int main() {
char *path= "/tmp/file";
#!/usr/bin/env python3
def f(l=[]):
print(len(l))
l.append(0)
f()
f()
f()