BaroqueW

BaroqueW

and his sidekick nikkitaa

BaroqueW RSS Feed
 
 
 
 

Archive for February 26th, 2007

Coloration syntaxique

J’ai modifié mon squelette pour qu’il accepte la coloration syntaxique comme décrit ici. J’ai opté pour la méthode avec Beautifier. Attention l’article oublie deux fonctions dans la partie Beautifier qu’il faut reprendre du dessus et mettre dans ecrire/mes_fonctions.php :

  1. function avant_propre($texte) {
  2. $new_texte = avant_colorer_code($texte);
  3. return $new_texte;
  4. }

et

  1. function apres_propre($texte) {
  2. $new_texte = apres_colorer_code($texte);
  3. return $new_texte;
  4. }

Attention, ligne 33 de HFile/HFile_html.php un erreur s’est glissée au niveau du < qui n’est pas entre guillemets, enlevez-le simplement.

Évidemment maintenant que j’utilise WordPress, ça a moins d’intérêt… Sachez que sous WordPress, j’utilise le plugin CodeHighlighter.

Category: Articles en français, Blog, Tech >> Computer | Comments (2)

WAP, WML, WMLS et autres…

Dans le cadre de mon cours de Developping Mobile Applications, j’ai eu l’occasion d’expérimenter la programmation de sites WAP en quelques TP. Sont passés en revue, entre autres, le WMLS, l’intégration PHP/WML, la redirection HTML/WML, l’envoi de SMS/MMS en console etc. Allez visiter la liste des TP ainsi que ma page.

Quelques exemples :

  1. <script language="php">
  2. $accept = $_SERVER[‘HTTP_ACCEPT’];
  3. $pos = strpos($accept, "text/vnd.wap.wml");
  4. $wml = ($pos === 0 | $pos > 0 );
  5. if( $wml ) {
  6. header(‘Content-type: text/vnd.wap.wml’);
  7. echo ‘<?xml version="1.0" ?>’;
  8. echo ‘<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.3//EN"
  9. "http://www.wapforum.org/DTD/wml13.dtd">’;
  10. echo ‘<wml><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/></head>
  11. <card title="Dynamic">
  12. <p>Ahh, a WML surfer!</p>
  13. </card>
  14. </wml>’;
  15. } else {
  16. header(‘Content-type: text/html’);
  17. echo ‘<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">’;
  18. echo ‘</ccode><code><html>
  19. <head> <title>Dynamic</title> </head>
  20. <body>
  21. <p>Ahh, an HTML surfer!</p>
  22. </body>
  23. </html></code><ccode(php3)>’;
  24. }
  25. </script>

Le code ci-dessus parcourt les formats acceptés par le navigateur courant et détecte la possibilité d’interpréter le WML ou non.

  1. <?xml version="1.0" ?>
  2. <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.3//EN"
  3. "http://www.wapforum.org/DTD/wml13.dtd">
  4. <wml>
  5. <head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/></head>
  6. <template>
  7. <do type ="home1" label="Home">
  8. <go href="index.wml"/>
  9. </do>
  10. <do type="lab2" label="Lab2">
  11. <go href="index.wml#lab2"/>
  12. </do>
  13. </template>
  14. <card id="bet" title=’Online gambling’>
  15. <p>Type your bet here: <input emptyok="false" maxlength="3" type="text" title="SEK" format="*N" name="betval"/></p>
  16. <p><a href="bet.wmls#displayalert($betval)">Validate</a></p>
  17. </card>
  18. <card id="betok" title=’Bet accepted’>
  19. <p>Ok. Your bet was $betvalok</p>
  20. </card>
  21. </wml>
  22.  
  23. Le code ci-dessus utilise les champs (en forçant le type à "entiers" avec *N) et le WMLS :
  24. <blockquote>
  25. extern function displayalert(val){
  26. Dialogs.alert("Do you confirm this bet?");
  27. WMLBrowser.refresh();
  28. WMLBrowser.setVar("betvalok", val);
  29. WMLBrowser.go("bet.wml#betok");
  30. }</blockquote>
  31.  

Pour les codes sources précis, ou pour avoir la version de PHPIcalendar modifiée pour le WAP, contactez-moi !

A voir aussi, notre projet (avec Gabriele Violino) : sondage par SMS avec utilisation du WAP-PUSH. Au programme : détection du modèle et de la marque d’un mobile via l’UAProf, envoi de SMS-Push via la gateway NowSMS (avec explications sur le codage en hexa d’un message Push, ie. l’encapsulation WBXML, WSP, WDP, SMS), sondage en XHTML-MP, WML et HTML (le bon format est choisi directement via l’UAProf du mobile)… Les données sont stockées dans une base de données MySQL.

L’archive avec le code source et les slides est librement téléchargeable sur notre DokuWiki.

Category: Articles en français, Tech >> Computer | Leave a comment

I experienced it for you: losing my cellphone in Sweden

First of all, make sure to have a cellphone and a Comviq SIM card. The next step is quite easy: lose both of them; together, it’s easier.

The first step after the loss is to report the loss the police. Go to the nearest police station (be careful, on saturdays and sundays, only a few are open, you will probably end up at the one behind Polishuset) with an ID card, a phone number where you can be reached and the IMEI number of the lost cell phone (probably to be found somewhere on the box or the user’s guide of the cell phone). Be careful, do not fill in the police file online even if Comviq suggests it, as the file number would not be suitable for the further report to Comviq. Also, do not call Comviq first even if they advise you to do so on their website: they would only tell you to call the police. Once the police declaration form is filled in, check that you have a file number as following: 1234-K12345-12. If you actually do an online report, you will get a number like 1234-K12345-12 by snail mail after 3 or 4 days.

Next step is to call the 0200-222040 (or the 0046856222040 with Skype) to report the loss. If you owned a content card, press 1 and wait, if it was a monthly subscription, press 2 and wait. The clerk will then ask for your name, address (to send you your new SIM card, announced delay: 3 days), the credit left on your card when you lost it, a few phone numbers you called recently and obviously the famous K number received from the police. UPDATE: that means you will wait 10 days and then contact them, at that moment they will inform you that you have to write a letter to Comviq GSM 69 175 Karlskoga notifying them your wish to receive that damn SIM card, with its full content and your old phone number, which should be done within a week. Truth is, one week later you will receive a letter asking you for the same informations they already asked you, sending the reply is on you. That letter also informs you that the new SIM card will cost you 95Kr.

If you have lost your cell phone in the subway or the pendeltåg, dial the 004686001000 and press 2 to get the “please wait” message in English, even though you will be answered in Swedish later… Say that you have lost your mobile and you will be forwarded to the appropriate department. Please note, that it takes up to 2 or 3 week days after the loss to be efficient. If you have lost your cellphone on a Saturday afternoon, call on Tuesday afternoon.

Category: Articles in English, Suède / Sweden | Leave a comment

Conan O’Brien - On Finland and on Sweden


Conan O’Brien hates Sweden
Video sent by BaroqueW

Late Night with Conan O’Brien: Conan receives tons of letters from Finland in reaction to his “Conan O’Brien hates your homeland” project. Watch his reaction! Plus, he is so right about Sweden!

Category: Articles in English, Humour, Suède / Sweden, TV | Leave a comment