/** * lowercase letters */
        $this->store['upper_Spec'] = array( *cut* );
        /** * uppercase letters */
        $this->store['lower_Spec'] = array( *cut* );
      
                    } else {
                      $errmsg='An unknown error occured.';
                    }
                  } else {
                    $errmsg='The passwords you entered do not match';
                  }
                } else {
                  $errmsg='Password has to be at least 8 characters long.';
                }
              } else {
                $errmsg='The email you entered is already in our database.';
              }
            } else {
              $errmsg='Please enter your email address.';
            }
          } else {
            $errmsg='Please enter your first name and your last name.';
          }
        } else {
        (...)
      
        // Happy debugging, suckers
        # define true (rand() > 10)
      

anonymous

+1

var number = 10.632222232;

function round2Decimal(number) {
    return parseFloat(number.toString().substr(0, number.toString().indexOf('.') + 2) + (number.toString()[number.toString().indexOf('.') + 3] >= 5 ? (parseInt(number.toString()[number.toString().indexOf('.') + 2]) + 1).toString() : number.toString()[number.toString().indexOf('.') + 2]));
}

var roundedNumber = round2Decimal(number);
 

anonymous

+1

var arr = "5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,8,8,8,8,8,8,8,8,8,8,5,10,8,8,8,8,10,10,8,12,10,10,8,10,10,8,8,8,10,10,10,8,10,10,8,10,5,".split(',');
 

anonymous

0

int shift(int x, int y)
{
     int r = x;
     for(int i = 0; i < y; ++i)
     {
         r = r << 1;
     }
     return r;
}
 

anonymous

+2

#actual infinite loop from production code:

while True is not False and True or False is False or False and True is not False and True:
  socket.listen()
 

anonymous

0

//TODO: hash it
byte[] password = System.Text.Encoding.UTF8.GetBytes( pwd.ToString() );
Array.Reverse(password);
string tmpPassword = Convert.ToBase64String( password );
 

anonymous

+1

if(  $username == "admin" &&
     sha1(SALT . $password) == "2e7ee9a0c8c420711c709d908c37ee65f41276fd") { //check if password is "m8onIBBpRU"
     $adminSessionController->loggedIn(true);
}
 

anonymous

0

/// <summary>
///     Gets a value indicating whether is valid employee id.
 /// </summary>
public bool IsValidEmployeeId
{
     get
     {
          return this.EmployeeId.Length > 0  || this.EmployeeId.Length < 33;
     }
}
 

anonymous

+1

img{
font-weight:bold;
}
 

0

    public static int igenyszintToSzint(int igeny)
    {
        switch(igeny)
        {
            case 1: return 1;
            case 2: return 2;
            case 3: return 3;
            case 4: return 4;
            default : return 0;
        }
    }
    
    public static int szintToIgenySzint(int szint)
    {
        switch(szint)
        {
            case 1: return 1;
            case 2: return 2;
            case 3: return 3;
            case 4: return 4;
            default: return 0;
        }
    }
 

anonymous

0

// I recently joined the software developers of an FRC robotics team, and found stuff like this:
public static void print(int line, int column, String message, Object... parms) {
	String lcdLine = "";

	switch(line) {
		case 1:
			lcdLine = "LCD_Line_1";
			break;
		case 2:
			lcdLine = "LCD_Line_2";
			break;
		case 3:
			lcdLine = "LCD_Line_3";
			break;
		case 4:
			lcdLine = "LCD_Line_4";
			break;
		case 5:
			lcdLine = "LCD_Line_5";
			break;
		case 6:
			lcdLine = "LCD_Line_6";
			break;
		case 7:
			lcdLine = "LCD_Line_7";
			break;
		case 8:
			lcdLine = "LCD_Line_8";
			break;
		case 9:
			lcdLine = "LCD_Line_9";
			break;
		case 10:
			lcdLine = "LCD_Line_10";
			break;
	}
	SmartDashboard.putString(lcdLine, String.format(message, parms));
}

// Yep. This is real code that was on the robot during competitions. I might post more, there's a lot.
 

anonymous

+1

@Test
public void testGetResource() throws Exception {
      
     String basepath = "C:\\Documents and Settings\\<some guy's name>\\Desktop\\testfolder";
     // some other code
}
 

anonymous

+1

// IEventLogGroupConfigurator configurator = new EsEventLogGroupConfigurator();
// TODO: remove above line
 

anonymous

+2

// This is production code. No kidding
'numera zeros a esquerda 7 digitos #################################################################
function retorna_digitos_7(digitos)
	conta_string = Len(digitos)
	if conta_string=1 then
		digitos = "000000"&digitos
	elseif 	conta_string = 2 then
		digitos = "00000"&digitos
	elseif 	conta_string =3 then
		digitos = "0000"&digitos
	elseif 	conta_string =4 then
		digitos = "000"&digitos
	elseif 	conta_string =5 then
		digitos = "00"&digitos
	elseif 	conta_string =6 then
		digitos = "0"&digitos		
	else
		digitos = digitos
	end if
	retorna_digitos_7 = digitos
end function

'numera zeros a esquerda 6 digitos #################################################################
function retorna_digitos_6(digitos)
	conta_string = Len(digitos)
	if conta_string=1 then
		digitos = "00000"&digitos
	elseif 	conta_string = 2 then
		digitos = "0000"&digitos
	elseif 	conta_string =3 then
		digitos = "000"&digitos
	elseif 	conta_string =4 then
		digitos = "00"&digitos
	elseif 	conta_string =5 then
		digitos = "0"&digitos	
	else
		digitos = digitos
	end if
	retorna_digitos_6 = digitos
end function
'numera zeros a esquerda 5 digitos #################################################################
function retorna_digitos_5(digitos)
	conta_string = Len(digitos)
	if conta_string=1 then
		digitos = "0000"&digitos
	elseif 	conta_string = 2 then
		digitos = "000"&digitos
	elseif 	conta_string =3 then
		digitos = "00"&digitos
	elseif 	conta_string =4 then
		digitos = "0"&digitos
	else
		digitos = digitos
	end if
	retorna_digitos_5 = digitos
end function
'numera zeros a esquerda 4 digitos #################################################################
function retorna_digitos_4(digitos)
	conta_string = Len(digitos)
	if conta_string=1 then
		digitos = "000"&digitos
	elseif 	conta_string = 2 then
		digitos = "00"&digitos
	elseif 	conta_string =3 then
		digitos = "0"&digitos
	else
		digitos = digitos
	end if
	retorna_digitos_4 = digitos
end function
'###################################################################################################
function retorna_digitos_3(digitos)
	conta_string = Len(digitos)
	if conta_string=1 then
		digitos = "00"&digitos
	elseif 	conta_string = 2 then
		digitos = "0"&digitos
	else
		digitos = digitos
	end if
	retorna_digitos_3 = digitos
end function

function retorna_digitos_2(digitos)
	conta_string = Len(digitos)
	if conta_string=1 then
		digitos = "0"&digitos
	else
		digitos = digitos
	end if
	retorna_digitos_2 = digitos
end function
'###################################################################################################
 

+5

public class Bank_12
{
 
/*Blah blah... Basically, this was a pathetic attempt to curb copying in one of the "top"
engineering universities. Every student have to suffix every variable, class, method
(identifier) with the his/her registration number so that people don't "rip off code" from
other students. It obviously works because it is SOOOOO hard to do a find+replace with
your own number.
*/
 
    private int balance_12;
    private String name_12;
 
    public Bank_12(String name_12, balance_12)
    {
       this.name_12 = name_12;
       this.balance_12 = balance_12;
    }
 
    public void getBalance_12()
    {
        return balance_12;
    }
}
 

anonymous

+4

dataList
    .forEach(function(data, index) {
        switch (index) {
            case 0:
                item1 = data;
                return;
            case 1:
                item2 = data;
                return;
        }
    });
 

anonymous

+5

if ((action == nil) || ((action != nil)) {
    // Stuff...
}
 

anonymous

+2

    Dim oHeaderTextParam
    Set oHeaderTextParam = Nothing
    Set oHeaderTextParam = oParamSet_GN.DirectParameters.Item(sHeaderTextParamName)
    Dim oBodyTextParam
    Set oBodyTextParam = Nothing
    Set oBodyTextParam = oParamSet_GN.DirectParameters.Item(sBodyTextParamName)
    Dim oFooterTextParam
    Set oFooterTextParam = Nothing
    Set oFooterTextParam = oParamSet_GN.DirectParameters.Item(sFooterTextParamName)
    Dim oVersionParam
    Set oVersionParam = Nothing
    Set oVersionParam = oParamSet_GN.DirectParameters.Item(sGN_VersionParamName)
    Dim oUpdateParam
    Set oUpdateParam = Nothing
    Set oUpdateParam = oParamSet_GN.DirectParameters.Item(sGN_UpdateParamName)
    Dim oConfigParam
    Set oConfigParam = Nothing
    Set oConfigParam = oParamSet_GN.DirectParameters.Item(sGN_ConfigParamName)
 

anonymous

+1

 //Make sure we don't trigger this condition while in prod. Note to self, remove the (1 == 2) before release
if ($_SERVER['HTTP_USER_AGENT'] != "Valve/Steam HTTP Client 1.0" && 1 == 2) {            
    //some code that basically redirect to an access denied page
}
 

anonymous

+1

<?php
$arr_a = array("A" => 1,"B"=> 2,"C"=> 3,"D"=> 4,"E"=> 5);
$arr_b = $arr_a;
$arr_c = $arr_a;
$arr_d = $arr_a;
$arr_e = $arr_a;
$combos = 0;

echo "\n";
foreach($arr_a as $key_a => $number_a) {
    foreach($arr_b as $key_b => $number_b) {
        foreach($arr_c as $key_c => $number_c) {
            foreach($arr_d as $key_d => $number_d) {
                foreach($arr_e as $key_e => $number_e) {
                    echo $key_a.$key_b.$key_c.$key_d.$key_e." ".($number_a+$number_b+$number_c+$number_d+$number_e)."\n";
                    $combos++;
                }
            }
        }
    }
}
echo $combos."\n";
 

0

/**
 * Get some property
 * @throws NullPointerException Throws if contact is null    <<-- No kidding?
 */
public boolean getSomeProperty(Contact contact, String name, boolean defaultValue) throws NullPointerException {
  if(contact == null) {
    throw new NullPointerException();                <<-- Oh, what a relief
  }
  return getSomeBooleanProperty(contact, defaultValue);
}
 

anonymous

+1

// This if from actual commercial quite serious project
// So, for how long does this thread sleep?
final int wait100Ms = 300;
for( int i=0; i < wait100Ms; i++) {
  try {
    Thread.sleep(100);
  } catch (InterruptedException e) {
  }
}
 

anonymous

+1

// ----------------------------------------------------------------
// People were reporting random PHP errors on the loading screen
// and I don't feel like maintaining the code of another person. 
// So yeah, fuck it. 
     error_reporting(0);
//
// THERE I FIXED IT 
// ----------------------------------------------------------------
 

+2

svg .white {
    fill: $grey;
}
 

anonymous

0

Function CompareTextsPerCharacter(iTxt1, iTxt2) As Boolean
' Purposes      : to check characters in iTxt2 are continuously similar from behind with iTxt2
    
    CompareTextsPerCharacter = False
    If Trim(iTxt1) = "" Then Exit Function
    If Trim(iTxt2) = "" Then Exit Function
    
    Dim char1
    Dim char2
    Dim len1
    len1 = Len(iTxt1)
    Dim len2
    len2 = Len(iTxt2)
    Dim i As Integer
    Dim j As Integer
    j = 0
    For i = 1 To len1
        char1 = Mid(iTxt1, i, 1)
        char2 = Mid(iTxt2, i, 1)
        If char1 <> char2 Then Exit For
        j = j + 1
    Next
    
    If j = len2 Then CompareTextsPerCharacter = True
    
    
End Function
 

anonymous

+3

if (!dont_show_error) {
    dont_show_error = false;
}
 

anonymous

0

 public boolean addAddress(AddressData newAddress, String message, CartData cartData){
      try{
         userFacade.addAddress(newAddress);
      }
      catch(Exception ex){
         if(ex.getCause() instanceof InterceptorException){
            if(ex.getCause().getMessage().contains("316")){
               LOG.error(message);
               if(cartData != null){
                  LOG.error(logCartInformationFor316(cartData));
               }
               else{
                  LOG.error("316: No Cart Data found.");
               }
               return true;
            }
         }
         LOG.error("Error adding new address. " +  ex);
      }
      return false;
   }
 

+2

var random = (new Date).getTime();
 

+5

<?

$calend = array(
"17.05.2014", 
"18.05.2014", 
"24.05.2014",
"25.05.2014",
"31.05.2014",
"01.06.2014",
"07.06.2014",
"08.06.2014",
"12.06.2014",
"13.06.2014",
"14.06.2014",
"15.06.2014",
"21.06.2014",
"22.06.2014",
"28.06.2014",
"29.06.2014",
"05.07.2014",
"06.07.2014",
"12.07.2014",
"13.07.2014",
"19.07.2014",
"20.07.2014",
"26.07.2014",
"27.07.2014",
"02.08.2014",
"03.08.2014",
"09.08.2014",
"10.08.2014",
"16.08.2014",
"17.08.2014",
"23.08.2014",
"24.08.2014",
"30.08.2014",
"31.08.2014",
"07.09.2014",
"13.09.2014",
"14.09.2014",
"20.09.2014",
"21.09.2014",
"27.09.2014",
"28.09.2014",
"04.10.2014",
"05.10.2014",
"11.10.2014",
"12.10.2014",
"18.10.2014",
"19.10.2014",
"25.10.2014",
"26.10.2014",
"01.11.2014",
"02.11.2014",
"03.11.2014",
"04.11.2014",
"08.11.2014",
"09.11.2014",
"15.11.2014",
"16.11.2014",
"22.11.2014",
"23.11.2014",
"29.11.2014",
"30.11.2014",
"07.12.2014",
"13.12.2014",
"14.12.2014",
"20.12.2014",
"21.12.2014",
"27.12.2014",
"28.12.2014"
);



if (in_array(date("d.m.Y",time()), $calend)) {
echo "(343) 266-30-54";
}

else echo '(343) 222-77-60';





?>
 

anonymous

+1

	//Actually, return a list of states
	public function GetCities(){...}
 

anonymous

0

// whole Drupal6
 

anonymous

+16

<noscript><script type="text/javascript">alert("You do not have JavaScript enabled. Please enable JavaScript.</script></noscript>
 

anonymous

+1

@media screen and (min-width:0){ ... } // The final straw that got someone fired.
 

+1

{% for img in subpage.images.all %}
    <a href="
    {% thumbnail img.image '930x523' as im %}
        {{ im.url }}">
    {% empty %}
        ">
    {% endthumbnail %}
    <img src="
    {% thumbnail img.image '200x112' as im %}
        {{ im.url }}"
    {% empty %}
        "
    {% endthumbnail %}
    {% thumbnail img.image "1200" as im %}
        data-big="{{ im.url }}"
    {% empty %}
    {% endthumbnail %}
    {% if img.title or img.author %}
            data-title="{{ img.title|default:"&nbsp;" }}"
        {% if img.author %}
            data-description="{% blocktrans with img.author as author %}photo by {{ author }}{% endblocktrans %}"
        {% else %}
            data-description="&nbsp;"
        {% endif %}
    {% endif %}
    ></a>
{% endfor %}
 

+1

if(!vbarcode.isEmpty()){
   if(vbarcode.isEmpty())
      return;

...
}
 

+7

function not_only_letters(word) {
     
    var OK = 1
    var NO = 0
 
     
    word = word.toUpperCase();
 
    var len = wyraz.length; 
 
    for(i = 0;  i < len;  i++){        
             
            if(word.charAt(i) <"A" 
                    && word.charAt(i) != "-" 
                        && word.charAt(i)  != " " 
                            && word.charAt(i) != "." 
                                && word.charAt(i) != "&" 
                                    && word.charAt(i) != "_" 
                                        && word.charAt(i) != "\"" 
                                            && word.charAt(i) != "'" 
                             
            ) {                
                if(polish_letter(word.charAt(i) ) == 0 ) 
                            return NO; 
            }
            if(word.charAt(i) >"Z" 
                       && word.charAt(i) != "-" 
                            && word.charAt(i)  != " " 
                                && word.charAt(i) != "." 
                                    && word.charAt(i) != "&" 
                                        && word.charAt(i) != "_" 
                                            && word.charAt(i) != "\""
                                                && word.charAt(i) != "'"
            ) {  
 
                if(word.charCodeAt(i) >188) 
                    continue;
                else
                {
                 if(polish_letter(word.charAt(i) ) == 0 ) 
                        return NO;
                else
                   continue;
                }
            }
    }
    var counter = 0;
    for(i = 0;  i < len;  i++){
            if(word.charAt(i) == "-" 
                        || word.charAt(i)  == " " 
                            || word.charAt(i) == "." 
                                || word.charAt(i) == "&" 
                                    || word.charAt(i) == "_" 
                                        || word.charAt(i) == "\""
                                            || word.charAt(i) == "'"
             ) {
                counter++;
            }
    }
    if (len > 0)
    if (counter==len)
    {
        return NO;
    }
    return OK;
}
 

anonymous

+3

public void drawForeground() {
		switch (pageIndex) {
			case 0:
				drawMainScreen();
				break;
			case 1:
				drawScreenTwo();
				break;
			case 2:
				drawScreenThree();
				break;
			case 3:
				drawScreenFour();
				break;
			case 4:
				drawScreenFive();
				break;
			case 5:
				drawScreenSix();
				break;
			case 6:
				drawScreenSeven();
				break;
			case 7:
				drawScreenEight();
				break;
			case 8:
				drawScreenNine();
				break;
			case 9:
				drawScreenTen();
				break;
			case 10:
				drawScreenEleven();
				break;
		}
	}

	protected void drawMainScreen() {
		fontRendererObj.drawString(TextHelper.localize("gui." + ModInformation.ID + ".basebook.title.main"), bookXStart + 60, 20, 0x000000);

		boolean unicode = fontRendererObj.getUnicodeFlag();
		fontRendererObj.setUnicodeFlag(false);
		fontRendererObj.drawSplitString(TextHelper.localize("gui." + ModInformation.ID + ".basebook.content.main"), bookXStart + 30, 60, WIDTH - 40, 0x000000);
		fontRendererObj.drawString((pageIndex + 1) + "/" + (bookTotalPages), bookXStart + 82, 215, 0x000000);
		fontRendererObj.setUnicodeFlag(unicode);
	}

	private void drawScreenTwo() {
		fontRendererObj.drawString(TextHelper.localize("gui." + ModInformation.ID + ".basebook.title.1"), bookXStart + 70, 20, 0x000000);

		boolean unicode = fontRendererObj.getUnicodeFlag();
		fontRendererObj.setUnicodeFlag(false);
		fontRendererObj.drawSplitString(TextHelper.localize("gui." + ModInformation.ID + ".basebook.content.1"), bookXStart + 20, 60, WIDTH - 40, 0x000000);
		fontRendererObj.drawString((pageIndex + 1) + "/" + (bookTotalPages), bookXStart + 82, 215, 0x000000);
		fontRendererObj.setUnicodeFlag(unicode);
	}

	private void drawScreenThree() {
		fontRendererObj.drawString(TextHelper.localize("gui." + ModInformation.ID + ".basebook.title.2"), bookXStart + 70, 20, 0x000000);

		boolean unicode = fontRendererObj.getUnicodeFlag();
		fontRendererObj.setUnicodeFlag(false);
		fontRendererObj.drawSplitString(TextHelper.localize("gui." + ModInformation.ID + ".basebook.content.2"), bookXStart + 20, 60, WIDTH - 40, 0x000000);
		fontRendererObj.drawString((pageIndex + 1) + "/" + (bookTotalPages), bookXStart + 82, 215, 0x000000);
		fontRendererObj.setUnicodeFlag(unicode);
	}

	private void drawScreenFour() {
		fontRendererObj.drawString(TextHelper.localize("gui." + ModInformation.ID + ".basebook.title.3"), bookXStart + 70, 20, 0x000000);

		boolean unicode = fontRendererObj.getUnicodeFlag();
		fontRendererObj.setUnicodeFlag(false);
		fontRendererObj.drawSplitString(TextHelper.localize("gui." + ModInformation.ID + ".basebook.content.3"), bookXStart + 20, 60, WIDTH - 40, 0x000000);
		fontRendererObj.drawString((pageIndex + 1) + "/" + (bookTotalPages), bookXStart + 82, 215, 0x000000);
		fontRendererObj.setUnicodeFlag(unicode);
	}

	private void drawScreenFive() {
		fontRendererObj.drawString(TextHelper.localize("gui." + ModInformation.ID + ".basebook.title.4"), bookXStart + 70, 20, 0x000000);

		boolean unicode = fontRendererObj.getUnicodeFlag();
		fontRendererObj.setUnicodeFlag(false);
		fontRendererObj.drawSplitString(TextHelper.localize("gui." + ModInformation.ID + ".basebook.content.4"), bookXStart + 20, 60, WIDTH - 40, 0x000000);
		fontRendererObj.drawString((pageIndex + 1) + "/" + (bookTotalPages), bookXStart + 82, 215, 0x000000);
		fontRendererObj.setUnicodeFlag(unicode);
	}

	private void drawScreenSix() {
		fontRendererObj.drawString(TextHelper.localize("gui." + ModInformation.ID + ".basebook.title.5"), bookXStart + 70, 20, 0x000000);

		boolean unicode = fontRendererObj.getUnicodeFlag();
		fontRendererObj.setUnicodeFlag(false);
		fontRendererObj.drawSplitString(TextHelper.localize("gui." + ModInformation.ID + ".basebook.content.5"), bookXStart + 20, 60, WIDTH - 40, 0x000000);
		fontRendererObj.drawString((pageIndex + 1) + "/" + (bookTotalPages), bookXStart + 82, 215, 0x000000);
		fontRendererObj.setUnicodeFlag(unicode);
	}

	private void drawScreenSeven() {
		fontRendererObj.drawString(TextHelper.localize("gui." + ModInformation.ID + ".basebook.title.6"), bookXStart + 70, 20, 0x000000);

		boolean unicode = fontRendererObj.getUnicodeFlag();
		fontRendererObj.setUnicodeFlag(false);
		fontRendererObj.drawSplitString(TextHelper.localize("gui." + ModInformation.ID + ".basebook.content.6"), bookXStart + 20, 60, WIDTH - 40, 0x000000);
		fontRendererObj.drawString((pageIndex + 1) + "/" + (bookTotalPages), bookXStart + 82, 215, 0x000000);
		fontRendererObj.setUnicodeFlag(unicode);
	}

	private void drawScreenEight() {
		fontRendererObj.drawString(TextHelper.localize("gui." + ModInformation.ID + ".basebook.title.7"), bookXStart + 70, 20, 0x000000);

		boolean unicode = fontRendererObj.getUnicodeFlag();
		fontRendererObj.setUnicodeFlag(false);
		fontRendererObj.drawSplitString(TextHelper.localize("gui." + ModInformation.ID + ".basebook.content.7"), bookXStart + 20, 60, WIDTH - 40, 0x000000);
		fontRendererObj.drawString((pageIndex + 1) + "/" + (bookTotalPages), bookXStart + 82, 215, 0x000000);
		fontRendererObj.setUnicodeFlag(unicode);
	}

	private void drawScreenNine() {
		fontRendererObj.drawString(TextHelper.localize("gui." + ModInformation.ID + ".basebook.title.8"), bookXStart + 70, 20, 0x000000);

		boolean unicode = fontRendererObj.getUnicodeFlag();
		fontRendererObj.setUnicodeFlag(false);
		fontRendererObj.drawSplitString(TextHelper.localize("gui." + ModInformation.ID + ".basebook.content.8"), bookXStart + 20, 60, WIDTH - 40, 0x000000);
		fontRendererObj.drawString((pageIndex + 1) + "/" + (bookTotalPages), bookXStart + 82, 215, 0x000000);
		fontRendererObj.setUnicodeFlag(unicode);
	}

	private void drawScreenTen() {
		fontRendererObj.drawString(TextHelper.localize("gui." + ModInformation.ID + ".basebook.title.9"), bookXStart + 70, 20, 0x000000);

		boolean unicode = fontRendererObj.getUnicodeFlag();
		fontRendererObj.setUnicodeFlag(false);
		fontRendererObj.drawSplitString(TextHelper.localize("gui." + ModInformation.ID + ".basebook.content.9"), bookXStart + 20, 60, WIDTH - 40, 0x000000);
		fontRendererObj.drawString((pageIndex + 1) + "/" + (bookTotalPages), bookXStart + 82, 215, 0x000000);
		fontRendererObj.setUnicodeFlag(unicode);
	}

	private void drawScreenEleven() {
		fontRendererObj.drawString(TextHelper.localize("gui." + ModInformation.ID + ".basebook.title.10"), bookXStart + 70, 20, 0x000000);

		boolean unicode = fontRendererObj.getUnicodeFlag();
		fontRendererObj.setUnicodeFlag(false);
		fontRendererObj.drawSplitString(TextHelper.localize("gui." + ModInformation.ID + ".basebook.content.10"), bookXStart + 20, 60, WIDTH - 40, 0x000000);
		fontRendererObj.drawString((pageIndex + 1) + "/" + (bookTotalPages), bookXStart + 82, 215, 0x000000);
		fontRendererObj.setUnicodeFlag(unicode);
	}
 

anonymous

0

Dim ctlOB() ' to empty the collection
 

anonymous

-2

@EventHandler
	public void onInventoryClick(InventoryClickEvent event) {

		final Player player = (Player) event.getWhoClicked(); // The player that clicked the item
		final ItemStack clicked = event.getCurrentItem(); // The item that was clicked
		final Inventory inventory = event.getInventory(); // The inventory that was clicked in

		if (inventory.equals(Inv) || inventory.equals(powerRockInv) || inventory.equals(mutantmelonInv) || inventory.equals(gingerInv) || inventory.equals(spiceInv) || inventory.equals(sweetnerInv) || inventory.equals(cookieInv) || inventory.equals(chocolateInv) || inventory.equals(darkChocolateInv)) { // This is our inventory :D
			event.setCancelled(true); // Make it so the item cant be taken
			ItemStack is = event.getCurrentItem();
			ItemMeta im = is.getItemMeta();
			if(im.getDisplayName().equals("\2477\247lWrapper")) {
				if (econ.has(player, 25000)) {
					event.setCancelled(true); // Make it so the item cant be taken
					player.sendMessage(F.darkPurple + F.bold + "CANDIES" + F.gray + ": You have purchased x4 Wrapper for $25000");
					EconomyResponse r = econ.withdrawPlayer(player.getName(), 25000);
					wrapper.setAmount(4);
					player.getInventory().addItem(wrapper);
					player.updateInventory();
				}
				if (inventory.equals(Inv)) {
					if(im.getDisplayName().equals("\247c\247lPower \2474\247lRock")) {
						event.setCancelled(true); // Make it so the item cant be taken
						player.openInventory(powerRockInv);
						player.sendMessage(F.darkPurple + F.bold + "CANDIES" + F.gray + ": Navigating over to the Power Rock crafting GUI...");
					}else{
						if (inventory.equals(Inv)) {
							if(im.getDisplayName().equals("\2475\247lMutant \247d\247lMelon")) {
								event.setCancelled(true); // Make it so the item cant be taken
								player.openInventory(mutantmelonInv);
								player.sendMessage(F.darkPurple + F.bold + "CANDIES" + F.gray + ": Navigating over to the Mutant Melon crafting GUI...");
							}else{
								if (inventory.equals(Inv)) {
									if(im.getDisplayName().equals("\2476\247lGin\247r\247e\247lger")) {
										player.openInventory(gingerInv);
										player.sendMessage(F.darkPurple + F.bold + "CANDIES" + F.gray + ": Navigating over to the Ginger crafting GUI...");
										event.setCancelled(true); // Make it so the item cant be taken
									}else{
										if (inventory.equals(Inv)) {
											if(im.getDisplayName().equals("\2472\247lSpice")) {
												player.openInventory(spiceInv);
												player.sendMessage(F.darkPurple + F.bold + "CANDIES" + F.gray + ": Navigating over to the Spice crafting GUI...");
												event.setCancelled(true); // Make it so the item cant be taken
											}else{
												if(im.getDisplayName().equals("\2478\247lPepper")) {
													if (econ.has(player, 37500)) {
														event.setCancelled(true); // Make it so the item cant be taken
														player.sendMessage(F.darkPurple + F.bold + "CANDIES" + F.gray + ": You have purchased x8 Pepper for $37500");
														EconomyResponse r = econ.withdrawPlayer(player.getName(), 37500);
														pepper.setAmount(8);
														player.getInventory().addItem(pepper);
														player.updateInventory();
													}else{
														player.sendMessage(F.darkRed + F.bold + "FAULT" + F.gray + ": You do not have enough money for this candy! You need $37500 and you have $" + econ.getBalance(player));
													}}else{
														if (inventory.equals(Inv)) {
															if(im.getDisplayName().equals("\247f\247lSweet\2477\247lner")) {
																player.openInventory(sweetnerInv);
																player.sendMessage(F.darkPurple + F.bold + "CANDIES" + F.gray + ": Navigating over to the Sweetner crafting GUI...");
																event.setCancelled(true); // Make it so the item cant be taken
															}else{
																if (inventory.equals(Inv)) {
																	if(im.getDisplayName().equals("\247b\247lC\247e\247lO\247b\247lO\247e\247lK\247b\247lI\247e\247lE")) {
																		player.openInventory(cookieInv);
																		player.sendMessage(F.darkPurple + F.bold + "CANDIES" + F.gray + ": Navigating over to the Cookie crafting GUI...");
																		event.setCancelled(true); // Make it so the item cant be taken
																	}else{
																		if (inventory.equals(Inv)) {
																			if(im.getDisplayName().equals("\247e\247lChocolate")) {
																				player.openInventory(chocolateInv);
																				player.sendMessage(F.darkPurple + F.bold + "CANDIES" + F.gray + ": Navigating over to the Chocolate crafting GUI...");
																				event.setCancelled(true); // Make it so the item cant be taken
																			}else{
																				if (inventory.equals(Inv)) {
																					if(im.getDisplayName().equals("\2476\247lDark Chocolate")) {
																						player.openInventory(darkChocolateInv);
																						player.sendMessage(F.darkPurple + F.bold + "CANDIES" + F.gray + ": Navigating over to the Dark Chocolate crafting GUI...");
																						event.setCancelled(true); // Make it so the item cant be taken
																					}
																				}
																			}
																		}
																	}
																}
															}
														}
													}
											}
										}
									}
								}
							}
						}
					}
				}
			}
		}
	}
 

anonymous

+1

Public Sub RedefineTextArrayByRemovingLineFeedOnEachArrayMember(ByRef arrText, iTxtLimit)
' Purpose   : To redefine the array which contains text member when in member may have line feed within the text.
' Result    : an array which the member number may increase and each text member doesn't have line feed.
 

anonymous

+5

// static table for positive integer numbers below 65
const char *num_table[] = {
	"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "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", "57", "58", "59", "60",
	"61", "62", "63", "64" };