private static function derivePrice(...)
  {
	$price = self::derivePriceUnchecked($vars);
    
    if (isset($price)) {
		// CODE HERE
    } 

    if (isset($price)) {
		// CODE HERE
    } 
    
    if (isset($price)) {
		// CODE HERE
    }

    if (isset($price)) {
		// CODE HERE
    }

    if (isset($price)) {
		// CODE HERE
    }

    if (isset($price)) {
		// CODE HERE
    }

    if (isset($price)) {
		// CODE HERE
    }

    if (isset($price)) {
		// CODE HERE
    }

    return $price;
  }
By Anonymous, 2018-02-06 11:38:18
 foreach (Byte bajt in data ) {
                    BufferIndex = i++;
                    if (!char.IsControl((char)bajt))
                        MyCharacter = Convert.ToChar(bajt).ToString();//Encoding.ASCII.GetString(new[]{bajt});
                    else
                        MyCharacter = " ";

                    if (BufferIndex == 200)
                        {
                            int a = BufferIndex;
                        }

                    
                    if (BufferIndex < 200)
                    {
                        sw.WriteLine("PrintBuffer1[" + BufferIndex + "] :=\t" + bajt + "\t; // " + String.Format(@"0x{0:x2}", (ushort)bajt) + "\t" + MyCharacter );
                    }

                    if (BufferIndex >= 200 && BufferIndex  < 400)
                    {
                        BufferIndex = BufferIndex - 200;
                        sw.WriteLine("PrintBuffer2[" + BufferIndex + "] :=" + bajt + "; // " + String.Format(@"0x{0:x2}", (ushort)bajt) + "   " + MyCharacter);
                    }
                    if (BufferIndex >= 400 && BufferIndex < 600)
                    {
                        BufferIndex = BufferIndex - 400;
                        sw.WriteLine("PrintBuffer3[" + BufferIndex + "] :=" + bajt + "; // " + String.Format(@"0x{0:x2}", (ushort)bajt) + "   " + MyCharacter);
                    }
                    if (BufferIndex >= 600 && BufferIndex < 800)
                    {
                        BufferIndex = BufferIndex - 600;
                        sw.WriteLine("PrintBuffer4[" + BufferIndex + "] :=" + bajt + "; // " + String.Format(@"0x{0:x2}", (ushort)bajt) + "   " + MyCharacter);
                    }
                    if (BufferIndex >= 800 && BufferIndex < 1000)
                    {
                        BufferIndex = BufferIndex - 800;
                        sw.WriteLine("PrintBuffer5[" + BufferIndex + "] :=" + bajt + "; // " + String.Format(@"0x{0:x2}", (ushort)bajt) + "   " + MyCharacter);
                    }
                    if (BufferIndex >= 1000 && BufferIndex < 1200)
                    {
                        BufferIndex = BufferIndex - 1000;
                        sw.WriteLine("PrintBuffer6[" + BufferIndex + "] :=" + bajt + "; // " + String.Format(@"0x{0:x2}", (ushort)bajt) + "   " + MyCharacter);
                    }
                    if (BufferIndex >= 1200 && BufferIndex < 1400)
                    {
	                        BufferIndex = BufferIndex - 1200;
                        sw.WriteLine("PrintBuffer7[" + BufferIndex + "] :=" + bajt + "; // " + String.Format(@"0x{0:x2}", (ushort)bajt) + "   " + MyCharacter);
                    }
                    if (BufferIndex >= 1400 && BufferIndex < 1600)
                    {
                        BufferIndex = BufferIndex - 1400;
                        sw.WriteLine("PrintBuffer8[" + BufferIndex + "] :=" + bajt + "; // " + String.Format(@"0x{0:x2}", (ushort)bajt) + "   " + MyCharacter);
                    }
                    if (BufferIndex >= 1600 && BufferIndex < 1800)
                    {
                        BufferIndex = BufferIndex - 1600;
                        sw.WriteLine("PrintBuffer9[" + BufferIndex + "] :=" + bajt + "; // " + String.Format(@"0x{0:x2}", (ushort)bajt) + "   " + MyCharacter);
                    }
                    if (BufferIndex >= 1800 && BufferIndex < 2000)
                    {
                        BufferIndex = BufferIndex - 1800;
                        sw.WriteLine("PrintBuffer10[" + BufferIndex + "] :=" + bajt + "; // " + String.Format(@"0x{0:x2}", (ushort)bajt) + "   " + MyCharacter);
                    }
                    if (BufferIndex >= 2000 && BufferIndex < 2200)
                    {
                        BufferIndex = BufferIndex - 2000;
                        sw.WriteLine("PrintBuffer11[" + BufferIndex + "] :=" + bajt + "; // " + String.Format(@"0x{0:x2}", (ushort)bajt) + "   " + MyCharacter);
                    }
                    if (BufferIndex >= 2200 && BufferIndex < 2400)
                    {
                        BufferIndex = BufferIndex - 2200;
                        sw.WriteLine("PrintBuffer12[" + BufferIndex + "] :=" + bajt + "; // " + String.Format(@"0x{0:x2}", (ushort)bajt) + "   " + MyCharacter);
                    }

                        
                }

