public boolean logout(String token)
{
    LogedUser user = logedUsers.remove(token);
    return (user != null) ? true : false;
}
By Slacki, 2015-11-17 17:58:53
#53 C++ +11
int chromosome::getScore()
{
    return this->getScore();
}
By Anonymous, 2015-11-05 15:41:39
# troche rak, ale jeszcze to jakos poprawie. JAKOS.
try:
    if field.related.parent_model._meta.module_name == u"userprofile":
        new = u"%s" % getattr(obj, field.name).get_full_name()
        original = u"%s" % getattr(org_obj, field.name).get_full_name()
    else:
        raise Exception('to mialo tak zrobic jak cos')
except:
    ...

code written on the train, wtf I was thinking about?!

By chleb, 2015-10-28 16:25:42
public event EventHandler<Cles_graph_doivent_etre_redessines> les_graph_doivent_etre_redessines;
public void remove_event()
{
    if (this.les_graph_doivent_etre_redessines != null)
    {
        foreach (EventHandler<Cles_graph_doivent_etre_redessines> F_les_graph_doivent_etre_redessines in this.les_graph_doivent_etre_redessines.GetInvocationList())
        {
            this.les_graph_doivent_etre_redessines -= F_les_graph_doivent_etre_redessines;
        }
    }
}
By Anonymous, 2015-09-14 05:52:20
<Window WindowStyle="None" MouseLeftButtonDown="WindowMouseLeftButtonDown"/>
    <x:Code>
        <![CDATA[            
            private void WindowMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
            {
                DragMove();
            }
        ]]>
    </x:Code>
</Window>

http://stackoverflow.com/a/19136910 The code highlighter should be for XAML/XML, but there's no such highlighting option, so I used HTML.

By OverCR, 2015-08-22 16:55:07
$i = 0;
 
if ($i == 'dupa') {
   echo 'dupa';
} else {
   echo 'nie dupa';
}

Do you think, that output is "nie dupa"? Just try...

