-
+139
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
// Эволюция программы
foo = true;
function foo(){
return true;
}
function foo( param ){
return int;
}
function foo( param1, param2, param3, param4, param5 ){
return result;
}
function foo( object ){
return {result1, result2};
}
class foo {
function bar( object1 ){
return result1;
}
function biz( object2 ){
return result2;
}
}
class factory {
foo = new foo();
bar = new bar();
}
server1 = new factory1();
server2 = new factory2();
// прошло миллион лет...
...а потом программа встала и пошла.
просто так
bot-minurast,
27 Сентября 2012
-
+138
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
# it makes sense to use it only for
# numbers up to 100
fun StringToInteger (str) {
int = -1;
for (i=0; i<=100; i++) {
if (i+"" == str) {
int = i;
break;
}
}
return int;
}
Функция преобразования строк в целые числа из кода бутскрина Ubuntu на неизвестном науке кастомном скриптовом языке.
Пруфлинк: http://bazaar.launchpad.net/~ubuntu-branches/ubuntu/precise/plymouth/precise/view/head:/themes/ubuntu-logo/ubuntu-logo.script#L149
Shnatsel,
22 Сентября 2012
-
+127
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
/**
* Determines equality based upon the contents of this Box instead of the box itself.
* As a result, it is not symmetric. Which means that for
*
* <pre name="code" class="scala">
* val foo = "foo"
* val boxedFoo = Full(foo)
* foo == boxedFoo //is false
* boxedFoo == foo //is true
* </pre>
*
* For Full and Empty, this has the expected behavior. Equality in terms of Failure
* checks for equivalence of failure causes.
*/
override def equals(other: Any): Boolean = (this, other) match {
case (Full(x), Full(y)) => x == y
case (Full(x), y) => x == y
case (x, y: AnyRef) => x eq y
case _ => false
}
https://github.com/lift/framework/blob/master/core/common/src/main/scala/net/liftweb/common/Box.scala
rat4,
20 Сентября 2012
-
+131
Мне было стыдно постить это в С++.
http://www.gamedev.ru/flame/forum/?id=167142&page=2#m25
LispGovno,
20 Сентября 2012
-
+130
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
<div id="busyList" class="busyList">
<div id="busyList" class="busyList">...</div>
<div id="busyList" class="busyList">...</div>
<div id="busyList" class="busyList">...</div>
<div id="busyList" class="busyList">...</div>
<div id="busyList" class="busyList">...</div>
<div id="busyList" class="busyList">...</div>
</div>
Как-то даже грустно становится...
somnambulism,
20 Сентября 2012
-
+133
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
<div style='margin-top: 8px; margin-left: 2px;'><span style='display: inline-block; width: 68px; height: 68px;'><a href='http://www.miss.ru/julii'><img src='fotki/2012-09-13-09-58-01-861mmm_tut.jpg' alt='Юлия Г' border='0' width='62' height='62'></a></span><script language='JavaScript'>
if (document.getElementById("new_user_left_5921")) document.getElementById("new_user_left_5921").src="fotki/2012-09-13-09-58-01-861mmm_tut.jpg";
</script><span style='display: inline-block; width: 68px; height: 68px;'><a href='http://www.miss.ru/anastasiyashirshakova'><img src='fotki/2012-04-08-15-24-10-633mmm_tut.jpg' alt='Анастасия Ширшакова' border='0' width='62' height='62'></a></span><script language='JavaScript'>
if (document.getElementById("new_user_left_5094")) document.getElementById("new_user_left_5094").src="fotki/2012-04-08-15-24-10-633mmm_tut.jpg";
</script><span style='display: inline-block; width: 68px; height: 68px;'><a href='http://www.miss.ru/zoloto'><img src='fotki/2011-09-20-18-16-59-630mmm_tut.jpg' alt='Анна Золотова' border='0' width='62' height='62'></a></span><script language='JavaScript'>
if (document.getElementById("new_user_left_5095")) document.getElementById("new_user_left_5095").src="fotki/2011-09-20-18-16-59-630mmm_tut.jpg";
</script><span style='display: inline-block; width: 62px; height: 68px;'><a href='http://www.miss.ru/angel_in_disguise'><img src='fotki/2011-10-12-13-47-56-383mmm_tut.jpg' alt='Анна Данилова' border='0' width='62' height='62'></a></span><script language='JavaScript'>
if (document.getElementById("new_user_left_5096")) document.getElementById("new_user_left_5096").src="fotki/2011-10-12-13-47-56-383mmm_tut.jpg";
</script><span style='display: inline-block; width: 68px; height: 68px;'><a href='http://www.miss.ru/alekc'><img src='fotki/2011-09-21-23-26-16-859mmm_tut.jpg' alt='Алекс Алекс' border='0' width='62' height='62'></a></span><script language='JavaScript'>
if (document.getElementById("new_user_left_5098")) document.getElementById("new_user_left_5098").src="fotki/2011-09-21-23-26-16-859mmm_tut.jpg";
</script><span style='display: inline-block; width: 68px; height: 68px;'><a href='http://www.miss.ru/milashka_t'><img src='fotki/2011-09-23-05-36-11-815mmm_tut.jpg' alt='Таня Сакович' border='0' width='62' height='62'></a></span><script language='JavaScript'>
if (document.getElementById("new_user_left_5101")) document.getElementById("new_user_left_5101").src="fotki/2011-09-23-05-36-11-815mmm_tut.jpg";
</script><span style='display: inline-block; width: 68px; height: 68px;'><a href='http://www.miss.ru/oksano4ka'><img src='fotki/2011-09-23-15-45-35-905mmm_tut.jpg' alt='Оксана Таштиева' border='0' width='62' height='62'></a></span><script language='JavaScript'>
if (document.getElementById("new_user_left_5102")) document.getElementById("new_user_left_5102").src="fotki/2011-09-23-15-45-35-905mmm_tut.jpg";
</script><span style='display: inline-block; width: 62px; height: 68px;'><a href='http://www.miss.ru/branez'><img src='fotki/2011-11-10-21-04-58-361mmm_tut.jpg' alt='Марина Бранец' border='0' width='62' height='62'></a></span><script language='JavaScript'>
if (document.getElementById("new_user_left_5182")) document.getElementById("new_user_left_5182").src="fotki/2011-11-10-21-04-58-361mmm_tut.jpg";
</script><span style='display: inline-block; width: 68px; height: 68px;'><a href='http://www.miss.ru/kratyulianka'><img src='fotki/2011-11-10-22-08-23-802mmm_tut.jpg' alt='Yulianka Krat' border='0' width='62' height='62'></a></span><script language='JavaScript'>
if (document.getElementById("new_user_left_5183")) document.getElementById("new_user_left_5183").src="fotki/2011-11-10-22-08-23-802mmm_tut.jpg";
</script><span style='display: inline-block; width: 68px; height: 68px;'><a href='http://www.miss.ru/romanova'><img src='fotki/2011-11-11-11-29-44-496mmm_tut.jpg' alt='Лилия Романова' border='0' width='62' height='62'></a></span><script language='JavaScript'>
if (document.getElementById("new_user_left_5186")) document.getElementById("new_user_left_5186").src="fotki/2011-11-11-11-29-44-496mmm_tut.jpg";
</script><span style='display: inline-block; width: 68px; height: 68px;'><a href='http://www.miss.ru/agafonova'><img src='fotki/2011-11-11-11-45-36-596mmm_tut.jpg' alt='Нина Агафонова' border='0' width='62' height='62'></a></span><script language='JavaScript'>
if (document.getElementById("new_user_left_5187")) document.getElementById("new_user_left_5187").src="fotki/2011-11-11-11-45-36-596mmm_tut.jpg";
</script><span style='display: inline-block; width: 62px; height: 68px;'><a href='http://www.miss.ru/demash'><img src='fotki/2011-11-11-11-49-50-483mmm_tut.jpg' alt='Анастасия Демаш' border='0' width='62' height='62'></a></span><script language='JavaScript'>
if (document.getElementById("new_user_left_5188")) document.getElementById("new_user_left_5188").src="fotki/2011-11-11-11-49-50-483mmm_tut.jpg";
</script></div>
<br>
Найдено в работах одного дорогого уфимского фрилансера...
Stud,
20 Сентября 2012
-
+128
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
#!/bin/bash
hl=`cat $1`
wrdl=`cat ~/worlds.txt`
addr=$PWD'/extra_hosts.txt'
rm -f $addr && echo "Deleted host list file "$addr
touch $addr && echo "Created file "$addr
for address in $hl
do
rm $PWD/`basename $address`.txt && echo "Deleted file "$PWD/`basename $address`.txt
done
for address in $hl
do
#echo $address
export address
tmp=$PWD/`basename $address`.txt
trc=$PWD/`basename $address`.tr.txt
mytmp=/tmp/`basename $address`.txt
curl -Ss --retry 2 --trace $trc --tr-encoding --tcp-nodelay $address > $mytmp &
sleep 10s
cat $mytmp \
| grep -e '<a href=\"[^"]*\"' | grep -E -o '[^"]+'\
| grep htm | perl -pe 's/$ENV{address}//'| \
perl -pe 's/^\//$ENV{address}\//' | perl -pe 's/text\/html//'|\
sed -e 's/<[^>]*>//g' -e '/\/http:/d;/^http/p;d;' | sort | uniq >> $addr &
for wrd in `cat ~/worlds.txt`
do
export wrd
cat -b $mytmp\
| sed -e 's/<[^>]*>//g' |grep -i $wrd \
| perl -pe 's/^/$ENV{address}:$ENV{wrd}:/' | tee -a $tmp &
done
done
mkdir -p extra_hosts && echo "Made dir extra_hosts"
cd extra_hosts
$0 $addr
AliceGoth,
18 Сентября 2012
-
+132
- 1
- 2
- 3
<style Language="JavaScript">
...
</style>
WUT
mr.The,
18 Сентября 2012
-
+127
- 1
override def text: String = super.text
https://github.com/scala/scala/blob/master/src/library/scala/xml/Node.scala
rat4,
17 Сентября 2012
-
+137
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
{- Haskell -}
bruteforceGeneratorWithEasySimplication :: Description d => d -> [StandartTable]
bruteforceGeneratorWithEasySimplication description =
let width = size_h description; height = size_v description; vHeader = headerV description in
do
table <- genListBasedOn (map lineVariants vHeader)
return (ST table)
where
lineVariants :: [Int] -> [[Bool]]
lineVariants headerLine = let
всё_я_задолбался_однако = True -- K.O.
количество_цельных_блоков = length headerLine
число_промежутков = количество_цельных_блоков - 1
число_свободных_пробелов_которые_нам_нужно_распихать_между_цельными_блоками = ширина_поля - суммарная_длина_цельных_блоков
ширина_поля = size_h description
суммарная_длина_цельных_блоков = sum headerLine
возможная_строка_использующая :: [Int] -> [Bool]
возможная_строка_использующая разбиение = replicate (head разбиение) False ++
concat (zipWith (\x y -> replicate y True ++ replicate x False) (tail разбиение) headerLine)
и = and
по = undefined
in do
разбиение <- получить_разбиение_для_строки по (число_свободных_пробелов_которые_нам_нужно_распихать_между_цельными_блоками) и (число_промежутков)
return (возможная_строка_использующая разбиение :: [Bool])
получить_разбиение_для_строки по числу_свободных_элементов и числу_промежутков = do ...
Из раннего.
По-видимому, задолбался писать на тарабарщине, захотелось выражаться родными русскими словами.
Jean-Esther,
16 Сентября 2012