- 1
Onetime = ?config(onetime, Config) =:= true,
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
0
Onetime = ?config(onetime, Config) =:= true,
Boolshit? Нет, это динамическая питуизация.
−1
<?php $connection = mysqli_connect ('localhost','root','','userlistdb');
$per_page = 25;
$page = 1;
if (isset($_GET['page']))
{
$page = (int) $_GET['page'];
}
$total_cout_q = mysqli_query($connection, "SELECT COUNT(id_com) AS `total_count` FROM `comment`")
$total_count = mysqli_fetch_assoc($total_cout_q);
$total_count = $total_count['total_count'];
$total_pages = ceil ($total_count/ $per_pages);
if($page <= 1 || $page > $total_pages)
{
$page = 1;
}
$offset = ($per_page * $page)- $per_page;
$coments = mysqli_query($connection, "SELECT * `total_count` FROM `comment` ORDER BY `id_com` DESC LIMIT $offset, $per_page");
$coments_exist = true;
if(mysqli_nu,_rows($coments) <= 0 ){
echo 'Нет коментариев';
$coments_exist = false;
}
while( $result = mysqli_fetch_assoc($coments){
}
$row = mysqli_query($connection, "SELECT * FROM `comment` ORDER BY `id_com` DESC LIMIT 25");
?>
<table>
<tr>
<th><a href="?orderBy=username">username:</a>
</th>
<th> <a href="?orderBy=email">email:</a>
</th>
<th> <a href="?orderBy=recorded_date"> Date:</a>
</th>
<th> <a href="?orderBy=comment">Added Date:</a>
</th>
</tr>
<?php
while($row = mysql_fetch_array($result)){
?>
<tr>
<th><?php echo $result['username']; ?> </th>
<th><?php echo $result['email']; ?> </th>
<th><?php echo $result['Date']; ?> </th>
<th><?php echo $result['comment']; ?> </th>
</tr>
</table>
<?php //Страницы
if ( $coments_exist = true)
{
echo '<div class="paginator">';
if($page > 1)
{
echo '<a href= "/Guestbook.php?page='.($page - 1).'">« предыдущий </a>';
} if($page < $total_pages)
{
echo '<a href= "/Guestbook.php?page='.($page + 1).'"> Cледующая &eaquo; </a>';
}
echo '</div>';
}
$orderBy = array('username', 'email', 'recorded_date', 'comment');
$order = 'username';
if (isset($_GET['orderBy']) && in_array($_GET['orderBy'], $orderBy)) {
$order = $_GET['orderBy'];
}
$query = 'SELECT * FROM `comment` ORDER BY '.$order;
}
mysqli_close();
?>
Привет, тут в коде сортировка и переход по страницыам, сортировка в строки с таблицы HTML, вызываемые из MySQL, при нажиматие на username едёт сортировка по алфавиту, а затем нажимать на email или Date и сортировать по дате, но выдаёт ошыбки...
−102
SELECT MAX(len) from huis
−1
if (userSettingsErrorType != null && userSettingsErrorType.getError() != null &&
userSettingsErrorType.getError().getMessage() != null && userSettingsErrorType.getError().getMessage().getName() != null &&
userSettingsErrorType.getError().getMessage().getName().length != 0) {
try {
getView().ifPresent(v -> v.setFieldErrorMessage(SettingsField.NAME,
userSettingsErrorType.getError().getMessage().getName()[0]));
} catch (Exception e) {
Crashlytics.logException(e);
}
}
наткнулся на сие чудо во время рефакторинга.
0
if (memory[i] == CRG && memory[i + 1] == STDI) {
fprintf(code, "%d %d ", CRG, STDI);
i++;
}
else if (memory[i] == CRC && memory[i + 1] == STDI) {
fprintf(code, "%d %d ", CRC, STDI);
i++;
}
else if (memory[i] == PRG && memory[i + 1] == STDI) {
fprintf(code, "%d %d ", PRG, STDI);
i++;
}
else if (memory[i] == PRC && memory[i + 1] == STDI) {
fprintf(code, "%d %d ", PRC, STDI);
i++;
}
h: post/442988 / https://github.com/Centrix14/TVM/blob/master/TVM/ngl.c
На статье стоит меточка «Tutorial».
+1
<?php
namespace AppHttpControllers;
use AppModelsCardUserModel;
use IlluminateHttpRequest;
use AppModelsUserModel;
use AppModelsArenaBattleModel;
use AppModelsArenaCardsModel;
use Auth;
use Services;
class ArenaController extends Controller
{
public function index()
{
$issetBattle = ArenaBattleModel::where('user1', Auth::user()->id)->orWhere('user2', Auth::user()->id)->count();
if($issetBattle == 0)
{
$result = 'Начать подбор противника!<br>
<a href="/arena/find" class="btn btn-games2 btn-block">Искать</a>';
}
else
{
$battle = ArenaBattleModel::where('user1', Auth::user()->id)->orWhere('user2', Auth::user()->id)->first();
if($battle->status == 'card1_pick') return redirect('/arena/pick/1');
if($battle->status == 'card2_pick') return redirect('/arena/pick/2');
if($battle->status == 'battle') return redirect('/arena/battle');
if($battle->status == 'result') return redirect('/arena/result');
if($battle->user1 == Auth::user()->id) $opponent = $battle->user2;
else $opponent = $battle->user1;
if($opponent == 0) $result = 'Идёт поиск противника!<br>
<a href="/arena/cancel" class="btn btn-games2 btn-block">Отменить поиск</a>';
else
{
if($battle->start_time < time())
{
$battle->status = 'card1_pick';
$battle->save();
return redirect('/arena/pick/1');
}
$result = 'Противник найден!<br>
'.($battle->start_time-time() > 0 ? 'До начала боя: '.Services::timer($battle->start_time-time()).'<br>' : 'Бой начался!<br>').'
<a href="/arena/cancel" class="btn btn-games2 btn-block">Отменить поиск</a>';
}
}
return view('game.battles.arena.index', ['result' => $result]);
}
public function find()
{
$issetBattle = ArenaBattleModel::where('user1', Auth::user()->id)->orWhere('user2', Auth::user()->id)->count();
if($issetBattle > 0) return back()->with('error', 'Подбор уже начат!');
$battles = ArenaBattleModel::where('status', 'prepare')->where('user2', 0)->inRandomOrder();
$myMaxCardLevel = Services::getMaxCardLevel(Auth::user()->id);
if($battles->count() == 0)
{
ArenaBattleModel::create([
'user1' => Auth::user()->id,
'card_level' => $myMaxCardLevel+1
]);
return back()->with('ok', 'Поиск противника начат!');
}
else
{
$battles = $battles->first();
if($battles->card_level-1 > $myMaxCardLevel) $battles->card_level = $myMaxCardLevel+1;
$battles->user2 = Auth::user()->id;
$battles->start_time = time()+30;
$battles->save();
return back()->with('ok', 'Противник найден!');
}
}
public function cancelFind()
{
$issetBattle = ArenaBattleModel::where('user1', Auth::user()->id)->orWhere('user2', Auth::user()->id);
if($issetBattle->count() == 0) return back()->with('error', 'Подбор ещё не начат!');
$foundBattle = $issetBattle->first();
if($foundBattle->user1 == Auth::user()->id) $foundBattle->delete();
else
{
$opponentMaxCardLevel = Services::getMaxCardLevel($foundBattle->user1);
if($opponentMaxCardLevel != $foundBattle->card_level) $foundBattle->card_level = $opponentMaxCardLevel+1;
$foundBattle->user2 = 0;
$foundBattle->save();
}
return back();
}
}
// и еще 10кб кода
код игры на Laravel . Вкусняшка
+4
struct Data { /* ... */ };
class Items {
void insert(Data&& data) {
_storage.emplace_back(std::forward<Data>(data));
}
private:
std::vector<Data> _storage;
};
Dumb luck. Nuff said.
0
fn do_get_summary(req: &HttpRequest<AppState>) -> SummaryFuture {
let token = req.token().expect("ISE: token not verified during AuthMiddleware stage");
let datetime = req.match_info()
.get("timestamp")
.and_then(|s| i64::from_str(s).ok())
.map(|ts| NaiveDateTime::from_timestamp(ts, 0));
let datetime = match datetime {
Some(dt) => dt,
None => return Box::new(future::result(Err(ServiceError::InvalidSetting {
key: "timestamp".into(),
hint: "local time in seconds since Unix Epoch".into()
}.into())))
};
let db = req.state().db.clone();
let settings = req.state().db
.send(db::GetSettings(token.clone()))
.map_err(failure::Error::from)
// flatten error
.and_then(|res| match res {
Ok(settings) => Ok(settings),
Err(err) => Err(err)
});
let fitbit = req.state().db
.send(db::GetSettingsFitbit(token))
.map_err(failure::Error::from)
// Check if there is token and flatten error
.and_then(|res| match res {
Ok(fitbit) => {
if fitbit.client_token.is_none() {
Err(ServiceError::TokenExpired.into())
} else {
Ok(fitbit)
}
},
Err(err) => Err(err)
});
let headmaster = req.state().headmaster.clone();
let summary_and_token = settings.join(fitbit)
.and_then(move |(settings, fitbit)| -> Box<dyn Future<Item = (Summary, FitbitToken), Error = failure::Error>> {
// Deserialize token
let token = fitbit.client_token.expect("ISE: token option is not cleared");
let fitbit_token = match FitbitToken::from_json(&token) {
Ok(token) => token,
Err(err) => return Box::new(future::err(ServiceError::TokenExpired.into()))
};
let headmaster_config = master::HeadmasterConfig {
minimum_active_time: settings.hourly_activity_goal,
max_accounted_active_minutes: settings.hourly_activity_limit.unwrap_or(settings.hourly_activity_goal * 3),
debt_limit: settings.hourly_debt_limit.unwrap_or(settings.hourly_activity_goal * 3),
day_begins_at: settings.day_starts_at,
day_ends_at: settings.day_ends_at,
day_length: settings.day_length.unwrap_or((settings.day_ends_at.hour() - settings.day_starts_at.hour()) as i32),
user_date_time: datetime,
};
let auth_data = FitbitAuthData {
id: fitbit.client_id,
secret: fitbit.client_secret,
token: fitbit_token,
};
let future = headmaster.send(master::GetSummary::<FitbitActivityGrabber>::new(headmaster_config, auth_data))
.map_err(failure::Error::from)
// flatten error
.and_then(|res| res);
Box::new(future)
});
let summary = summary_and_token
.and_then(move |(summary, fitbit_token)| {
db.send(db::UpdateSettingsFitbit::new(
token, db::models::UpdateFitbitCredentials {
client_token: Some(Some(fitbit_token.to_json())),
..Default::default()
}))
.map_err(failure::Error::from)
.and_then(|_| Ok(summary))
});
Box::new(summary)
}
Фьючи в Rust до рефакторинга -- тот еще говнокод
+2
...
removed: function(row) {
if ($(row).find('textarea')[0].style.backgroundColor === "red") {
$(row).find('textarea')[0].style.backgroundColor = "white";
--disabled_elements_count;
}
if (disabled_elements_count === 0) {
$("input[type='submit']").prop('disabled', false);
}
}, ...
0
cript src='https://www.google.com/recaptcha/api.js?onload=captchaOn&render=explicit' async defer></script>
</span>
<span id="noCaptchaBlock" style="display: none">
<a onclick="cl=true" href="#" class="vam" style="z-index: 1;position: relative;text-decoration: none;border-radius: 2px;background: #4C8EFA;color: #fff;padding: 7px 20px;font-size: 20px;text-decoration: none !important;margin: 7px 10px;" id="rbs">Пропустить рекламу</a>
<span id="load" class="vam" style="z-index: 1;position: relative;margin: 6px 10px;display: none;font-size: 1.125em"><span id="statusload">Загрузка рекламы</span><span id="point">...</span></span></span>
</span>
<div class="progress" style="height: 100%;background: #bbbbbb;opacity: 0.2;z-index: 0;"><dt></dt><dd></dd></div>
</div>
<div class="bl_all_rek" style="position: relative;overflow: hidden;z-index: 1;">
<div class="progress_bg"><div class="progress"><dt></dt><dd></dd></div></div>
<div class="toggle" style="position: absolute;width: 4px;height: 100%;background-color: #EFC439;z-index: 3;left: 0;top: 10px;/* box-shadow: -3px 0px 7px 0px #000; */"></div>
<div class="toggle" style="position: absolute;width: 4px;height: 100%;background-color: #EFC439;z-index: 3;right: 0;top: 10px;/* box-shadow: 3px 0px 7px 0px #000; */"></div>
<div class="toggle" style="margin: 0px;background-color: #EFC439;padding:8px 15px;font-weight:bold;font-size: 14px;line-height: 100%;word-wrap: break-word;color:#FFF; font-family: Arial, sans-serif;text-align: center;box-shadow: 0px 0px 7px -1px #000, inset 0px 2px 8px -5px #000;position: relative;z-index: 2;">Реклама <a class="a_site_top" style="margin: 0; font-size: 12px;top:auto;font-weight:normal;" target="_blank"
title="http://yandex.ru" href="/away4.php?a=aHR0cDovL3lhbmRleC5ydQ=="
>Открыть полностью</a>
</div>
Куча гавна с хардкодом с сайта catcut! Ну блять пиздец, так делать сайты нельзя.
И прикол в том что сайт глючит, ПИЗДЕЦ!!!! ЕБАЛ В РОТ