don't repeat yourself.. whyy we don't have PrintBufeer[i] ?

By Anonymous, 2016-02-08 09:52:40
import cv2
import numpy as np

cap = cv2.VideoCapture(0)

while (1):

    _, frame = cap.read()

    hsv = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV)

    lower_green = np.array([40, 50, 50])
    upper_green = np.array([80, 102, 200])

    # Threshold the HSV image to get only green colors
    mask = cv2.inRange(hsv, lower_green, upper_green)

    total_pixels = mask.shape[0] * mask.shape[1]
    print "Number of pixels: %", total_pixels

    pixel_counter = 0
    x_counter = 0
    y_counter = 0
    for y in xrange(640):
        for x in xrange(480):
            pixel = mask[x, y]
            if pixel == 255:
                pixel_counter += 1
                x_counter += x
                y_counter += y
    x_center = x_counter / pixel_counter
    y_center = y_counter / pixel_counter
    print x_center, y_center

    cv2.line(frame, (x_center+15, y_center), (x_center+2, y_center), (235, 218, 100), 1)
    cv2.line(frame, (x_center-15, y_center), (x_center-2, y_center), (235, 218, 100), 1)
    cv2.line(frame, (x_center, y_center+15), (x_center, y_center+2), (235, 218, 100), 1)
    cv2.line(frame, (x_center, y_center-15), (x_center, y_center-2), (235, 218, 100), 1)

    cv2.circle(frame, (x_center, y_center), 4, (235, 218, 100), 2)

    cv2.imshow('frame', frame)

    k = cv2.waitKey(5) & 0xFF
    if k == 27:
        break

cv2.destroyAllWindows()

track the green color

By Vik.victory, 2017-06-23 19:11:14
local part = script.Parent

local OriginColor = Color3.new(0,170,255)

local KillColor = Color3.new(1, 0, 0)

part.Touched:Connect(function(H)
	local humanoid = H.Parent:FindFirstChild("Humanoid")
	if humanoid and part.Color == KillColor then
		humanoid.Health = 0

	end

end)

local shit = 1
repeat

	part.Color = OriginColor
	wait(1.5) 
	part.Color = KillColor
	wait(1.5)



until shit == 2
By petierko, 2021-06-23 19:02:54
String s = "string";

String.valueOf(s).toString();

