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
/* Defines macros tor printing debug information. | |
* To enable debug messages, #define DEBUG. | |
* To change the level, define DBG_PLEVEL to a level which | |
* is the minimum urgency that shall be printed. | |
* | |
* https://gist.github.com/Quackmatic/312e77a8df62bf731385 | |
*/ | |
#ifndef DBG_H | |
#define DBG_H |
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
/* Quackmatic 2014 | |
* https://github.com/Quackmatic | |
*/ | |
#include <math.h> | |
#include "vector2.h" | |
vec2 vec_add(vec2 v1, vec2 v2) | |
{ | |
vec2 value = { v1.x + v2.x, v1.y + v2.y }; |
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
/* Vector2 code at https://gist.github.com/Quackmatic/8f904e2f0cb7d144c0b7 | |
*/ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <math.h> | |
#include <stdbool.h> | |
#include "vector2.h" |
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
def alpha_to_num(str, col=0) | |
unless str.nil? || str.empty? | |
return (alpha_to_num(str.slice(0, str.length - 1), col + 1)) * 26 + | |
"abcdefghijklmnopqrstuvwxyz".index(str.downcase[str.length - 1]) + (col > 1 ? 1 : col) | |
else | |
0 | |
end | |
end | |
def cell_coords(str) |
This file has been truncated, but you can view the full 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
Speed limit is 60.00 mph. | |
Speed camera number 1 is 0 metres down the motorway. | |
Speed camera number 2 is 580 metres down the motorway. | |
Speed camera number 3 is 900 metres down the motorway. | |
Speed camera number 4 is 1390 metres down the motorway. | |
Speed camera number 5 is 1885 metres down the motorway. | |
Start of log for camera 1. | |
Vehicle PV50 CAN passed camera 1 at 05:33:26. | |
Vehicle W867 BRO passed camera 1 at 05:33:29. | |
Vehicle KQ63 ARU passed camera 1 at 05:33:38. |
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
Vehicle M655 LLN broke the speed limit by 0.43 mph. | |
Vehicle U721 MXB broke the speed limit by 0.28 mph. | |
Vehicle H732 SKY broke the speed limit by 3.88 mph. | |
Vehicle 12 SM broke the speed limit by 0.98 mph. | |
Vehicle U398 NYO broke the speed limit by 6.53 mph. | |
Vehicle T626 OHU broke the speed limit by 2.14 mph. | |
Vehicle L247 TXV broke the speed limit by 4.53 mph. | |
Vehicle M362 XNK broke the speed limit by 6.77 mph. | |
Vehicle D953 ICB broke the speed limit by 3.83 mph. | |
Vehicle B766 PYQ broke the speed limit by 4.13 mph. |
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 ruby | |
# /r/DailyProgrammer Challenge 182e: The Column Conundrum | |
words = [] | |
columns, column_width, space_width = gets.chomp.split(' ').map {|s| s.to_i} | |
while (line = gets; line != nil && line.chomp.length > 0) | |
words += line.chomp.split(' ') | |
end |
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
4 25 1 | |
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut at pharetra sapien, id sodales ipsum. Vivamus eleifend molestie tortor, vel pretium tortor venenatis nec. Nam in metus vitae nulla aliquam fringilla at vel metus. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis dignissim mauris a velit facilisis ullamcorper. Ut vitae consectetur purus, eu auctor quam. Donec aliquet, urna non egestas faucibus, mauris velit vestibulum quam, eget porttitor eros dui non eros. Aliquam fringilla, mi et suscipit lacinia, libero ligula consequat quam, id facilisis neque augue eget metus. Mauris dignissim quis ex eget euismod. Nunc vitae lectus turpis. Vivamus tincidunt, est sollicitudin varius blandit, sapien quam molestie mi, eget volutpat dui mauris nec dui. Praesent tincidunt lectus ut leo tincidunt, quis consectetur sapien ultricies. Nunc erat risus, mollis in ultrices ac, posuere sit amet velit. Pellentesque semper tempus sapien id tempor. Suspendisse vitae condimentum mauris, quis imperdiet nisl. | |
N |
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
Lorem ipsum dolor sit felis, eleifend lacinia dictumst. Donec elementum Aliquam euismod massa vel | |
amet, consectetur diam facilisis egestas. risus laoreet, molestie magna consequat semper. | |
adipiscing elit. Ut at Nullam varius eu diam ut dui vel, volutpat dui. Sed porttitor aliquet | |
pharetra sapien, id iaculis. Duis viverra Aenean facilisis mollis elit, ut porttitor ipsum | |
sodales ipsum. Vivamus imperdiet leo quis accumsan. Nullam eu imperdiet non. | |
eleifend molestie tortor, condimentum. Ut tincidunt vehicula diam. Vivamus at Pellentesque tincidunt | |
vel pretium tortor ullamcorper velit, nec nunc eros. Proin sodales felis, sit amet | |
venenatis nec. Nam in sodales velit. Nulla pharetra, orci non congue pulvinar libero facilisis | |
metus vitae nulla aliquam porttitor mi enim, nec porta, massa metus eleifend. Donec vitae | |
fringilla at vel metus. blandit tellus rutrum finibus est, aliquam viverra tu |
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
class Program | |
{ | |
static Random random = new Random(); | |
static void Main(string[] args) | |
{ | |
InputData data = GetInput(); | |
int sampleSize = 1024; | |
Bitmap chart = new Bitmap(data.SimulationTime, sampleSize); |