-
+141
- 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
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
using System;
using System.Globalization;
using System.IO;
namespace CyberForumTasks
{
class Program
{
static void Main()
{
var text = File.ReadAllText("C:\\test.txt");
for (var i = 0; i < text.Length - 1; i++)
{
if (text[i].ToString(CultureInfo.InvariantCulture).Contains("1"))
if (text[i + 1].ToString(CultureInfo.InvariantCulture).Contains("0"))
if (text[i + 2].ToString(CultureInfo.InvariantCulture).Contains("1"))
Console.Write("101");
if (text[i].ToString(CultureInfo.InvariantCulture).Contains("1"))
if (text[i + 1].ToString(CultureInfo.InvariantCulture).Contains("1"))
if (text[i + 2].ToString(CultureInfo.InvariantCulture).Contains("0"))
Console.Write("110");
if (text[i].ToString(CultureInfo.InvariantCulture).Contains("1"))
if (text[i + 1].ToString(CultureInfo.InvariantCulture).Contains("1"))
if (text[i + 2].ToString(CultureInfo.InvariantCulture).Contains("1"))
Console.Write("111");
if (text[i].ToString(CultureInfo.InvariantCulture).Contains("1"))
if (text[i + 1].ToString(CultureInfo.InvariantCulture).Contains("0"))
if (text[i + 2].ToString(CultureInfo.InvariantCulture).Contains("0"))
if (text[i + 3].ToString(CultureInfo.InvariantCulture).Contains("0"))
Console.Write("1000");
if (text[i].ToString(CultureInfo.InvariantCulture).Contains("1"))
if (text[i + 1].ToString(CultureInfo.InvariantCulture).Contains("0"))
if (text[i + 2].ToString(CultureInfo.InvariantCulture).Contains("0"))
if (text[i + 3].ToString(CultureInfo.InvariantCulture).Contains("1"))
Console.Write("1001");
if (text[i].ToString(CultureInfo.InvariantCulture).Contains("1"))
if (text[i + 1].ToString(CultureInfo.InvariantCulture).Contains("0"))
if (text[i + 2].ToString(CultureInfo.InvariantCulture).Contains("1"))
if (text[i + 3].ToString(CultureInfo.InvariantCulture).Contains("0"))
Console.Write("1010");
}
}
}
}
Дан файл целых чисел. Продублировать в нем все числа, принадлежащие диапазону 5..10.
Psilon,
09 Января 2014
-
+158
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
if (xmasCard.isTablet)
{
if (xmasCard.orient === "portrait")
{
addPositionItems = 2;
if (myX === 0)
{
myX = (window.innerWidth - parseInt($("#snowManNaked").css("width").split("px")[0])) / 2;
}
}
else if (xmasCard.orient === "landscape")
{
addPositionItems = 1.1933174224343675417661097852029;
if (myX === 0)
{
myX = (window.innerWidth - parseInt($("#snowManNaked").css("width").split("px")[0])) / 2;
}
}
}
Код от колумбийских аутсорсеров. На вопрос "а что это за волшебное число такое" был дан ответ - "more numbers you put more precise it gets on all screens".
cahbtexhuk,
09 Января 2014
-
+128
- 1
- 2
- 3
- 4
Sorry! The page could not be loaded.
Unable to connect to MySQL and select database.
MySQL reported: Access denied for user 'root'@'localhost' (using password: YES)
http://gvforum.ru/
эх, vasiliy, кто ж на продакшене базу от рута поднимает? надо же от юзверя с правами insert, delete, update, select
Lure Of Chaos,
08 Января 2014
-
+15
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
struct Point3D {
float x,y,z;
float& operator [] (int i) {
switch (i) {
case 0: return x;
case 1: return y;
case 2: return z;
default: assert(false);
}
}
};
Писал Жабапоглащенный.
LispGovno,
08 Января 2014
-
+164
- 1
- 2
- 3
- 4
- 5
function get_the_fucking_first_image_from_the_fucking_content_DUDE_is_this_really_so_hard($content)
{
preg_match_all('/(<img .*? src=\"\/images.*?\">?)/', $content, $result);
return $result[0][0];
}
мне кажется, коллега задолбался
russling,
08 Января 2014
-
−94
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
import time
def inttime():
return int(''.join(str(time.time()).split('.')))
def rand():
while True:
s = bin(inttime())[2:]
for x in s:
yield x
Этим "рандомом" заполняется клеточный автомат "Жизнь". Нечего было делать.
x0m9k,
08 Января 2014
-
+167
- 1
- 2
gl.drawArrays(gl.QUADS, 0, 4);
// WebGL рисует черный экран с четырьмя точками.
bormand vs WebGL. Акт второй.
Как оказалось, в OpenGL ES выпилили GL_QUADS и GL_POLYGON.
Но т.к. в js несуществующее поле это null, а null это 0, а 0 это GL_POINTS, то рисуются 4 точки ;)
bormand,
07 Января 2014
-
+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
- 27
- 28
- 29
- 30
- 31
// bormand: Ну что, затестим шейдер в WebGL...
int iter = 0;
while (iter < 1000 && length(z) < 2.0) {
z = vec2(z.x * z.x - z.y * z.y, 2.0 * z.x * z.y) + c;
iter++;
}
// compileShader: 'while' : This type of loop is not allowed
// bormand: WTF?! В обычном OpenGL же работало, ну ок...
int iter = 0;
for (; iter < 1000; iter++) {
if (length(z) < 2.0)
break;
z = vec2(z.x * z.x - z.y * z.y, 2.0 * z.x * z.y) + c;
}
// compileShader: 'for' : Missing init declaration
// bormand: Да что за херня!?
for (iter = 0; iter < 1000; iter++) {
// compileShader: 'for' : Invalid init declaration
// bormand: Подавись, сука!
int iters = -1;
for (int iter = 0; iter < 1000; iter++) {
if (length(z) < 2.0) {
iters = iter;
break;
}
z = vec2(z.x * z.x - z.y * z.y, 2.0 * z.x * z.y) + c;
}
// compileShader: ok.
bormand vs WebGL
bormand,
07 Января 2014
-
+125
- 1
- 2
- 3
@ECHO OFF
VESAINF %1
PAUSE
Фикс к программе на ассемблере с исходным кодом.
http://masm32.com/board/index.php?topic=2727.msg29659#msg29659
LispGovno,
07 Января 2014
-
+126
- 1
<input type="text" id="tos" name="tos" data-validate="true" class="text-field" tabindex="6" data-validation-rules="^(https?|ftp):\/\/(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-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$" data-validation-msg="Invalid URL" />
Monkey killing monkey killing monkey
Over pieces of the ground.
Silly monkeys give them thumbs,
They forge a blade,
And where there's one
they're bound to divide it,
Right in two.
Right in two.
:'(
wvxvw,
07 Января 2014