// just to make sure it's a damn string
while(!s instanceof String) {
    String.valueOf(s).toString();
}
By Anonymous, 2021-01-23 17:11:10
function focused(evt, errors) {
	let form = evt.target

	const output = errors.map((error)=> {

		// Find first component with error on form and set focus to it

		let focusedInput = (Object.keys(error) == "phonebookId") ? Object.keys(error) :
			(Object.keys(error) == "phonebook_str") ? Object.keys(error) :
				(Object.keys(error) == "message") ? Object.keys(error) :
					(Object.keys(error) == "image") ? Object.keys(error) :
						(Object.keys(error) == "buttonLink") ? Object.keys(error) :
							(Object.keys(error) == "messageSms") ? Object.keys(error) : false
		return focusedInput.shift()
	})

	const selector = output.shift()
	form.querySelector('[id="' + selector + '"]').focus()

	return selector

Shitcode

By Anonymous, 2021-05-28 01:16:05

var move=0;
var kier=0;
var pic=0;
var rol=0;

var rol2=171;
var rol3=343;
var rol4=514;
var rol2_cel=171;
var rol3_cel=343;
var rol4_cel=514;

function onpic(p) {
  pic=p;
}

function offpic(p) {
  if( pic==p ) pic=0;
}

 function next() { if(move<40) move = 40; kier=0; }
 function prev() { if(move<40) move = 60; kier=1; }
 function set() {
  document.getElementById('ba1').style.left=0;
  document.getElementById('ba2').style.left=rol2;
  document.getElementById('ba3').style.left=rol3;
  document.getElementById('ba4').style.left=rol4;
}


function SetOpacity(object,opacityPct)
{
  // IE.
  object.style.filter = 'alpha(opacity=' + opacityPct + ')';
  // Old mozilla and firefox
  object.style.MozOpacity = opacityPct/100;
  // Everything else.
  object.style.opacity = opacityPct/100;
}


var randtim=new Array(110,103,130,125,108,118,112,122,101,100);
var showtimer=0;
var showpic=1;

 
 function Animuj() {
   if( pic==0 ) {
     rol2_cel=171;
     rol3_cel=343;
     rol4_cel=514;
   } else if( pic==1 ) {
     rol2_cel=342;
     rol3_cel=457;
     rol4_cel=571;
   } else if( pic==2 ) {
     rol2_cel=115;
     rol3_cel=457;
     rol4_cel=571;
   } else if( pic==3 ) {
     rol2_cel=114;
     rol3_cel=229;
     rol4_cel=571;
   } else if( pic==4 ) {
     rol2_cel=114;
     rol3_cel=228;
     rol4_cel=344;
   }
   var a = (rol2-rol2_cel)/10; if(( a< -0.1 )&&( a> -1 )) a = -1; if(( a>0.1 )&&( a<1 )) a = 1;
   if( rol2!=rol2_cel ) rol2-= a;
   var a = (rol3-rol3_cel)/10; if(( a< -0.1 )&&( a> -1 )) a = -1; if(( a>0.1 )&&( a<1 )) a = 1;
   if( rol3!=rol3_cel ) rol3-= a;
   var a = (rol4-rol4_cel)/10; if(( a< -0.1 )&&( a> -1 )) a = -1; if(( a>0.1 )&&( a<1 )) a = 1;
   if( rol4!=rol4_cel ) rol4-= a;
   set();
    document.getElementById('ba2').style.left=rol2;



 showtimer+=1;
 if(showtimer>100) {
  for( st=0; st<9; ++st ) {
   if(showtimer==randtim[st]) { SetOpacity(document.getElementById("ps"+st), 0); document.getElementById("ps"+st).style.backgroundImage="url('cs/log"+showpic+".jpg')"; }
   if(showtimer==(randtim[st]+1)) SetOpacity(document.getElementById("ps"+st),20); 
   if(showtimer==(randtim[st]+2)) SetOpacity(document.getElementById("ps"+st),40); 
   if(showtimer==(randtim[st]+3)) SetOpacity(document.getElementById("ps"+st),60); 
   if(showtimer==(randtim[st]+4)) SetOpacity(document.getElementById("ps"+st),80); 
   if(showtimer==(randtim[st]+5)) { document.getElementById("pn"+st).style.backgroundImage="url('cs/log"+showpic+".jpg')"; SetOpacity(document.getElementById("ps"+st),0); }
  }
  if(showtimer>150) {
   showtimer=0;
   for( st=0; st<9; ++st ) randtim[st]=Math.floor(Math.random()*26)+100;
   showpic+=1; if(showpic>2) showpic=0;
  }
 }


 }

 window.setInterval("Animuj()", 50);

This is how public money is spent in poland

By Anonymous, 2019-05-29 18:35:09
if(date.getFullYear() <= 2017) {
    if(date.getMonth() <= 11) {
        if(date.getDate() <= 26) {
            if(date.getHours() <= 23) {
                if(date.getMinutes() <= 59) {
                    if(date.getSeconds() <= 59) {
                        //Display popup before 2017-11-27
                    }
                }
            }
        }
    }
}

    
By Anonymous, 2017-12-12 14:14:55
spring.datasource.password=#{@secretsManager.getJsonField('${DSP_DB_SECRET:}', 'password', @secretsManager.getString('${DSP_DB_PASSWORD_SECRET:}', '${DSP_DB_PASSWORD:}'))}

String boot, 3 env variables written as string containing code executable code which cannot be verified by compiler. Welcome to Java

By 7bits, 2022-02-01 19:17:55
apps_to_be_deployed = apps_to_be_deployed.strip()
if apps_to_be_deployed.endswith(":"):
    apps_to_be_deployed_length = len(apps_to_be_deployed)
    apps_to_be_deployed_list = list(apps_to_be_deployed)
    apps_to_be_deployed_list[apps_to_be_deployed_length - 1] = ''
    apps_to_be_deployed = "".join(apps_to_be_deployed_list)
By jlo, 2019-09-14 01:16:59

function atoi(charstring)
{
  if(charstring=="a") return 0x61;if(charstring=="b") return 0x62;
  if(charstring=="c") return 0x63;if(charstring=="d") return 0x64;
  if(charstring=="e") return 0x65;if(charstring=="f") return 0x66;
  if(charstring=="g") return 0x67;if(charstring=="h") return 0x68;
  if(charstring=="i") return 0x69;if(charstring=="j") return 0x6a;
  if(charstring=="k") return 0x6b;if(charstring=="l") return 0x6c;
  if(charstring=="m") return 0x6d;if(charstring=="n") return 0x6e;
  if(charstring=="o") return 0x6f;if(charstring=="p") return 0x70;
  if(charstring=="q") return 0x71;if(charstring=="r") return 0x72;
  if(charstring=="s") return 0x73;if(charstring=="t") return 0x74;
  if(charstring=="u") return 0x75;if(charstring=="v") return 0x76;
  if(charstring=="w") return 0x77;if(charstring=="x") return 0x78;
  if(charstring=="y") return 0x79;if(charstring=="z") return 0x7a;
  if(charstring=="0") return 0x30;if(charstring=="1") return 0x31;
  if(charstring=="2") return 0x32;if(charstring=="3") return 0x33;
  if(charstring=="4") return 0x34;if(charstring=="5") return 0x35;
  if(charstring=="6") return 0x36;if(charstring=="7") return 0x37;
  if(charstring=="8") return 0x38;if(charstring=="9") return 0x39;
  if(charstring==".") return 0x2e;
  return 0x20;
}

found in a proxy script

By Anonymous, 2020-08-10 03:17:52
// check if user is valid or not
ValidUserValidationResult userValidationResult = validUserValidator.validateUser(validationRequest);
By Anonymous, 2020-12-09 17:45:18
#define private public
#define protected public
#define class struct

#include "your_private_parts.hpp"
// ...

#undef class
#undef protected
#undef private

// ...

Fails miserably if template <class>, template <template <class> class> or their variations are found anywhere inside your header. :(

By 2 + 2 = 3.99999999999999999999999999999999999, 2021-11-08 07:59:05
def possibilities():
    alphabets=(n,o,r,t,h,e,a,s,u,w,m,y)
    combinations=list()
    for n in range(9,-1,-1):
            for o in range(9,-1,-1):
                    for r in range(9,-1,-1):
                            for t in range(9,-1,-1):
                                    for h in range(9,-1,-1):
                                            for e in range(9,-1,-1):
                                                    for a in range(9,-1,-1):
                                                            for s in range(9,-1,-1):
                                                                    for u in range(9,-1,-1):
                                                                            for w in range(9,-1,-1):
                                                                                    for m in range(9,-1,-1):
                                                                                            for y in range(9,-1,-1):
                                                                                                    if len(set([n,o,r,t,h,e,a,s,u,w,m,y]))==12:
                                                                                                    north=10000*n + 1000*o +100*r +10*t +h
                                                                                                    east=1000*e +100*a +10*s +t
                                                                                                    south=10000*s + 1000*o +100*u +10*t +h
                                                                                                    west=1000*w + 100*e +10*s +t
                                                                                                    earth= 10000*e + 1000*a + 100*r +10*t +h
                                                                                                    if north +east +south +west == earth:
                                                                                                            combinations.append((north,east,south,west,earth))

    return combinations
By Dusk Code, 2018-04-25 11:47:49
if(computedDate != null){
    myObject.setDueDate(computedDate);
}
else{
    myObject.setDueDate(null);
}
By Anonymous, 2018-02-22 04:46:08