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
hw = [100, 85, 80, 95] | |
hw_avg = hw.inject(:+).to_f/hw.size | |
hw_weight = 35 | |
midterm_score = 84 | |
midterm_weight = 25 | |
pmtg = 91 | |
final_weight = 40 |
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
total = ARGV[0] ? ARGV[0].to_i : 175 | |
ways = ARGV[1] ? ARGV[1].to_i : 10 | |
avg = total/ways | |
min = avg - (ways-1)/2 | |
max = avg + (ways-1)/2 + 1 | |
result = *(min..max) | |
resum = result.reduce(:+) | |
puts "Start "+total.to_s |
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
<?php | |
$X = isset($argv[1]) ? $argv[1] : 175; | |
$n = isset($argv[2]) ? $argv[2] : 10; | |
$y = $X/$n; | |
$result = range($y - ($n-1)/2, $y + ($n-1)/2); | |
$resum = array_reduce($result, function($carry, $item) { | |
return $carry + $item; |
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
Game update: AppID 220200 "Kerbal Space Program", ProcID 3712, IP 0.0.0.0:0 | |
ERROR: ld.so: object '/home/bisbyx/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored. | |
ERROR: ld.so: object '/home/bisbyx/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored. | |
Found path: /home/bisbyx/.local/share/Steam/SteamApps/common/Kerbal Space Program/KSP.x86_64 | |
Mono path[0] = '/home/bisbyx/.local/share/Steam/SteamApps/common/Kerbal Space Program/KSP_Data/Managed' | |
Mono path[1] = '/home/bisbyx/.local/share/Steam/SteamApps/common/Kerbal Space Program/KSP_Data/Mono' | |
Mono config path = '/home/bisbyx/.local/share/Steam/SteamApps/common/Kerbal Space Program/KSP_Data/Mono/etc' | |
Aborted | |
Game removed: AppID 220200 "Kerbal Space Program", ProcID 3712 |
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
#!/usr/bin/env ruby | |
require 'open-uri' | |
require 'nokogiri' | |
require 'json' | |
class AsusRma | |
attr_accessor :json, :data | |
@@url = "http://www.asus.com/support/Repair-Status-Result" | |
@rmano = '' |
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
<?php | |
$array = array("123", "456A", "78"); | |
while ($array[0] < $array[1]) { | |
echo "{$array[0]} < {$array[1]}" . PHP_EOL; | |
array_push($array, array_shift($array)); | |
} |
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
function compareVersion (a, b) { | |
var parts_a = a.split('.'); | |
var parts_b = b.split('.'); | |
var length = Math.max(parts_a.length, parts_b.length); | |
parts_a = extendAsInt(parts_a, length); | |
parts_b = extendAsInt(parts_b, length); | |
return parts_a.reduce( function (prev, current, i, self) { | |
if (prev != 0) { return prev; } |
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
<canvas id="whiteboard" width="400" height="400"></canvas> | |
<script> | |
var example = document.getElementById('example'); | |
var context = example.getContext('2d'); | |
var X = 0, Y = 0, draw = false; | |
example.onmousedown = function(e) { | |
X = e.pageX - this.offsetLeft; | |
Y = e.pageY - this.offsetTop; |
NewerOlder