By mademan, 2015-08-12 22:42:57
#48 PHP +64
<?php
private function redirectFromOldSlug($pSlug, $pLanguageCode)
{
    /*
    $redirectArray[3][1] = 'beauty-young';
    $redirectArray[3][2] = 'beauty-and-rejuvenation';
    $redirectArray[3][3] = 'beauty-young';
    $redirectArray[3][4] = 'beauty-young';
    $redirectArray[2][1] = 'beauty-slim';
    $redirectArray[2][2] = 'beauty-slim';
    $redirectArray[2][3] = 'beauty-slim';
    $redirectArray[2][4] = 'beauty-slim';
    $redirectArray[18][1] = 'white-smile---2-dniowy-pakiet';
    $redirectArray[18][2] = 'white-smile-2---day-package-hilton-hotel';
    $redirectArray[18][3] = 'white-smile';
    $redirectArray[18][4] = 'white-smile---2---day-package';
    $redirectArray[17][1] = 'zdrowie-z-pieknem';
    $redirectArray[17][2] = 'healthy-and-beauty-2---day-with-dentist-botox';
    $redirectArray[17][3] = 'gesundheit-von-schonheit-2-tage';
    $redirectArray[17][4] = 'vard-av-skonhet-2-dagar';
    $redirectArray[19][1] = 'beauty-care';
    $redirectArray[19][2] = 'beauty-care';
    $redirectArray[19][3] = 'beauty-care';
    $redirectArray[19][4] = 'beauty-care';
    $redirectArray[21][1] = 'luksus-spa---hilton-w-gdasku';
    $redirectArray[21][2] = 'spa-in-hilton-hotel';
    $redirectArray[21][3] = 'spa-im-hilton---fur-sie';
    $redirectArray[21][4] = 'spa-pa-hilton---for-dig';
    $redirectArray[26][1] = 'zabiegi-implantacji-w-sea-tower';
    $redirectArray[26][2] = 'implant-treatments-in-the-sea-tower';
    $redirectArray[26][3] = 'implantate-in-der-sea-tower';
    $redirectArray[26][4] = 'implantat-i-sea-tower';
    $redirectArray[23][1] = 'mezoterapia-peeling-lipoliza-botox-hialuron';
    $redirectArray[23][2] = 'beauty-med';
    $redirectArray[23][3] = 'beauty-med';
    $redirectArray[23][4] = 'beauty-med';
    $redirectArray[34][1] = 'paski-brzuch-w-8-dni';
    $redirectArray[34][2] = 'special-abdomen-programme';
    $redirectArray[34][3] = 'das-speziell-gestaltete-und-vorbereitete-programm';
    $redirectArray[34][4] = 'ett-speciellt-utformat-program';
    $redirectArray[27][1] = 'zdrowy-kregosup';
    $redirectArray[27][2] = 'healthy-spine-clinic';
    $redirectArray[27][3] = 'wirbelsaule-ist-die-basis';
    $redirectArray[27][4] = 'frisk-ryggrad';
    $redirectArray[5][1] = 'pakiet-stomatologiczny-hotel-hilton';
    $redirectArray[5][2] = 'healthy-smile-2-day-dental-package-hilton-hotel';
    $redirectArray[5][3] = 'healthy-smile-2---day---dental-package-hotel-hilton';
    $redirectArray[5][4] = 'healthy-smile-2---day---dental-package-hotel-hilton';
    $redirectArray[16][1] = 'beauty-calming--anti-redness-2-dni';
    $redirectArray[16][2] = 'beauty-calming--anti-redness-2-days';
    $redirectArray[16][3] = 'beauty-calming--anti-redness';
    $redirectArray[16][4] = 'beauty-calming--anti-redness';
    $redirectArray[22][1] = 'stomatolog-na-twoja-kiesze';
    $redirectArray[22][2] = 'dentist-for-every-pocket';
    $redirectArray[22][3] = 'zahnarzt-fur-jedes-budget';
    $redirectArray[22][4] = 'tandlakare-for-varje-budget';
    $redirectArray[25][1] = 'przeglad-stomatologiczny-wybielanie-zebow';
    $redirectArray[25][2] = 'teeth-whitening';
    $redirectArray[25][3] = 'zahnaufhellung';
    $redirectArray[25][4] = 'tandblekning';
    $redirectArray[24][1] = 'implant-w-dwa-dni';
    $redirectArray[24][2] = 'lifelong-guarantee-for-implants';
    $redirectArray[24][3] = 'lebenslange-garantie-fur-implantate';
    $redirectArray[24][4] = 'livslangt-garanti-for-implantat';
    $redirectArray[39][1] = 'nogi-bez-zylakow';
    $redirectArray[39][2] = 'varicose';
    $redirectArray[39][3] = 'das-venefit-verfahren';
    $redirectArray[39][4] = 'forfarande-venefit';
    $redirectArray[36][1] = 'rehabilitacja-narzadu-ruch';
    $redirectArray[36][2] = 'locomotor-system-14-day-stay-in-the-health-resort';
    $redirectArray[36][3] = 'rehabilitation-14-tage-aufenthalt-im-sanatorium';
    $redirectArray[36][4] = 'rorelseapparaten---rehabiliteringsemester';
    $redirectArray[35][1] = 'zdrowe-serce-14-dniowy-program';
    $redirectArray[35][2] = 'cardiology-14-day-stay-in-the-health-resort';
    $redirectArray[35][3] = 'kardiologie---14-tage-aufenthalt-im-sanatorium';
    $redirectArray[35][4] = 'kardiologi---rehabiliteringsemester';
    $redirectArray[37][1] = 'stomatolog-w-szczecinie';
    $redirectArray[37][2] = 'dentist-in-szczecin';
    $redirectArray[37][3] = 'zahnarzt-in-szczecin';
    $redirectArray[37][4] = 'tandlakare-i-szczecin';
    $redirectArray[32][1] = 'sanatorium-z-rehabilitacja-narza';
    $redirectArray[32][2] = 'physical-medicine-and-rehabilita';
    $redirectArray[32][3] = 'rehabilitation-bewegungs';
    $redirectArray[32][4] = 'rehabilitation-behandlingar';
     *
     */
    $redirectArray = array();
    $redirectArray['beauty-young']['pl'] = 3;
    $redirectArray['beauty-slim']['pl'] = 2;
    $redirectArray['white-smile---2-dniowy-pakiet']['pl'] = 18;
    $redirectArray['zdrowie-z-pieknem']['pl'] = 17;
    $redirectArray['beauty-care']['pl'] = 19;
    $redirectArray['luksus-spa---hilton-w-gdasku']['pl'] = 21;
    $redirectArray['zabiegi-implantacji-w-sea-tower']['pl'] = 26;
    $redirectArray['mezoterapia-peeling-lipoliza-botox-hialuron']['pl'] = 23;
    $redirectArray['paski-brzuch-w-8-dni']['pl'] = 34;
    $redirectArray['zdrowy-kregosup']['pl'] = 27;
    $redirectArray['pakiet-stomatologiczny-hotel-hilton']['pl'] = 5;
    $redirectArray['beauty-calming--anti-redness-2-dni']['pl'] = 16;
    $redirectArray['stomatolog-na-twoja-kiesze']['pl'] = 22;
    $redirectArray['przeglad-stomatologiczny-wybielanie-zebow']['pl'] = 25;
    $redirectArray['implant-w-dwa-dni']['pl'] = 24;
    $redirectArray['nogi-bez-zylakow']['pl'] = 39;
    $redirectArray['rehabilitacja-narzadu-ruch']['pl'] = 36;
    $redirectArray['zdrowe-serce-14-dniowy-program']['pl'] = 35;
    $redirectArray['stomatolog-w-szczecinie']['pl'] = 37;
    $redirectArray['sanatorium-z-rehabilitacja-narza']['pl'] = 32;
    $redirectArray['beauty-and-rejuvenation']['en'] = 3;
    $redirectArray['beauty-slim']['en'] = 2;
    $redirectArray['white-smile-2---day-package-hilton-hotel']['en'] = 18;
    $redirectArray['healthy-and-beauty-2---day-with-dentist-botox']['en'] = 17;
    $redirectArray['beauty-care']['en'] = 19;
    $redirectArray['spa-in-hilton-hotel']['en'] = 21;
    $redirectArray['implant-treatments-in-the-sea-tower']['en'] = 26;
    $redirectArray['beauty-med']['en'] = 23;
    $redirectArray['special-abdomen-programme']['en'] = 34;
    $redirectArray['healthy-spine-clinic']['en'] = 27;
    $redirectArray['healthy-smile-2-day-dental-package-hilton-hotel']['en'] = 5;
    $redirectArray['beauty-calming--anti-redness-2-days']['en'] = 16;
    $redirectArray['dentist-for-every-pocket']['en'] = 22;
    $redirectArray['teeth-whitening']['en'] = 25;
    $redirectArray['lifelong-guarantee-for-implants']['en'] = 24;
    $redirectArray['varicose']['en'] = 39;
    $redirectArray['locomotor-system-14-day-stay-in-the-health-resort']['en'] = 36;
    $redirectArray['cardiology-14-day-stay-in-the-health-resort']['en'] = 35;
    $redirectArray['dentist-in-szczecin']['en'] = 37;
    $redirectArray['physical-medicine-and-rehabilita']['en'] = 32;
    $redirectArray['beauty-young']['de'] = 3;
    $redirectArray['beauty-slim']['de'] = 2;
    $redirectArray['white-smile']['de'] = 18;
    $redirectArray['gesundheit-von-schonheit-2-tage']['de'] = 17;
    $redirectArray['beauty-care']['de'] = 19;
    $redirectArray['spa-im-hilton---fur-sie']['de'] = 21;
    $redirectArray['implantate-in-der-sea-tower']['de'] = 26;
    $redirectArray['beauty-med']['de'] = 23;
    $redirectArray['das-speziell-gestaltete-und-vorbereitete-programm']['de'] = 34;
    $redirectArray['wirbelsaule-ist-die-basis']['de'] = 27;
    $redirectArray['healthy-smile-2---day---dental-package-hotel-hilton']['de'] = 5;
    $redirectArray['beauty-calming--anti-redness']['de'] = 16;
    $redirectArray['zahnarzt-fur-jedes-budget']['de'] = 22;
    $redirectArray['zahnaufhellung']['de'] = 25;
    $redirectArray['lebenslange-garantie-fur-implantate']['de'] = 24;
    $redirectArray['das-venefit-verfahren']['de'] = 39;
    $redirectArray['rehabilitation-14-tage-aufenthalt-im-sanatorium']['de'] = 36;
    $redirectArray['kardiologie---14-tage-aufenthalt-im-sanatorium']['de'] = 35;
    $redirectArray['zahnarzt-in-szczecin']['de'] = 37;
    $redirectArray['rehabilitation-bewegungs']['de'] = 32;
    $redirectArray['beauty-young']['sv'] = 3;
    $redirectArray['beauty-slim']['sv'] = 2;
    $redirectArray['white-smile---2---day-package']['sv'] = 18;
    $redirectArray['vard-av-skonhet-2-dagar']['sv'] = 17;
    $redirectArray['beauty-care']['sv'] = 19;
    $redirectArray['spa-pa-hilton---for-dig']['sv'] = 21;
    $redirectArray['implantat-i-sea-tower']['sv'] = 26;
    $redirectArray['beauty-med']['sv'] = 23;
    $redirectArray['ett-speciellt-utformat-program']['sv'] = 34;
    $redirectArray['frisk-ryggrad']['sv'] = 27;
    $redirectArray['healthy-smile-2---day---dental-package-hotel-hilton']['sv'] = 5;
    $redirectArray['beauty-calming--anti-redness']['sv'] = 16;
    $redirectArray['tandlakare-for-varje-budget']['sv'] = 22;
    $redirectArray['tandblekning']['sv'] = 25;
    $redirectArray['livslangt-garanti-for-implantat']['sv'] = 24;
    $redirectArray['forfarande-venefit']['sv'] = 39;
    $redirectArray['rorelseapparaten---rehabiliteringsemester']['sv'] = 36;
    $redirectArray['kardiologi---rehabiliteringsemester']['sv'] = 35;
    $redirectArray['tandlakare-i-szczecin']['sv'] = 37;
    $redirectArray['rehabilitation-behandlingar']['sv'] = 32;

    if (!empty($redirectArray[$pSlug][$pLanguageCode]))
    {
        $packageId = $redirectArray[$pSlug][$pLanguageCode];
        $package = $this->packagesInstance->getPackageByIdAndLang($packageId, $pLanguageCode);
        if (!empty($package))
        {
            $this->redirect('package/'.$package['slug'], array('code' => 301));
        }
    }
}
By Kadet, 2015-07-30 02:01:37
int var = 0;
int* ptr = &var;
ptr[0] = 5;
std::cout << ptr[0];
By Anonymous, 2015-07-24 23:51:35
CREATE FUNCTION [dbo].[get_number_of_workers] 
(
     @number_of_workers varchar(10)
 
)
RETURNS int
AS
BEGIN
 
 
set @number_of_workers = replace(replace(replace(replace(LTRIM(RTRIM(@number_of_workers)), char(9), ''), char(10), ''), char(13),''), char(13)+char(10), '')
 
