to generate problems
Image title says:
Wers nicht versteht: explainxkcd.com
Aber auch XKCD/App und XKCD/Workflow sind sehr empfehlenswert
Image title says:
Wers nicht versteht: explainxkcd.com
Aber auch XKCD/App und XKCD/Workflow sind sehr empfehlenswert
Nachdem die Nachweihnachtszeit bis jetzt sehr stressig war und ich bis dato 5 Prüfungen abgelegt habe (davon 4 mit sehr gut, eine Note ist noch aus ständig), beginnt nun die vorlesungsfreie Zeit. Nicht, dass das irgendeinen Unterschied machen würde mittlerweile. Die Diplomarbeit macht sehr langsam Fortschritte, jedoch nicht einmal annähernd in dem Maße wie ich es mir wünschen würde.
Leider muss ebendiese nun ein wenig ruhen, da ich wieder einmal bei meinem Lieblingsverein in der IT & EDV aushelfe und dort wartet derzeit einiges auf mich.
Diese Woche wartet noch eine Prüfung und dann Ende Februar gleich nochmal eine. Dann ist's mit den Master-Prüfungen aber beinahe vorbei.
Immerhin gibt's nächste Woche Spaß und Erholung mit Skifahren, darauf freu ich mich jetzt schon echt!
Leider muss ebendiese nun ein wenig ruhen, da ich wieder einmal bei meinem Lieblingsverein in der IT & EDV aushelfe und dort wartet derzeit einiges auf mich.
Diese Woche wartet noch eine Prüfung und dann Ende Februar gleich nochmal eine. Dann ist's mit den Master-Prüfungen aber beinahe vorbei.
Immerhin gibt's nächste Woche Spaß und Erholung mit Skifahren, darauf freu ich mich jetzt schon echt!
I was searching for solutions for using my existing iCal-calendars from Lightning/Sunbird with my new HTC Desire WITHOUT using the Google-calender (respectively without sending them your private data).
To create the calendars on the Adroid I couldn't find any other way then, just to create them at your Google-Account, sync them and afterwards disable the calendar-syncing at your Android-Phone.
Now you have to install yourself a CalDav-Server. The simplest server I found, for configuring and installing was SabreDav. Just get a XAMPP running on your machine and installing SabreDav.
Since there is no out-of-the-box possibility to import your iCal-files in the new CalDav server I wrote myself a little script, that does that for me. I know the code is messy and very imperformant, but it works and that is all it counts for me, at the moment.
Just put this code in a file in the directory where your SabreDav-Server is located and put the .ics files in the same directory.
You eventually need to increase the max_execution_time in the php.ini file
A value of 600 worked fine for me.
If your iCal-files were imported to your CalDav serer you can synchronize the your Android phone with the server. To synchronize your Android calendar with your new CalDav-Server you will have to install this tiny app: Calendar (CalDAV) Sync
When configuring the app on your phone your URL to the calendar could look like this
Also you can access the CalDav server via Lightning/Sunbird via:
New calendar->On the network->select CalDav and enter the URL to your calender. Don't forget the trailing slash! For me the URL looked for example like this
Explaination:
192.168.0.1 is the IP of the computer where der xampp is runing,
dav is the directory where I installed my SabreDav server,
calendarserver.php is the SabreDav calendar-server file.
calendars, the virtual directory calandars is for accessing (who got it? ;-)) the calendars,
admin is the principal/user and
Privat is the name of the calandar as i created it.
Be sure to have the trailing slash at the end of the URL or this won't work properly.
Tip: If you wan't to synchronize your phone from outside the LAN you have to use a VPN or a public webserver.
If you have questions feel free to contact me via comments, email or jabber.
Update:
Added the trim() function to the UID-detection, because if synchronizing without them, apache sometimes can't find the ics-files.
To create the calendars on the Adroid I couldn't find any other way then, just to create them at your Google-Account, sync them and afterwards disable the calendar-syncing at your Android-Phone.
Now you have to install yourself a CalDav-Server. The simplest server I found, for configuring and installing was SabreDav. Just get a XAMPP running on your machine and installing SabreDav.
Since there is no out-of-the-box possibility to import your iCal-files in the new CalDav server I wrote myself a little script, that does that for me. I know the code is messy and very imperformant, but it works and that is all it counts for me, at the moment.
Just put this code in a file in the directory where your SabreDav-Server is located and put the .ics files in the same directory.
You eventually need to increase the max_execution_time in the php.ini file
A value of 600 worked fine for me.
If your iCal-files were imported to your CalDav serer you can synchronize the your Android phone with the server. To synchronize your Android calendar with your new CalDav-Server you will have to install this tiny app: Calendar (CalDAV) Sync
When configuring the app on your phone your URL to the calendar could look like this
Also you can access the CalDav server via Lightning/Sunbird via:
New calendar->On the network->select CalDav and enter the URL to your calender. Don't forget the trailing slash! For me the URL looked for example like this
Explaination:
192.168.0.1 is the IP of the computer where der xampp is runing,
dav is the directory where I installed my SabreDav server,
calendarserver.php is the SabreDav calendar-server file.
calendars, the virtual directory calandars is for accessing (who got it? ;-)) the calendars,
admin is the principal/user and
Privat is the name of the calandar as i created it.
Be sure to have the trailing slash at the end of the URL or this won't work properly.
Tip: If you wan't to synchronize your phone from outside the LAN you have to use a VPN or a public webserver.
If you have questions feel free to contact me via comments, email or jabber.
Update:
Added the trim() function to the UID-detection, because if synchronizing without them, apache sometimes can't find the ics-files.
Die PHP-Funktion empty() gibt Auskunft darüber, ob die angegebe Variable leer ist. Folgendes weiß das Manual dazu zu sagen
Man sollte nun doch meinen, dass folgende beide Code-Snippets das gleiche Ergebnise erzeugen: nämlich true.
Dem ist aber nicht so.
Das erste snippet gibt folgendes wiede
das zweite Snippet
Um darauf zu kommen, habe ich gerade zwei Stunden meines Lebens verschwendet...Dankeschön!
Man sollte nun doch meinen, dass folgende beide Code-Snippets das gleiche Ergebnise erzeugen: nämlich true.
Dem ist aber nicht so.
Das erste snippet gibt folgendes wiede
das zweite Snippet
Um darauf zu kommen, habe ich gerade zwei Stunden meines Lebens verschwendet...Dankeschön!
Eingeordnet unter: PHP-Entwicklung, Programmieren
Wie manche wissen, bin ich kein großer Java-Fan, aber dieses Video is genial :D
Via eli
Via eli
...Syntax von PHP.
Im Vergleich zu Visual Basic ist die Syntax von PHP einfach nur traumhaft.
Ich speib mich gleich an bei der von VB.
Im Vergleich zu Visual Basic ist die Syntax von PHP einfach nur traumhaft.
Ich speib mich gleich an bei der von VB.
Eingeordnet unter: Programmieren
When serialize()ing an array containing the data of the last created blogpost there was no error at first.
But if the data were fetched from the database and the script tried to unserialize() them the following error occured:
So why is this?
Lets say you have an array with 3 indizes containing 2 strings and one integer.
As you can see the single quote in the second array-element is escaped by a backslash.
If you now serialize the data you get the following string
If this string is now written to the database the backslashes disappears and the field contains the following data:
As the considerate reader might have discovered the length of the highlighted string was first 25 characters and is after inserting into the database 24 characters long.
So if PHP tries to unserialize the string it thinks it has to read 25 characters but there are only 24. This throws the above error.
So how can you circumvent this?
So the backslashes are removed before serializing the data and added afterwards to prevent database malfunctions or errors.
But if the data were fetched from the database and the script tried to unserialize() them the following error occured:
So why is this?
Lets say you have an array with 3 indizes containing 2 strings and one integer.
As you can see the single quote in the second array-element is escaped by a backslash.
If you now serialize the data you get the following string
If this string is now written to the database the backslashes disappears and the field contains the following data:
As the considerate reader might have discovered the length of the highlighted string was first 25 characters and is after inserting into the database 24 characters long.
So if PHP tries to unserialize the string it thinks it has to read 25 characters but there are only 24. This throws the above error.
So how can you circumvent this?
So the backslashes are removed before serializing the data and added afterwards to prevent database malfunctions or errors.
Nachdem Michelle mich darauf aufmerksam gemacht hat, dass im Seitenmenü die doppelte Anzahl an Seiten zB bei den Kategorien angezeigt werden als eigentlich vorhanden sein sollten hab ich mich auf Fehlersuche gemacht.
Nachdem ich ein fehlendes DISTINCT zuerst für den Verantwortlichen gehalten habe bin ich nach einiger Zeit draufgekommen, dass beim Portieren der Software der Inhalt 2 mal eingefügt wurde.
Ich hatte also eine 2spaltige Tabelle mit mehreren Tausend Einträgen und diese waren je 2 mal vorhanden. Was also tun? Manuell kann man das vergessen. Mit normalen Abfragen is mir auch nix eingefallen und siehe da das Glasgoogle hat geholfen und folgendes zu Tage gebracht:
Doppelte Einträge löschen (ganz unten)
Es wird ein UNIQUE Index auf die gewähljten Felder gelegt und da er UNIQUE ist, sind keine doppelten Einträge erlaubt.
Ignore ist dabei das Stichwort: Dadurch werden doppelte Einträge einfach gelöscht. Sache gelöst. Juhu :D
Nachdem ich ein fehlendes DISTINCT zuerst für den Verantwortlichen gehalten habe bin ich nach einiger Zeit draufgekommen, dass beim Portieren der Software der Inhalt 2 mal eingefügt wurde.
Ich hatte also eine 2spaltige Tabelle mit mehreren Tausend Einträgen und diese waren je 2 mal vorhanden. Was also tun? Manuell kann man das vergessen. Mit normalen Abfragen is mir auch nix eingefallen und siehe da das Glasgoogle hat geholfen und folgendes zu Tage gebracht:
Doppelte Einträge löschen (ganz unten)
Es wird ein UNIQUE Index auf die gewähljten Felder gelegt und da er UNIQUE ist, sind keine doppelten Einträge erlaubt.
Ignore ist dabei das Stichwort: Dadurch werden doppelte Einträge einfach gelöscht. Sache gelöst. Juhu :D