Manage PlItems

You may optionally enter a comparison operator (<, <=, >, >=, <> or =) at the beginning of each of your search values to specify how the comparison should be done.

Advanced Search
Displaying 51-60 of 300 results.
IDPlCodelangPlGroupPlItemTitleCode 
 
205MySQLDatum, ZeitTagesnameSELECT DAYNAME(NOW()); -- Monday SELECT DAYNAME('2014-08-10'); -- Sunday -- To get localized names switch the parameter, e.g. to German SET lc_time_names = 'de_DE'; SELECT DAYNAME('2014-08-10'); -- SonntagView Update Delete
212SQLiteDatum, ZeitTagesname-- There is no build in solution. Because of this you have to build a solution out of the weekday. -- Be careful, the first weekday (0) is a sunday SELECT ,CASE CAST(strftime('%w', myDateField) as integer) WHEN 0 then 'Sonntag' WHEN 1 then 'Montag' WHEN 2 then 'Dienstag' WHEN 3 then 'Mittwoch' WHEN 4 then 'Donnerstag' WHEN 5 then 'Freitag' WHEN 6 then 'Samstag' ELSE '????????????????????' END AS Tag_der_Woche_Deutsch ,CASE CAST(strftime('%w', myDateField) as integer) WHEN 0 then 'Sunday' WHEN 1 then 'Monday' WHEN 2 then 'Tuesday' WHEN 3 then 'Wednesday' WHEN 4 then 'Thursday' WHEN 5 then 'Friday' WHEN 6 then 'Saturday' ELSE '????????????????????' END AS Day_of_week_EnglishView Update Delete
202PHPFallunterscheidungTernary operator$testVar = "OK"; $resultVar; $resultVar = $testVar=="OK" ? true : false; // same as if-else construction if ($testVar == "OK") { $resultVar = true; } else { $resultVar = false; };View Update Delete
203JavaFilehandlingTernary operatorString thisVar = "OK"; boolean resultVar; resultVar = thisVar.equals("OK") ? true : false; // same as if-else construction if (thisVar.equals("OK")) { resultVar = true; } else { resultVar = false; }View Update Delete
204PythonFallunterscheidungTernary operatorthisVar = "OK" resultVar = False # [on_true] if [cond] else [on_false] resultVar = True if thisVar == "OK" else False // same as if-else construction if (thisVar == "OK"): resultVar = True else: resultVar = FalseView Update Delete
248PowerShellFallunterscheidungTernary operator## Example from here: https://www.kongsli.net/2012/02/23/powershell-another-alternative-to-ternary-operator/ $thisVar='OK' $resultVar = @{$true=1;$false=2}[$thisVar -eq 'OK'] // same as if-else construction if ($thisVar -eq 'OK') { $resultVar = 1; } else { $resultVar = 2; }View Update Delete
197PythonJSONJSON Daten speichernmyData_dict = {"key1":"value1"} fileObj = open('myData.json', 'w+') jsonDump = json.dumps(myData_dict) fileObj.write(jsonDump) fileObj.close()View Update Delete
196PythonJSONJSON Daten ladenimport json myJSONFile = "/tmp/Test/myData.json" json_data = open(myJSONFile) # In Python werden JSON Daten nach dem Laden wie Dictionaries behandelt data_dict = json.load(json_data)View Update Delete
195PythonExceptionsException auslösenif (a!=b): raise Exception("Not implemented, yet")View Update Delete
194PythonFilehandlingFilename-Manipultation Basicsimport os myFilename = "/tmp/Test/myFile.txt" # Get only the path path_only = os.path.dirname(myFilename) # /tmp/Test # Filename only filename_only = os.path.basename(myFilename) # myFile.txt # get only filename without extention filename_without_ext = os.path.basename(os.path.splitext(myFilename)[0]) # myFile # get only the extension filename_extention_only = os.path.splitext(myFilename)[1] # .txt # put them together again myFilename_together = os.path.join(path_only, filename_without_ext + filename_extention_only) # /tmp/Test/myFile.txt View Update Delete