- 1
 - 2
 - 3
 - 4
 - 5
 - 6
 - 7
 - 8
 - 9
 
$users = new Users();
 $users->findBySql("SELECT * FROM `users`");
foreach($users as $user) {
      echo $user['email'] . "<br>";
}
                                    Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
0
$users = new Users();
 $users->findBySql("SELECT * FROM `users`");
foreach($users as $user) {
      echo $user['email'] . "<br>";
}
                                    
            Task framework основан на MVC парадигме с удобством использования и минимум функционала для решения простых задач.
В отличие от стандартных решений вместо контроллера тут используется задача (task)
h/523828
        
0
// https://vk.com/login?u=2&to=YWxfZmVlZC5waHA-
$ echo YWxfZmVlZC5waHA- | base64 -d
al_feed.phpbase64: invalid input
$ echo -n al_feed.php | base64
YWxfZmVlZC5waHA=
                                    Олимпиадники даже base64 умудрились пропатчить
0
https://pbs.twimg.com/media/EjtRN4HX0AA6FPN.jpg
                                    
−1
zero :: Integer -> Bool
zero = (==0)
ieq :: Num p => Bool -> p
ieq x = if x then 1 else 0
elem' :: (Foldable t, Eq a) => t a -> a -> Bool
elem' xs x = not $ zero func
            where 
                func = foldl (\acc y -> acc + (ieq $ x == y)) 0 xs
                                    Петуху дали поиграть в Haskell.
−1
Get-NetTCPConnection -State Listen | %{[pscustomobject]@{Port=$_.LocalPort; Process=$(Get-Process -Id $_.OwningProcess)}} | sort {[int]$_.Port}
                                    Давайте течь от powershell.
−1
// добавляем новые ссылки
  for i := 0 to ATags.Count - 1 do
  begin
    // так мне кажется лучше
    Application.ProcessMessages;
                                    кому или чему лучше кроме тебя, автор ?
+2
object Cорок {
    infix fun тысяч(b: String) = this
    infix fun в(a: String) = this
    infix fun сунули(a: String) = this
}
fun main() {
    Cорок тысяч "обезъян" в "жопу" сунули "банан"
}
                                    
+5
#include <iostream>
#include <set>
#include <unicode/brkiter.h>
#include <unicode/unistr.h>
#include <unicode/coll.h>
#include <unicode/sortkey.h>
bool hasRepeatingCharacters(const icu::UnicodeString &word)
{
    icu::Locale locale = icu::Locale::getDefault();
    UErrorCode status = U_ZERO_ERROR;
    std::unique_ptr<icu::BreakIterator> it{icu::BreakIterator::createCharacterInstance(locale, status)};
    if (U_FAILURE(status)) throw 42;
    it->setText(word);
    std::unique_ptr<icu::Collator> collator{icu::Collator::createInstance(status)};
    if (U_FAILURE(status)) throw 42;
    collator->setStrength(icu::Collator::SECONDARY);
    auto less = [](const icu::CollationKey &k1, const icu::CollationKey &k2){
        UErrorCode status = U_ZERO_ERROR;
        bool isLess = k1.compareTo(k2, status) == UCOL_LESS;
        if (U_FAILURE(status)) throw 42;
        return isLess;
    };
    std::set<icu::CollationKey, decltype(less)> cache(less);
    int32_t p = it->first();
    while (p != icu::BreakIterator::DONE) {
        int32_t q = it->next();
        if (q == icu::BreakIterator::DONE)
            break;
        icu::CollationKey key;
        collator->getCollationKey(word.tempSubStringBetween(p, q), key, status);
        if (U_FAILURE(status)) throw 42;
        if (cache.find(key) != cache.end())
            return true;
        cache.insert(key);
        p = q;
    }
    return false;
}
int main()
{
    icu::UnicodeString words(u8"Example english Боб мир כוכב 民主主義語こんにちは", "utf-8");
    icu::Locale locale = icu::Locale::getDefault();
    UErrorCode status = U_ZERO_ERROR;
    std::unique_ptr<icu::BreakIterator> it{icu::BreakIterator::createWordInstance(locale, status)};
    if (U_FAILURE(status)) throw 42;
    it->setText(words);
    int32_t p = it->first();
    while (p != icu::BreakIterator::DONE) {
        int32_t q = it->next();
        if (q == icu::BreakIterator::DONE)
            break;
        if (it->getRuleStatus() != UBRK_WORD_NONE)
        {
            icu::UnicodeString word{words.tempSubStringBetween(p, q)};
            bool hasRepeats = hasRepeatingCharacters(word);
            std::string wordUtf8;
            word.toUTF8String(wordUtf8);
            std::cout << (hasRepeats ? "Has repeats: " : "No repeats: ") << wordUtf8 << std::endl;
        }
        p = q;
    }
    return 0;
}
                                    
            По мотивам https://govnokod.ru/27025
Сформировать строку из слов исходной строки, содержащих повторяющиеся буквы.
В 60 строк, к сожалению, не уложился :(
        
−1
Lemma mint_head_eq CR1 CR2 (te : TE) l m r (t t' : list TE) :
    MInt CR1 (l, m, r) (te :: t) ->
    MInt CR2 (l, m, r) t' ->
    exists t'', t' = te :: t''.
  Proof.
    intros H1 H2.
    inversion_ H1; inversion_ H2; (* generates 25 goals *)
    match goal with
      |- (exists _, te :: ?T = te :: _) => now exists T
    end.
  Qed.
                                    Против метушни нет приёма.
0
jQuery( this ).parent().parent().parent().parent().parent().parent().parent().parent().find(".crate_bottle").html(product_crate_price_final);