Recherche avancée

Médias (0)

Mot : - Tags -/auteurs

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (83)

  • MediaSPIP 0.1 Beta version

    25 avril 2011, par

    MediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
    The zip file provided here only contains the sources of MediaSPIP in its standalone version.
    To get a working installation, you must manually install all-software dependencies on the server.
    If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)

  • MediaSPIP version 0.1 Beta

    16 avril 2011, par

    MediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Pour avoir une installation fonctionnelle, 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 (...)

  • Amélioration de la version de base

    13 septembre 2013

    Jolie sélection multiple
    Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
    Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...)

Sur d’autres sites (15369)

  • How to verify user permissions – Introducing the Piwik Platform

    9 novembre 2014, par Thomas Steur — Development

    This is the next post of our blog series where we introduce the capabilities of the Piwik platform (our previous post was How to make your plugin multilingual). This time you’ll learn how to verify user permissions. For this tutorial you will need to have basic knowledge of PHP and the Piwik platform.

    When should a plugin verify permissions ?

    Usually you want to do this before executing any action – such as deleting or fetching data – and before rendering any sensitive information that should not be accessible by everyone. For instance in an API method or Controller action. You sometimes also need to verify permissions before registering menu items or widgets.

    How does Piwik’s user management work ?

    It is quite simple as it only differentiates between a few roles : View permission, Admin permission and Super User permission. If you manage multiple websites with Piwik a user can be assigned to different roles as a user might have no permission for some websites but view or admin permission for another set of websites.

    Worth mentioning is that roles inherit from each other. This means the role admin automatically includes the role view and a super user automatically covers the view and admin role.

    Getting started

    In this post, we assume that you have already set up your development environment and created a plugin. If not, visit the Piwik Developer Zone where you’ll find the tutorial Setting up Piwik and other Guides that help you to develop a plugin.

    Verifying user permissions

    To protect your data the platform offers many convenient methods in the \Piwik\Piwik class. There you will find methods that either start with check, is or has. While methods that start with check throw an exception in case a condition is not met, the other methods return a boolean true or false.

    Use methods that throw an exception if you want to stop any further execution in case a user does not have an appropriate role. The platform will catch the exception and display an error message or ask the user to log in.

    1. public function deleteAllMessages()
    2. {
    3.     // delete messages only if user has super user access, otherwise show an error message
    4.     Piwik::checkUserSuperUserAccess();
    5.  
    6.     $this->getModel()->deleteAllMessages();
    7. }

    Télécharger

    Use methods that return a boolean for instance when registering menu items or widgets.

    1. public function configureAdminMenu(MenuAdmin $menu)
    2. {
    3.     if (Piwik::hasUserSuperUserAccess()) {
    4.         $menu->addPlatformItem('Plugins', $this->urlForDefaultAction());
    5.     }
    6. }

    Télécharger

    It is important to be aware that just because the menu item won’t be displayed in the UI a user can still open the registered URL manually. Therefore you have to check for permissions in the actual controller action as well.

    View permission

    A user having a view permission should be only able to view reports but not make any changes apart from his personal settings. The methods that end with UserHasSomeViewAccess make sure a user has at least view permission for one website whereas the methods *UserHasViewAccess($idSites = array(1,2,3)) check whether a user has view access for all of the given websites.

    1. Piwik::checkUserHasSomeViewAccess();
    2.  
    3. Piwik::checkUserHasViewAccess($idSites = array(1,2,3));

    Télécharger

    As a plugin developer you would usually use the latter example to verify the permissions for specific websites. Use the first example in case you develop something like an “All Websites Dashboard” where you only want to make sure the user has a view permission for at least one website.

    Admin permission

    A user having an admin permission cannot only view reports but also change website related settings. The methods to check for this role are similar to the ones before, just swap the term View with Admin.

    1. Piwik::checkUserHasSomeAdminAccess();
    2.  
    3. Piwik::checkUserHasAdminAccess($idSites = array(1,2,3));

    Télécharger

    Super user permission

    A user having the super user permission is allowed to access all of the data stored in Piwik and change any settings. To check if a user has this role use one of the methods that end with UserSuperUserAccess.

    Piwik::checkUserHasSuperUserAccess();

    As a plugin developer you would check for this permission for instance in places where your plugin shows an activity log over all users or where it offers the possibility to change any system wide settings.

    Getting information about the currently logged in user

    Sometimes you might want to know which user is currently logged in. This can be useful if you want to persist user related information in the database or if you want to send an email to the currently logged in user. You can easily get this information by calling the following methods :

    1. $login = Piwik::getCurrentUserLogin()
    2. $email = Piwik::getCurrentUserEmail()

    Télécharger

    Advanced features

    Of course there is more that you can do. For instance you can verify whether a user is an anonymous user or whether a user has a specific role. You can also perform any operation in the context of a super user even if the current user does not have this role. Would you like to know more about those features ? Check out the Piwik class reference, the Security guide and the Manage Users user guide.

    If you have any feedback regarding our APIs or our guides in the Developer Zone feel free to send it to us.

  • Leading Google Analytics alternative, Matomo, parodies Christopher Nolan blockbuster ahead of the UA sunset

    4 juillet 2023, par Erin — Press Releases

    Wellington, New Zealand, 4 July 2023 : In the world of online data, Google Analytics has long reigned supreme. Its dominance has been unquestioned, leaving website owners with little choice but to rely on the tech giant for their data insights. However, a new dawn in web analytics is upon us, and Matomo, the leading alternative to Google Analytics, is seizing a unique opportunity to position itself as the go-to provider. In a bold move, Matomo has launched a parody trailer, “Googleheimer,” humorously taking a satirical swipe at Google in the style of the upcoming Oppenheimer biopic by Christopher Nolan.

    Capitalising on a time-bound decision

    With an important decision looming for marketers and web specialists who need to switch analytics providers by July 1st, Matomo has found the perfect window to capture their attention.

    The urgency of the situation, combined with the high intent to switch providers, sets the stage for Matomo to establish itself as the leading alternative analytics platform of choice.

    Matomo’s parody trailer addresses the frustrations of GA4 head-on by highlighting the issues and the uncertainties caused by the sunset of Universal Analytics in humorous satire with lines such as :

    “But we’re keeping everyone’s data, right ? Right ?? …RIGHT ?!”

    Riding on the coat tails of this summer’s anticipated blockbuster from Christopher Nolan, Matomo openly points at the downsides of GA4, and reflects many frustrated marketers pain points in an entertaining way. Beneath the comedic and satirical tone lies the message that users have choices, and no longer need to surrender to the behemoth incumbent.

    Matomo was founded to challenge the status quo and provide a solution for those who believe in privacy and in ethical analytics, and who prefer that their customer data not be concentrated in the hands of just a few corporations.

    Watch the full trailer here. 


    About Matomo

    Matomo is a world-leading open-source privacy-friendly ethical web analytics platform, trusted by over 1.4 million websites in 190 countries and translated into over 50 languages. Matomo helps businesses and organisations track and optimise their online presence allowing users to easily collect, analyse, and act on their website and marketing data to gain a deeper understanding of their visitors and drive conversions and revenue. Matomo’s vision is to create, as a community, the leading open digital analytics platform that gives every user complete control of their data.

    Visit matomo.org for more information.




    More on Google Analytics changes



    A new dawn in web analytics is upon us, and Matomo – the leading alternative to Google Analytics – is here for it. After 20 years, Google is blowing up Universal Analytics (or GA3) – and taking your data with it. Inspired by Christopher Nolan’s upcoming biopic about physicist J. Robert Oppenheimer and the making of his atomic bomb (also known as “The Manhattan Project”), this parody trailer openly points to Google and draws the comparison in humorous satire. GA4 comes with a new set of metrics, setups and reports that change how you analyse your data.

  • javacv FFMPEG decode memory leak ?

    25 mars 2015, par Liquan Nie

    I’m new to JAVACV and I am using FFMPEG to play some video file as follows
    My enviroument is windows 8 with jdk7 and javacv0.10.

               String file_path ="D:\\1.mp4";
                   
                    // regist all format and codec
                    avformat.av_register_all();
                    avcodec.avcodec_register_all();
                   
                    // open file
                    avformat.AVFormatContext avFormatCtx = avformat.avformat_alloc_context();
                    if (avformat.avformat_open_input(avFormatCtx, file_path, null, null) != 0)
                    {
                            System.out.println("cann't open file\r\n");
                            return;
                    }
                    // find stream info
                    if (avformat.avformat_find_stream_info(avFormatCtx, (AVDictionary)null) < 0)
                    {
                            System.out.println("can't find stream info\r\n");
                            return;
                    }

                    int videoIndex = -1;
                    for(int i=0; i< avFormatCtx.nb_streams();i++)
                    {
                            if(avFormatCtx.streams(i).codec().codec_type() == avutil.AVMEDIA_TYPE_VIDEO)
                            {
                                    videoIndex = i;
                            }
                    }
                    // determ codec
                    avcodec.AVCodecContext avCodecCtx = avFormatCtx.streams(videoIndex).codec();
                    avcodec.AVCodec codec = avcodec.avcodec_find_decoder(avCodecCtx.codec_id());
                    if (codec == null)
                    {
                            System.out.println("codec not found");
                            return;
                    }
                    if(avcodec.avcodec_open2(avCodecCtx, codec, (AVDictionary)null) < 0)
                    {
                            System.out.println("cann't open avcodec\r\n");
                    }
                    avutil.AVFrame frame    = avcodec.avcodec_alloc_frame();
                    avutil.AVFrame frameRGB = avcodec.avcodec_alloc_frame();
                    int numByte = avcodec.avpicture_get_size(avutil.AV_PIX_FMT_RGB24, avCodecCtx.width(), avCodecCtx.height());
                    Pointer outBuffer = avutil.av_malloc(numByte);
                   
                    avcodec.avpicture_fill(new AVPicture(frameRGB), outBuffer.asByteBuffer(), avutil.AV_PIX_FMT_RGB24, avCodecCtx.width(), avCodecCtx.height());
                    avformat.av_dump_format(avFormatCtx, 0, file_path, 0);
                    System.out.println(avFormatCtx.duration());
                    SwsContext img_convert_ctx = swscale.sws_getContext(avCodecCtx.width(), avCodecCtx.height(), avCodecCtx.pix_fmt(), avCodecCtx.width(), avCodecCtx.height(), avutil.AV_PIX_FMT_RGB24, swscale.SWS_BICUBIC, null, null, (double[])null);

                    AVPacket pkt = new AVPacket();
                    int y_size = avCodecCtx.width()*avCodecCtx.height();
                    avcodec.av_new_packet(pkt, y_size);
                    opencv_highgui.cvNamedWindow(WINDOW_NAME);
                   
                    IplImage showImage = opencv_core.cvCreateImage(opencv_core.cvSize(avCodecCtx.width(), avCodecCtx.height()), opencv_core.IPL_DEPTH_8U, 3);
                    // read frames loop
                    int frameNumbers = avformat.av_read_frame(avFormatCtx, pkt);
                System.out.println("frame number is "+frameNumbers);
               
                while (avformat.av_read_frame(avFormatCtx, pkt) >= 0)
                    {
                        //System.out.println(pkt.asByteBuffer());
                            if (pkt.stream_index() == videoIndex)
                            {
                                    IntPointer ip = new IntPointer();
                                    int ret = avcodec.avcodec_decode_video2(avCodecCtx, frame, ip, pkt);
                                    if (ret < 0)
                                    {
                                            System.out.println("codec error\r\n");
                                            return;
                                    }
                                   
                                    if (ip.get()!= 0)
                                    {
                                            swscale.sws_scale(img_convert_ctx, frame.data(), frame.linesize(), 0, avCodecCtx.height(), frameRGB.data(), frameRGB.linesize());
                                            showImage.imageData(frameRGB.data(0));
                                           
                                            showImage.widthStep(frameRGB.linesize().get(0));
                                            opencv_highgui.cvShowImage(WINDOW_NAME, showImage);
                                            opencv_highgui.cvWaitKey(25);
                                    }
                            }
                    }
                   
                    showImage.release();
                    opencv_highgui.cvDestroyWindow(WINDOW_NAME);
                    avutil.av_free(frameRGB);
                    avcodec.avcodec_close(avCodecCtx);
                    avformat.avformat_close_input(avFormatCtx);

    but i run into get this error

    # A fatal error has been detected by the Java Runtime Environment:
    #
    #  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00000000767c35ed, pid=11884, tid=3960
    #
    # JRE version: 7.0_13-b20
    # Java VM: Java HotSpot(TM) 64-Bit Server VM (23.7-b01 mixed mode windows-amd64 compressed oops)
    # Problematic frame:
    # C  [avcodec-56.dll+0x4835ed]  avcodec_decode_video2+0xbd
    #
    # Failed to write core dump. Minidumps are not enabled by default on client versions of Windows
    #
    # An error report file with more information is saved as:
    # E:\code\android\TestJAVACV\hs_err_pid11884.log
    #
    # If you would like to submit a bug report, please visit:
    #   http://bugreport.sun.com/bugreport/crash.jsp
    # The crash happened outside the Java Virtual Machine in native code.
    # See problematic frame for where to report the bug.
    #
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'D:\1.mp4':
     Metadata:
       major_brand     : isom
       minor_version   : 512
       compatible_brands: isomiso2avc1mp41
       creation_time   : 1970-01-01 00:00:00
       encoder         : Lavf53.29.100
     Duration: 00:08:30.27, start: 0.000000, bitrate: 160 kb/s
       Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 960x540 [SAR 1:1 DAR 16:9], 28 kb/s, 15 fps, 15 tbr, 15 tbn, 30 tbc (default)
       Metadata:
         creation_time   : 1970-01-01 00:00:00
         handler_name    : VideoHandler
       Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 127 kb/s (default)
       Metadata:
         creation_time   : 1970-01-01 00:00:00
         handler_name    : SoundHandler

    and in the log file i found that the enden space heap in jvm has been used 98%. but I don’t know where is the issue, since the document of ffmpeg is not that enough, I feel difficult to know more about how to use it well ,any suggestions ??

    Heap
    PSYoungGen      total 23872K, used 20250K [0x00000000e5600000, 0x00000000e70a0000, 0x0000000100000000)
     eden space 20480K, 98% used [0x00000000e5600000,0x00000000e69c69f8,0x00000000e6a00000)