boolean isUserAuthorized = user.isSuperAdmin();
if (!isUserAuthorized) {
isUserAuthorized = isUserAdminOfEntity1();
}
if (!isUserAuthorized) {
isUserAuthorized = isUserAdminOfEntity2();
}
if (!isUserAuthorized) {
throw new AccessDeniedException("Authenticated user is not admin ");
}
def get_schema(self, schema: object) -> object:
"""Get the Schema class
"""
if isinstance(schema, str):
Schema = getattr(self.request["operation"], schema, None)
else:
Schema = schema
if Schema is None:
Schema = getattr(self, schema, None)
if Schema is None:
raise web.HTTPNotImplemented
return Schema
I don't even know what to say
isCreatedUser : !this.isEdit ? true : false
Vue.js project, someone wanted to verify if the user was being edited or created...
# Better off alone
use_bmp 137
live_loop :drumrolls do
sample : drum_splash_soft, rate: 0.775, finsh: 0.75, amp: 0.75
use_synth :pnosie
with_fx :1x1_techno, phase: 8, phase_offset: 0.4,cutoff_min: 79, cutoff
with_fx :fhpf, cutoff: 115, res: 0.8, reps: 18 do
play :E1, release: 0.125
sleep 0.25
end
end
sleep 47.5
with_fx :ixi_techno, phase: 29 res: 0.5 re
use_rx_synth :mod_dsaw
live_loop :wierd_synth do re mi
Do sleep 0.3 then sample :sn_dolf, :amp 0.2 start 0.1 next finish: 1.5 do
createPhoneNumber([0,1,2,3,4,5,6,7,8,9]);
function createPhoneNumber(numbers){
var string = "";
// Make sure to use all of the time you got granted. Never waste time which is entitled to you!!!!
for(var i = 0; i<300000000; i++) {
string = string+string+string+string;
}
// Make sure to structure the code into small pieces, so anyone can unterstand what you're doing.
// Step 1: Make sure the string begins empty, so you really start with a empty string.
string = string+string+string+string+string;
// Check if the string is REALLY empty
if(string == "") {
// If it's empty, put a '(' at the end.
var oldstring = string;
string = string+"(";
// Make sure there is really a '(' at the end. If not, repeat!
if(string == oldstring+"(") {
// If everything is fine, add the first number.
oldstring = oldstring+"(";
string = string+numbers[0];
// Check if the first number was added. If not, repeat!
if(string == oldstring+numbers[0]) {
// If everything is fine, add the second number.
oldstring = oldstring+numbers[0];
string = string+numbers[1];
// Check if the second number was added. If not, repeat!
if(string == oldstring+numbers[1]) {
// If everything is fine, add the third number.
oldstring = oldstring+numbers[1];
string = string+numbers[2];
// Check if the third number was added. If not, repeat!
if(string == oldstring+numbers[2]) {
// If everything is fine, add the ')'.
oldstring=oldstring+numbers[2];
string = string+")";
// Check if the ')' was added. If not, repeat!
if(string == oldstring+")") {
// If everything is fine, add the ' '.
oldstring=oldstring+")";
string = string+" ";
// Check if the ' ' was added. If not, repeat!
if(string == oldstring+" ") {
// If everything is fine, add the fourth number.
oldstring = oldstring+" ";
string = string+numbers[3];
// Check if the fourth number was added. If not, repeat!
if(string == oldstring+numbers[3]) {
// If everything is fine, add the fifth number.
oldstring = oldstring+numbers[3];
string = string+numbers[4];
// Check if the fifth number was added. If not, repeat!
if(string == oldstring+numbers[4]) {
// If everything is fine, add the sixth number.
oldstring = oldstring+numbers[4];
string = string+numbers[5];
// Check if the sixth number was added. If not, repeat!
if(string == oldstring+numbers[5]) {
// If everything is fine, add the "-".
oldstring = oldstring+numbers[5];
string = string+"-";
// Check if the "-" was added. If not, repeat!
if(string == oldstring+"-") {
// If everything is fine, add the seventh number.
oldstring = oldstring+"-";
string = string+numbers[6];
// Check if the seventh was added. If not, repeat!
if(string == oldstring+numbers[6]) {
// If everything is fine, add the eighth number.
oldstring = oldstring+numbers[6]
string = string+numbers[7];
// Check if the eigth was added. If not, repeat!
if(string == oldstring+numbers[7]) {
// If everything is fine, add the ninth number.
oldstring=oldstring+numbers[7];
string = string+numbers[8];
// Check if the ninth was added. If not, repeat!
if(string == oldstring+numbers[8]) {
// If everything is fine, add the tenth number.
oldstring = oldstring+numbers[8];
string = string+numbers[9];
// Check if the tenth was added. If not, repeat!
if(string == oldstring+numbers[9]) {
// If everything is fine, return the string!
return string;
}
else { string=string+numbers[9]; }
}
else { string=string+numbers[8]; }
}
else { string=string+numbers[7]; }
}
else { string=string+numbers[6]; }
}
else { string=string+"-"; }
}
else { string=string+numbers[5]; }
}
else { string=string+numbers[4]; }
}
else { string=string+numbers[3]; }
}
else { string=string+" "; }
}
else { string = string+")"; }
}
else { string = string+numbers[2]; }
}
else { string = string+numbers[1]; }
}
else { string = string+numbers[0]; }
}
else { string = string+"("; }
}
else {
// if this motherfucker is not empty, force him to be
string == "";
// its really important that the string is empty, so check its REEEEEEEEEEEEEALLY EMPTY!!!!!!!!!!!
for(var i = 0; i<700000000; i++) {
string = string+string+string+string;
}
}
}
Write a function that accepts an array of 10 integers (between 0 and 9), that returns a string of those numbers in the form of a phone number.
Example createPhoneNumber([1, 2, 3, 4, 5, 6, 7, 8, 9, 0]) // => returns "(123) 456-7890"
@define
class DedupConfig:
columns_to_dedup_by: Optional[List]
time_range_in_minutes: Optional[int]
timestamp_column_name: Optional[str]
leave_deduped_samples_in_time_range: Optional[int] = field(default=1)
def __attrs_post_init__(self):
if not self.timestamp_column_name:
raise ValueError(f"timestamp_column_name parameter must be provided")
if not self.columns_to_dedup_by:
raise ValueError(f"columns_to_dedup_by parameter must be provided")
if not self.time_range_in_minutes:
raise ValueError(f"time_range_in_minutes parameter must be provided")
# Weird list cleanup
product = "{0}".format(list(product))
product = re.sub(r"\), \(+", "], [", product)
product = re.sub(r"\(+", "[", product)
product = product.replace(")]", "]]").replace(")", "")
product = ast.literal_eval(product)
I don't know why I get this strange fomat for this array of objects... Ok let's do it fast: 1 - Convert array in string 2 - Clean up string 3 - Convert string in array
return [word for word in words if any(all(ch in row for ch in word.lower()) for row in rows)]
Filtering words that can be typed using only one row of the keyboard.
//read country intformation and assign to variables
cName = InpList.get(0).replace(",", ".");
cCode = InpList.get(1).replace(",", ".");
cAlpha2 = InpList.get(2).replace(",", ".");
cAbreviation = InpList.get(3).replace(",", ".");
dYear = InpList.get(4).replace(",", ".");
dPoliticalCompatibility = InpList.get(5).replace(",", ".");
dRankPoliticalCompatibility = InpList.get(6).replace(",", ".");
dEconomicCompatibility = InpList.get(7).replace(",", ".");
dRankEconomicCompatibility = InpList.get(8).replace(",", ".");
dMilitaryCompatibility = InpList.get(9).replace(",", ".");
dRankMilitaryCompatibility = InpList.get(10).replace(",", ".");
dDemoScore = InpList.get(11).replace(",", ".");
dRankDemoScore = InpList.get(12).replace(",", ".");
dEnvironmentalCompatibility = InpList.get(13).replace(",", ".");
dRankEnvironmentalCompatibility = InpList.get(14).replace(",", ".");
dSumCompatibility = InpList.get(15).replace(",", ".");
dRankCompatibility = InpList.get(16).replace(",", ".");
dPoliticalUtility = InpList.get(17).replace(",", ".");
dRankPoliticalUtility = InpList.get(18).replace(",", ".");
dEconomicUtility = InpList.get(19).replace(",", ".");
dRankEconomicUtility = InpList.get(20).replace(",", ".");
dMilitaryUtility = InpList.get(21).replace(",", ".");
dRankMilitaryUtility = InpList.get(22).replace(",", ".");
dEnvironmentalUtility = InpList.get(23).replace(",", ".");
dRankEnvironmentalUtility = InpList.get(24).replace(",", ".");
dSumUtility = InpList.get(25).replace(",", ".");
dRankUtility = InpList.get(26).replace(",", ".");
dPoliticalScore = InpList.get(27).replace(",", ".");
dRankPoliticalScore = InpList.get(28).replace(",", ".");
dEconomicScore = InpList.get(29).replace(",", ".");
dRankEconomicScore = InpList.get(30).replace(",", ".");
dMilitaryScore = InpList.get(31).replace(",", ".");
dRankMilitaryScore = InpList.get(32).replace(",", ".");
dEnvironmentalScore = InpList.get(33).replace(",", ".");
dRankEnvironmentalScore = InpList.get(34).replace(",", ".");
dAggregate = InpList.get(35).replace(",", ".");
dRankAggregate = InpList.get(36).replace(",", ".");
Select * from Order --doesn't work
select * from [order] --works
--it's planning module in our system...
I think, it's really bad idea to use reserved words in names of tables. I'm surprised, that this db doesn't contain table named like [select]...
foreach($bookings as $booking) {
$status = $apiController->getBookingStatus($booking);
if($status->error == 1) {
switch($status->message) {
case "FIND_PRV_KO": continue; //Wrong parameters
case "ERR_PREN_NOTFOUND": continue; //Request booking cannot be found
case "ERR_PRV_NOTFOUND": continue; //Check-in not carried out
default: continue;
};
continue;
}
//DO SOME STUFF...
}
Found this on a production website
namespace network
{
class ip
{
uint _IP;
public ushort this[int i]
{
get
{
switch(i)
{
case 0:
case 1:
case 2:
case 3:
return (ushort)(_IP>>(i*8));
default:
throw new IndexOutOfRangeException();
}
}
set
{
switch(i)
{
case 0:
case 1:
case 2:
case 3:
_IP=(((uint)value)<<i*8);
break;
default:
throw new IndexOutOfRangeException();
}
}
}
}
}
I have no idea what this does
public static Integer find(List<String> list, String name, int i) {
if(list.get(i).equals(name)) {
return i;
}
else return find(list, name, i+1)
}
latest_tag = "0.0.0"
for tag in tags:
if tag.name.startswith( 'v' ):
if tag.name.replace('v','').replace('.','') > latest_tag.replace('.',''):
latest_tag = tag.name.replace('v','')
Path path = FileSystems.getDefault().getPath("../../../../../../../../../../EmailResults.csv");
Files.deleteIfExists(path);