This file contains 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 "RectangleTracker.h" | |
static void TrackTask(RectangleTracker *t) { | |
while (true) { | |
if (!t->Enabled()) continue; | |
if (!t->camera->IsFreshImage()) continue; | |
t->GetRectangles(); | |
if (t->MatchesFound()) { | |
t->SelectTarget(); |
This file contains 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 "TrackingImage.h" | |
static bool HeightSort(RectangleMatch a, RectangleMatch b) { | |
return a.corner[0].y < b.corner[0].y; | |
} | |
TrackingImage::TrackingImage(AxisCamera &camera) { | |
ColorImage *rawImage = new ColorImage(IMAQ_IMAGE_RGB); | |
camera.GetImage(rawImage); | |
grayscaleImage = rawImage->GetLuminancePlane(); |
This file contains 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 "Camera.h" | |
#include "../Configuration.h" | |
#include <math.h> | |
#define fuzzy(a, b) static Camera::FuzzyDistance *(a) = new Camera::FuzzyDistance;\ | |
*(a) = (b); | |
Camera::Camera(): | |
Subsystem("Camera"), | |
panValue(0), |
This file contains 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
# Access child peripherals with :: | |
# peripheral::child_peripheral::another_peripheral | |
# Access events with the dot operator | |
# peripheral.periodic | |
# Write to a peripherals property value with the assignment operator | |
# peripheral = value | |
left_joystick::x_axis.periodic: |
This file contains 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
window.streamCallback = (data) -> | |
if $.streams is undefined or data.version >= $.streams.version | |
$.streams = data | |
executeStreams() | |
executeStreams = -> | |
for stream in $.streams.streams | |
elm = $("#blank-stream").clone() | |
elm.attr("id", "stream-#{stream.id}") | |
elm.html(stream.embed) |
This file contains 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
require "gosu" | |
class Character | |
def initialize(window) | |
@window = window | |
@sprite = Gosu::Image.new(@window, "sprite.gif", false) | |
@x, @y = 100, @window.floor | |
@counter = 0 | |
@angle = 0 |
This file contains 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
// RobotClasses.cpp : Defines the entry point for the console application. | |
// | |
#include "stdafx.h" | |
#include <iostream> | |
#include <string> | |
using namespace std; | |
class Robot { |
This file contains 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
IsArmInButtonPressed() | |
previousArmInButton && !currentValue | |
clawState == OUT | |
distance > 0 | |
degreesToTurn < 0 |
This file contains 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
SELECT days.*, name, SUM(value) AS total_points FROM "days" LEFT JOIN points ON points.day_id = days.id LEFT JOIN tasks ON tasks.id = points.task_id WHERE "days"."user_id" = 2 AND (value IS NOT NULL) GROUP BY task_id, date ORDER BY date; |
This file contains 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
<tr id="<%= dom_id(@task) %>"> | |
<input type="hidden" class="achieved" value="<%= @task.achieved_points %>" /> | |
<input type="hidden" class="quota" value="<%= @task.required_points %>" /> | |
<td class="task-controls"> | |
<div class="graph-hidden"><%= image_tag image_path("graph_hidden.png"), :width => "30", :class => "graph-hidden graph-button", "data-task" => @task.name %></div> | |
<div class="graph-visible"><%= image_tag image_path("graph_visible.png"), :width => "30", :class => "graph-visible graph-button", "data-task" => @task.name %></div> | |
</td> | |
<td class="task-name"><span class="name"><%= @task.name %></span> (<span class="achieved"><%=n @task.achieved_points %></span> / <span class="quota"><%=n @task.required_points %></span>)</td> | |
<td class="task-bar pointer"> | |
<%= render :partial => "progress", :locals => { :task => @task } %> |