double func_atof(char *p){
	double	 integer = 0.0, div = 1.0 , fract = 0.0 , sign = 1.0;
   if(   *p == 45  ){sign = -1.0, *p++ ; }
	while ( isdigit(*p)  ) { 
		integer = ( *p++ )  +  (10.0   *   integer)  -  48.0 ; 
		}
	if(*p == 46  ){
	(*p++ ) ;
	while (  isdigit(*p) )  {
		fract = ( *p++ )  +  (10.0   *   fract)  -  48.0  ; 
		div *= 10;		
		}
    }
  return    (integer  +   fract  / div )  * sign    ;
}
By Lazy_8, 2020-01-13 16:53:53
for (InformacionPagareServiceDTO aux : res_pon.getListaRespuesta()) {
			String pattern_dic = "{\"Estdo\":\"%s\", \"Fecha Firma\":\"%s\", \"Fecha Grabacion\": \"%s\", \"ID Pagare\": \"%s\",\"Nombre Otorgante\": \"%s\",\"Tipo documento Otorgante\": \"%s\",\"Documento Otorgante\": \"%s\",\"Numero Pagare Entidad\": \"%s\",\"Pdf Pagare Nom\": \"%s\",\"Pdf Pagare Cont\": \"%s\"}";
			if (aux.getPdfPagare() == null) {
				if(dic_txt.equals("")) {
					dic_txt = String.format(pattern_dic, aux.getEstadoPagare(), aux.getFechaFirmaPagare(), aux.getFechaGrabacionPagare(), aux.getIdPagareDeceval(), aux.getNombreOtorgante(), aux.getTipoDocumentoOtorgante(), aux.getNumeroDocumentoOtorgante(), aux.getNumPagareEntidad(), aux.getPdfPagare(), aux.getPdfPagare());
				}else {
					dic_txt += ","+String.format(pattern_dic, aux.getEstadoPagare(), aux.getFechaFirmaPagare(), aux.getFechaGrabacionPagare(), aux.getIdPagareDeceval(), aux.getNombreOtorgante(), aux.getTipoDocumentoOtorgante(), aux.getNumeroDocumentoOtorgante(), aux.getNumPagareEntidad(), aux.getPdfPagare(), aux.getPdfPagare());
				}
			}else {
				if(dic_txt.equals("")) {
					dic_txt = String.format(pattern_dic, aux.getEstadoPagare(), aux.getFechaFirmaPagare(), aux.getFechaGrabacionPagare(), aux.getIdPagareDeceval(), aux.getNombreOtorgante(), aux.getTipoDocumentoOtorgante(), aux.getNumeroDocumentoOtorgante(), aux.getNumPagareEntidad(), aux.getPdfPagare().getNombreArchivo(), aux.getPdfPagare().getContenido());
				}else {
					dic_txt += ","+String.format(pattern_dic, aux.getEstadoPagare(), aux.getFechaFirmaPagare(), aux.getFechaGrabacionPagare(), aux.getIdPagareDeceval(), aux.getNombreOtorgante(), aux.getTipoDocumentoOtorgante(), aux.getNumeroDocumentoOtorgante(), aux.getNumPagareEntidad(), aux.getPdfPagare().getNombreArchivo(), aux.getPdfPagare().getContenido());
				}
			}
		}

Holy Shit

By rootweiller, 2020-01-15 03:47:22
def sho_est(request):
    if not request.user.is_superuser and not request.user.is_staff and not request.user.is_university:
        raise Http404
    data = ''
    if request.content_type == 'application/x-www-form-urlencoded' and request.method == 'POST':
        user_detail = request.POST.get('user_detail', None)
        if user_detail:
            if request.user.is_superuser or request.user.is_staff:
                credito = Credit.objects.get(pk=user_detail)
                fecha_apronacion = 'Pendiente'
                estado_firma = 'Pendiente'
                estado_cuota = 'Pendiente'
                if credito.created_at:
                    fecha_apronacion = credito.created_at.strftime('%Y-%m-%d')
                if credito.is_iou_signed:
                    estado_firma = 'Firmado'
                if credito.is_retainer_paid:
                    estado_cuota = 'Paga'
                reg_amr_due = """
                <tr style="border: 1px solid black; padding: 5px;">
                    <td style="border: 1px solid black; padding: 5px; text-align: right;">{period}</td>
                    <td style="border: 1px solid black; padding: 5px; text-align: right;">{due_amount}</td>
                    <td style="border: 1px solid black; padding: 5px; text-align: right;">{due_loan_amount}</td>
                    <td style="border: 1px solid black; padding: 5px; text-align: right;">
                    {due_tech_amount_due_surety_amount_due}</td>
                    <td style="border: 1px solid black; padding: 5px; text-align: right;">{due_interest_amount}</td>
                    <td style="border: 1px solid black; padding: 5px; text-align: right;">
                    {due_fines_arrears_amount_due_interest_arrears_amount}</td>
                    <td style="border: 1px solid black; padding: 5px; text-align: left;">{days_in_arrears}</td>
                    <td style="border: 1px solid black; padding: 5px; text-align: left;">{fullfilment_date}</td>
                    <td style="border: 1px solid black; padding: 5px; text-align: left;">{status}</td>
                  </tr>
                  """
                str_amr_due = ""
                dic_ver = {}

