//////////////////////////////////////////
// Add ROI coordinates into Environment
//////////////////////////////////////////
AddROIcoordinatesIntoEnvironment();
It really helped me understand the code.
Path path = FileSystems.getDefault().getPath("../../../../../../../../../../EmailResults.csv");
Files.deleteIfExists(path);
abstract class ASong(
var songId: Int = 0,
var title: String? = "",
var clipArt: String? = "",
var artist: String? = "",
var source: String? = "",
var songType: Int = 0,
var length: String? = "",
var downloadPath: String? = "",
var category: String? = ""
) : Parcelable {
@Transient
var totalDuration: Long = 0
@Transient
var currentPosition: Long = 0
@Transient
var playingPercent = 0
private fun calculatePlayingPercent(): Int {
return if (currentPosition == 0L || totalDuration == 0L) 0 else (currentPosition * 100 / totalDuration).toInt()
}
}
© 2021 GitHub, Inc
Probably meant to stand for AbstractSong. Ens up sounding awkward or like somebody who just wrote their first class.
# 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
strcpy(szBuffer, sBuffer);
so many questions given you by Hungarian notation
if ($this->getTestSku()) {
...
} elseif ($this->getTestOffset() >= 0 && $this->getTestLimit() > 0) {
...
} else {
Mage::throwException(sprintf("Invalid parameters for test mode: sku %s or offset %s and limit %s", $this->getTestSku(), $this->getTestOffset(), $this->getTestLimit()));
}
<table class="table table-sm o_main_table" style="width='100%'">
<!-- ... thanks ...-->
</table>
Found that on a customer's project, wonder if my employee knows about inline css
def dow_to_dict_from_self(self):
# res = {'name': self.name, 'enabled': self.enabled }
res = {'sun': 0, 'mon': 0, 'tue': 0, 'wed': 0, 'thr': 0, 'fri': 0,
'sat': 0,
'enabled': 0, 'dow': 0, 'name': 'untitled'}
if (int(self.days_of_week) & 0x01) == 0x01: # sun
res['sun'] = 1
if (int(self.days_of_week) & 0x02) == 0x02: # mon
res['mon'] = 1
if (int(self.days_of_week) & 0x04) == 0x04: # tue
res['tue'] = 1
if (int(self.days_of_week) & 0x08) == 0x08: # wed
res['wed'] = 1
if (int(self.days_of_week) & 0x10) == 0x10: # thr
res['thr'] = 1
res['thu'] = 1 # '%a' returns thu for Thursday
if (int(self.days_of_week) & 0x20) == 0x20: # fri
res['fri'] = 1
if (int(self.days_of_week) & 0x40) == 0x40: # sat
res['sat'] = 1
if (int(
self.days_of_week) & 0x40) == 0x80: # enabled # new enable#
# flag -- duplicate in db
res['enabled'] = 1
res['enabled'] = self.enabled # remove this
res['dow'] = self.days_of_week
res['name'] = self.name
return res
kept the original comments - they're very helpful
// powtierdzenie decyzji
function zapytaj(pytanie){
if(confirm(pytanie)) return true
else return false;
}
class FileReader extends EventTarget(...READER_EVENTS) {
// [...]
readAsArrayBuffer() {
throw new Error('FileReader.readAsArrayBuffer is not implemented');
}
}
React Native's way of saying they don't support FileReader.readAsArrayBuffer()
@Override
public String toString() {
List<Integer> accountLevels = new ArrayList<>();
List<String> accountIds = new ArrayList<>();
for (SelectedHierarchyLevel selectedHierarchyLevel : selectedHierarchyLevels) {
accountLevels.add(selectedHierarchyLevel.getLevel());
accountIds.add(selectedHierarchyLevel.getAccountRowId());
}
vetoAreValidIds(accountIds);
StringBuilder converterString = new StringBuilder();
convert(accountLevels, converterString);
converterString.append("$");
convert(accountIds, converterString);
return converterString.toString();
}
Just because you can, doesn’t mean you should.
if (CATEGORY_NORMAL.equalsIgnoreCase(categorie)) {
return assignGroupStartWithPrefix(assignmentGroups);
} else if (CATEGORY_EXTERNAL.equalsIgnoreCase(categorie)) {
return assignGroupStartWithPrefix(assignmentGroups);
}
var list = new List<string>() { // Assume some items in the list };
for (var i = 0; i < list.Count; i++)
{
var item = list[i];
list.Remove(item);
i--;
}
Simple alternative to List.Clear()
try{
//...
getMyDataFromServer();
//...
}catch(Excepion e){
// :D
}
HMM FIXED BUG!
<?
if (ini_get('register_globals') != 1){
if ((isset($_POST) == true) && (is_array($_POST) == true)) extract($_POST, EXTR_OVERWRITE);
if ((isset($_GET) == true) && (is_array($_GET) == true)) extract($_GET, EXTR_OVERWRITE);}