Skip to content

Instantly share code, notes, and snippets.

View recv_multicast.c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <time.h>
#if !defined(_WIN32)
#include <sys/socket.h>
#include <netdb.h>
#include <arpa/inet.h>
#include <net/if.h>
View recv_multicast.py
#!/usr/bin/env python3
import socket
import sys
import struct
if len(sys.argv) != 2:
print("usage: {} intf".format(sys.argv[0]))
print("interfaces:")
for idx, name in socket.if_nameindex():
print("{}: {}".format(idx, name))
View error_windows.c
void myperror(const char *msg) {
char *wsa_message = NULL;
FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
NULL,
WSAGetLastError(),
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
(LPSTR)&wsa_message,
0,
NULL);
printf("%s : %s\n", msg, wsa_message);
View send_multicast.c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <time.h>
#include <unistd.h>
#if !defined(_WIN32)
#include <sys/socket.h>
#include <netdb.h>
#include <arpa/inet.h>
View stegapp.dart
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:convert';
import 'dart:math';
import 'dart:ui';
import 'package:flutter/services.dart';
import 'package:image/image.dart' as A;
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
View git pull conflict.txt
Comment gérer un conflit git, du type "a merge would override your changes":
1) enregistrer les modifications locales: git stash
2) faire le merge: git pull
3) réappliquer ls modifications locales: git stash pop
4) maintenant ils y a peut-être des conflicts, git dit:
auto-merge blabla
CONFLICT blabla
5) pour chacun des fichiers avec un conflit, l'ouvrir et chercher les conflits,
c'est toujours du type:
View error.txt
02:32:37 ERROR: Compiling the checker for '/tmp/maze'
In file included from check.cpp:1:
/usr/local/france-ioi/test//_common//checkers/common.h:485:24: error: ‘constexpr’ needed for in-class initialization of static data member ‘const double DistAllRoundChecker::multipleThreshold’ of non-integral type [-fpermissive]
const static double multipleThreshold = 1e-5;
^~~~~~~~~~~~~~~~~
In file included from /usr/local/france-ioi/test//_common//checkers/common.h:653,
from check.cpp:1:
/usr/local/france-ioi/test//_common//checkers/checker_commands.h: In member function ‘virtual void CheckerCommands::successButRemains(std::__cxx11::string, int, std::__cxx11::string)’:
/usr/local/france-ioi/test//_common//checkers/checker_commands.h:101:48: warning: unused parameter ‘msg’ [-Wunused-parameter]
void CheckerCommands::successButRemains(string msg, int score, string cmd) {
View landscape.patch
diff --git a/firmware/export/config/sansafuzeplus.h b/firmware/export/config/sansafuzeplus.h
index 2a57619b06..e637a148a3 100644
--- a/firmware/export/config/sansafuzeplus.h
+++ b/firmware/export/config/sansafuzeplus.h
@@ -99,8 +99,8 @@
#define CONFIG_CODEC SWCODEC
/* LCD dimensions */
-#define LCD_WIDTH 240
-#define LCD_HEIGHT 320
View pcm-alsa-threaded.c
/***************************************************************************
* __________ __ ___.
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
* \/ \/ \/ \/ \/
*
* Copyright (C) 2010 Thomas Martitz
* Copyright (C) 2018 Amaury Pouly
View mips_lib.S
/***************************************************************************
* __________ __ ___.
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
* \/ \/ \/ \/ \/
*
* Copyright (C) 2015 by Marcin Bukat
* Copyright (C) 2017 by Amaury Pouly