Fuck Yeah

By rootweiller, 2020-01-15 04:09:48
var doc = (Parent as Doc);
doc.Name = (doc != null) ? "" : doc.Name
By MSx, 2020-01-16 12:39:39
  $(".alarmBell").on("click", () => {

    let icon = $(".alarm-bell__icon")
    icon.attr('data', icon.attr('data') == 'images/icon/alarm-bell.svg' ? 'images/icon/alarm-bell-filled-new.svg' : 'images/icon/alarm-bell.svg');

    // $(".alarm-bell__icon").attr('data', function (index, data) {
    //   if (data == 'images/icon/alarm-bell-filled-new.svg') {
    //     return 'images/icon/alarm-bell.svg';
    //   } else if (data == 'images/icon/alarm-bell.svg') {
    //     return 'images/icon/alarm-bell-filled-new.svg';
    //   } else {
    //     return 'images/icon/alarm-bell.svg';
    //   }
    // });

  });

...after yet another icons change request

By Desperate Dev..., 2020-01-21 17:28:18
    public function update($oldVersion) {
        switch ($oldVersion) {
            case '1.0.0':
            case '1.0.1':
                break;
            default:
                return false;
        }
        return true;
    }

Found in a Shopware Plugin

By Procinger, 2020-02-14 14:08:36
#557 C++ +104
int getChar(char charachter){
 int returnValue = Z;
 switch(charachter){
  case 'A': returnValue = A; break;
  case 'a': returnValue = A; break;
  case 'B': returnValue = B; break;
  case 'b': returnValue = B; break;
  case 'C': returnValue = C; break;
  case 'c': returnValue = C; break;
  case 'D': returnValue = D; break;
  case 'd': returnValue = D; break;
  case 'E': returnValue = E; break;
  case 'e': returnValue = E; break;
  case 'F': returnValue = F; break;
  case 'f': returnValue = F; break;
  case 'G': returnValue = G; break;
  case 'g': returnValue = G; break;
  case 'H': returnValue = H; break;
  case 'h': returnValue = H; break;
  case 'I': returnValue = I; break;
  case 'i': returnValue = I; break;
  case 'J': returnValue = J; break;
  case 'j': returnValue = J; break;
  case 'K': returnValue = K; break;
  case 'k': returnValue = K; break;
  case 'L': returnValue = L; break;
  case 'l': returnValue = L; break;
  case 'M': returnValue = M; break;
  case 'm': returnValue = M; break;
  case 'N': returnValue = N; break;
  case 'n': returnValue = N; break;
  case 'O': returnValue = O; break;
  case 'o': returnValue = O; break;
  case 'P': returnValue = P; break;
  case 'p': returnValue = P; break;
  case 'Q': returnValue = Q; break;
  case 'q': returnValue = Q; break;
  case 'R': returnValue = R; break;
  case 'r': returnValue = R; break;
  case 'S': returnValue = S; break;
  case 's': returnValue = S; break;
  case 'T': returnValue = T; break;
  case 't': returnValue = T; break;
  case 'U': returnValue = U; break;
  case 'u': returnValue = U; break;
  case 'V': returnValue = V; break;
  case 'v': returnValue = V; break;
  case 'W': returnValue = W; break;
  case 'w': returnValue = W; break;
  case 'X': returnValue = X; break;
  case 'x': returnValue = X; break;
  case 'Y': returnValue = Y; break;
  case 'y': returnValue = Y; break;
  case 'Z': returnValue = Z; break;
  case 'z': returnValue = Z; break;
  case ' ': returnValue = _; break;
  case '3': returnValue = B2; break;
  case '<': returnValue = TEMP; break;
  case '*': returnValue = FULL; break;
  case '|': returnValue = LINE; break;  
  case '_': returnValue = _; break;  
  case ':': returnValue = COL; break;  
  case '-': returnValue = DASH; break;  
  case ')': returnValue = BRA2; break;  
  case '%': returnValue = SMILE; break;  
  case '.': returnValue = DOT; break;    
  case '^': returnValue = COLDOT; break;      
  }
  return returnValue; //RETORNO DE INFORMAÇÃO
}

