This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import torch | |
import torch.nn as nn | |
from torch.nn import functional as F | |
from torch.autograd import Variable | |
from torch import optim | |
import numpy as np | |
import math, random | |
# Generating a noisy multi-sin wave |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# thanks to http://stackoverflow.com/a/20743090 | |
# thanks to https://github.com/diogovk/c2nasm | |
# install objconv: https://github.com/vertis/objconv | |
# | |
# $1: source code | |
set -e | |
C_FILE="$1" | |
BASE_NAME="${C_FILE%.*}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Diagnostics; | |
using System.Text; | |
using System.Threading.Tasks; | |
public static class ProcessAsyncHelper | |
{ | |
public static async Task<ProcessResult> ExecuteShellCommand(string command, string arguments, int timeout) | |
{ | |
var result = new ProcessResult(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
Purpose of the file: subscribe to a topic called /image_raw of type sensor_msgs/Image | |
Apply filter to the resulting image | |
""" | |
from __future__ import print_function | |
import cv2 | |
import numpy as np | |
import rospy | |
from sensor_msgs.msg import Image |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* SPI Master Demo written by Robert Mollik, 2016 | |
* | |
* This demo uses the SPI protocol on a Arduino Uno R3 / ATmega8 controller | |
* | |
* The demo sends out a request ID depending, whether a temperature or humidity signal shall be obtained from the slave. Both signals | |
* are datatype float, however get received as 4 bytes and need to be re-assembled. | |
*/ | |
#define CS PC0 // Chip select pin, any vacant portpin can be used |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* USI SPI Slave Demo written by Robert Mollik, 2016 | |
* | |
* This demo uses the SPI protocol with USI interface. This is necessary with with the smaller AVR controller since they don't | |
* a complete SPI functionality. | |
* Demo is written for the pinout of an Arduino Trinket and ATtiny85. Pins need to be modified if a different controller is used. | |
* | |
* The demo takes receives a request ID from the Master at the beginning of every communication. According to the request ID, | |
* it sends back either a temperature or a humidity values. Since both values are present in float, the 4 bytes of the float need | |
* to be send separately. | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Make sure you grab the latest version | |
curl -OL https://github.com/google/protobuf/releases/download/v3.2.0/protoc-3.2.0-linux-x86_64.zip | |
# Unzip | |
unzip protoc-3.2.0-linux-x86_64.zip -d protoc3 | |
# Move protoc to /usr/local/bin/ | |
sudo mv protoc3/bin/* /usr/local/bin/ | |
# Move protoc3/include to /usr/local/include/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct DeferredDirect3DDevice9: DummyDirect3DDevice9 | |
{ | |
private: | |
char* begin; | |
char* write; | |
char* read; | |
char* end; | |
enum command_t | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#define _USE_MATH_DEFINES | |
#include <cmath> | |
#include <SDL2/SDL.h> | |
#include <SDL2/SDL_opengl.h> | |
constexpr int SCREEN_WIDTH = 800; | |
constexpr int SCREEN_HEIGHT = 600; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/unix/internal.h b/src/unix/internal.h | |
index 03a9226..b2f1a41 100644 | |
--- a/src/unix/internal.h | |
+++ b/src/unix/internal.h | |
@@ -86,7 +86,7 @@ | |
#endif | |
#if defined(__linux__) | |
-# define UV__POLLIN UV__EPOLLIN | |
+# define UV__POLLIN (UV__EPOLLIN | UV__EPOLLPRI) |