Recherche avancée

Médias (17)

Mot : - Tags -/wired

Autres articles (62)

  • 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 (...)

  • 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 (...)

  • 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 (7784)

  • ffmpeg progess bar not giving percent

    3 décembre 2014, par Brett

    Hi im trying to create a java program that shows the percent of a ffmpeg command , Im not sure where i am going wrong.

    Its keeps giving me these results

    run :
    Total duration : 857.44 seconds.
    Progress : 0.85%
    Progress : 1.76%
    Progress : 2.79%
    Progress : 3.93%
    Progress : 5.04%
    Progress : 6.21%
    Progress : 6000.27%
    Progress : 6001.29%
    Progress : 6002.46%
    Progress : 6003.58%
    Progress : 6004.59%
    Progress : 6005.70%
    Progress : 6006.77%
    Progress : 12000.86%
    Progress : 12001.97%
    Progress : 12002.97%
    Progress : 12004.03%
    Progress : 12005.15%
    Progress : 12006.27%
    Progress : 18000.34%
    Progress : 18001.46%
    Progress : 18002.29%
    Progress : 18003.41%
    Progress : 18004.41%
    Progress : 18005.50%
    Progress : 18006.55%
    Progress : 24000.52%
    Progress : 24001.62%
    Progress : 24002.74%
    Progress : 24003.69%
    Progress : 24004.76%
    Progress : 24005.88%
    Progress : 24006.94%
    Progress : 30001.01%
    Progress : 30002.16%
    Progress : 30003.24%
    Progress : 30004.25%
    Progress : 30005.37%
    Progress : 30006.44%
    Progress : 36000.56%
    Progress : 36001.60%
    Progress : 36002.69%
    Progress : 36003.73%
    Progress : 36004.81%
    Progress : 36005.93%
    Progress : 42000.05%
    Progress : 42001.18%
    Progress : 42002.30%
    Progress : 42003.41%
    Progress : 42004.50%
    Progress : 42005.60%
    Progress : 42006.72%
    Progress : 48000.84%
    Progress : 48001.96%
    Progress : 48003.08%
    Progress : 48004.18%
    Progress : 48005.09%
    Progress : 48006.16%
    Progress : 54000.22%
    Progress : 54001.15%
    Progress : 54002.20%
    Progress : 54003.30%
    Progress : 54004.42%
    Progress : 54005.49%
    Progress : 54006.38%
    Progress : 60000.45%
    Progress : 60001.57%
    Progress : 60002.55%
    Progress : 60003.64%
    Progress : 60004.66%
    Progress : 60005.62%
    Progress : 60006.72%
    Progress : 66000.67%
    Progress : 66001.73%
    Progress : 66002.75%
    Progress : 66003.61%
    Progress : 66004.71%
    Progress : 66005.82%
    Progress : 66006.81%
    Progress : 72000.67%
    Progress : 72001.73%
    Progress : 72002.80%
    Progress : 72003.87%
    Progress : 72004.81%
    Progress : 72005.71%
    Progress : 72006.69%
    Progress : 78000.73%
    Progress : 78001.82%
    Progress : 78002.91%
    Progress : 78003.91%
    Progress : 78004.98%
    Progress : 78005.88%
    Progress : 78006.49%
    Progress : 84000.37%
    Progress : 84001.12%
    Progress : 84002.04%
    BUILD SUCCESSFUL (total time : 49 seconds)

    But the file is created , i don’t know why im getting 0.00% any help would be awsome
    ..
    It also complains some imports a not being used here are the imports.

    here is my code

    import java.io.IOException;
    import java.util.Scanner;
    import static java.util.logging.Level.parse;
    import java.util.regex.Pattern;
    import javafx.util.Duration;
    import static javax.management.Query.lt;
    /**
    *
    * @author brett
    */

    public class MashMeUp {

       public static void main(String[] args) throws IOException {
           ProcessBuilder pb = new ProcessBuilder("ffmpeg", "-i", "C:\\Users\\brett\\Documents\\Telegraph_Road.mp4", "C:\\Users\\brett\\Documents\\out.mp4");

           // ProcessBuilder pb = new ProcessBuilder(args);  
           final Process p = pb.start();

       // create a new thread to get progress from ffmpeg command , override  
           // it's run method, and start it!  
           new Thread() {
               public void run() {

                   Scanner sc = new Scanner(p.getErrorStream());

                   // Find duration  
                   Pattern durPattern = Pattern.compile("(?<=Duration: )[^,]*");
                   String dur = sc.findWithinHorizon(durPattern, 0);
                   if (dur == null) {
                       throw new RuntimeException("Could not parse duration.");
                   }
                   String[] hms = dur.split(":");
                   double totalSecs = Integer.parseInt(hms[0]) * 3600
                           + Integer.parseInt(hms[1]) * 60
                           + Double.parseDouble(hms[2]);
                   System.out.println("Total duration: " + totalSecs + " seconds.");

                   // Find time as long as possible.  
                   Pattern timePattern = Pattern.compile("(?<=time=)[\\d:.]*");
                   // TODO make regex that works with ffmpeg static build  
                   String match;
                   String[] matchSplit;
    while (null != (match = sc.findWithinHorizon(timePattern, 0))) {
       matchSplit = match.split(":");
       double progress = Double.parseDouble(matchSplit[2]) / totalSecs +  Integer.parseInt(matchSplit[0]) * 3600 + Integer.parseInt(matchSplit[1]) * 60;
                       System.out.printf("Progress: %.2f%%%n", progress * 100);
                   }
               }
           }.start();
       }
    }
  • Progress with rtc.io

    12 août 2014, par silvia

    At the end of July, I gave a presentation about WebRTC and rtc.io at the WDCNZ Web Dev Conference in beautiful Wellington, NZ.

    webrtc_talk

    Putting that talk together reminded me about how far we have come in the last year both with the progress of WebRTC, its standards and browser implementations, as well as with our own small team at NICTA and our rtc.io WebRTC toolbox.

    WDCNZ presentation page5

    One of the most exciting opportunities is still under-exploited : the data channel. When I talked about the above slide and pointed out Bananabread, PeerCDN, Copay, PubNub and also later WebTorrent, that’s where I really started to get Web Developers excited about WebRTC. They can totally see the shift in paradigm to peer-to-peer applications away from the Server-based architecture of the current Web.

    Many were also excited to learn more about rtc.io, our own npm nodules based approach to a JavaScript API for WebRTC.

    rtcio_modules

    We believe that the World of JavaScript has reached a critical stage where we can no longer code by copy-and-paste of JavaScript snippets from all over the Web universe. We need a more structured module reuse approach to JavaScript. Node with JavaScript on the back end really only motivated this development. However, we’ve needed it for a long time on the front end, too. One big library (jquery anyone ?) that does everything that anyone could ever need on the front-end isn’t going to work any longer with the amount of functionality that we now expect Web applications to support. Just look at the insane growth of npm compared to other module collections :

    Packages per day across popular platforms (Shamelessly copied from : http://blog.nodejitsu.com/npm-innovation-through-modularity/)

    For those that – like myself – found it difficult to understand how to tap into the sheer power of npm modules as a font end developer, simply use browserify. npm modules are prepared following the CommonJS module definition spec. Browserify works natively with that and “compiles” all the dependencies of a npm modules into a single bundle.js file that you can use on the front end through a script tag as you would in plain HTML. You can learn more about browserify and module definitions and how to use browserify.

    For those of you not quite ready to dive in with browserify we have prepared prepared the rtc module, which exposes the most commonly used packages of rtc.io through an “RTC” object from a browserified JavaScript file. You can also directly download the JavaScript file from GitHub.

    Using rtc.io rtc JS library
    Using rtc.io rtc JS library

    So, I hope you enjoy rtc.io and I hope you enjoy my slides and large collection of interesting links inside the deck, and of course : enjoy WebRTC ! Thanks to Damon, JEeff, Cathy, Pete and Nathan – you’re an awesome team !

    On a side note, I was really excited to meet the author of browserify, James Halliday (@substack) at WDCNZ, whose talk on “building your own tools” seemed to take me back to the times where everything was done on the command-line. I think James is using Node and the Web in a way that would appeal to a Linux Kernel developer. Fascinating !!

  • 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.