#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
#557 C++ +100
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
    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
  $(".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
var doc = (Parent as Doc);
doc.Name = (doc != null) ? "" : doc.Name
By MSx, 2020-01-16 12:39:39
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
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
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
if ($getCount) {
    foreach ($all_items as $item) {
        $item_arr[$item->id] = 0;
    }
    
    return count($item_arr);
}
By Anonymous, 2020-01-08 22:15:04
	// Check if marked for deletion and run finalizers
	if k8sutil.IsMarkedForDeletion(instance.ObjectMeta) {
		return r.checkFinalizers(ctx, log, instance)
	}
By Anonymous, 2019-12-31 15:25:32
final boolean True = true;   
final boolean False = false;
//why

:v

By Memz, 2019-12-31 03:25:05
        if "[trait]" in lines[i]:
            in_trait = True
        elif "[/trait]" in lines[i]:
            in_trait = False
        elif "[object]" in lines[i]:
            in_object = True
        elif "[/object]" in lines[i]:
            in_object = False
        elif "[stage]" in lines[i]:
            in_stage = True
        elif "[/stage]" in lines[i]:
            in_stage = False
        elif "[cfg]" in lines[i]:
            in_cfg = True
        elif "[/cfg]" in lines[i]:
            in_cfg = False
        elif "[goal]" in lines[i]:
            in_goal = True
        elif "[/goal]" in lines[i]:
            in_goal = False
#... 150 more lines of this

Basically, linting a config file with a DOM tree, using Python

By Anonymous, 2019-12-28 23:35:11
bool	vlNoExitIfZeroBytesReceived = false; //		false: can exit when receive 0 later; 	1: can not exit when receive 0 later;
By BrokenBrain, 2019-12-23 15:23:19
function returnTrue() {
    return true;
}
By Anonymous, 2019-12-19 19:41:56
public class MetricsChecker
{
    protected const string AwaitingRecognitionCountMetricName = "AwaitingRecognitionCount";
    protected const string AwaitingExportCountMetricName = "AwaitingExportCount";
    protected const string NotYetDownloadedEventCountMetricName = "NotYetDownloadedEventCount";
    
    ...
    
    public virtual void PublishNotYetDownloadedEventCounts()
    {
        this.logger.Trace($"Starting to gather and publish {NotYetDownloadedEventCountMetricName}(s).");
        ...
    }
    
    ...
}
By Senior developer with 30 rear experience, 2019-12-13 16:22:28