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 SearchDisplaying 41-50 of 300 results.
ID | PlCodelang | PlGroup | PlItemTitle | Code | |
---|---|---|---|---|---|
110 | PHP | XML | RSS-Feed erstellen | // Beispiel von den der Seite: // http://xml-rss.de/xml-rss-feed-mit-php/xml-rss-feed-mit-php-und-dom-erstellen.htm // Code-Kommentare stammen nicht von der Seite <?php header("Content-type: text/xml"); // XML Element-Object erstellen $xml = new DOMDocument('1.0', 'UTF-8'); $xml->formatOutput = true; $roo = $xml->createElement('rss'); $roo->setAttribute('version', '2.0'); $xml->appendChild($roo); $cha = $xml->createElement('channel'); $roo->appendChild($cha); // Header-Informationen des RSS // Titel $hea = $xml->createElement('title',utf8_encode('Name des RSS Feed')); $cha->appendChild($hea); // Beschreibung $hea = $xml->createElement('description',utf8_encode('Feed Beschreibung')); $cha->appendChild($hea); // Sprache, für einen englischen Feed hier 'en' eintragen $hea = $xml->createElement('language',utf8_encode('de')); $cha->appendChild($hea); // Link zur Seite zum dem der RSS gehört $hea = $xml->createElement('link',htmlentities('http://xml-rss.de')); $cha->appendChild($hea); // Datum des letzten Aufbaus der Feed-Anforderung $hea = $xml->createElement('lastBuildDate',utf8_encode(date("D, j M Y H:i:s ").'GMT')); $cha->appendChild($hea); // Content erstellen $itm = $xml->createElement('item'); $cha->appendChild($itm); $dat = $xml->createElement('title',utf8_encode('Titel der Nachricht')); $itm->appendChild($dat); $dat = $xml->createElement('description',htmlspecialchars('Die Nachricht an sich',ENT_QUOTES,'UTF-8')); $itm->appendChild($dat); $link = "http://page/Link_To_Introduction"; $dat = $xml->createElement('link',htmlentities($link)); $itm->appendChild($dat); $dat = $xml->createElement('pubDate',utf8_encode('Datum der Nachricht')); $itm->appendChild($dat); // Ist der Inhalt auf mehreren Seiten verteilt, wäre hier eine Unterteilung vorzunehmen. I.d.R. ist link=guid... $guid = $link; $guid = "http://page/Link_To_Content"; $dat = $xml->createElement('guid',htmlentities($guid)); $itm->appendChild($dat); // Content fertig // RSS-XML serialisieren als separate Datei oder direkt ausgeben // Mittels der save-Methode kann man eine statische Datei erstellen // So wäre es denkbar, dass diese über einen Cron-Job in bestimmten // Zeitintervallen erstellen wird und damit nicht die Performance // des Servers belastet. Nachteil, der Feed ist evtl. nicht immer auf dem neusten Stand. //$xml->save('dateiname.xml'); // Die XML-Struktur wird mitels eines Strings zurückgegeben. // Vorteil: Immer aktuelle Feeds // Nachteil: Bei jedem Aufruf Neuerstellung des Feed's, bei großen // Datenmengen kann darunter die Performance des Servers leiden. echo $xml->saveXML(); ?> | ![]() ![]() ![]() |
109 | C# | Dateihandling | Dateinamen aus kompletten Pfad extrahieren | string filename = Path.GetFileName(fileNameWithPath); | ![]() ![]() ![]() |
132 | PHP | Dateihandling | Prüfen ob Datei schreibbar ist | // Orginal von: http://www.sebastianviereck.de/php-nicht-schreibbare-dateien-finden-und-beheben/ function checkFileWritable($file) { if(!file_exists($file)) { file_put_contents($file, ""); } if(!chmod($file, 0644)) { $fileowner = fileowner($file); echo "counld not change File Permissions: $file, File Owner is: $fileowner"; if(!chown($file, ftpUserID)) { echo "counld not change File owner: $file "; mail(mailadresse, "Schreibeprobleme","File: $file, File Owner is: $fileowner"); } } } | ![]() ![]() ![]() |
252 | Python | Dateihandling | Textdatei 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() | ![]() ![]() ![]() |
79 | T-SQL | Datenbank, Collation | Datensatz Case-Sesitive abfragen | -- Table containing Values -- content (column) -- a -- A SELECT content FROM myTable WHERE content='A' COLLATE SQL_Latin1_General_CP1_CS_AS -- Result: A | ![]() ![]() ![]() |
80 | T-SQL | Datenbank, Collation | Collation (Sortierreihenfolge) einer Datenbank ändern | -- Collation einer Multi-User Datenbank ändern -- Über SSMS kommt die Fehlermeldung 5030 (Die Datenbank konnte nicht exklusiv gesperrt werden, um den Vorgang auszuführen.) -- siehe dazu: http://sunali.com/2009/10/08/microsoft-sql-server-error-5030/ -- the following line sets the database to "Single User" mode ALTER DATABASE MYDB SET SINGLE_USER WITH ROLLBACK IMMEDIATE -- the following line sets the new collation ALTER DATABASE MYDB COLLATE Latin1_General_CS_AS -- the following line sets the database back to "Multi User" mode ALTER DATABASE MYDB SET MULTI_USER | ![]() ![]() ![]() |
81 | T-SQL | Datenbank, Collation | Collation-Arten auflisten | -- siehe auch: http://msdn.microsoft.com/de-de/library/ms187963.aspx SELECT * FROM fn_helpcollations() | ![]() ![]() ![]() |
78 | Delphi | Anwendungskonfigurationsdateien | INI-Datei lesen | uses IniFiles; var iniMem: TMemIniFile; // ini-File (ready only one time) // Load the ini-information once - maybe at startup function TMyForm.LoadIniFile:boolean; var SL : TStringList; return : Boolean; iniFile : String; begin iniFile:='myFormConfig.ini'; return:=true; if not FileExists(ExtractFilePath(Application.Exename)+iniFile) then begin MessageDlg('ini-File not found!', mtError, [mbOK], 0); return:=false; end; if not return then halt; iniMem:=TMemIniFile.Create(''); SL:=TStringList.Create; SL.LoadFromFile(ExtractFilePath(Application.Exename)+iniFile); iniMem.SetStrings(SL); LoadIniFile:=return; end; procedure TMyForm.DoThis; begin ShowMessage(iniMem.ReadString('Section','Attribute','Default-Value')); end; | ![]() ![]() ![]() |
105 | C# | Netzwerk | Downloaden einer Datei | private void DownloadFile(string url, string targetFilePath) { WebClient webClient = new WebClient(); webClient.DownloadFileAsync(new Uri(url), targetFilePath); } | ![]() ![]() ![]() |
73 | Delphi | Windows - Prompt Errorlevel | Errorlevel setzen | //... var errorlevel: Integer; begin if cond1=cond2 then errorlevel:=0; if cond1<>cond2 then errorlevel:=1; halt(errorlevel); end. | ![]() ![]() ![]() |