
Recherche avancée
Médias (1)
-
Richard Stallman et le logiciel libre
19 octobre 2011, par
Mis à jour : Mai 2013
Langue : français
Type : Texte
Autres articles (111)
-
MediaSPIP v0.2
21 juin 2013, parMediaSPIP 0.2 est la première version de MediaSPIP stable.
Sa date de sortie officielle est le 21 juin 2013 et est annoncée ici.
Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
Comme pour la version précédente, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...) -
Script d’installation automatique de MediaSPIP
25 avril 2011, parAfin de palier aux difficultés d’installation dues principalement aux dépendances logicielles coté serveur, un script d’installation "tout en un" en bash a été créé afin de faciliter cette étape sur un serveur doté d’une distribution Linux compatible.
Vous devez bénéficier d’un accès SSH à votre serveur et d’un compte "root" afin de l’utiliser, ce qui permettra d’installer les dépendances. Contactez votre hébergeur si vous ne disposez pas de cela.
La documentation de l’utilisation du script d’installation (...) -
Les notifications de la ferme
1er décembre 2010, parAfin d’assurer une gestion correcte de la ferme, il est nécessaire de notifier plusieurs choses lors d’actions spécifiques à la fois à l’utilisateur mais également à l’ensemble des administrateurs de la ferme.
Les notifications de changement de statut
Lors d’un changement de statut d’une instance, l’ensemble des administrateurs de la ferme doivent être notifiés de cette modification ainsi que l’utilisateur administrateur de l’instance.
À la demande d’un canal
Passage au statut "publie"
Passage au (...)
Sur d’autres sites (9612)
-
AAC decoding with ffmpeg
22 novembre 2011, par AliI am trying to decode mms :// audio stream with ffmpeg.
I am able to get stream using libmms and now using ffmpeg to decode frames.
The problem is when i try to open codec usingcodec = avcodec_find_decoder(CODEC_ID_AAC);
c= avcodec_alloc_context();
avcodec_open(c, codec);FFmpeg library gives
error :channel element 1.8 is not allocated
and when i try to decodelen = avcodec_decode_audio3(c, (short *)outbuf, &out_size,&avpkt);
it does not decode, resulting len=-1Any idea ?
-
Pointer peril
18 octobre 2011, par Mans — Bugs, OptimisationUse of pointers in the C programming language is subject to a number of constraints, violation of which results in the dreaded undefined behaviour. If a situation with undefined behaviour occurs, anything is permitted to happen. The program may produce unexpected results, crash, or demons may fly out of the user’s nose.
Some of these rules concern pointer arithmetic, addition and subtraction in which one or both operands are pointers. The C99 specification spells it out in section 6.5.6 :
When an expression that has integer type is added to or subtracted from a pointer, the result has the type of the pointer operand. […] If both the pointer operand and the result point to elements of the same array object, or one past the last element of the array object, the evaluation shall not produce an overflow ; otherwise, the behavior is undefined. […]
When two pointers are subtracted, both shall point to elements of the same array object, or one past the last element of the array object ; the result is the difference of the subscripts of the two array elements.
In simpler, if less accurate, terms, operands and results of pointer arithmetic must be within the same array object. If not, anything can happen.
To see some of this undefined behaviour in action, consider the following example.#include <stdio.h>
int foo(void)
int a, b ;
int d = &b - &a ; /* undefined */
int *p = &a ;
b = 0 ;
p[d] = 1 ; /* undefined */
return b ;
int main(void)
printf("%d\n", foo()) ;
return 0 ;
This program breaks the above rules twice. Firstly, the &a - &b calculation is undefined because the pointers being subtracted do not point to elements of the same array. Most compilers will nonetheless evaluate this to the distance between the two variables on the stack. Secondly, accessing p[d] is undefined because p and p + d do not point to elements of the same array (unless the result of the first undefined expression happened to be zero).
It might be tempting to assume that on a modern system with a single, flat address space, these operations would result in the intuitively obvious outcomes, ultimately setting b to the value 1 and returning this same value. However, undefined is undefined, and the compiler is free to do whatever it wants :
$ gcc -O undef.c $ ./a.out 0
Even on a perfectly normal system, compiled with optimisation enabled the program behaves as though the write to p[d] were ignored. In fact, this is exactly what happened, as this test shows :
$ gcc -O -fno-tree-pta undef.c $ ./a.out 1
Disabling the tree-pta optimisation in gcc gives us back the intuitive behaviour. PTA stands for points-to analysis, which means the compiler analyses which objects any pointers can validly access. In the example, the pointer p, having been set to &a cannot be used in a valid access to the variable b, a and b not being part of the same array. Between the assignment b = 0 and the return statement, no valid access to b takes place, whence the return value is derived to be zero. The entire function is, in fact, reduced to the assembly equivalent of a simple return 0 statement, all because we decided to violate a couple of language rules.
While this example is obviously contrived for clarity, bugs rooted in these rules occur in real programs from time to time. My most recent encounter with one was in PARI/GP, where a somewhat more complicated incarnation of the example above can be found. Unfortunately, the maintainers of this program are not responsive to reports of such bad practices in their code :
Undefined according to what rule ? The code is only requiring the adress space to be flat which is true on all supported platforms.
The rule in question is, of course, the one quoted above. Since the standard makes no exception for flat address spaces, no such exception exists. Although the behaviour could be logically defined in this case, it is not, and all programs must still follow the rules. Filing bug reports against the compiler will not make them go away. As of this writing, the issue remains unresolved.
-
nomenclature #2507 : Itérateurs : boucles (LISTE) à l’identique de (ENUM)
23 janvier 2012, par Fil Upla difficulté de BOUCLE...> c’est que le tableau de données peut contenir n’importe quoi, et donc se confondre (informatiquement) avec n’importe quel critère. Exemple d’indétermination : BOUCLE0,12,1> devrait-il donner le premier élément de 2,1 (2) ou bien le 3ème élément de 0,1 (aucun (...)