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 21-30 of 300 results.
IDPlCodelangPlGroupPlItemTitleCode 
 
191PythonEncoding / Decodingmd5-Hash erzeugen# https://docs.python.org/2/library/hashlib.html import hashlib a = "hello world" b = 0.1 md5str = hashlib.md5(str(b) + a).hexdigest() View Update Delete
259PowerShellStringsMultiline String Variable# In PowerShell such variables are called: Here-Strings $mySQLString = @" SELECT 1 FROM dbo.TestTable WHERE 1=1 "@ View Update Delete
252PythonDateihandlingTextdatei schreiben# Modes # r: Read mode which is used when the file is only being read # w: Write mode which is used to edit and write new information to the file (any existing files with the same name will be erased when this mode is activated) # a: Appending mode, which is used to add new data to the end of the file; that is new information is automatically amended to the end # r+: Special read and write mode, which is used to handle both actions when working with a file myFile = open("myFile.txt","w") myFile.write("Hello World") myFile.close() View Update Delete
229PowerShellStringsString nach einem Teilstring durchsuchen# See also a good hint with explanation between like and contains: # http://windowsitpro.com/blog/powershell-contains $fullstring = "This is my string"; if ($fullstring -like "*my*") { Write-Host "found" -ForegroundColor Green; } else { Write-Host "nope" -ForegroundColor Red; }View Update Delete
251PythonStringsErster Buchstable Groß in Wort# Siehe auch: http://www.php2python.com/wiki/function.ucwords/ myString = "nothingspecial" import string uc = string.capwords(myString) print(uc) # NothingspecialView Update Delete
285Bash ScriptFilehandlingApplikations-/Script-Verzeichnis ermitteln#!/bin/sh # The script is located in /tmp/abc/myscript.sh export AppPath=$(dirname $0) echo $0 # /tmp/abc/myscript.sh echo $AppPath # /tmp/abcView Update Delete
163Bash ScriptDatum, ZeitAktuelles Datum/Uhrzeit#!/bin/sh myDate=$(date +"%Y-%m-%d") echo $myDate # 2014-01-14 echo $(date +"%Y-%m-%d_%a") # with short dayname # 2017-01-05_Do (Do => German, localized short of Tuesday) echo $(date +"%Y-%m-%d %H:%M:%S") # 2014-01-14 22:15 # List of formatting options: https://www.cyberciti.biz/faq/linux-unix-formatting-dates-for-display/View Update Delete
167Bash ScriptProzeduren, Funktionen, MethodenDeklaration einer Funktion/Prozedur#!/bin/sh do_something() { echo $1 echo $2 } do_something "this is my first" " and second argument" # this is my first and second argumentView Update Delete
243Bash ScriptDatum, ZeitGestriges Datum#!/bin/sh myDate=$(date +"%Y-%m-%d" -d "yesterday") echo $myDate # 2014-01-13 myDate2=$(date -d @$(( $(date +"%s") - 86400)) +"%Y-%m-%d") # 014-01-13 # today: $(date +"%Y-%m-%d") # 2014-01-14 # Hint: -d parameter doesn't work on Solaris View Update Delete
246Bash ScriptFilehandlingFilename-Manipultation Basics#!/bin/sh myFilename="$1" # or myFilename="/tmp/Test/myFile.txt" # Get only the path path_only=$(dirname "$myFilename") # /tmp/Test # if it is a local file in the path, then . will be prompted e.g. myFilename="myFile.txt" # Filename only filename_only=$(basename "$myFilename") # myFile.txt # get only filename without extention filename_without_ext="${filename_only%.*}" # myFile # get only the extension filename_extention_only="${myFilename##*.}" # txt # put them together again myFilename_together="${path_only}/${filename_without_ext}.${filename_extention_only}" # /tmp/Test/myFile.txtView Update Delete