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
<html> | |
<head> | |
<meta content='text/html; charset=UTF-8' http-equiv='Content-Type'/> | |
</head> | |
<body> | |
<form name="f" id="f" action="#" onsubmit="translate(); return false;"><textarea name="text" rows="4" cols="60">Enter text here</textarea><br /><br /><input type="submit" value="Перевести на русский" onfocus="this.blur();" /><br /><br /><textarea name="translation" rows="4" cols="60" onfocus="this.select();" readonly="true"></textarea></form><br /><script type="text/javascript" src="http://www.google.com/jsapi"></script> <script type="text/javascript">google.load("language", "1"); function translate() {var originaltext=document.forms["f"].text.value; google.language.translate(originaltext, "", "ru", function(result) { document.forms["f"].translation.value = (result.error)?("Error: "+result.error.message):result.translation; }); } </script> | |
</body> | |
</html> |
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
namespace config { | |
class Quix{} | |
#define FOO_BAR | |
#if FOO_BAR | |
// active block | |
class FooBar{ | |
} |
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 <QObject> | |
class Receiver : public QObject { | |
Q_OBJECT | |
// ... | |
signals: | |
void bytesReceived(QByteArray b); | |
// ... | |
} |
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
/*! | |
* Convert .select elements to Bootstrap Dropdown Group | |
* Assumes jQuery and Bootstrap scripts already linked | |
* | |
* Expected markup: | |
* | |
* <div id="someId" data-name="someName" class="select someClass"> | |
* <div class="option selected" data-value="1"> Item 1 <i class="icon-ok"></i></div> | |
* <div class="option" data-value="2"> Item 2 <span>some html</span></div> | |
* <div class="option" data-value="3"> Item 3 <img src="little.img"></div> |
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
Useful symbols: | |
~~~~~~~~~~~~~~ | |
–—‒ - dash (en/em/figure) | |
“”«» - quotes (english/russian) | |
©®™ - copyright | |
←↑→↓ - arrows | |
↖↗↘↙ - arrows giagonal | |
⇐⇑⇒⇓⇔⇕ - arrows double | |
×⋅ - multiplication | |
… - ellipsis |
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 | |
# Usage example: echo 'use "hw1test.sml";' | sml | truecolor.rb | |
require 'colorize' | |
# HA HA HA I USE GLOBAL VARIABLES | |
$failed = 0 | |
$passed = 0 | |
while line = gets |
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
// locate this in src/main/scala/ to compile with sbt | |
import org.joda.time.Period | |
import org.joda.time.format.PeriodFormat | |
import org.scala_tools.time.Imports._ | |
object Main extends App { | |
def periodDiff(t1: Period)(t2: Period) = PeriodFormat.getDefault print (t1 - t2).normalizedStandard | |
println( periodDiff(2.hours + 14.minutes + 39.seconds)(1.hour + 32.minutes + 43.seconds) ) |
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
\url{http://www.krugosvet.ru/enc/nauka_i_tehnika/astronomiya/CHERNAYA_DIRA.html} | |
ЧЕРНАЯ ДЫРА – область пространства, в которой гравитационное притяжение настолько сильно, что ни вещество, | |
ни излучение не могут эту область покинуть. Для находящихся там тел вторая космическая скорость (скорость убегания) | |
должна была бы превышать скорость света, что невозможно, поскольку ни вещество, ни излучение не могут двигаться быстрее | |
света. Поэтому из черной дыры ничто не может вылететь. Границу области, за которую не выходит свет, называют | |
«горизонтом событий», или просто «горизонтом» черной дыры. | |
\section{История} | |
Основные этапы \url{https://ru.wikipedia.org/wiki/Чёрная_дыра} |
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
[info] Koans: (http://scalakoans.webfactional.com) | |
[info] AboutAsserts: | |
[info] - asserts can take a boolean argument | |
[info] - asserts can include a message | |
[info] - true and false values can be compared with should matchers | |
[info] - booleans in asserts can test equality | |
[info] - sometimes we expect you to fill in the values | |
[info] AboutValAndVar: | |
[info] - Vars are variables, and may be reassigned | |
[info] - vals are values, and may not be reassigned, analogous to final in Java |
NewerOlder