- 1
- 2
- 3
while($us > 1){
$us--;
}
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
0
while($us > 1){
$us--;
}
На одном из сайтов, который мне нужно потдерживать.
0
$sPreviewFile = $_SERVER["DOCUMENT_ROOT"].BX_PERSONAL_ROOT."/tmp/templates/__bx_preview/footer.php";
if($_GET['bx_template_preview_mode'] == 'Y' && $USER->CanDoOperation('edit_other_settings') && file_exists($sPreviewFile))
include_once($sPreviewFile);
else {
require $GLOBALS["BX_ICON"];
eval("?>$content<?");
}
?>
Где-то в битриксе.
−6
primary(this, "в рот ебись');
// Php говно мамонта и когда я его вижу хочется въебать в монитор кулаком чтоб развалился нахуй и выебался нахуй в рот. Уже давно есть nodejs в котором писать приятнее и возможностей больше, так что сосите нахуй разработчику на nodejs платят столько же блять 300К в месяц заебись да? Короче выбор нахуй есть! А дрочеры пошли нахуй с этого сайта, тут место обсуждения современных технологий
−1
var processedHtml = new HtmlAgilityPack.HtmlDocument
{
OptionOutputAsXml = true
};
processedHtml.LoadHtml(sbb);
var doc = processedHtml.DocumentNode;
foreach (var link in doc.SelectNodes("//a[@href]"))
{
string hrefValue = link.GetAttributeValue("href", string.Empty);
if (!hrefValue.ToUpper().Contains("GOOGLE")
&& hrefValue.Contains("/url?q=")
&& hrefValue.ToUpper().Contains("HTTP"))
{
int index = hrefValue.IndexOf("&");
if (index > 0)
{
hrefValue = hrefValue.Substring(0, index);
lstTitles.Items.Add(hrefValue.Replace("/url?q=", string.Empty));
string output = Regex.Replace(link.InnerText, ""\\.?", string.Empty);
Log.Items.Add("Found new url");
requested_urls.Add(hrefValue.Replace("/url?q=", string.Empty));
}
}
}
// Log.DataSource = requested_urls;
// Analyze();
UpdateLog();
f2.Show();
Analyze();
}
ya govnokoder ili net>?
+4
bool MyClass::operator==(int elem){
if (list.isExist(elem)){
list.remove(elem);
return true; // Операция завершена успешно
}
return false; // Элемент elem не найден в списке
}
(C) https://www.linux.org.ru/forum/development/14063699?cid=14063991
Вырвано из контекста (треда), но считаю данная кучка должна лежать здесь.
−1
var i, j;
loop1:
for (i = 0; i < 3; i++) { //The first for statement is labeled "loop1"
loop2:
for (j = 0; j < 3; j++) { //The second for statement is labeled "loop2"
if (i === 1 && j === 1) {
continue loop1;
}
console.log('i = ' + i + ', j = ' + j);
}
}
Метки в js. Баян?
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/label
0
class PriceCache {
public:
FlightStorage(const std::size_t count) {
for (std::size_t i = 0; i < count; ++i) {
flights.emplace_back(FlightCache::get(i));
prices.emplace_back(&flights.back(), Price::getFor(flights.back()));
}
}
private:
std::vector<Flight> flights;
std::vector<const Flight *, double> prices;
};
"случайные сегфолты при обращении к PriceCache::prices"
0
public class DialogBuilder: NSObject {
private var style: UIAlertControllerStyle
private var titleColor: UIColor?
/**
* initial DialogBuilder with UIAlertControllerStyle and for title color
*/
public init(style: UIAlertControllerStyle = .alert, titlecolor : UIColor?) {
self.style = style
if(titlecolor != nil)
{self.titleColor = titlecolor}
}
/**
* initial DialogBuilder with UIAlertControllerStyle
*/
public init(style: UIAlertControllerStyle = .alert) {
self.style = style
}
...
}
0
func onlyCashLessEUR(_ rates : [CurrencyRateMto]) -> CurrencyRateItem {
var EUR : CurrencyRateItem? = nil
let cashLessEUR = rates.filter({$0.type.enumValue == CurrencyRateTypeMtoEnum.CASHLESS && $0.currency.isEUR() == true})
if(cashLessEUR.count > 0){
EUR = CurrencyRateItem(
cashLessEUR.first?.currency.getIcon(),
(cashLessEUR.first?.currency.id)!,
NumberFormatting.sum(cashLessEUR.first?.buyPrice?.price),
NumberFormatting.sum(cashLessEUR.first?.sellPrice?.price))
}
if(EUR == nil){
EUR = CurrencyRateItem(
UIImage.init(named: "currency_eur"),
"EUR",
"-",
"-")
}
return EUR!
}
"Я форматирую как далбаёб, и мне похер на то, что cashLessEUR.first опционален, я буду его юзать дальше".
+1
OrderedDict().fromkeys(['key1', 'key2', 'key3'], [])
Снова сел на грабли с изменяемыми объектами