Recherche avancée

Médias (1)

Mot : - Tags -/graphisme

Autres articles (65)

  • Le profil des utilisateurs

    12 avril 2011, par

    Chaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
    L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...)

  • Configurer la prise en compte des langues

    15 novembre 2010, par

    Accéder à la configuration et ajouter des langues prises en compte
    Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
    De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
    Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...)

  • La sauvegarde automatique de canaux SPIP

    1er avril 2010, par

    Dans le cadre de la mise en place d’une plateforme ouverte, il est important pour les hébergeurs de pouvoir disposer de sauvegardes assez régulières pour parer à tout problème éventuel.
    Pour réaliser cette tâche on se base sur deux plugins SPIP : Saveauto qui permet une sauvegarde régulière de la base de donnée sous la forme d’un dump mysql (utilisable dans phpmyadmin) mes_fichiers_2 qui permet de réaliser une archive au format zip des données importantes du site (les documents, les éléments (...)

Sur d’autres sites (7135)

  • Playing With Emscripten and ASM.js

    1er mars 2014, par Multimedia Mike — General

    The last 5 years or so have provided a tremendous amount of hype about the capabilities of JavaScript. I think it really kicked off when Google announced their Chrome web browser in September, 2008 along with its V8 JS engine. This seemed to spark an arms race in JS engine performance along with much hyperbole that eventually all software could, would, and/or should be written in straight JavaScript for maximum portability and future-proofing, perhaps aided by Emscripten, a tool which magically transforms C and C++ code into JS. The latest round of rhetoric comes courtesy of something called asm.js which purports to narrow the gap between JS and native code performance.

    I haven’t been a believer, to express it charitably. But I wanted to be certain, so I set out to devise my own experiment to test modern JS performance.

    Up Front Summary
    I was extremely surprised that my experiment demonstrated JS performance FAR beyond my expectations. There might be something to these claims of magnficent JS speed in numerical applications. Basically, here were my thoughts during the process :

    • There’s no way that JavaScript can come anywhere close to C performance for a numerically intensive operation ; a simple experiment should demonstrate this.
    • Here’s a straightforward C program to perform a simple yet numerically intensive operation.
    • Let’s compile the C program on gcc and get some baseline performance numbers.
    • Let’s use Emscripten to convert the C program to JavaScript and run it under Chrome.
    • Ha ! Pitiful JS performance, just as I expected !
    • Try the same program under Firefox, since Firefox is supposed to have some crazy optimization for asm.js code, allegedly emitted by Emscripten.
    • LOL ! Firefox performs even worse than Chrome !
    • Wait a minute… the Emscripten documentation mentioned using optimization levels for generating higher performance JS, so try ‘-O1′.
    • Umm… wow : Chrome’s performance increased dramatically ! What about Firefox ? Not only is Firefox faster than Chrome, it’s faster than the gcc-generated code !
    • As my faith in C is suddenly shaken to its core, I remembered to compile the gcc version with an explicit optimization level. The native C version pulled ahead of Firefox again, but the Firefox code is still close.
    • Aha ! This is just desktop– but what about mobile ? One of the leading arguments for converting everything to pure JavaScript is that such programs will magically run perfectly in mobile browsers. So I wager that this is where the experiment will fall over.
    • I proceed to try the same converted program on a variety of mobile platforms.
    • The mobile platforms perform rather admirably as well.
    • I am surprised.

    The Experiment
    I wanted to run a simple yet numerically-intensive and relevant benchmark, and something I am familiar with. I settled on JPEG image decoding. Again, I wanted to keep this simple, ideally in a single file because I didn’t know how hard it might be to deal with Emscripten. I found NanoJPEG, which is a straightforward JPEG decoder contained in a single C file.

    I altered nanojpeg.c (to a new file called nanojpeg-static.c) such that the main() program would always load a 1920×1080 (a.k.a. 1080p) JPEG file (“bbb-1080p-title.jpg”, the Big Buck Bunny title), rather than requiring a command line argument. Then I used gettimeofday() to profile the core decoding function (njDecode()).

    Compiling with gcc and profiling execution :

    gcc -Wall nanojpeg-static.c -o nanojpeg-static
    ./nanojpeg-static
    

    Optimization levels such as -O0, -O3, or -Os can be applied to the compilation command.

    For JavaScript conversion, I installed Emscripten and converted using :

    /path/to/emscripten/emcc nanojpeg-static.c -o nanojpeg.html \
      —preload-file bbb-1080p-title.jpg -s TOTAL_MEMORY=32000000
    

    The ‘–preload-file’ option makes the file available to the program via standard C-style file I/O functions. The ‘-s TOTAL_MEMORY’ was necessary because the default of 16 MB wasn’t enough. Again, the -O optimization levels can be sent in.

    For running, the .html file is loaded (via webserver) in a web browser.

    Want To Try It Yourself ?
    I put the files here : http://multimedia.cx/emscripten/. The .c file, the JPEG file, and the Emscripten-converted files using -O0, -O1, -O2, -O3, -Os, and no optimization switch.

    Results and Charts
    Here is the spreadsheet with the raw results.

    I ran this experiment using Ubuntu Linux 12.04 on an Intel Atom N450-based netbook. For this part, I was able to compare the Chrome and Firefox browser results against the C results :



    These are the results for a 2nd generation Android Nexus 7 using both Chrome and Firefox :



    Here is the result for an iPad 2 running iOS 7 and Safari– there is no Firefox for iOS and while there is a version of Chrome for iOS, it apparently isn’t able to leverage an optimized JS engine. Chrome takes so long to complete this experiment that there’s no reason to muddy the graph with the results :



    Interesting that -O1 tends to provide better optimization than levels 2 or 3, and that -Os (optimize for size) seems to be a good all-around choice.

    Don’t Get Too Smug
    JavaScript can indeed get amazing performance in this day and age. Please be advised, however, that this isn’t the best that a C decoder implementation can possibly do. This version doesn’t leverage any SIMD extensions. According to profiling (using gprof against the C code), sample saturation in color conversion dominates followed by inverse DCT functions, common cases for SIMD ASM or intrinsics. Allegedly, there will be some support for JS SIMD optimizations some day. We’ll see.

    Implications For Development
    I’m still not especially motivated to try porting the entire Native Client game music player codebase to JavaScript. I’m still wondering about the recommended development flow. How are you supposed to develop for Emscripten and asm.js ? From what I can tell, Emscripten is not designed as a simple aide for porting C/C++ code to JS. No, it reduces the code into JS code you can’t possibly maintain. This seems to imply that the C/C++ code needs to be developed and debugged in its entirety and then converted to JS, which seems arduous.

  • Anomalie #3164 (Nouveau) : Problème de sauveagrde en MySQL

    2 février 2014, par Franck Dalot

    Bonsoir
    Alors après beaucoup de tests :-D Je fais un ticket de plus plutôt qu’une suite au autre, car il y a beaucoup de choses différente
    J’ai fini par trouver le moyen de reproduire le bug concernant les sauvegardes de spip"s"
    A savoir que j’ai fait que des tests de sauvegarde, je n’ai pas fait de vérification concernant la "qualité" des sauveagardes n’y même de restauration de base.
    Tests fait avec Firefox 26 et chez OVH en php 5.4.23

    Problème 1

    Contexte
    J’instal un spip 2.1.25 en choisissant MySQL via spip_loader, Je fais le choix concernant le prefix des tables de : spip21vers30bis
    Après l’instal, je vais dans "plugins" pour inserer les listes des plug (http://plugins.spip.net/rss-+-selection-2-1-+ et http://www.spip-contrib.net/?page=rss-plugins-spip-2-1)
    Puis, je fais la création d’une rubrique et d’un article de test que je publi en ligne.
    Enfin, je donne un nom au site et je vide le cache via l’interface de spip.

    Enfin, je vais dans "maintenance avancer" pour faire une sauvegarde de la base
    Je passe la souris sur "OPTIONS AVANCÉES"
    Et surprise... spip souhaite sauvegarder des tables qui n’existent pas "spip_article" et d’autres non, alors qu’elles existent "spip21vers30bis_articles"
    Sons en Gras les table que spip "coche" par défault
    spip21vers30bis_articles (1)
    spip21vers30bis_auteurs (1)
    spip21vers30bis_auteurs_articles (1)
    spip21vers30bis_auteurs_messages (0)
    spip21vers30bis_auteurs_rubriques (0)
    spip21vers30bis_breves (0)
    spip21vers30bis_documents (0)
    spip21vers30bis_documents_liens (0)
    spip21vers30bis_forum (0)
    spip21vers30bis_groupes_mots (0)
    spip21vers30bis_messages (0)
    spip21vers30bis_meta (93)
    spip21vers30bis_mots (0)
    spip21vers30bis_mots_articles (0)
    spip21vers30bis_mots_breves (0)
    spip21vers30bis_mots_documents (0)
    spip21vers30bis_mots_forum (0)
    spip21vers30bis_mots_rubriques (0)
    spip21vers30bis_mots_syndic (0)
    spip21vers30bis_petitions (0)
    spip21vers30bis_referers (0)
    spip21vers30bis_referers_articles (0)
    spip21vers30bis_resultats (0)
    spip21vers30bis_rubriques (1)
    spip21vers30bis_signatures (0)
    spip21vers30bis_syndic (0)
    spip21vers30bis_syndic_articles (0)
    spip21vers30bis_types_documents (164)
    spip21vers30bis_urls (0)
    spip21vers30bis_versions (0)
    spip21vers30bis_versions_fragments (0)
    spip21vers30bis_visites (0)
    spip21vers30bis_visites_articles (0)
    spip_articles (1)
    spip_auteurs (1)
    spip_auteurs_articles (1)
    spip_auteurs_messages (0)
    spip_auteurs_rubriques (0)
    spip_breves (0)
    spip_documents (0)
    spip_documents_liens (0)
    spip_forum (0)
    spip_groupes_mots (0)
    spip_messages (0)
    spip_meta (93)
    spip_mots (0)
    spip_mots_articles (0)
    spip_mots_breves (0)
    spip_mots_documents (0)
    spip_mots_forum (0)
    spip_mots_rubriques (0)
    spip_mots_syndic (0)
    spip_petitions (0)
    spip_rubriques (1)
    spip_signatures (0)
    spip_syndic (0)
    spip_syndic_articles (0)
    spip_types_documents (164)
    spip_urls (0)

    Problème 2
    Contexte
    Je place un fichier mes_options avec dedans :
    < ?php
    define(’SPIP_ERREUR_REPORT’,E_ALL) ;
    define(’_NO_CACHE’, -1) ;
    error_reporting(E_ALL^E_NOTICE) ;
    ini_set ("display_errors", "On") ;
    define(’_DEBUG_SLOW_QUERIES’, true) ;
    define(’_BOUCLE_PROFILER’, 5000) ;
    define(’_LOG_FILTRE_GRAVITE’,8) ;
    define(’_MAX_DEBUG_AFF’, ’1’) ;
     ?>

    Via spip_loader je fais le passage en SPIP 3.1.0-dev [21172]

    Apparission de notices pendant le passage :
    Notice : Undefined variable : r in /.../ecrire/req/mysql.php on line 974
    Notice : Undefined variable : row in /.../ecrire/req/mysql.php on line 539
    Notice : Undefined index : objet in /.../ecrire/req/mysql.php on line 1127
    Notice : Undefined index : creer_htpasswd in /.../ecrire/auth/spip.php on line 345
    + certaines qui ne sont pas systématique
    Notice : Undefined index : spip_lang in /.../ecrire/inc/lang.php on line 269
    Notice : Undefined variable : rub_ in /.../ecrire/base/dump.php on line 34

    Je vide le cache via l’interface de spip, et je vais dans "sauvegarder la base", je décoche "Sauvegarder toutes les tables"
    Surprise, spip me propose toutes les tables cocher sauf "spip_resultats" et "spip_test" (il me semble que c’est normal), par contre, il ne me propose pas les tables avec le préfix que j’avais choisi au moment de l’instal en spip 2.1.25

    Problème 3
    Je re-coche "Sauvegarder toutes les tables", choisi comme nom de sauvegarde "essai" et fait une sauveagarde

    Des notices apparaisent
    Notice : Undefined index : extra in /.../ecrire/req/sqlite_generique.php on line 1108
    Notice : Undefined index : objet in /.../ecrire/req/sqlite_generique.php on line 1053

    La sauvegarde ne semble pas correcte (voir la copie d’écran "sauvegarde1" jointe)

    Problème 4
    Je vide le cache, puis je fais une nouvelle sauveagrde de la base de données, mais uniquement d’une table "spip_articles" (Cela fait pareil avec toutes les tables qui sont en "gras" dans la copie d’écran "sauvegarde1"). je lui done le nom de "essai2"

    Des notices apparaissent
    Notice : Undefined index : extra in /.../ecrire/req/sqlite_generique.php on line 1108
    Notice : Undefined index : id_version in /.../ecrire/req/sqlite_generique.php on line 1108
    Notice : Undefined index : extra in /.../ecrire/req/sqlite_generique.php on line 1153
    Notice : Undefined index : id_version in /.../ecrire/req/sqlite_generique.php on line 1153

    La sauvegarde semble se faire
    Par contre quand il n’y a qu’une table, il faudrait que sont nom soit à gauche, il y a une puce de trop (voir la copie d’écran "sauvegarde2" jointe)

    problème 5
    Que cela soit en spip 3.0.15 ou 3.1 quand je regarde les tables que spip va sauveagrder, le prefix des table qui apparait ne correspond pas au prefix que j’ai choisi au moemnt de l’instal

    Problème 6 (divers)
    Des notices sont apparu lors de tests mais pas moyen de me souvenir si j’étais en 3.0.15 ou 3.1
    lors des essai, firefox mavais dit dans une page blanche qu’il y avait :
    Erreur d’encodage

    Des notices étaient visible
    Notice : Undefined index : contenu in /.../ecrire/req/sqlite_generique.php on line 1108
    Notice : Undefined index : extrait in /.../ecrire/req/sqlite_generique.php on line 1108
    Notice : Undefined index : composition in /.../ecrire/req/sqlite_generique.php on line 1108
    Notice : Undefined index : composition_lock in /.../ecrire/req/sqlite_generique.php on line 1108
    Notice : Undefined index : oembed in /.../ecrire/req/sqlite_generique.php on line 1108

    Et quand je faisait une sauvegarde, les table suivante étaient systématiquement en "gras"

    spip_article
    spip_depots
    spip_documents
    spip_groupes_mots
    spip_mots
    spip_paquets
    spip_plugins
    spip_auteurs
    spip_meta

    D’autres notices
    Notice : ob_end_flush() : failed to delete and flush buffer. no buffer to delete or flush in /.../plugins-dist/dump/inc/sauvegarde.php on line 59
    Notice : Undefined index : id in /.../ecrire/plugins/infos_plugin.php on line 170

  • Revision 87136 : Suite au message de nico du 15-01-2015 ...

    18 janvier 2015, par spip.franck@… — Log

    Suite au message de nico du 15-01-2015 http://archives.rezo.net/archives/spip-zone.mbox/2015/01/
    j’ai fait un up de version aux plug qui en avaient besoin, parfois, il y avait des différence entre paquet et plugins.xml, et d’autres broutilles