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
function sum(ary) { | |
var result = 0; | |
for (var i = 0; i < ary.length; i++) { | |
result += ary[i]; | |
} | |
return result; | |
} |
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
iteration = 0 | |
count = 0 | |
while iteration < 5: | |
for letter in "hello, world": | |
count += 1 | |
print("Iteration " + str(iteration) + "; count is: " + str(count)) | |
iteration += 1 |
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
require 'flickraw' | |
require 'open-uri' | |
FlickRaw.api_key="your api key" | |
FlickRaw.shared_secret="your secret" | |
args = { | |
tags: "1680x1050,nature", | |
tag_mode: "all", | |
per_page: 500, |
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 | |
# Copyright (c) 2011 Josh Schreuder | |
# http://www.postteenageliving.com | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
# copies of the Software, and to permit persons to whom the Software is | |
# furnished to do so, subject to the following conditions: |
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
function sopcast_vlc () { | |
Downloads/sp-auth/sp-sc-auth \ | |
sop://broker.sopcast.com:3912/"$1" 3908 8908 > /dev/null & | |
sleep 5; | |
vlc http://localhost:8908/tv.asf; | |
killall sp-sc-auth; | |
} |
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
>>> $A # у нас есть точка | |
<A = (1.64, 2.16)> | |
>>> $B # еще одна | |
<B = (4.16, 1.96)> | |
>>> List = [$A] # поместим одну из них в список | |
>>> List # проверим, там ли она: | |
[<A = (1.64, 2.16)>] | |
>>> $A in List | |
True # True, то есть, да |
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 print_strategy(P, name): | |
s = '$ {} = \left('.format(name) | |
for el in P: | |
if el.denominator > 1: | |
s += '\\frac{{ {} }}{{ {} }}, '.format(el.numerator, el.denominator) | |
else: | |
s += '{}, '.format(el) | |
s = s.rstrip(', ') | |
s += '\\right)$' | |
return s |