-
0
- 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
const int DD_GOOD = 1;
const int DD_BAD = 2;
const int DD_BAD_VERT = 3;
auto segStatus = [&DD_GOOD, &DD_BAD, &DD_BAD_VERT](SomeClass* seg, EXTR ext, coord pickPt, double pickElev) -> int
{
Pt& pt = seg->ExtremePt(ext);
Line& line = seg->ExtremeLn(ext);
coord btPt = seg->GetExtremeWallPos(ext);
if (pt.GetCoord() != pickPt && btPt != pickPt)
{
return DD_BAD;
}
if (pt.pairGuid == GUID_NULL && EQ(pt.GetHeight(), pickElev))
{
return DD_GOOD;
}
if (!line.IsNonVert())
{
return DD_BAD;
}
double e1 = line.m_startPt.GetHeight();
double e2 = line.m_endPt.GetHeight();
if (e1 < e2 && e1 < pickElev && pickElev < e2)
{
return DD_GOOD;
}
if (e2 < e1 && e2 < pickElev && pickElev < e1)
{
return DD_GOOD;
}
return DD_BAD_VERT;
};
Когда не умеешь пользоваться энумами.
yog_muskrat,
26 Августа 2016
-
+506
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
if(isset($db_array["reference"]) && is_array($db_array["reference"]))
$ref = $db_array["reference"];
elseif(isset($db_array["REFERENCE"]) && is_array($db_array["REFERENCE"]))
$ref = $db_array["REFERENCE"];
else
$ref = array();
if(isset($db_array["reference_id"]) && is_array($db_array["reference_id"]))
$ref_id = $db_array["reference_id"];
elseif(isset($db_array["REFERENCE_ID"]) && is_array($db_array["REFERENCE_ID"]))
$ref_id = $db_array["REFERENCE_ID"];
else
$ref_id = array();
bitrix/modules/main/tools.php:182
maxyc,
25 Августа 2016
-
+916
- 1
- 2
if(!empty($_REQUEST['action_button']))
$_REQUEST['action'] = $_REQUEST['action_button'];
bitrix/modules/main/interface/admin_lib.php:3320
maxyc,
25 Августа 2016
-
+840
- 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
- 51
- 52
- 53
- 54
- 55
- 56
Options -Indexes
ErrorDocument 404 /404.php
<IfModule mod_php5.c>
php_flag allow_call_time_pass_reference 1
php_flag session.use_trans_sid off
php_value display_errors 1
php_value display_startup_errors 1
php_value error_reporting E_ALL
php_value auto_prepend_file "/home/bitrix/www/bitrix/pagen.php"
#php_value mbstring.internal_encoding UTF-8
</IfModule>
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
RewriteRule ^(.*)/page([\d]+)/ /$1/?PAGEN_2=$2 [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !/bitrix/urlrewrite.php$
RewriteRule ^(.*)$ /bitrix/urlrewrite.php [L]
RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization}]
</IfModule>
<IfModule mod_dir.c>
DirectoryIndex index.php index.html
</IfModule>
<IfModule mod_expires.c>
ExpiresActive on
ExpiresByType image/jpeg "access plus 3 day"
ExpiresByType image/gif "access plus 3 day"
</IfModule>
RewriteCond %{HTTP_HOST} ^www\.sitename\.ru [NC]
RewriteRule ^(.*)$ http://sitename.ru/$1 [L,R=301]
# Чиним изменения в названии корневых разделов
RedirectMatch 301 /catalog/oborudovanie-dlya-katerov-i-lodok/(.*) /catalog/oborud/$1
RedirectMatch 301 /catalog/vse-dlya-orujiya/(.*) /catalog/guns/$1
RedirectMatch 301 /catalog/ohota/(.*) /catalog/hunt/$1
RedirectMatch 301 /catalog/ribalka/(.*) /catalog/fish/$1
RedirectMatch 301 /catalog/noji/(.*) /catalog/knifes/$1
RedirectMatch 301 /catalog/lodochnie-motory/(.*) /catalog/motors/$1
RedirectMatch 301 /catalog/zapchasti/(.*) /catalog/spares/$1
RedirectMatch 301 /catalog/navigatsiya/(.*) /catalog/navi/$1
RedirectMatch 301 /catalog/masla-i-gsm/(.*) /catalog/oil/$1
RedirectMatch 301 /catalog/accumulyatori/(.*) /catalog/accum/$1
RedirectMatch 301 /catalog/turizm-i-kemping/(.*) /catalog/camp/$1
RedirectMatch 301 /catalog/pnevmaticheskoe-orujie/(.*) /catalog/pneumo/$1
RedirectMatch 301 /catalog/suveniri-i-podarki/(.*) /catalog/gifts/$1
Помогите пожалуйста сделать так, чтобы все ссылки вида /catalog/oborud редиректили 301 на / catalog/oborud/
konstantin,
25 Августа 2016
-
+967
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
if (!ch.election) {
exec('date -R', function(error, stdout, stderr) {
if (stdout.search('Wed') > -1) {
ch.startElection();
}
});
} else {
exec('date -R', function(error, stdout, stderr) {
if (stdout.search('Wed') < 0) {
ch.stopElection();
}
});
}
В ноде видимо нет функций для работы с календарём...
https://github.com/birdlab/trigger/blob/master/src/node/trigger/channel.js#L783
POPSuL,
25 Августа 2016
-
+1004
- 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
// shit.h :
#if END_SHIT == 0
bagor++;
#if BIT0 == 0
#undef BIT0
#define BIT0 1
#else
#undef BIT0
#define BIT0 0
#if BIT1 == 0
#undef BIT1
#define BIT1 1
#else
#undef BIT1
#define BIT1 0
#if BIT2 == 0
#undef BIT2
#define BIT2 1
#else
#undef BIT0
#undef BIT1
#undef BIT2
#define END_SHIT 1
#endif
#endif
#endif
#include "shit.h"
#endif
//shit.c
#include <stdio.h>
int main(void) {
int bagor = 0;
#define BIT0 0
#define BIT1 0
#define BIT2 0
#include "shit.h"
printf("bagor = %i\n", bagor);
return 0;
}
http://govnokod.ru/20947#comment348047
CHayT 3 часа назад # 0
> нет ни циклов, ни рекурсий
Можно, думаю, файлы сами в себя инклудить, чем не рекурсия. Не очень понятно, что с этим делать, правда.
-----
Но ведь совершенно очевидно, что с этим можно делать. Очередной шедевр макроговна
j123123,
25 Августа 2016
-
+918
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
#include <iostream>
template<typename T>
struct A {
typedef int R();
template<typename U>
static U *f(int) {
return 0;
}
static int f() {
return 0;
}
};
template<typename T>
bool g() { A<T> a; return !(typename A<T>::R*)a.f<int()>(0); }
template<typename T>
bool h() { A<T> a; return !( A<T>::R*)a.f<int()>(0); }
int main() {
std::cout << g<void>() << f<void>() << std::endl;
}
Как можно было придумать такой синтаксис :(
Bobik,
25 Августа 2016
-
+2424
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
// Most profiles should run only on one loader (they don't coordinate multiple instances,
// and do not test performance).
// We explicitly specify that some profiles should run on multiple loaders:
singleLoader := true
switch params.Config.Foo.Profile.Name() {
case (*foo_config.ProfileIO).Name(nil):
singleLoader = false
}
if singleLoader {
// Setting TargetLoaders to a single random loader.
}
Вот думаем подарить человеку книжку про судоку, а то творческую натуру негде применить.
wvxvw,
24 Августа 2016
-
+2302
- 1
- 2
- 3
- 4
- 5
http://govnokod.ru/20924
Запрашиваемая страница не найдена!
Возможно, её и не было никогда
http://dump.bitcheese.net/files/pimarut/%D0%93%D0%BE%D0%B2%D0%BD%D0%BE%D0%BA%D0%BE%D0%B4_%2320924_%E2%80%94_C___%E2%80%94_%D0%93%D0%BE%D0%B2%D0%BD%D0%BE%D0%BA%D0%BE%D0%B4.%D1%80%D1%83.html
но бекап я сделал, так что хуй вам. Я требую продолжения банкета.
j123123,
24 Августа 2016
-
+491
- 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
app::storage()->setUserUploadDir('public');
app::storage()->avatar = 'profile/avatars';
app::storage()->background = 'profile/background';
app::storage()->audioFile = 'music';
app::storage()->videoFile = 'video/file';
app::storage()->videoScreen = 'video/screen';
app::storage()->forum = 'forum';
app::storage()->systemImages = 'system/images';
app::storage()->tmpUpload('upload');
app::storage()->registerMethod('avatar', function($id, $type = false)
{
if($type==true){
return app::storage()->fileExists(app::storage()->path('avatar').'/'.$id.'.png') ? '/'.app::storage()->path('avatar').'/'.$id.'.png' : null;
}else{
return '/'.app::storage()->path('avatar').'/'.$id.'.png';
}
} );
app::storage()->registerMethod('defaultAvatar', function()
{
return '/'.app::storage()->path('systemImages').'/noavatar.png';
} );
Загрузка файлов от программиста с двадцатилетним стажем.
pravka,
24 Августа 2016