ngOnInit() {
this._FunctionService.getSicksList().then(res => {
let resf:any = res;
if (resf.err) {
} else {
this.diagnosticAll = resf.data
}
}, err => { })
}
/*
ngOnInit() {
this._FunctionService.getSicksList().then(res => {
this.diagnosticAll = res.data
}, err => { })
}
*/
<?php
if(!defined('WPINC')) // MUST have WordPress.
exit ('Do not access this file directly.');
if(!class_exists('pluginName_options_page_class'))
{
/**
* Menu page blah
*
* @package blah
* @since 140617
*/
class pluginName_options_page_class
{
public function __construct()
{
echo '<div class="wrap menu-page">'."\n";
echo '<div class="wp-header-end"></div>'."\n";
echo '<div class="menu-page-toolbox">'."\n";
pluginName_some_other_class::display();
echo '</div>'."\n";
echo '<h2>Options</h2>'."\n";
echo '<table class="menu-page-table">'."\n";
echo '<tbody class="menu-page-table-tbody">'."\n";
echo '<tr class="menu-page-table-tr">'."\n";
echo '<td class="menu-page-table-l">'."\n";
echo '<form method="post" name="plugin_options_form" id="plugin--options-form" autocomplete="off">'."\n";
echo '<input type="hidden" name="plugin_options_save" id="plugin--options-save" value="'.esc_attr(wp_create_nonce('plugin--options-save')).'" />'."\n";
echo '<div class="menu-page-group" title="Account Details">'."\n";
/* includes things like this gem */
echo (!is_multisite() || !pluginName_utils_conds::is_multisite_farm() || is_main_site()) ? '<p>[ Really Long message about something ]</p>'."\n" : '';
/* ... continues until end ... */
echo '</div>'."\n";
}
}
}
new pluginName_options_page_class ();
The entire file is a single class with a constructor. The constructor is ~ 1150 lines of echo statements with a few PHP conditionals thrown in. There are no other methods. The class is instantiated as soon as it is defined. Clever...
j =0
import random
import hashlib
#geetting inputs
c = input("data ")
n= int(input("N(the count of last numbers)= "))
v= input(str(n)+" last char ")
#list of alphas
l1 = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'v', 'w', 'x', 'y', 'z', 'u']
l2 = ["A", 'B', 'C', 'D', 'E', 'F','G' , 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'V', 'W', 'X', 'Y', 'Z', 'U']
alphas= 0
#calc the count of alppphas
x=""
for j in c:
if(j in l1 or j in l2):
alphas +=1
#positions
h = 2**alphas
hs = []
cc =0
j=0
xf =0
# the stat of main coode
for j in range(h):
#making a sring with 1 and 0
while True:
x=""
for i in range(len(c)):
x+=str(random.randint(0,1))
if(not(x in hs)):
hs.append(x)
break
Xx =""
cc =0
#convert that to lower and upper
for j1 in x:
if(j1=="0"):
Xx+=c[cc].lower()
else:
Xx+=c[cc].upper()
cc+=1
#hash
m = hashlib.sha256()
m.update(Xx.encode('utf-8'))
h = m.hexdigest()
#if
if(h[0-n:]==v):
print("text :"+Xx)
print("hash :"+h)
xf = True
break
if xf==True:
break
j =0
#if that not possible to have git push -Desirable-hash by changed lower to upper and upper to lower
if(xf==0):
while 1:
j+=1
d = c+str(j)
m = hashlib.sha256()
m.update(d.encode('utf-8'))
h = m.hexdigest()
if(h[0-n:]==v):
print("text :"+d)
print("hash :"+h)
break
x = input("press enter to exit")0
this program take a string from you and give you a Desirable-hash by changing lower to upper and changing lower to upper if that possible
typedef NS_ENUM(NSUInteger, MyEnum1) {
PackagesNo1 = 1,
PackagesNo2 = 2,
PackagesNo4 = 4,
PackagesNo8 = 8
};
typedef NS_ENUM(NSUInteger, MyEnum2) {
LEVEL0 = 0,
LEVEL1 = 1,
LEVEL2 = 2,
LEVEL3 = 3
};
- (int)packagesNeededForLevel:(int)level {
switch (level) {
case LEVEL0:
return PackagesNo8;
case LEVEL1:
return PackagesNo4;
case LEVEL2:
return PackagesNo2;
case LEVEL3:
return PackagesNo1;
}
}
well done mr junior
var state = getCookie("state");
function checkCookie(args) {
if (state == args) {
return true;
} else {
alert("Request denied. Invalid auth code provided.");
return false;
}
}
const tokenElement = document.getElementsByName("dream");
var loginSrv = checkCookie(getAllUrlParams().state);
document.cookie = `state=${getAllUrlParams().state}; path=/`;
tokenElement.innerText = getAllUrlParams().code;
if (getAllUrlParams().state != loginSrv) {
alert(`Incorrect auth code provided. The correct code is ${state}`);
}
If they provide the wrong oauth state code, tell the user the correct one!
if(computedDate != null){
myObject.setDueDate(computedDate);
}
else{
myObject.setDueDate(null);
}
#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.
:(
$("#search-submit").click(function() {
$("#search form").submit()
});
type="submit"
is too mainstream, jquery is the proper way to do it
if yearOfBirth > 2002 {
fmt.Errorf("year of birth not allowed %d", yob)
return
}
string month = DateTime.Today.Month.ToString();
if (DateTime.Today.Month < 10)
{
month = "0" + month;
}
string day = DateTime.Today.Day.ToString();
if (DateTime.Today.Day < 10)
{
day = "0" + day;
}
string dateCorrect = String.Format("{0}.{1}.{2}", DateTime.Today.Year, month, day);
string dateDue = "";
if (transferFields.DueDate.SelectedDate.HasValue)
{
var dateDuearr = transferFields.DueDate.Value.Split(' ')[0].Split('.');
dateDue = dateDuearr[2] + '.' + dateDuearr[1] + '.' + dateDuearr[0];
}
else {
dateDue = dateCorrect;
}
Real developers don't use built in parsing and formatting methods.
from django.http import JsonResponse, HttpResponse
import requests
def download_custom_award(request):
try:
custom_img = requests.get(request.GET.get('award'))
response = HttpResponse(custom_img.content, content_type='application/PNG')
filename = "Your_Award.png"
response['Content-Disposition'] = 'attachment; filename=%s' % (filename)
return response
except Exception as e:
return JsonResponse({'Status': 404, "message": e.message})
This developer was trying to force the browser to download a custom image rather than show it inline, so he coded an open reverse proxy and attempted to release it to a production web app. Also, all exceptions are trapped and shown to the user in plaintext in their browser.
int true = 0;
while (true)
{
//do something
}
true = false
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
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
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