found on brazillian website

By Anonymous, 2020-02-15 00:18:29
#include <stdio.h>
#include<stdlib.h>
#include<time.h>

void randy(int array[] ){
int i = 0  , d = 0;
		for(i = 1 ; i <= 23 ; i++){
			
			array[i] =  1 + (rand() % 365 ); 
		}
	}

int compare (const void * a, const void * b)
{
return ( *(int*)a - *(int*)b );
}



int find (int arr[]){
 int d = 0;
 	
 	for(d = 1  ;d <=23 ; d++ ){
 		
		 if(arr[d] == 	 arr[d + 1]){
		 	return 1;
		 }
	 }
	
	return 0;
}

int main(void){
	 double count_birthday = 0;
	int  people[24];
  
	srand(time(NULL));
	
	int c = 0 ;
	long double ip = 0;
	
	
	
	while(ip++ <= 1000000 ){
		

		randy(people);
		qsort (people, 25, sizeof(int), compare);
		if(find (people) == 1 ){
			count_birthday++;
		}

	}

printf("%.2lf", 	count_birthday  / 10000  );
return 0;
}
By lazy_8, 2020-03-04 13:14:05
/// <summary> 
/// Desctop constructor
/// </summary>
...

This is best XML commentary I found so far.

By Anonymous, 2020-03-11 17:55:37
@register.filter
def rangocinco(obj_id, limit):
    if (obj_id+5) > limit:
        if not (limit-4) == obj_id:
            # print((limit-4), obj_id, flush=True)
            return range((limit-4), (limit+1))
        else:
            # print('SI NO', flush=True)
            return range((obj_id-2), (obj_id+3))
    else:
        # print('NO', flush=True)
        if (obj_id-4) < 2:
            # print('NO SI', flush=True)
            return range(obj_id, (obj_id+5))
        else:
            # print('NO NO', flush=True)
            return range((obj_id-4), (obj_id+1))

Fuck

By rootweiller, 2020-03-11 21:17:16
local Plr = game.Players.LocalPlayer

for i,v in pairs(game.ReplicatedStorage.DataStorage[Plr.Name].Data["Slot1"].AccessoriesList:GetChildren()) do
v.Value = "Unlocked"
end
for i,v in pairs(game.ReplicatedStorage.DataStorage[Plr.Name].Data["Slot1"].StanceList:GetChildren()) do
v.Value = "Unlocked"
end
for i,v in pairs(game.ReplicatedStorage.DataStorage[Plr.Name].Data["Slot1"].RunningList:GetChildren()) do
v.Value = "Unlocked"
end
for i,v in pairs(game.ReplicatedStorage.DataStorage[Plr.Name].Data["Slot1"].FlyingList:GetChildren()) do
v.Value = "Unlocked"
end
for i,v in pairs(game.ReplicatedStorage.DataStorage[Plr.Name].Data["Slot1"].FightingStyles:GetChildren()) do
v.Value = "Unlocked"
end
for i,v in pairs(game.ReplicatedStorage.DataStorage[Plr.Name].Data["Slot1"].MoveList:GetChildren()) do
v.Value = "Unlocked"
end
for i,v in pairs(game.ReplicatedStorage.DataStorage[Plr.Name].Data["Slot1"].ClothingList:GetChildren()) do
v.Value = "Unlocked"
end

Bad unlock script for Roblox

By JayRain, 2020-03-14 03:01:24
$orderDateTS = strtotime($data['ordertime']);
$nowTS = strtotime('now');
$diff = $nowTS - $orderDateTS;
$diff = $diff / 86400;
$dayDiff = floor($diff);

found in a shopware plugin

By Anon, 2020-04-03 14:16:07
$MaxSizeGB = [math]::Round($MaxSize/1024/1024/1024,2)
Write-Output "    the maximum size is $MaxSizeGB GB"

At least [math] is used. So close, and yet so far...

By Anonymous, 2020-04-03 20:59:34
  ierr = pxmlIn->GetData(pcTag, *pTData);
  *pbDataValid = bool((ierr==0)&&(iLen>0));  // enabled if: not empty string and vaild (number?)
  if (*pbDataValid)  iErr += ierr;
By Anonymous, 2020-04-07 14:44:12
#997 Java +17
final int two_fifty_five_hex = 0xFF
final int two_fifty_five_dec = 255

One is in hex but the other is in decimal! Watch out, make sure you use the correct 255, not the other 255.

By Anonymous, 2020-04-28 14:52:27