Dienstag, 11. Dezember 2007

TextPad - Regex

Löschen zweier von drei Zeilen


Es soll nur jede dritte Zeile behalten werden:


Suchen und Ersetzen mittels Textpad und der RegEx Option:

Suchpattern: n(^.*$)n^.*$n^.*$
Ersetzen: n1


Anstatt daß explizit Zeilenanfang ^ und Zeilenende $ definiert werden ^.*$ , könnte auch nur .* genommen werden, da ja die n schon Zeilenanfang und -ende darstellen

Siehe auch http://www.tfh-berlin.de/~solymosi/fgi/TextPad.html



Dienstag, 2. Oktober 2007

Videos konvertieren






Videos konvertieren, rippen


http://mediacoder.sourceforge.net/

MP3 zu swf

Konvertierung jeder Menge von Audio und Video Formaten

SUPER von eRightSoft : http://www.chip.de/downloads/SUPER-2008_17370353.html

Ungeschützte DVD rippen:

Windows: DVDx_2_10_setup.exe
Ubuntu: dvd::rip

Das bessere Ergebnis (ohne Interlacing) erzielt Ubuntu.

Videos hosten bei http://sevenload.de (max. 200MB) oder http://video.google.com


Donnerstag, 13. September 2007

rem
rem Backupskript: xcopy "quelle*.*" "ziel" /d /e /c /h /y
rem
SET DRIVE=P

xcopy "C:WindowsFavoriten*.*"
"%DRIVE%:backup_shuttleC
WindowsFavoriten" /d /e /c /h /y

rem EINZELNE EINSTELLUNGEN
xcopy "C:Dokumente und EinstellungenRainerLokale
EinstellungenAnwendungsdatenIdentities{C611C16B-98CE-481A-89B1-1C6615EC58C0}MicrosoftOutlook
Express*.*" "%DRIVE%:backup_shuttleCDokumente und EinstellungenOutlook
Express" /d /e /c /h /y

xcopy "C:Dokumente und EinstellungenRainerEigene Dateien*.*"
"%DRIVE%:backup_shuttleCDokumente und EinstellungenRainerEigene
Dateien" /d /e /c /h /y

xcopy "E:hp*.*" "%DRIVE%:backup_shuttleEhp" /d /e /c /h /y
rem xcopy "E:Tutorials*.*" "%DRIVE%:backup_shuttleETutorials" /d /e /c
/h /y
rem xcopy "E:c++*.*" "%DRIVE%:backup_shuttleEc++" /d /e /c /h /y



backup2.bat

@ECHO off
CLS
REM ----------------------------
REM Name: Sicherung.bat
REM Autor: ***
REM Datum: 28.03.2005
REM ----------------------------
ECHO Beginn, datensicherung von Mozila und Foxmail
ECHO.
xcopy "C:Dokumente und EinstellungenAdministratorAnwendungsdatenMozilla*.*" "D:BackupMozilla%date%*.*" /Y /I /E /s
xcopy "C:ProgrammeFoxmail*.*" "D:BackupFoxmail%date%*.*" /Y /I /E /s
ECHO.
ECHO Ende, datensichung von Mozila und Foxmail
ECHO Beginn, loeschung der Ordner die Aelter als Sieben Tage sind.
ECHO.
for /f "skip=7" %%a in ('dir /b /a:d /o:-d D:BackupMozilla') do rd /s /q D:BackupMozilla%%a
for /f "skip=7" %%a in ('dir /b /a:d /o:-d D:BackupFoxmail') do rd /s /q D:BackupFoxmail%%a
ECHO.
ECHO Ende, loeschung der Ordner die Aelter als Sieben Tage sind.
REM -----------------------------Ende----------------------------



Bei mir wird mit %date% nur das Datum ohne Wochentag (und ohne Leerzeichen) ausgegeben. Damit habe ich dann auch getestet.

Wenn die Ordner z.B. "Mo 28.03.2005" heißen, müssen die Zeilen so aussehen:

for /f "skip=7 delims=" %%a in ('dir /b /a:d /o:-d D:BackupMozilla') do rd /s /q "D:BackupMozilla%%a"
und
for /f "skip=7 delims=" %%a in ('dir /b /a:d /o:-d D:BackupFoxmail') do rd /s /q "D:BackupFoxmail%%a"

Zwei Änderungen
Die delims= Option, damit die gesamte Ausgabezeile des dir Kommandos gelesen wird.
Wichtig: auf keinen Fall ein Leerzeichen zwischen delims= und dem Anführungszeichen setzen. Also so wie oben delims="

Änderung zwei, die Anführungszeichen in der Pfadangabe für das rd Kommando.

Donnerstag, 6. September 2007

Palm Desktop - Google Calendar Sync

syncronisation - Synchronisation - synchronisieren
Angepasst nach http://herold.org/google-calendar-palm-sync.php



Palm <-> Palm Desktop <-> AirSet Desktop Sync <-> www.airset.com <-alle 24h-> calendar.google.com

