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 111-120 of 300 results.
IDPlCodelangPlGroupPlItemTitleCode 
 
192PythonFilehandlingPrüfen ob Datei existiertimport os filePath="/home/myUser/test.txt" if (os.path.isfile(filePath)): print "There it is! ;-)" else: print "Whow, file is missing at this place :-(" View Update Delete
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
190PythonSchleifenWhile Schleifei=10 while i<10: i=i+1 print i View Update Delete
189PythonSchleifenFor-Schleifefor i in range(0, 10): i=1 time.sleep(1) print i items = ['computer', 'fruits', 'fraggels'] # without indexes for item in items: print item # with indexes for (i, item) in enumerate(items): print i, itemView Update Delete
188PythonProzeduren, Funktionen, MethodenDeklaration einer Funktion/Prozedurdef this_is_my_function_name(param1): print "do something inside the function " + param1 print "do something outside the function" # call the function this_is_my_function_name("hello world") View Update Delete
187PHPURL-HandlingAktuelle URL bekommen// https://myDomain/appPath/index.php $protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) ? "https://" : "http://"; $domainName = $_SERVER['HTTP_HOST']; $query = $_SERVER['PHP_SELF']; $path = pathinfo( $query ); $myURLBasePath=$protocol.$domainName.$path['dirname']; echo $myURLBasePath; // https://myDomain/appPath echo $myURLBasePath.'/'.$path['basename']; // https://myDomain/appPath/index.phpView Update Delete
186PythonStringsString nach Delimenter zerlegenmyString = "A;B;C;D;E" myPieces = myString.split(";") # erzeugt ein Arrey mit den einzelnen Zeichen print myPieces[2] # gibt C ausView Update Delete
185T-SQLStringsPrüfen ob eine Zahl in einem String enthalten istSELECT value ,CASE WHEN PATINDEX('%[0-9]%',value) > 0 THEN 1 ELSE 0 END AS CheckIfStringContainsANumber FROM ( SELECT 'String w/o a number' AS value UNION ALL SELECT 'This string contains 1 as a number' AS value ) subQuery1 -- value | CheckIfStringContainsANumber -- ------------------------------------------------------------------ -- String w/o a number | 0 -- This string contains 1 as a number | 1View Update Delete
184BatchFilehandlingPrüfen ob Datei existiert@echo off SET checkFileExists="C:\Temp\myFile.txt" IF exist %checkFileExists% GOTO :EXISTS GOTO :EXISTSNOT :EXISTS echo There it is :-) GOTO :END :EXISTSNOT echo Sorry, the file isn't there :-( GOTO :END :END echo End of programView Update Delete
183BatchVariablenWert einer Variable zuweisen@echo off cd C:\Temp REM Aktuelles Verzeichnis in einer Variable setzen SET mydir="Mein Verzeichnis lautet %CD%" echo %mydir% REM "Mein Verzeichnis lautet C:\Temp"View Update Delete