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)
}
let length str =
let len = String.length str in
let rec length_helper str curr =
if str = "" then 0 else 1 + length_helper (String.sub str 1 (len - curr - 1)) (curr + 1)
in length_helper str 0;;
We use this code internally at Google. JFC.
div.body:first-child:nth-last-child(n+12),
div.body:first-child:nth-last-child(n+12) ~ div.body {
padding: 3px 5px 2px !important;
div.rect {
top: 6px !important;
}
div.legend-action {
top: 3px !important;
}
}
<style type="text/css">
<?php echo file_get_contents(
\realpath(ROOT_PATH . '/public/').$this->assetPath('css/styles.css', true)
); ?>
</style>
Including style file (about 100kb) directly to HTML page. Thanks for developer, it's in
.// this.collectPairs() returns data from the UI form
// this.alert.alarmReasons contains empty array or alarmReason-Category pair objects
let newAlarmReasonsToAdd = []
this.collectPairs().forEach(categoryAndAlarmReasonPair => {
!!!this.searchAmidExisting(categoryAndAlarmReasonPair, this.alert.alarmReasons) ? newAlarmReasonsToAdd.push(categoryAndAlarmReasonPair) : null
})
searchAmidExisting(alarmReasonToAdd, existingAlarmReasons){
let res = existingAlarmReasons.find(existing => {
if(alarmReasonToAdd.categoryDictEntryKey === existing.category && alarmReasonToAdd.reasonDictEntryKey === existing.reason){
return true
} else return false
})
return res
}
#define omae
#define wa (void)0
#define mou (void)0
#define shinderu ;
#define nani (void)
#define return 0; return
int main(void) {
omae wa, mou shinderu
nani!
return 0;
}
private readonly FooType _foo = new FooType();
/// <summary>
/// Gets the controller of this component
/// </summary>
private FooType Foo
{
get
{
return _foo;
}
}
export const LandingReducer=createSlice({
name:'MAIN_SLICE',
initialState:initialStates,
reducers: {
changeStateValue:(state,action) => {
state[action.payload.name] = action.payload.value
const check = action.payload.name.includes('.')
if (!check) {
state[action.payload.name] = action.payload.value
}else{
const groups=action.payload.name.split('.')
console.log(groups);
if(groups.length===2){
state[groups[0]][groups[1]]=action.payload.value;
}else if(groups.length===3){
state[groups[0]][groups[1]][groups[2]]=action.payload.value;
}else if(groups.length===4){
state[groups[0]][groups[1]][groups[2]][groups[3]]=action.payload.value;
}
}
}
}
});
def get_first_index_of_array(array):
"""
this function is very usefull for get first index of array
"""
return array[0]
assert get_first_index_of_array([1, 2, 3, 4, 5]) == 1
assert get_first_index_of_array([1, 2, 3, 4, 5]) != 2
assert get_first_index_of_array([1, 2, 3, 4, 5]) != 3
assert get_first_index_of_array([1, 2, 3, 4, 5]) != 4
assert get_first_index_of_array([1, 2, 3, 4, 5]) != 4
// Check if marked for deletion and run finalizers
if k8sutil.IsMarkedForDeletion(instance.ObjectMeta) {
return r.checkFinalizers(ctx, log, instance)
}
//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(",", ".");
set_locations(locations){
return new Promise((resolve, reject) => {
this.locations = locations;
resolve();
});
}
boolean isUserAuthorized = user.isSuperAdmin();
if (!isUserAuthorized) {
isUserAuthorized = isUserAdminOfEntity1();
}
if (!isUserAuthorized) {
isUserAuthorized = isUserAdminOfEntity2();
}
if (!isUserAuthorized) {
throw new AccessDeniedException("Authenticated user is not admin ");
}
// var array = retrieveArrayValue();
var filteredArray = array.filter(function (element, index, array) {
return array.indexOf(element) == index;
});
// processArray(filteredArray);