DECLARE @temp varchar(10)
 
SELECT
    @temp = number_of_workers 
FROM
    (SELECT LTRIM(RTRIM(@number_of_workers)) as number_of_workers) as temp
WHERE
       number_of_workers like  '[0-9]'
    or number_of_workers like  '[0-9][0-9]'
    or number_of_workers like  '[0-9][0-9][0-9]'
    or number_of_workers like  '[0-9][0-9][0-9][0-9]'
    or number_of_workers like  '[0-9][0-9][0-9][0-9][0-9]'
    or number_of_workers like  '[0-9][0-9][0-9][0-9][0-9][0-9]'
    or number_of_workers like  '[0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
    or number_of_workers like  '[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
    or number_of_workers like  '[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
    or number_of_workers like  '[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
    or number_of_workers like  '[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
     
     
RETURN CONVERT(INT, @temp)
 
END
By Anonymous, 2015-07-22 14:59:09
private static int alphabetToNumber(String letter) {
    String s = letter.toLowerCase();
    if (s.equals("a")) {
        return 1;
    } else if (s.equals("b")) {
        return 2;
    } else if (s.equals("c")) {
        return 3;
    } else if (s.equals("d")) {
        return 4;
    } else if (s.equals("e")) {
        return 5;
    } else if (s.equals("f")) {
        return 6;
    } else if (s.equals("g")) {
        return 7;
    } else if (s.equals("h")) {
        return 8;
    } else if (s.equals("i")) {
        return 9;
    } else if (s.equals("j")) {
        return 10;
    } else if (s.equals("k")) {
        return 11;
    } else if (s.equals("l")) {
        return 12;
    } else if (s.equals("m")) {
        return 13;
    } else if (s.equals("n")) {
        return 14;
    } else if (s.equals("o")) {
        return 15;
    } else if (s.equals("p")) {
        return 16;
    } else if (s.equals("q")) {
        return 17;
    } else if (s.equals("r")) {
        return 18;
    } else if (s.equals("s")) {
        return 19;
    } else if (s.equals("t")) {
        return 20;
    } else if (s.equals("u")) {
        return 21;
    } else if (s.equals("v")) {
        return 22;
    } else if (s.equals("w")) {
        return 23;
    } else if (s.equals("x")) {
        return 24;
    } else if (s.equals("y")) {
        return 25;
    } else if (s.equals("z")) {
        return 26;
    } else {
        return 0;
    }
}
By Anonymous, 2015-07-22 14:54:18
[ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo *Click*
By Anonymous, 2015-07-22 14:51:27
<img src="../../../../../../../../../../../../../../../../../assets/logo.png" />
By Anonymous, 2015-07-22 14:46:50
// sleep 150s
for ($a = 0; $a < 150 ; $a++ ) { 
      sleep(1);
}
By Anonymous, 2015-07-22 14:42:11
for ($i=0 ; $i<3 ; $i++) {
  switch($i) {
    case 1:
      // do some stuff
      break;
    case 2:
      // do some stuff
      break;;
    case 3:
      // do some stuff
      break;
  }
}
By Anonymous, 2015-07-22 14:40:25
<!-- Renders an horizontal line -->
 
<center>____________________________________________________________________________</center>
By Anonymous, 2015-07-22 14:38:41