Kontakte und Kalender zwischen Palm und AirSet, Kalendar zwischen AirSet und Google



Sync your Google Calendar and Palm Device via Airset

    • Airset Google Calendar Sync
  • Select Calendar - Subscribe
    • Airset Google Calendar Sync
  • Click Next
    • Airset Google Calendar Sync
  • To get your Google iCal Address go to Google 'Manage Calendars' and select the calendar you want to import.
    • Google Calendar Sync
  • Click on the iCal icon for your private or public calendar address. Most likely you are using a private address...
    • 0make sure you have your Google iCal Address.
  • Copy the iCal address link to your clipboard
    • 0make sure you have your Google iCal Address.
  • Insert your Google Calendar iCal URL
    • Airset Google Calendar Sync
  • Review the calendar import details and confirm by clicking next.
    • Airset Google Calendar Sync
  • Select the Airset Calendar that you want your Google Calendar to sync with.
    • Airset Google Calendar Sync

Congratulations. Remember Airset Calendars will sync your google calendar every 24 hours. (They indicate that they will create a manual sync button in the future, but in the meantime remember you'll just get a daily update.

You can now sync Airset with your Palm Desktop and Palm Device.

  • Download and Install the Airset Desktop Sync http://www.airset.com/User/Sync.jsp
Install the Application and you'll be sync'n your Google Calendar and Palm Device.

Freitag, 3. August 2007

Ajax Project - Form Entry Suggest

(vgl. http://www.crackajax.net/suggest.php)


ajax.js


var url = "myajaxfunctions.php?param=";

function get_spot_id(idValue)
{

//var idValue = document.getElementById("agtel").value;
var myRandom = parseInt(Math.random()*99999999); // cache buster
http.open("GET", url + escape(idValue) + "&rand=" + myRandom, true);
http.onreadystatechange = handleHttpResponse;
http.send(null);
}


function handleHttpResponse()
{
if (http.readyState == 4)
{
document.getElementById("hiddenDIV2").innerHTML=http.responseText;
document.getElementById("hiddenDIV2").style.width="200px";
//alert(document.getElementById("response_table_font").size);
var l = document.getElementById("response_table").rows.length;
document.getElementById("hiddenDIV2").style.height= l*25 +"px";
document.getElementById("hiddenDIV2").style.visibility="visible";
}
}

function loadrecord(record) {
//document.forms[1].telno.value = record;
document.getElementById("agtel").value = record;
document.getElementById("hiddenDIV2").innerHTML='';
document.getElementById("hiddenDIV2").style.height="0px";
document.getElementById("hiddenDIV2").style.width="0px";
document.getElementById("hiddenDIV2").style.visibility="hidden";
}

myajaxfunctions.php

if(strlen($_REQUEST['param'])>0)
{
/*$result = mysql_query("SELECT * FROM contact WHERE ContactTel LIKE '$_REQUEST['param']%'");
if(mysql_num_rows($result)>0)
{
while($myrow = mysql_fetch_array($result))
{
$agenttel = $myrow["ContactTel"];
$agentid = $myrow["ContactID"];
$textout .= "<table><tr style="border: 0px solid black"> <td style="border: 0px solid black; padding: 0px 10px 0px 10px"> <a href="javascript:loadrecord('".$agenttel."')">" .$agentid."</a></td> <td style="border: 0px solid black; padding: 0px 10px 0px 10px">" .$agenttel."</td></tr></table>";
}
}
else { $textout=""; }
*/

$textout .= "<table width='50px'>";
$textout .= "<tr style="border: 0px solid black"> <td style="border: 0px solid black; padding: 0px 10px 0px 10px"> <a href="javascript:loadrecord('112')">112</a></td> <td style="border: 0px solid black; padding: 0px 10px 0px 10px">Tom</td></tr>";
$textout .= "<tr style="border: 0px solid black"> <td style="border: 0px solid black; padding: 0px 10px 0px 10px"> <a href="javascript:loadrecord('100111')">100111</a></td> <td style="border: 0px solid black; padding: 0px 10px 0px 10px">Rainer</td></tr>";
$textout .= "</table>";

$textout='';
$textout .= "<font id='response_table_font' size='2'>";
$textout .= "<table id='response_table'>";
$textout .= "<tr > <td > <a href="javascript:loadrecord('112')">112</a></td> <td >Tom</td></tr>";
$textout .= "<tr > <td > <a href="javascript:loadrecord('112')">112</a></td> <td >Tom</td></tr>";
$textout .= "<tr > <td > <a href="javascript:loadrecord('112')">112</a></td> <td >Tom</td></tr>";
$textout .= "<tr > <td > <a href="javascript:loadrecord('112')">112</a></td> <td >Tom</td></tr>";
$textout .= "<tr > <td > <a href="javascript:loadrecord('112')">112</a></td> <td >Tom</td></tr>";
$textout .= "</table></font>";

}
echo $textout;


page.html


Wo?<br />
<input id="agtel" type="text" name="telno" onKeyUp="javascript:if(this.value.length > 3) get_spot_id(this.value);">

<div id="hiddenDIV2" name="hiddenDIV2" style="position:relative; top: 2px; left: 2px;width: 200px; visibility:hidden; background-color:white; border: 1px solid black;"> </div>



Editieren mit Browser - edit.php

<?php


$_REQUEST['dateiname'] =='' ? $file = "./index.php" : $file = $_REQUEST['dateiname'];


if(isset($_GET['action']) AND $_GET['action'] == 'update' AND $_POST['update_txt']!='') {
$fp = fopen($file, "w");
if(fwrite($fp, stripcslashes($_POST['update_txt']))) {
echo "Update erfolgreich.";
} else {
echo "Fehler beim Update.";
}
}
// else {
$content = file_get_contents($file);
echo '<form action="'.$_SERVER['PHP_SELF'].'?action=update&file='.$file.'" method="post" >';
echo 'Zu öffnende Datei: <input name="dateiname" type="text" size="50" maxlength="50" value="'.$file.'"><br>';
echo '<textarea name="update_txt" cols="70" rows="30" >'.$content.'</textarea><br/>';
if($file==''){ echo '<input type="submit" value="Datei laden" /></form>';}

else{ echo '<input type="submit" value="Update" /></form>';}
//}

function listdir($start_dir='.') {

$files = array();
if (is_dir($start_dir))
{
$fh = opendir($start_dir);
while (($file = readdir($fh)) !== false)
{
# loop through the files, skipping . and .., and recursing if necessary
if (strcmp($file, '.')==0 || strcmp($file, '..')==0) continue;
$start_dir == "." ? $filepath = $file : $filepath = $start_dir ."/". $file;
if ( is_dir($filepath) )
$files = array_merge($files, listdir($filepath));
else
array_push($files, $filepath);
}
closedir($fh);
}
else
{
# false if the function was called with an invalid non-directory argument
$files = false;
}

return $files;

}

echo "Vorhanden sind folgende Dateien:<br>";
$files = listdir();
foreach($files as $f)
echo " <a href='./edit.php?dateiname=".addslashes($f)."' >".$f."</a>,";
?>

Donnerstag, 2. August 2007

Ajax Tutorial - Kurzeinführung


Hier eine von mir angepasste Ajax Einführung von Rasmus.

I find a lot of this AJAX stuff a bit of a hype.  Lots of people have
been using similar things long before it became "AJAX". And it really
isn't as complicated as a lot of people make it out to be. Here is a
simple example from one of my apps. First the Javascript:

function createRequestObject() {
var req = null;
try{
req = new XMLHttpRequest();
}
catch (ms){
try{
req = new ActiveXObject("Msxml2.XMLHTTP");
}
catch (nonms){
try{
req = new ActiveXObject("Microsoft.XMLHTTP");
}
catch (failed){
req = null;
}
}
}
return req;
}

var http = createRequestObject();

function sndReq(action) {
http.open('get', 'myajaxfunctions.php?ajaxaction='+action);
http.onreadystatechange = handleResponse;
http.send(null);
}

function handleResponse() {
if(http.readyState == 4){
var response = http.responseText;

var update = new Array();

if(response.indexOf('|' != -1)) {
update = response.split('|');

document.getElementById(update[0]).innerHTML = update[1];
}
}
}


This creates a request object along with a send request and handle
response function. So to actually use it, you could include this js in
your page. Then to make one of these backend requests you would tie it
to something. Like an onclick event or a straight href like this:

<div id="my_ajax_div">
</div>
<a href="javascript:sndReq('search_spots')">doit</a>

That means that when someone clicks on that link what actually happens
is that a backend request to myajaxfunctions.php?ajaxaction=search_spots will be sent.

In myajaxfunctions.php you might have something like this:

<?php
switch($_REQUEST['ajaxaction']) {
case 'search_spots':
echo "my_ajax_div|Search done.";
break;
}
?>

Now, look at handleResponse. It parses the "my_ajax_div|Search done." string and
splits it on the '|' and uses whatever is before the '|' as the dom
element id in your page and the part after as the new innerHTML of that
element. That means if you have a div tag like this in your page:

<div id="my_ajax_div">
</div>

Once you click on that link, that will dynamically be changed to:

<div id="my_ajax_div">
Search done.
</div>

That's all there is to it. Everything else is just building on top of
this. Replacing my simple response "id|text" syntax with a richer XML
format and makine the request much more complicated as well. Before you
blindly install large "AJAX" libraries, have a go at rolling your own
functionality so you know exactly how it works and you only make it as
complicated as you need. Often you don't need much more than what I
have shown here.

Expanding this approach a bit to send multiple parameters in the
request, for example, would be really simple. Something like:

function sndReqArg(action,arg) {
http.open('get', 'myajaxfunctions.php?ajaxaction='+action+'&arg='+arg);
http.onreadystatechange = handleResponse;
http.send(null);
}

And your handleResponse can easily be expanded to do much more
interesting things than just replacing the contents of a div.

-Rasmus