text
stringlengths
256
65.5k
After I turned down my computer and came back, steam suddenly needed to update, and the games are gone. I thought the paths to the actual files are gone, as the amount of space that the games take up my partition are still there, as shown by GParted. So, I decided to reinstall Steam, which would only affect the launcher and leave the games right where they are. But now, I have this issue. enter code heredpkg: error processing package steam (--configure): package steam is not ready for configuration cannot configure (current status `half-installed') Errors were encountered while processing: steam E: Sub-process /usr/bin/dpkg returned an error code (1) How do I fix this problem?
App Engine’s Python documentation is sometimes fuzzy on details around caching and cache headers. Here’s a quick overview for those new to the platform. App Engine apps can serve a mix of static and dynamic content. For each, I’ll discuss App Engine’s default behavior and then describe levers that you can pull to customize your app’s caching behavior. Dynamic Content. App Engine apps are just CGI scripts. Let’s start with the simplest possible: print 'Content-Type: text/plain' print '' print 'Hello, world!' (To get going, App Engine also needs an app.yaml configuration file, one section of which maps URLs to scripts. See the App Engine Hello World Tutorial for details.) After uploading our app to Google’s production servers, we use curl -D to see what headers App Engine adds to responses: HTTP/1.1 200 OK Content-Type: text/plain Vary: Accept-Encoding Date: Mon, 24 Oct 2011 21:41:39 GMT Server: Google Frontend Cache-Control: private Transfer-Encoding: chunked Notice the Cache-Control header, which we of course didn’t emit in our script. According to RFC2616, a value of private indicates that all or part of the response message is intended for a single user and MUST NOT be cached by a shared cache. A private (non-shared) cache MAY cache the response. In HTTP parlance, a shared cache is one that multiple users can access. So, by default, the headers added by App Engine’s runtime indicate that it’s okay to cache content so long as only one user can access the cache. App Engine adds the same Cache-Control: private header regardless of whether the request is HTTP or HTTPS. In addition to the Cache-Control header, App Engine also sneaks a Vary: Accept-Encoding header into the mix. The RFC has a bit to say about this, too: The Vary field value indicates the set of request-header fields that fully determines, while the response is fresh, whether a cache is permitted to use the response to reply to a subsequent request without revalidation. In other words, by default, App Engine responses (provided they’re fresh) can be re-acquired directly from caches so long as the Accept-Encoding header hasn’t changed. This seems like a safe default: if a browser needs a different encoding, it won’t want the same response. What to do when you don’t want the default caching behavior? App Engine allows developers to provide their own Cache-Control header. For example, we can prevent caching entirely: print 'Content-Type: text/plain' print 'Cache-Control: no-cache' print '' print 'Hello, world!' A quick trip to curl -D confirms this behaves as expected. But what about the Vary header? print 'Content-Type: text/plain' print 'Cache-Control: no-cache' print 'Vary: X-Something' print '' print 'Hello, world!' App Engine doesn’t quite let us get away with this. The returned Vary header includes both X-Something and Accept-Encoding. This is true even if you use the special Vary: * form. Many of my own App Engine apps aren’t web sites; they’re REST-ful APIs for which Cache-Control: private is not always the right choice. I’m a Django kinda guy, so I often write my own middleware to ensure the right caching headers make their way into my API responses. One last detail of note: there is an App Engine bug related to the other side of the Vary header. App Engine allows you to download content from the web via standard Python libraries. The App Engine edge cache currently ignores the Vary header in downloaded responses. This is in violation of the RFCs and can lead to cache poisoning. For certain apps, I imagine that issue 4277 is a show-stopper. Alas: if history is any guide, and despite the severity of the bug, I wouldn’t expect a fix any time soon… Static Content. App Engine allows you to upload a small amount of static content along with your application. Static content is served through a fast (and less financially expensive) path that doesn’t need to touch application code. To include static content, simply add static file or directory callouts to the handlers section of your app.yaml. (See the application configuration documentation for details.) Let’s fire up curl -D again and check out the headers returned for a sample static file: HTTP/1.1 200 OK ETag: "anYKQA" Date: Tue, 25 Oct 2011 00:42:26 GMT Expires: Tue, 25 Oct 2011 00:52:26 GMT Cache-Control: public, max-age=600 Content-Type: text/plain Server: Google Frontend Transfer-Encoding: chunked For static content, we see that App Engine provides a public Cache-Control response (so any cache may hold on to the returned resource) with a short lifespan of ten minutes. (Again, this is true for both HTTP and HTTPS service.) Thankfully, an ETag is also included in the mix. App Engine gives you both app-wide and fine-grained control over the expiration times for static content. This is configured in your app.yaml. To set an application-wide expiration time, use the default_expiration property, like so: default_expiration: "7d". Or, if you’d like to specify for a specific static_file or static_directory, you can simply hang an expiration property off of each. (See the app configuration documentation for details.) This sort of control over expiration times is handy, but I often need to go one step further. In my experience, new App Engine code often implies changes to my static javascript, css, and image resources. I want my static content to invalidate when I push new code to App Engine. While App Engine updates its ETags on push, most clients won’t make use of this to invalidate the cache. For typical web apps, static content is referenced by dynamic content, so I’ve developed a workable system to change references to static content after every push. Basically, I’ve created a new Django template tag, static_url, that appends a cache buster query parameter to referenced URLs. This isn’t really cache invalidation — instead, we’re handing out entirely new URLs! The effect is the same. I set the buster to the value of the CURRENT_VERSION_ID environment variable provided by the App Engine runtime; the value changes on every push. I built this for Django but the equivalent should be easy to string together in your favorite framework.
spyke Re : La communauté du jeux sous Linux http://www.JeuxLinux.fr jerhum oki mais alors je ny arrive pas a les faire tourner justement est ce normale comme wolfenstein , quake4 etc..... Hors ligne foxylechou Re : La communauté du jeux sous Linux http://www.JeuxLinux.fr il faut autoriser le fichier a être exécuter dans propriétés ofwgkta ------------------------------------------------------------------ Hors ligne andycam Re : La communauté du jeux sous Linux http://www.JeuxLinux.fr Bonjour, Quel est le(s) jeux (toute catégories confondues) qui est unique Linux et que l'on ne retrouve donc nul part ? Merci, Andycam Hors ligne gayelene Re : La communauté du jeux sous Linux http://www.JeuxLinux.fr bonjour svp je veux installer le jeu MONOPOLY sur mon pc aidez moisvp comment faire? merci davance Hors ligne forficule Re : La communauté du jeux sous Linux http://www.JeuxLinux.fr @andycam : un jeu que sous linux, ça colle pas avec ce qu'est linux, si tu as le code source (c'est le cas de beaucoup de jeux sous linux), tu peux le compiler pour d'autres plateformes (macosx, win32...). Honnêtement un jeu qui ne tournerait QUE sous linux, je ne vois pas... Hors ligne Calinou Re : La communauté du jeux sous Linux http://www.JeuxLinux.fr Ouais c'est bien mumble, mais Ya pas la 1.2.0... Hors ligne ArnaudK Re : La communauté du jeux sous Linux http://www.JeuxLinux.fr Bonjour, est-il possible de poster un lien vers un site de revente de jeux linux qui fait des promos ? Je sais que c'est mal vu car certains penseraient que c'est du SPAM Hors ligne ArnaudK Re : La communauté du jeux sous Linux http://www.JeuxLinux.fr Ne serait il pas bon d'ajouter les sites revendeurs de jeux Linux, qu'ils soient français ou internationaux ? ça se compte sur les doigts des deux mains, mais ça pourrait être intéressant. Hors ligne KazukyAkayashi Re : La communauté du jeux sous Linux http://www.JeuxLinux.fr Il y a LGP : http://www.linuxgamepublishing.com/ Sinon j'en parlerai, mais le mieux est de venir faire des propositions sur le forum jeuxlinux Mon Blog --> http://kazuky.homelinux.net/blog Hors ligne Crone123 Re : La communauté du jeux sous Linux http://www.JeuxLinux.fr Bonjour, Moi j'ai ce message qui s'affiche tout le temps: Traceback (most recent call last): File "djl_main.py", line 747, in timerEvent self.maj_liste() File "/home/valentin/djl/djl/diff.py", line 1125, in maj_liste self.etat(self.nom_jeu_depot()) File "djl_main.py", line 809, in etat self.verif_maj_jeu(nom_jeu) File "/home/valentin/djl/djl/diff.py", line 295, in verif_maj_jeu version = self.detail_jeux(no_description, type_info = 'version') File "/home/valentin/djl/djl/diff.py", line 72, in detail_jeux sortie = self.parse_detailjeux(no_jeu, 0) File "/home/valentin/djl/djl/depot.py", line 72, in parse_detailjeux return self.detailjeux['item'][val]['value'] AttributeError: 'Ui_Djl' object has no attribute 'detailjeux' Quelqu'un sait ce que c'est? Merci Hors ligne waston Re : La communauté du jeux sous Linux http://www.JeuxLinux.fr salut a tous je suis nouveau sur ubuntu et sur le forum. j'ai un petit coup de gueule a pousser parce que la je me sent tout perdu et pas une personne pour me répondre clairement j' ai viré w7 de mon pc parce qu'il faisait planter ma machine. j'installe ubuntu 64 bits, super. mais voila que sa ce complique. je sais pas ouvrir un seul programme .exe. j'installe donc wine et wintricks. (il m'as fallu chercher pour trouver sa) ensuite je m'aperçois que fsx pas moyen de l'installer et football manager 2009 non plus ( j'ai était sur la page d'explication pour installer fm2009 et franchement sa marche pas) l'installe ne bouge plus, pourtant je tape tout ce qu'il demande avec E=enter et S et T etc et sa marche pas. j'ai toujours une page grise même après avoir installer direct3d comme demander dans l'explication, et je sais même pas quand l'instal sera finie, bref deux jeux, deux problème. je précise que j'ai ce pc pour moi jouer( le pc pour travailler reste au travail lol) si sous w7 je sais rien installer et maintenant sous ubuntu non plus. j'ai des jeux que je peux mettre a la poubelle et bref mon pc aussi. alors si quelqu'un a une solution miracle , merci de m'aider parce que franchement ras le bol. la seul excuse que ubuntu as par rapport a windows c'est que lui, il est gratuit. sinon c'est le même problème. les créateur de système d'exploitation oublie un peu beaucoup les gamer je trouve. (je suis gamer mais pas informaticien, alors si vous savais m'aider expliquer moi sans mot trop technique s'il vous plait. merci) Hors ligne atichu Re : La communauté du jeux sous Linux http://www.JeuxLinux.fr LEs fichier .EXE c'est des fichiers Windows pas linux/ubuntu... donc tu veux installer des roues de 2CV sur une porche. Tu comprend le bléme? en général les jeu ubuntu sont dans des dêpot ou sont des .deb qui installe le jeu. sinon voir la documention sur le forum /jeu ou le site Alors pour les gamers, faut se plaindre au fabriquand de jeu qui ne fond pas tout des version linux. mais si tu cherche il y en a quand même. certain gros gamers jour a WOW sous linux mais vu qu'il y a pas de version linux c'est pas tout les jours facile. Dernière modification par atichu (Le 31/03/2011, à 16:14) Je ne suis pas un geek ni un informaticien mais j'aime linux/ubuntu. acer aspire5741G (unity 12.04))+une vieillebousse(xfce 12.04) +teste de la version instable Hors ligne keld Re : La communauté du jeux sous Linux http://www.JeuxLinux.fr la seul excuse que ubuntu as par rapport a windows c'est que lui, il est gratuit. sinon c'est le même problème. les créateur de système d'exploitation oublie un peu beaucoup les gamer je trouve. (je suis gamer mais pas informaticien, alors si vous savais m'aider expliquer moi sans mot trop technique s'il vous plait. merci) Je te comprends tout a fait, moi aussi raz le cul, la dernière fois j'ai voulu mettre le dvd, fraichement payé, de Gran Turismo 5 sur ma Wii, bah tu sais quoi? Ça ne voulais pas marché!!! Y'en a marre de ces fabriquant de console qui ne s'occupe pas des gamer!!! L122-1 Powaaaa!!!!! Hors ligne waston Re : La communauté du jeux sous Linux http://www.JeuxLinux.fr je pense que ubuntu est quand même très intéressent; vue que c'est asse facile de l'utiliser. maintenant je vais chercher de mon cote mais.... les jeux linux on les a ou? et franchement es qu'il en val le coup? je suis curieux . maintenant je vais essayer quand meme d'obtenir un windows xp pro 64 bits( w7 c'est vraiment de la M... ) pour pouvoir jouer a mes jeux favoris. en dual boot avec ubuntu je devrais être comblé. merci pour vos réponse. en effet je comprend mieux le problème vue la comparaison avec la deudeuche. Hors ligne goahead Re : La communauté du jeux sous Linux http://www.JeuxLinux.fr Salut Waston,j'ai eu le meme probleme que toi au début mais maintenant ca va, la facons simple avec Wine c'est que quand tu veux installer un jeu tu va dans la CONFIGURATION de Wine et tu vas dans l'onglet (LECTEUR) situé en haut, une page apparait de tous tes lecteur tu clics sur la lettre de ton lecteur que tu as incerré ton jeu et tu fais (PARCOURIRE) situé un peu plus bas. La une fenetre s'ouvre avec tout tes fichier,tu choisi MEDIA tu double clic dessus,apres le nom de ton jeu apparait tu double clic dessus et tu fais OK.ensuite la fenetre se ferme, apres tu fais APPLIQUER. Tu ouvre WINE tu fais désinstaller un logiciel WINE, tu tappes sur installer tu clic sur la petite fleche verte,jusqua tant de voir ceci / tu vas voir la page est pleinne de fichiers tu trouve MEDIA tu double clic dessus le fichier de ton jeu apparait, tu double clic dessus et tu vas voir apparaitre les fichiers du jeu avec SETUP.EXE tu double clic dessus et l'installation commence. c'est de meme que je procede c'est une facon simple. Ca c'est bon pour les DVDROM. Ce qui est des jeux avec plusieurs CD ex: DIABLO 2 tu vas encore dans CONFIGURATION de Wine tu vas dans LECTEUR tu clic sur la lettre de ton LECTEUR,et tu inscis en bas dans la bar /media/cdrom0 et tu fais APPLIQUER. Tu ouvre Wine et tu fais comme je t'ai dit un peu plus haut tu clic sur la fleche verte et tu va chercher MEDIA tu double clic dessus apres le nom de ton jeux apparait tu double clic dessud et tu fais SETUP.EXE. Lorsequ'il te demande d'incerer le DISC 2 tu vas dans ton terminal (ca c'est important) tu tape sudo eject -a sinon ca na marchera pas entout cas pas pour moi,il faut que je fasse cela pour que ca fonctionne.Tu n'éjecte pas ton jeux manuellement. Si tu suit ce que je t'ai écris ca devrais fonctionner. Bonne chance. Dernière modification par goahead (Le 28/05/2011, à 07:44) Hors ligne Crone123 Re : La communauté du jeux sous Linux http://www.JeuxLinux.fr Ouais, mais Wine, ça reste léger, pour ne pas dire complètement nul... Hors ligne goahead Re : La communauté du jeux sous Linux http://www.JeuxLinux.fr Pourquoi est-ce que tu dis ca? Hors ligne SlimGary Re : La communauté du jeux sous Linux http://www.JeuxLinux.fr les créateur de système d'exploitation oublie un peu beaucoup les gamer je trouve. ! C'est pas les développeurs d'OS les fautifs, au contraire, ils mettent des outils de développement à disposition ! Non, les vrais fautifs sont clairement et simplement les éditeurs de jeux ... Et si tu trouves que les développeurs d'OS ne sont pas assez compétents, vas t'acheter une PS3 ou une XboX 360 ! Ouais, mais Wine, ça reste léger, pour ne pas dire complètement nul... Rien a dire ... ah si, scandaleux ! Hors ligne Nemr0D Re : La communauté du jeux sous Linux http://www.JeuxLinux.fr Merci ! C'est très interresent ! Hors ligne Crone123 Re : La communauté du jeux sous Linux http://www.JeuxLinux.fr Pourquoi est-ce que tu dis ca? C'est la vérité, 90% des programmes ne marchent pas, ou marchent mal, et ça crée des tonnes de raccourcis dans la liste de lancement de programmes (donc quand on choisis une application avec laquelle ouvrir un fichier, c'est mort.. [Wine affiche 90programmes supplémentaires dans la liste et c'est souvent 20fois le meme..]), bon, en plus l'affichage est pas Super Joli... (dans le programme, il pourrais y avoir un design Windows plus beau, ou le design de GNOME..) Bref, en tout cas, tous les jeux que j'ai testé sur Wine, qui sont pourtant certifiés, fonctionne bien sur Wine (depuis le site officiel), j'ai eu des désastres.... Pour être franc je ne l'utilise plus, si j'ai vraiment besoin d'un programme Windows, je lance Windows (env 1fois par mois..), mais sinon, je trouve toujours ce que je cherche en natif. (surtout pour développer..) J'utilise surtout mon PC le développement (donc j'ai tout ce qu'il faut en natif) et pour les jeux libres (même si je pense que les développeurs libres devraient faire plus souvent des .deb parce qu'un développeur php "amateur" français ne sait pas forcément compiler un programme C++ en lisant des instructions en anglais, surtout quand il viens d'avoir son brevet.. [Oui je suis encore étudiant...]) Donc, Linux reste Linux, pour des programmes Linux, et Windows reste Windows avec des programmes Windows, c'est sûrement la meilleure chose quand on a pas envie d'encombrer son PC avec des tonnes de trucs qui marchent a moitié, et dont on ne vas pas forcément se servir du coup. Et effectivement, si les développeurs pensaient un peu plus aux autres OS, ça serait mieux. (voir normal.), remarquez, il y a de plus en plus de jeux payants natifs dans la logithèque, peut être que la tendance va changer du coté des gros jeux (Call Of Duty, Crysis, Trackmania, ...) et peut être que l'on pourra les trouver en natif dans la Logithèque →Il faudrait faire une loi qui indique ceci: "Lorsque un développeur sort un programme payant (ou logiciel d'installation [je pense aux imprimantes, scanner par exemple]), il doit en fournir un version pour chaque OS (donc, une Windows, une Linux, et une Mac OS), si il ne veut pas la compiler pour X raison, il doit proposer les sources du logiciel de façon a ce que les utilisateurs (ou communautés) puissent les compiler pour leurs OS (et donc, en faire des .deb pour les dépôts)" Et ça, ça serait normal, pourquoi privilégier un OS instable payant, plutôt qu'un OS stable libre? Hors ligne goahead Re : La communauté du jeux sous Linux http://www.JeuxLinux.fr Oui je suis daccord avec toi,mais si il venait a faire une loi du genre se qui est peu probable pour les raison de droit faudrait que Linux déboursse d'importante somme d'argent pour avoir c'est jeu natif. Comme Wine est une petite communauté il n'ont pas l'argent nécéssaiore pour faire se qu'ils aimerrait faire c'est pour ca que faire un don a ces programmes aide a la communauté de se développer. Hors ligne Rαiden Re : La communauté du jeux sous Linux http://www.JeuxLinux.fr Désolé de casser votre réflexion mais je ne suis pas d'accord pour ce genre de loi. Chacun fait ce qu'il veut, si les éditeurs n'ont envie de sortir leurs jeux et logiciels que pour Windows grand bien leur fasse mais hors de question d'obliger les gens à le faire. Sinon Je trouve que cela va à l'encontre des principes de liberté qui animent GNU/Linux à la base ce serait dommage, quand on force les gens à faire quelque chose on sait tous ce que ça donne des choses bâclées voir inutilisables. Concernant Wine en fait Wine existe en premier lieu à travers Crossover qui est une entreprise commerciale c'est vrai qu'ils n'ont pas énormément d'argent mais ils ont un statut d'entreprise qui peut au moins peut faire écho dans le milieu. Comme ils ont un pied dans le propriétaire ça serait cool qu'il prennent au moins la place laissez vacante par Cedega vis à vis de certains éditeurs. Hors ligne goahead Re : La communauté du jeux sous Linux http://www.JeuxLinux.fr Je suis d'accord avec toi aussi,mais ne serrait-il pas le temps pour Linux de vouloir faire plaisir au Linuxiens d'avoir des jeux qu'ont pourraient jouer sans se casser la tete, a savoir si Wine va l'accepter je sais que le sujet c'est déjà parlé,mais la on est en 2011 et c'est le temps que Linux fasse le saut.Je sais que ca couterait des sous mais les jeux ont les achetent,donc un revenu pour Linux. Hors ligne Rαiden Re : La communauté du jeux sous Linux http://www.JeuxLinux.fr En fait le problème (pour moi ça n'en est pas un mais bon) vient du fait que Linux est un noyau et seulement un Noyau il n'a qu'une fonction technique et pas franchement politique à part celle le concernant. Là ou le lobbying doit être fait c'est au niveau des distributions Ubuntu par exemple et comme on a 50 000 distributions ça n'aide pas à créer de grosses structures influentes qui peuvent rivaliser avec Microsoft et Apple. Du fait qu' il n'y ai pas de grosse structure la pression sur les éditeurs de jeux-vidéos est nulle c'est donc les développeurs qui choisissent en leur âme et conscience de développer pour GNU/Linux, moi je préfère honnêtement car c'est un acte en général altruiste et ça le reste. Quand un jeu sort sous GNU/Linux tu sais que c'est parce que le développeur à un attachement particulier à notre plateforme, qu'il a voulu faire plaisir à tous les utilisateurs et ça ça fait chaud au coeur. Parfois pour les développeurs indépendant c'est pour des raisons financières mais même si c'est le cas ce sont des gens qu'il faut encourager car ils sont l'avenir du secteur. Comme tu vois ce n'est pas à Linux de faire plaisir aux Linuxiens, Linux n'est qu'un noyau c'est aux éditeurs/développeurs de se bouger le cul car tous les outils existent pour développer correctement sous GNU/Linux c'est juste le choix de ne pas le faire pour des raisons financières en ce qui les concerne. Dernière modification par Rαίdeη (Le 23/07/2011, à 08:10) Hors ligne goahead Re : La communauté du jeux sous Linux http://www.JeuxLinux.fr Merci de ton idée,je viens d'en apprendre beaucoup,se qui reste le mieux pour les jeux c'est un bon Xbox 360 ou un Playstation.Mais il reste que et j'espere, que Linux devienne plus qu'un simple Noyau.Il disent que Linux Mint est le 4eme systeme d'exploitation le plus utilisé au monde,il pourrait sen doute grossire la machine,mais c'est un peu comme si on voudrait changer la mentalité de LInux et je ne pense pas qu'il sont pret pour cela. Je me trompe peut-etre j'en suis sure que quelqu'un saura me le dire. Hors ligne
I'm quite new to Django & Tastypie. I would like to return only one of the objects from the query. I've tried almost everything and cannot seem to find the solution. Here is my code below: class ProfileResource(ModelResource): person = fields.ForeignKey(UserResource, 'user', full=True) class Meta: queryset = Person.objects.all() resource_name = 'profile' authentication = BasicAuthentication() authorization = DjangoAuthorization() serializer = Serializer(formats=['json']) Now the part I'm having trouble with is how can I return a single user object from a single resource using request.user.
ddg.velamp external This is probably a silly question but: Where do I put this external in Max6? I’ve placed it everywhere and have even made an ‘externals’ folder in ‘file preferences’ and pointed to it but Im still having no luck. Putting it in ‘patches’ or ‘examples’ which I understand is the default directory to place externals has no effect. I have done heaps of tutorials and just wanted to make a basic synth but this is driving me up the wall! Thanks Assuming you have the correct version of this extern for your platform and version of Max Try putting it inside the Cycling ’74 folder in your Max6 application folder. Restart Max I have a folder in my Cycling ’74 folder I use as a catch-all for 3rd party stuff and things I need to be automatically included in the Max search path. It doesn’t get deleted or over-written when I install a new version of Max. -A Yeah ive done that. It opens in Max6 but I cant get it to show up in the object explorer. Its so frustrating! I cant seem to find any other version so Im not sure although I know the tutorial was written a long time ago. I was really liking it as I could actually play with and make music with this synth. If anyone out there knows where to get a more compatible version or even knows of any tutorials like it that are more current Id really like to know about them. I think I need something to break up the standard included tutorials in Max and actually have some fun. If anyone can help Id greatly appreciate it! Thanks Open ddg.velamp in Max6, save it in Max6 format, dropped in Extras folder, restart, and then it show up for me. Ah yes I forgot that it’s an abstraction. As such it will not show up in autocompletion until you have already used it in a Max session. Here it is allof the following text. Then, in Max, select New From Clipboard. ----------begin_max5_patcher---------- 1254.3oc2Z88aaaCD9Y6+JHD5CqCtd5n9E0dn.Ca.C60sh8xZwfrDiCakoLj jyRWQ6e6ijmjsSlMCsqshcCBrDYnIu6ie2w6NlOMdj2rp64Mdjej7WjQi9z3 QiLco6XTW6QdKxtOuLqwLLupUsk7VuI3eZYVa9sB47+tlm2hSCDGL0eBIz2W +.h5+j7ttuin.mnYu+UP+7HWsPHUyqYMfMchqloW+tdyqVrfKMKl220HlKyJ eI4O4kU4h1O9pl7rRdAgKuS0yRNQMAKW05o+ped7X8GSbTQk7+QIh8BXK+db I+ABPYS66Fku1OtjiJu2MkUYpA9NK3SJngDZZhAlBM3S5twGZ+5bSkrUlsvr Jd+JWxuKamPGcqw2H9Wy3Uy8NAT3zAJhaHuP.jWS7Is2xk5F6EgbBbRn5Go9 1.mfCEbfmGv46+Bwe+DFjAaGTPKp.pANBRsAJgWILl5rEKaVTU0d6WHTe0um B.JL1vZrBPQGJ.E7LwZrgIBoceLzTCf.gHtX0LJ9Jgw7UAHPRny.RxkFfrf2 zjMm++PjFdqxyB4suUoKSIu3Xc41AMwL8iD775jcCMrqEnwepAST5l+QhJnK E.OklkXCURudPkilkPY.hGFWrALa3A3ek3RoTH4tb37Dh2rL4bWHLTv.MgTa dX.3bBPzSHiwn1ccpQq7pUXn2zihEEf1Qfw+KkgwAuGLhdsXUchwHvO1cPJ3 ZIbO0zxIV7EOwIlClPPh0.7fvKMiq8fIulb7wyfvQbJlrjU3H5Rihzm.+iwi emWxyZ3j2HVvsTegftRJXhZIN1ptGeNSQz+Dp6+TaaV9GdJUGRC2R0seDSxk lpaVoiL3itzYBbnhRrcpb6g8tqRJoL8dIomK1p2PFVksOdbWT1zShx1Q9dFz 0TW0zMo98Uoo8kIjHjGYUA2mA75Y92jd1hhdi8aDyZk+fqEWW+BukWqjCkwR sXNISVPp4kD9cpA2XMtnc.PX5mQlSzRvb0g8.PzqE.5IpM8zCEi.FCqCn4rO F0JJEbogRKyj7x9UVkdUkRwJE4eX60d177pxpZTc8mxR7iXrIp2hXgAP31us sduKCNjOg9VnX4A2mKl0wMpBVUVvK11Ayrp5Bd8itbhm7FKNgjn+f2RVsTWc 807Ga9Y5Ra.Ue.reICQeKvQBRoPrlYndFEmpeiEq9I4I4H.5toid.IXgNf38 fVwWxzjetlmoRzRSS5t4qCz4BEvKfIx7fEa04Rx2VDGeHMFLu4lyEHDsxBwv XhvpJqM81IZwNmDGyJZ1kezs4Zjac+OD1ZpVUm2GiVefyjMBdAuoUHyZEUxs FT7CFyshhBtba0nPzjMqrS0149myhC0AwQWnQqxyBQwxJgrsCSBimFoi2jh0 TwecqMqyISAhOCxefO0HxrvsU.cqyfB3xFf5HSBLH7g.GjF5fwNo9NHNAG1l KV3XZDt25a1aMsNC6sINH9rgyVO0AwIYvDmHWrbGLoIzAoIZ31p.G8JLLhiK DGX31q.+Sg77H+Bct4ocAwmPW25L3X.bwOa5A5XChvCZS2RALsNCJ.6LH+r. iD28eiTm7qacN1.d3Qp6gBELbTZW7+.C2IufSdmCurhD.hNlPAvKYGiYMf4. aCyAHa4x630McRfQvUII8dLim3IllBI1zr9d076D8iObrd1973+y0T3oV -----------end_max5_patcher----------- thanks for bearing with me guys… I have opened it in Max6. Saved it. Put it into extras. Now it shows up in the drop down extras menu as patch but will still not show up as an object in the explorer. Just to clarify, Rick, does it actually show up as an object for you or just a patch? Thanks for your help! @cs1122, does it really matter? as long as you can save this as "ddg.velamp" in your max search path and then type "ddg.velamp" into an empty object box and it show up, that is all you need surely? however, i sympathise with you. from memory, those tutorials are ridiculously old and do not have that much to do with modern max. you might want to play around with examples from the examples folder (extras menu), such as "X.FM~" etc. there should really be more synth tutorials for max. i have to say, that ddg.velamp abstraction is over 10 years old. i cannot actually believe a cycling74 employee is happy to still put that about. it is awful. the least you could do is take the three mins needed to update it to a less Max3-ish state. such as the attached. Attachments: Ah the penny has dropped at last! Thanks pid. Didn’t realise I could just use it as an object and attach my own dials. I was expecting to see something like in tutorial as the object itself and was stumped as to why mine looked totally different. Its working, and ive learnt something new, so thats the main thing. Thanks for the heads up on the X.FM example. Ill check it out. FWIW you can get the ddg.velamp abstraction/patch to work like an object. Open the object explorer, click on the Patchers tab and select ddg.velamp. It should load into your patch like an object.
I was wondering the same the other day, what I found on internet was that the best way to make a search with like and text is 'WORD%' with the % at the end (text that end with word will not be found) if you can't use that your query will go row by row and word by word, reading all the text of each result to find the matches. Other Options that I saw (it doesn't make too much sense to me) it's to separate the query, select * from actor where first_name like 'alex%' or first_name like '%alex'; I think there is a full text index that will help a lot (let me see if I can find the info and edit my post) EDIT: here it's the information of full text index, first, engine HAVE TO BE MyISAM add the index text, ALTER TABLE fulltext_sample ADD FULLTEXT(column_name) A list of the main features of a standard FULLTEXT search follows: Excludes partial words Excludes words less than 4 characters in length (3 or less) Excludes words that appear in more than half the rows (meaning at least 3 rows are required) Hyphenated words are treated as two words Rows are returned in order of relevance, descending Words in the stopword list (common words) are also excluded from the search results. The stopword list is based upon common English words, so if your data is used for a different purpose, you'll probably want to change the list. Unfortunately, doing so at present is not easy. You'll need to edit the file myisam/ft_static.c. recompile MySQL, and rebuild the indexes! To save you hunting through the source, or if you have a binary version of MySQL, here is a list of stopwords. Note that these can and do change with different versions. To be absolutely sure, you'll have to check the specific list for your version. With this you can improve your search by fulltext using the '%Axel%'
I've been working on creating a subclass of db.Model that is automatically cached, i.e.: instance.put would store the entity in memcache before persisting it to the datastore class.get_by_key_name would first check the cache, and if missed, would go to the datastore to retrieve it and cache it after retrieval I developed the approach below (which appears to work for me), but I have a few questions: I had read Nick Johnson's article on efficient model memcaching which suggests implementing the serialization for memcache through protocol buffers. Looking at the memcache API source code in the SDK, it looks like Google has already implemented protobuf serialization by default. Is my interpretation correct? Am I missing some important details (which could get me in the future) in the way I am subclassing db.Model or overriding the two methods? Is there a more efficient way of implementing what I've done below? Are there guidelines, benchmarks or best practices for when such entity caching would make sense from a performance perspective? Or would it alwaysmake sense to cache entities? On a related note, should I be reading anything into the fact that Google hasn't provided a cached model in the modeling API? Are there too many special cases to be thinking about? Below is my current implementation. I would really appreciate any and all guidance/suggestions on caching entities (even if your response is not a direct answer to one of the 4 questions above, but relevant to the topic overall). from google.appengine.ext import db from google.appengine.api import memcache import os import logging class CachedModel(db.Model): '''Subclass of db.Model that automatically caches entities for put and attempts to load from cache for get_by_key_name ''' @classmethod def get_by_key_name(cls, key_names, parent=None, **kwargs): cache = memcache.Client() # Ensure that every new deployment of the application results in a cache miss # by including the application version ID in the namespace of the cache entry namespace = os.environ['CURRENT_VERSION_ID'] + '_' + cls.__name__ if not isinstance(key_names, list): key_names = [key_names] entities = cache.get_multi(key_names, namespace=namespace) if entities: logging.info('%s (namespace=%s) retrieved from memcache' % (str(entities.keys()), namespace)) missing_key_names = list(set(key_names) - set(entities.keys())) # For keys missed in memcahce, attempt to retrieve entities from datastore if missing_key_names: missing_entities = super(CachedModel, cls).get_by_key_name(missing_key_names, parent, **kwargs) missing_mapping = zip(missing_key_names, missing_entities) # Determine entities that exist in datastore and store them to memcache entities_to_cache = dict() for key_name, entity in missing_mapping: if entity: entities_to_cache[key_name] = entity if entities_to_cache: logging.info('%s (namespace=%s) cached by get_by_key_name' % (str(entities_to_cache.keys()), namespace)) cache.set_multi(entities_to_cache, namespace=namespace) non_existent = set(missing_key_names) - set(entities_to_cache.keys()) if non_existent: logging.info('%s (namespace=%s) missing from cache and datastore' % (str(non_existent), namespace)) # Combine entities retrieved from cache and entities retrieved from datastore entities.update(missing_mapping) if len(key_names) == 1: return entities[key_names[0]] else: return [entities[key_name] for key_name in key_names] def put(self, **kwargs): cache = memcache.Client() namespace = os.environ['CURRENT_VERSION_ID'] + '_' + self.__class__.__name__ cache.set(self.key().name(), self, namespace=namespace) logging.info('%s (namespace=%s) cached by put' % (self.key().name(), namespace)) return super(CachedModel, self).put(**kwargs)
#1476 Le 27/06/2013, à 20:53 The Uploader Re : /* Topic des codeurs [8] */ Je ne suis pas sûr de comprendre la question pour le coup. En fait, je rajoute ceci : position: relative; À ce code de app/assets/stylesheets/application.css : #preview { float:left; width: 46%; height: 100%; border-left:5px solid gray; overflow: auto; padding: 10px; } Et ça ne change rien (l'article est toujours partiellement recouvert par la splitbar) Si je le fais dans la propriété "style" de la balise <div id="preview"> dans Firebug, ça fonctionne. Et dans l'onglet Style de Firebug, j'ai : #preview { [...] position: relative; qui est barré. Ça confirme qu'il est ignoré. Pourquoi, j'en sais rien. J'me dis que c'est le style du div parent qui prend effet à la place, mais il y a rien de ce côté là. Ok. Des bonnes nouvelles? Pas de nouvelles. (sinon j't'ai envoyé un mail sur RReader) Dernière modification par The Uploader (Le 27/06/2013, à 20:59) Passer de Ubuntu 10.04 à Xubuntu 12.04 LTS Archlinux + KDE sur ASUS N56VV. ALSA, SysV, DBus, Xorg = Windows 98 ! systemd, kdbus, ALSA + PulseAudio, Wayland = modern OS (10 years after Windows, but still...) ! Deal with it ! Hors ligne #1477 Le 27/06/2013, à 20:59 Rolinh Re : /* Topic des codeurs [8] */ Je t'avoue que quand ça touche au CSS... je t'avoue que je suis limité ^^ Faire des GUI m'a toujours emm****, spécialement pour le web ou chaque navigateur interprète les choses différemment. Pour le coup, l'utilisation de Twitter bootstrap rend la chose moins pénible Je vais faire quelques tests et voir si je trouve ce qui cloche Et j'ai répondu à ton mail. EDIT: j'ai essayé d'ajouter juste ça. Pour moi ça ne change absolument rien. Tu avais apporté d'autres changements? Dernière modification par Rolinh (Le 27/06/2013, à 21:02) Hors ligne #1478 Le 27/06/2013, à 21:05 The Uploader Re : /* Topic des codeurs [8] */ Pareil. D'où l'appel à l'aide. ^^ Ok pour le mail. EDIT: j'ai essayé d'ajouter juste ça. Pour moi ça ne change absolument rien. Tu avais apporté d'autres changements? Par ici : ./viewtopic.php?pid=13957101#p13957101 Dernière modification par The Uploader (Le 27/06/2013, à 21:06) Passer de Ubuntu 10.04 à Xubuntu 12.04 LTS Archlinux + KDE sur ASUS N56VV. ALSA, SysV, DBus, Xorg = Windows 98 ! systemd, kdbus, ALSA + PulseAudio, Wayland = modern OS (10 years after Windows, but still...) ! Deal with it ! Hors ligne #1479 Le 27/06/2013, à 21:12 Rolinh Re : /* Topic des codeurs [8] */ Tu pourrais pusher ta branche pour le coup? (oups, ça devient IRC ici ^^) Hors ligne #1480 Le 27/06/2013, à 21:20 The Uploader Re : /* Topic des codeurs [8] */ C'est fait. Passer de Ubuntu 10.04 à Xubuntu 12.04 LTS Archlinux + KDE sur ASUS N56VV. ALSA, SysV, DBus, Xorg = Windows 98 ! systemd, kdbus, ALSA + PulseAudio, Wayland = modern OS (10 years after Windows, but still...) ! Deal with it ! Hors ligne #1481 Le 27/06/2013, à 21:45 grim7reaper Re : /* Topic des codeurs [8] */ grim7reaper a écrit : Un jour j’avais eu un TP de ce genre (mais sur un truc encore moins puissant que ça encore). On avait utilisé Boa comme serveur web. J'étais tombé sur Boa en faisant quelques recherches. Tu l'avais trouvé bien? Quel langage avais-tu utilisé? Je viens de vérifier, le CPU que l’on avait était cadencé à 200 Mhz. Pour situer le contexte, on avait deux cartes qui communiquait en RS232. L’une des cartes avec un prog’ en C multithread qui simulait un capteur de température (on utilisait deux threads car il fallait envoyer les mesures + recevoir et traiter les commandes en provenance de l’autre carte). L’autre carte, sur laquelle on avait une interface web qui permettait d’afficher les info’ du capteurs et d’envoyer des commandes (genre changement de fréquence d’acquisition ou arrêt du capteur). Pour le coup, on avait pas de gros besoin au niveau de l’interface web donc ouais ça allait bien. Pour le langage je sais que Boa prends au moins les CGI en Perl et en C (nous on devait le faire en C, m’enfin c’est mon partenaire qui s’est fait chier à générer du HTML à base de printf , perso moi j’avais préférer faire mumuse avec les threads et le RS232 ) Édit : Thus, any language that can be used as a CGI will work just fine, and this includes the popular scripting languages Python, Perl, and PHP. Dernière modification par grim7reaper (Le 27/06/2013, à 21:49) Hors ligne #1482 Le 27/06/2013, à 21:46 Rolinh Re : /* Topic des codeurs [8] */ J'ai la solution pour le coup. Vu que tu as mis un margin-left de 20px à la vsplitbar, il suffit de mettre un margin-left de 20px également à #preview. EDIT: @grim: Je suis pas assez mazot pour faire du web en Perl (que je ne connais pas d'ailleurs) ou en C. Si je peux me faciliter la vie avec un langage haut-niveau, je ne vais pas me gêner ^^ Je n'ai pas non plus un énorme besoin au niveau de l'interface web mais bon, un minimum quand même. Pour ton edit, je crois que je vais partir sur du Python avec bottle pour le coup. A moins que quelqu'un me suggère un autre framework web simple et léger. Dernière modification par Rolinh (Le 27/06/2013, à 21:52) Hors ligne #1483 Le 27/06/2013, à 22:03 The Uploader Re : /* Topic des codeurs [8] */ Ah cool. J'avais testé différentes marges, mais peut-être pas ça. J'm'étais aussi sûrement focalisé sur "position: relative;" parce que ça m'avait l'air plus élégant que des marges "en dur". Passer de Ubuntu 10.04 à Xubuntu 12.04 LTS Archlinux + KDE sur ASUS N56VV. ALSA, SysV, DBus, Xorg = Windows 98 ! systemd, kdbus, ALSA + PulseAudio, Wayland = modern OS (10 years after Windows, but still...) ! Deal with it ! Hors ligne #1484 Le 28/06/2013, à 18:56 Didier-T Re : /* Topic des codeurs [8] */ Bonjour à tous, c'est le premier code que je souhaite soumettre à vos avis experts. Et j'aurais une petite question à vous poser. Est-il possible de conserver un menu ouvert après lui avoir demandé de lancer une action (en l’occurrence démarrer / arrêter un Conky)? ConkyControl.py #!/usr/bin/python3 # coding: utf-8 # ======================================================================================== # # Script de Didier-T # license GPL V3 or later # # Description : script permettant la gestion simplifier d'une bibliothèque de conky. # # ======================================================================================== # ----------------------------------------------- # Ajout de bibliothèques utiles # ----------------------------------------------- from tkinter import Menubutton, Menu, Canvas, Frame, GROOVE, LEFT, IntVar, filedialog, Toplevel, Label, Tk, Entry from tkinter.filedialog import askopenfilename from tkinter.simpledialog import askstring, askinteger from tkinter.messagebox import askokcancel, showinfo, CANCEL from subprocess import check_output, Popen from os import path, system from re import search, findall Version='1' ## Données utiles ## homedir = path.expanduser('~') listfichier=[["Perso", "~/.scripts/Conky/conky_liste"], ## Attention à ne pas modifier cette ligne ## ["Base", "~/.scripts/Conky/conky_liste1"], ["Bar", "~/.scripts/Conky/conky_liste2"], ["Extra", "~/.scripts/Conky/conky_liste3"], ["Cover", "~/.scripts/Conky/conky_liste4"]] Fichier_Demarrage_Auto="~/DemConky.sh" class fonctions(): def __init__(self): self.listfichier=[] for chemin in listfichier: chemin[1]=chemin[1].replace("~", homedir) if path.isfile(chemin[1]): self.listfichier.append(chemin) def initialisation(self): ## Récupération du temps de latence fichier de démarrage automatique ## fichier=Fichier_Demarrage_Auto.replace("~", homedir) if path.isfile(fichier): fiche = open(fichier, "r") lines = fiche.readlines() fiche.close() for line in lines: if search("sleep", line) is not None: Latence=findall('-?\d+', line)[0] break else: Latence=5 ## Initialisation des bases de données et vérification des conkys lancés ## ### Scan Conky lancés ### ConkyLances=fonctions.scan() ### Création bases de données ### BasesConky=[] for base in self.listfichier: BasesConky.append([base[0],fonctions.lecture(base[1], ConkyLances)]) return BasesConky, ConkyLances, Latence def scan(): ## Scan processus extraction des conkys actifs ## Scan=check_output("ps ax | awk '/\ conky\ .*-c/'", shell=True).decode('utf-8').split('\n') index=0 retour={} while index < len(Scan)-1: Scan[index]=Scan[index].split() retour[Scan[index][len(Scan[index])-1]]=Scan[index][0] index=index+1 return retour def lecture(fichier, ConkyLances): ## Extraction liste conky + chemin de lancement ## fiche = open(fichier, "r") lines = fiche.readlines() fiche.close() base1 = [] base_de_donnee = [] index=0 index1=0 for line in lines: line=line.replace("\n", '') index=index+1 if index % 2: base1.append(line) else: line=line.replace("~", homedir) base1.append(line) if ConkyLances.get(line) is not None: base1.append(1) else: base1.append(0) base_de_donnee.append(base1) base1=[] return base_de_donnee def ecriture(self, BasesConky): ## modification d'un fichier base de données ## fichier=self.listfichier[0][1] fiche = open(fichier, "w") for Bases in BasesConky: information = Bases[0]+"\n"+Bases[1]+"\n" fiche.write(information) fiche.close() class MenuBar(Frame): ## Barre de menu déroulant ## def __init__(self, boss = None): self.MenuConky={} self.SuppConky={} self.ConkyLances={} self.BasesConky, self.ConkyLances, self.TempLat = fonctions.initialisation(fonctions()) Frame.__init__(self, borderwidth = 2, bd = 1, relief = GROOVE) ## Menu Fermer ## fermeMenu = Menubutton(self, text = 'Fermer', relief = GROOVE) fermeMenu.pack(side = LEFT) ### Partie déroulante ### fM = Menu(fermeMenu, tearoff=0) fM.add_command(label='Terminer', underline = 0, command = boss.quit) #### Intégration du menu #### fermeMenu.configure(menu = fM) ## Menu Conky liste ## self.ListeMenu = Menubutton(self, text = 'Conky Listes', relief = GROOVE) self.ListeMenu.pack(side = LEFT) ### Partie déroulante ### self.menuliste() ## Menu Conky gestion ## self.GestionMenu = Menubutton(self, text = 'Conky Gestion', relief = GROOVE) self.GestionMenu.pack(side = LEFT) ### Partie déroulante ### self.menuSup() ## Menu Gestion démmarage ## AutoRunMenu = Menubutton(self, text = 'Démarrage Automatique', relief = GROOVE) AutoRunMenu.pack(side = LEFT) ### Partie déroulante ### ARM = Menu(AutoRunMenu, tearoff=0) ARM.add_command(label='Latence démarrage', underline = 0, command=self.latence) ARM.add_command(label='Enregistrement', underline = 0, command=self.DemAuto) #### Intégration du menu #### AutoRunMenu.configure(menu = ARM) ## Réglage latence démarrage ## def latence(self): self.TempLat=askinteger(title='Réglage latence', prompt='Temps en secondes', initialvalue=self.TempLat) ## Enregistrement du fichier de démarrage automatique ## def DemAuto(self): fichier=Fichier_Demarrage_Auto.replace("~", homedir) FichDem=["#!/bin/bash", "# License GPL", "", "sleep "+str(self.TempLat)+";"] for conky in self.ConkyLances: FichDem.append('sh -c "conky -c '+conky+' &"') fiche = open(fichier, "w") fiche.write('\n'.join(FichDem)) fiche.close() system("chmod ugo+x "+fichier) showinfo(title="Démarrage automatique",message="Fichier "+Fichier_Demarrage_Auto+" modifié") ## Mise à jour des menus ## def MajMenu(self): self.GM.destroy() self.menuSup() self.lM.destroy() self.menuliste() ## Création / Mise à jour des sous menus lancement conky ## def menuliste(self): self.lM = Menu(self.ListeMenu, tearoff=0) for name in self.BasesConky: listeC=Menu(self.lM) self.MenuConky[name[0]]={} index=0 for val in name[1]: self.MenuConky[name[0]][val[1]]=IntVar() listeC.add_checkbutton(label=val[0], variable=self.MenuConky[name[0]][val[1]], command=self.choixactifs) self.MenuConky[name[0]][val[1]].set(val[2]) index=index+1 self.lM.add_cascade(label=name[0], underline = 0, menu=listeC) #### Intégration du menu #### self.ListeMenu.configure(menu = self.lM) ## Création / Mise à jour du sous menu suppression conky ## def menuSup(self): self.GM = Menu(self.GestionMenu, tearoff=0) self.GM.add_command(label='Ajout', command=self.ajouter, underline = 0) listeS=Menu(self.GM, tearoff=0) for val in self.BasesConky[0][1]: self.SuppConky[val[1]]=IntVar() listeS.add_checkbutton(label=val[0], variable=self.SuppConky[val[1]], command=self.supp) self.GM.add_cascade(label='Suppression', underline = 0, menu=listeS) #### Intégration du menu #### self.GestionMenu.configure(menu = self.GM) ## Lancement ou extinction d'un conky choisi par l'utilisateur ## def choixactifs(self): self.ConkyLances=fonctions.scan() for name in self.MenuConky: for chemin in self.MenuConky[name]: if self.ConkyLances.get(chemin) is not None: if self.MenuConky[name][chemin].get() == 0: Popen('kill '+self.ConkyLances.get(chemin), shell=True) else: if self.MenuConky[name][chemin].get() == 1: Popen('conky -c '+chemin+' &', shell=True) ## Suppression d'un conky au Conky Preso ## def supp(self): index=0 while index < len(self.BasesConky[0][1]): if self.SuppConky.get(self.BasesConky[0][1][index][1]) is not None: if self.SuppConky[self.BasesConky[0][1][index][1]].get() == 1: rep=askokcancel(title='Suppréssion', message='Êtes-vous certain de vouloir supprimer le conky '+self.BasesConky[0][1][index][0]+' de conky contrôle ?', default=CANCEL) if rep==True: self.BasesConky[0][1].remove(self.BasesConky[0][1][index]) fonctions.ecriture(fonctions(), self.BasesConky[0][1]) self.MajMenu() else: self.SuppConky[self.BasesConky[0][1][index][1]].set(0) break index=index+1 ## Ajout d'un conky au Conky Preso ## def ajouter(self): Chemin=askopenfilename() if Chemin: NomNouvConky=askstring(title='nouveau conky', prompt='Nom du nouveau conky') if NomNouvConky is not None: self.BasesConky[0][1].append([NomNouvConky, Chemin, 0]) fonctions.ecriture(fonctions(), self.BasesConky[0][1]) self.MajMenu() class application(Frame): ## Application principal ## def __init__(self, boss = None): Frame.__init__(self) self.master.title('Conky Contrôle') mBar = MenuBar(self) mBar.pack() self.can = Canvas(self, bg='light grey', borderwidth=2) self.can.pack() self.pack() if __name__ == '__main__': app = application() app.mainloop() Edit : comme vous pouvez le voir j'aime bien faire mes courses au détail Dernière modification par Didier-T (Le 28/06/2013, à 22:30) Hors ligne #1485 Le 28/06/2013, à 21:29 :!pakman Re : /* Topic des codeurs [8] */ @Rolinh : merci ... Hors ligne #1486 Le 29/06/2013, à 19:54 :!pakman Re : /* Topic des codeurs [8] */ @ux pythonneux : Je me posait la question, utilisez-vous souvent Python (voir même Ruby ou autres langages interprétés, d'ailleurs) pour des applications coté client et à destination du grand public (plus ou moins novice donc) ? Vu que la plateforme Python, contrairement à Java, n'est sans doute pas installée chez madame Michu, vous gérez le cas comment ? Vous utilisez un autre langage (Python n'étant pas forcément très adapté à la distribution) Vous envoyez mme Michu sur le site de python pour qu'elle le télécharge et l'installe Vous embarquez une version de Python, qui s'installe automatiquement si la plateforme n'est pas présente sur la machine de mme Michu Tant pis pour madame Michu, elle ne fait pas partie du public ciblé par mon application (mon public visé est censé s'y connaitre un minimum) Autre... Dernière modification par :!pakman (Le 29/06/2013, à 20:09) ... Hors ligne #1487 Le 29/06/2013, à 21:45 xapantu Re : /* Topic des codeurs [8] */ Déjà, ça dépend beaucoup de ta plateforme cible, si c'est pour une distribution gnu/linux, tu as toujours python installé (ou de toutes façons, avec le packaging, ça passe), dès que tu as une distribution grand public du moins. Sur Windows, il y a py2exe qui permet d'embarquer python directement qui marche pas mal (c'est pas d'une grande légèreté, mais quand c'est bien fait et qu'il n'y a pas trop de dépendances, ça marche vraiment bien). Pour Mac OS X, je ne sais pas trop comment ça fonctionne. Et pour Android, il y a des procédés qui permettent d'embarquer un interpréteur dans un apk directement je crois. Hors ligne #1488 Le 30/06/2013, à 11:48 tshirtman Re : /* Topic des codeurs [8] */ pyinstaller… Hors ligne #1489 Le 30/06/2013, à 14:49 :!pakman Re : /* Topic des codeurs [8] */ Merci pour les pistes ... Hors ligne #1490 Le 01/07/2013, à 03:41 grim7reaper Re : /* Topic des codeurs [8] */ @Rolinh : Dans words_processing.py : def tf(data): mat = numpy.asarray(data.values()) return TfidfTransformer(use_idf=False).fit_transform(mat) def tf_idf(data): mat = numpy.asarray(data.values()) return TfidfTransformer(use_idf=False).fit_transform(mat) Pour la seconde fonction, use_idf ne devrait pas être à True ? Dans le même fichier, pour la fonction remove_stopwords : chars = ['.', '/', "'", '"', '?', '!', '#', '$', '%', '^', '&', '*', '(', ')', ' - ', '_', '+' ,'=', '@', ':', '\\', ',', ';', '~', '`', '<', '>', '|', '[', ']', '{', '}', '"', '-',] Il y a deux fois ", et ça pourrait être remplacé par : chars = list(punctuation) + [' - '] avec un from string import punctuation bien sûr Et enfin, pour la fonction filter_tweet_words tu peux remplacer filtered_words = [] tokeep = ['JJ', 'JJR', 'JJS', 'NN', 'NNS', 'NNP', 'NNPS', 'VB', 'VBD', 'VBG', 'VBN', 'VBP', 'VBZ'] text = preprocessing(tweet.text) token = nltk.word_tokenize(text) tags = nltk.pos_tag(token) for tag in tags: if tag[1] in tokeep: filtered_words.append(tag[0]) return filtered_words par tokeep = ['JJ', 'JJR', 'JJS', 'NN', 'NNS', 'NNP', 'NNPS', 'VB', 'VBD', 'VBG', 'VBN', 'VBP', 'VBZ'] text = preprocessing(tweet.text) token = nltk.word_tokenize(text) return filter(lambda tag: tag[1] in tokeep, nltk.pos_tag(token)) Dans utils.py, json_to_tweets_helper : if bad_data: screen_name = '' in_reply_to_status_id = \ in_reply_to_user_id =\ favorite_count = \ retweet_count = \ user_favorite_count = \ followers_count = \ friends_count = \ statuses_count = 0 verified = False Ça c’est pas très joli et en plus c’est inutile (tu n’économises même pas une ligne). Autant faire : if bad_data: screen_name = '' in_reply_to_status_id = 0 in_reply_to_user_id =0 favorite_count = 0 retweet_count = 0 user_favorite_count = 0 followers_count = 0 friends_count = 0 statuses_count = 0 verified = False Et ça : hashtags = [] for hashtag in tw['entities']['hashtags']: hashtags.append(h.Hashtags(hashtag['text'])) urls = [] for url in tw['entities']['urls']: urls.append(u.Url(url['display_url'])) Ça pourrait être fait à coup de map : hashtags = map(lambda hashtag: h.Hashtags(hashtag['text']), tw['entities']['hashtags']) urls = map(lambda url: u.Url(url['display_url']), tw['entities']['urls']) Sinon, de manière générale, je préfère utilisé format plutôt que %. Dernière modification par grim7reaper (Le 01/07/2013, à 05:02) Hors ligne #1491 Le 01/07/2013, à 22:30 Rolinh Re : /* Topic des codeurs [8] */ Pour la seconde fonction, use_idfne devrait pas être àTrue? Tout à fait. Seulement, on devait rendre le projet et avec use_idf à True, le classifieur plante (alors que sans l'idf il passe sans problèmes...). Il faut que je revienne dessus pour comprendre ce qui ne joue pas. Il y a deux fois ", et ça pourrait être remplacé par : chars = list(punctuation) + [' - '] avec un from string import punctuationbien sûr Bien vu et élégant. Et enfin, pour la fonction filter_tweet_wordstu peux remplacer (...) Bien vu le coup de la fonction lambda. Dans utils.py,json_to_tweets_helper(...) Ça c’est pas très joli et en plus c’est inutile (tu n’économises même pas une ligne). J'en conviens. Bien vu le coup du map pour les hashtags et urls. Je n'y avais même pas pensé... Sinon, de manière générale, je préfère utilisé formatplutôt que %. Une raison particulière à ça? Sinon, merci bien pour cette revue. Toujours bon à prendre. Bon, il faut aussi se dire que ce code à été écrit en 8-10 jours à des heures pas possibles alors que je bossais à 50%. Bref, on était pas mal à la bourre mais au final ça a bien fini. Sinon, un de mes anciens prof (François Flückiger) a été nominé pour les internet hall of fame 2013 dans la catégorie Innovators (Recognizing individuals who made outstanding technological, commercial, or policy advances and helped to expand the Internet’s reach), aux cotés notamment de Richard Stallman, Aaron Swartz (à titre posthume) et Jimmy Wales pour les noms qui vous évoquent forcément quelque chose. On verra le 3 août qui sera le "gagnant". Il était dans l'équipe de Tim Berners Lee quand ils ont mis au point le www au CERN et a repris la direction du l'équipe suite à son départ. Actuellement, c'est le grand manitou de l'informatique au CERN. J'ai eu la chance d'avoir eu droit à une visite privée des installations informatiques du CERN en 2009, présenté par F.Flückiger. C'était hyper intéressant pour moi qui n'avait jamais visité de datacenter auparavant, surtout avec la mise en perspective des défis informatiques liés aux expériences du CERN. Hors ligne #1492 Le 02/07/2013, à 02:21 grim7reaper Re : /* Topic des codeurs [8] */ grim7reaper a écrit : Pour la seconde fonction, use_idfne devrait pas être àTrue? Tout à fait. Seulement, on devait rendre le projet et avec use_idfàTrue, le classifieur plante (alors que sans l'idf il passe sans problèmes...). Il faut que je revienne dessus pour comprendre ce qui ne joue pas. Ha ok, ça me semblait bizarre aussi. grim7reaper a écrit : Sinon, de manière générale, je préfère utilisé formatplutôt que %. Une raison particulière à ça? Je trouve ça moins moche Plus sérieusement, même si % n’est pas déprécié il semblerait que format soit son successeur. This section contains examples of the new format syntax and comparison with the old %-formatting. Et format me semble aussi plus souple et plus puissant, mais ne connaissant pas trop % je me trompe peut-être. Sinon il y a aussi des import inutilisés, mais ça doit être à cause des bouts de code en commentaire. Sinon, merci bien pour cette revue. Toujours bon à prendre. Bon, il faut aussi se dire que ce code à été écrit en 8-10 jours à des heures pas possibles alors que je bossais à 50%. Bref, on était pas mal à la bourre mais au final ça a bien fini. Bah de rien. Et ça va, le code reste plutôt propre quand même Sinon, un de mes anciens prof (François Flückiger) a été nominé pour les internet hall of fame 2013 dans la catégorie Innovators(Recognizing individuals who made outstanding technological, commercial, or policy advances and helped to expand the Internet’s reach), aux cotés notamment de Richard Stallman, Aaron Swartz (à titre posthume) et Jimmy Wales pour les noms qui vous évoquent forcément quelque chose. On verra le 3 août qui sera le "gagnant". Il était dans l'équipe de Tim Berners Lee quand ils ont mis au point le www au CERN et a repris la direction du l'équipe suite à son départ. Actuellement, c'est le grand manitou de l'informatique au CERN. J'ai eu la chance d'avoir eu droit à une visite privée des installations informatiques du CERN en 2009, présenté par F.Flückiger. C'était hyper intéressant pour moi qui n'avait jamais visité de datacenter auparavant, surtout avec la mise en perspective des défis informatiques liés aux expériences du CERN. J’ai entendu parler de ce Hall of Fame. Tu as eu un sacré prof’ on dirait ^^ Ouais, le CERN c’est un truc assez impressionnant ^^ Hors ligne #1493 Le 02/07/2013, à 18:52 Shanx Re : /* Topic des codeurs [8] */ Je continue dans le python. Cette fois, je dois faire un data logger qui reçois des données en entrée (pour le moment, une température pour une zone à chaque heure), les stocke et les modifie au cours du temps (moyenne journalière pour les données vieille d’une semaine, et suppression au bout d’un an). Je n’ai pas encore la fonction pour recevoir les données, du coup une certaine partie de celles-ci est écrite en dur (et le reste est généré par un second script). Voici le script qui s’occupe de gérer la base de donnée, et le script de simulation qui me permet de remplir cette dernière. J’ai en partie repris du code que j’avais déjà fait, tout en réadaptant. Par contre, c’est moitié en français, moitié en anglais. Je sais que c’est un peu dégueulasse, je vais changer ça. De plus, comme vous vous en doutez, j’ai pas mal de question : j’ai placé tout ce qui concernait le curseur de la base de donnée en dehors du main, en tant que variable globale. Il me semble qu’en faire une classe serait un peu mieux, mais j’avoue ne pas du tout savoir comment faire la connexion à la bdd pourrait se faire avec un withou pas ? Est-ce que j’y gagnerai quelque chose ? d’une manière plus générale, avez-vous des remarques pour le code (robustesse, conventions, erreurs, etc.) ? Sans vraiment parler de ce code, j’ai encore quelques autres questions : J’utilise des tabulations pour indenter, et pas des espaces. À titre personnel, je trouve les tabulations vraiment plus pratiques. Quels sont les arguments expliquant que PEP8 conseille les espaces ? À partir des données stockées dans la bdd, je vais devoir faire des graphiques et des courbes. Que conseillez-vous pour le faire ? J’ai rapidement jeté un œil à GChartWrapper, mais je n’ai pas réussi à l’installer (je suis passé rapidement sur la question, si vous me dites que ça convient je verrais ça plus en profondeur demain) Hors ligne #1494 Le 02/07/2013, à 21:05 Rolinh Re : /* Topic des codeurs [8] */ Tu as eu un sacré prof’ on dirait ^^ Ouep, j'ai eu de la chance. Par contre, ce qui est dommage c'est qu'il n'est pas professeur ordinaire mais juste chargé de cours. Il a assez à faire au CERN j'imagine... Du coup, il donne juste 2 cours de première année donc pas de matière bien avancée, ce qui est carrément dommage. Ouais, le CERN c’est un truc assez impressionnant ^^ Carrément. (...) faire une classe serait un peu mieux, mais j’avoue ne pas du tout savoir comment faire class Foo: """Foobar class.""" def __init__(self, bar='bar'): self.bar = bar def putfoo(self): print("foo") print(self.bar) Le __init__ c'est ton constructeur (enfin, pas exactement, c'est une méthode qui est exécutée quand une classe est instanciée). Si tu mets ce code dans foo.py, tu peux l'importer depuis un autre fichier source et instancier ta classe comme ça: import foo blah = foo.Foo() d’une manière plus générale, avez-vous des remarques pour le code (robustesse, conventions, erreurs, etc.) ? J'ai juste jeté un très bref coup d’œil à ton code et oui, je vois des améliorations. Mais comme je me vraiment mis à Python il y a environ 3 semaines, je ne vois certainement pas tout.^^ Par exemple, ça: heures=['00','01','02','03','04','05','06','07','08','09','10','11','12','13','14','15','16','17','18','19','20','21','22','23'] Peut se remplacer par ça, qui est bien plus élégant: heures = ["%02d" % h for h in range(0,24)] Si tu veux, je peux jeter un vrai coup d’œil et te faire part de mes remarques (qui vaudront ce qu'elles vaudront). J’utilise des tabulations pour indenter, et pas des espaces. Tu vas te faire fusilier toi. ^^ Non, plus sérieusement, c'est bien de suivre les recommandations/bonnes pratiques d'un langage. Surtout que pour le coup, en Python l'indentation compte vraiment... Il suffit qu'un mec édite ton code source, ait un tab réglé sur 2 ou 8 (enfin, pas le même tab que toi quoi), il modifie 2 lignes et il flingue tout. Pour le côté pratique, il suffit de bien réglé son éditeur et du coup, l'utilisation d'espaces à la place de tabs devient transparent. J'ai des réglages spéciaux pour python dans mon vim par exemple: [robin@thor ~] % cat .vim/ftplugin/python.vim setlocal omnifunc=pythoncomplete#Complete setlocal shiftwidth=4 setlocal tabstop=4 setlocal textwidth=80 setlocal softtabstop=4 setlocal expandtab setlocal autoindent setlocal nowrap setlocal formatoptions+=c setlocal formatoptions+=r je vais devoir faire des graphiques et des courbes. Que conseillez-vous pour le faire ? Sinon, j'ai finalement utilisé web.py en combinaison avec twitter bootstrap en faisant tourner le tout via lighttpd et fastcgi pour l'appli web embarquée. Ça fonctionne plutôt bien et je dois avouer que comme petit framework, webpy est plutôt bien foutu. Il intègre son propre moteur de template qui permet d'incruster du python dans les templates html, ce qui rend la chose très pratique et évite de se farcir des tonnes de js et il gère bien l'url rewriting avec les définitions des routes. Pour un framework web, il permet de faire beaucoup en python. Le seul truc dommage, c'est qu'il n'est pas encore compatible python 3 (bien que le portage semble être en cours). Je dois avouer qu'il m'a même donné une idée pour une petite application. Vous en saurez plus bientôt. Hors ligne #1495 Le 02/07/2013, à 21:14 Shanx Re : /* Topic des codeurs [8] */ Merci Rolinh pour tes remarques. Concernant la classe, je ne voyais pas comment en faire une pour mon curseur. Je re-regarderai demain, je pense qu’en fouillant encore un peu je devrais arriver à quelque chose. Pour ton astuces pour remplir la liste des heures, ça a l’air franchement plus élégant, en effet. Si tu veux, je peux jeter un vrai coup d’œil et te faire part de mes remarques (qui vaudront ce qu'elles vaudront). Ce serait bien volontiers ! Hors ligne #1496 Le 02/07/2013, à 21:27 Rolinh Re : /* Topic des codeurs [8] */ Merci Rolinh pour tes remarques. Pas de quoi. Concernant la classe, je ne voyais pas comment en faire une pour mon curseur. Ah pardon, j'avais mal compris. Personnellement, je verrais ton problème différemment: se farcir du SQL, bah heu... faut vraiment le vouloir. ^^ D'autant plus qu'en passant directement tes requêtes SQL comme tu le fais, tu es directement dépendant de sqlite (ce qui n'est pas un problème en soi dans un simple script, j'en conviens). Donc à ta place, moi je ferais de l'ORM. Bien que je ne l'ai jamais utilisé, sqlalchemy à l'air pas mal pour ça (et il gère sqlite, évidemment). Il y a un tutoriel qui à l'air pas mal sur la doc. Tu risques de passer un petit moment à comprendre comment ça fonctionne mais je suis sûr que ça va te simplifier la vie par la suite. Sur ce, je vais jeter un coup d’œil à ton code et revenir avec quelques remarques supplémentaires si j'en ai. Hors ligne #1497 Le 02/07/2013, à 21:44 Rolinh Re : /* Topic des codeurs [8] */ @Shanx: Dans move: # Valeurs initiales normalement jamais atteinte (sinon ça ne va pas fonctionner) # Je trouve pas ça très propre, à revoir mini = 500 maxi = -50 Ça m'a un peu surpris. mini à 500 et max à -50 ? Toujours dans la même méthode: for row in cur: if (row[2] < mini): mini = row[2] if (row[2] > maxi): maxi = row[2] moy += row[2] row[2] ne mériterait pas une affectation là vu que tu l'utilises plusieurs fois? Avec un nom parlant ça aide aussi à comprendre de quoi il s'agit. Dans main: def main(): # Valeurs définies en dur pour les tests title = "temp_zone_1" date = "2013-07-03 00" value = 26 Tant qu'à faire, procède ainsi puisque ces paramètres semblent requis: def main(title="temp_zone_1", date="2013-07-03 00", value=26): Toujours dans le main, il sert à quoi i=0? Il n'est pas utilisé par la suite. Sinon, pour ta gestion de la db, cf mon post précédent. Des méthodes comme present1 ou present2 seront inutiles (par ailleurs, les noms de ces méthodes ne sont vraiment pas parlant...). Hors ligne #1498 Le 02/07/2013, à 22:04 Shanx Re : /* Topic des codeurs [8] */ Merci. En vrac : c’est pas la première fois que je “me farcis” du SQL, et je ne trouve pas ça très compliqué. J’irais même plus loin et dirais que c’est pratique, mais je ne connais pas les autres alternatives. Du coup, je ne vois pas trop ce que l’ORM va m’apporter… La bdd gérée par sqlite3 me permet d’avoir plusieurs applis qui la consultent, ce qui m’est pratique. Ce sera aussi le cas avec l’ORM ? Concernant les valeurs données à minetmax, comme dit en commentaire je n’en étais pas content (je ne sais pas ce qu’il m’a pris de faire ça comme ça ). Ça a depuis été changé. Bien vu pour l’affectation de row[2]. Après, ça fait partie du code de test qui me sert uniquement à remplir la base de donnée, donc c’est pas non plus le plus important. Mais c’est bien pour moi de prendre les bonnes habitudes. Enfin, les valeurs définies dans le mainne sont là qu’à fin de test, et elles sont vouées à disparaitre. Ça me paraît donc aussi simple de les définir comme je le fais, plutôt que de les passer en paramètres. Et la variableiest un vieux reste que je vais supprimer de ce pas. Hors ligne #1499 Le 02/07/2013, à 22:18 Rolinh Re : /* Topic des codeurs [8] */ c’est pas la première fois que je “me farcis” du SQL, et je ne trouve pas ça très compliqué. J’irais même plus loin et dirais que c’est pratique, mais je ne connais pas les autres alternatives. Du coup, je ne vois pas trop ce que l’ORM va m’apporter… La bdd gérée par sqlite3 me permet d’avoir plusieurs applis qui la consultent, ce qui m’est pratique. Ce sera aussi le cas avec l’ORM ? Ce n'est pas tellement le fait que SQL soit compliqué ou pas le problème. Passer par de l'ORM te permettra de notamment de "mapper tes objets en base de données". mais apporte aussi une couche d'abstraction, ce qui n'est pas une mauvaise chose. Évidemment, cela n'est utile que si tu rends ton code plus orienté objet. Ceci dit, je pense que tu n'as pas bien compris le principe. Si tu choisis une base sqlite, c'est toujours du sqlite qu'il y aura derrière en passant par sqlalchemy. Donc tu pourras évidemment toujours utiliser cette bdd comme bon te semble... Hors ligne #1500 Le 02/07/2013, à 22:25 Shanx Re : /* Topic des codeurs [8] */ Évidemment, cela n'est utile que si tu rends ton code plus orienté objet. Ça, c’est mon grand problème : j’ai du mal à réfléchir (et à codé) en orienté objet. Et je ne sais pas comment faire pour avoir le déclic (c’est d’ailleurs pour ça que j’ai beaucoup de mal avec le java). Sinon, je ne vois toujours pas les avantages de l’ORM. Je vais lire attentivement la doc demain, et voir ce que je peux en faire. Merci beaucoup. Hors ligne
pandageek MCedit pour minecraft bonjour a tous, je joue à minecraft version linux sous xubuntu et j'aimerai pouvoir utiliser le logiciel MCedit qui sert a éditer les cartes du jeu. or il ne fonctionne pas malgré mes tentatives : panda@panda-USB:~/Bureau/MCEdit-stable33-linux$ ./mcedit.sh RuntimeError: Bad magic number in .pyc file panda@panda-USB:~/Bureau/MCEdit-stable33-linux$ sh mcedit.sh python: can't open file 'mcedit.sh/MCEditData/mcedit.pyo': [Errno 20] Not a directory panda@panda-USB:~/Bureau/MCEdit-stable33-linux$ bash mcedit.sh python: can't open file 'mcedit.sh/MCEditData/mcedit.pyo': [Errno 20] Not a directory merci de m'aider! Hors ligne pandageek Re : MCedit pour minecraft personne? Hors ligne abelthorne Re : MCedit pour minecraft Les erreurs me font penser que le fichier est corrompu. Tu as essayé de le retélécharger ? En ligne pandageek Re : MCedit pour minecraft après re-téléchargement j’obtiens ceci. panda@panda-USB:~/Bureau/MCEdit-stable33-linux$ ./mcedit.sh Loading imports... Adding SafeOutputStream... Release: stable33 Loading OpenGL... Traceback (most recent call last): File "mcedit.py", line 102, in <module> File "/usr/lib/pymodules/python2.7/OpenGL/GL/__init__.py", line 2, in <module> from OpenGL.raw.GL import * File "/usr/lib/pymodules/python2.7/OpenGL/raw/GL/__init__.py", line 6, in <module> from OpenGL.raw.GL.constants import * File "/usr/lib/pymodules/python2.7/OpenGL/raw/GL/constants.py", line 7, in <module> from OpenGL import platform, arrays File "/usr/lib/pymodules/python2.7/OpenGL/platform/__init__.py", line 36, in <module> _load() File "/usr/lib/pymodules/python2.7/OpenGL/platform/__init__.py", line 27, in _load plugin_class = plugin.load() File "/usr/lib/pymodules/python2.7/OpenGL/plugins.py", line 14, in load return importByName( self.import_path ) File "/usr/lib/pymodules/python2.7/OpenGL/plugins.py", line 28, in importByName module = __import__( ".".join(moduleName), {}, {}, moduleName) File "/usr/lib/pymodules/python2.7/OpenGL/platform/glx.py", line 8, in <module> class GLXPlatform( baseplatform.BasePlatform ): File "/usr/lib/pymodules/python2.7/OpenGL/platform/glx.py", line 20, in GLXPlatform raise ImportError("Unable to load OpenGL library", *err.args) ImportError: ('Unable to load OpenGL library', "GL: Ne peut ouvrir le fichier d'objet partag\xc3\xa9: Aucun fichier ou dossier de ce type", 'GL', None) Startup failed. Please send a copy or screenshot of this error to [email protected] Hors ligne pandageek Re : MCedit pour minecraft tout est déjà installé correctement. Hors ligne pandageek Re : MCedit pour minecraft up? Hors ligne pandageek Re : MCedit pour minecraft up Hors ligne pandageek Re : MCedit pour minecraft longtemps après, en cherchant une solution, je retrouve mon vieux topic... le message à changé : # python mcedit.py Running in development mode! Traceback (most recent call last): File "mcedit.py", line 13, in <module> import albow File "/home/panda/mcedit/albow/__init__.py", line 13, in <module> from albow.shell import Shell File "/home/panda/mcedit/albow/shell.py", line 5, in <module> from root import RootWidget File "/home/panda/mcedit/albow/root.py", line 13, in <module> from glbackground import * File "/home/panda/mcedit/glbackground.py", line 21, in <module> from albow.openglwidgets import GLOrtho File "/home/panda/mcedit/albow/openglwidgets.py", line 8, in <module> from OpenGL import GL, GLU File "/usr/lib/pymodules/python2.7/OpenGL/GL/__init__.py", line 2, in <module> from OpenGL.raw.GL import * File "/usr/lib/pymodules/python2.7/OpenGL/raw/GL/__init__.py", line 6, in <module> from OpenGL.raw.GL.constants import * File "/usr/lib/pymodules/python2.7/OpenGL/raw/GL/constants.py", line 7, in <module> from OpenGL import platform, arrays File "/usr/lib/pymodules/python2.7/OpenGL/platform/__init__.py", line 36, in <module> _load() File "/usr/lib/pymodules/python2.7/OpenGL/platform/__init__.py", line 27, in _load plugin_class = plugin.load() File "/usr/lib/pymodules/python2.7/OpenGL/plugins.py", line 14, in load return importByName( self.import_path ) File "/usr/lib/pymodules/python2.7/OpenGL/plugins.py", line 28, in importByName module = __import__( ".".join(moduleName), {}, {}, moduleName) File "/usr/lib/pymodules/python2.7/OpenGL/platform/glx.py", line 8, in <module> class GLXPlatform( baseplatform.BasePlatform ): File "/usr/lib/pymodules/python2.7/OpenGL/platform/glx.py", line 20, in GLXPlatform raise ImportError("Unable to load OpenGL library", *err.args) ImportError: ('Unable to load OpenGL library', 'GL: cannot open shared object file: No such file or directory', 'GL', None) petit up en fait Hors ligne
Getting DBUS Messages from Networkmanager (Python) Dennis Guse I had some spare time and so I started playing with DBUS. I was annoyed that after NetworkManager established a connection I always start the same programs like ekiga, pidgin, firefox and evolution. So I wrote a small python program that start software if the NetworkManager singals an open connection via DBUS. The NetworkManager DBUS-API is available. The hardest part was to find the docs. 1 #!/usr/bin/python 2 from dbus.mainloop.glib import DBusGMainLoop 3 import gobject 4 import dbus 5 import subprocess 6 7 def signal_deviceNowActive(data=None): 8 if data is not None and data[dbus.String("State")] == 2 : 9 subprocess.Popen("ps -C pidgin&nbsp;&nbsp;&nbsp; || pidgin &amp;", shell=True) 10 subprocess.Popen("ps -C ekiga&nbsp;&nbsp;&nbsp;&nbsp; || ekiga &amp;", shell=True) 11 subprocess.Popen("ps -C evolution || evolution &amp;", shell=True) 12 13 print "init loop" 14 15 DBusGMainLoop(set_as_default=True) 16 17 loop = gobject.MainLoop(); 18 19 print "init dbus" 20 21 dbus.SystemBus().add_signal_receiver(signal_deviceNowActive, signal_name=None, dbus_interface="org.freedesktop.NetworkManager.Connection.Active") 22 23 print "start loop" 24 25 loop.run() //*UPDATE: thanks for your comment
The following table is designed to make layout a simpler paper and pencil exercise. It is probably best to print it out (using NON PROPORTIONAL fonts) and adjust the numbers until you are happy with them. Mount point is what directory you wish to mount a partition on or the actual device. This is also a good place to note how you plan to use symbolic links. The size given corresponds to a fairly big Debian 1.2.6 installation. Other examples are coming later. Mainly you use this table to select what structure and drives you will use, the partition numbers and letters will come from the next two tables. Directory Mount point speed seek transfer size SIZE swap __________ ooooo ooooo ooooo 32 ____ / __________ o o o 20 ____ /tmp __________ oooo oooo oooo ____ /var __________ oo oo oo 25 ____ /var/tmp __________ oooo oooo oooo ____ /var/spool __________ ____ /var/spool/mail __________ o o o ____ /var/spool/news __________ ooo ooo oo ____ /var/spool/____ __________ ____ ____ ____ ____ /home __________ oo oo oo ____ /usr __________ 500 ____ /usr/bin __________ o oo o 250 ____ /usr/lib __________ oo oo ooo 200 ____ /usr/local __________ ____ /usr/local/bin __________ o oo o ____ /usr/local/lib __________ oo oo ooo ____ /usr/local/____ __________ ____ /usr/src __________ o oo o 50 ____ DOS __________ o o o ____ Win __________ oo oo oo ____ NT __________ ooo ooo ooo ____ /mnt._________ __________ ____ ____ ____ ____ /mnt._________ __________ ____ ____ ____ ____ /mnt._________ __________ ____ ____ ____ ____ /_____________ __________ ____ ____ ____ ____ /_____________ __________ ____ ____ ____ ____ /_____________ __________ ____ ____ ____ ____ Total capacity:
Ayu Grub ne se lance pas Bonsoir, J'ai installé windows 7 et Xubuntu 11.10 sur un nouveau pc avec cette configuration:CM: Asus P8H67 B3Processeur: i5 2500kDD: 1TO 7200 RPMRAM: 2x4GOCG: Gigabyte GeForce GTX 560 Mais je boot toujours sur windows et Grub ne se lance pas j'ai essayé de réinstaller grub depuis une session live avec sudo grub-install /dev/sda ça me renvoi: /usr/sbin/grub-probe : erreur : cannot find a device for /boot/grub (is /dev mounted?). et sudo fdisk -l me renvoi: Attention : identifiant de table de partitions GPT (GUID) détecté sur « /dev/sda » ! L'utilitaire sfdisk ne prend pas GPT en charge. Utilisez GNU Parted. Disk /dev/sda: 1000.2 GB, 1000204886016 bytes 255 têtes, 63 secteurs/piste, 121601 cylindres, total 1953525168 secteurs Unités = secteurs de 1 * 512 = 512 octets Taille de secteur (logique / physique) : 512 octets / 512 octets taille d'E/S (minimale / optimale) : 512 octets / 512 octets Identifiant de disque : 0x648ad58f Périphérique Amorce Début Fin Blocs Id Système /dev/sda1 1 1953525167 976762583+ ee GPT et sudo os-prober me renvoi: (ça ne montre pas windows ? O.o) /dev/sda4:Ubuntu 11.10 (11.10):Ubuntu:linux et le script boot_info_script.sh me renvoi: Boot Info Script 0.60 from 17 May 2011 ============================= Boot Info Summary: =============================== => Grub2 (v1.99) is installed in the MBR of /dev/sda and looks at sector 423401960 of the same hard drive for core.img. core.img is at this location and looks for on this drive. sda1: __________________________________________________________________________ File system: vfat Boot sector type: Unknown Boot sector info: No errors found in the Boot Parameter Block. Operating System: Boot files: sda2: __________________________________________________________________________ File system: Boot sector type: - Boot sector info: Mounting failed: mount : type de système de fichiers «  » inconnu sda3: __________________________________________________________________________ File system: ntfs Boot sector type: Windows Vista/7 Boot sector info: No errors found in the Boot Parameter Block. Operating System: Windows 7 Boot files: /Windows/System32/winload.exe sda4: __________________________________________________________________________ File system: ext4 Boot sector type: - Boot sector info: Operating System: Ubuntu 11.10 Boot files: /boot/grub/grub.cfg /etc/fstab /boot/grub/core.img sda5: __________________________________________________________________________ File system: swap Boot sector type: - Boot sector info: sda6: __________________________________________________________________________ File system: ntfs Boot sector type: Windows Vista/7 Boot sector info: No errors found in the Boot Parameter Block. Operating System: Boot files: ============================ Drive/Partition Info: ============================= Drive: sda _____________________________________________________________________ Disk /dev/sda: 1000.2 GB, 1000204886016 bytes 255 têtes, 63 secteurs/piste, 121601 cylindres, total 1953525168 secteurs Unités = secteurs de 1 * 512 = 512 octets Taille de secteur (logique / physique) : 512 octets / 512 octets Partition Boot Start Sector End Sector # of Sectors Id System /dev/sda1 1 1,953,525,167 1,953,525,167 ee GPT GUID Partition Table detected. Partition Start Sector End Sector # of Sectors System /dev/sda1 2,048 206,847 204,800 EFI System partition /dev/sda2 206,848 468,991 262,144 Microsoft Reserved Partition (Windows) /dev/sda3 468,992 409,602,047 409,133,056 Data partition (Windows/Linux) /dev/sda4 409,602,048 800,227,048 390,625,001 Data partition (Windows/Linux) /dev/sda5 800,227,049 817,023,924 16,796,876 Swap partition (Linux) /dev/sda6 817,025,024 1,953,523,711 1,136,498,688 Data partition (Windows/Linux) "blkid" output: ________________________________________________________________ Device UUID TYPE LABEL /dev/loop0 squashfs /dev/sda1 C425-C856 vfat /dev/sda3 04242E1C242E116A ntfs /dev/sda4 73768a23-3767-4c6c-bb8d-3a2afbb7bda2 ext4 /dev/sda5 cdfeeba6-3426-4109-a3de-86412dc29a09 swap /dev/sda6 505AA4295AA40DB2 ntfs Data ================================ Mount points: ================================= Device Mount_Point Type Options /dev/loop0 /rofs squashfs (ro,noatime) /dev/sda3 /media/04242E1C242E116A fuseblk (rw,nosuid,nodev,allow_other,blksize=4096,default_permissions) /dev/sda4 /media/73768a23-3767-4c6c-bb8d-3a2afbb7bda2 ext4 (rw,nosuid,nodev,uhelper=udisks) /dev/sda6 /media/Data fuseblk (rw,nosuid,nodev,allow_other,blksize=4096,default_permissions) /dev/sr0 /cdrom iso9660 (ro,noatime) =========================== sda4/boot/grub/grub.cfg: =========================== -------------------------------------------------------------------------------- # # DO NOT EDIT THIS FILE # # It is automatically generated by grub-mkconfig using templates # from /etc/grub.d and settings from /etc/default/grub # ### BEGIN /etc/grub.d/00_header ### if [ -s $prefix/grubenv ]; then set have_grubenv=true load_env fi set default="0" if [ "${prev_saved_entry}" ]; then set saved_entry="${prev_saved_entry}" save_env saved_entry set prev_saved_entry= save_env prev_saved_entry set boot_once=true fi function savedefault { if [ -z "${boot_once}" ]; then saved_entry="${chosen}" save_env saved_entry fi } function recordfail { set recordfail=1 if [ -n "${have_grubenv}" ]; then if [ -z "${boot_once}" ]; then save_env recordfail; fi; fi } function load_video { insmod vbe insmod vga insmod video_bochs insmod video_cirrus } insmod part_gpt insmod ext2 set root='(hd0,gpt4)' search --no-floppy --fs-uuid --set=root 73768a23-3767-4c6c-bb8d-3a2afbb7bda2 if loadfont /usr/share/grub/unicode.pf2 ; then set gfxmode=auto load_video insmod gfxterm insmod part_gpt insmod ext2 set root='(hd0,gpt4)' search --no-floppy --fs-uuid --set=root 73768a23-3767-4c6c-bb8d-3a2afbb7bda2 set locale_dir=($root)/boot/grub/locale set lang=fr_FR insmod gettext fi terminal_output gfxterm if [ "${recordfail}" = 1 ]; then set timeout=-1 else set timeout=10 fi ### END /etc/grub.d/00_header ### ### BEGIN /etc/grub.d/05_debian_theme ### set menu_color_normal=white/black set menu_color_highlight=black/light-gray ### END /etc/grub.d/05_debian_theme ### ### BEGIN /etc/grub.d/10_linux ### if [ ${recordfail} != 1 ]; then if [ -e ${prefix}/gfxblacklist.txt ]; then if hwmatch ${prefix}/gfxblacklist.txt 3; then if [ ${match} = 0 ]; then set linux_gfx_mode=keep else set linux_gfx_mode=text fi else set linux_gfx_mode=text fi else set linux_gfx_mode=keep fi else set linux_gfx_mode=text fi export linux_gfx_mode if [ "$linux_gfx_mode" != "text" ]; then load_video; fi menuentry 'Ubuntu, avec Linux 3.0.0-12-generic' --class ubuntu --class gnu-linux --class gnu --class os { recordfail set gfxpayload=$linux_gfx_mode insmod gzio insmod part_gpt insmod ext2 set root='(hd0,gpt4)' search --no-floppy --fs-uuid --set=root 73768a23-3767-4c6c-bb8d-3a2afbb7bda2 linux /boot/vmlinuz-3.0.0-12-generic root=UUID=73768a23-3767-4c6c-bb8d-3a2afbb7bda2 ro quiet splash vt.handoff=7 initrd /boot/initrd.img-3.0.0-12-generic } menuentry 'Ubuntu, avec Linux 3.0.0-12-generic (mode de dépannage)' --class ubuntu --class gnu-linux --class gnu --class os { recordfail insmod gzio insmod part_gpt insmod ext2 set root='(hd0,gpt4)' search --no-floppy --fs-uuid --set=root 73768a23-3767-4c6c-bb8d-3a2afbb7bda2 echo 'Chargement de Linux 3.0.0-12-generic ...' linux /boot/vmlinuz-3.0.0-12-generic root=UUID=73768a23-3767-4c6c-bb8d-3a2afbb7bda2 ro recovery nomodeset echo 'Chargement du disque mémoire initial ...' initrd /boot/initrd.img-3.0.0-12-generic } ### END /etc/grub.d/10_linux ### ### BEGIN /etc/grub.d/20_linux_xen ### ### END /etc/grub.d/20_linux_xen ### ### BEGIN /etc/grub.d/20_memtest86+ ### menuentry "Memory test (memtest86+)" { insmod part_gpt insmod ext2 set root='(hd0,gpt4)' search --no-floppy --fs-uuid --set=root 73768a23-3767-4c6c-bb8d-3a2afbb7bda2 linux16 /boot/memtest86+.bin } menuentry "Memory test (memtest86+, serial console 115200)" { insmod part_gpt insmod ext2 set root='(hd0,gpt4)' search --no-floppy --fs-uuid --set=root 73768a23-3767-4c6c-bb8d-3a2afbb7bda2 linux16 /boot/memtest86+.bin console=ttyS0,115200n8 } ### END /etc/grub.d/20_memtest86+ ### ### BEGIN /etc/grub.d/30_os-prober ### if [ "x${timeout}" != "x-1" ]; then if keystatus; then if keystatus --shift; then set timeout=-1 else set timeout=0 fi else if sleep --interruptible 3 ; then set timeout=0 fi fi fi ### END /etc/grub.d/30_os-prober ### ### BEGIN /etc/grub.d/40_custom ### # This file provides an easy way to add custom menu entries. Simply type the # menu entries you want to add after this comment. Be careful not to change # the 'exec tail' line above. ### END /etc/grub.d/40_custom ### ### BEGIN /etc/grub.d/41_custom ### if [ -f $prefix/custom.cfg ]; then source $prefix/custom.cfg; fi ### END /etc/grub.d/41_custom ### -------------------------------------------------------------------------------- =============================== sda4/etc/fstab: ================================ -------------------------------------------------------------------------------- # /etc/fstab: static file system information. # # Use 'blkid' to print the universally unique identifier for a # device; this may be used with UUID= as a more robust way to name devices # that works even if disks are added and removed. See fstab(5). # # <file system> <mount point> <type> <options> <dump> <pass> proc /proc proc nodev,noexec,nosuid 0 0 # / was on /dev/sda4 during installation UUID=73768a23-3767-4c6c-bb8d-3a2afbb7bda2 / ext4 errors=remount-ro 0 1 # swap was on /dev/sda5 during installation UUID=cdfeeba6-3426-4109-a3de-86412dc29a09 none swap sw 0 0 -------------------------------------------------------------------------------- =================== sda4: Location of files loaded by Grub: ==================== GiB - GB File Fragment(s) = boot/grub/core.img 1 = boot/grub/grub.cfg 1 = boot/initrd.img-3.0.0-12-generic 2 = boot/vmlinuz-3.0.0-12-generic 1 = initrd.img 2 = vmlinuz 1 ======================== Unknown MBRs/Boot Sectors/etc: ======================== Unknown BootLoader on sda1 00000000 eb 58 90 4d 53 44 4f 53 35 2e 30 00 02 02 fe 19 |.X.MSDOS5.0.....| 00000010 02 00 00 00 00 f8 00 00 3f 00 ff 00 00 08 00 00 |........?.......| 00000020 00 20 03 00 01 03 00 00 00 00 00 00 02 00 00 00 |. ..............| 00000030 01 00 06 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000040 80 00 29 56 c8 25 c4 4e 4f 20 4e 41 4d 45 20 20 |..)V.%.NO NAME | 00000050 20 20 46 41 54 33 32 20 20 20 33 c9 8e d1 bc f4 | FAT32 3.....| 00000060 7b 8e c1 8e d9 bd 00 7c 88 4e 02 8a 56 40 b4 41 |{......|[email protected]| 00000070 bb aa 55 cd 13 72 10 81 fb 55 aa 75 0a f6 c1 01 |..U..r...U.u....| 00000080 74 05 fe 46 02 eb 2d 8a 56 40 b4 08 cd 13 73 05 |[email protected].| 00000090 b9 ff ff 8a f1 66 0f b6 c6 40 66 0f b6 d1 80 e2 |.....f...@f.....| 000000a0 3f f7 e2 86 cd c0 ed 06 41 66 0f b7 c9 66 f7 e1 |?.......Af...f..| 000000b0 66 89 46 f8 83 7e 16 00 75 38 83 7e 2a 00 77 32 |f.F..~..u8.~*.w2| 000000c0 66 8b 46 1c 66 83 c0 0c bb 00 80 b9 01 00 e8 2b |f.F.f..........+| 000000d0 00 e9 2c 03 a0 fa 7d b4 7d 8b f0 ac 84 c0 74 17 |..,...}.}.....t.| 000000e0 3c ff 74 09 b4 0e bb 07 00 cd 10 eb ee a0 fb 7d |<.t............}| 000000f0 eb e5 a0 f9 7d eb e0 98 cd 16 cd 19 66 60 80 7e |....}.......f`.~| 00000100 02 00 0f 84 20 00 66 6a 00 66 50 06 53 66 68 10 |.... .fj.fP.Sfh.| 00000110 00 01 00 b4 42 8a 56 40 8b f4 cd 13 66 58 66 58 |[email protected]| 00000120 66 58 66 58 eb 33 66 3b 46 f8 72 03 f9 eb 2a 66 |fXfX.3f;F.r...*f| 00000130 33 d2 66 0f b7 4e 18 66 f7 f1 fe c2 8a ca 66 8b |3.f..N.f......f.| 00000140 d0 66 c1 ea 10 f7 76 1a 86 d6 8a 56 40 8a e8 c0 |.f....v....V@...| 00000150 e4 06 0a cc b8 01 02 cd 13 66 61 0f 82 75 ff 81 |.........fa..u..| 00000160 c3 00 02 66 40 49 75 94 c3 42 4f 4f 54 4d 47 52 |[email protected]| 00000170 20 20 20 20 00 00 00 00 00 00 00 00 00 00 00 00 | ............| 00000180 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| * 000001a0 00 00 00 00 00 00 00 00 00 00 00 00 0d 0a 52 65 |..............Re| 000001b0 74 69 72 65 7a 20 6c 65 20 64 69 73 71 75 65 ff |tirez le disque.| 000001c0 0d 0a 45 72 72 2e 20 64 69 73 71 75 65 ff 0d 0a |..Err. disque...| 000001d0 50 72 65 73 73 65 7a 20 75 6e 65 20 74 6f 75 63 |Pressez une touc| 000001e0 68 65 20 70 6f 75 72 20 72 65 64 82 6d 61 72 72 |he pour red.marr| 000001f0 65 72 0d 0a 00 00 00 00 00 ac c0 ce 00 00 55 aa |er............U.| 00000200 =============================== StdErr Messages: =============================== unlzma: Decoder error awk: cmd. line:36: Math support is not compiled in awk: cmd. line:36: Math support is not compiled in awk: cmd. line:36: Math support is not compiled in awk: cmd. line:36: Math support is not compiled in awk: cmd. line:36: Math support is not compiled in awk: cmd. line:36: Math support is not compiled in En attente de votre réponse. Merci d'avance! Dernière modification par Ayu (Le 27/11/2011, à 23:05) Que vous m'aspergiez d’alcool et de nourritures, que vous me crachiez à la figure, ça passe encore, mais il y as des limites !! Je ne tolère pas que l'ont maltraite un ami! - Akagami no Shanks Hors ligne xabilon Re : Grub ne se lance pas Salut Je ne sais pas si c'est le fait que la table de partitions soit en GPT qui fait ça, mais on dirait que le BIOS démarre sur le boot-sector de sda1 plutôt que sur le MBR de sda. Consulte déjà les options de démarrage de ton BIOS. C'est malheureusement la première fois que j'entends parler de ce type de table de partitions ... Pour passer un sujet en résolu : modifiez le premier message et ajoutez [Résolu] au titre. Hors ligne malbo Re : Grub ne se lance pas Ayu, Je m'intéresse à UEFI mais je débute dans l'apprentissage et je ne connais pas l'EFI Boot de Asus autrement que par l'intermédiaire de Google. Je viens de lire ça : http://support.asus.com/Search/KDetail. … 19D871&t=2 Je voudrais savoir pratiquement comment tu démarres actuellement sous Windows par rapport à ce qui est décrit dans ce lien : peux-tu aller dans le réglages avancés et vérifier que c'est bien "Windows Boot Manager" qui est en priorité de Boot ? Edit : je te parle de UEFI parce que ta carte-mère est équipée de UEFI au lieu de BIOS. On trouve des infos sur ton matériel dans cette partie de la documentation anglaise de Ubuntu : https://help.ubuntu.com/community/UEFIB … chitecture Il y est dit que les carte-mère H67 de Asus utilisent ce type de logiciel UEFI. Par conséquent, toutes les vieilles méthodes utilisées avec le Bios ne sont pas utilisables. En particulier, on n'installe pas Grub dans le MBR comme ça a été fait dans ton disque dur, comme on peut voir dans le résultat que tu as posté : Boot Info Script 0.60 from 17 May 2011 ============================= Boot Info Summary: =============================== => Grub2 (v1.99) is installed in the MBR of /dev/sda and looks at sector 423401960 of the same hard drive for core.img. core.img is at this location and looks for on this drive. C'est à dire que Grub2 installé dans le MBR du disque dur comme il est spécifié dans la documentation du site, ça ne marche pas avec une carte-mère UEFI. Pour l'instant tu peux le laisser en place mais le système UEFI ne pourra pas l'exploiter. Dans un système UEFI, le paramétrage du multi-boot, ça se fait dans la partition EFI (ta partition sda1). Le principe, c'est que dans cette partition, il doit y avoir tous les fichiers nécessaires pour pouvoir démarrer tous les OS du PC. A l'heure actuelle, c'est dans cette partition EFI que se trouve le fichier qui permet de démarrer Win7. Le but du jeu, c'est qu'un fichier permettant de démarrer Ubuntu se trouve également dans cette partition EFI. Et normalement, lors de l'installation de Ubuntu, l'installateur devrait automatiquement créer le dossier et le fichier qui va bien dans la partition EFI. Mais j'ai de gros doutes dans ton cas et dans la discussion dont je donne le lien ci-dessous, il est mentionné l'hypothèse que pour une raison ou une autre, Ubuntu n'ait pas pu détecter le système UEFI et ait malencontreusement fait une installation classique avec grub-pc au lieu de faire l'installation avec grub-efi qui est sensé fabriquer le fichier qui va bien dans la partition EFI. C'est le système bâtard dont il est question dans cette cette discussion : http://ubuntuforums.org/showthread.php?t=1770885 Cammer Pants semble avoir un partitionnement très semblable au tien en ce qui concerne sda1 et sda2, pourtant ce n'est pas la même carte-mère (la sienne est Gigabyte GA-870A-USB3). Dans ce post de la même discussion, srs5694 - qui est spécialiste de ces pb UEFI - donne des explications. Dernière modification par malbo (Le 28/11/2011, à 13:42) MedionPC MT5 MED MT 162 / pentium IV / RAM 1Go / Radeon HD 3450 AGP / XP, HandyLinux et Xubuntu 14.04 32 bits Acer Aspire M5100-5F7N / Phenom Quad Core 9500 / ATI HD 2600 pro / RAM 4 Go / Win8, XP et Ubuntu 14.04 Hors ligne Ayu Re : Grub ne se lance pas Bonsoir, Merci pour vos réponses. peux-tu aller dans le réglages avancés et vérifier que c'est bien "Windows Boot Manager" qui est en priorité de Boot ? Oui c'est bien ça, pour le reste je comprend pas trop comment régler le problème. Dernière modification par Ayu (Le 28/11/2011, à 20:48) Que vous m'aspergiez d’alcool et de nourritures, que vous me crachiez à la figure, ça passe encore, mais il y as des limites !! Je ne tolère pas que l'ont maltraite un ami! - Akagami no Shanks Hors ligne malbo Re : Grub ne se lance pas Peux-tu démarrer sur un support live de Ubuntu 11.10, monter la partition sda1 avec l'utilitaire de disque et vérifier si elle contient bien un fichier grubx64.efi dans le chemin EFI/ubuntu/ (si tu préfères, tu peux aussi vérifier la chose depuis Windows puisque la partition EFI est visible depuis Windows). Le but du jeu, c'est d'avoir les éléments pour pouvoir booter sur ce fichier .efi par l’intermédiaire de ton Système UEFI. En général, c'est très simple mais il faut avoir quelques directives et le fabricant de ton PC doit pouvoir te donner l'info si tu ne t'en sors pas à l'instinct. Moi, je l'ai fait dans un PC virtuel (avec VirtualBox) donc avec un système UEFI virtuel et c'est assez simple à condition d'avoir quelques indications. Je me suis aidé de cette doc (§ 4.1 Using Boot Maintenance Menu:) : http://software.intel.com/en-us/article … scripting/ et c'est ce qui m'a permis de créer une nouvelle entrée dans le Boot manager (voir chapitre D : installation de Ubuntu 11.10 depuis la session live ) : http://forum.ubuntu-fr.org/viewtopic.ph … 1#p7189161 il y a vraiment très peu de manipulations à faire. Dernière modification par malbo (Le 28/11/2011, à 21:38) MedionPC MT5 MED MT 162 / pentium IV / RAM 1Go / Radeon HD 3450 AGP / XP, HandyLinux et Xubuntu 14.04 32 bits Acer Aspire M5100-5F7N / Phenom Quad Core 9500 / ATI HD 2600 pro / RAM 4 Go / Win8, XP et Ubuntu 14.04 Hors ligne Ayu Re : Grub ne se lance pas Je ne retrouve pas le fichier grubx64.efi par contre je peux booter sur linux en choisissant ça dans le bios il faut à chaque fois que je rentre dans le bios pour choisir mon OS Que vous m'aspergiez d’alcool et de nourritures, que vous me crachiez à la figure, ça passe encore, mais il y as des limites !! Je ne tolère pas que l'ont maltraite un ami! - Akagami no Shanks Hors ligne malbo Re : Grub ne se lance pas par contre je peux booter sur linux en choisissant ça dans le bios il faut à chaque fois que je rentre dans le bios pour choisir mon OS Cette entrée de ton "Bios" qui te permet de booter sur linux, elle a été créée automatiquement par l'installateur de Ubuntu ou bien c'est toi qui a dû la paramétrer à la main (un peu comme j'explique dans mon post précédent) ? L'entrée pour Win7 dans ton "Bios" est désignée par "Windows Boot Manager". Comment est désignée l'entrée pour Ubuntu ? Quand tu choisis de démarrer sur Ubuntu, juste avant que Ubuntu démarre, en appuyant rapidement sur la touche Echap tu dois pouvoir faire apparaître le menu Grub. est-ce bien le cas ? Dernière modification par malbo (Le 29/11/2011, à 07:25) MedionPC MT5 MED MT 162 / pentium IV / RAM 1Go / Radeon HD 3450 AGP / XP, HandyLinux et Xubuntu 14.04 32 bits Acer Aspire M5100-5F7N / Phenom Quad Core 9500 / ATI HD 2600 pro / RAM 4 Go / Win8, XP et Ubuntu 14.04 Hors ligne Ayu Re : Grub ne se lance pas Bonjour, l'entrée à été crée automatiquement L'entrée Win8 c'est bien "Windows Boot Manager" Par contre si je sélectionne un boot sur le DD (SATA: ST31000524AS) depuis le bios (et cela sans grub) Linux se lance Dernière modification par Ayu (Le 29/11/2011, à 11:02) Que vous m'aspergiez d’alcool et de nourritures, que vous me crachiez à la figure, ça passe encore, mais il y as des limites !! Je ne tolère pas que l'ont maltraite un ami! - Akagami no Shanks Hors ligne malbo Re : Grub ne se lance pas Par contre si je sélectionne un boot sur le DD (SATA: ST31000524AS) depuis le bios (et cela sans grub) Linux se lance Arrivé dans Ubuntu, peux-tu ouvrir un terminal et passer cette commande : dmesg | grep EFI Chez moi depuis une session Ubuntu dans un système Bios (mon PC Acer), ça donne ça : dmesg | grep EFI [ 1.241248] EFI Variables Facility v0.08 2004-May-17 Ce qui indique bien que Ubuntu a démarré dans un système Bios Par contre, si j'ouvre un session Ubuntu dans un système UEFI (dans un PC virtuel par VirtualBox), voici ce que j'obtiens : dmesg | grep EFI [ 0.000000] EFI v2.10 by VBOX 64 [ 0.000000] Kernel-defined memdesc doesn't match the one from EFI! [ 0.000000] EFI: mem00: type=7, attr=0xf, range=[0x0000000000000000-0x00000000000a0000) (0MB) [ 0.000000] EFI: mem01: type=2, attr=0xf, range=[0x0000000000100000-0x000000000056e000) (4MB) [ 0.000000] EFI: mem02: type=7, attr=0xf, range=[0x000000000056e000-0x000000000f9d9000) (244MB) [ 0.000000] EFI: mem03: type=2, attr=0xf, range=[0x000000000f9d9000-0x000000001f000000) (246MB) [ 0.000000] EFI: mem04: type=3, attr=0xf, range=[0x000000001f000000-0x000000001f00e000) (0MB) [ 0.000000] EFI: mem05: type=7, attr=0xf, range=[0x000000001f00e000-0x00000000365ae000) (373MB) [ 0.000000] EFI: mem06: type=2, attr=0xf, range=[0x00000000365ae000-0x00000000372cf000) (13MB) [ 0.000000] EFI: mem07: type=7, attr=0xf, range=[0x00000000372cf000-0x000000003d8bc000) (101MB) [ 0.000000] EFI: mem08: type=4, attr=0xf, range=[0x000000003d8bc000-0x000000003dc9f000) (3MB) [ 0.000000] EFI: mem09: type=7, attr=0xf, range=[0x000000003dc9f000-0x000000003dcb0000) (0MB) [ 0.000000] EFI: mem10: type=4, attr=0xf, range=[0x000000003dcb0000-0x000000003dcca000) (0MB) [ 0.000000] EFI: mem11: type=7, attr=0xf, range=[0x000000003dcca000-0x000000003dcda000) (0MB) [ 0.000000] EFI: mem12: type=4, attr=0xf, range=[0x000000003dcda000-0x000000003dcf6000) (0MB) [ 0.000000] EFI: mem13: type=7, attr=0xf, range=[0x000000003dcf6000-0x000000003dd4d000) (0MB) [ 0.000000] EFI: mem14: type=4, attr=0xf, range=[0x000000003dd4d000-0x000000003de05000) (0MB) [ 0.000000] EFI: mem15: type=7, attr=0xf, range=[0x000000003de05000-0x000000003de50000) (0MB) [ 0.000000] EFI: mem16: type=1, attr=0xf, range=[0x000000003de50000-0x000000003de70000) (0MB) [ 0.000000] EFI: mem17: type=4, attr=0xf, range=[0x000000003de70000-0x000000003de71000) (0MB) [ 0.000000] EFI: mem18: type=7, attr=0xf, range=[0x000000003de71000-0x000000003de95000) (0MB) [ 0.000000] EFI: mem19: type=2, attr=0xf, range=[0x000000003de95000-0x000000003de9b000) (0MB) [ 0.000000] EFI: mem20: type=4, attr=0xf, range=[0x000000003de9b000-0x000000003dea1000) (0MB) [ 0.000000] EFI: mem21: type=7, attr=0xf, range=[0x000000003dea1000-0x000000003dea4000) (0MB) [ 0.000000] EFI: mem22: type=2, attr=0xf, range=[0x000000003dea4000-0x000000003dea7000) (0MB) [ 0.000000] EFI: mem23: type=4, attr=0xf, range=[0x000000003dea7000-0x000000003deb1000) (0MB) [ 0.000000] EFI: mem24: type=2, attr=0xf, range=[0x000000003deb1000-0x000000003deba000) (0MB) [ 0.000000] EFI: mem25: type=7, attr=0xf, range=[0x000000003deba000-0x000000003debb000) (0MB) [ 0.000000] EFI: mem26: type=4, attr=0xf, range=[0x000000003debb000-0x000000003e7e7000) (9MB) [ 0.000000] EFI: mem27: type=3, attr=0xf, range=[0x000000003e7e7000-0x000000003e951000) (1MB) [ 0.000000] EFI: mem28: type=4, attr=0xf, range=[0x000000003e951000-0x000000003e952000) (0MB) [ 0.000000] EFI: mem29: type=3, attr=0xf, range=[0x000000003e952000-0x000000003e9d3000) (0MB) [ 0.000000] EFI: mem30: type=5, attr=0x800000000000000f, range=[0x000000003e9d3000-0x000000003e9f6000) (0MB) [ 0.000000] EFI: mem31: type=3, attr=0xf, range=[0x000000003e9f6000-0x000000003ea20000) (0MB) [ 0.000000] EFI: mem32: type=5, attr=0x800000000000000f, range=[0x000000003ea20000-0x000000003ea35000) (0MB) [ 0.000000] EFI: mem33: type=0, attr=0xf, range=[0x000000003ea35000-0x000000003ea36000) (0MB) [ 0.000000] EFI: mem34: type=4, attr=0xf, range=[0x000000003ea36000-0x000000003eed3000) (4MB) [ 0.000000] EFI: mem35: type=3, attr=0xf, range=[0x000000003eed3000-0x000000003eede000) (0MB) [ 0.000000] EFI: mem36: type=4, attr=0xf, range=[0x000000003eede000-0x000000003f83f000) (9MB) [ 0.000000] EFI: mem37: type=7, attr=0xf, range=[0x000000003f83f000-0x000000003f843000) (0MB) [ 0.000000] EFI: mem38: type=3, attr=0xf, range=[0x000000003f843000-0x000000003f8be000) (0MB) [ 0.000000] EFI: mem39: type=5, attr=0x800000000000000f, range=[0x000000003f8be000-0x000000003f8cc000) (0MB) [ 0.000000] EFI: mem40: type=3, attr=0xf, range=[0x000000003f8cc000-0x000000003f913000) (0MB) [ 0.000000] EFI: mem41: type=5, attr=0x800000000000000f, range=[0x000000003f913000-0x000000003f922000) (0MB) [ 0.000000] EFI: mem42: type=3, attr=0xf, range=[0x000000003f922000-0x000000003f92f000) (0MB) [ 0.000000] EFI: mem43: type=5, attr=0x800000000000000f, range=[0x000000003f92f000-0x000000003f933000) (0MB) [ 0.000000] EFI: mem44: type=5, attr=0x800000000000000f, range=[0x000000003f933000-0x000000003f94f000) (0MB) [ 0.000000] EFI: mem45: type=6, attr=0x800000000000000f, range=[0x000000003f94f000-0x000000003f985000) (0MB) [ 0.000000] EFI: mem46: type=6, attr=0x800000000000000f, range=[0x000000003f985000-0x000000003f99f000) (0MB) [ 0.000000] EFI: mem47: type=9, attr=0xf, range=[0x000000003f99f000-0x000000003f9b5000) (0MB) [ 0.000000] EFI: mem48: type=9, attr=0xf, range=[0x000000003f9b5000-0x000000003f9bb000) (0MB) [ 0.000000] EFI: mem49: type=10, attr=0xf, range=[0x000000003f9bb000-0x000000003f9bc000) (0MB) [ 0.000000] EFI: mem50: type=10, attr=0xf, range=[0x000000003f9bc000-0x000000003f9bf000) (0MB) [ 0.000000] EFI: mem51: type=4, attr=0xf, range=[0x000000003f9bf000-0x000000003fee0000) (5MB) [ 0.000000] EFI: mem52: type=6, attr=0x800000000000000f, range=[0x000000003fee0000-0x000000003ff00000) (0MB) [ 0.666999] fb0: EFI VGA frame buffer device [ 1.083445] EFI Variables Facility v0.08 2004-May-17 Ce grand nombre de ligne, dont plusieurs avec la mention "mem...", c'est caractéristique de Ubuntu démarré dans un système UEFI Dernière modification par malbo (Le 29/11/2011, à 11:58) MedionPC MT5 MED MT 162 / pentium IV / RAM 1Go / Radeon HD 3450 AGP / XP, HandyLinux et Xubuntu 14.04 32 bits Acer Aspire M5100-5F7N / Phenom Quad Core 9500 / ATI HD 2600 pro / RAM 4 Go / Win8, XP et Ubuntu 14.04 Hors ligne Ayu Re : Grub ne se lance pas ça donne [ 1.237075] EFI Variables Facility v0.08 2004-May-17 Que vous m'aspergiez d’alcool et de nourritures, que vous me crachiez à la figure, ça passe encore, mais il y as des limites !! Je ne tolère pas que l'ont maltraite un ami! - Akagami no Shanks Hors ligne malbo Re : Grub ne se lance pas ça donne [ 1.237075] EFI Variables Facility v0.08 2004-May-17 OK donc quand tu sélectionnes un boot sur le DD (SATA: ST31000524AS) dans ton "Bios", tu démarres bien en mode "Legacy Device" dont il est question dans ce lien sur les vues : http://support.asus.com/Search/KDetail. … 19D871&t=2 C'est à dire que ton "Bios" ce comporte comme un ancien Bios (et non pas comme un sytème UEFI) et il est d'ailleurs vu par Ubuntu comme un Bios (et pas comme un UEFI). Avec ma petite connaissance du domaine, je crois pouvoir dire qu'il n'est pas possible de réussir à obtenir un menu Grub qui pourrait lancer Windows dans ta configuration actuelle de Ubuntu. En effet, Ubuntu s'est installé (que tu l'aies voulu ou non, ça je ne sais pas le dire) en mode Bios donc il est équipé de grub-pc (au lieu de grub-efi si l'installation avait été faite en mode UEFI). Grub-pc n'arrive pas à détecter la présence de ton Windows 7 parce que ta partition Win7 n'est pas équipé des fichiers caractéristiques d'une installation en mode Bios de Windows 7 : on peut voir dans le résultat de ton Boot Info Script, que ta partition sda3 ne comporte pas ces éléments Bootmgr, BCD, etc... qui servent à cette détection. Normal puisque l'équivalent de ces éléments doit être planqué dans la partition EFI. En bref, je pense que tu es obligé de choisir ton camp : 1ère possibilité : tu mets la priorité de démarrage sur le DD (SATA: ST31000524AS) dans ton "Bios" et tu démarres par défaut sur Ubuntu. Et le jour où tu as besoin d'aller sur Windows, tu passes par ton "Bios" pour choisir de démarrer "Windows Boot Manager". 2ème possibilité : Parce que tu travailles essentiellement sur Windows ou que le PC est à usage familial, tu mets la priorité de démarrage sur "Windows Boot Manager" dans le "Bios" et le jour où tu dois aller sous Ubuntu, tu passes par le "Bios" pour sélectionner le DD (SATA: ST31000524AS Dernière modification par malbo (Le 29/11/2011, à 12:22) MedionPC MT5 MED MT 162 / pentium IV / RAM 1Go / Radeon HD 3450 AGP / XP, HandyLinux et Xubuntu 14.04 32 bits Acer Aspire M5100-5F7N / Phenom Quad Core 9500 / ATI HD 2600 pro / RAM 4 Go / Win8, XP et Ubuntu 14.04 Hors ligne Ayu Re : Grub ne se lance pas Oui c'est ce que je compte faire pour le moment mais ce n'est pas la bonne solution en tous cas merci pour ton aide Que vous m'aspergiez d’alcool et de nourritures, que vous me crachiez à la figure, ça passe encore, mais il y as des limites !! Je ne tolère pas que l'ont maltraite un ami! - Akagami no Shanks Hors ligne malbo Re : Grub ne se lance pas Si tu n'attends plus d'aide pour ce problème, peux-tu modifier le titre de ton post #1 pour qu'il devienne : [Résolu] Grub ne se lance pas en suivant ces indications ( 5.2 Passer son sujet en [Résolu] ) : http://doc.ubuntu-fr.org/tutoriel/howto … _en_resolu Si dans l'avenir, tu réussis à avoir un multi-boot Win7/Ubuntu fonctionnel qui soit géré par Grub (je pense que ce serait grâce à une install de Ubuntu faite en UEFI mode mais moi, je ne sais pas comment il faut faire pratiquement pour ça), ce serait sympa de donner des nouvelles et des tuyaux en postant dans la présente discussion ; ça pourra servir à d'autres. MedionPC MT5 MED MT 162 / pentium IV / RAM 1Go / Radeon HD 3450 AGP / XP, HandyLinux et Xubuntu 14.04 32 bits Acer Aspire M5100-5F7N / Phenom Quad Core 9500 / ATI HD 2600 pro / RAM 4 Go / Win8, XP et Ubuntu 14.04 Hors ligne Ayu Re : Grub ne se lance pas Oui mais j'attends toujours une solution ^^' c'est pas encore résolu vous trouvez pas ? Que vous m'aspergiez d’alcool et de nourritures, que vous me crachiez à la figure, ça passe encore, mais il y as des limites !! Je ne tolère pas que l'ont maltraite un ami! - Akagami no Shanks Hors ligne malbo Re : Grub ne se lance pas Ayu, Comme tu te rends bien compte, je ne sais pas t'aider davantage pour la solution de tes rêves mais je te recommande un chose si tu ne l'as pas déjà faite : prévois de pouvoir réinstaller Windows dans ce PC. Si tu as le DVD d'install de Win7 ou d'autres moyens d'install sur support externe (sur clé USB ou disque dur externe), c'est parfait sinon fait le nécessaire avant d'autres tentatives. MedionPC MT5 MED MT 162 / pentium IV / RAM 1Go / Radeon HD 3450 AGP / XP, HandyLinux et Xubuntu 14.04 32 bits Acer Aspire M5100-5F7N / Phenom Quad Core 9500 / ATI HD 2600 pro / RAM 4 Go / Win8, XP et Ubuntu 14.04 Hors ligne xabilon Re : Grub ne se lance pas Je ne peux que m'incliner ... et penser que le UEFI promet de belles prises de tête sur les forums GNU/Linux. Pour passer un sujet en résolu : modifiez le premier message et ajoutez [Résolu] au titre. Hors ligne Ayu Re : Grub ne se lance pas malbo, Oui c'est pas grave si je dois réinstaller Win7 c'est un nouveau PC donc j'évite d'y mettre des données tant que j'ai pas regler ce problème Que vous m'aspergiez d’alcool et de nourritures, que vous me crachiez à la figure, ça passe encore, mais il y as des limites !! Je ne tolère pas que l'ont maltraite un ami! - Akagami no Shanks Hors ligne Ayu Re : Grub ne se lance pas Bonsoir, Oui j'ai toujours le problème (à chaque démarrage je go BIOS pour lancer windows) Voici le lien http://paste.ubuntu.com/769415/ En attente de votre aide. Merci d'avance. Que vous m'aspergiez d’alcool et de nourritures, que vous me crachiez à la figure, ça passe encore, mais il y as des limites !! Je ne tolère pas que l'ont maltraite un ami! - Akagami no Shanks Hors ligne YannUbuntu Re : Grub ne se lance pas Merci. - Pouvez-vous svp vérifier que dans les Options avancées de Boot-Repair, onglet "Emplacement de GRUB", il y a une case (non cochée par défaut) "Partition /boot/efi :" et qu'à sa droite il y a une liste déroulante avec uniquement "sda1" comme choix? - pouvez-vous booter sur Ubuntu, ouvrir un terminal, et indiquer le retour des commandes suivantes svp : sudo mount /dev/sda1 /mnt && ls -F /mnt ls -F /mnt/efi (liste les fichiers de sda1) Hors ligne malbo Re : Grub ne se lance pas Effectivement, l'installation s'est enrichie. Dans le post #1 on avait ça : sda3: __________________________________________________________________________ File system: ntfs Boot sector type: Windows Vista/7 Boot sector info: No errors found in the Boot Parameter Block. Operating System: Windows 7 Boot files: /Windows/System32/winload.exe A présent, dans le résultat du Boot Info script du post #19, on a ça : sda3: __________________________________________________________________________ File system: ntfs Boot sector type: Grub2 (v1.99) Boot sector info: Grub2 (v1.99) is installed in the boot sector of sda3 and looks at sector 745534560 of the same hard drive for core.img. core.img is at this location and looks for on this drive. No errors found in the Boot Parameter Block. Operating System: Windows 7 Boot files: /Windows/System32/winload.exe Grub dans le secteur de boot de la partition système de Windows, c'est pas trop bon...Heureusement que le windows 7 installé est "EFI" (et pas "Bios"), c'est à dire qu'il se fout de ce secteur de Boot parce qu'il utilise les instructions qui sont dans sda1 pour démarrer. Dernière modification par malbo (Le 14/12/2011, à 10:26) MedionPC MT5 MED MT 162 / pentium IV / RAM 1Go / Radeon HD 3450 AGP / XP, HandyLinux et Xubuntu 14.04 32 bits Acer Aspire M5100-5F7N / Phenom Quad Core 9500 / ATI HD 2600 pro / RAM 4 Go / Win8, XP et Ubuntu 14.04 Hors ligne Ayu Re : Grub ne se lance pas Bonsoir, Oui y a bien que sda1 dans le menu déroulant. et pour les commande j'ai ça: ~$ sudo mount /dev/sda1 /mnt && ls -F /mnt EFI/ ~$ ls -F /mnt/efi Boot/ Microsoft/ Que vous m'aspergiez d’alcool et de nourritures, que vous me crachiez à la figure, ça passe encore, mais il y as des limites !! Je ne tolère pas que l'ont maltraite un ami! - Akagami no Shanks Hors ligne YannUbuntu Re : Grub ne se lance pas je peux vous aider à installer grub-efi (qui je l'espère réglera le problème) avec mes maigres connaissances sur le sujet, mais je ne garantis pas le résultat, donc par précaution svp commencez par: - sauver toutes vos données sur un support externe (disque USB ou DVD) - m'envoyer une archive TAR.GZ du contenu de la partition sda1 par email (yannubuntu ATT gmail POINT com) - m'envoyer aussi par mail une archive TAR.GZ du dossier /var/log/clean qui se trouve dans la partition Ubuntu (sda4) Hors ligne malbo Re : Grub ne se lance pas Ayu, Pas hasard, je suis tombé sur cette vidéo qui détaille minutieusement la mise à jour du Bios pour ta carte-mère : http://www.dailymotion.com/video/xmyt8x … -asus_tech Je ne sais pas si cette mise à jour du Bios pourrait améliorer la cohabitation Ubuntu/Win7 dans ton PC, mais il faut y penser. MedionPC MT5 MED MT 162 / pentium IV / RAM 1Go / Radeon HD 3450 AGP / XP, HandyLinux et Xubuntu 14.04 32 bits Acer Aspire M5100-5F7N / Phenom Quad Core 9500 / ATI HD 2600 pro / RAM 4 Go / Win8, XP et Ubuntu 14.04 Hors ligne jeanmi199 Re : Grub ne se lance pas @Ayu. Quand tu as installer windows tu as ou plutôt windows a formater ton disque en GPT au lieu de MBR (voir les options avancée a l'install de win7) ton probleme vien de la et pas de EFI. Les volume GPT sont prévu pour des disques de plus de 2,2To comme tu as un disque de 1To tu peux le formater en MBR. en tout cas dans un premier temps je ne sais pas si apres reformatage du disque en MBR l'EFI ne causera pas de problème (a creuser) mais je n'ai pas le matériel ad'hoc. Dernière modification par jeanmi199 (Le 21/12/2011, à 00:37) Hors ligne
I'm trying to trawl newsgroup to test some text-based grouping algorithms, fetching batches of newsgroup headers and sticking them into a SQLite database. The database is about as plain as it gets, with text columns for all the data, and the header data as fetched by Python's nntp library always gives 8 values per header. All but one of those are strings, and I convert the only non-string to a string before inserting my data into the database. This notwithstanding, Python falls over itself with the rather useless "TypeError: not all arguments converted during string formatting" error, which is only a marginal step up from just saying "error: good luck, you're on your own." Does someone who understands how string formatting of a string to a string goes wrong better than I know what's going wrong in the following code? import nntplib, sqlite3 # newsgroup settings (modify so that this works for you =) server = 'news.yournewsgroup.com' port = 119 username = 'your name here' password = 'your password here' # set up the newsgroup and sqlite connections connection = nntplib.NNTP(server, port, username, password) newsgroup = "comp.graphics.algorithms" connection.group(newsgroup) database = sqlite3.connect(newsgroup + ".db") # create a table definition if it doesn't exist yet try: # SQLite doesn't actually have data types. Everything as stored as plain text. # And so is newsgroup data. Bonus! database.execute("""CREATE TABLE headers (articleNumber text, subject text, poster text, date text, id text, references text, size text, lines text)""") except: # table definition already exists. Not actually an error. pass # Get the group meta-data, and set up iterator values for running # through the header list. resp, count, first, last, name = connection.group(newsgroup) total = int(last) - int(first) step = 10000 steps = total / step; articleRange = first + '-' + str(int(first)+step) # grab a batch of headers print "[FETCHING HEADERS]" resp, list = connection.xover(first, str(int(first)+step)) print "done." # process the fetched headers print "[PROCSSING HEADERS]" for entry in list: # Unpack immutable tuple, mutate (because the references list # should be a string), then repack. articleNumber, subject, poster, date, id, references, size, lines = entry argumentList = (articleNumber, subject, poster, date, id, (",".join(references)), size, lines) try: # try to chronicle the header information. THIS WILL GO WRONG AT SOME POINT. database.execute("""INSERT INTO headers (articleNumber, subject, poster, date, id, reference, size, lines) VALUES ('?', '?', '?', '?', '?','?', '?', '?')""" % argumentList) except TypeError as err: # And here is an irking point with Python in general. Something went # wrong, yet all it tells us is "not all arguments converted during # string formatting". Despite that error being generated at a point # where the code knows WHICH argument was the problem. print err print type(argumentList[0]), argumentList[0] print type(argumentList[1]), argumentList[1] print type(argumentList[2]), argumentList[2] print type(argumentList[3]), argumentList[3] print type(argumentList[4]), argumentList[4] print type(argumentList[5]), argumentList[5] print type(argumentList[6]), argumentList[6] print type(argumentList[7]), argumentList[7] # A quick print set shows us that all arguments are already of type # "str", and none of them are empty... so it would take quite a bit # of work to make them fail at being legal strings... Wat? exit(1) print "done." # cleanup database.close() connection.quit()
I've finally found why my Google Chrome is so slow. And I've found these 2 posts.The first on Google Chrome forum and the second one here.The solution suggested in the second post requires a modification of /etc/modprobe.d/aliases, but on my Ubuntu 11.04 I don't have such a file. None of the resources i found would work on 11.04. Can anyone use anything that has worked and which is easily revertible? Below are the result of dig aaaa he.net and dig a he.net joseph@joseph-off-lap:~$ dig aaaa he.net ; <<>> DiG 9.7.3 <<>> aaaa he.net ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 15618 ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 5, ADDITIONAL: 7 ;; QUESTION SECTION: ;he.net. IN AAAA ;; ANSWER SECTION: he.net. 58616 IN AAAA 2001:470:0:76::2 ;; AUTHORITY SECTION: he.net. 2031 IN NS ns2.he.net. he.net. 2031 IN NS ns3.he.net. he.net. 2031 IN NS ns4.he.net. he.net. 2031 IN NS ns5.he.net. he.net. 2031 IN NS ns1.he.net. ;; ADDITIONAL SECTION: ns1.he.net. 2044 IN A 216.218.130.2 ns2.he.net. 2044 IN A 216.218.131.2 ns2.he.net. 73027 IN AAAA 2001:470:200::2 ns3.he.net. 2044 IN A 216.218.132.2 ns3.he.net. 62719 IN AAAA 2001:470:300::2 ns4.he.net. 2044 IN A 216.66.1.2 ns4.he.net. 62719 IN AAAA 2001:470:400::2 ;; Query time: 134 msec ;; SERVER: 80.87.78.4#53(80.87.78.4) ;; WHEN: Mon Jul 4 17:02:33 2011 ;; MSG SIZE rcvd: 290 joseph@joseph-off-lap:~$ dig a he.net ; <<>> DiG 9.7.3 <<>> a he.net ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 31069 ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 5, ADDITIONAL: 7 ;; QUESTION SECTION: ;he.net. IN A ;; ANSWER SECTION: he.net. 58533 IN A 216.218.186.2 ;; AUTHORITY SECTION: he.net. 1948 IN NS ns4.he.net. he.net. 1948 IN NS ns5.he.net. he.net. 1948 IN NS ns1.he.net. he.net. 1948 IN NS ns2.he.net. he.net. 1948 IN NS ns3.he.net. ;; ADDITIONAL SECTION: ns1.he.net. 1961 IN A 216.218.130.2 ns2.he.net. 1961 IN A 216.218.131.2 ns2.he.net. 72944 IN AAAA 2001:470:200::2 ns3.he.net. 1961 IN A 216.218.132.2 ns3.he.net. 62636 IN AAAA 2001:470:300::2 ns4.he.net. 1961 IN A 216.66.1.2 ns4.he.net. 62636 IN AAAA 2001:470:400::2 ;; Query time: 190 msec ;; SERVER: 80.87.78.4#53(80.87.78.4) ;; WHEN: Mon Jul 4 17:03:56 2011 ;; MSG SIZE rcvd: 278 below are the result for ping and ping6 joseph@joseph-off-lap:~$ ping -c 5 he.net PING he.net (216.218.186.2) 56(84) bytes of data. 64 bytes from he.net (216.218.186.2): icmp_req=1 ttl=45 time=277 ms 64 bytes from he.net (216.218.186.2): icmp_req=2 ttl=45 time=275 ms 64 bytes from he.net (216.218.186.2): icmp_req=3 ttl=45 time=277 ms 64 bytes from he.net (216.218.186.2): icmp_req=4 ttl=45 time=275 ms 64 bytes from he.net (216.218.186.2): icmp_req=5 ttl=45 time=275 ms --- he.net ping statistics --- 5 packets transmitted, 5 received, 0% packet loss, time 21209ms rtt min/avg/max/mdev = 275.675/276.405/277.621/0.995 ms joseph@joseph-off-lap:~$ ping6 -c 5 he.net connect: Network is unreachable joseph@joseph-off-lap:~$ as suggested i'm leaning towards installing miredo .is there any configurations/tweaks to make it works? what would you say about disabling ipv6 vs installing miredo ? thanks for reading this. ;)
The Date Helper primarily creates select/option tags for different kinds of dates and times or date and time elements. All of the select-type methods share a number of common options that are as follows: :prefix- overwrites the default prefix of “date” used for the select names. So specifying “birthday” would give birthday[month] instead of date[month] if passed to theselect_monthmethod. :include_blank- set to true if it should be possible to set an empty date. :discard_type- set to true if you want to discard the type part of the select name. If set to true, theselect_monthmethod would use simply “date” (which can be overwritten using:prefix) instead of date[month]. D S T MINUTES_IN_YEAR = 525600 MINUTES_IN_QUARTER_YEAR = 131400 MINUTES_IN_THREE_QUARTERS_YEAR = 394200 date_select(object_name, method, options = {}, html_options = {}) Link Returns a set of select tags (one for year, month, and day) pre-selectedfor accessing a specified date-based attribute (identified bymethod) on an object assigned to the template (identified byobject). Options :use_month_numbers- Set to true if you want to use month numbers rather than month names (e.g. “2” instead of “February”). :use_two_digit_numbers- Set to true if you want to display two digit month and day numbers (e.g. “02” instead of “February” and “08” instead of “8”). :use_short_month- Set to true if you want to use abbreviated month names instead of full month names (e.g. “Feb” instead of “February”). :add_month_numbers- Set to true if you want to use both month numbers and month names (e.g. “2 - February” instead of “February”). :use_month_names- Set to an array with 12 month names if you want to customize month names. Note: You can also use Rails' i18n functionality for this. :month_format_string- Set to a format string. The string gets passed keys:number(integer) and:name(string). A format string would be something like “%{name} (%<number>02d)” for example. SeeKernel.sprintffor documentation on format sequences. :date_separator- Specifies a string to separate the date fields. Default is “” (i.e. nothing). :start_year- Set the start year for the year select. Default isDate.today.year - 5if you are creating new record. While editing existing record,:start_yeardefaults to the current selected year minus 5. :end_year- Set the end year for the year select. Default isDate.today.year + 5if you are creating new record. While editing existing record,:end_yeardefaults to the current selected year plus 5. :discard_day- Set to true if you don't want to show a day select. This includes the day as a hidden field instead of showing a select field. Also note that this implicitly sets the day to be the first of the given month in order to not create invalid dates like 31 February. :discard_month- Set to true if you don't want to show a month select. This includes the month as a hidden field instead of showing a select field. Also note that this implicitly sets :discard_day to true. :discard_year- Set to true if you don't want to show a year select. This includes the year as a hidden field instead of showing a select field. :order- Set to an array containing:day,:monthand:yearto customize the order in which the select fields are shown. If you leave out any of the symbols, the respective select will not be shown (like when you setdiscard_xxx: true. Defaults to the order defined in the respective locale (e.g. [:year, :month, :day] in the en locale that ships with Rails). :include_blank- Include a blank option in every select field so it's possible to set empty dates. :default- Set a default date if the affected date isn't set or is nil. :selected- Set a date that overrides the actual value. :disabled- Set to true if you want show the select fields as disabled. :prompt- Set to true (for a generic prompt), a prompt string or a hash of prompt strings for:year,:month,:day,:hour,:minuteand:second. Setting this option prepends a select option with a generic prompt (Day, Month, Year, Hour, Minute, Seconds) or the given prompt string. :with_css_classes- Set to true if you want assign different styles for 'select' tags. This option automatically set classes 'year', 'month', 'day', 'hour', 'minute' and 'second' for your 'select' tags. If anything is passed in the html_options hash it will beapplied to every select tag in the set. NOTE: Discarded selects will default to 1. So if no month select is available, January will be assumed. # Generates a date select that when POSTed is stored in the article variable, in the written_on attribute. date_select("article", "written_on") # Generates a date select that when POSTed is stored in the article variable, in the written_on attribute, # with the year in the year drop down box starting at 1995. date_select("article", "written_on", start_year: 1995) # Generates a date select that when POSTed is stored in the article variable, in the written_on attribute, # with the year in the year drop down box starting at 1995, numbers used for months instead of words, # and without a day select box. date_select("article", "written_on", start_year: 1995, use_month_numbers: true, discard_day: true, include_blank: true) # Generates a date select that when POSTed is stored in the article variable, in the written_on attribute, # with two digit numbers used for months and days. date_select("article", "written_on", use_two_digit_numbers: true) # Generates a date select that when POSTed is stored in the article variable, in the written_on attribute # with the fields ordered as day, month, year rather than month, day, year. date_select("article", "written_on", order: [:day, :month, :year]) # Generates a date select that when POSTed is stored in the user variable, in the birthday attribute # lacking a year field. date_select("user", "birthday", order: [:month, :day]) # Generates a date select that when POSTed is stored in the article variable, in the written_on attribute # which is initially set to the date 3 days from the current date date_select("article", "written_on", default: 3.days.from_now) # Generates a date select that when POSTed is stored in the article variable, in the written_on attribute # which is set in the form with todays date, regardless of the value in the Active Record object. date_select("article", "written_on", selected: Date.today) # Generates a date select that when POSTed is stored in the credit_card variable, in the bill_due attribute # that will have a default day of 20. date_select("credit_card", "bill_due", default: { day: 20 }) # Generates a date select with custom prompts. date_select("article", "written_on", prompt: { day: 'Select day', month: 'Select month', year: 'Select year' }) The selects are prepared for multi-parameter assignment to an Active Record object. Note: If the day is not included as an option but the month is, the day will be set to the 1st to ensure that all month choices are valid. # File actionview/lib/action_view/helpers/date_helper.rb, line 257 def date_select(object_name, method, options = {}, html_options = {}) Tags::DateSelect.new(object_name, method, self, options, html_options).render end datetime_select(object_name, method, options = {}, html_options = {}) Link Returns a set of select tags (one for year, month, day, hour, and minute)pre-selected for accessing a specified datetime-based attribute (identifiedby method) on an object assigned to the template (identifiedby object). If anything is passed in the html_options hash it will be applied to every select tag in the set. # Generates a datetime select that, when POSTed, will be stored in the article variable in the written_on # attribute. datetime_select("article", "written_on") # Generates a datetime select with a year select that starts at 1995 that, when POSTed, will be stored in the # article variable in the written_on attribute. datetime_select("article", "written_on", start_year: 1995) # Generates a datetime select with a default value of 3 days from the current time that, when POSTed, will # be stored in the trip variable in the departing attribute. datetime_select("trip", "departing", default: 3.days.from_now) # Generate a datetime select with hours in the AM/PM format datetime_select("article", "written_on", ampm: true) # Generates a datetime select that discards the type that, when POSTed, will be stored in the article variable # as the written_on attribute. datetime_select("article", "written_on", discard_type: true) # Generates a datetime select with a custom prompt. Use <tt>prompt: true</tt> for generic prompts. datetime_select("article", "written_on", prompt: {day: 'Choose day', month: 'Choose month', year: 'Choose year'}) datetime_select("article", "written_on", prompt: {hour: true}) # generic prompt for hours datetime_select("article", "written_on", prompt: true) # generic prompts for all The selects are prepared for multi-parameter assignment to an Active Record object. # File actionview/lib/action_view/helpers/date_helper.rb, line 329 def datetime_select(object_name, method, options = {}, html_options = {}) Tags::DatetimeSelect.new(object_name, method, self, options, html_options).render end distance_of_time_in_words(from_time, to_time = 0, options = {}) Link Reports the approximate distance in time between two Time, Date or DateTime objects or integers as seconds.Pass include_seconds: true if you want more detailedapproximations when distance < 1 min, 29 secs. Distances are reportedbased on the following table: 0 <-> 29 secs # => less than a minute30 secs <-> 1 min, 29 secs # => 1 minute1 min, 30 secs <-> 44 mins, 29 secs # => [2..44] minutes44 mins, 30 secs <-> 89 mins, 29 secs # => about 1 hour89 mins, 30 secs <-> 23 hrs, 59 mins, 29 secs # => about [2..24] hours23 hrs, 59 mins, 30 secs <-> 41 hrs, 59 mins, 29 secs # => 1 day41 hrs, 59 mins, 30 secs <-> 29 days, 23 hrs, 59 mins, 29 secs # => [2..29] days29 days, 23 hrs, 59 mins, 30 secs <-> 44 days, 23 hrs, 59 mins, 29 secs # => about 1 month44 days, 23 hrs, 59 mins, 30 secs <-> 59 days, 23 hrs, 59 mins, 29 secs # => about 2 months59 days, 23 hrs, 59 mins, 30 secs <-> 1 yr minus 1 sec # => [2..12] months1 yr <-> 1 yr, 3 months # => about 1 year1 yr, 3 months <-> 1 yr, 9 months # => over 1 year1 yr, 9 months <-> 2 yr minus 1 sec # => almost 2 years2 yrs <-> max time or date # => (same rules as 1 yr) With include_seconds: true and the difference < 1 minute 29seconds: 0-4 secs # => less than 5 seconds 5-9 secs # => less than 10 seconds 10-19 secs # => less than 20 seconds 20-39 secs # => half a minute 40-59 secs # => less than a minute 60-89 secs # => 1 minute from_time = Time.now distance_of_time_in_words(from_time, from_time + 50.minutes) # => about 1 hour distance_of_time_in_words(from_time, 50.minutes.from_now) # => about 1 hour distance_of_time_in_words(from_time, from_time + 15.seconds) # => less than a minute distance_of_time_in_words(from_time, from_time + 15.seconds, include_seconds: true) # => less than 20 seconds distance_of_time_in_words(from_time, 3.years.from_now) # => about 3 years distance_of_time_in_words(from_time, from_time + 60.hours) # => 3 days distance_of_time_in_words(from_time, from_time + 45.seconds, include_seconds: true) # => less than a minute distance_of_time_in_words(from_time, from_time - 45.seconds, include_seconds: true) # => less than a minute distance_of_time_in_words(from_time, 76.seconds.from_now) # => 1 minute distance_of_time_in_words(from_time, from_time + 1.year + 3.days) # => about 1 year distance_of_time_in_words(from_time, from_time + 3.years + 6.months) # => over 3 years distance_of_time_in_words(from_time, from_time + 4.years + 9.days + 30.minutes + 5.seconds) # => about 4 years to_time = Time.now + 6.years + 19.days distance_of_time_in_words(from_time, to_time, include_seconds: true) # => about 6 years distance_of_time_in_words(to_time, from_time, include_seconds: true) # => about 6 years distance_of_time_in_words(Time.now, Time.now) # => less than a minute # File actionview/lib/action_view/helpers/date_helper.rb, line 71 def distance_of_time_in_words(from_time, to_time = 0, options = {}) options = { scope: :'datetime.distance_in_words' }.merge!(options) from_time = from_time.to_time if from_time.respond_to?(:to_time) to_time = to_time.to_time if to_time.respond_to?(:to_time) from_time, to_time = to_time, from_time if from_time > to_time distance_in_minutes = ((to_time - from_time)/60.0).round distance_in_seconds = (to_time - from_time).round I18n.with_options :locale => options[:locale], :scope => options[:scope] do |locale| case distance_in_minutes when 0..1 return distance_in_minutes == 0 ? locale.t(:less_than_x_minutes, :count => 1) : locale.t(:x_minutes, :count => distance_in_minutes) unless options[:include_seconds] case distance_in_seconds when 0..4 then locale.t :less_than_x_seconds, :count => 5 when 5..9 then locale.t :less_than_x_seconds, :count => 10 when 10..19 then locale.t :less_than_x_seconds, :count => 20 when 20..39 then locale.t :half_a_minute when 40..59 then locale.t :less_than_x_minutes, :count => 1 else locale.t :x_minutes, :count => 1 end when 2...45 then locale.t :x_minutes, :count => distance_in_minutes when 45...90 then locale.t :about_x_hours, :count => 1 # 90 mins up to 24 hours when 90...1440 then locale.t :about_x_hours, :count => (distance_in_minutes.to_f / 60.0).round # 24 hours up to 42 hours when 1440...2520 then locale.t :x_days, :count => 1 # 42 hours up to 30 days when 2520...43200 then locale.t :x_days, :count => (distance_in_minutes.to_f / 1440.0).round # 30 days up to 60 days when 43200...86400 then locale.t :about_x_months, :count => (distance_in_minutes.to_f / 43200.0).round # 60 days up to 365 days when 86400...525600 then locale.t :x_months, :count => (distance_in_minutes.to_f / 43200.0).round else if from_time.acts_like?(:time) && to_time.acts_like?(:time) fyear = from_time.year fyear += 1 if from_time.month >= 3 tyear = to_time.year tyear -= 1 if to_time.month < 3 leap_years = (fyear > tyear) ? 0 : (fyear..tyear).count{|x| Date.leap?(x)} minute_offset_for_leap_year = leap_years * 1440 # Discount the leap year days when calculating year distance. # e.g. if there are 20 leap year days between 2 dates having the same day # and month then the based on 365 days calculation # the distance in years will come out to over 80 years when in written # English it would read better as about 80 years. minutes_with_offset = distance_in_minutes - minute_offset_for_leap_year else minutes_with_offset = distance_in_minutes end remainder = (minutes_with_offset % MINUTES_IN_YEAR) distance_in_years = (minutes_with_offset.div MINUTES_IN_YEAR) if remainder < MINUTES_IN_QUARTER_YEAR locale.t(:about_x_years, :count => distance_in_years) elsif remainder < MINUTES_IN_THREE_QUARTERS_YEAR locale.t(:over_x_years, :count => distance_in_years) else locale.t(:almost_x_years, :count => distance_in_years + 1) end end end end select_date(date = Date.current, options = {}, html_options = {}) Link Returns a set of HTML select-tags (one for year, month, and day)pre-selected with the date. It's possible to explicitlyset the order of the tags using the :order option with anarray of symbols :year, :month and:day in the desired order. If the array passed to the:order option does not contain all the three symbols, all tagswill be hidden. If anything is passed in the html_options hash it will be applied to every select tag in the set. my_date = Time.now + 6.days # Generates a date select that defaults to the date in my_date (six days after today). select_date(my_date) # Generates a date select that defaults to today (no specified date). select_date() # Generates a date select that defaults to the date in my_date (six days after today) # with the fields ordered year, month, day rather than month, day, year. select_date(my_date, order: [:year, :month, :day]) # Generates a date select that discards the type of the field and defaults to the date in # my_date (six days after today). select_date(my_date, discard_type: true) # Generates a date select that defaults to the date in my_date, # which has fields separated by '/'. select_date(my_date, date_separator: '/') # Generates a date select that defaults to the datetime in my_date (six days after today) # prefixed with 'payday' rather than 'date'. select_date(my_date, prefix: 'payday') # Generates a date select with a custom prompt. Use <tt>prompt: true</tt> for generic prompts. select_date(my_date, prompt: {day: 'Choose day', month: 'Choose month', year: 'Choose year'}) select_date(my_date, prompt: {hour: true}) # generic prompt for hours select_date(my_date, prompt: true) # generic prompts for all # File actionview/lib/action_view/helpers/date_helper.rb, line 417 def select_date(date = Date.current, options = {}, html_options = {}) DateTimeSelector.new(date, options, html_options).select_date end select_datetime(datetime = Time.current, options = {}, html_options = {}) Link Returns a set of HTML select-tags (one for year, month, day, hour, minute,and second) pre-selected with the datetime. It's alsopossible to explicitly set the order of the tags using the:order option with an array of symbols :year,:month and :day in the desired order. If you donot supply a Symbol, it will be appendedonto the :order passed in. You can also add:date_separator, :datetime_separator and:time_separator keys to the options to controlvisual display of the elements. If anything is passed in the html_options hash it will be applied to every select tag in the set. my_date_time = Time.now + 4.days # Generates a datetime select that defaults to the datetime in my_date_time (four days after today). select_datetime(my_date_time) # Generates a datetime select that defaults to today (no specified datetime) select_datetime() # Generates a datetime select that defaults to the datetime in my_date_time (four days after today) # with the fields ordered year, month, day rather than month, day, year. select_datetime(my_date_time, order: [:year, :month, :day]) # Generates a datetime select that defaults to the datetime in my_date_time (four days after today) # with a '/' between each date field. select_datetime(my_date_time, date_separator: '/') # Generates a datetime select that defaults to the datetime in my_date_time (four days after today) # with a date fields separated by '/', time fields separated by '' and the date and time fields # separated by a comma (','). select_datetime(my_date_time, date_separator: '/', time_separator: '', datetime_separator: ',') # Generates a datetime select that discards the type of the field and defaults to the datetime in # my_date_time (four days after today) select_datetime(my_date_time, discard_type: true) # Generate a datetime field with hours in the AM/PM format select_datetime(my_date_time, ampm: true) # Generates a datetime select that defaults to the datetime in my_date_time (four days after today) # prefixed with 'payday' rather than 'date' select_datetime(my_date_time, prefix: 'payday') # Generates a datetime select with a custom prompt. Use <tt>prompt: true</tt> for generic prompts. select_datetime(my_date_time, prompt: {day: 'Choose day', month: 'Choose month', year: 'Choose year'}) select_datetime(my_date_time, prompt: {hour: true}) # generic prompt for hours select_datetime(my_date_time, prompt: true) # generic prompts for all # File actionview/lib/action_view/helpers/date_helper.rb, line 378 def select_datetime(datetime = Time.current, options = {}, html_options = {}) DateTimeSelector.new(datetime, options, html_options).select_datetime end select_day(date, options = {}, html_options = {}) Link Returns a select tag with options for each of the days 1 through 31 withthe current day selected. The date can also be substituted fora day number. If you want to display days with a leading zero set the:use_two_digit_numbers key in options to true.Override the field name using the :field_name option,'day' by default. my_date = Time.now + 2.days # Generates a select field for days that defaults to the day for the date in my_date. select_day(my_date) # Generates a select field for days that defaults to the number given. select_day(5) # Generates a select field for days that defaults to the number given, but displays it with two digits. select_day(5, use_two_digit_numbers: true) # Generates a select field for days that defaults to the day for the date in my_date # that is named 'due' rather than 'day'. select_day(my_date, field_name: 'due') # Generates a select field for days with a custom prompt. Use <tt>prompt: true</tt> for a # generic prompt. select_day(5, prompt: 'Choose day') # File actionview/lib/action_view/helpers/date_helper.rb, line 560 def select_day(date, options = {}, html_options = {}) DateTimeSelector.new(date, options, html_options).select_day end select_hour(datetime, options = {}, html_options = {}) Link Returns a select tag with options for each of the hours 0 through 23 withthe current hour selected. The datetime can be either aTime or DateTime object or an integer. Overridethe field name using the :field_name option, 'hour' bydefault. my_time = Time.now + 6.hours # Generates a select field for hours that defaults to the hour for the time in my_time. select_hour(my_time) # Generates a select field for hours that defaults to the number given. select_hour(13) # Generates a select field for hours that defaults to the hour for the time in my_time # that is named 'stride' rather than 'hour'. select_hour(my_time, field_name: 'stride') # Generates a select field for hours with a custom prompt. Use <tt>prompt: true</tt> for a # generic prompt. select_hour(13, prompt: 'Choose hour') # Generate a select field for hours in the AM/PM format select_hour(my_time, ampm: true) # Generates a select field that includes options for hours from 2 to 14. select_hour(my_time, start_hour: 2, end_hour: 14) # File actionview/lib/action_view/helpers/date_helper.rb, line 533 def select_hour(datetime, options = {}, html_options = {}) DateTimeSelector.new(datetime, options, html_options).select_hour end select_minute(datetime, options = {}, html_options = {}) Link Returns a select tag with options for each of the minutes 0 through 59 withthe current minute selected. Also can return a select tag with options byminute_step from 0 through 59 with the 00 minute selected. Thedatetime can be either a Time orDateTime object or an integer. Override the field name usingthe :field_name option, 'minute' by default. my_time = Time.now + 6.hours # Generates a select field for minutes that defaults to the minutes for the time in my_time. select_minute(my_time) # Generates a select field for minutes that defaults to the number given. select_minute(14) # Generates a select field for minutes that defaults to the minutes for the time in my_time # that is named 'moment' rather than 'minute'. select_minute(my_time, field_name: 'moment') # Generates a select field for minutes with a custom prompt. Use <tt>prompt: true</tt> for a # generic prompt. select_minute(14, prompt: 'Choose minutes') # File actionview/lib/action_view/helpers/date_helper.rb, line 504 def select_minute(datetime, options = {}, html_options = {}) DateTimeSelector.new(datetime, options, html_options).select_minute end select_month(date, options = {}, html_options = {}) Link Returns a select tag with options for each of the months January throughDecember with the current month selected. The month names are presented askeys (what's shown to the user) and the month numbers (1-12) are usedas values (what's submitted to the server). It's also possible touse month numbers for the presentation instead of names – set the:use_month_numbers key in options to true forthis to happen. If you want both numbers and names, set the:add_month_numbers key in options to true. If youwould prefer to show month names as abbreviations, set the:use_short_month key in options to true. If youwant to use your own month names, set the :use_month_names keyin options to an array of 12 month names. If you want todisplay months with a leading zero set the:use_two_digit_numbers key in options to true.Override the field name using the :field_name option,'month' by default. # Generates a select field for months that defaults to the current month that # will use keys like "January", "March". select_month(Date.today) # Generates a select field for months that defaults to the current month that # is named "start" rather than "month". select_month(Date.today, field_name: 'start') # Generates a select field for months that defaults to the current month that # will use keys like "1", "3". select_month(Date.today, use_month_numbers: true) # Generates a select field for months that defaults to the current month that # will use keys like "1 - January", "3 - March". select_month(Date.today, add_month_numbers: true) # Generates a select field for months that defaults to the current month that # will use keys like "Jan", "Mar". select_month(Date.today, use_short_month: true) # Generates a select field for months that defaults to the current month that # will use keys like "Januar", "Marts." select_month(Date.today, use_month_names: %w(Januar Februar Marts ...)) # Generates a select field for months that defaults to the current month that # will use keys with two digit numbers like "01", "03". select_month(Date.today, use_two_digit_numbers: true) # Generates a select field for months with a custom prompt. Use <tt>prompt: true</tt> for a # generic prompt. select_month(14, prompt: 'Choose month') # File actionview/lib/action_view/helpers/date_helper.rb, line 605 def select_month(date, options = {}, html_options = {}) DateTimeSelector.new(date, options, html_options).select_month end select_second(datetime, options = {}, html_options = {}) Link Returns a select tag with options for each of the seconds 0 through 59 withthe current second selected. The datetime can be either aTime or DateTime object or an integer. Overridethe field name using the :field_name option, 'second'by default. my_time = Time.now + 16.minutes # Generates a select field for seconds that defaults to the seconds for the time in my_time. select_second(my_time) # Generates a select field for seconds that defaults to the number given. select_second(33) # Generates a select field for seconds that defaults to the seconds for the time in my_time # that is named 'interval' rather than 'second'. select_second(my_time, field_name: 'interval') # Generates a select field for seconds with a custom prompt. Use <tt>prompt: true</tt> for a # generic prompt. select_second(14, prompt: 'Choose seconds') # File actionview/lib/action_view/helpers/date_helper.rb, line 480 def select_second(datetime, options = {}, html_options = {}) DateTimeSelector.new(datetime, options, html_options).select_second end select_time(datetime = Time.current, options = {}, html_options = {}) Link Returns a set of HTML select-tags (one for hour and minute). You can set:time_separator key to format the output, and the:include_seconds option to include an input for seconds. If anything is passed in the html_options hash it will be applied to every select tag in the set. my_time = Time.now + 5.days + 7.hours + 3.minutes + 14.seconds # Generates a time select that defaults to the time in my_time. select_time(my_time) # Generates a time select that defaults to the current time (no specified time). select_time() # Generates a time select that defaults to the time in my_time, # which has fields separated by ':'. select_time(my_time, time_separator: ':') # Generates a time select that defaults to the time in my_time, # that also includes an input for seconds. select_time(my_time, include_seconds: true) # Generates a time select that defaults to the time in my_time, that has fields # separated by ':' and includes an input for seconds. select_time(my_time, time_separator: ':', include_seconds: true) # Generate a time select field with hours in the AM/PM format select_time(my_time, ampm: true) # Generates a time select field with hours that range from 2 to 14 select_time(my_time, start_hour: 2, end_hour: 14) # Generates a time select with a custom prompt. Use <tt>:prompt</tt> to true for generic prompts. select_time(my_time, prompt: {day: 'Choose day', month: 'Choose month', year: 'Choose year'}) select_time(my_time, prompt: {hour: true}) # generic prompt for hours select_time(my_time, prompt: true) # generic prompts for all # File actionview/lib/action_view/helpers/date_helper.rb, line 457 def select_time(datetime = Time.current, options = {}, html_options = {}) DateTimeSelector.new(datetime, options, html_options).select_time end select_year(date, options = {}, html_options = {}) Link Returns a select tag with options for each of the five years on each sideof the current, which is selected. The five year radius can be changedusing the :start_year and :end_year keys in theoptions. Both ascending and descending year lists aresupported by making :start_year less than or greater than:end_year. The date can also be substituted for ayear given as a number. Override the field name using the:field_name option, 'year' by default. # Generates a select field for years that defaults to the current year that # has ascending year values. select_year(Date.today, start_year: 1992, end_year: 2007) # Generates a select field for years that defaults to the current year that # is named 'birth' rather than 'year'. select_year(Date.today, field_name: 'birth') # Generates a select field for years that defaults to the current year that # has descending year values. select_year(Date.today, start_year: 2005, end_year: 1900) # Generates a select field for years that defaults to the year 2006 that # has ascending year values. select_year(2006, start_year: 2000, end_year: 2010) # Generates a select field for years with a custom prompt. Use <tt>prompt: true</tt> for a # generic prompt. select_year(14, prompt: 'Choose year') # File actionview/lib/action_view/helpers/date_helper.rb, line 634 def select_year(date, options = {}, html_options = {}) DateTimeSelector.new(date, options, html_options).select_year end time_ago_in_words(from_time, options = {}) Link Like distance_of_time_in_words, but where to_timeis fixed to Time.now. time_ago_in_words(3.minutes.from_now) # => 3 minutes time_ago_in_words(3.minutes.ago) # => 3 minutes time_ago_in_words(Time.now - 15.hours) # => about 15 hours time_ago_in_words(Time.now) # => less than a minute time_ago_in_words(Time.now, include_seconds: true) # => less than 5 seconds from_time = Time.now - 3.days - 14.minutes - 25.seconds time_ago_in_words(from_time) # => 3 days from_time = (3.days + 14.minutes + 25.seconds).ago time_ago_in_words(from_time) # => 3 days Note that you cannot pass a Numeric value totime_ago_in_words. # File actionview/lib/action_view/helpers/date_helper.rb, line 156 def time_ago_in_words(from_time, options = {}) distance_of_time_in_words(from_time, Time.now, options) end time_select(object_name, method, options = {}, html_options = {}) Link Returns a set of select tags (one for hour, minute and optionally second)pre-selected for accessing a specified time-based attribute (identified bymethod) on an object assigned to the template (identified byobject). You can include the seconds with:include_seconds. You can get hours in the AM/PM format with:ampm option. This method will also generate 3 input hidden tags, for the actual year,month and day unless the option :ignore_date is set totrue. If you set the :ignore_date totrue, you must have a date_select on the samemethod within the form otherwise an exception will be raised. If anything is passed in the html_options hash it will be applied to every select tag in the set. # Creates a time select tag that, when POSTed, will be stored in the article variable in the sunrise attribute. time_select("article", "sunrise") # Creates a time select tag with a seconds field that, when POSTed, will be stored in the article variables in # the sunrise attribute. time_select("article", "start_time", include_seconds: true) # You can set the <tt>:minute_step</tt> to 15 which will give you: 00, 15, 30 and 45. time_select 'game', 'game_time', {minute_step: 15} # Creates a time select tag with a custom prompt. Use <tt>prompt: true</tt> for generic prompts. time_select("article", "written_on", prompt: {hour: 'Choose hour', minute: 'Choose minute', second: 'Choose seconds'}) time_select("article", "written_on", prompt: {hour: true}) # generic prompt for hours time_select("article", "written_on", prompt: true) # generic prompts for all # You can set :ampm option to true which will show the hours as: 12 PM, 01 AM .. 11 PM. time_select 'game', 'game_time', {ampm: true} The selects are prepared for multi-parameter assignment to an Active Record object. Note: If the day is not included as an option but the month is, the day will be set to the 1st to ensure that all month choices are valid. # File actionview/lib/action_view/helpers/date_helper.rb, line 294 def time_select(object_name, method, options = {}, html_options = {}) Tags::TimeSelect.new(object_name, method, self, options, html_options).render end time_tag(date_or_time, *args, &block) Link Returns an HTML time tag for the given date or time. time_tag Date.today # => <time datetime="2010-11-04">November 04, 2010</time> time_tag Time.now # => <time datetime="2010-11-04T17:55:45+01:00">November 04, 2010 17:55</time> time_tag Date.yesterday, 'Yesterday' # => <time datetime="2010-11-03">Yesterday</time> time_tag Date.today, pubdate: true # => <time datetime="2010-11-04" pubdate="pubdate">November 04, 2010</time> time_tag Date.today, datetime: Date.today.strftime('%G-W%V') # => <time datetime="2010-W44">November 04, 2010</time> <%= time_tag Time.now do %> <span>Right now</span> <% end %> # => <time datetime="2010-11-04T17:55:45+01:00"><span>Right now</span></time> # File actionview/lib/action_view/helpers/date_helper.rb, line 655 def time_tag(date_or_time, *args, &block) options = args.extract_options! format = options.delete(:format) || :long content = args.first || I18n.l(date_or_time, :format => format) datetime = date_or_time.acts_like?(:time) ? date_or_time.xmlschema : date_or_time.iso8601 content_tag(:time, content, options.reverse_merge(:datetime => datetime), &block) end
Extending GlusterFS with Python Although this behavior makes sense for many applications, the performance impact for many PHP applications can be severe. Without negative-lookup caching, you're likely to search half of those directories in vain before finding the one that contains each include file, every time the including page is requested. (This pattern does occur in other environments as well, including Python Web applications, but common PHP frameworks cause those applications to be hit the hardest.) Just as the effects are severe, the benefits of adding a negative-lookup cache can be significant. For example, a C version of such a translator decreased average include-search times nearly seven-fold. What could a Python version do? Here's part of a translator based on glupy: @lookup_fop_t def lookup_fop (frame, this, loc, xdata): pargfid = uuid2str(loc.contents.pargfid) print "lookup FOP: %s:%s" % (pargfid, loc.contents.name) # Check the cache. if cache.has_key(pargfid) and (loc.contents.name in cache[pargfid]): dl.unwind_lookup(frame,0,this,-1,2,None,None,None,None) return 0 key = dl.get_id(frame) requests[key] = (pargfid, loc.contents.name[:]) dl.wind_lookup(frame,POINTER(xlator_t)(),loc,xdata) return 0 This is the function that gets called to look up a file, which is the core functionality for this example. Entry to this function represents a transition from C to Python, while its return represents a transition back to C. Calls through the "dl" object—a handle to the C dynamic library that supports glupy—also suspend the Python interpreter while they run. The Python decorator syntax allows you to hide most of the function-type details, and there's also a notable lack of type-conversion code. Most of what's there is domain-specific code, not boiler plate required by the infrastructure. In the top half of this function, you simply check the cache to see if you already know the requested file won't be there. If the cache check succeeds, the lookup fails immediately, and you "unwind" the translator stack to report that fact. As with the registration functions, each operation type has its own specific wind (call downward) and unwind (return upward) functions as well. This represents a temporary return from the "Python world" to the "C world", and it's worth noting that these transitions between worlds might occur seamlessly many times while processing a single request. In particular, a common GlusterFS translator idiom is for a completion callback on one request to initiate the next, and if that request completes immediately (as done here), then you can have multiple requests and completions all on the stack at once. Returning to the code, if you do not find an entry in the cache (and youalready know it must not be in the standard positive-lookup cache orelse you wouldn't even have been called), you pass the request on to thenext translator using wind_lookup. When that next translator is done, itreturns control (through the glupy meta-translator) tolookup_cbk. Hereyou retrieve your request context, conveniently stashed in a dictionaryfor you by lookup_fop, and use it to update the cache according towhether the file was found. There are a few other less relevant details of how this particular glupy translator works, but that really is the meat of it. With less than a hundred lines of Python code, including comments and empty lines, you can add a significant piece of functionality to a real filesystem. But, how well does it really work? As it turns out, it works very well; see Table 1. A simple test reveals that the result is slower than the C-based version of the same thing, but still more than four times as fast as the baseline. Clearly, the fact that you're caching these results matters more than what language you're using to do it. ms/lookup minimum average maximum 99th percentile no caching 0.368 6.898 16.286 9.702 C version 0.379 1.036 18.503 2.180 glupy version 0.381 1.527 21.163 2.916 As promising as these results are, they're more of a beginning than an end. Glupy is still a very young project, and much remains to be done. Support needs to be added for a few dozen more operation types and several data structures. There still are more ways that GlusterFS calls into translators and utility functions that translators themselves call. There are many ways the glupy interface could be made more convenient, and there are undoubtedly performance or concurrency issues still to be resolved. The most important thing is that the basic infrastructure for doing all of these things already exists, and not just for GlusterFS translators. If even a highly multithreaded and asynchronous program like this can take advantage of all that Python has to offer, so can just about any other program. Thanks to Python's extension/embedding interface and ctypes module, a "best of both worlds" approach to developing complex software is more achievable than most people think. Resources Jython: http://www.jython.org Cython: http://www.cython.org GlusterFS: http://www.gluster.org Glupy Source Repository: https://github.com/jdarcy/glupy Negative-Lookup Caching Translator in C: https://github.com/jdarcy/negative-lookup Zend (PHP) Framework on Include Files: http://framework.zend.com/manual/1.12/en/performance.classloading.html Jeff Darcy has been working on network and distributed storage since that meant DECnet and NFS version 2 in the early 1990s. He is currently at Red Hat where he serves on the GlusterFS architecture team. Geolocation Give new life to old phones and tablets with these tips! Lucidchart Memory Ordering in Modern Microprocessors, Part I Linux Systems Administrator Senior Perl Developer Source Code Scanners for Better Code Technical Support Rep Putlocker!! Watch Begin Again Online 2014 Streaming Full Movie Tech Tip: Really Simple HTTP Server with Python
sam7 mon multiboot & UbuntuStudio Gnome Voyager 10.04 bonjour, pour faire suite à http://forum.ubuntu-fr.org/viewtopic.php?id=387219 (installation d'un nouveau multiboot) je viens d'installer Gnome-Voyager 10.04 basé sur Ubuntu 10.04 TS (personnalisation réalisée par rodofr http://forum.ubuntu-fr.org/viewtopic.ph … 5#p3442495 ) je vais donc livrer dans ce topic mes observations & modifications personnelles au fil du temps... ... à commencer par exemple par la modif du fstab ou encore la gestion du double écran, pour commencer... ( http://forum.ubuntu-fr.org/viewtopic.php?id=395834 & http://forum.ubuntu-fr.org/viewtopic.ph … 3#p3466113 ) Edit 1 : fstab modifié selon mes besoins Edit 2 : installation driver carte nvidia pour gestion effets 3d + gestion dualscreen + mises à jour de la distribution (dont kernel) Edit 3 : installation de tous les paquets "UbuntuStudio" Dernière modification par sam7 (Le 21/02/2011, à 23:48) Hors ligne sam7 Re : mon multiboot & UbuntuStudio Gnome Voyager 10.04 après reboot : j'ai modifié mon xorg.conf avec le "NVIDIA X server settings" en mode "twinwiew" ... visuellement, comme j'avais dans ma précédente installation... le voici : # nvidia-settings: X configuration file generated by nvidia-settings # nvidia-settings: version 1.0 (buildd@palmer) Fri Apr 9 10:35:18 UTC 2010 Section "ServerLayout" Identifier "Layout0" Screen 0 "Screen0" 0 0 InputDevice "Keyboard0" "CoreKeyboard" InputDevice "Mouse0" "CorePointer" Option "Xinerama" "0" EndSection Section "Files" EndSection Section "InputDevice" # generated from default Identifier "Mouse0" Driver "mouse" Option "Protocol" "auto" Option "Device" "/dev/psaux" Option "Emulate3Buttons" "no" Option "ZAxisMapping" "4 5" EndSection Section "InputDevice" # generated from default Identifier "Keyboard0" Driver "kbd" EndSection Section "Monitor" # HorizSync source: edid, VertRefresh source: edid Identifier "Monitor0" VendorName "Unknown" ModelName "NUL M17W" HorizSync 31.0 - 60.0 VertRefresh 56.0 - 75.0 Option "DPMS" EndSection Section "Device" Identifier "Device0" Driver "nvidia" VendorName "NVIDIA Corporation" BoardName "GeForce 8600 GT" EndSection Section "Screen" Identifier "Screen0" Device "Device0" Monitor "Monitor0" DefaultDepth 24 Option "TwinView" "1" Option "TwinViewXineramaInfoOrder" "CRT-0" Option "metamodes" "CRT-0: nvidia-auto-select +0+0, CRT-1: nvidia-auto-select +1440+0" SubSection "Display" Depth 24 EndSubSection EndSection forcément donc : - pour cairo-dock placé en bas à cheval entre les 2 écrans, c'est pas très pratique ... comment faire ? (j'avais déjà le soucis "avant") - pour le panel supérieur : il est à cheval sur les 2 écrans aussi ... ça n'est pas forcément très pratique ... je voudrais avoir, comme "avant" 1 panel par écran ... comment faire ? - lors de l'ouverture d'une application ... celle-ci s'ouvre au centre de l'écran ... et non sur l'écran principal (celui de gauche) ... et lorsque firefox (par exemple) s'ouvre en plein écran, c'est "pas génial" ... comment faire ? (je n'avais pas ce soucis "avant") Edit 1 : pour info, j'ai testé aussi ce mode là qui est très intéressant également http://forum.ubuntu-fr.org/viewtopic.php?pid=3466113#p3466113 , mais qui ne correspond pas à mes besoins... Edit 2 : j'ai commencé à "bidouiller" dans ubuntu tweak histoire de changer la position des boutons & dans CompizConfig pour "jouer" avec le cube ... je constate des "ralentissements" lorsqu'une fenêtre passe d'un bord à l'autre de l'écran (bord gauche de l'écran gauche à bord droit de l'écran droit...) ... & un énorme ralentissement pour faire "tourner" le cube ... ce qui n'est pas normal ... je n'avais pas ces problèmes sous hardy ! je ne trouve plus comment faire tourner le cube avec la molette de la souris ! qui peux m'aiguiller là dessus ? merci Edit 3 : après reboot, ces problèmes ont "disparus" semble t'il ... cool (sauf pour cairo-dock) Dernière modification par sam7 (Le 10/05/2010, à 14:11) Hors ligne sam7 Re : mon multiboot & UbuntuStudio Gnome Voyager 10.04 bon, je vais passer maintenant au fichier "A lire important" qui est sur le bureau : à commencer par : Installation de Flash Player 10 (non-libre) d'Adobe (Ubuntu 10.LTS et ultérieure) Installation à partir des dépôts Ubuntu 1.Fermez toutes les instances de votre navigateur Internet ; 2.Installez le paquet flashplugin-installer ; Cliquer en appuyant sur Ctrl pour ouvrir le lien flash 3.Ouvrez de nouveau votre navigateur Internet. Vérifiez que votre installation de Flash Player s'est déroulée correctement en affichant une animation de test : Testez Flash Player. c'est fait étape suivante : Comment faire fonctionner le correcteur orthographique de openoffice ? C'est simple. Activer la prise en charge linguistique (via Système\Administration\Prise en charge des langues). Une fois de-dessus, soit vous accepter la mise à jour complète, mais il y aura l'anglais de compris, ou vous allez à Installer/supprimer des langues, décocher les langues étrangères et cocher la langues FR et en bas vous cocher Traduction et vérification orthographique et aides la saisie...Puis Appliquer les changement et voilà. Ensuite, ouvrer une page office et aller à Outils/Orthographe et grammaire/Option et cocher vérifier l'Orthographe... et Grammaire.... Tout devrait ainsi fonctionner. c'est fait étape suivante : Nautilus La doc nautilus-elemantary Nautilus a été changé par le thème nautilus-elemantary. Un tweak de réglage, que vous pouvez trouver, en allant sur le dernier bouton rond à droite de nautilus. La menubar installé, aller dans Edition/Préférences/Tweaks. L'installation c'est faite par son dépôt « ppa:am-monkeyd/nautilus-elementary-ppa ». Donc à activer pour les mises à jour dans sources de logiciels. comment faut-il faire ? étape suivante : Globalmenu / Panel Style Apple X Doc lien Globalmenu Pour avoir Globalmenu, aller sur le panel du haut et cliquer droit dessus. Cliquer sur ajouter au tableur de bord, chercher, Applet menu global. Une fois cela fait, recliquer droit sur le panel et activer. c'est fait étape suivante : Gnome-do Doc lien Pour Gnome-do, allé dans Applications/Accessoires/Gnome Do. Le réglage ce fait en cliquant sur l'onglet à droite. Choisir préférences. Activer Lancer Gnome Do au démarrage, pour l'avoir en permanence avec la touche Super/Space. c'est fait étape suivante : Un fond d'écran dynamique le doc lien la Terre vue par satellite en temps réel. Un wall qui affiche une image de la Terre en temps réel comme fond d’écran. Allez dans Système => Préférences => Applications au démarrage et activer Wallpaper dynamic, dans la zone de commande, entrez : /home/votre nom d’utilisateur/.WallpaperReal/Globo_CarbonFiber/./GloboCarbon.sh Ensuite dans terminal coller ceci. Ça ouvrira le wall et le définir comme arrière plan. eog .WallpaperReal/Globo_CarbonFiber/world_carbon_Wallpaper.jpg Maintenant, chaque fois que vous démarrerez votre ordinateur, le script de mise à jour du fond d’écran s’exécutera automatiquement. c'est fait je crois que c'est déjà pas mal pour le moment comme ça ... je verrais le reste ultérieurement il faut maintenant que je remettes tous mes documents dans mon "/home" (actuellement, ils sont sur disque dur externe) Dernière modification par sam7 (Le 10/05/2010, à 14:45) Hors ligne sam7 Re : mon multiboot & UbuntuStudio Gnome Voyager 10.04 je passe aussi par la logithèque (ouf ! elle s'est amméliorée ) pour installer quelques applications qui me seront utiles/indispensables (pour commencer) : accessoires : 7zip / AClock / Gnome Commander / gDesklets / GPRename / Gestionnaire de fichier PCMan ... ... il faudra que j'installe également Virtualbox (Sun / Oracle ... pas OSE) bureautique : abiword / base de données openoffice / clips arts libres / gLabels / gnome office / Gnumeric / suite open office / Sunbird graphisme : darkroom / Gimp (autant pour moi, il y est déjà) / mtpaint / fontmatrix (j'y pense, il faudra que j'installe pleins de polices supplémentaires) / Fotowall (le logiciel de mon ami Geenux ) / Gnu Paint / Phatch / Rawstudio / UFRaw / utilitaire de numérisation / Blender / K-3D / gpicview / photoprint / scribus internet : epiphany / thunderbird / chromium / XChat IRC / XChat-Gnome IRC Chat son et vidéo : audacity / dvd::rip / OGMRip / MPlayer / xcfa / avidemux(il faudra que j'installe aussi Moovida) thèmes & optimisations : à mon propos / applications préférées / desktop drakes / écran de démarrage / écrans multiples / éditeur de verrous / gestionnaire d'ammorçage Startup-manager / gestionnaire d'apparence art-manager / gestionnaire de connexion / gestionnaire de profils utilisateurs / gestionnaire de sauvegardes de fichiers / gestionnaire de scripts nautilus / gestionnaire de thèmes emerald / imprimante par défaut / réglages du moniteur / ... ... je m'arrête là pour le moment (faute de temps)... mais j'en vois pleins d'autres ...(polices de caractères + thèmes & optimisations en particulier) Dernière modification par sam7 (Le 16/05/2010, à 22:14) Hors ligne sam7 Re : mon multiboot & UbuntuStudio Gnome Voyager 10.04 petites questions en passant (à rodofr s'il passe par là éventuellement) : je souhaiterais déplacer les icônes "date" & "RBOX" qui sont sur le bureau, et je n'y arrives pas ... comment procéder ? merci d'avancepar contre, pas de soucis avec "l'image défilante" Hors ligne rodofr Re : mon multiboot & UbuntuStudio Gnome Voyager 10.04 Hello Sam, Clic droit sur l'icône RBOX et tu désélectionnes (verrouiller la position) puis tu bouges l'icône où tu veux. Pour la date, tu clic sur l'épaisseur d'une lettre ou un chiffre et tu verras deux icônes apparaître. Tu clic sur le rond/ tu vas à option et tu désélectionnes (verrouiller la position) puis pareil, tu bouges ton icône. Et bonne chance pour toutes tes installations. Hors ligne rodofr Re : mon multiboot & UbuntuStudio Gnome Voyager 10.04 Sam, Petit précision. Si le fond dynamique ne marche pas. Réactive-le ainsi. Dans Terminal (A la place de user tu mets ton login) /home/user/.WallpaperReal/Globo_CarbonFiber/./GloboCarbon.sh Hors ligne Alain P. Re : mon multiboot & UbuntuStudio Gnome Voyager 10.04 Salut, j'ai installé Voyager10.04 sur mon portable en dual-boot avec LinuxMint8. Tout fonctionne nickel (drivers NVidia, config. compiz, cairo, fds d'écran dynamiques...), un seul petit souci, je dois ré-entrer la clé wep pour le wifi à chaque démarrage de session. Avanie et framboises sont les mamelles du destin tsoin tsoin! (B. Lapointe) Hors ligne jmika Re : mon multiboot & UbuntuStudio Gnome Voyager 10.04 Bonjour, Ce problème a été résolu ici : http://forum.ubuntu-fr.org/viewtopic.php?id=338432 Si ça ne marche pas, crée une nouvelle discussion pour parler de ton problème. Tu trouvera plus facilement une réponse. Hors ligne Alain P. Re : mon multiboot & UbuntuStudio Gnome Voyager 10.04 OK merci Avanie et framboises sont les mamelles du destin tsoin tsoin! (B. Lapointe) Hors ligne sam7 Re : mon multiboot & UbuntuStudio Gnome Voyager 10.04 pour info, j'ai un soucis pour redémarrer gnome-voyager suite à l'install de debian sid ... ... ça se passe ici : http://forum.ubuntu-fr.org/viewtopic.php?pid=3476883#p3476883 Edit : cette manip ne change rien http://forum.ubuntu-fr.org/viewtopic.php?pid=3481097#p3481097 Dernière modification par sam7 (Le 15/05/2010, à 23:09) Hors ligne sam7 Re : mon multiboot & UbuntuStudio Gnome Voyager 10.04 problème de démarrage de gnome-voyager & de crunchbang statler résolu ... ... c'était bien un problème d'UUID dans le fstab pour la partition partagée "HDebian" gnome-voyager est donc quazi complètement opérationnelle ... reste quelques applications à ajouter comme le paquet "b-side", les depots get-deb & les thèmes bisigi-project ou encore moovida ou xbmc par exemple Dernière modification par sam7 (Le 16/05/2010, à 21:51) Hors ligne sam7 Re : mon multiboot & UbuntuStudio Gnome Voyager 10.04 à l'aide d'ubuntu tweak, je suis en train d'ajouter quelques PPA & "sources de tierces parties" dans mon sources.list # deb cdrom:[Ubuntu 10.04 LTS _Lucid Lynx_ - Release i386 (20100429)]/ lucid main restricted # See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to # newer versions of the distribution. deb http://fr.archive.ubuntu.com/ubuntu/ lucid main restricted deb-src http://fr.archive.ubuntu.com/ubuntu/ lucid main restricted ## Major bug fix updates produced after the final release of the ## distribution. deb http://fr.archive.ubuntu.com/ubuntu/ lucid-updates main restricted deb-src http://fr.archive.ubuntu.com/ubuntu/ lucid-updates main restricted ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu ## team. Also, please note that software in universe WILL NOT receive any ## review or updates from the Ubuntu security team. deb http://fr.archive.ubuntu.com/ubuntu/ lucid universe deb-src http://fr.archive.ubuntu.com/ubuntu/ lucid universe deb http://fr.archive.ubuntu.com/ubuntu/ lucid-updates universe deb-src http://fr.archive.ubuntu.com/ubuntu/ lucid-updates universe ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu ## team, and may not be under a free licence. Please satisfy yourself as to ## your rights to use the software. Also, please note that software in ## multiverse WILL NOT receive any review or updates from the Ubuntu ## security team. deb http://fr.archive.ubuntu.com/ubuntu/ lucid multiverse deb-src http://fr.archive.ubuntu.com/ubuntu/ lucid multiverse deb http://fr.archive.ubuntu.com/ubuntu/ lucid-updates multiverse deb-src http://fr.archive.ubuntu.com/ubuntu/ lucid-updates multiverse ## Uncomment the following two lines to add software from the 'backports' ## repository. ## N.B. software from this repository may not have been tested as ## extensively as that contained in the main release, although it includes ## newer versions of some applications which may provide useful features. ## Also, please note that software in backports WILL NOT receive any review ## or updates from the Ubuntu security team. # deb http://fr.archive.ubuntu.com/ubuntu/ lucid-backports main restricted universe multiverse # deb-src http://fr.archive.ubuntu.com/ubuntu/ lucid-backports main restricted universe multiverse ## Uncomment the following two lines to add software from Canonical's ## 'partner' repository. ## This software is not part of Ubuntu, but is offered by Canonical and the ## respective vendors as a service to Ubuntu users. # deb http://archive.canonical.com/ubuntu lucid partner # deb-src http://archive.canonical.com/ubuntu lucid partner deb http://security.ubuntu.com/ubuntu lucid-security main restricted deb-src http://security.ubuntu.com/ubuntu lucid-security main restricted deb http://security.ubuntu.com/ubuntu lucid-security universe deb-src http://security.ubuntu.com/ubuntu lucid-security universe deb http://security.ubuntu.com/ubuntu lucid-security multiverse deb-src http://security.ubuntu.com/ubuntu lucid-security multiverse ce qui me permet d'ajouter les applications suivantes (en plus des thèmes bisigi & d'actualiser certains "paquets" ): - Sun Virtualbox 3.1 - Googleearth - xbmc << mince il s'ouvre à cheval sur mes 2 écrans ... comment y remédier ? merci - terminator petite question en passant : comment changer de bureau & tourner le cube avec la molette de la souris ? merci Dernière modification par sam7 (Le 16/05/2010, à 22:36) Hors ligne sam7 Hors ligne sam7 Re : mon multiboot & UbuntuStudio Gnome Voyager 10.04 & il faudrait également que j'installe conky ... cf. : http://forum.ubuntu-fr.org/viewtopic.php?pid=3493988#p3493988 >> http://crunchbanglinux.org/forums/topic/59/my-conky-config/ merci Kookaburra Hors ligne sam7 Re : mon multiboot & UbuntuStudio Gnome Voyager 10.04 il faudra également résoudre ce petit soucis pour la lecture des vidéos : http://forum.ubuntu-fr.org/viewtopic.php?pid=3504367#p3504367 sinon, j'ai installé encore quelques applications complémentaires... comme par exemple : pyrenamer / k3d / qcad / moovida / avidemux / kino / extracteur cd / mandvd / devede / oggconvert / gwenview ... ... restera encore à installer remastersys, lightning, ekd & nemo & quelques scripts & polices... je dois également installer : - ces quelques extensions firefox http://forum.ubuntu-fr.org/viewtopic.php?pid=3135530#p3135530 (& sans doute quelques autres comme par exemple ainsi qu'une Collection d'extensions pour Firefox « afin de renforcer sa vie privée » http://forum.ubuntu-fr.org/viewtopic.php?pid=3181384#p3181384 ) - ainsi que http://www.iola.dk/nemo/ cf. http://forum.ubuntu-fr.org/viewtopic.php?pid=3139979#p3139979 - & bien sûr Get-Deb dans mon « sources.list » cf. http://forum.ubuntu-fr.org/viewtopic.php?pid=3181384#p3181384 - quelques scripts pour nautilus cf. http://www.gnome-look.org/index.php?xsortmode=down&xcontentmode=188 - la synthèse vocale http://doc.ubuntu-fr.org/synthese_vocale?s & gnome-voice-control http://doc.ubuntu-fr.org/gnome-voice-control?s cf. http://forum.ubuntu-fr.org/viewtopic.php?pid=3181384#p3181384 - circular-application-menu & streamy seront également de la partie cf. http://forum.ubuntu-fr.org/viewtopic.php?pid=3218678#p3218678 j'ai donc de quoi m'occuper un moment avec mon gnome-voyager (& j'ai encore crunchbang & kubuntu & debian sid ... ) Dernière modification par sam7 (Le 25/05/2010, à 23:11) Hors ligne sam7 Re : mon multiboot & UbuntuStudio Gnome Voyager 10.04 Bon, il faut que je regarde ceci demain : http://forum.ubuntu-fr.org/viewtopic.php?pid=3504489#p3504489 (pas le temps aujourd'hui) ... (mais) j'ai un peu modifié/personnalisé mon cairo-dock Dernière modification par sam7 (Le 30/05/2010, à 12:20) Hors ligne sam7 Re : mon multiboot & UbuntuStudio Gnome Voyager 10.04 la "suite" sur ce problème "vidéo" se passera ici : http://forum.ubuntu-fr.org/viewtopic.php?pid=3514026#p3514026 Edit : Résolu Dernière modification par sam7 (Le 03/06/2010, à 23:42) Hors ligne sam7 Re : mon multiboot & UbuntuStudio Gnome Voyager 10.04 bon, ça n'est pas le tout, il me faut aussi installer http://www.korben.info/getdeb-repository.html en jetant un oeil à http://doc.ubuntu-fr.org/getdeb ... le moment venu bien sûr Hors ligne sam7 Re : mon multiboot & UbuntuStudio Gnome Voyager 10.04 il me restera également à "arranger mes marques pages", comme expliqué ici : http://forum.ubuntu-fr.org/viewtopic.php?pid=3516267#p3516267 & à installer rapidement http://www.iola.dk/nemo/ (que j'apprécie) j'ai également un "soucis" de "freeze" avec sun virtualbox ... à voir dès que possible... ainsi qu'un soucis avec le trousseau de connexion pour sauvegarder les mots de passe (en particulier avec epiphany : Saisissez votre mot de passe pour déverrouiller le trousseau de connexion Le mot de passe que vous utilisez pour ouvrir une session sur cet ordinateur ne correspond plus à celui de votre trousseau de connexion. Le mot de passe de déverrouillage n'est pas correct ... pourtant je n'ai qu'un seul mot de passe sur ce système ... que faire ? merci d'avance Edit : pb supp : message d'erreur lors rechargement des paquets W: Une erreur est survenue lors de la vérification de la signature. Le dépot n'est pas mis à jour et les fichiers d'index précédents seront utilisés. Erreur GPG : http://download.virtualbox.org lucid Release: Les signatures suivantes n'ont pas pu être vérifiées car la clé publique n'est pas disponible : NO_PUBKEY 54422A4B98AB5139 W: Impossible de récupérer http://download.virtualbox.org/virtualbox/debian/dists/lucid/Release Dernière modification par sam7 (Le 04/06/2010, à 23:43) Hors ligne rodofr Re : mon multiboot & UbuntuStudio Gnome Voyager 10.04 Resalut sam ! Je vois que ça bosse Pour ton mot de passe Menu Applications>Accessoires>Mots de passe et clés de chiffrement Puis clic droit sur "Mots de passe" de ton application et enfin "Modifier le mot de passe" si il te demande un que tu n'as pas, supprime-le et recréé-le à l'application. Ca arrive parfois ! Tu as ça aussi Problèmes WIFI et Clé WEP Je dois ré-entrer la clé wep pour le wifi à chaque démarrage de session ? Que faire ? Une première solution. Cliquer droit sur l’applet→Modifications des connexion→sans fil→cliquez sur le nom de votre box → modifier→rentrer votre mot de passe ubuntu→dans onglet « sans fil » cochez disponible pour tous les utilisateurs (en bas à gauche) Avant de valider vérifier les paramètres de connexion dans les autres onglets et cocher sur appliquez Hors ligne sam7 Re : mon multiboot & UbuntuStudio Gnome Voyager 10.04 merci pour le lien, je regarderais si ça marche le moment venu & laquelle des 2 solutions était la bonne : 1 => http://forum.ubuntu-fr.org/viewtopic.php?pid=3290555#p3290555 2 => http://forum.ubuntu-fr.org/viewtopic.php?pid=3290768#p3290768 il faudra que je regarde également ceci le moment venu : http://doc.ubuntu-fr.org/virtualbox http://m.commentcamarche.net/faq/sujet-7576-VirtualBox-Installer-les-additions-client-dans-Ubuntu?SessionID=9283c6beb2a8&sessionBack=9 http://www.commentcamarche.net/faq/7576-virtualbox-installer-les-additions-client-dans-ubuntu Dernière modification par sam7 (Le 04/06/2010, à 23:02) Hors ligne sam7 Re : mon multiboot & UbuntuStudio Gnome Voyager 10.04 concernant codename nemo http://www.iola.dk/nemo/ je vais donc maintenant procéder à son installation en saisissant dans un terminal sudo sh -c 'echo deb http://www.iola.dk/nemo/repo binary/ > /etc/apt/sources.list.d/nemo.list' puis en cliquant sur le paquet http://www.iola.dk/nemo/repo/binary/nemo_0.2.4_all.deb & en l'installant avec GDebi reste ensuite à le traduire en français (cf. http://git.gnome.org/browse/nemo/ http://git.gnome.org/browse/nemo/commit/?id=caf0d9da81d6b0e870c5a6c45bdebba0f1f134bf ) là, je suis "un peu" perdu... je verrais demain ...ainsi que pour mon soucis virtualbox soucis résolus ... ... j'ai aussi installé Brasero & K3B Dernière modification par sam7 (Le 09/07/2010, à 22:28) Hors ligne sam7 Re : mon multiboot & UbuntuStudio Gnome Voyager 10.04 je viens également d'installer quelques applications complémentaires comme PDF-Shuffler & pdfsam qui sont très pratique... + calibre ( http://www.clapico.com/2010/09/11/calibre/ ) ... ainsi que http://www.clapico.com/2010/09/08/audio-recorder-applet/ ... & quelques applications "financières" afin de faire mon choix parmi elles : http://doc.ubuntu-fr.org/comptabilite Homebank http://doc.ubuntu-fr.org/homebank Grisbi http://doc.ubuntu-fr.org/grisbi Gnucash http://doc.ubuntu-fr.org/gnucash skrooge http://doc.ubuntu-fr.org/skrooge kmymoney http://doc.ubuntu-fr.org/kmymoney wxbanker ... verdicte sous peu Edit : il semble que ça soit Homebank qui l'emporte au niveau "facilité d'utilisation"... j'aimais bien grisbi, mais soucis pour installer la 0.6.0-1 Dernière modification par sam7 (Le 15/09/2010, à 23:57) Hors ligne
Installing a Wiki on Your iBook by Giles Turnbull 06/05/2003 The following conversation between Mac DevCenter writer Giles Turnbull and software developer Matt Hunt (a FreeBSD fan who's very happy with the way Mac OS X turned out) walks you through a Wiki installation on Mac OS X. It's really easy to follow, and we hope you'll give it whirl. Giles: Hi, Matt. I've been researching how to install a Wiki on my iBook. I thought there'd be a bunch of how-to documents online somewhere, but I searched all over the place and came up with not much. Could you help me out? Matt: Yeah OK. Had you thought about which one you'd like to install? There are literally several to choose from. Giles: Well, I've used PHPwiki before and I quite liked it. Plus the documentation says that installation is a snap. Matt: The documentation would say that, but it is worth trying out. The first step is to download the source package. The latest source download is probably the best thing to get. Giles: OK, I've got that, what's next? Matt: Unpack it in the Sites directory of your home directory, tar zxf phpwiki-1.3.4.tar.gz, and enter the newly create directory. Giles: I did that, and went to http://localhost/~myusername/phpwiki/, and Safari just downloaded a file. What went wrong? Matt: Whoa, there! Nothing's ever quite that simple. You need to make sure that your web server is loading the PHP module and that it will use PHP documents as index pages. You'll need to edit your Apache configuration. Giles: That's just a text editor job, right? Matt: Right. Edit /etc/httpd/httpd.conf in your normal command-line text editor (vi, emacs, pico, whatever). Giles: I tend to use vi. Matt: Fine, you'll have to edit the file with an administrator account or with the root account; try sudo vi /etc/httpd/httpd.conf and make sure that you uncomment (remove the # symbol from the start of the line) these lines: LoadModule php4_module libexec/httpd/libphp4.so AddModule mod_php4.c They're not together in the file so you'll have to search for them. Whilst you're in there editing the httpd.conf, find the line that specifies: DirectoryIndex index.html and add a few more entries to it. Mine reads: DirectoryIndex index.html index.php index.htm index.php3 index.cgi and finally, you'll also need to tell Apache how to identify PHP files; add these lines: AddType application/x-httpd-php .php AddType application/x-httpd-php-source .phps Add them just after the comment about AddType (# AddType allows you to tweak...) That ought to do the trick. Giles: Hmm, OK, that wasn't too hard. Matt: Don't forget to restart Apache when you're done. You can start and stop it from the "Sharing" panel in "System Preferences", but that would also automatically open the firewall to the outside world, which you might not want at the moment. If Apache's running already you can run: sudo apachectl restart from the terminal; if not you'll have to run: sudo apachectl start Giles: So now I'll go see my shiny new Wiki in my browser at 127.0.0.1/~myusername/phpwiki .... oh. It doesn't work. I'm getting an error. It says Fatal error: Call to undefined function: dba_open() in /Users/gilestur/Sites/phpwiki/lib/DbaDatabase.php on line 32 Related Reading Matt: Oh, that's just a fatal error. You need to store the content somewhere. The default is to use DBM files, but I find it's better to use MySQL as a datastore. It's more flexible. Do you have MySQL installed? Giles: Nope. Tell me it's not complicated. Matt: It's not complicated. You can download a package for it from the Apple downloads site. MySQL version 4 should do the job admirably, so get that and install it. Giles: This is more like it. A nice easy package that I can just double-click on ... I've downloaded and installed it, and everything seems to have gone smoothly. It's put itself in /usr/local/mysql, which I suspect is a good place for it. Matt: Yeah, did it start the database server? Giles: How would I know that it had? Matt: You can ask it: /usr/local/mysql/bin/mysqladmin status Giles: Ah right. I've asked it and it says that various things are happening--one thread, 34 questions, 6 open tables, and so on. Matt: That sounds just fine, if it hadn't you'd have had to start the server, that is, sudo /usr/local/mysql/bin/safe_mysqld &. Giles: Figures. So, I've got MySQL working ... now I guess I need to tell it to start a database for the Wiki. Matt: You're getting the hang of this now. But first you have to set a password for the "root" account on your database server. /usr/local/mysql/bin/mysqladmin -u root password sniggle will do that, but you should choose a different password to "sniggle". As an aside, that MySQL package also contains a directory called MySQL.prefPane. If you drag that into /Library/PreferencePanes you'll get a MySQL entry on your System Preferences, which will let you start and stop the server as well as setting the master (root) password. Once you've done that, you can set up a user in MySQL for your Wiki--do this in your terminal: /usr/local/mysql/bin/mysql -uroot -p mysql This starts up the MySQL command line client. Now, do this in the client: > grant select, insert, update, delete, lock tables on wiki.* to wiki@localhost identified by 'password'; > create database wiki; > \q You should probably choose a different password to "password" there as well. Once you've done that, you have an empty database in MySQL just ready for your Wiki content, and a new user with permission to access and change the database. Giles: Cool. After each of those commands, the MySQL client responded with some simple information about what had happened. Nothing too frightening. What's the next step? Something to do with PHP? Matt: Not quite yet. There's a little bit more database stuff to do, and then a bit of PHPwiki stuff, and then it should work. First, for the database, in the PHPwiki distribution that you unpacked there's a directory called "schemas". Go there and issue this command: /usr/local/mysql/bin/mysql -uroot -p[password you just set in mysql] wiki < mysql.sql. That sets up the database structure for the Wiki so that it's ready for the content, make sure you specify the password you set for the root account here. Giles: Yikes, I'm getting confused about all these passwords. There's the sniggle one, and the password one--which one do I use when? Matt: OK, the first thing to be clear on is that these accounts are just MySQL accounts, they're not related to the Mac OS X accounts. They have passwords stored in the database server and their permissions relate to what they can do on the database server. We're just concentrating on two accounts here, the "root" account has privileges to alter all parts of all databases that MySQL knows about: it's the "superuser". The "wiki" account that we just created has very limited privileges, it can select, update, delete, and insert data only in the Wiki database. So it can't create the tables, nor delete (in SQL terms, drop) them. Giles: Aha, so in terms of the examples we've been using so far, the "root" account password was the "sniggle" one, and the "wiki" account password was the "password" one, right? Matt: Right. Giles: Now I get it. Things are getting clearer. We must be nearly done now. Matt: Yes, we're on the last lap. You can connect to the Wiki database as the Wiki user and check that your tables are there if you like: /usr/local/mysql/bin/mysql -uwiki -ppassword wiki > show tables; It should show something like this: Giles: Yes, that's exactly what I get. Matt: Great, now we just need to get PHPwiki to connect to it and we're away. There's a configuration program provided with PHPwiki--you could try http://localhost/~yourusername/phpwiki/configurator.php, but it didn't work when I tried it. Giles: Hmm, so there's another way? Matt: Yes, you can edit the index.php file directly. Giles: Fine. Which bits do I need to change and where? Matt: All these changes are to the index.php file in the directory of PHPwiki source that you unpacked. You have to set the admin username and password options, otherwise your Wiki will give you a warning to set them when you view pages. Set them to something convenient to you (sorry, that's yet another password to remember). The lines that you're looking for are: if (!defined('ADMIN_USER')) define('ADMIN_USER', ""); if (!defined('ADMIN_PASSWD')) define('ADMIN_PASSWD', ""); just add the username and password between the quote marks at the end of the lines. For example, if (!defined('ADMIN_USER')) define('ADMIN_USER', "wikiadm"); if (!defined('ADMIN_PASSWD')) define('ADMIN_PASSWD', "admpassword"); The other important thing to do is to let the Wiki know where it can find the database. Find these two lines in the file: //'dbtype' => 'SQL', 'dbtype' => 'dba', and change them to: //'dbtype' => 'dba', 'dbtype' => 'SQL', Finally, find: //'dsn' => 'mysql://guest@:/var/lib/mysql/mysql.sock/test', and add this line below it: 'dsn' => 'mysql://wiki:password@localhost/wiki', Change that to match the details of the user that you created earlier. For example, replace the first "wiki" with the username, "password" with that user's password and the final "wiki" with the name of the database, if you changed it. And that should be all you need. You can find the line containing define('THEME', 'default'); and change 'default' to 'MacOSX', if you'd like your Wiki to blend in a little. Giles: Great. So having made all those changes, my Wiki will now work? Matt: Yes, it should. Try it. Giles: OK, so all I need to do is start up my browser--I'll use Safari--and send it to http://localhost/~myusername/phpwiki ... and it works! I've got myself a wiki home page (see below). Matt: Phew! Remind me why you wanted one again? Giles: After all that, I've forgotten. No, only kidding. I wanted to investigate using a Wiki for all sorts of things. There's a lot of discussion on the original wiki about using the Wiki concept for knowledge management (and more) on a local disk. Matt: I've used Wiki to support collaboration before, for instance to support discussion on programming projects and share documentation on a company Intranet, but I never really thought to use it as my personal data store. Giles: There's been talk about the idea of a personal wiki and various contributors have added their own suggested uses: recipe storage, journal writing, even as a private weblogging system. You can put a Wiki to use as a to-do list, and there are calendar plug-ins available for those who see the Wiki as a replacement for their normal PIM software. Matt: I like that, maybe I'll use one on my desktop at work to replace the battered collection of notepads I have to search through when I need to remember something. Giles: Yes, I can sympathize with that. One thing I'm interested in doing with my Wiki is using it as a bookmark manager. Although Safari remains my default browser, I still use Camino, Phoenix, and Mozilla quite regularly, and it would be good to be able to reach my bookmarks from within any of them. Another possibility is keeping a journal, not just a personal diary but a record of everything I write. Because the Wiki is searchable, I can throw pieces of text into it and I don't have to worry too much about categorizing them or sorting them into any kind of hierarchy. As long as I know roughly what the text was about, I'll always be able to find it again. Of course, it's worth pointing out that there are simpler alternatives to the process we've just outlined. One of the simplest is VoodooPad, a simple-to-install app for Mac OS X 10.2 and later, which operates just like a Wiki, but without the need for setting up any databases or meddling with MySQL and PHP. Personally speaking, I'm a big fan of the whole Wiki concept. The idea of having a web page that anyone can edit sounds pretty strange when you first encounter it, but Wikis do work well as collaborative environments. The simplicity of their interface--edit, save, that's all there is to it--is what makes me want to use it on my own computer too. Matt: Yes, you've given me some ideas there too. Giles: Couldn't have done it without your help. Thanks! Matt: No problem, well, apart from the problems. You can buy me a beer when I see you next. Cheers. Giles: It's a deal. Bye. Return to the Mac DevCenter. Comments on this article Soks - An easier wiki 2005-08-05 10:35:58 tamc [View] Trackback from download-legal-mp3.tripod.com downloading legal mp3 2005-08-02 16:43:44 [View] Does it work with PHP5? 2005-06-03 16:20:50 bmtndog [View] Another easy option for Wiki on the Mac: PmWiki 2004-09-25 16:32:37 jhchou [View] mysql setup error: mysql.sql 2004-09-13 09:03:56 [email protected] [View] mysql setup error: mysql.sql 2004-09-14 11:58:19 [email protected] [View] 2004-09-08 10:05:19 jhchou [View] Installing phpwiki v1.3.10? 2004-09-14 11:56:39 [email protected] [View] localhost 56k 2004-07-16 14:22:17 [View] More on Wikis 2004-03-22 20:45:47 [View] 2004-03-08 06:30:18 alananonymous [View] local links are not relative 2004-08-03 14:48:04 rikahlberg [View] Complete MySQL 2004-01-29 18:00:26 [View] OffBrainWiki 2004-01-29 14:03:27 [View] Un excellent tutoriel sur PhpWiki 2004-01-11 06:52:13 [View] PhpWiki install on OS X 2004-01-11 06:27:57 [View] 2003-11-19 15:03:13 anonymous2 [View] 2003-10-27 16:59:41 mickazoid [View] 2003-08-27 20:47:37 anonymous2 [View] 2003-08-27 19:56:59 anonymous2 [View] 2003-08-13 14:19:26 anonymous2 [View] 2003-07-01 05:27:44 anonymous2 [View] 2003-06-22 09:56:23 rberg [View] MYSQL Problem 2003-12-30 11:30:46 anonymous2 [View] 2003-06-20 17:50:59 dparmet1 [View] 2003-06-20 03:31:36 anonymous2 [View] 2003-06-19 04:37:52 dparmet1 [View] 2003-06-18 19:33:49 anonymous2 [View] got all the way through and made the changes to the index.php 2003-07-24 15:05:05 anonymous2 [View] It just got even more interesting 2003-06-18 19:43:58 dparmet1 [View] 2003-06-17 00:09:09 adam_alexander [View] Wiki: php warnings 2003-06-17 13:15:03 matt_hunt [View] 2003-06-13 12:59:50 anonymous2 [View] No graphics on external network 2003-06-28 19:18:53 anonymous2 [View] re: No graphics on external network 2003-07-05 19:55:41 anonymous2 [View] 2003-06-11 15:13:39 anonymous2 [View] 2003-06-08 14:49:29 anonymous2 [View] installation 2003-06-17 13:23:16 matt_hunt [View] installation 2003-06-25 09:43:47 keith_veleba [View] 2003-06-08 02:11:25 anonymous2 [View] So Wiki is . . . ? 2004-03-12 12:10:01 sans [View] So Wiki is . . . ? 2003-06-10 08:08:16 salamon [View] So Wiki is . . . ? 2003-06-17 13:28:32 matt_hunt [View] 2003-06-07 14:15:54 anonymous2 [View] 2003-06-06 23:02:53 anonymous2 [View] 2003-06-06 19:17:29 ddp [View] 2003-06-06 11:08:09 anonymous2 [View] 2003-06-06 08:05:32 salamon [View] Bookmarks 2003-08-14 22:15:07 anonymous2 [View] 2003-06-06 05:24:28 szpak [View] 2003-06-06 03:12:20 anonymous2 [View] Not all Wikis are this horrid to install! 2003-06-12 14:15:44 anonymous2 [View] 2003-06-05 17:09:40 anonymous2 [View]
NOTE: This github page hosts the development version, but not the distribution version. To get and install the current stable version of geeneus use pip sudo pip install geeneus **The command above will install the current stable release. ** geeneus is designed as a simple to use, robust and reliable Python API to obtain biological record information (currently only protein data is supported). The tool primarily uses NCBI's protein database, but falls back on the EBI UniProt database in a totally seamless fashion if needed. The motivation comes from the simple fact that when I began working with NCBI's databases I wanted an interface which allowed me to do: interface.get_protein_sequence(accession_number) and would just return the sequence associated with that accession number. This didn't exist, so I decided to create it. The primary focus of geeneus from day 1 has been ease of use. NCBI allows access to their records through an Entrez based RESTful API called eUtils. However, this can be complicated to set up, and to people who are less used to networking or programming can pose a major barrier to access. Biopython goes some way to help with this, but still requires the user to parse XML, deal with networking, read handles, and lots of other things which are just more work. Considering this, my goals were to; Parse the returned XML - the user should never have to deal with XML unless they want to (note the raw XML associated with a record is still easily available!) Deal with all the networking errors - the user should be able to turn their internet connection off while running and the system won't crash (it will probably stop getting results though) Abstract any of the complexity to create a uniform and easy to use, API which returns built-in types. This means the various functions only return strings, lists, tuples and dictionaries. The simplest way to is to just use pip (note there's no need to download anything here, pip downloads the source from the package index database and then installs it) pip install geeneus # (may need to be sudo) More installation options can be found here For now only protein record access usage is provided, as the gene record functionality is still in development. However, the backend provides an extendable framework for abstracting networking, caching records and error handling, such that the addition of additional data types is reasonably straight forward (i.e. the only additional code needed is record type specific XML parsing) geeneus as a package contains a module for each type of record you might want to parse (protein, gene etc). To set up for protein records, you do; from geeneus import Proteome manager = Proteome.ProteinManager("[email protected]") And from there, the NCBI/UniProt protein data is at your fingertips. Say we want the sequence for the protein sprouty homolog 4 isoform 2. This protein has the accession number "NP_001120968", so we simply do manager.get_protein_sequence("NP_001120968") and we're greeted with the sequence (formatting for easy reading here) 'meppipqsap ltpnsvmvqp lldsrmshsr lqhpltilpi dqvktshve ndyidnpsla lttgpkrtrg gapelaptpa rcdqdvthhw isfsgrpssv ssssstssd qrlldhmapp pvadqaspra vriqpkvvhc qpldlkgpav ppeldkhfll ceacgkckc kecasprtlp scwvcnqecl csaqtlvnyg tcmclvqgif yhctneddeg scadhpcsc srsnccarws fmgalsvvlp cllcylpatg cvklaqrgyd rlrrpgcrck htnsvicka asgdaktsrp dkpf' For the full range of functions available see below, or try help(manager) or help(geneeus.Proteome). Below there is a brief reference list for the available functions. The '*datastore*' being mentioned here refers to the internal storage structure that holds the data as it's parsed and stored. Proteome # for accessing protein data Genome # for accessing gene information (currently non-functional) email # required for NCBI database access cache (True) # True or False: If set to True then the datastore cache's records, while if False a new record is downloaded on every request. Unless you have a very specific reason it is highly recommended to keep this as True retry (0) # Number of retries the NCBI networking protocols use if access fails uniprotShortut (True) # If true we check UniProt first and exclusivly for some record types (see the section "Shortcutting" below) has_key(ID) # check if an ID is currently cached in the datastore (does not trigger downloading on False) keys() # returns a list of all the protein IDs in the datastore datastore_size() # get the number of records in the datastore purge() # delete all data from the datastore error(ID) # See if the record associated with this ID caused an error (discussed below in more detail) exists(ID) # See if the protein record associated with this ID exists (discussed below in more detail) run_translation(ID) # function to translate an accession to a GI (uses a call to the NCBI lookup server) get_record_source(ID) # determine which database this record was downloaded from (will return either 'NCBI' or 'UniProt') get_record_creation_date(ID) # get the date the record was created in the database (not the datastore) get_record_version(ID) # get the record version (discussed in more detail below) get_ID_type(ID) # returns a 2 position list where [0] is an exit code and [1] is the name of the ID type (if it meets the criterion for any specific type get_raw_xml(ID) # get an XML string for the record get_protein_name(ID) # get the protein name get_protein_sequence(ID) # get the amino acid sequence get_protein_sequence_length(ID) # get number of amino acids in sequence get_geneID(ID) # if the protein is associated with a specific gene ID then this returns that ID get_gene_name(ID) # if the protein is associated with a specific gene then this returns that gene's name get_variants(ID) # get a list of variant dictionaries (covered in detail in a later section) get_isoforms(ID) # get a list of isoforms indexed by their isoform reference (covered in detail in a later section) get_domains(ID) # get a list of the PFAM identified domains (covered in detail later) get_other_accessions(ID) # get a list of other accessions which also point at this record get_taxonomy(ID) # get the ordered taxonomy list of the species this protein originates from get_species(ID) # get the species of origin get_host(ID) # get the host of the species if this is a viral protein, else returns an 'N/A' string batch_get_protein_sequence(List) # returns a list which corresponds with the input list of protein sequences batch_get_protein_name(List) # returns a list which corresponds with the input list of protein names batch_get_variants(List) # returns a list which corresponds with the input list of protein variants lists Currently untested, so best to ignore for the time being... Domains, variants, isoforms and other_accessions queries return complex structures (i.e. not a string or an integer). To understand what is being returned we briefly summarize them here. We also have a quick discussion on version numbers, UniProt shortcutting, and on error and exists statuses. A domain query returns a list of domain dictionaries, where each dictionary has the following key value pairs; start # domain start location stop # domain stop location type # domain type (currently always `pfam`, but left in for potential upgrades to different domain recognition approaches in the future) label # label information accession # accession associated with the domain UPDATE IN 0.1.6: Previously he key names were capitalized (e.g. 'Location', 'Original' etc). To add consistency with other complex types keys are now all lower case A variant query returns a list of variant dictionaries, where each dictionary has the following key value pairs; location # start location of the variant being reported original # original amino acid(s) at location mutant # new amino acid(s) at location variant # a convenient X -> Y string for easy visualization of what the variant is type # Describes the type of variant notes # any annotation provided in the reference database as well as mutation references where possible For type there are a number of possible values; "Deletion" # represent regions or amino acids which are missing (e.g. AGDDT -> -) "Deletion & substitution" # represents the situation where the mutant is shorter and but other amino acids are added (e.g. AGH -> AK) "Insertion" # represent situations where the mutated version is longer than the original but the original is still present (e.g A -> AKL) "Insertion & substitution" # represent situations where the mutated version is longer than the original and we lose the original (e.g. A -> GKL) "Substitution (single)" # Single amino acid switch (e.g. A->G) "Substitution (double)" # Double amino acid switch (e.g. AK -> GL) "Substitution (<X>)" # Greater than 2 substitution where <X> is the length of the exchange (e.g. if <X> = 4 then AKHI -> CDYW) One potentially confusing is the use of DNA-typical vocabulary (insertion, deletion and subsitution) when talking about variant changes. It was decided that these provide appropriate and easy to understand terms, even if they typically refer to changes in DNA, not amino acid sequence. It's important to remember that a single substitution of an amino acid does not necessarily correspond to a SNP, and these descriptions refer exclusively to changes to the amino acid sequence, not the underlying DNA sequence. Isoform queries return dictionary, where each key value is keyed by the isoform ID (which has the form "accession-X" e.g. Q12345-3). The value is a 2 position list, where position 0 is the isoform name/reference number and position 1 is the full isoform sequence. For example, a protein with one isoform (Q12345-2) might return the following dictionary {'Q1234-2':['2','GTAGHKLPKKLRSDF']} Isoforms present some difficulties. Isoforms are defined in NCBI records in two different ways. One set are based on feature annotation. A canonical record will have a number of features which describe the change in the various isoforms relative to that canonical sequence. Those isoforms don't have their own records - they exist as annotations in a canonical record and their sequences are represented as Q12345-X. geeneus can reconstruct these isoform amino acid sequences based on the annotations, which is how it builds the NCBI isoform lists (UniProt isoforms are each individually defined and linked to the reference record, so no reconstruction is required). One additional complication is that each isoform has both an isoform ID (Q12345-X) and an isoform name (isoform Y). While often X and Y are the same this is not always the case, sometimes Y is a word name (such a small, short, beta etc). More unhelpfully, sometimes Y is a number, but a different number to the isoform ID X value. The other set exist as stand alone records, often with "isoform" in their name. These records unhelpfully includes no references to other isoforms, or to the canonical sequence/record from which they relate to. Similarly, canonical sequences have no reference to their "isoform" records. As such there is no way to include these in the list of isoforms (although they do have their own accession values as a result of existing as their own records). It is therefore up to the user to identify such isoforms. Theoretically, you could query the entire list of cross-referenced accessions and compare names to try and identify isoforms, but this would be a hugely expensive (in terms of network traffic) and there's no guarantee any/all isoforms would be included in the cross reference section. NB: If you want to request a specific isoform sequence using the dash notation, doing manager.get_protein_sequence("Q12345-5") will return the canonical sequence, not the isoform sequence. Instead, you need to do manager.get_isoforms("Q12345-5")["Q12345-5"][1] # or manager.get_isoforms("Q12345")["Q12345-5"][1] This will do the following Q12345, then get the isoformsQ12345-5name, sequence) so position 1 gives you the sequences It would probably be wise to wrap this in a try/except block in case the isoform ID is missing, such as try: manager.get_isoforms("Q12345-5")["Q12345-5"][1] except KeyError: print "Isoform ID not found" Other accession queries returns a list of tuples which define, (type of accession, accession). The type of accession will be one of the following; The way geeneus classifies these accession types is based on a set of hardcoded regular expressions. If you expect one accession type to be classified as something it's not, this may be an error in either how these values are parsed or the defining regular expressions, so please submit a bug report! Accession versioning is done by appending a period followed by a version number, e.g. Q12345.1 or Q12345.2 would be two different versions of the same record. Versioning represents updates made to records, typically as new information becomes available. One potential source of problems is that NCBI records obtained directly through the eUtils interface (as opposed to through the website) do not contain any information on related versions. This means that geeneus is unable to give this information either. Querying a non-versioned accession (e.g. Q12345 or NP_1234567) will give the most up-to-date record associated with that accession, while querying a versioned value (Q12345.3 or NP_1234567.5) will give that specific version. However, there is no way to know if any specific versioned record is the most up-to-date record, or access previous records. This is not necessarily a problem, it's just worth being aware that if you query with explicit version numbers this may not give the most up to date version. Note that GI numbers are unique for each different version, so deal with versioning in a different manner. The version number returned here refers to the non-GI accession version, where available. If no explicit version is available then we assume the version is 1. Shortcutting allows geeneus to bypass the NCBI servers entirely for UniProtKB/Swiss-Prot accession values which NCBI doesn't guarantee to support (e.g. all of them except those beginning with O, P or Q) and go directly to the UniProt servers, both in batch mode and individual mode. This leads to a massive increase in performance when dealing with large number of accessions which meet this criterion as we avoid countless database misses, retry-rounds, and the eventual fallback to UniProt and just go straight there from the word go. error and exists represent two flags to help deal with problems. If a networking request fails, this sets a records error flag to true, and any of the other methods return None. In this case, exist is also set to False, as the record does not exist in the datastore. Sometimes we may obtain a record correctly and without error, but find that it does not represent a valid protein record. If this happens we have not triggered an error (so error=False), but the record does not exists, in which case exist is also set to False. In these instances all methods except the get_raw_xml()' method returnNone, butget_raw_xml()` will return the xml for further inspection. UPDATE IN 0.1.6: Previously if an error=True or exists=False the methods would return empty strings, lists of dictionaries. This can be dangerously ambiguous, so the behavior was changed to return None (equivalent to NA, or unknown) NB The discussion below is more relevant when uniprotShortcut is set to False. NCBI guarantees support for UniProt/Swissprot IDs which begin with O, P or Q. However, it also offers some support for other types of UniProt IDs (i.e. those which begin with other letters). There is sometimes a discrepancy between those which are available through the website and through the eUtils interface, where the eUtils lookup fails on an accession that should succeed. To deal with this, geeneus can use UniProt IDs and fall back on the UniProt servers. Dealing with UniProt calls instead of NCBI calls is more expensive in terms of network traffic because it requires an addition batch request to the PFAM servers to define the domains. The UniProt records only hold references to PFAM domains, but lack the necessary details to build informative domain data structures. However, like NCBI, UniProt servers do offer a batch request mode, which is utilized in batch_get methods. If uniprotShortcut is set to True then we default to the UniProt servers instead of NCBI for those accessions not beginning with O, P or Q. However, geeneus still provides UniProt fallback for those O/P/Q records, should they fail on NCBI lookup. The user is totally oblivious to this behavior - geeneus provides an entirely uniform access to the information regardless of its source. To check which database a record has come from you can do manager.get_record_source(ID) Which returns the remote database type from which the record associated with accession ID was obtained. Note that if ID is not already in the datastore this will trigger the record to be fetched. Local and temporary caching is an important feature of geeneus which helps make it an ideal tool for interactive data exploration. The manager object builds up a local data structure, and by default caches the records it fetches from remote database. The upshot of this from the user's perspective is that if I run manager.get_protein_sequence("NP_001120968") manager.get_protein_sequence("NP_001120968") The second call doesn't query the database, but just reads off the cached value. This caching behavior can be turned off on by setting cache=False when initializing the ProteinManager object. A key design decision was how to deal with batch queries. The eUtils recommended approach for making large (100+ IDs) queries is to initially ePost a list of those queries. The ePost operation sends this list to the ENTREZ servers, returning a WebEnv value and a QueryKey value. These two can then be used with an eFetch to go to the sever and get the result of the list submitted previously. The difficulty is that this list must be made up of UIDs (unique identifiers) which for proteins means GI numbers. If you only have an accession value (as is common) the only way to get this GI number is to query the database, and this eSearch operation can not be done in batch. Essentially, this is a chicken and egg problem - to get the GIs we need to do an ePost based batch query we have to run serial database queries. This means that using ePost/eFetch would be great if you had a list of UIDs, but in practice accession numbers are a lot more common and useful, and the mapping of n accession values to UIDs would require n calls the server anyway. To get around this, I use concatenated eFetch calls for batch queries, whereby a single call is submitted with a list of IDs. This is a fast and stable way to get around this problem, and, so far, as shown no issues with lists up to 100 IDs long. The potential issue is that the HTTP GET request being made here literally gets longer as we add accession values, so this represents a top limit in terms of networking protocols. However, I implemented a recursive cascading retry mechanism which halves the list and retries each half, so should a list be too long it should only result in two calls instead of one. A primary goal with geeneus was to create an API which is robust to input. By this, it should be able to handle case insensitivity, convert accession values where necessary, and correctly recognize valid accession values while rejecting irrelevant ones to minimize server burden. For accession filtering, we use regular expressions to ensure the only accession values which we query could be real values (based on NCBI's accession rules. While PDBs don't fall into this category, we allow translation between PDBID and GI, although often a chain identifier is required as the NCBI protein database treats separate chains as separate records. All the networking is dealt with in a highly modular fashion, and network failure tolerance is a priority. This code was developed by Alex Holehouse at Washington University in Saint Louis as part of the Naegle lab. It is licensed under the the GNU General Public License (GPL-2.0). For more information see LICENCE. A truly massive hat tip to Matt Matlock for countless suggestions, discussions and constant feedback regarding geeneus in a production setting. Matt has significantly shaped this code for the better, and it would be nothing like it is today without his input (the need for isoform support, domain support, the idea for shortcutting etc etc).
If you happen to be one of about 4 people that actually reads this, you may notice I added a search box to the sidebar. What's far more interesting is the code behind it. I posted a snippet containing the code I wrote to accomplish this. Basically, it's just some convenience code to avoid having to drop down to SQL or use triggers for the simple case of having a model where you want certain fields to be full-text searchable. A SearchableModel will, by default, automatically update it's search index when you call its save() method. The API is documented at the top of the snippet, so I won't duplicate it here, but I will share the search view this site uses: def search( request ): query = '&'.join( request.GET.get('q','').split() ) entries = Entry.objects.search( query, rank_field='rank' ) return render_template( request, 'search.html', {'entries': entries} ) Update: I added query parsing for multiple words in the view. Basically, all search words are ANDed together. That's all there is to it. Keep in mind this is simply for making a single model searchable, it doesn't handle searching across relationships or custom indexing. But for simple cases, it does the trick quite nicely.
I am using ubuntu with libreOffice. I have installed unoconv for convert a *.odp file to *.pdf. When i run the command unoconv -f pdf myfile.odp from terminal then it works very fine. I want to do the same thing with using PHP shell_exec() method. So, I wrote the following code: $output = shell_exec('unoconv -f pdf test.odp 2>&1'); echo $output; But it shows the following error: /usr/bin/python: /opt/lampp/lib/libz.so.1: no version information available (required by /usr/bin/python) Traceback (most recent call last): File "/usr/bin/unoconv", line 24, in import uno, unohelper File "/usr/lib/python2.7/dist-packages/uno.py", line 34, in import pyuno SystemError: dynamic module not initialized properly How can I solve this problem? Thanks in advance.
This question already has an answer here: Question: (34 O 5 O 6 O 8 O 9 O 1) O 2=2008 Replace the Symbol of "O" to "+" or "-" or "*",and make the expression is true. My solution: info = {{"+"}, {"-"}, {"*"}}; For[a = 1, a < 4, a++, For[b = 1, b < 4, b++, For[c = 1, c < 4, c++, For[d = 1, d < 4, d++, For[e = 1, e < 4, e++, For[f = 1, f < 4, f++, temp = StringJoin["(34", Part[info, a], "5", Part[info, b], "6", Part[info, c], "8", Part[info, d], "9", Part[info, e], "1)", Part[info, f], "2"]; If[ToExpression[temp] == 2008, Print[temp]] ] ] ] ] ] ] The results: (34*5*6-8-9+1)*2==2008
brital creer un explorateur de fichiers avec python 3 Bonjour, Je voudrais programmer un "petit" explorateur de ficher avec python et TKinter. Je suppose que je dois utiliser le module os de la bibliothèque standard. Mais je cherche un tuto ou un exemple en français qui me montrerais la marche à suivre... Hors ligne shoot76 Re : creer un explorateur de fichiers avec python 3 Qu'est ce que tu entends par "explorateur de fichiers" ? - Une sorte de thunar/nautilus ou autre où tu te déplace librement sans aucun but derrière si ce n'est retrouver un fichier ? - Un sélecteur de dossiers/Fichiers ? - Une entrée chemin ? La liste est longue. Il faudrait que tu précise le contexte d'utilisation, parce que TKinter c'est bien, mais on va pas pouvoir vraiment t'aider si tu nous précise pas ce qu'il doit faire Si c'est juste sélectionner un fichier, tu peux faire comme ça : from tkinter import * from tkinter.filedialog import askopenfilename fichier = askopenfilename() à modifier selon ta convenance bien sûr Cordialement Dernière modification par shoot76 (Le 05/01/2013, à 22:16) ~ La mort d'une personne est une tragédie, celle d'un million c'est des statistiques. [J. Staline] Hors ligne brital Re : creer un explorateur de fichiers avec python 3 Ce serait plutôt pour faire une sorte de thunar/nautilus, pour parcourir mes disques, dossiers et fichiers... Hors ligne shoot76 Re : creer un explorateur de fichiers avec python 3 Tu peux créer une fenêtre tkinter vierge en ajouter tout ce que tu veux y ajouter (boutons, titres etc) en lui donnant un aspect de navigateur de fichier avec ceci par exemple : treeview.tkinter ça n'est qu'une idée, l'interface graphique en programmation dans mon domaine c'est accessoire donc je te donne que ce que je connais. On doit pouvoir faire quelque chose de plus "propre" mais ça sera forcément plus long. ~ La mort d'une personne est une tragédie, celle d'un million c'est des statistiques. [J. Staline] Hors ligne
Virtualici Re : [Tuto] - Ma personnalisation Xubuntu (et autres variantes) j'ai tout tenté ! au mieux j'ai ça : ): [sudo] password for boubou: Sorry, try again. sudo: 3 incorrect password attempts boubou@boubou-M51SE:~$ ******* ******* : commande introuvable boubou@boubou-M51SE:~$ les : ******* c'est mon pass. Hors ligne nam1962 Re : [Tuto] - Ma personnalisation Xubuntu (et autres variantes) On va changer ton mot de passe. Fais users-admin et là change ton mot de passe pour un truc simple uniquement avec des lettres sans accents Dernière modification par nam1962 (Le 17/11/2013, à 15:21) Mon tuto pour optimiser / finaliser une install : http://forum.ubuntu-fr.org/viewtopic.ph … #p15041961 Xubuntu 14.10 sur portable, 14.04 sur fixe, 14.04 chez mes amis. Score : 49 convertis IRL (leur ai pas donné le choix, aussi...). Un jeune site que j'aime bien, qui fait du T-shirt la nouvelle élégance ...bio en plus : http://goudronblanc.com Hors ligne Virtualici Re : [Tuto] - Ma personnalisation Xubuntu (et autres variantes) Je ne comprend pas, il ne veux pas accèpté mon mot de pass, déjà parce-qu'il faut enter l'ancien, ça a fonctionné une fois et après, en plein parcours de ton tuto, j'ai due repondre O/n, "j'ai fais comme dans le tuto" O majuscule, j'ai tout essayé le 0 le o len même, mais rien il me redemande mon mdp, mais il n'en veux pas il était on n'peu plus simple pourtant !!! Bref désolé de faire le boulet comme ça mais merci quand même Dernière modification par Virtualici (Le 17/11/2013, à 16:28) Hors ligne nam1962 Re : [Tuto] - Ma personnalisation Xubuntu (et autres variantes) Redémarre et retente Mon tuto pour optimiser / finaliser une install : http://forum.ubuntu-fr.org/viewtopic.ph … #p15041961 Xubuntu 14.10 sur portable, 14.04 sur fixe, 14.04 chez mes amis. Score : 49 convertis IRL (leur ai pas donné le choix, aussi...). Un jeune site que j'aime bien, qui fait du T-shirt la nouvelle élégance ...bio en plus : http://goudronblanc.com Hors ligne Vaykadji Re : [Tuto] - Ma personnalisation Xubuntu (et autres variantes) Ce que tu peux essayer c'est écrire ton mot de passe autre part, par exemple dans ton navigateur, ou dans un fichier texte. Ensuite tu peux le surligner avec ta souris, le sélectionner, et clic droit > copier. Ensuite dans ton terminal, quand il te demande ton mot de passe, tu fais clic droit et coller, puis tu appuies sur la touche <Enter> de ton clavier. Comme ça, tu es sûr de bien entrer exactement ce que tu veux Netbook : Asus EeePC 1005PX : Atom N450 / 2Gb DDR2 - Ubuntu UnityDesktop : i5 4670k / MSI GTX760 / 8Gb DDR3 - Windows 8.1 pro & Ubuntu UnityTablette : Google Nexus 7 2013 'flo' - S4Pro 1,51Ghz / 2Gb RAM - Android 4.4.2 & Ubuntu Touch Hors ligne rb Re : [Tuto] - Ma personnalisation Xubuntu (et autres variantes) bonsoir en voulant mettre à niveau le portable de ma femme sous ubuntu 12.04 j'ai commencé les actions et la : sudo apt-get install ubuntu-restricted-extras je me retrouve avec , dans le terminal "outil de configuration des paquets"Configuration de ttf-mscorefonts-installer ,un topo microsoft dont je te mets que la fin, il y en a des tonnes et je n'arrive pas à sélectionner l'ensemble pour te mettre une copie. est ce normale @+ Richard Outil de configuration des paquets ┌──────────────┤ Configuration de ttf-mscorefonts-installer ├───────────────┐ │ │ │ MISCELLANEOUS │ │ If you acquired this product in the United States, this EULA is governed │ by the laws of the State of Washington. │ │ If this product was acquired outside the United States, then local laws │ may apply. │ │ Should you have any questions concerning this EULA, or if you desire to │ contact Microsoft for any reason, please contact the Microsoft │ subsidiary serving your country, or write: Microsoft Sales Information │ Center/One Microsoft Way/Redmond, WA 98052-6399. │ │ Reference: http://www.microsoft.com/typography/fontpack/eula.htm │ <Ok> │ │ └───────────────────────────────────────────────────────────────────────────┘ MSI Wind Box DC500-005 - Intel Atom Dual-Core D510 4 Go XubuntuVoyager 14.04 32bits et HandyLinux Hors ligne nam1962 Re : [Tuto] - Ma personnalisation Xubuntu (et autres variantes) Oui, tu sélectionnes ok avec la touche tab (les deux flèches au dessus du verrouillage majuscules) ce sont les polices de caractères non libres, ça permet de bien interpréter les docs envoyés par les gens du monde W$ Mon tuto pour optimiser / finaliser une install : http://forum.ubuntu-fr.org/viewtopic.ph … #p15041961 Xubuntu 14.10 sur portable, 14.04 sur fixe, 14.04 chez mes amis. Score : 49 convertis IRL (leur ai pas donné le choix, aussi...). Un jeune site que j'aime bien, qui fait du T-shirt la nouvelle élégance ...bio en plus : http://goudronblanc.com Hors ligne rb Re : [Tuto] - Ma personnalisation Xubuntu (et autres variantes) Ok Merci MSI Wind Box DC500-005 - Intel Atom Dual-Core D510 4 Go XubuntuVoyager 14.04 32bits et HandyLinux Hors ligne markusolympe Re : [Tuto] - Ma personnalisation Xubuntu (et autres variantes) ah, ça semble pas mal, je prends, merci ! Hors ligne Virtualici Re : [Tuto] - Ma personnalisation Xubuntu (et autres variantes) Bonjour nam et les autres;) Bon je suis boqué a cette étape : boubou@boubou-M51SE:~$ software-properties-gtk gpg: /tmp/tmpJJAotZ/trustdb.gpg : base de confiance créée boubou@boubou-M51SE:~$ sudo apt-get update [sudo] password for boubou: Sorry, try again. [sudo] password for boubou: Atteint http://fr.archive.ubuntu.com precise Release.gpg Atteint http://fr.archive.ubuntu.com precise-updates Release.gpg Atteint http://fr.archive.ubuntu.com precise-backports Release.gpg Réception de : 1 http://extras.ubuntu.com precise Release.gpg [72 B] Atteint http://archive.canonical.com precise Release.gpg Atteint http://fr.archive.ubuntu.com precise Release Atteint http://fr.archive.ubuntu.com precise-updates Release Atteint http://archive.canonical.com precise Release Atteint http://extras.ubuntu.com precise Release Atteint http://fr.archive.ubuntu.com precise-backports Release Atteint http://security.ubuntu.com precise-security Release.gpg Atteint http://fr.archive.ubuntu.com precise/main Sources Atteint http://archive.canonical.com precise/partner Sources Atteint http://fr.archive.ubuntu.com precise/restricted Sources Atteint http://fr.archive.ubuntu.com precise/universe Sources Atteint http://fr.archive.ubuntu.com precise/multiverse Sources Atteint http://fr.archive.ubuntu.com precise/main i386 Packages Atteint http://fr.archive.ubuntu.com precise/restricted i386 Packages Atteint http://fr.archive.ubuntu.com precise/universe i386 Packages Atteint http://fr.archive.ubuntu.com precise/multiverse i386 Packages Atteint http://fr.archive.ubuntu.com precise/main TranslationIndex Atteint http://fr.archive.ubuntu.com precise/multiverse TranslationIndex Atteint http://extras.ubuntu.com precise/main Sources Atteint http://security.ubuntu.com precise-security Release Atteint http://archive.canonical.com precise/partner i386 Packages Ign http://archive.canonical.com precise/partner TranslationIndex Atteint http://fr.archive.ubuntu.com precise/restricted TranslationIndex Atteint http://fr.archive.ubuntu.com precise/universe TranslationIndex Atteint http://fr.archive.ubuntu.com precise-updates/main Sources Atteint http://fr.archive.ubuntu.com precise-updates/restricted Sources Atteint http://fr.archive.ubuntu.com precise-updates/universe Sources Atteint http://fr.archive.ubuntu.com precise-updates/multiverse Sources Atteint http://extras.ubuntu.com precise/main i386 Packages Ign http://extras.ubuntu.com precise/main TranslationIndex Atteint http://fr.archive.ubuntu.com precise-updates/main i386 Packages Atteint http://fr.archive.ubuntu.com precise-updates/restricted i386 Packages Atteint http://fr.archive.ubuntu.com precise-updates/universe i386 Packages Atteint http://fr.archive.ubuntu.com precise-updates/multiverse i386 Packages Atteint http://fr.archive.ubuntu.com precise-updates/main TranslationIndex Atteint http://fr.archive.ubuntu.com precise-updates/multiverse TranslationIndex Atteint http://fr.archive.ubuntu.com precise-updates/restricted TranslationIndex Atteint http://fr.archive.ubuntu.com precise-updates/universe TranslationIndex Atteint http://fr.archive.ubuntu.com precise-backports/main Sources Atteint http://fr.archive.ubuntu.com precise-backports/restricted Sources Atteint http://security.ubuntu.com precise-security/main Sources Atteint http://fr.archive.ubuntu.com precise-backports/universe Sources Atteint http://fr.archive.ubuntu.com precise-backports/multiverse Sources Atteint http://fr.archive.ubuntu.com precise-backports/main i386 Packages Atteint http://fr.archive.ubuntu.com precise-backports/restricted i386 Packages Atteint http://fr.archive.ubuntu.com precise-backports/universe i386 Packages Atteint http://fr.archive.ubuntu.com precise-backports/multiverse i386 Packages Atteint http://fr.archive.ubuntu.com precise-backports/main TranslationIndex Atteint http://fr.archive.ubuntu.com precise-backports/multiverse TranslationIndex Atteint http://fr.archive.ubuntu.com precise-backports/restricted TranslationIndex Atteint http://fr.archive.ubuntu.com precise-backports/universe TranslationIndex Atteint http://fr.archive.ubuntu.com precise/main Translation-fr_FR Atteint http://fr.archive.ubuntu.com precise/main Translation-fr Atteint http://fr.archive.ubuntu.com precise/main Translation-en Atteint http://fr.archive.ubuntu.com precise/multiverse Translation-fr_FR Atteint http://fr.archive.ubuntu.com precise/multiverse Translation-fr Atteint http://fr.archive.ubuntu.com precise/multiverse Translation-en Atteint http://fr.archive.ubuntu.com precise/restricted Translation-fr_FR Atteint http://fr.archive.ubuntu.com precise/restricted Translation-fr Atteint http://fr.archive.ubuntu.com precise/restricted Translation-en Atteint http://fr.archive.ubuntu.com precise/universe Translation-fr_FR Atteint http://fr.archive.ubuntu.com precise/universe Translation-fr Atteint http://fr.archive.ubuntu.com precise/universe Translation-en Atteint http://fr.archive.ubuntu.com precise-updates/main Translation-fr Atteint http://fr.archive.ubuntu.com precise-updates/main Translation-en Atteint http://security.ubuntu.com precise-security/restricted Sources Atteint http://security.ubuntu.com precise-security/universe Sources Atteint http://security.ubuntu.com precise-security/multiverse Sources Atteint http://security.ubuntu.com precise-security/main i386 Packages Atteint http://security.ubuntu.com precise-security/restricted i386 Packages Atteint http://security.ubuntu.com precise-security/universe i386 Packages Atteint http://security.ubuntu.com precise-security/multiverse i386 Packages Atteint http://security.ubuntu.com precise-security/main TranslationIndex Atteint http://security.ubuntu.com precise-security/multiverse TranslationIndex Atteint http://security.ubuntu.com precise-security/restricted TranslationIndex Atteint http://fr.archive.ubuntu.com precise-updates/multiverse Translation-fr Atteint http://fr.archive.ubuntu.com precise-updates/multiverse Translation-en Atteint http://fr.archive.ubuntu.com precise-updates/restricted Translation-fr Atteint http://fr.archive.ubuntu.com precise-updates/restricted Translation-en Atteint http://fr.archive.ubuntu.com precise-updates/universe Translation-fr Atteint http://fr.archive.ubuntu.com precise-updates/universe Translation-en Atteint http://fr.archive.ubuntu.com precise-backports/main Translation-en Atteint http://fr.archive.ubuntu.com precise-backports/multiverse Translation-en Atteint http://fr.archive.ubuntu.com precise-backports/restricted Translation-en Atteint http://fr.archive.ubuntu.com precise-backports/universe Translation-en Atteint http://security.ubuntu.com precise-security/universe TranslationIndex Atteint http://security.ubuntu.com precise-security/main Translation-en Atteint http://security.ubuntu.com precise-security/multiverse Translation-en Ign http://archive.canonical.com precise/partner Translation-fr_FR Ign http://extras.ubuntu.com precise/main Translation-fr_FR Ign http://archive.canonical.com precise/partner Translation-fr Atteint http://security.ubuntu.com precise-security/restricted Translation-en Ign http://extras.ubuntu.com precise/main Translation-fr Ign http://archive.canonical.com precise/partner Translation-en Ign http://extras.ubuntu.com precise/main Translation-en Atteint http://security.ubuntu.com precise-security/universe Translation-en 72 o réceptionnés en 1s (54 o/s) Lecture des listes de paquets... Fait boubou@boubou-M51SE:~$ sudo apt-get install xfce4-goodies Lecture des listes de paquets... Fait Construction de l'arbre des dépendances Lecture des informations d'état... Fait Les paquets suivants ont été installés automatiquement et ne sont plus nécessaires : linux-headers-3.2.0-52-generic linux-headers-3.2.0-52 Veuillez utiliser « apt-get autoremove » pour les supprimer. Les paquets supplémentaires suivants seront installés : hddtemp libfam0 libhal-storage1 libhal1 libthunar-vfs-1-2 libthunar-vfs-1-common lm-sensors mousepad squeeze xfce4-artwork xfce4-battery-plugin xfce4-clipman xfce4-clipman-plugin xfce4-cpufreq-plugin xfce4-diskperf-plugin xfce4-fsguard-plugin xfce4-genmon-plugin xfce4-mount-plugin xfce4-sensors-plugin xfce4-smartbookmark-plugin xfce4-timer-plugin xfce4-wavelan-plugin Paquets suggérés : ksensors fam fancontrol sensord read-edid i2c-tools xfprint4 xfce4-cellmodem-plugin xfce4-linelight-plugin xfce4-messenger-plugin xfce4-mpc-plugin xfce4-radio-plugin xfce4-xfapplet-plugin xfswitch-plugin xfce4-hdaps thunar-thumbnailers xfmpc xsensors Les NOUVEAUX paquets suivants seront installés : hddtemp libfam0 libhal-storage1 libhal1 libthunar-vfs-1-2 libthunar-vfs-1-common lm-sensors mousepad squeeze xfce4-artwork xfce4-battery-plugin xfce4-clipman xfce4-clipman-plugin xfce4-cpufreq-plugin xfce4-diskperf-plugin xfce4-fsguard-plugin xfce4-genmon-plugin xfce4-goodies xfce4-mount-plugin xfce4-sensors-plugin xfce4-smartbookmark-plugin xfce4-timer-plugin xfce4-wavelan-plugin 0 mis à jour, 23 nouvellement installés, 0 à enlever et 0 non mis à jour. Il est nécessaire de prendre 11,8 Mo dans les archives. Après cette opération, 22,2 Mo d'espace disque supplémentaires seront utilisés. Souhaitez-vous continuer [O/n] ? O Annulation. boubou@boubou-M51SE:~$ Hors ligne Vaykadji Re : [Tuto] - Ma personnalisation Xubuntu (et autres variantes) C'est un O, pas un 0 (un "eau" de l'alphabet, pour OUI, pas le zéro), mais je pense que tu l'as compris ça. Essaye avec un "o" minuscule, moi c'est ce que je fais. Essaye également avec un "y" qui est la réponse YES sur une installation en Anglais (on sait jamais que toute la traduction soit pas installée...) Netbook : Asus EeePC 1005PX : Atom N450 / 2Gb DDR2 - Ubuntu UnityDesktop : i5 4670k / MSI GTX760 / 8Gb DDR3 - Windows 8.1 pro & Ubuntu UnityTablette : Google Nexus 7 2013 'flo' - S4Pro 1,51Ghz / 2Gb RAM - Android 4.4.2 & Ubuntu Touch Hors ligne nam1962 Re : [Tuto] - Ma personnalisation Xubuntu (et autres variantes) Ou tout simplement la touche entrée (valide dans la plupart des cas) Mon tuto pour optimiser / finaliser une install : http://forum.ubuntu-fr.org/viewtopic.ph … #p15041961 Xubuntu 14.10 sur portable, 14.04 sur fixe, 14.04 chez mes amis. Score : 49 convertis IRL (leur ai pas donné le choix, aussi...). Un jeune site que j'aime bien, qui fait du T-shirt la nouvelle élégance ...bio en plus : http://goudronblanc.com Hors ligne Virtualici Re : [Tuto] - Ma personnalisation Xubuntu (et autres variantes) Bon et bien merci, je ne sais pas si j'ai tout fais "bien" car parfois ni le O ni o ni Y ni y ni même Entrer, parfois les double flèches me proposais un (y/n) j'ai toujours mis y, mais parfois ça ne fonctionnais même pô ^^ Mais bon la bécane fonctionne c'est déjà top ! merci Nam A+ ? Hors ligne alca94 Re : [Tuto] - Ma personnalisation Xubuntu (et autres variantes) @ nam1962 Je ne sais pas pourquoi (même dans la Doc en général) ils utilisent "sudo gedit" alors que ça devrait être "gksudo gedit" et je vois que vous également ? http://doc.ubuntu-fr.org/sudo#quand_doi … udokdesudo Hors ligne moko138 Re : [Tuto] - Ma personnalisation Xubuntu (et autres variantes) @alca94 : merci d'enfoncer le clou ! @nam1962 : effectivement, ça serait bien que tu édites ton tuto en ce sens. Depuis que je distingue gksudo de sudo, je ne me retrouve plus avec /home et HD externe en lecture seule. Hors ligne Vaykadji Re : [Tuto] - Ma personnalisation Xubuntu (et autres variantes) C'est pareil pourtant, sauf que "sudo gedit" va tourner dans le terminal et demandera de laisser ouvert le terminal alors que "gksudo gedit" va faire appel à gksu pour ouvrir gedit, et donc tourner dans gksu et pas dans le terminal. Dernière modification par Vaykadji (Le 21/11/2013, à 13:43) Netbook : Asus EeePC 1005PX : Atom N450 / 2Gb DDR2 - Ubuntu UnityDesktop : i5 4670k / MSI GTX760 / 8Gb DDR3 - Windows 8.1 pro & Ubuntu UnityTablette : Google Nexus 7 2013 'flo' - S4Pro 1,51Ghz / 2Gb RAM - Android 4.4.2 & Ubuntu Touch Hors ligne moko138 Re : [Tuto] - Ma personnalisation Xubuntu (et autres variantes) Ce n'est pas pareil au niveau des droits admin, cf. lien donné par alca94, et ça a parfois des conséquences embêtantes au redémarrage. Hors ligne nam1962 Re : [Tuto] - Ma personnalisation Xubuntu (et autres variantes) Modifié ! Merci du rappel bande de puristes Dernière modification par nam1962 (Le 21/11/2013, à 14:59) Mon tuto pour optimiser / finaliser une install : http://forum.ubuntu-fr.org/viewtopic.ph … #p15041961 Xubuntu 14.10 sur portable, 14.04 sur fixe, 14.04 chez mes amis. Score : 49 convertis IRL (leur ai pas donné le choix, aussi...). Un jeune site que j'aime bien, qui fait du T-shirt la nouvelle élégance ...bio en plus : http://goudronblanc.com Hors ligne moko138 Re : [Tuto] - Ma personnalisation Xubuntu (et autres variantes) Grand merci, nam1962 ! Hors ligne jibel Re : [Tuto] - Ma personnalisation Xubuntu (et autres variantes) @Tous , La guerre du GKsudo VS sudo est déclarée , au premier round sudo a envoyé un uppercut a GKsudo qui c'est retrouvé dans les cordes ....... Qu'elle va être la réponse de GKsudo ? suite au prochain épisode .... Plus grande est la face, plus grand est le dos! Toutes les fautes de frappe, d'orthographe, de grammaire et de syntaxe ci-dessus, sont la propriété intellectuelle de l'auteur.Elles peuvent être reproduites et même corrigées sans l'accord préalable du susdit. Avec Ub.12.04, 14.04, Kub. 13.10, 14.04,Voy 14.04,13.10,13.04,12.04 LTS , Mint 17, hybryde fus13.04 .PC medion akira DD 1T + 2 . Hors ligne Vaykadji Re : [Tuto] - Ma personnalisation Xubuntu (et autres variantes) Ah et il faut aussi se rappeler que certaines distributions ne supportent pas la commande gksudo (je pense à Fedora, notamment), alors que sudo est présent partout. Note : La différence entre sudo et gksudo est la suivante : - sudo lance un programme en root en utilisant la configuration de l'utilisateur loggé. - gksudo lance un programme en root en utilisant la configuration root du programme. En fait, utiliser gksudo va permettre de ne pas modifier vos dossiers personnels, qui contiennent des fichiers nécessaires au bon fonctionnement de la session. Cependant, utiliser gksudo va également vous faire perdre vos paramètres personnalisés durant l'utilisation du programme puisqu'il va utiliser les fichiers de configuration root pour se lancer. Il est déconseillé d'utiliser 'sudo' pour un programme avec interface graphique parce que dans de rares cas, ça pourrait causer des dommages importants à votre OS. Source Dernière modification par Vaykadji (Le 21/11/2013, à 19:03) Netbook : Asus EeePC 1005PX : Atom N450 / 2Gb DDR2 - Ubuntu UnityDesktop : i5 4670k / MSI GTX760 / 8Gb DDR3 - Windows 8.1 pro & Ubuntu UnityTablette : Google Nexus 7 2013 'flo' - S4Pro 1,51Ghz / 2Gb RAM - Android 4.4.2 & Ubuntu Touch Hors ligne nam1962 Re : [Tuto] - Ma personnalisation Xubuntu (et autres variantes) Ce n'est plus un tuto : ça devient une encyclopédie ce topic Mon tuto pour optimiser / finaliser une install : http://forum.ubuntu-fr.org/viewtopic.ph … #p15041961 Xubuntu 14.10 sur portable, 14.04 sur fixe, 14.04 chez mes amis. Score : 49 convertis IRL (leur ai pas donné le choix, aussi...). Un jeune site que j'aime bien, qui fait du T-shirt la nouvelle élégance ...bio en plus : http://goudronblanc.com Hors ligne alca94 Re : [Tuto] - Ma personnalisation Xubuntu (et autres variantes) Ah et il faut aussi se rappeler que certaines distributions ne supportent pas la commande gksudo (je pense à Fedora, notamment), ça s'adresse a un public "ubuntu" .Ferdora doit avoir son propre forum ,non ? Hors ligne metalux Re : [Tuto] - Ma personnalisation Xubuntu (et autres variantes) nam1962, tu peux S.T.P. m'apporter des précisions sur:1. TLP a un réglage douteux : SATA_LINKPWR_ON_BAT qu'il vaut mieux mettre sur max_performance et son utilité. J'utilise également TLP depuis un certains temps et justement je change cette option pour mettre SATA_LINKPWR_ON_AC=min_power sinon mon PC ressemble plus à un grille-pain....euh grille-mains Xubuntu 14.04 LTS sur HP Pavilion t728.fr Precise Pangolin 64 bits sur Acer aspire 5738ZG Voyager 13.04 mise à niveau en 14.04 sur TOSHIBA Satellite C870-196. Faîtes la mise à jour de vos P.P.A. automatiquement Hors ligne nam1962 Re : [Tuto] - Ma personnalisation Xubuntu (et autres variantes) Ça venait d'une observation sur un fofo qui depuis a disparu : ce premier qui me l'a conseillé considérait que min_power était mal géré. De mon côté, ça m'a bien été sur 36 installs. (Mais du coup n'ai pas testé min_power) Mon tuto pour optimiser / finaliser une install : http://forum.ubuntu-fr.org/viewtopic.ph … #p15041961 Xubuntu 14.10 sur portable, 14.04 sur fixe, 14.04 chez mes amis. Score : 49 convertis IRL (leur ai pas donné le choix, aussi...). Un jeune site que j'aime bien, qui fait du T-shirt la nouvelle élégance ...bio en plus : http://goudronblanc.com Hors ligne
Kanor Re : Idée projet Logiciel RDM Eurocodes Structures Bois, Acier, Béton... D'aprés ce que je comprend Salome utilise code_aster Sinon pdf qui me semble intéressant http://calcul.math.cnrs.fr/Documents/Journees/dec2006/aster.pdf ça date un peu 2006 En ligne ossatureLibre Re : Idée projet Logiciel RDM Eurocodes Structures Bois, Acier, Béton... Bonjour tout le monde, Effectivement pyopenshelter demande un bon ménage, voire même de le reprendre à zéro en le considérant comme une maquette (ça n'est pas forcemment un boulot enorme). ceci dit il fonctionne, je m'occupe de mettre la dernière "version" en ligne ce soir. Pour l'instant c'est juste une API permettant de piloter le code aster et de faire un post traitement selon les eurocodes. Pour l'installation du code aster, je trouve que le plus simple est de passer par Salome dont l'installation est assez simple et qui installe le code aster en même temps. Le mieux est de vous brancher sur le forum du code aster pour les problèmes d'installation et de prise en main.Il y a une communauté trés active. quelques conseils pour la prise en main du code aster: A la base c'est un logiciel qui ne fait que le calcul: pas d'interface graphique ni de visualisation intégrée:les données sont entrées dans 2 (en général) fichiers textes: - le fichier de maillage pour la géométrie - le fichier de commandes pour les chargements, les options de calcul, etc Le fichier de commande a cette particularité qu'il accepte des commandes en python, ce qui a déterminé mon choix de python pour pyopenshelter, les utilisateurs du code_aster sont en effet sensés connaitre python. Le calcul peut ce lancer par la console avec une ligne de commande, mais il faut pour renseigner le code aster un fichier (.export) qui indique les fichiers de données, et des renseignements sur la machine de l'utilisateur, il n'y a pas de doc trés claire sur ce fichier, le mieux est d'en créer un automatiquement avec l'interface ASTK (voir plus bas) Il existe quelques outils qui peuvent remplir le role d'interface graphique: - Salome meca: permet de modéliser une structure par une interface graphique, et de lancer un calcul du code aster directement. C'est un logiciel adapté à l'industrie, bien pour les éléments finis, mais pas bien adapté aux structures de type poutres. - ASTK: c'est une interface graphique qui permet de lancer les calculs: on indique dans une fenêtre le répertoire de travail, les fichiers de données (maillage et fichier de commande) et le nom des fichiers de résultats, et le calcul est lancé en cliquant - gmsh: logiciel libre de maillage qui peut servir à faire le modèle géométrique et à visualiser les résultats, ce logiciel à l'honneur d'être intégré dans la logithèque d'Ubuntu (logiciels d'education) A noter qu'il existe une distribution linux ( caeLinux ) qui est livrée avec le codeaster et plein d'autres logiciels de calcul. Quand à pyopenshelter, il permet de modéliser des structures de poutres dans un langage "pythonique", de visualiser les résultats en 3D (avec VTK), de lancer un calcul par le code aster, il y a quelques modules d'export (dxf, pdf), un module de combinaisons ELS ELU Eurocodes (pas encore sur le site), vérification de fleches et sections par eurocode5, calcul d'assemblages (pointes et boulons) par eurocode5... bref il fait beaucoup de choses, plus tout ce qu'on peut imaginer avec les très nombreuses bibliothèques python existantes. Mais dans l'immédiat il faut le voir comme un projet en début de développement, dans une optique plus vaste consistant à offrir au développeur python des outils de modélisation pour le bâtiment dans son langage préféré. Gérard Hors ligne j1100 Re : Idée projet Logiciel RDM Eurocodes Structures Bois, Acier, Béton... bon alors 2-3 questions juste comme ça... 1) ça sert à quoi de sortir de bazooka de la mort pour tuer une mouche? aster, c'est de la mef, non? je pense que pybar suffit largement pour des problèmes aux EC 2) est-ce que quelqu'un a les EC, même en partie. je sais que ça coûte bonbon! 3) je suis partant pour géotech, et mixte. je pense que ba/bp, il y en a pas mal qui connaisse. pareil pour cm. Hors ligne mc@ubuntu Re : Idée projet Logiciel RDM Eurocodes Structures Bois, Acier, Béton... Bonjour, Comme dit ossatureLibre, si vous avez des problèmes d'installation de Code_Aster, allez sur www.code-aster.org (problème avec l'hébergement du site ces jours-ci...). Et pour ces problèmes d'installation, si quelqu'un veut se pencher sur la fabrication de paquets, à dispo pour en parler ! Si vous décidez d'utiliser Code_Aster dans votre nouvel outil, n'hésitez pas à vous faire connaître, demander des infos sur la meilleure manière de s'interfacer avec Code_Aster... Bravo pour votre analyse SaloméMéca / Code_Aster / astk : c'est tout juste ! (et pour les connaisseurs et ceux qui veulent lancer un calcul aster à la main : as_run pourra se passer d'un fichier export pour les calculs simples dans la prochain livraison) MC Dernière modification par mc@ubuntu (Le 20/01/2010, à 10:45) Hors ligne peterp@n Re : Idée projet Logiciel RDM Eurocodes Structures Bois, Acier, Béton... bon alors 2-3 questions juste comme ça... 1) ça sert à quoi de sortir de bazooka de la mort pour tuer une mouche? aster, c'est de la mef, non? je pense que pybar suffit largement pour des problèmes aux EC Qu'est ce que ça veut dire "mef"? pyBar est plus simple mais oblige à décomposer le projet. Mais la possibilité de pouvoir créer la structure entière en une fois est intéressante aussi. Pour l'instant je trouve bien de découvrir et tester tout ce qui existe déjà. 2) est-ce que quelqu'un a les EC, même en partie. je sais que ça coûte bonbon! J'ai toutes les EC en .rtf et/ou .pdf. 3) je suis partant pour géotech, et mixte. je pense que ba/bp, il y en a pas mal qui connaisse. pareil pour cm. Excusez mon ignorance mais que veut dire "géotech et mixte", "ba/bp", et "cm" ? Ubuntu 12.04 64bits, Raspbian “wheezy”, Tango Studio sauce debian Un bureau d'études techniques pour le bâtiment avec des logiciels libre. Entreprise de construction bois. - Formations FreeCAD (logiciel 3d) Hors ligne mc@ubuntu Re : Idée projet Logiciel RDM Eurocodes Structures Bois, Acier, Béton... 1) ça sert à quoi de sortir de bazooka de la mort pour tuer une mouche? aster, c'est de la mef, non? je pense que pybar suffit largement pour des problèmes aux EC Certes, Code_Aster n'est pas développé dans cet objectif, mais il le fait très bien. A vous de choisir ! Si vous développez un module python pour les eurocodes, cela peut potentiellement intéresser d'autres utilisateurs de Code_Aster. Çà pourrait être intégré. MC PS MEF : méthode des éléments finis Dernière modification par mc@ubuntu (Le 20/01/2010, à 14:46) Hors ligne ossatureLibre Re : Idée projet Logiciel RDM Eurocodes Structures Bois, Acier, Béton... Je n'utilise pas le code-aster et pyopenshelter pour tuer des mouches mais pour modéliser des structures dans un cadre professionnel, pour cela j'ai besoin: - de pouvoir modéliser en 3D pour etudier le contreventement de structures assymétriques - de pouvoir faire des calculs dynamiques ou modaux (séisme) - de pouvoir faire des calculs non linéaires (cables, flambement) - de pouvoir faire des calculs par éléments finis volumiques (modélisation du sol par exemple) - etc Tout cela le code_aster le fait très bien et même mieux que la plupart des logiciels du commerce. Mais forcemment cela a un coût: la complexité (que l'on retrouve dans une certaine mesure dans pyopenshelter!) Ce que le code_aster (et salome) fait mal ou pas: - la modélisation de systèmes de poutres (en particulier visualisation des sections, modélisation des liaisons entre poutres ...) pyopenshelter a été créé à l'origine dans ce but. - la vérification des sections et assemblages selon les eurocodes Le fait de le proposer sous forme de bibliothèque python offre de plus des possibilités de modélisation paramétrique énormes. j'ai mis la dernière "version" de pyopenshelter en ligne: http://www.pyopenshelter.com/doc/download/download.html Le danger de la programmation en particulier avec python, c'est que dés qu'on a besoin d'une fonctionnalité, il suffit ... de la rajouter! Ce qui explique qu'en un an de développement anarchique j'ai produit une bibliothèque hypertrophiée dans laquelle les visiteurs risquent de se perdre. D'où la necessité de créer une communauté d'utilisateurs et de développeurs (en fait tout utilisateur est développeur puisqu'un modèle n'est rien d'autre qu'un script python) pour proposer une API cohérente et bien documentée Gérard Hors ligne j1100 Re : Idée projet Logiciel RDM Eurocodes Structures Bois, Acier, Béton... géotech, c'est l'eurocode 7: calcul géotechnique ba/bp: béton armé et béton précontraint, cm:construction métallique. Hors ligne peterp@n Re : Idée projet Logiciel RDM Eurocodes Structures Bois, Acier, Béton... Salut à tous, Je suis en train de tester CaeLinux2009 en live-cd. Ca dépote ! Pas besoin de s'embéter à installer Salome ou code_aster sur Karmic ou autres. Mais j'arrive pas à faire grand chose... J'ai l'impression que c'est trop complet par rapport à ce que j'imaginais. Du coup je me sens dépassé par l'ampleur de la tâche. Je me demande si je dois persister à comprendre Salomé, code_aster etc... ou si, comme à l'air de penser j1100, il vaut mieu partir de quelque chose de plus simple comme pyBar. Pour l'instant je me sens incapable de produire quoique ce soit avec salome et code_aster. Si il y en a parmis vous qui utilise CaeLinux j'ai 2 questions : Faut il faire les MAJ ? Comme je suis en live_cd je peux pas mettre la distrib en full french mais j'imagine que tous les logiciels sont en anglais, non ? Existe t il des tutoriels en français pour débuter avec salome et code_aster et orientés structure ? (c'est pas que je sois anglophobe mais pour débuter j'aime bien ma langue maternelle) A Gérard : Dans Salome, est ce que tu modélises les éléments d'une structure avec des noeuds et des lignes ou avec des volumes ? Comment est ce que je peux appliquer des efforts sur ma structure directement dans salome ? exemple : http://www.hiboox.com/go/pictures/priva … 9.png.html Bonne journée ! Ubuntu 12.04 64bits, Raspbian “wheezy”, Tango Studio sauce debian Un bureau d'études techniques pour le bâtiment avec des logiciels libre. Entreprise de construction bois. - Formations FreeCAD (logiciel 3d) Hors ligne wwiki Re : Idée projet Logiciel RDM Eurocodes Structures Bois, Acier, Béton... Je n'utilise pas le code-aster et pyopenshelter pour tuer des mouches mais pour modéliser des structures dans un cadre professionnel, pour cela j'ai besoin: - de pouvoir modéliser en 3D pour etudier le contreventement de structures assymétriques - de pouvoir faire des calculs dynamiques ou modaux (séisme) - de pouvoir faire des calculs non linéaires (cables, flambement) - de pouvoir faire des calculs par éléments finis volumiques (modélisation du sol par exemple) - etc Tout cela le code_aster le fait très bien et même mieux que la plupart des logiciels du commerce. Mais forcemment cela a un coût: la complexité (que l'on retrouve dans une certaine mesure dans pyopenshelter!) Ce que le code_aster (et salome) fait mal ou pas: - la modélisation de systèmes de poutres (en particulier visualisation des sections, modélisation des liaisons entre poutres ...) pyopenshelter a été créé à l'origine dans ce but. - la vérification des sections et assemblages selon les eurocodes Le fait de le proposer sous forme de bibliothèque python offre de plus des possibilités de modélisation paramétrique énormes. j'ai mis la dernière "version" de pyopenshelter en ligne: http://www.pyopenshelter.com/doc/download/download.html Le danger de la programmation en particulier avec python, c'est que dés qu'on a besoin d'une fonctionnalité, il suffit ... de la rajouter! Ce qui explique qu'en un an de développement anarchique j'ai produit une bibliothèque hypertrophiée dans laquelle les visiteurs risquent de se perdre. D'où la necessité de créer une communauté d'utilisateurs et de développeurs (en fait tout utilisateur est développeur puisqu'un modèle n'est rien d'autre qu'un script python) pour proposer une API cohérente et bien documentée Gérard Bonjour , Je trouve la proposition intéressante . Par contre ma plus grosse difficulté est plus informative. Ou puis-je consulter les EUROCODES ? De plus , je vous suggère de faire un poste de lancement sur le site http://caelinux.com/CMS/index.php?option=com_joomlaboard&Itemid=52 Hors ligne peterp@n Re : Idée projet Logiciel RDM Eurocodes Structures Bois, Acier, Béton... Salut wwiki, Bienvenue parmis nous ! Contactes moi pour les Eurocodes. Pour ce qui est de lancer le projet à plus grande échelle j'attends d'avoir finit quelques épreuves et projet en cours (étudiant en licence professionnelle) pour m'y replonger sérieusement. A+ Dernière modification par Peterpan12 (Le 13/02/2010, à 14:17) Ubuntu 12.04 64bits, Raspbian “wheezy”, Tango Studio sauce debian Un bureau d'études techniques pour le bâtiment avec des logiciels libre. Entreprise de construction bois. - Formations FreeCAD (logiciel 3d) Hors ligne wwiki Re : Idée projet Logiciel RDM Eurocodes Structures Bois, Acier, Béton... Re - bonjour à tous, Pour ma part , je trouve l'orientation donnée par ossatureLibre , la plus intéressante sur le long terme et la plus rapide à mettre en oeuvre par rapport à l'ensemble des Eurocodes. En plus Peterpan12 comme tu connais python , il n'y a pas de problème. Hors ligne peterp@n Re : Idée projet Logiciel RDM Eurocodes Structures Bois, Acier, Béton... Oula, "connaitre" python est un bien grand mot. Je n'y connais pas grand chose en réalité, même si je comprend vite, je n'ai eu aucune formation en programmation. Et le script que je montre au début du topic est tout simplement la transposition de codes trouvés sur Internet. Maintenant il est vrai que l'orientation donnée par ossatureLibre répond a un besoin professionnel et ceci pour tout les corps de métiers. Je suis aussi d'accord sur le fait que c'est la solution la plus intéressante sur le long terme mais cela va demandé une étude approfondie de code_aster (pour ma part en tous cas). Peterpan12, pressé de finir le semestre et de partir en stage pour se pencher sur ce projet. Ubuntu 12.04 64bits, Raspbian “wheezy”, Tango Studio sauce debian Un bureau d'études techniques pour le bâtiment avec des logiciels libre. Entreprise de construction bois. - Formations FreeCAD (logiciel 3d) Hors ligne wwiki Re : Idée projet Logiciel RDM Eurocodes Structures Bois, Acier, Béton... Merci pour ta réponse Peterpan12 , Quand tu es disponibles , je peux te faire un topo rapide sur les outils qu'ossatureLibre a décrit . C'est vrai qu'ils sont d'un abord rude, mais pour ma part , je trouve que l'on va vraiment beaucoup plus loin qu'avec les logiciels commerciaux. Allez bon fin de semestre . Dernière modification par wwiki (Le 18/02/2010, à 23:47) Hors ligne fabdark Re : Idée projet Logiciel RDM Eurocodes Structures Bois, Acier, Béton... salut je suis intéressé par votre projet y a t'il une première version fonctionnelle ? Hors ligne peterp@n Re : Idée projet Logiciel RDM Eurocodes Structures Bois, Acier, Béton... salut fabdark, Le projet que nous développons ici n'a aucune version pour l'instant. Les seules choses que tu peus tester c'est : pyOpenShelter de ossatureLibre et aussi mon script dans mon premier message. Voilà, si tu as des scripts ou des programmes dans ce domaine, faits nous en part. Ubuntu 12.04 64bits, Raspbian “wheezy”, Tango Studio sauce debian Un bureau d'études techniques pour le bâtiment avec des logiciels libre. Entreprise de construction bois. - Formations FreeCAD (logiciel 3d) Hors ligne fabdark Re : Idée projet Logiciel RDM Eurocodes Structures Bois, Acier, Béton... malheureusement je suis en BTS SCBH mais je n'ai aucune notion de programmation donc vous donner un coup de main serai un grand plaisir mais a par le calcul aux eurocodes je m'en arrête là, mais j'imagine que vous connaissez bien tout cela. sinon je veut bien testé le programme de Ossature libre si il veut bien m'expliquer comment faut l'installer merci d'avance a lui. car je dois avoué j'aime bien son concept de modéliseur sinon je peut répondre a certaine question sur les eurocodes sur le bois et le vent si il y a besoins je suivrai ce sujet de près en m'impliquant au maximum Hors ligne Julius Re : Idée projet Logiciel RDM Eurocodes Structures Bois, Acier, Béton... Un de mes prof' est assez intéressé par la démarche... Il aimerait savoir si certains d'entre vous seraient intéressés par s'impliquer vraiment dans la programmation, en partant de ce qu'ils ont déjà fait : http://www.geuz.org/gmsh/ Apparemment le maillage fonctionne super bien et là ils sont en train d'implémenter les éléments finis dans l'idée de pouvoir communiquer avec d'autres programmes déjà existants (genre code aster j'imagine). Bref, si ça vous tente, c'est un projet d'une grosse envergure mais il faut du temps et connaitre le c++ Les logiciels libres à Sambreville avec le SambreLUG. Hors ligne Brain Bug Re : Idée projet Logiciel RDM Eurocodes Structures Bois, Acier, Béton... Bonsoir, Je suis pas mal intéressé par ce projet que je compte suivre. De là à m'impliquer, je pense ne pas avoir le niveau. (et dans le cas contraire, je me manifesterai) Sinon j'ai une question sur ces propos : Un de mes prof' est assez intéressé par la démarche... Il aimerait savoir si certains d'entre vous seraient intéressés par s'impliquer vraimentdans la programmation, en partant de ce qu'ils ont déjà fait : http://www.geuz.org/gmsh/ Apparemment le maillage fonctionne super bien et là ils sont en train d'implémenter les éléments finis dans l'idée de pouvoir communiquer avec d'autres programmes déjà existants (genre code aster j'imagine). Bref, si ça vous tente, c'est un projet d'une grosse envergure mais il faut du temps et connaitre le c++ Au boulot on utilise gmsh pour mailler les pièces et calculer avec code aster si j'ai bien compris. Donc il communique déjà avec Aster non ? J'ai raté quelque chose ? Hors ligne captnfracasse Re : Idée projet Logiciel RDM Eurocodes Structures Bois, Acier, Béton... Salut, salut !! Je suis aussi en SCBH sur Nantes. Ce projet m'interesse beaucoup. J'avais déjà commencé un site en php sur le calcul de charge (malheureusement, j'ai tout perdu) . Je suis en fin de deuzième année (donc bientot le projet) et ce petit programme m'avait aidé à chaque fois. Je vais rééssayer Salome et code aster. Je les avais déjà testé au debut de ma formation et cela m'avait paru très compliqué. Je voudrais lancer un site communautaire sur la construction (open). J'ai déjà mis un site nuked >> http://www.konstruction.tk/ . et un chan irc sur spidernet.org : #konstruction . A+ Baptiste. captnfracasse Re : Idée projet Logiciel RDM Eurocodes Structures Bois, Acier, Béton... up stephane creativbois Re : Idée projet Logiciel RDM Eurocodes Structures Bois, Acier, Béton... bonjour a tous je de tout coeur avec vous ! c'est beau des projets comme ceux ci je suis dans le bois mais pas dans la programmation désolé (vous voyez l'intérêt que je porte a votre projet lol ) car les calcul a la main ....:P bien des logiciels mais pas donné et je le comprend vu le travail dessus Hors ligne toitoinebzh Re : Idée projet Logiciel RDM Eurocodes Structures Bois, Acier, Béton... salut pour ceux intéresser scilab développe un module pour l'eurocodes http://www.scilab.org/projects/development/eurocodes [email protected] http://toitoinebzh.blog.free.fr Hors ligne VinsS Re : Idée projet Logiciel RDM Eurocodes Structures Bois, Acier, Béton... Bonjour, Une version PyQt du script de Peterpan12 #! /usr/bin/env python # -*- coding: utf-8 -*- import os from xml.dom import minidom from PyQt4 import QtCore, QtGui class TopWindow(object): c_folder = os.getcwdu() f_datas = os.path.join(c_folder, "materiau.xml") gM = 0 kh = 0 def setup_gui(self, MainWindow): MainWindow.resize(350, 500) MainWindow.setWindowTitle("Calcul d'ossature") self.centralwidget = QtGui.QWidget(MainWindow) self.gridLayout_2 = QtGui.QGridLayout(self.centralwidget) self.verticalLayout = QtGui.QVBoxLayout() self.gridLayout = QtGui.QGridLayout() self.title_0 = QtGui.QLabel(self.centralwidget) self.font = QtGui.QFont() self.font.setFamily("AlMateen") self.font.setWeight(75) self.font.setBold(True) self.title_0.setFont(self.font) self.title_0.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing |QtCore.Qt.AlignVCenter) self.gridLayout.addWidget(self.title_0, 0, 0, 1, 1) spacerItem = QtGui.QSpacerItem(108, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) self.gridLayout.addItem(spacerItem, 0, 1, 1, 1) self.label_0 = QtGui.QLabel(self.centralwidget) self.label_0.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing |QtCore.Qt.AlignVCenter) self.gridLayout.addWidget(self.label_0, 1, 0, 1, 1) self.class_meca_cmb = QtGui.QComboBox(self.centralwidget) self.gridLayout.addWidget(self.class_meca_cmb, 1, 1, 1, 1) self.label_1 = QtGui.QLabel(self.centralwidget) self.label_1.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing |QtCore.Qt.AlignVCenter) self.gridLayout.addWidget(self.label_1, 2, 0, 1, 1) self.base_spb = QtGui.QSpinBox(self.centralwidget) self.base_spb.setMaximum(9000000) self.gridLayout.addWidget(self.base_spb, 2, 1, 1, 1) self.label_2 = QtGui.QLabel(self.centralwidget) self.label_2.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing |QtCore.Qt.AlignVCenter) self.gridLayout.addWidget(self.label_2, 3, 0, 1, 1) self.height_spb = QtGui.QSpinBox(self.centralwidget) self.height_spb.setMaximum(9000000) self.gridLayout.addWidget(self.height_spb, 3, 1, 1, 1) self.label_3 = QtGui.QLabel(self.centralwidget) self.label_3.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing |QtCore.Qt.AlignVCenter) self.gridLayout.addWidget(self.label_3, 4, 0, 1, 1) self.ft_lbl = QtGui.QLabel(self.centralwidget) self.gridLayout.addWidget(self.ft_lbl, 4, 1, 1, 1) self.label_4 = QtGui.QLabel(self.centralwidget) self.label_4.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing |QtCore.Qt.AlignVCenter) self.gridLayout.addWidget(self.label_4, 5, 0, 1, 1) self.gm_lbl = QtGui.QLabel(self.centralwidget) self.gridLayout.addWidget(self.gm_lbl, 5, 1, 1, 1) self.label_5 = QtGui.QLabel(self.centralwidget) self.label_5.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing |QtCore.Qt.AlignVCenter) self.gridLayout.addWidget(self.label_5, 6, 0, 1, 1) self.kh_lbl = QtGui.QLabel(self.centralwidget) self.gridLayout.addWidget(self.kh_lbl, 6, 1, 1, 1) self.title_2 = QtGui.QLabel(self.centralwidget) self.title_2.setFont(self.font) self.title_2.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing |QtCore.Qt.AlignVCenter) self.gridLayout.addWidget(self.title_2, 7, 0, 1, 1) spacerItem1 = QtGui.QSpacerItem(108, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) self.gridLayout.addItem(spacerItem1, 7, 1, 1, 1) self.label_8 = QtGui.QLabel(self.centralwidget) self.label_8.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing |QtCore.Qt.AlignVCenter) self.gridLayout.addWidget(self.label_8, 8, 0, 1, 1) self.N_dsb = QtGui.QSpinBox(self.centralwidget) self.N_dsb.setMaximum(999999999) self.gridLayout.addWidget(self.N_dsb, 8, 1, 1, 1) self.label_9 = QtGui.QLabel(self.centralwidget) self.label_9.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing |QtCore.Qt.AlignVCenter) self.label_9.setObjectName("label_9") self.gridLayout.addWidget(self.label_9, 9, 0, 1, 1) self.kmod_dsb = QtGui.QDoubleSpinBox(self.centralwidget) self.kmod_dsb.setMaximum(999999999) self.gridLayout.addWidget(self.kmod_dsb, 9, 1, 1, 1) self.verticalLayout.addLayout(self.gridLayout) self.horizontalLayout = QtGui.QHBoxLayout() self.kh_btn = QtGui.QToolButton(self.centralwidget) self.horizontalLayout.addWidget(self.kh_btn) self.proceed_btn = QtGui.QToolButton(self.centralwidget) self.horizontalLayout.addWidget(self.proceed_btn) self.verticalLayout.addLayout(self.horizontalLayout) self.horizontalLayout_2 = QtGui.QHBoxLayout() self.label_10 = QtGui.QLabel(self.centralwidget) self.horizontalLayout_2.addWidget(self.label_10) self.lineEdit = QtGui.QLineEdit(self.centralwidget) self.horizontalLayout_2.addWidget(self.lineEdit) self.quit_btn = QtGui.QToolButton(self.centralwidget) self.horizontalLayout_2.addWidget(self.quit_btn) self.verticalLayout.addLayout(self.horizontalLayout_2) self.gridLayout_2.addLayout(self.verticalLayout, 0, 0, 1, 1) MainWindow.setCentralWidget(self.centralwidget) self.menubar = QtGui.QMenuBar(MainWindow) self.menubar.setGeometry(QtCore.QRect(0, 0, 350, 25)) MainWindow.setMenuBar(self.menubar) self.statusbar = QtGui.QStatusBar(MainWindow) MainWindow.setStatusBar(self.statusbar) self.retranslate(MainWindow) self.cal = Calcul() self.i_dat = DataImport(self.f_datas) profils = ["Profils ..."] for p in self.i_dat.listmeca: profils.append(p) self.class_meca_cmb.addItems(profils) QtCore.QObject.connect(self.class_meca_cmb, QtCore.SIGNAL ("activated(int)"), self.set_profil) QtCore.QObject.connect(self.base_spb, QtCore.SIGNAL ("valueChanged(int)"), self.change_val) QtCore.QObject.connect(self.height_spb, QtCore.SIGNAL ("valueChanged(int)"), self.change_val) QtCore.QObject.connect(self.kh_btn, QtCore.SIGNAL ("clicked()"), self.kh_value) QtCore.QObject.connect(self.proceed_btn, QtCore.SIGNAL ("clicked()"), self.cal.calcul) QtCore.QObject.connect(self.quit_btn, QtCore.SIGNAL ("clicked()"), exit) def retranslate(self, MainWindow): self.title_0.setText(QtGui.QApplication.translate ("MainWindow", "Définition de l\'élément étudié :", None, QtGui.QApplication.UnicodeUTF8)) self.label_0.setText(QtGui.QApplication.translate ("MainWindow", "Classe mécanique :", None, QtGui.QApplication.UnicodeUTF8)) self.label_1.setText(QtGui.QApplication.translate ("MainWindow", "Base b :", None, QtGui.QApplication.UnicodeUTF8)) self.base_spb.setSuffix(QtGui.QApplication.translate ("MainWindow", " mm", None, QtGui.QApplication.UnicodeUTF8)) self.label_2.setText(QtGui.QApplication.translate ("MainWindow", "Hauteur h :", None, QtGui.QApplication.UnicodeUTF8)) self.height_spb.setSuffix(QtGui.QApplication.translate ("MainWindow", " mm", None, QtGui.QApplication.UnicodeUTF8)) self.label_3.setText(QtGui.QApplication.translate ("MainWindow", "ft, O, k :", None, QtGui.QApplication.UnicodeUTF8)) self.label_4.setText(QtGui.QApplication.translate ("MainWindow", "gM :", None, QtGui.QApplication.UnicodeUTF8)) self.label_5.setText(QtGui.QApplication.translate ("MainWindow", "Kh :", None, QtGui.QApplication.UnicodeUTF8)) self.title_2.setText(QtGui.QApplication.translate ("MainWindow", "Définition de l\'effort :", None, QtGui.QApplication.UnicodeUTF8)) self.label_8.setText(QtGui.QApplication.translate ("MainWindow", "N :", None, QtGui.QApplication.UnicodeUTF8)) self.N_dsb.setSuffix(QtGui.QApplication.translate ("MainWindow", " N", None, QtGui.QApplication.UnicodeUTF8)) self.label_9.setText(QtGui.QApplication.translate ("MainWindow", "kmod :", None, QtGui.QApplication.UnicodeUTF8)) self.kh_btn.setText(QtGui.QApplication.translate ("MainWindow", "kh ?", None, QtGui.QApplication.UnicodeUTF8)) self.proceed_btn.setText(QtGui.QApplication.translate ("MainWindow", "Calculer", None, QtGui.QApplication.UnicodeUTF8)) self.label_10.setText(QtGui.QApplication.translate ("MainWindow", "Taux de travail :", None, QtGui.QApplication.UnicodeUTF8)) self.quit_btn.setText(QtGui.QApplication.translate ("MainWindow", "Quitter", None, QtGui.QApplication.UnicodeUTF8)) def set_profil(self, idx): if idx: self.ft0k = eval(self.i_dat.get_value(idx, "ftok")) self.ft_lbl.setFont(self.font) self.ft_lbl.setText("".join([str(self.ft0k), " Mpa"])) self.gM = eval(self.i_dat.get_value(idx, "gM")) self.gm_lbl.setFont(self.font) self.gm_lbl.setText(str(self.gM)) self.kh_lbl.setText("") def change_val(self, v): self.base = self.base_spb.value() self.height = self.height_spb.value() self.kh_lbl.setText("") def kh_value(self): if self.gM and self.height: if self.gM == 1.3: if self.height >= 150: self.kh=1.0 elif self.height > 0 : kh = (150 / self.height) kh = pow(kh, 0.2) kh = min(1.3, kh) self.kh = (int(kh * 100)) / 100.0 else : self.statusbar.showMessage(u"Entrée incorrecte : Hauteur") return elif self.gM == 1.25: if self.height >= 600: self.kh = 1.0 elif self.height > 0 : kh = pow(600 / self.height, 0.1) kh = min(1.1, kh) self.kh = (int(kh * 100)) / 100.0 else : self.statusbar.showMessage(u"Entrée incorrecte : Hauteur") return self.kh_lbl.setFont(self.font) self.kh_lbl.setText(str(self.kh)) class DataImport(object): def __init__(self, datas): xmldoc = minidom.parse(datas) self.reflist = xmldoc.getElementsByTagName('profil') self.listmeca = [ligneX.attributes["id"].value for ligneX in self.reflist] def get_value(self, idx, d) : ligneX = self.reflist[idx] valeur_symbole = ligneX.attributes[d] valeur_symbole = valeur_symbole.value valeur_symbole = valeur_symbole.encode('utf-8') return valeur_symbole class Calcul(object): def __init__(self): pass def calcul(self): effort = float(gui.N_dsb.value()) Kmod = float(gui.kmod_dsb.value()) if effort and Kmod and gui.base and gui.height and gui.ft0k: aire = gui.base * gui.height st0d = effort / aire print type(gui.ft0k), type(gui.kh), type(Kmod), type(gui.gM) Ft0d = gui.ft0k * gui.kh * Kmod / gui.gM self.travail = (st0d / Ft0d) gui.lineEdit.setText(str(self.travail)) else: gui.statusbar.showMessage(u"Données insufisantes.") if __name__ == "__main__": import sys app = QtGui.QApplication(sys.argv) MainWindow = QtGui.QMainWindow() gui = TopWindow() gui.setup_gui(MainWindow) MainWindow.show() sys.exit(app.exec_()) PyQt 4.4 ou sup. cordialement, vincent Hors ligne peterp@n Re : Idée projet Logiciel RDM Eurocodes Structures Bois, Acier, Béton... Au top cette version ! N'y aurait il pas moyen de séparer interface graphique et programme ? Je m'attaque à un petit script pour définir la charge de neige sur la toiture. Edit : Dans ton script VinsS il faut remplacer : ligne 159 self.label_3.setText(QtGui.QApplication.translate ("MainWindow", "ft, O, k :", None, par self.label_3.setText(QtGui.QApplication.translate ("MainWindow", "ft, 0, k :", None, C'est juste le "O" qu'il faut remplacer par un "0". De plus le "g" de "gM" est en réalité la lettre grec gamma. Si tu sais comment le faire apparaître ainsi, ce serait classe. Dernière modification par Peterpan12 (Le 05/05/2010, à 22:56) Ubuntu 12.04 64bits, Raspbian “wheezy”, Tango Studio sauce debian Un bureau d'études techniques pour le bâtiment avec des logiciels libre. Entreprise de construction bois. - Formations FreeCAD (logiciel 3d) Hors ligne
Have you ever wished that you had a sweet little API to generate HTML in Python? Dominate is probably what you are looking for. Dominate is a Python library for creating and manipulating HTML documents using an elegant DOM API. Now, I’m a self admitted HTML purist, but look at how the dominate API works. from dominate.tags import ul, li list = ul() for item in range(4): list += li('Item #', item) If done correctly HTML generators can blend in with your code nicely. Checkout Dominate the next time you’re looking for a nice native HTML generator API for python. Hogan is a console compiler for Mustache templates, complete with a fantastic name and man page. Aiming not only for speed, Hogan boasts a parser API: var text = "{{^check}}{{i18n}}No{{/i18n}}{{/check}}"; text += "{{#check}}{{i18n}}Yes{{/i18n}}{{/check}}"; var tree = Hogan.parse(Hogan.scan(text)); // outputs "# check" console.log(tree[0].tag + " " + tree[0].name); // outputs "Yes" console.log(tree[1].nodes[0].nodes[0]); Just released on the hub, check the web site for usage. Technologies like Websockets lead us to rethink how we construct our web applications. Model-View-Controller (MVC)-based frameworks have encouraged us to chunk up markup into templates that are served up in response to controller actions. Different approaches for updating application views are emerging as browser clients take on more and more responsibilities. For Node.js applications, LearnBoost has released Nodestream which adds realtime template updating to your application. Take the following Express application snippet and Jade template: // app.js app.get('/', function(req, res){ database.getItems(function(items){ res.render('items.jade', {locals: { items: items }}) }) }) app.post('/save/item', function(req, res){ database.saveItem(req.body, function(){ res.redirect('/'); }) }) // items.jade - each item in items div.item p This is an item titled #{item.title} Nodestream allows your templates to get updated in realtime with Socket.io using Websockets and JavaScript with only a couple of changes. Usage First we need to notify Nodestream of an update, emitting a newitem event when we save an item to the database: database.saveItem(item){ ... nodestream.emit('newitem', item) } … and then hook into that even in our template: :realtime(append: 'newitem', local: 'items', obj: 'item') div.item p This is an item titled #{item.title} Now our views are updated after new items are add, even in multiple tabs! Awesome. Be sure and check the README for full installation instructions and other usage guidelines. [Source on GitHub] If you’ve ever used Jan Lehnardt’s Mustache.js, a port of Chris Wanstrath’s logic-less views project Mustache, be sure and checkout Handlebars.js from Yehuda Katz. Handlebars builds on Mustaches’ namesake {{mustaches}} data binding syntax by adding support for path-based expressions, block helpers, and optimized partial support. Paths Binding deep hashes with Mustache can be cumbersome. Yehuda’s new path-based expressions let you specify XPath-style expressions to bind to values deep within a nested data structure. Given the following data: var data = {"person": { "name": "Alan" }, company: {"name": "Rad, Inc." } }; you could bind to company name with an expression like: {{#person}}{{../company/name}}{{/person}} [Source on GitHub] [Yehuda’s blog ppst]
I want to find out which sql agent jobs failed in last 24 hours... How can I find it using TSQL for SQL 2000? Regards Manjot I want to find out which sql agent jobs failed in last 24 hours... How can I find it using TSQL for SQL 2000? Regards Manjot SELECT j.[name] , jh.run_date , jh.run_time , jh.sql_severity , jh.message FROM msdb.dbo.sysjobhistory jh INNER JOIN msdb.dbo.sysjobs j ON j.job_id = jh.job_id WHERE jh.run_status = 0 -- Failure AND jh.run_date > DATEADD(DAY, -1, GETDATE()) ORDER BY jh.run_date DESC And.... SELECT j.[name] , left(cast(jh.run_date as char(10)),4) + '-' + substring(cast(jh.run_date as char(10)),5,2) + '-' + substring(cast(jh.run_date as char(10)),7,2) + ' ' + substring (right (stuff (' ', 1, 1, '000000') + convert(varchar(6),jh.run_time), 6), 1, 2) + ':' + substring (right (stuff (' ', 1, 1, '000000') + convert(varchar(6), jh.run_time), 6) ,3 ,2) + ':' + substring (right (stuff (' ', 1, 1, '000000') + convert(varchar(6),jh.run_time), 6) ,5 ,2) as [Start_Time] FROM msdb.dbo.sysjobhistory jh INNER JOIN msdb.dbo.sysjobs j ON j.job_id = jh.job_id and jh.step_id = 0 and jh.run_status = 0 and left(cast(jh.run_date as char(10)),4) + '-' + substring(cast(jh.run_date as char(10)),5,2) + '-' + substring(cast(jh.run_date as char(10)),7,2) + ' ' + substring (right (stuff (' ', 1, 1, '000000') + convert(varchar(6),jh.run_time), 6), 1, 2) + ':' + substring (right (stuff (' ', 1, 1, '000000') + convert(varchar(6), jh.run_time), 6) ,3 ,2) + ':' + substring (right (stuff (' ', 1, 1, '000000') + convert(varchar(6),jh.run_time), 6) ,5 ,2) >= CONVERT(char(19), GETDATE()-2, 121)
I've started with matplotlib a week ago; I'm trying to plot the function where I changed my code for from math import* import numpy as np import matplotlib.pyplot as plt def phi(x): return min(ceil(x) - x, x - floor(x)) n=50 def f(x): return sum([phi(x*2.0**i)/(2.0**i) for i in range (1,n)]) t = np.arange(0.0, 3.0, 0.1) plt.plot(t, map(f,t)) plt.show() But it is not working. The error that I'm getting is: File "C:\Documents and Settings\Macedo\Desktop\exem.py", line 15, in <module> plt.plot(t, map(f,t)) File "C:\Python32\lib\site-packages\matplotlib\pyplot.py", line 2459, in plot ret = ax.plot(*args, **kwargs) File "C:\Python32\lib\site-packages\matplotlib\axes.py", line 3850, in plot for line in self._get_lines(*args, **kwargs): File "C:\Python32\lib\site-packages\matplotlib\axes.py", line 325, in _grab_next_args for seg in self._plot_args(remaining, kwargs): File "C:\Python32\lib\site-packages\matplotlib\axes.py", line 302, in _plot_args x, y = self._xy_from_xy(x, y) File "C:\Python32\lib\site-packages\matplotlib\axes.py", line 242, in _xy_from_xy raise ValueError("x and y must have same first dimension") ValueError: x and y must have same first dimension
I once got started on a PyGtk and Glade tutorial but never finished it. Recently I saw that PyGtk is being depreciated in favor of using introspection at https://wiki.ubuntu.com/MeetingLogs/appdevweek1104/GObjectIntrospection and https://wiki.ubuntu.com/MeetingLogs/appdevweek1104/PyGI. I decided to try learning more of python and Gtk again using the new way. The pages I linked to seem to show how you would do it if I wanted to make the GUI in the code, but I like to use Glade. Is there a way to do this and still use the new introspection? Yes, in fact it's almost exactly the same: from gi.repository import Gtk class Test (object): def __init__(self): self.builder = Gtk.Builder() self.builder.add_from_file("test.glade") self.builder.connect_signals(self) def run(self, *args): self.builder.get_object("window1").show() Gtk.main() def quit(self, *args): Gtk.main_quit() Test().run() Many smaller programs will take little effort to convert. You can start by switching to gobject introspection using the following two lines, and then correct any errors by looking them up in the reference. from gi.repository import Gtk as gtk from gi.repository import Gobject as gobject For example, Keep in mind that you need Glade 3.10 or newer to build a GTK 3 interface. 3.8 or older is for GTK 2. In Ubuntu, the packages are called If you need to convert an (old) PyGTK app to PyGI, you should try the pygi-convert script that comes with the PyGObject tarball. In a lot of cases, this should be enough to transform your application. It is also found in GIT: http://git.gnome.org/browse/pygobject/tree/pygi-convert.sh The following link should help too with some basic explanation of the common things that have changed: https://live.gnome.org/PyGObject/IntrospectionPorting And finally, here is an (very nice) effort to create a PyGI tutorial: http://readthedocs.org/docs/python-gtk-3-tutorial/en/latest/index.html I find it usefull to have a look at the C docs when building something: http://developer.gnome.org/gtk3/Once you know how everything is done in Python, this can be a very good resource for things that aren't documented yet. Let's have a look at the gtk.RESPONSE_OK example given in the other answer. When going to the C docs, you'll find this: http://developer.gnome.org/gtk3/3.2/GtkDialog.html#GtkResponseTypeTake the enum name (GtkResponseType) and split the 'Gtk' part by a dot and add the enum type without the GTK_* part, so you'll get:
A different non-regex approach from the others: >>> import string >>> from itertools import groupby >>> >>> special = set(string.punctuation + string.whitespace) >>> s = "One two three tab\ttabandspace\t end" >>> >>> split_combined = [''.join(g) for k, g in groupby(s, lambda c: c in special)] >>> split_combined ['One', ' ', 'two', ' ', 'three', ' ', 'tab', '\t', 'tabandspace', '\t ', 'end'] >>> split_separated = [''.join(g) for k, g in groupby(s, lambda c: c if c in special else False)] >>> split_separated ['One', ' ', 'two', ' ', 'three', ' ', 'tab', '\t', 'tabandspace', '\t', ' ', 'end'] Could use dict.fromkeys and .get instead of the lambda, I guess. [edit] Some explanation: groupby accepts two arguments, an iterable and an (optional) keyfunction. It loops through the iterable and groups them with the value of the keyfunction: >>> groupby("sentence", lambda c: c in 'nt') <itertools.groupby object at 0x9805af4> >>> [(k, list(g)) for k,g in groupby("sentence", lambda c: c in 'nt')] [(False, ['s', 'e']), (True, ['n', 't']), (False, ['e']), (True, ['n']), (False, ['c', 'e'])] where terms with contiguous values of the keyfunction are grouped together. (This is a common source of bugs, actually -- people forget that they have to sort by the keyfunc first if they want to group terms which might not be sequential.) As @JonClements guessed, what I had in mind was >>> special = dict.fromkeys(string.punctuation + string.whitespace, True) >>> s = "One two three tab\ttabandspace\t end" >>> [''.join(g) for k,g in groupby(s, special.get)] ['One', ' ', 'two', ' ', 'three', ' ', 'tab', '\t', 'tabandspace', '\t ', 'end'] for the case where we were combining the separators. .get returns None if the value isn't in the dict.
I'm trying to deploy my first django app on heroku and have been following the guide on the Heroku site. I get all the way to this step of checking to see if the web process is up and it looks like like the app is crashing: (venv)Jonathans-MacBook-Air-2:myportfolio jonathanschen$ heroku ps === web: `python ./manage.py runserver 0.0.0.0:$PORT --noreload` web.1: crashed for 2m When I check my log there's a lot of stuff. I've read some of the different posts on stackoverflow and am wondering whether i need to have a proc file in the root directory (there seems to be conflicting answers)? Could that be whats causing the crash? As always thanks a lot in advance stack overflow. Here is the log: (venv)Jonathans-MacBook-Air-2:myportfolio jonathanschen$ heroku logs 2012-08-01T18:29:55+00:00 app[web.1]: self.fetch_command(subcommand).run_from_argv(self.argv) 2012-08-01T18:29:55+00:00 app[web.1]: File "/app/.heroku/venv/lib/python2.7/site-packages/django/core/management/base.py", line 196, in run_from_argv 2012-08-01T18:29:55+00:00 app[web.1]: self.execute(*args, **options.__dict__) 2012-08-01T18:29:55+00:00 app[web.1]: File "/app/.heroku/venv/lib/python2.7/site-packages/django/core/management/base.py", line 232, in execute 2012-08-01T18:29:55+00:00 app[web.1]: output = self.handle(*args, **options) 2012-08-01T18:29:55+00:00 app[web.1]: File "/app/.heroku/venv/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 69, in handle 2012-08-01T18:29:55+00:00 app[web.1]: self.run(*args, **options) 2012-08-01T18:29:55+00:00 app[web.1]: File "/app/.heroku/venv/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 80, in run 2012-08-01T18:29:55+00:00 app[web.1]: self.inner_run(*args, **options) 2012-08-01T18:29:55+00:00 app[web.1]: File "/app/.heroku/venv/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 91, in inner_run 2012-08-01T18:29:55+00:00 app[web.1]: self.validate(display_num_errors=True) 2012-08-01T18:29:55+00:00 app[web.1]: File "/app/.heroku/venv/lib/python2.7/site-packages/django/core/management/base.py", line 266, in validate 2012-08-01T18:29:55+00:00 app[web.1]: num_errors = get_validation_errors(s, app) 2012-08-01T18:29:55+00:00 app[web.1]: File "/app/.heroku/venv/lib/python2.7/site-packages/django/core/management/validation.py", line 23, in get_validation_errors 2012-08-01T18:29:55+00:00 app[web.1]: from django.db import models, connection 2012-08-01T18:29:55+00:00 app[web.1]: File "/app/.heroku/venv/lib/python2.7/site-packages/django/db/__init__.py", line 40, in <module> 2012-08-01T18:29:55+00:00 app[web.1]: backend = load_backend(connection.settings_dict['ENGINE']) 2012-08-01T18:29:55+00:00 app[web.1]: File "/app/.heroku/venv/lib/python2.7/site-packages/django/db/__init__.py", line 34, in __getattr__ 2012-08-01T18:29:55+00:00 app[web.1]: return getattr(connections[DEFAULT_DB_ALIAS], item) 2012-08-01T18:29:55+00:00 app[web.1]: File "/app/.heroku/venv/lib/python2.7/site-packages/django/db/utils.py", line 92, in __getitem__ 2012-08-01T18:29:55+00:00 app[web.1]: backend = load_backend(db['ENGINE']) 2012-08-01T18:29:55+00:00 app[web.1]: File "/app/.heroku/venv/lib/python2.7/site-packages/django/db/utils.py", line 24, in load_backend 2012-08-01T18:29:55+00:00 app[web.1]: return import_module('.base', backend_name) 2012-08-01T18:29:55+00:00 app[web.1]: File "/app/.heroku/venv/lib/python2.7/site-packages/django/utils/importlib.py", line 34, in import_module 2012-08-01T18:29:55+00:00 app[web.1]: name = _resolve_name(name[level:], package, level) 2012-08-01T18:29:55+00:00 app[web.1]: File "/app/.heroku/venv/lib/python2.7/site-packages/django/utils/importlib.py", line 7, in _resolve_name 2012-08-01T18:29:55+00:00 app[web.1]: raise ValueError("'package' not set to a string") 2012-08-01T18:29:55+00:00 app[web.1]: ValueError: 'package' not set to a string 2012-08-01T18:29:56+00:00 heroku[web.1]: Process exited with status 1 2012-08-01T18:29:56+00:00 heroku[web.1]: State changed from starting to crashed 2012-08-01T18:41:41+00:00 heroku[web.1]: State changed from crashed to starting 2012-08-01T18:41:45+00:00 heroku[web.1]: Starting process with command `python ./manage.py runserver 0.0.0.0:22549 --noreload` 2012-08-01T18:41:46+00:00 app[web.1]: Validating models... 2012-08-01T18:41:46+00:00 app[web.1]: 2012-08-01T18:41:46+00:00 app[web.1]: Traceback (most recent call last): 2012-08-01T18:41:46+00:00 app[web.1]: File "./manage.py", line 10, in <module> 2012-08-01T18:41:46+00:00 app[web.1]: execute_from_command_line(sys.argv) 2012-08-01T18:41:46+00:00 app[web.1]: File "/app/.heroku/venv/lib/python2.7/site-packages/django/core/management/__init__.py", line 443, in execute_from_command_line 2012-08-01T18:41:46+00:00 app[web.1]: File "/app/.heroku/venv/lib/python2.7/site-packages/django/core/management/__init__.py", line 382, in execute 2012-08-01T18:41:46+00:00 app[web.1]: self.fetch_command(subcommand).run_from_argv(self.argv) 2012-08-01T18:41:46+00:00 app[web.1]: utility.execute() 2012-08-01T18:41:46+00:00 app[web.1]: File "/app/.heroku/venv/lib/python2.7/site-packages/django/core/management/base.py", line 196, in run_from_argv 2012-08-01T18:41:46+00:00 app[web.1]: self.execute(*args, **options.__dict__) 2012-08-01T18:41:46+00:00 app[web.1]: File "/app/.heroku/venv/lib/python2.7/site-packages/django/core/management/base.py", line 232, in execute 2012-08-01T18:41:46+00:00 app[web.1]: File "/app/.heroku/venv/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 80, in run 2012-08-01T18:41:46+00:00 app[web.1]: File "/app/.heroku/venv/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 69, in handle 2012-08-01T18:41:46+00:00 app[web.1]: output = self.handle(*args, **options) 2012-08-01T18:41:46+00:00 app[web.1]: self.run(*args, **options) 2012-08-01T18:41:46+00:00 app[web.1]: self.validate(display_num_errors=True) 2012-08-01T18:41:46+00:00 app[web.1]: File "/app/.heroku/venv/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 91, in inner_run 2012-08-01T18:41:46+00:00 app[web.1]: self.inner_run(*args, **options) 2012-08-01T18:41:46+00:00 app[web.1]: File "/app/.heroku/venv/lib/python2.7/site-packages/django/core/management/validation.py", line 23, in get_validation_errors 2012-08-01T18:41:46+00:00 app[web.1]: File "/app/.heroku/venv/lib/python2.7/site-packages/django/db/__init__.py", line 34, in __getattr__ 2012-08-01T18:41:46+00:00 app[web.1]: File "/app/.heroku/venv/lib/python2.7/site-packages/django/db/__init__.py", line 40, in <module> 2012-08-01T18:41:46+00:00 app[web.1]: num_errors = get_validation_errors(s, app) 2012-08-01T18:41:46+00:00 app[web.1]: backend = load_backend(connection.settings_dict['ENGINE']) 2012-08-01T18:41:46+00:00 app[web.1]: from django.db import models, connection 2012-08-01T18:41:46+00:00 app[web.1]: File "/app/.heroku/venv/lib/python2.7/site-packages/django/core/management/base.py", line 266, in validate 2012-08-01T18:41:46+00:00 app[web.1]: return getattr(connections[DEFAULT_DB_ALIAS], item) 2012-08-01T18:41:46+00:00 app[web.1]: File "/app/.heroku/venv/lib/python2.7/site-packages/django/db/utils.py", line 92, in __getitem__ 2012-08-01T18:41:46+00:00 app[web.1]: backend = load_backend(db['ENGINE']) 2012-08-01T18:41:46+00:00 app[web.1]: File "/app/.heroku/venv/lib/python2.7/site-packages/django/db/utils.py", line 24, in load_backend 2012-08-01T18:41:46+00:00 app[web.1]: return import_module('.base', backend_name) 2012-08-01T18:41:46+00:00 app[web.1]: File "/app/.heroku/venv/lib/python2.7/site-packages/django/utils/importlib.py", line 34, in import_module 2012-08-01T18:41:46+00:00 app[web.1]: name = _resolve_name(name[level:], package, level) 2012-08-01T18:41:46+00:00 app[web.1]: File "/app/.heroku/venv/lib/python2.7/site-packages/django/utils/importlib.py", line 7, in _resolve_name 2012-08-01T18:41:46+00:00 app[web.1]: raise ValueError("'package' not set to a string") 2012-08-01T18:41:46+00:00 app[web.1]: ValueError: 'package' not set to a string 2012-08-01T18:41:47+00:00 heroku[web.1]: Process exited with status 1 2012-08-01T18:41:47+00:00 heroku[web.1]: State changed from starting to crashed 2012-08-01T18:46:00+00:00 heroku[slugc]: Slug compilation started 2012-08-01T18:48:55+00:00 heroku[api]: Release v5 created by [email protected] 2012-08-01T18:48:55+00:00 heroku[api]: Deploy f097e62 by [email protected] 2012-08-01T18:48:55+00:00 heroku[web.1]: State changed from crashed to starting 2012-08-01T18:48:56+00:00 heroku[slugc]: Slug compilation finished 2012-08-01T18:48:58+00:00 heroku[web.1]: Starting process with command `python ./manage.py runserver 0.0.0.0:23141 --noreload` 2012-08-01T18:48:59+00:00 app[web.1]: Traceback (most recent call last): 2012-08-01T18:48:59+00:00 app[web.1]: File "./manage.py", line 10, in <module> 2012-08-01T18:48:59+00:00 app[web.1]: execute_from_command_line(sys.argv) 2012-08-01T18:48:59+00:00 app[web.1]: File "/app/.heroku/venv/lib/python2.7/site-packages/django/core/management/__init__.py", line 443, in execute_from_command_line 2012-08-01T18:48:59+00:00 app[web.1]: utility.execute() 2012-08-01T18:48:59+00:00 app[web.1]: File "/app/.heroku/venv/lib/python2.7/site-packages/django/core/management/__init__.py", line 382, in execute 2012-08-01T18:48:59+00:00 app[web.1]: File "/app/.heroku/venv/lib/python2.7/site-packages/django/core/management/__init__.py", line 252, in fetch_command 2012-08-01T18:48:59+00:00 app[web.1]: self.fetch_command(subcommand).run_from_argv(self.argv) 2012-08-01T18:48:59+00:00 app[web.1]: File "/app/.heroku/venv/lib/python2.7/site-packages/django/conf/__init__.py", line 42, in _setup 2012-08-01T18:48:59+00:00 app[web.1]: File "/app/.heroku/venv/lib/python2.7/site-packages/django/core/management/__init__.py", line 101, in get_commands 2012-08-01T18:48:59+00:00 app[web.1]: app_name = get_commands()[subcommand] 2012-08-01T18:48:59+00:00 app[web.1]: apps = settings.INSTALLED_APPS 2012-08-01T18:48:59+00:00 app[web.1]: File "/app/.heroku/venv/lib/python2.7/site-packages/django/utils/functional.py", line 184, in inner 2012-08-01T18:48:59+00:00 app[web.1]: mod = importlib.import_module(self.SETTINGS_MODULE) 2012-08-01T18:48:59+00:00 app[web.1]: self._wrapped = Settings(settings_module) 2012-08-01T18:48:59+00:00 app[web.1]: File "/app/.heroku/venv/lib/python2.7/site-packages/django/utils/importlib.py", line 35, in import_module 2012-08-01T18:48:59+00:00 app[web.1]: self._setup() 2012-08-01T18:48:59+00:00 app[web.1]: ^ 2012-08-01T18:48:59+00:00 app[web.1]: File "/app/.heroku/venv/lib/python2.7/site-packages/django/conf/__init__.py", line 93, in __init__ 2012-08-01T18:48:59+00:00 app[web.1]: File "/app/myportfolio/settings.py", line 23 2012-08-01T18:48:59+00:00 app[web.1]: SyntaxError: invalid syntax 2012-08-01T18:48:59+00:00 app[web.1]: __import__(name) 2012-08-01T18:48:59+00:00 app[web.1]: } 2012-08-01T18:49:00+00:00 heroku[web.1]: Process exited with status 1 2012-08-01T18:49:00+00:00 heroku[web.1]: State changed from starting to crashed (venv)Jonathans-MacBook-Air-2:myportfolio jonathanschen$ heroku ps === web: `python ./manage.py runserver 0.0.0.0:$PORT --noreload` web.1: crashed for 1m (venv)Jonathans-MacBook-Air-2:myportfolio jonathanschen$ heroku ps === web: `python ./manage.py runserver 0.0.0.0:$PORT --noreload` web.1: crashed for 2m (venv)Jonathans-MacBook-Air-2:myportfolio jonathanschen$ heroku logs 2012-08-01T18:29:55+00:00 app[web.1]: ValueError: 'package' not set to a string 2012-08-01T18:29:56+00:00 heroku[web.1]: Process exited with status 1 2012-08-01T18:29:56+00:00 heroku[web.1]: State changed from starting to crashed 2012-08-01T18:41:41+00:00 heroku[web.1]: State changed from crashed to starting 2012-08-01T18:41:45+00:00 heroku[web.1]: Starting process with command `python ./manage.py runserver 0.0.0.0:22549 --noreload` 2012-08-01T18:41:46+00:00 app[web.1]: Validating models... 2012-08-01T18:41:46+00:00 app[web.1]: 2012-08-01T18:41:46+00:00 app[web.1]: Traceback (most recent call last): 2012-08-01T18:41:46+00:00 app[web.1]: File "./manage.py", line 10, in <module> 2012-08-01T18:41:46+00:00 app[web.1]: execute_from_command_line(sys.argv) 2012-08-01T18:41:46+00:00 app[web.1]: File "/app/.heroku/venv/lib/python2.7/site-packages/django/core/management/__init__.py", line 443, in execute_from_command_line 2012-08-01T18:41:46+00:00 app[web.1]: File "/app/.heroku/venv/lib/python2.7/site-packages/django/core/management/__init__.py", line 382, in execute 2012-08-01T18:41:46+00:00 app[web.1]: self.fetch_command(subcommand).run_from_argv(self.argv) 2012-08-01T18:41:46+00:00 app[web.1]: utility.execute() 2012-08-01T18:41:46+00:00 app[web.1]: File "/app/.heroku/venv/lib/python2.7/site-packages/django/core/management/base.py", line 196, in run_from_argv 2012-08-01T18:41:46+00:00 app[web.1]: self.execute(*args, **options.__dict__) 2012-08-01T18:41:46+00:00 app[web.1]: File "/app/.heroku/venv/lib/python2.7/site-packages/django/core/management/base.py", line 232, in execute 2012-08-01T18:41:46+00:00 app[web.1]: File "/app/.heroku/venv/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 80, in run 2012-08-01T18:41:46+00:00 app[web.1]: File "/app/.heroku/venv/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 69, in handle 2012-08-01T18:41:46+00:00 app[web.1]: output = self.handle(*args, **options) 2012-08-01T18:41:46+00:00 app[web.1]: self.run(*args, **options) 2012-08-01T18:41:46+00:00 app[web.1]: self.validate(display_num_errors=True) 2012-08-01T18:41:46+00:00 app[web.1]: File "/app/.heroku/venv/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 91, in inner_run 2012-08-01T18:41:46+00:00 app[web.1]: self.inner_run(*args, **options) 2012-08-01T18:41:46+00:00 app[web.1]: File "/app/.heroku/venv/lib/python2.7/site-packages/django/core/management/validation.py", line 23, in get_validation_errors 2012-08-01T18:41:46+00:00 app[web.1]: File "/app/.heroku/venv/lib/python2.7/site-packages/django/db/__init__.py", line 34, in __getattr__ 2012-08-01T18:41:46+00:00 app[web.1]: File "/app/.heroku/venv/lib/python2.7/site-packages/django/db/__init__.py", line 40, in <module> 2012-08-01T18:41:46+00:00 app[web.1]: num_errors = get_validation_errors(s, app) 2012-08-01T18:41:46+00:00 app[web.1]: backend = load_backend(connection.settings_dict['ENGINE']) 2012-08-01T18:41:46+00:00 app[web.1]: from django.db import models, connection 2012-08-01T18:41:46+00:00 app[web.1]: File "/app/.heroku/venv/lib/python2.7/site-packages/django/core/management/base.py", line 266, in validate 2012-08-01T18:41:46+00:00 app[web.1]: return getattr(connections[DEFAULT_DB_ALIAS], item) 2012-08-01T18:41:46+00:00 app[web.1]: File "/app/.heroku/venv/lib/python2.7/site-packages/django/db/utils.py", line 92, in __getitem__ 2012-08-01T18:41:46+00:00 app[web.1]: backend = load_backend(db['ENGINE']) 2012-08-01T18:41:46+00:00 app[web.1]: File "/app/.heroku/venv/lib/python2.7/site-packages/django/db/utils.py", line 24, in load_backend 2012-08-01T18:41:46+00:00 app[web.1]: return import_module('.base', backend_name) 2012-08-01T18:41:46+00:00 app[web.1]: File "/app/.heroku/venv/lib/python2.7/site-packages/django/utils/importlib.py", line 34, in import_module 2012-08-01T18:41:46+00:00 app[web.1]: name = _resolve_name(name[level:], package, level) 2012-08-01T18:41:46+00:00 app[web.1]: File "/app/.heroku/venv/lib/python2.7/site-packages/django/utils/importlib.py", line 7, in _resolve_name 2012-08-01T18:41:46+00:00 app[web.1]: raise ValueError("'package' not set to a string") 2012-08-01T18:41:46+00:00 app[web.1]: ValueError: 'package' not set to a string 2012-08-01T18:41:47+00:00 heroku[web.1]: Process exited with status 1 2012-08-01T18:41:47+00:00 heroku[web.1]: State changed from starting to crashed 2012-08-01T18:46:00+00:00 heroku[slugc]: Slug compilation started 2012-08-01T18:48:55+00:00 heroku[api]: Release v5 created by [email protected] 2012-08-01T18:48:55+00:00 heroku[api]: Deploy f097e62 by [email protected] 2012-08-01T18:48:55+00:00 heroku[web.1]: State changed from crashed to starting 2012-08-01T18:48:56+00:00 heroku[slugc]: Slug compilation finished 2012-08-01T18:48:58+00:00 heroku[web.1]: Starting process with command `python ./manage.py runserver 0.0.0.0:23141 --noreload` 2012-08-01T18:48:59+00:00 app[web.1]: Traceback (most recent call last): 2012-08-01T18:48:59+00:00 app[web.1]: File "./manage.py", line 10, in <module> 2012-08-01T18:48:59+00:00 app[web.1]: execute_from_command_line(sys.argv) 2012-08-01T18:48:59+00:00 app[web.1]: File "/app/.heroku/venv/lib/python2.7/site-packages/django/core/management/__init__.py", line 443, in execute_from_command_line 2012-08-01T18:48:59+00:00 app[web.1]: utility.execute() 2012-08-01T18:48:59+00:00 app[web.1]: File "/app/.heroku/venv/lib/python2.7/site-packages/django/core/management/__init__.py", line 382, in execute 2012-08-01T18:48:59+00:00 app[web.1]: File "/app/.heroku/venv/lib/python2.7/site-packages/django/core/management/__init__.py", line 252, in fetch_command 2012-08-01T18:48:59+00:00 app[web.1]: self.fetch_command(subcommand).run_from_argv(self.argv) 2012-08-01T18:48:59+00:00 app[web.1]: File "/app/.heroku/venv/lib/python2.7/site-packages/django/conf/__init__.py", line 42, in _setup 2012-08-01T18:48:59+00:00 app[web.1]: File "/app/.heroku/venv/lib/python2.7/site-packages/django/core/management/__init__.py", line 101, in get_commands 2012-08-01T18:48:59+00:00 app[web.1]: app_name = get_commands()[subcommand] 2012-08-01T18:48:59+00:00 app[web.1]: apps = settings.INSTALLED_APPS 2012-08-01T18:48:59+00:00 app[web.1]: File "/app/.heroku/venv/lib/python2.7/site-packages/django/utils/functional.py", line 184, in inner 2012-08-01T18:48:59+00:00 app[web.1]: mod = importlib.import_module(self.SETTINGS_MODULE) 2012-08-01T18:48:59+00:00 app[web.1]: self._wrapped = Settings(settings_module) 2012-08-01T18:48:59+00:00 app[web.1]: File "/app/.heroku/venv/lib/python2.7/site-packages/django/utils/importlib.py", line 35, in import_module 2012-08-01T18:48:59+00:00 app[web.1]: self._setup() 2012-08-01T18:48:59+00:00 app[web.1]: ^ 2012-08-01T18:48:59+00:00 app[web.1]: File "/app/.heroku/venv/lib/python2.7/site-packages/django/conf/__init__.py", line 93, in __init__ 2012-08-01T18:48:59+00:00 app[web.1]: File "/app/myportfolio/settings.py", line 23 2012-08-01T18:48:59+00:00 app[web.1]: SyntaxError: invalid syntax 2012-08-01T18:48:59+00:00 app[web.1]: __import__(name) 2012-08-01T18:48:59+00:00 app[web.1]: } 2012-08-01T18:49:00+00:00 heroku[web.1]: Process exited with status 1 2012-08-01T18:49:00+00:00 heroku[web.1]: State changed from starting to crashed 2012-08-01T19:03:18+00:00 heroku[web.1]: State changed from crashed to starting 2012-08-01T19:03:21+00:00 heroku[web.1]: Starting process with command `python ./manage.py runserver 0.0.0.0:20934 --noreload` 2012-08-01T19:03:22+00:00 app[web.1]: Traceback (most recent call last): 2012-08-01T19:03:22+00:00 app[web.1]: File "./manage.py", line 10, in <module> 2012-08-01T19:03:22+00:00 app[web.1]: File "/app/.heroku/venv/lib/python2.7/site-packages/django/core/management/__init__.py", line 443, in execute_from_command_line 2012-08-01T19:03:22+00:00 app[web.1]: File "/app/.heroku/venv/lib/python2.7/site-packages/django/core/management/__init__.py", line 382, in execute 2012-08-01T19:03:22+00:00 app[web.1]: execute_from_command_line(sys.argv) 2012-08-01T19:03:22+00:00 app[web.1]: utility.execute() 2012-08-01T19:03:22+00:00 app[web.1]: self.fetch_command(subcommand).run_from_argv(self.argv) 2012-08-01T19:03:22+00:00 app[web.1]: File "/app/.heroku/venv/lib/python2.7/site-packages/django/core/management/__init__.py", line 252, in fetch_command 2012-08-01T19:03:22+00:00 app[web.1]: app_name = get_commands()[subcommand] 2012-08-01T19:03:22+00:00 app[web.1]: File "/app/.heroku/venv/lib/python2.7/site-packages/django/core/management/__init__.py", line 101, in get_commands 2012-08-01T19:03:22+00:00 app[web.1]: apps = settings.INSTALLED_APPS 2012-08-01T19:03:22+00:00 app[web.1]: self._setup() 2012-08-01T19:03:22+00:00 app[web.1]: File "/app/.heroku/venv/lib/python2.7/site-packages/django/utils/functional.py", line 184, in inner 2012-08-01T19:03:22+00:00 app[web.1]: File "/app/.heroku/venv/lib/python2.7/site-packages/django/conf/__init__.py", line 42, in _setup 2012-08-01T19:03:22+00:00 app[web.1]: self._wrapped = Settings(settings_module) 2012-08-01T19:03:22+00:00 app[web.1]: File "/app/.heroku/venv/lib/python2.7/site-packages/django/conf/__init__.py", line 93, in __init__ 2012-08-01T19:03:22+00:00 app[web.1]: mod = importlib.import_module(self.SETTINGS_MODULE) 2012-08-01T19:03:22+00:00 app[web.1]: File "/app/.heroku/venv/lib/python2.7/site-packages/django/utils/importlib.py", line 35, in import_module 2012-08-01T19:03:22+00:00 app[web.1]: File "/app/myportfolio/settings.py", line 23 2012-08-01T19:03:22+00:00 app[web.1]: ^ 2012-08-01T19:03:22+00:00 app[web.1]: SyntaxError: invalid syntax 2012-08-01T19:03:22+00:00 app[web.1]: __import__(name) 2012-08-01T19:03:22+00:00 app[web.1]: } 2012-08-01T19:03:23+00:00 heroku[web.1]: Process exited with status 1 2012-08-01T19:03:24+00:00 heroku[web.1]: State changed from starting to crashed
I had the following code that works fine with python 2.7+ class Worker(threading.Thread): def __init__(self, group=None, target=None, name=None, args=(), kwargs=None, verbose=None, onCompleteCb=None): self.__onCompleteCb = onCompleteCb self.__name = name super(Worker, self).__init__(group, target, name, args, kwargs, verbose) def getName(self): return self.__name def run(self): try: super(Worker, self).run() if self.__onCompleteCb is not None: self.__onCompleteCb(self.__name) except Exception, e: if self.__onCompleteCb is not None: self.__onCompleteCb(self.__name, failed=True, exception=e) But I found out recently my code should support versions starting from 2.4: In the above code, run gets called but when it calls super(Worker, self).run(), I see the following error TypeError: threadTargMethod() argument after ** must be a dictionary Should I call super differently in python 2.4? Solution I have to start the thread in the following way: Worker(target=threadTargMethod, name="thread1", args=(), kwargs={}).start() In v2.7 I was starting the following way and it works Worker(target=threadTargMethod, name="thread1").start()
Use crons to schedule tasks to run periodically at specific times and dates. Crons can be triggered as often as every minute, and there’s no limit to the number of functions you can register as crons. Everytime your cron is triggered by its schedule, a job is created and added to the queue. This does not mean that your job is processed immediately, as can be seen when Alice or Bob has a job in the queue before your job. If you need your cron job to execute immediately once triggered, you can activate a single realtime core to guarantee that a core is always available. # import our Python client import cloud # register a cron that runs every minute cloud.cron.register(ping_webserver, 'heartbeat', '* * * * *') There are no additional charges for using crons. However, you are charged for the compute time and data transfer costs of your scheduled functions at the standard rate found on our pricing page. Schedules are specified using a BSD-style cron timestamp. The full format can be found here. The smallest period allowed is once a minute. No. When a cron is triggered, a new task is created and added to the queue. If you have realtime cores available, the task will immediately begin running. Otherwise, it will depend on how long it takes for your job to be assigned to a free core.
One of the big topics in the BigData community is Map/Reduce. There are a lot of good blogs that explain what Map/Reduce does and how it works logically, so I won’t repeat it (look here, here and here for a few). Very few of them however explain the technical flow of things, which I at least need, to understand the performance implications. You can always throw more hardware at a map reduce job to improve the overall time. I don’t like that as a general solution and many Map/Reduce programs can be optimized quite easily, if you know what too look for. And optimizing a large map/reduce jobs can be instantly translated into ROI! The Word Count Example I went over some blogs and tutorials about performance of Map/Reduce. Here is one that I liked. While there are a lot of good tips out there, none, except the one mentioned, talk about the Map/Reduce program itself. Most dive right into the various hadoop options to improve distribution and utilization. While this is important, I think we should start the actual problem we try to solve, that means the Map/Reduce Job. To make things simple I am using Amazons Elastic Map Reduce. In my setup I started a new Job Flow with multiple steps for every execution. The Job Flow consisted of one master node and two task nodes. All of them were using the Small Standard instance. While AWS Elastic Map/Reduce has its drawbacks in terms of startup and file latency (Amazon S3 has a high volatility), it is a very easy and consistent way to execute Map/Reduce jobs without needing to setup your own hadoop cluster. And you only pay for what you need! I started out with the word count example that you see in every map reduce documentation, tutorial or Blog. The result of the job always produces files that look something like this: the: 5967 all: 611 a: 21586 That idea is to count the occurrence of every word in a large number of text files. I processed around 30 files totaling somewhere around 200MB in size. I ran the original python version and then made a very small change to it. Without touching the configuration of hadoop I cut the execution time in half: The Original Code: #!/usr/bin/python import sys import re def main(argv): line = sys.stdin.readline() pattern = re.compile("[a-zA-Z][a-zA-Z0-9]*") try: while line: for word in pattern.findall(line): print "LongValueSum:" + word.lower() + "\t" + "1" line = sys.stdin.readline() except "end of file": return None if __name__ == "__main__": main(sys.argv) The Optimized Code: #!/usr/bin/python import sys import re def main(argv): line = sys.stdin.readline() pattern = re.compile("[a-zA-Z][a-zA-Z0-9]*") map = dict() try: while line: for word in pattern.findall(line): map[word.lower()] = map.get(word.lower(), 0) + 1 if ( len(map) > 10000 ): for item in map.iteritems(): print "LongValueSum:" + item[0] + "\t" + str(item[1]) map.clear() line = sys.stdin.readline() for item in map.iteritems(): print "LongValueSum:" + item[0] + "\t" + str(item[1]) except "end of file": return None if __name__ == "__main__": main(sys.argv) Instead of “emitting” every word with value 1 to the OutputCollector, I did an internal reduce before emitting it. The result is that instead of emitted the word ‘a’ 1000 times with value 1, I emitted it 1 time with value 1000. The end result of the job is the same, but in half the time. To understand this we need to look at the execution flow of map reduce. Execution Path and Distribution Elastic Map Reduce first schedules a Map Task task per file (or parts of the file). It then feeds each line of the file into the map function. The map function will emit each key/value, in this case each word of the line, to the OutputCollector. Each emitted key/value will be written to an intermediate file for later reduce. The Shuffle Process will make sure that each key, in this case each word, will be sent to the same reduce task (meaning hadoop node) for aggregation. If we emit the same word multiple times it also needs to be written and sent multiple times, which results in more I/O (disk and network). The logical conclusion is that we should „pre-reduce“ this on a per task node basis and send the minimal amount of data. This is what the Combiner is for, which is really a Reducer that is run locally on the same node after the Mapping. So we should be fine, right? Not really. Inside of Amazons Elastic Map Reduce To get a better idea of where I spent the time, I deployed dynaTrace into Amazons Map Reduce environment. This can be done fully automated with a simple bootstrap action (I will publish the result as a Fastpack on our community at a later time). The original python run lasted roughly 5 minutes each run (between 290 and 320 seconds), while the optimized ran around 3 minutes (160-170 seconds). I used dynaTrace to split those run times into their different components to get a feel for where we spend time. Some numbers have a rather high volatility which, as I found out, is due to Amazon S3 and to a smaller degree garbage collection. I executed it several times and the volatility did not have a big impact on the overall job execution time. The next thing we see is that the combine time has dropped dramatically, we could say it nearly vanished! That makes sense after all we were making sure that we emitted less duplicates, thus less to combine. In fact it might make sense to stop combining at all as we will see later on. Another item that has dramatically improved is the sort. Again that makes a lot of sense, less data to sort. While the majority of the combine and sort happens in a separate thread, it still saves a lot of CPU and I/O time! On the other hand neither shuffle nor reduce time itself have changed really. I identified the fluctuations the table does show, as being AWS S3 volatility issues via a hotspot analysis, so I ignored them. The fact that we see no significant improvements here makes sense. The resulting intermediate files of each map task do not look much different, whether we combine or use the optimized code. So it really was the optimization of the map operation itself, that lead to overall improvement in job run time. While I might have achieved the same goal by doubling the number of map nodes, it would cost me more to do so. What happens during mapping To understand why that simple change has such a large impact we need to look at what happens to emitted keys in a Map Job. What most Map/Reduce tutorials forget to mention is that the collect method called by the Mapper serializes the key/value directly to an in-memory buffer, as can be seen in the diagram above and the hotspot below. Once that buffer has reached a certain saturation, the Spill Thread kicks in and writes the data to an intermediate file (this is controlled by several io.sort.spill. options). Map/Reduce normally deals with a large amount of potentially never repeating data, so it has to spill to file eventually. It is not enough to simple dump the data to file, the content has to be sorted and combined first. The sort is a preparation for the shuffle process and relative efficient (it sorts based on binary bytes, because the actual order is not important). The combine however needs to de-serialize the key and values again prior to writing. So emitting a key multiple times has a direct negative impact on the map time and CPU usage, due to more serialization an indirect negative impact on CPU due to more spilling and additional deserialization in the combine step a direct impact on the map task, due to more intermediate files, which makes the final merge more expensive Slower mapping obviously impacts the overall Job time directly. The more data we emit, the more CPU and I/O is consumed by the Spill Thread. If the SpillThread is too slow (e.g. expensive combine, slow disk), the in memory buffer might get fully saturated, in which case the map task has to wait (this can be improved by adjusting the io.sort.spill.percent hadoop option). Finally after the Map Task finishes the actual mapping, it writes, sorts and combines the remaining data to file. Finally it merges all intermediate files into a single output file (which it might combine again). More emitted key’s thus mean more intermediate files to merge as well. While the final flush only “slows” us down for 1.5 seconds, this still amounts to roughly 8 percent of the Mapper task. So we see it really does make a lot of sense to optimize the output of the map operation, prior to the combine or reduce step. It will save CPU, Disk and Network I/O and this of course means less Nodes are needed for the same work! The one million X factor Until now I have tried to explain the I/O and CPU implications of emitting many keys, but there is also another factor that should be considered when writing Map/Reduce jobs. The map function is executed potentially millions of times. Every ms consumed here can potentially lead to minutes in job time. Indeed most of the gain of my “optimization” came from speeding up the mapping itself and not from more effective combine and disk writes. On average each map method call had a little less to do and that paid off. What that struck me when looking at Map/Reduce first, was that most samples and tutorials use scripting languages like python, perl or something else. This is realized via the Hadoop Streaming framework. While I understand that this lowers the barrier to write Map/Reduce jobs, it should not be used for serious tasks! To illustrate this I ran a randomly selected java version of the Word Count sample. The result is another 50-60% improvement on top of the optimized python (it might be even better, in a larger task). The table shows the various execution times for: Optimized Java: ~1.5 minutes job execution time The same trick as in python, if anybody really wants to have the code, it let me know. Optimized Java with no Combiner: roughly 10 seconds faster than the optimized one As pointed out the pre-reduce in the map method makes the combine nearly redundant. The improvement in overall job time is minimal however due to the smallness of the job. Original Java: ~2.5 minutes We see that all the times (mapping, combining, sorting, spilling) are a lot higher, as we came to expect Optimized Python: ~3 minutes Non-optimized python: ~5 minutes Java is faster than Python every time and the optimized version of Java is twice as fast as the optimized python version. Remember that this is a small example and that the hadoop parameters are the same for all runs . In addition CPU was never a limiting factor. If you execute the same small code millions of times, even small differences matter. The difference between a single line mapped in java and python is maybe not even measurable. With 200 MB of text it adds up to more than a minute! The same would be true for small changes in any java Map/Reduce job. The difference between the original and the optimized java version is still more than 60% improvement! Conclusion Map Reduce is a very powerful and elegant way to distribute processing of large amounts of data across many hosts. It is also a bit of a brute and it pays of to analyze and optimize the performance of the map and reduce tasks before we start playing with hadoop options. While Map/Reduce can reduce the job time by throwing more hardware the problem, easy optimizations often reach a similar effect. In the cloud and AWS Elastic Map Reduce that means less cost!
Okay, here is the problem: Certain questions contain more than one page's worth of answers. Given a sort method and an answer id, how can we figure out which page the answer is on? Any suggestions are welcome. These are two simple methods in meta-language: 1. Pulls a pagesize number of answers, page after page, checking the presence of the given accepted_answer_id def get_accepted_answer_page(question_id, answer_id, sort, pagesize): page = 1 while(True): answers_page_ids = get_answers_ids_with_API_method(question_id, sort, page, pagesize) if accepted_answer_id in answers_page_ids : return page else: page ++ 2. Pulls all the answers ids using the fastest/lightest API method (questions/id/answers, pagesize=100, body=false..), get the index of the accepted_answer_id on this list and finally find the page dividing accepted_answer_id position by the pagesize def get_accepted_answer_page(question_id, answer_id, sort, pagesize): answers_ids = get_all_answers_ids_with_the_fastest_lightest_API_method(question_id, sort) accepted_answer_id_position = get_accepted_answer_index (answers_ids) + 1 accepted_answer_page = (accepted_answer_id_position / pagesize) +1 if accepted_answer_id_index MOD pagesize == 0 : accepted_answer_page -- return accepted_answer_page My 0.02c Why go through the question to get an answer you already have? You have an answer id, so you can get all of its information. I suppose you could pull all answers from a question and store them in a list is a static sorted order. Then, you would know the page the answer is on given the entire list. It is far less memory efficient, but it will be much easier to figure out.
Three months ago, I wrote a post detailing the process of writing a calculator using a parsing library. The popular response, however, was that readers are far more curious about seeing a calculator written from scratch, with the batteries included but nothing else. I figured, why not? Writing a calculator is simple, if you use hacks specific to arithmetic expressions, but the effect of hacks is nearly always the same: the solution isn't elegant, it's not extendable, and it's hard to understand intuitively. In my appreciation of a good challenge, and my aim at a beneficial post, I decided to write it using a mostly generic recursive-descent parser. In the same spirit as last time, I wanted to do it in as few lines as I reasonably can, so it's filled with hacks and tricks, but they're superficial and not specific to the task at hand. This post is a detailed, step-by-step explanation of my implementation. If you want to jump straight to the code and figure it out by yourself, just scroll to the end of this post. Hopefully when you're done you'll have better understanding of how parsing works internally, and you'll be inspired to use a proper parsing library to avoid this entire bloody mess. To understand this post, you should have a strong understanding of Python, and it's recommended to have some understanding of what parsing is and what it's for. If you're not sure, I recommend that you read my previous post, in which I thoroughly explain the grammar that I will be using in this post. Step 1: Tokenize The first step of processing the expression is to turn it into a list of individual symbols. This is the easiest part, and not the point of this exercise, so I allowed myself to cheat here quite a lot. First, I defined the tokens (Numbers are notably absent; they're the default) and a Token type: token_map = {'+':'ADD', '-':'ADD', '*':'MUL', '/':'MUL', '(':'LPAR', ')':'RPAR'} Token = namedtuple('Token', ['name', 'value']) And here's the code I used to tokenize an expression `expr`: split_expr = re.findall('[\d.]+|[%s]' % ''.join(token_map), expr) tokens = [Token(token_map.get(x, 'NUM'), x) for x in split_expr] The first line is a trick that splits the expression into the basic tokens, so '1.2 / ( 11+3)' --> ['1.2', '/', '(', '11', '+', '3', ')'] The next line names the tokens, so that the parser can recognize them by category: ['1.2', '/', '(', '11', '+', '3', ')'] --> [Token(name='NUM', value='1.2'), Token(name='MUL', value='/'), Token(name='LPAR', value='('), Token(name='NUM', value='11'), Token(name='ADD', value='+'), Token(name='NUM', value='3'), Token(name='RPAR', value=')')] Any token that is not in the token_map is assumed to be a number. Our tokenizer lacks a property called validation which would prevent non-numbers from being accepted, but luckily the evaluator will handle this task later on. That's it. Now that we have a list of tokens, our next step is to parse it into an AST. Step 2: Define the grammar The parser I chose to implement is a naive recursive descent parser, which is a simpler version of LL parsing. It's the simplest parser to implement, and in fact mine takes only 14 lines. It's a kind of top-down parser, which means that it starts by matching the highest rule (like: expression), and recursively tries to match its sub-rules until it matches the lowest rules (like: number). To put it another way, while a bottom-up (LR) parser will gradually fold tokens and rules into other rules, until there's only one rule left, a top-down (LL) parser like ours will gradually expand the rules into less abstract rules, until they completely match the input-tokens. Before we get to the actual parser, let's talk about the grammar. In my previous post, I used an LR parser, and I defined the calculator grammar like this (caps are tokens): add: add ADD mul | mul; mul: mul MUL atom | atom; atom: NUM | '(' add ')' | neg; neg: '-' atom; (If you don't understand this grammar, you should read my previous post) This time I'm using an LL parser, instead of LR, and here's how I defined the grammar: rule_map = { 'add' : ['mul ADD add', 'mul'], 'mul' : ['atom MUL mul', 'atom'], 'atom': ['NUM', 'LPAR add RPAR', 'neg'], 'neg' : ['ADD atom'], } There is a subtle change here. The recursive definitions of add and mul are reversed. This is a very important detail, and I need to explain it. The LR version of this grammar uses something called left-recursion. When LL parsers see recursion, they just dive in there in an attempt to match the rule. So when faced with left-recursion, they enter infinite recursion. Even smart LL-parsers such as ANTLR suffer from this issue, though it probably writes a friendly error instead of looping infinitely like our toy parser would. Left-recursion is easily solved by changing it to right-recursion, and that is what I did. But because nothing is easy with parsers, it created another problem: While left-recursion parses 3-2-1 correctly as (3-2)-1, right-recursion parses it incorrectly as 3-(2-1). I don't know of an easy solution to this problem, so to keep things short and simple for you and me both, I decided to keep the incorrect form and deal with it in post-processing (see step 4). Step 3: Parse into an AST The algorithm is simple. We're going to define a recursive function that receives two parameters: The first is the name of the rule that we're trying to match, and the second is the list of tokens we have left. We'll start with add (which is the highest rule) and with the entire list of tokens, and have the recursive calls become increasingly more specific. The function returns a tuple: The current match, and a list of the tokens that are left to match. For the purpose of short code, we'll make it capable of also matching tokens (they're both strings; one is UPPER-CASE and the other lower-case). Here's is the code for the parser: RuleMatch = namedtuple('RuleMatch', ['name', 'matched']) def match(rule_name, tokens): if tokens and rule_name == tokens[0].name: # Match a token? return RuleMatch(tokens[0], tokens[1:]) for expansion in rule_map.get(rule_name, ()): # Match a rule? remaining_tokens = tokens matched_subrules = [] for subrule in expansion.split(): matched, remaining_tokens = match(subrule, remaining_tokens) if not matched: break # no such luck. next expansion! matched_subrules.append(matched) else: return RuleMatch(rule_name, matched_subrules), remaining_tokens return None, None # match not found Lines 4-5 check if rule_name is actually a token, and if it matches the current token. If it does, it will return the match, and which tokens are still left to consume. Line 6 iterates over the sub-rules of rule_name, so each can be matched recursively. If rule_name is a token, the get() call will return an empty tuple and the flow will fall to the empty return (line 16). Lines 9-15 iterate over every element of the current sub-rule, and try to match them in sequentially. Each iteration tries to consume as many matching tokens as possible. If one element did not match, we discard the entire sub-rule. However, if all elements matched, we reach the else clause and return our match for rule_name, with the remaining tokens to match. Let's run it and see what we get for 1.2 / ( 11+3). >>> tokens = [Token(name='NUM', value='1.2'), Token(name='MUL', value='/'), Token(name='LPAR', value='('), Token (name='NUM', value='11'), Token(name='ADD', value='+'), Token(name='NUM', value='3'), Token(name='RPAR', value=')')] >>> match('add', tokens) (RuleMatch(name='add', matched=[RuleMatch(name='mul', matched=[RuleMatch(name='atom', matched=[Token(name='NUM', value='1.2')]), Token(name='MUL', value='/'), RuleMatch(name='mul', matched=[RuleMatch(name='atom', matched=[Token(name='LPAR', value='('), RuleMatch(name='add', matched=[RuleMatch(name='mul', matched=[RuleMatch(name='atom', matched=[Token(name='NUM', value='11')])]), Token(name='ADD', value='+'), RuleMatch(name='add', matched=[RuleMatch(name='mul', matched=[RuleMatch(name='atom', matched=[Token(name='NUM', value='3')])])])]), Token(name='RPAR', value=')')])])])]), []) The result is a tuple, of course, and we can see there are no remaining tokens. The actual match is not easy to read, so let me draw it for you add mul atom NUM '1.2' MUL '/' mul atom LPAR '(' add mul atom NUM '11' ADD '+' add mul atom NUM '3' RPAR ')' This is what the AST looks like, in concept. It's a good practice to imagine the parser run in your mind, or on a piece of paper. I dare say it's necessary to do so if you want to grok it. You can use this AST as a reference to make sure you got it right. So far we've written a parser capable of correctly parsing binary operations, unary operations, brackets and precedence. There's only one thing it does incorrectly, and we're going to fix it in the next step. Step 4: Post Processing My parser is not perfect in many ways. The important one is that it cannot handle left-recursion, which forced me to write the grammar as right-recursive. As a result, parsing 8/4/2 results in the folowing AST: add mul atom NUM 8 MUL '/' mul atom NUM 4 MUL '/' mul atom NUM 2 If we try to solve the expression using this AST, we'll have to calculate 4/2 first, which is wrong. Some LL-parsers choose to fix the associativity in the tree. That takes too many lines ;). Instead, we're going to flatten it. The algorithm is simple: For each rule in the AST that 1) needs fixing, and 2) is a binary operation (has three sub-rules), and 3) its right-hand operand is the same rule: flatten the latter into the former. By "flatten", I mean replace a node with its children, in the context of its parent. Since our traversal is DFS post-order, meaning it starts from the edge of the tree and works its way to the root, the effect accumulates. Here's the code: fix_assoc_rules = 'add', 'mul' def _recurse_tree(tree, func): return map(func, tree.matched) if tree.name in rule_map else tree[1] def flatten_right_associativity(tree): new = _recurse_tree(tree, flatten_right_associativity) if tree.name in fix_assoc_rules and len(new)==3 and new[2].name==tree.name: new[-1:] = new[-1].matched return RuleMatch(tree.name, new) This code will turn any structural sequence of additions or multiplications into a flat list (without mixing each other). Parenthesis break the sequence, of course, so they won't be affected. From this point I could re-build the structure as left-associative, using code such as def build_left_associativity(tree): new_nodes = _recurse_tree(tree, build_left_associativity) if tree.name in fix_assoc_rules: while len(new_nodes)>3: new_nodes[:3] = [RuleMatch(tree.name, new_nodes[:3])] return RuleMatch(tree.name, new_nodes) But I won't. I'm pressed for lines of code, and changing the evaluation code to handle lists takes a lot less lines than rebuilding the tree. Step 5: Evaluate Evaluating the tree is very simple. All that's required is to traverse the tree in a similar fashion to the post-processing code (namely DFS post-order), and to evaluate each rule in it. At the point of evaluation, because we recurse first, each rule should be made of nothing more than numbers and operations. Here's the code: bin_calc_map = {'*':mul, '/':div, '+':add, '-':sub} def calc_binary(x): while len(x) > 1: x[:3] = [ bin_calc_map[x[1]](x[0], x[2]) ] return x[0] calc_map = { 'NUM' : float, 'atom': lambda x: x[len(x)!=1], 'neg' : lambda (op,num): (num,-num)[op=='-'], 'mul' : calc_binary, 'add' : calc_binary, } def evaluate(tree): solutions = _recurse_tree(tree, evaluate) return calc_map.get(tree.name, lambda x:x)(solutions) I wrote calc_binary to evaluate both addition and multiplication (and their counterparts). It evaluates lists of either, in a left-associative fashion, thus bringing our little LL-grammar annoyance to conclusion. Step 6: The REPL The plainest REPL possible: if __name__ == '__main__': while True: print( calc(raw_input('> ')) ) Please don't make me explain it :) Appendix: Tying it all together: A calculator in 70 lines '''A Calculator Implemented With A Top-Down, Recursive-Descent Parser''' # Author: Erez Shinan, Dec 2012 import re, collections from operator import add,sub,mul,div Token = collections.namedtuple('Token', ['name', 'value']) RuleMatch = collections.namedtuple('RuleMatch', ['name', 'matched']) token_map = {'+':'ADD', '-':'ADD', '*':'MUL', '/':'MUL', '(':'LPAR', ')':'RPAR'} rule_map = { 'add' : ['mul ADD add', 'mul'], 'mul' : ['atom MUL mul', 'atom'], 'atom': ['NUM', 'LPAR add RPAR', 'neg'], 'neg' : ['ADD atom'], } fix_assoc_rules = 'add', 'mul' bin_calc_map = {'*':mul, '/':div, '+':add, '-':sub} def calc_binary(x): while len(x) > 1: x[:3] = [ bin_calc_map[x[1]](x[0], x[2]) ] return x[0] calc_map = { 'NUM' : float, 'atom': lambda x: x[len(x)!=1], 'neg' : lambda (op,num): (num,-num)[op=='-'], 'mul' : calc_binary, 'add' : calc_binary, } def match(rule_name, tokens): if tokens and rule_name == tokens[0].name: # Match a token? return tokens[0], tokens[1:] for expansion in rule_map.get(rule_name, ()): # Match a rule? remaining_tokens = tokens matched_subrules = [] for subrule in expansion.split(): matched, remaining_tokens = match(subrule, remaining_tokens) if not matched: break # no such luck. next expansion! matched_subrules.append(matched) else: return RuleMatch(rule_name, matched_subrules), remaining_tokens return None, None # match not found def _recurse_tree(tree, func): return map(func, tree.matched) if tree.name in rule_map else tree[1] def flatten_right_associativity(tree): new = _recurse_tree(tree, flatten_right_associativity) if tree.name in fix_assoc_rules and len(new)==3 and new[2].name==tree.name: new[-1:] = new[-1].matched return RuleMatch(tree.name, new) def evaluate(tree): solutions = _recurse_tree(tree, evaluate) return calc_map.get(tree.name, lambda x:x)(solutions) def calc(expr): split_expr = re.findall('[\d.]+|[%s]' % ''.join(token_map), expr) tokens = [Token(token_map.get(x, 'NUM'), x) for x in split_expr] tree = match('add', tokens)[0] tree = flatten_right_associativity( tree ) return evaluate(tree) if __name__ == '__main__': while True: print( calc(raw_input('> ')) )
utaku_ryukko [RESOLU]Problême avec Rhythmbox et Clementine - Lecture de CD Audio im Bonjour, J'ai un petit souci. Je viens de remarqué qu'il m'est impossible de lire un CD audio quelque soit le logiciel de lecture que je veux utiliser. Il m'est possible de copier via Brasero et de ripper via SoundJuicer. Quand j'insère mon CD, il m'ouvre le menu pour choisir ce que je veux faire. Si je choisis VLC, le logiciel se lance, commence à jouer une piste (toujours la track10) pendant 4 seconde puis se bloque. Si je choisis Rhythmbox, le logiciel se lance, mais le CD n'apparaît pas dans l'explorateur sur la gauche. J'ai essayé en lançant Rhythmbox depuis la ligne de commande pour voir s'il y avait un message d'erreur et voici ce que j'ai: Ubuntu1204:~$ rhythmbox (rhythmbox:15716): libpeas-WARNING **: audiocd: /usr/lib/rhythmbox/plugins/audiocd/libaudiocd.so: undefined symbol: discid_get_submission_url (rhythmbox:15716): libpeas-WARNING **: Could not load plugin module: 'audiocd' (rhythmbox:15716): libpeas-WARNING **: Error loading plugin 'audiocd' J'ai aussi essayé un sudo apt-get purge suivi de sudo apt-get install pour Rhythmbox: Rien à faire Quelqu'un aurait-il une solution? Je suis sous Ubuntu 12.04 64 bits Merci d'avance Dernière modification par utaku_ryukko (Le 30/03/2013, à 13:21) Hors ligne shoot76 Re : [RESOLU]Problême avec Rhythmbox et Clementine - Lecture de CD Audio im Tu as essayé ça ? ~ La mort d'une personne est une tragédie, celle d'un million c'est des statistiques. [J. Staline] Hors ligne utaku_ryukko Re : [RESOLU]Problême avec Rhythmbox et Clementine - Lecture de CD Audio im Oui, le paquet Ubuntu-restricted était déjà installé et je n'ai aucun souci pour les MP3. Je viens d'installer les seconds, puis re-boot. Aucun changement: le CD se lance avec VLC ou Clementine, mais stoppe après 4 secondes. Rien ne se passe avec Rhythmbox. Hors ligne gouet Re : [RESOLU]Problême avec Rhythmbox et Clementine - Lecture de CD Audio im De quel CD s'agit-il? j'en ai un certain nombre de la warner dont je ne peux plus rien faire depuis que je n'ai plus de lecteur CD Gouet Hors ligne utaku_ryukko Re : [RESOLU]Problême avec Rhythmbox et Clementine - Lecture de CD Audio im J'ai ce problème avec tous mes CD, que ce soit venant de majors ou de petits labels indépendants et même des compilations que j'ai gravé pour la voiture. Info: mes CD se montent automatiquement ici cdda:://sr0 Voici le message d'erreur que j'ai quand je lance vlc: Ubuntu1204:~$ vlc cdda://sr0 VLC media player 2.0.5 Twoflower (revision 2.0.5-0-g1661b7d) [0x22fb108] main libvlc: Lancement de vlc avec l'interface par défaut. Utilisez « cvlc » pour démarrer VLC sans interface. [0x7f46ac000b78] main input error: open of `cdda://sr0' failed Hors ligne fcn50 Re : [RESOLU]Problême avec Rhythmbox et Clementine - Lecture de CD Audio im Salut, Est-ce que le paquet gvfs-backends est installé? Hors ligne utaku_ryukko Re : [RESOLU]Problême avec Rhythmbox et Clementine - Lecture de CD Audio im Je viens de vérifier et il est bien installé, de même que: gvfs-daemons, gvfs-common, gvfs-libs, gvfs-bin et gvfs-fuse Hors ligne fcn50 Re : [RESOLU]Problême avec Rhythmbox et Clementine - Lecture de CD Audio im Tu dis: Info: mes CD se montent automatiquement ici cdda:://sr0 et ici vlc cherche: cdda://sr0 cdda::// vs cdda://, c'est normal cette différence : | ::? En général les cd se montent dans média, non? Essaye d'ouvrir le cd avec vlc mais media>ouvrir>un disque>cd audio pour voir. Dernière modification par faucon50 (Le 29/03/2013, à 12:58) Hors ligne utaku_ryukko Re : [RESOLU]Problême avec Rhythmbox et Clementine - Lecture de CD Audio im Là je ne sais pas trop. J'ai suivi l'aide de VLC. Ce qui est sur c'est quand je pointe sur le CD, ça m'affiche cdda::/sr0. Et je ne vois rien dans /media à part mes 2 HD Hors ligne fcn50 Re : [RESOLU]Problême avec Rhythmbox et Clementine - Lecture de CD Audio im J'ai écris une connerie, les cd ne se montent pas! Tu as bien un dossier cdrom dans /media? Depuis quand ça ne marche plus? Peux-tu lire un dvd de photos ou autre données? Dernière modification par faucon50 (Le 29/03/2013, à 13:18) Hors ligne utaku_ryukko Re : [RESOLU]Problême avec Rhythmbox et Clementine - Lecture de CD Audio im Non, pas de dossier cdrom dans media, J'ai bien un dossier cdrom dans mon Home mais il est toujours vide. Je viens de tester certaines choses et j'ai des résultats bizarres. Si j'insère le CD, choisis de ne rien faire puis j'ouvre VLC et fait Media >Ouvrir>CD Audio et que je choisis /dev/sr0 dans la drop list, je n'ai aucun souci. Le CD démarre normalement et j'ai la liste des titres (si le CD est trouvé dans la base de données). Par contre si j'insère le CD et choisis Lancer avec VLC, là ça ne marche plus. Le CD se lance (toujours sur la piste 10 s'il ya plus de 10 pistes) puis se bloque après 4 à 6 secondes. Et si j'ouvre la liste de lecture, je ne vois plus les titres mais une simple liste Track1 à TrackXX. Et même en choisissant de ne rien faire quand j'insère le CD puis ouvrir soit Rhythmbox ou Clementine, le CD est invisible dans la liste des périphériques. EDIT: aucun souci pour lire un DVD du commerce (même si j'ai du désinstaller puis réinstaller libdvdcss2) ou un CD/DVD de données. Dernière modification par utaku_ryukko (Le 29/03/2013, à 13:36) Hors ligne fcn50 Re : [RESOLU]Problême avec Rhythmbox et Clementine - Lecture de CD Audio im Poste ton /fstab. Hors ligne utaku_ryukko Re : [RESOLU]Problême avec Rhythmbox et Clementine - Lecture de CD Audio im # /etc/fstab: static file system information. # # Use 'blkid' to print the universally unique identifier for a # device; this may be used with UUID= as a more robust way to name devices # that works even if disks are added and removed. See fstab(5). # # <file system> <mount point> <type> <options> <dump> <pass> proc /proc proc nodev,noexec,nosuid 0 0 # / was on /dev/sda1 during installation UUID=1e3346ce-31a8-4ac7-a0da-d4f4f0d3a46a / ext4 errors=remount-ro 0 1 # swap was on /dev/sda5 during installation UUID=03b8dc20-4db4-4685-85b5-45c2e2943e0b none swap sw 0 0 # DataStorage Hard Drive 1TB UUID=3939db73-2d25-48d6-aaac-f2087091e1be /media/DataStorage ext4 auto 0 1 Hors ligne fcn50 Re : [RESOLU]Problême avec Rhythmbox et Clementine - Lecture de CD Audio im Le fstab est ok. Déplace ce dossier cdrom dans /media là où il doit et essaye un dvd données et regarde si le dossier cdrom contient ces données. Hors ligne utaku_ryukko Re : [RESOLU]Problême avec Rhythmbox et Clementine - Lecture de CD Audio im OK. Fait. Avec un DVD Video ou Données, le montage se fait automatiquement dans /media. Par contre, avec un CD Audio, rien n'apparaît dans /media et le dossier cdrom que j'ai transféré reste vide. Je vois le CD listé dans la liste des périphérique. Mais il n'apparaît plus quand je lance Rhythmbox ou Clementine. Et je dois faire la manip que j'ai cité précédemment pour pouvoir l'ouvrir avec VLC. Hors ligne fcn50 Re : [RESOLU]Problême avec Rhythmbox et Clementine - Lecture de CD Audio im Je ne sais pas comment fonctionnent Rhythmbox ou Clementine et unity mais la démarche: "j'ouvre VLC et fait Media >Ouvrir>CD Audio et que je choisis /dev/sr0 dans la drop list, je n'ai aucun souci. Le CD démarre normalement et j'ai la liste des titres", permet de lire tes CDs, ce qui est déjà une bonne chose. Perso j'ouvre toujours mes CDs de cette manière, avec vlc et Deadbeef sans problème. Change de titre car devenu inadapté, pour un truc du genre: cd audio>ouvrir avec Rhythmbox ou Clementine ne fonctionne pas. Ouvre Rhythmbox et Clementine dans un terminal et fait la manip media>ouvrir>cd audio pour voir si ils donnent des erreurs. P.S. Est-ce que le paquet libcdio-cdda1 est installé? Dernière modification par faucon50 (Le 29/03/2013, à 16:11) Hors ligne utaku_ryukko Re : [RESOLU]Problême avec Rhythmbox et Clementine - Lecture de CD Audio im Voici pour Rhythmbox: Ubuntu1204:~$ rhythmbox (rhythmbox:5834): libpeas-WARNING **: audiocd: /usr/lib/rhythmbox/plugins/audiocd/libaudiocd.so: undefined symbol: discid_get_submission_url (rhythmbox:5834): libpeas-WARNING **: Could not load plugin module: 'audiocd' (rhythmbox:5834): libpeas-WARNING **: Error loading plugin 'audiocd' (rhythmbox:5834): Rhythmbox-WARNING **: Unable to start mDNS browsing: MDNS service is not running (rhythmbox:5834): libdmapsharing-WARNING **: Unable to initialize mDNS: Le démon n'est pas en cours d'exécution (rhythmbox:5834): libdmapsharing-WARNING **: Unable to notify network of media sharing: The avahi MDNS service is not running Sense key: 0x70 0x00 0x03 0x00 0x00 0x00 0x00 0x0a 0x00 0x00 0x00 0x00 0x11 0x00 0x00 0x00 0x00 0x00 0x00 Je vois le CD audio quand je demande Musique>Ajouter (dossier ou fichier), mais rien ne se passe quand je clique sur Ouvrir après avoir sélectionné. Voici pour Clementine: Ubuntu1204:~$ clementine 14:21:07.916 DEBUG NetworkProxyFactory:30 Detected system proxy URLs: ("", "", "", "") 14:21:07.916 DEBUG CoverProviders:34 Registered cover provider "Amazon" 14:21:07.934 INFO Player:533 Registered URL handler for "di" 14:21:07.934 DEBUG InternetModel:94 Adding internet service: "DigitallyImported" 14:21:07.959 DEBUG InternetModel:94 Adding internet service: "Icecast" 14:21:07.978 DEBUG InternetModel:94 Adding internet service: "Jamendo" 14:21:07.987 INFO Player:533 Registered URL handler for "lastfm" 14:21:07.987 DEBUG CoverProviders:34 Registered cover provider "last.fm" 14:21:07.987 DEBUG InternetModel:94 Adding internet service: "Last.fm" 14:21:07.987 INFO Player:533 Registered URL handler for "grooveshark" 14:21:07.987 INFO PlaylistManager:417 Registered special playlist type "grooveshark-search" 14:21:07.988 DEBUG InternetModel:94 Adding internet service: "Grooveshark" 14:21:07.990 INFO Player:533 Registered URL handler for "magnatune" 14:21:07.990 DEBUG InternetModel:94 Adding internet service: "Magnatune" 14:21:07.994 DEBUG InternetModel:94 Adding internet service: "SavedRadio" 14:21:07.994 INFO Player:533 Registered URL handler for "sky" 14:21:07.994 DEBUG InternetModel:94 Adding internet service: "SKY.fm" 14:21:07.994 INFO Player:533 Registered URL handler for "somafm" 14:21:07.994 DEBUG InternetModel:94 Adding internet service: "SomaFM" 14:21:08.010 DEBUG GnomeGlobalShortcutBackend:50 registering 14:21:08.040 DEBUG MainWindow:208 Starting 14:21:08.092 DEBUG MainWindow:266 Initialising player 14:21:08.092 DEBUG MainWindow:272 Creating models 14:21:08.094 DEBUG MainWindow:295 Creating UI 14:21:08.112 DEBUG MainWindow:662 Creating equalizer 14:21:08.112 DEBUG MainWindow:677 Creating now playing widget 14:21:08.153 DEBUG MainWindow:714 Loading settings 14:21:08.166 DEBUG MainWindow:760 Initialising library 14:21:08.166 DEBUG MainWindow:773 Started 14:21:08.173 INFO DeviceManager:411 Device added: "DeviceKit/6VM62A36/Seagate/ST3500418AS/500105249280" 14:21:08.177 INFO DeviceManager:411 Device added: "/dev/sr0" 14:21:08.191 DEBUG UbuntuUnityHack:74 Unity whitelist is "['JavaEmbeddedFrame', 'Wine', 'Update-notifier', 'clementine'] " 14:21:08.194 DEBUG GnomeGlobalShortcutBackend:93 registered 14:21:11.149 DEBUG unknown "sni-qt/6789" INFO 14:21:11.149 void StatusNotifierItem::slotAboutToShow() Adding an "Activate" entry to the StatusNotifierItem context menu 14:21:17.256 INFO SongLoaderInserter:97 Loading audio CD... 14:21:17.257 ERROR SongLoader:121 Error while changing CDDA GstElement's state Là, c'est encore pire, je ne vois même pas le CD Audio EDIT: je viens de vérifier, le paquet libcdio-cdda1 est bien installé Dernière modification par utaku_ryukko (Le 29/03/2013, à 17:30) Hors ligne fcn50 Re : [RESOLU]Problême avec Rhythmbox et Clementine - Lecture de CD Audio im J'ai tapé ceci sur la toile: Clementine Error while changing CDDA GstElement's state Et voici le résultat: https://code.google.com/p/clementine-pl … il?id=2442 Ça a tout l'aire d'un bug de Clementine. Et voici pour Rhythmbox (lis les messages et liens): Les deux semblent pourris. Ça me rappel le bon vieux temps où j'ai viré Rhythmbox pour installer des lecteurs fonctionnels. Hors ligne utaku_ryukko Re : [RESOLU]Problême avec Rhythmbox et Clementine - Lecture de CD Audio im OK, merci. J'ai suivi les liens. Le problème avec Clementine est exactement le même. Pour Rhythmox, c'est légèrement différent mais il semblerait que ce soit le même module qui pose problème. Il n'y a plus qu'à espérer que des patchs ou une nouvelle version corrigeront ceux-ci. Merci pour ton aide. Je passe en RESOLU même si le problème ne l'est pas. Heureusement que je peux tout ripper en FLAC ma collection de CD que je viens de récupérer après 6 ans dans un container. Hors ligne fcn50 Re : [RESOLU]Problême avec Rhythmbox et Clementine - Lecture de CD Audio im De rien. J'ai aussi ripper les miens depuis un moment, c'est quand plus sympa de cliquer que de se lever à chaque fois, sans parler du bruit des lecteurs dvdrom avec un cd audio dedans. Prend quand même un bon ripper pour pas faire le boulot pour rien ou de mauvaise qualité. Test les fichiers .flac après ripp, suivant le ripper utilisé il peut y avoir de mauvaises surprises. Peut-être qu'en cherchant sur la toile tu trouverais une solution pour faire fonctionner ces deux coucous... Hors ligne utaku_ryukko Re : [RESOLU]Problême avec Rhythmbox et Clementine - Lecture de CD Audio im J'utilise Sound Juicer. Je ne teste pas à 100%, mais je sample de temps à autre et je n'ai pas encore eu de mauvaises surprises. La prochaine étape est de trouver un auto-radio qui peut lire les fichiers FLAC. Ca, ce n'est pas gagné. J'ai trouvé des baladeurs qui peuvent le faire, mais pas encore d'auto-radio Sinon, pour les 2 autres, j'espère que le passage à la 13.04 va résoudre les problèmes, mais j'en doute. Hors ligne fcn50 Re : [RESOLU]Problême avec Rhythmbox et Clementine - Lecture de CD Audio im Sinon, pour les 2 autres, j'espère que le passage à la 13.04 va résoudre les problèmes, mais j'en doute. Tu connais le proverbe: l'espoir est la seule consolation des ......! Perso ça fait longtemps que j'ai trouvé des remplaçants. Hors ligne utaku_ryukko Re : [RESOLU]Problême avec Rhythmbox et Clementine - Lecture de CD Audio im Lequel me conseillerais-tu? J'ai testé Banshee mais je n'aime pas. Il semblerait que Exaile ne soit pas trop mal, et corresponde à ce que je cherche. Audacious me parait pas trop mal aussi. Hors ligne fcn50 Re : [RESOLU]Problême avec Rhythmbox et Clementine - Lecture de CD Audio im J'utilise Deadbeef pour la sique, une perle qui m'a fais rester sur nunux après mon passage en provenance de w$>foobar2000 alors ce que je cherchais un équivalent. Si ça te dis, je t'aide volontiers pour la config et mise en oeuvre, c'est un soft super chouette, personnalisable à souhait et stable. Je peux même te refiler mon fichier de config couleurs pour te faire une idée... Voici un fil où tu trouveras des infos: http://forum.ubuntu-fr.org/viewtopic.php?id=911611&p=1 Pour les vidéos c'est vlc, une fois configuré, c'est un monstre... Dernière modification par faucon50 (Le 30/03/2013, à 18:02) Hors ligne
mao-40 Re : TBI + wiimote + ubuntu En ce qui concerne 'gtkwhiteboard.ico', ce n'est pas l'image de calibration je pense, puisque le logiciel demande de calibrer l'écran avec les 4 coins du bureau et après cela fonctionne bien. Ah ok, j'essaierai au demain au vidéo-projcteur. Dernière modification par mao-40 (Le 04/02/2009, à 00:28) - * HP Quad Core Q9300 2,5GHz - 6Go - Nvidia GeForce GT 610 1Go - Ubuntu 13.10 64 (Gnome-Shell, vivement autre chose !!! ) - Asus X5DAF - ATI 512Mo - Ubuntu 12.04 AMD-64 Hors ligne Jer!cho Re : TBI + wiimote + ubuntu Bon, un retour d'expérience avec Interwrite sous ubuntu. J'ai désactivé les effets de compiz et lancé le fichier d'installation avec sudo et le logiciel s'installe bien. Après redémarrage comme conseillé, le logiciel se lance bien à partir du menu 'applications', me détecte l'absence du matériel (TBI) mais c'est normal puisque je n'ai aucun périphérique connecté à la maison. Si on remet les effets de compiz, Interwrite ne gère plus les pages et on ne peut pas annoter. Sinon, à première vue, presque tout fonctionne... seul handicap et de taille : lorsque je veux insérer un cadre de texte dans une page, ma session se ferme immédiatement. C'est quand même une fonction importante qui n'est pas utilisable... dommage. Un autre retour qui confirme ceci ? Hors ligne mao-40 Re : TBI + wiimote + ubuntu Je viens d'essayer au lycée l'association et le calibrage avec le script python, ça fonctionne impeccable. En effet il n'y a pas les 4 points comme on peut avoir sur d'autres logiciels. Le calibrage se fait directement sur les 4 coins du bureau. La détection Infra rouge est beaucoup plus sensible en effet que celle avec le paquet proposé dans la doc du site sur la wiimote. Sinon, à première vue, presque tout fonctionne... seul handicap et de taille : lorsque je veux insérer un cadre de texte dans une page, ma session se ferme immédiatement. J'avais le même problème que toi pour le cadre texte, et aujourd'hui ça a fonctionné avec clavier virtuel et même avec la reconnaissance de caractères cellwriter. Tu as installé quelle version de wiimote witheboard ? C'est peut-être la version python qui m'a résolu ce problème. - * HP Quad Core Q9300 2,5GHz - 6Go - Nvidia GeForce GT 610 1Go - Ubuntu 13.10 64 (Gnome-Shell, vivement autre chose !!! ) - Asus X5DAF - ATI 512Mo - Ubuntu 12.04 AMD-64 Hors ligne Jer!cho Re : TBI + wiimote + ubuntu Rien à faire, ça veut pas : ni le cadre de texte ni le clavier virtuel ne fonctionne. Déco de la session immédiate. La version de python est celle qui était installée avant 'gtkwhiteboard' cad la 2.8 : j'avais édité le fichier de conf comme le tuto le recommandait afin de correspondre à la version déjà installée. As-tu la même ? PS : j'ai résolu le problème du message d'erreur de l'icone au lancement de 'gtkwhiteboard' : solution 1 -> enlever les lignes et donc l'icone dans l'application : - editer le script : 'sudo gedit /usr/share/gtkwhiteboard/gtkwhiteboard.py' - commenter les trois lignes concernant l'icone (faites une recherche de "ico" dans gedit) Solution 2 -> lui donner ce qu'il veut : - on ouvre /usr/share/pixmaps/gtkwhiteboard.xpm avec gimp - on l'enregistre en format .ico dans notre home Solution 3 -> mettre l'icone au bon endroit pour faire plus propre : - on ouvre /usr/share/pixmaps/gtkwhiteboard.xpm avec gimp - on l'enregistre en format .ico dans /usr/share/pixmaps/ - on édite avec 'sudo gedit /usr/share/gtkwhiteboard/gtkwhiteboard.py' ' et on lui donne le chemin complet de l'icone en mettant : iconFile = "/usr/share/pixmaps/gtkwhiteboard.ico" et voilà... Dernière modification par Jer!cho (Le 04/02/2009, à 15:40) Hors ligne mao-40 Re : TBI + wiimote + ubuntu Petite précision, le clavier virtuel de Interwrite ne s'affiche pas. J'utilise celui de Cellwriter. Dernière modification par mao-40 (Le 09/02/2009, à 22:11) - * HP Quad Core Q9300 2,5GHz - 6Go - Nvidia GeForce GT 610 1Go - Ubuntu 13.10 64 (Gnome-Shell, vivement autre chose !!! ) - Asus X5DAF - ATI 512Mo - Ubuntu 12.04 AMD-64 Hors ligne mao-40 Re : TBI + wiimote + ubuntu Bonjour, Petit retour d'expérience du script python en utilisation avec vidéo projecteur : Reconnaissance, calibration sensibilité : super !!!Précision : catastrophique, impossible d'écrire quoi que ce soit, les courbes sont complètement morcelées. Il faudrait lier la sensibilité du script python "GTK Wiimote Whiteboard" avec la précision du deb "Wiimote Whiteboard". Mais je crois que c'est pas pour demain. :(:( Dernière modification par mao-40 (Le 09/02/2009, à 22:16) - * HP Quad Core Q9300 2,5GHz - 6Go - Nvidia GeForce GT 610 1Go - Ubuntu 13.10 64 (Gnome-Shell, vivement autre chose !!! ) - Asus X5DAF - ATI 512Mo - Ubuntu 12.04 AMD-64 Hors ligne alain14773 Re : TBI + wiimote + ubuntu Bonjour, Un petit retour d'expérience également Je viens également de faire plusieurs essais avec GTK Wiimote Whiteboard Sur mon ordinateur fixe personnel acer avec processeur quadricoeur Q6600 à 2,40 Ghz, 95 Goctets disponibles sur la partition linux, affichage réglé d'abord avec l'écran 17 pouces en résolution 1024 768 puis écran débranché et remplacé par video projecteur epson , batterie wiimote à 45 % Là : Impeccable Précision, rapidité, fluidité avec gpaint, tuxpaint,firefox (calques déplaçables) et interwrite la réaction au stylet (stylet maison avec diode LTE 5208 (CRY 89 a) de selectronic) est instantannée le trait ou l'écriture se fait simultanément sans aucun retard aussi bien que si on tenait une craie Remarque Ce pc est en dual boot et j'ai eu du utiliser bluesoleil (payant) sous vista pour faire reconnaitre ma clef bluetooth marque blue snork à 11 euros alors que alors que sous linux rien eu à faire .... Par contre avec mon ordinateur professionnel portable lenovo 3000 N200 992 MO de mémoire processeur dual à 1,6 Ghz blue tooth intégré Installation d'ubuntu 8,10 faite directement à partir de windows Xp sur un espace réduit 10 Giga octets Pas de problème pour installer GTK Wiimote Whiteboard grâce à la procédure donnée au début de cette discussion Stylet qui fonctionne sur l'écran du pc Il laisse une trace sous gpaint mais ce n'est pas très fluide Par contre... Pas moyen d'installer interwrite pour cause d'espace dans un répertoire temp insuffisant voir message The directory /home/ubuntu/istemp11833044110728 does not contain enough space to extract temporary files. Please specify a temporary directory using the -is:tempdir option. Use the -is:help option for more information. Y a t'il une solution pour passer cet obstacle ? (c'est pour pouvoir montrer l'utilisation d'interwrite sur le portable ...) Echec aussi avec le vidéoprojecteur : le pointeur est bien détecté mais sous gpaint aucune trace ne s'inscrit sur le mur (sauf de temps en temps un point ou deux) De même les calques ne sont pas déplacés sous firefox De plus, la configuration du vidéoprojecteur ne s'est pas faite facilement( avantage XP !) Je pense donc que les capacités de la machine sont un paramètre très important même si les ressources demandées pour gérer le blue tooth et la wiimote ne paraissent pas énormes... Cordialement Alain Eatice Paimpol Hors ligne frucot Re : TBI + wiimote + ubuntu Rajouter l'option -is:tempdir avec un chemin vers un répertoire ayant suffisamment de place. D'une manière générale il me semble que l'installation de Ubuntu dans windows n'est pas la meilleure solution, (moins rapide, et moins sûr). Pour ce qui du videoprojecteur, j'ai remarqué qu'il fallait utiliser une résolution de 1024x768 et en clonant les écrans cela allait bien. (Système->Préférences->Résolution d'écran) Il faut peut-être aussi désactiver les effets compiz (Systéme->Préférences->Apparence Onglet Effets visuels Aucun). Hors ligne frucot Re : TBI + wiimote + ubuntu Pour moi sous ubuntu 8.10 module bluetooth Broadcomm BCM2210. Installation de GTKwhiteboard en suivant la modif citée plus haut. Pas de problèmes, détection de la wiimote et du stylo IR parfaite (LED IR SFH484-2) Installation de Interwriter LE linux en suivant leur notice : il y a une erreur (ne pas faire sudo su mais uniquement sudo). A part cela il fonctionne correctement. Le clavier virtuel est en anglais mais un petit tour dans les préférences règle cela (option sélectionner une langue -> Français) PS : Si cela intéresse quelqu'un, je peux envoyer le paquet gtkwhiteboard modifié pour Ubuntu 8.10. Hors ligne Kokoyaya Re : TBI + wiimote + ubuntu Je pense que ça peut intéresser du monde (moi en particulier ). Tu pourrais le joindre au forum ou mettre un petit lien stp ? Hors ligne frucot Re : TBI + wiimote + ubuntu Voici le lien pour télécharger le fichier : http://pourlecole.net/ariane/download/g … -5_all.deb Il fonctionne avec Ubuntu 8.10 en utilisant GDebi pour l'installer Dernière modification par frucot (Le 22/02/2009, à 21:21) Hors ligne Bionet Re : TBI + wiimote + ubuntu Bonjour, j'ai un problème que j'attribuerai volontier à intrepid s'il n'y avait pas les témoignages de collègues qui n'ont pas ce soucis. J'ai un "Échec de l'appariement avec Nintendo RVL-CNT-01" lorsque j'essaie de Définir un nouveau périphérique BlueTooth. avec lswm j'obtiens bien l'adresse MAC de ma Wiimote : 00:17:AB:39:56:C9 Mais avec wmgui ou wminput j'ai un "Socket Connect Error (control channel), unable to connect". alors forcément, que ce soit avec Whiteboard ou GTK Whiteboard je n'arrive pas à connecter ma Wiimote. (ou plutôt je n'arrive pas à l'" apparier" ce qui doit être, à priori, le mot à employer). Le problème c'est qu'avec le même Dongle BlueTooth j'arrivais à connecter ma Wiimote sous Hardy. j'ai suivi les consignes sur la page Wiimote de la doc (ajout des références à l'adresse MAC dans le fichier .bashrc). Alors, si quelqu'un à une petite idée sur la marche à suivre pour que j'arrive à faire fonctionne mon futur TNWii je suis preneur. NOTE : je suis sous Intrebid (8.10, version CrunchEee), sur un EeePC 701. J'ai utilisé le .deb de gtkwhiteboard donné par frucot (ça a installé 7 paquets supplémentaires). Dernière modification par Bionet (Le 25/02/2009, à 12:59) Hors ligne sakurazuka38 Re : TBI + wiimote + ubuntu Bonjour a tous, Après une petite pause, je repars dans mon projet tnwii. A votre avis est-il envisageable d'installer la version windows d'interwrite et l'utiliser avec wine? Hors ligne frucot Re : TBI + wiimote + ubuntu Pour utiliser Interwriter avec wine, je ne sais pas, mais pour moi (ubuntu 8.10) il fonctionne bien. je le trouve même plus "joli" que sous windows!. Tu peux essayer le paquet que j'ai mis en lien précédemment http://pourlecole.net/ariane/download/g … -5_all.deb A+ Hors ligne sakurazuka38 Re : TBI + wiimote + ubuntu Ok je vais tenter interwrite directement sous ubuntu mais j'avoue que je n'ai pas trop compris comment l'installer...ca avait merdé lors de l'installation du coup j'ai abandonné! Hors ligne Tbones1977 Re : TBI + wiimote + ubuntu Bonsoir, J'utilise aussi le TNWii en classe depuis la rentrée. C'est assez simple. Pour fabriquer son stylet (et plein d'autres infos utiles): http://www.prtice.info/?voir=tnwii_fabrication_stylet Utilisation sous linux: Se connecter et utiliser la wiimote avec le stylet => wiimote whiteboard: http://code.google.com/p/linux-whiteboard/downloads/list Tester sa connexion et les fonctionnalités de la wiimote =>wmgui (dans les dépots toutes applications disponibles) Dessiner sur l'image projetée (ou sur l'ecran) => gromit: http://www.home.unix-ag.org/simon/gromit/ Ou plus aboutit, => pointofix (a installer avec Wine): http://www.pointofix.de/download.php Personnellement j'ai constaté qq problèmes avec le soft wiimote whiteboard (avec gromit ou pointofix le tracé d'une ligne pleine sur l'écran est rendu de manière discontinue) Comme j'ai des logiciels sous win que j'utilise avec les élèves, j'ai transféré la gestion de mon module bluetooth usb a ma virtualbox XP et cela fonctionne mieux. Du coup j'utilise le logiciel libre qui existe sous win wiimotesmoothboard http://www.boonjin.com/wp/2008/08/14/wiimote-smoothboard-045-beta bon tnwii! Peux-tu me dire svp comment tu es parvenu à faire reconnaitre ton récepteur bluetooth usb en virtual box. J'arrive pas à le voir moi. Merci sakurazuka38 Re : TBI + wiimote + ubuntu Bon ben j'ai essayé d'installer interwrite...tout s'est bien passé, l'installateur s'est lancé mais très rapidement j'ai eu droit à un message d'erreur: "could not create directory /opt/interwrite_workspace" ou un truc comme ca! Si quelqu'un sait comment résoudre ce probleme! Hors ligne untamed-duck Re : TBI + wiimote + ubuntu @Tbones Arrives tu a te connecter sur d'autres périphériques usb avec ta virtual box? Si les périphériques usb ne fonctionnent pas va voir sur la doc Virtual box Ubuntu. http://doc.ubuntu-fr.org/virtualbox Il y a une petite manip a faire. Hors ligne e2q2 Re : TBI + wiimote + ubuntu Bonjour, j'ai un videoproj, une wiimote mais le stylet Del-IR que j'ai fabriqué n'est pas assez précis... Quelqu'un pourrait-il m'en fabriquer une (contre finances) ou m'indiquer où en trouver un qui soit bien adapté pour une utilisation avec la wiimote ? Merci d'avance. Hors ligne Jer!cho Re : TBI + wiimote + ubuntu C'est en anglais mais je pense que tu trouveras ton bonheur -> ici <- et plus particulièrement là : "Market Place -> For Sale -> IR Pens". Dernière modification par Jer!cho (Le 23/03/2009, à 21:10) Hors ligne frucot Re : TBI + wiimote + ubuntu Voici ce que je viens de trouver : http://www.ryxeo.com/materiels_6_pack-open-tni__tnwii_pack1.html Pour connaitre et utiliser la distribution AbulEdu dont Ryxeo est le maitre d'oeuvre, c'est du sérieux. Hors ligne sarto21 Re : TBI + wiimote + ubuntu Bonjour à tous, Simplement une petite remarque. La précision du TBWiiii dépend du calibrage mais est aussi fonction du vidéoprojecteur utilisé. J'ai remarqué (sous Windows, mais sous Linux ça doit être pareil) que certains vidéos sont "impropores" à l'utilisation TBWiii (bonne précision en haut et en bas de l'image, gros décalage au centre). Hors ligne frucot Re : TBI + wiimote + ubuntu Alors, j'ai de la chance avec mon petit videoproj à matrice DLP Hors ligne ilym Re : TBI + wiimote + ubuntu problème : à l'installation du logiciel aucun pb, mais après et maintenant j'ai ce message d'erreur : Traceback (most recent call last): File "/usr/share/gtkwhiteboard/gtkwhiteboard.py", line 527, in <module> frame = MainWindow(None,"Wiimote Whiteboard Controller") File "/usr/share/gtkwhiteboard/gtkwhiteboard.py", line 260, in __init__ if not self.LoadOptions(): File "/usr/share/gtkwhiteboard/gtkwhiteboard.py", line 305, in LoadOptions self.w.perspective.setsrc(*d['CalibrationDots']) File "/usr/share/gtkwhiteboard/perspective.py", line 54, in setsrc self.computeWarpMatrix() File "/usr/share/gtkwhiteboard/perspective.py", line 61, in computeWarpMatrix self.srcmatrix = self.computeQuadToSquare(self.srcdots) File "/usr/share/gtkwhiteboard/perspective.py", line 110, in computeQuadToSquare mat = self.computeSquareToQuad(inputdots) File "/usr/share/gtkwhiteboard/perspective.py", line 76, in computeSquareToQuad g = (sx * dy2 - dx2 * sy) / (dx1 * dy2 - dx2 * dy1) ZeroDivisionError: float division pourquoi? comment résoudre ça ? je pense que c'est les fichiers de configurations qui ont du avoir un pb. J'aimerai donc savoir où sont'ils pour pouvoir les supprimer ? (sachant que j'ai déjà fait une réinstallation complète et que ça marche pas) merci de votre aide Hors ligne ilym Re : TBI + wiimote + ubuntu non personne ? Hors ligne
#1476 Le 27/06/2013, à 20:53 The Uploader Re : /* Topic des codeurs [8] */ Je ne suis pas sûr de comprendre la question pour le coup. En fait, je rajoute ceci : position: relative; À ce code de app/assets/stylesheets/application.css : #preview { float:left; width: 46%; height: 100%; border-left:5px solid gray; overflow: auto; padding: 10px; } Et ça ne change rien (l'article est toujours partiellement recouvert par la splitbar) Si je le fais dans la propriété "style" de la balise <div id="preview"> dans Firebug, ça fonctionne. Et dans l'onglet Style de Firebug, j'ai : #preview { [...] position: relative; qui est barré. Ça confirme qu'il est ignoré. Pourquoi, j'en sais rien. J'me dis que c'est le style du div parent qui prend effet à la place, mais il y a rien de ce côté là. Ok. Des bonnes nouvelles? Pas de nouvelles. (sinon j't'ai envoyé un mail sur RReader) Dernière modification par The Uploader (Le 27/06/2013, à 20:59) Passer de Ubuntu 10.04 à Xubuntu 12.04 LTS Archlinux + KDE sur ASUS N56VV. ALSA, SysV, DBus, Xorg = Windows 98 ! systemd, kdbus, ALSA + PulseAudio, Wayland = modern OS (10 years after Windows, but still...) ! Deal with it ! Hors ligne #1477 Le 27/06/2013, à 20:59 Rolinh Re : /* Topic des codeurs [8] */ Je t'avoue que quand ça touche au CSS... je t'avoue que je suis limité ^^ Faire des GUI m'a toujours emm****, spécialement pour le web ou chaque navigateur interprète les choses différemment. Pour le coup, l'utilisation de Twitter bootstrap rend la chose moins pénible Je vais faire quelques tests et voir si je trouve ce qui cloche Et j'ai répondu à ton mail. EDIT: j'ai essayé d'ajouter juste ça. Pour moi ça ne change absolument rien. Tu avais apporté d'autres changements? Dernière modification par Rolinh (Le 27/06/2013, à 21:02) Hors ligne #1478 Le 27/06/2013, à 21:05 The Uploader Re : /* Topic des codeurs [8] */ Pareil. D'où l'appel à l'aide. ^^ Ok pour le mail. EDIT: j'ai essayé d'ajouter juste ça. Pour moi ça ne change absolument rien. Tu avais apporté d'autres changements? Par ici : ./viewtopic.php?pid=13957101#p13957101 Dernière modification par The Uploader (Le 27/06/2013, à 21:06) Passer de Ubuntu 10.04 à Xubuntu 12.04 LTS Archlinux + KDE sur ASUS N56VV. ALSA, SysV, DBus, Xorg = Windows 98 ! systemd, kdbus, ALSA + PulseAudio, Wayland = modern OS (10 years after Windows, but still...) ! Deal with it ! Hors ligne #1479 Le 27/06/2013, à 21:12 Rolinh Re : /* Topic des codeurs [8] */ Tu pourrais pusher ta branche pour le coup? (oups, ça devient IRC ici ^^) Hors ligne #1480 Le 27/06/2013, à 21:20 The Uploader Re : /* Topic des codeurs [8] */ C'est fait. Passer de Ubuntu 10.04 à Xubuntu 12.04 LTS Archlinux + KDE sur ASUS N56VV. ALSA, SysV, DBus, Xorg = Windows 98 ! systemd, kdbus, ALSA + PulseAudio, Wayland = modern OS (10 years after Windows, but still...) ! Deal with it ! Hors ligne #1481 Le 27/06/2013, à 21:45 grim7reaper Re : /* Topic des codeurs [8] */ grim7reaper a écrit : Un jour j’avais eu un TP de ce genre (mais sur un truc encore moins puissant que ça encore). On avait utilisé Boa comme serveur web. J'étais tombé sur Boa en faisant quelques recherches. Tu l'avais trouvé bien? Quel langage avais-tu utilisé? Je viens de vérifier, le CPU que l’on avait était cadencé à 200 Mhz. Pour situer le contexte, on avait deux cartes qui communiquait en RS232. L’une des cartes avec un prog’ en C multithread qui simulait un capteur de température (on utilisait deux threads car il fallait envoyer les mesures + recevoir et traiter les commandes en provenance de l’autre carte). L’autre carte, sur laquelle on avait une interface web qui permettait d’afficher les info’ du capteurs et d’envoyer des commandes (genre changement de fréquence d’acquisition ou arrêt du capteur). Pour le coup, on avait pas de gros besoin au niveau de l’interface web donc ouais ça allait bien. Pour le langage je sais que Boa prends au moins les CGI en Perl et en C (nous on devait le faire en C, m’enfin c’est mon partenaire qui s’est fait chier à générer du HTML à base de printf , perso moi j’avais préférer faire mumuse avec les threads et le RS232 ) Édit : Thus, any language that can be used as a CGI will work just fine, and this includes the popular scripting languages Python, Perl, and PHP. Dernière modification par grim7reaper (Le 27/06/2013, à 21:49) Hors ligne #1482 Le 27/06/2013, à 21:46 Rolinh Re : /* Topic des codeurs [8] */ J'ai la solution pour le coup. Vu que tu as mis un margin-left de 20px à la vsplitbar, il suffit de mettre un margin-left de 20px également à #preview. EDIT: @grim: Je suis pas assez mazot pour faire du web en Perl (que je ne connais pas d'ailleurs) ou en C. Si je peux me faciliter la vie avec un langage haut-niveau, je ne vais pas me gêner ^^ Je n'ai pas non plus un énorme besoin au niveau de l'interface web mais bon, un minimum quand même. Pour ton edit, je crois que je vais partir sur du Python avec bottle pour le coup. A moins que quelqu'un me suggère un autre framework web simple et léger. Dernière modification par Rolinh (Le 27/06/2013, à 21:52) Hors ligne #1483 Le 27/06/2013, à 22:03 The Uploader Re : /* Topic des codeurs [8] */ Ah cool. J'avais testé différentes marges, mais peut-être pas ça. J'm'étais aussi sûrement focalisé sur "position: relative;" parce que ça m'avait l'air plus élégant que des marges "en dur". Passer de Ubuntu 10.04 à Xubuntu 12.04 LTS Archlinux + KDE sur ASUS N56VV. ALSA, SysV, DBus, Xorg = Windows 98 ! systemd, kdbus, ALSA + PulseAudio, Wayland = modern OS (10 years after Windows, but still...) ! Deal with it ! Hors ligne #1484 Le 28/06/2013, à 18:56 Didier-T Re : /* Topic des codeurs [8] */ Bonjour à tous, c'est le premier code que je souhaite soumettre à vos avis experts. Et j'aurais une petite question à vous poser. Est-il possible de conserver un menu ouvert après lui avoir demandé de lancer une action (en l’occurrence démarrer / arrêter un Conky)? ConkyControl.py #!/usr/bin/python3 # coding: utf-8 # ======================================================================================== # # Script de Didier-T # license GPL V3 or later # # Description : script permettant la gestion simplifier d'une bibliothèque de conky. # # ======================================================================================== # ----------------------------------------------- # Ajout de bibliothèques utiles # ----------------------------------------------- from tkinter import Menubutton, Menu, Canvas, Frame, GROOVE, LEFT, IntVar, filedialog, Toplevel, Label, Tk, Entry from tkinter.filedialog import askopenfilename from tkinter.simpledialog import askstring, askinteger from tkinter.messagebox import askokcancel, showinfo, CANCEL from subprocess import check_output, Popen from os import path, system from re import search, findall Version='1' ## Données utiles ## homedir = path.expanduser('~') listfichier=[["Perso", "~/.scripts/Conky/conky_liste"], ## Attention à ne pas modifier cette ligne ## ["Base", "~/.scripts/Conky/conky_liste1"], ["Bar", "~/.scripts/Conky/conky_liste2"], ["Extra", "~/.scripts/Conky/conky_liste3"], ["Cover", "~/.scripts/Conky/conky_liste4"]] Fichier_Demarrage_Auto="~/DemConky.sh" class fonctions(): def __init__(self): self.listfichier=[] for chemin in listfichier: chemin[1]=chemin[1].replace("~", homedir) if path.isfile(chemin[1]): self.listfichier.append(chemin) def initialisation(self): ## Récupération du temps de latence fichier de démarrage automatique ## fichier=Fichier_Demarrage_Auto.replace("~", homedir) if path.isfile(fichier): fiche = open(fichier, "r") lines = fiche.readlines() fiche.close() for line in lines: if search("sleep", line) is not None: Latence=findall('-?\d+', line)[0] break else: Latence=5 ## Initialisation des bases de données et vérification des conkys lancés ## ### Scan Conky lancés ### ConkyLances=fonctions.scan() ### Création bases de données ### BasesConky=[] for base in self.listfichier: BasesConky.append([base[0],fonctions.lecture(base[1], ConkyLances)]) return BasesConky, ConkyLances, Latence def scan(): ## Scan processus extraction des conkys actifs ## Scan=check_output("ps ax | awk '/\ conky\ .*-c/'", shell=True).decode('utf-8').split('\n') index=0 retour={} while index < len(Scan)-1: Scan[index]=Scan[index].split() retour[Scan[index][len(Scan[index])-1]]=Scan[index][0] index=index+1 return retour def lecture(fichier, ConkyLances): ## Extraction liste conky + chemin de lancement ## fiche = open(fichier, "r") lines = fiche.readlines() fiche.close() base1 = [] base_de_donnee = [] index=0 index1=0 for line in lines: line=line.replace("\n", '') index=index+1 if index % 2: base1.append(line) else: line=line.replace("~", homedir) base1.append(line) if ConkyLances.get(line) is not None: base1.append(1) else: base1.append(0) base_de_donnee.append(base1) base1=[] return base_de_donnee def ecriture(self, BasesConky): ## modification d'un fichier base de données ## fichier=self.listfichier[0][1] fiche = open(fichier, "w") for Bases in BasesConky: information = Bases[0]+"\n"+Bases[1]+"\n" fiche.write(information) fiche.close() class MenuBar(Frame): ## Barre de menu déroulant ## def __init__(self, boss = None): self.MenuConky={} self.SuppConky={} self.ConkyLances={} self.BasesConky, self.ConkyLances, self.TempLat = fonctions.initialisation(fonctions()) Frame.__init__(self, borderwidth = 2, bd = 1, relief = GROOVE) ## Menu Fermer ## fermeMenu = Menubutton(self, text = 'Fermer', relief = GROOVE) fermeMenu.pack(side = LEFT) ### Partie déroulante ### fM = Menu(fermeMenu, tearoff=0) fM.add_command(label='Terminer', underline = 0, command = boss.quit) #### Intégration du menu #### fermeMenu.configure(menu = fM) ## Menu Conky liste ## self.ListeMenu = Menubutton(self, text = 'Conky Listes', relief = GROOVE) self.ListeMenu.pack(side = LEFT) ### Partie déroulante ### self.menuliste() ## Menu Conky gestion ## self.GestionMenu = Menubutton(self, text = 'Conky Gestion', relief = GROOVE) self.GestionMenu.pack(side = LEFT) ### Partie déroulante ### self.menuSup() ## Menu Gestion démmarage ## AutoRunMenu = Menubutton(self, text = 'Démarrage Automatique', relief = GROOVE) AutoRunMenu.pack(side = LEFT) ### Partie déroulante ### ARM = Menu(AutoRunMenu, tearoff=0) ARM.add_command(label='Latence démarrage', underline = 0, command=self.latence) ARM.add_command(label='Enregistrement', underline = 0, command=self.DemAuto) #### Intégration du menu #### AutoRunMenu.configure(menu = ARM) ## Réglage latence démarrage ## def latence(self): self.TempLat=askinteger(title='Réglage latence', prompt='Temps en secondes', initialvalue=self.TempLat) ## Enregistrement du fichier de démarrage automatique ## def DemAuto(self): fichier=Fichier_Demarrage_Auto.replace("~", homedir) FichDem=["#!/bin/bash", "# License GPL", "", "sleep "+str(self.TempLat)+";"] for conky in self.ConkyLances: FichDem.append('sh -c "conky -c '+conky+' &"') fiche = open(fichier, "w") fiche.write('\n'.join(FichDem)) fiche.close() system("chmod ugo+x "+fichier) showinfo(title="Démarrage automatique",message="Fichier "+Fichier_Demarrage_Auto+" modifié") ## Mise à jour des menus ## def MajMenu(self): self.GM.destroy() self.menuSup() self.lM.destroy() self.menuliste() ## Création / Mise à jour des sous menus lancement conky ## def menuliste(self): self.lM = Menu(self.ListeMenu, tearoff=0) for name in self.BasesConky: listeC=Menu(self.lM) self.MenuConky[name[0]]={} index=0 for val in name[1]: self.MenuConky[name[0]][val[1]]=IntVar() listeC.add_checkbutton(label=val[0], variable=self.MenuConky[name[0]][val[1]], command=self.choixactifs) self.MenuConky[name[0]][val[1]].set(val[2]) index=index+1 self.lM.add_cascade(label=name[0], underline = 0, menu=listeC) #### Intégration du menu #### self.ListeMenu.configure(menu = self.lM) ## Création / Mise à jour du sous menu suppression conky ## def menuSup(self): self.GM = Menu(self.GestionMenu, tearoff=0) self.GM.add_command(label='Ajout', command=self.ajouter, underline = 0) listeS=Menu(self.GM, tearoff=0) for val in self.BasesConky[0][1]: self.SuppConky[val[1]]=IntVar() listeS.add_checkbutton(label=val[0], variable=self.SuppConky[val[1]], command=self.supp) self.GM.add_cascade(label='Suppression', underline = 0, menu=listeS) #### Intégration du menu #### self.GestionMenu.configure(menu = self.GM) ## Lancement ou extinction d'un conky choisi par l'utilisateur ## def choixactifs(self): self.ConkyLances=fonctions.scan() for name in self.MenuConky: for chemin in self.MenuConky[name]: if self.ConkyLances.get(chemin) is not None: if self.MenuConky[name][chemin].get() == 0: Popen('kill '+self.ConkyLances.get(chemin), shell=True) else: if self.MenuConky[name][chemin].get() == 1: Popen('conky -c '+chemin+' &', shell=True) ## Suppression d'un conky au Conky Preso ## def supp(self): index=0 while index < len(self.BasesConky[0][1]): if self.SuppConky.get(self.BasesConky[0][1][index][1]) is not None: if self.SuppConky[self.BasesConky[0][1][index][1]].get() == 1: rep=askokcancel(title='Suppréssion', message='Êtes-vous certain de vouloir supprimer le conky '+self.BasesConky[0][1][index][0]+' de conky contrôle ?', default=CANCEL) if rep==True: self.BasesConky[0][1].remove(self.BasesConky[0][1][index]) fonctions.ecriture(fonctions(), self.BasesConky[0][1]) self.MajMenu() else: self.SuppConky[self.BasesConky[0][1][index][1]].set(0) break index=index+1 ## Ajout d'un conky au Conky Preso ## def ajouter(self): Chemin=askopenfilename() if Chemin: NomNouvConky=askstring(title='nouveau conky', prompt='Nom du nouveau conky') if NomNouvConky is not None: self.BasesConky[0][1].append([NomNouvConky, Chemin, 0]) fonctions.ecriture(fonctions(), self.BasesConky[0][1]) self.MajMenu() class application(Frame): ## Application principal ## def __init__(self, boss = None): Frame.__init__(self) self.master.title('Conky Contrôle') mBar = MenuBar(self) mBar.pack() self.can = Canvas(self, bg='light grey', borderwidth=2) self.can.pack() self.pack() if __name__ == '__main__': app = application() app.mainloop() Edit : comme vous pouvez le voir j'aime bien faire mes courses au détail Dernière modification par Didier-T (Le 28/06/2013, à 22:30) Hors ligne #1485 Le 28/06/2013, à 21:29 :!pakman Re : /* Topic des codeurs [8] */ @Rolinh : merci ... Hors ligne #1486 Le 29/06/2013, à 19:54 :!pakman Re : /* Topic des codeurs [8] */ @ux pythonneux : Je me posait la question, utilisez-vous souvent Python (voir même Ruby ou autres langages interprétés, d'ailleurs) pour des applications coté client et à destination du grand public (plus ou moins novice donc) ? Vu que la plateforme Python, contrairement à Java, n'est sans doute pas installée chez madame Michu, vous gérez le cas comment ? Vous utilisez un autre langage (Python n'étant pas forcément très adapté à la distribution) Vous envoyez mme Michu sur le site de python pour qu'elle le télécharge et l'installe Vous embarquez une version de Python, qui s'installe automatiquement si la plateforme n'est pas présente sur la machine de mme Michu Tant pis pour madame Michu, elle ne fait pas partie du public ciblé par mon application (mon public visé est censé s'y connaitre un minimum) Autre... Dernière modification par :!pakman (Le 29/06/2013, à 20:09) ... Hors ligne #1487 Le 29/06/2013, à 21:45 xapantu Re : /* Topic des codeurs [8] */ Déjà, ça dépend beaucoup de ta plateforme cible, si c'est pour une distribution gnu/linux, tu as toujours python installé (ou de toutes façons, avec le packaging, ça passe), dès que tu as une distribution grand public du moins. Sur Windows, il y a py2exe qui permet d'embarquer python directement qui marche pas mal (c'est pas d'une grande légèreté, mais quand c'est bien fait et qu'il n'y a pas trop de dépendances, ça marche vraiment bien). Pour Mac OS X, je ne sais pas trop comment ça fonctionne. Et pour Android, il y a des procédés qui permettent d'embarquer un interpréteur dans un apk directement je crois. Hors ligne #1488 Le 30/06/2013, à 11:48 tshirtman Re : /* Topic des codeurs [8] */ pyinstaller… Hors ligne #1489 Le 30/06/2013, à 14:49 :!pakman Re : /* Topic des codeurs [8] */ Merci pour les pistes ... Hors ligne #1490 Le 01/07/2013, à 03:41 grim7reaper Re : /* Topic des codeurs [8] */ @Rolinh : Dans words_processing.py : def tf(data): mat = numpy.asarray(data.values()) return TfidfTransformer(use_idf=False).fit_transform(mat) def tf_idf(data): mat = numpy.asarray(data.values()) return TfidfTransformer(use_idf=False).fit_transform(mat) Pour la seconde fonction, use_idf ne devrait pas être à True ? Dans le même fichier, pour la fonction remove_stopwords : chars = ['.', '/', "'", '"', '?', '!', '#', '$', '%', '^', '&', '*', '(', ')', ' - ', '_', '+' ,'=', '@', ':', '\\', ',', ';', '~', '`', '<', '>', '|', '[', ']', '{', '}', '"', '-',] Il y a deux fois ", et ça pourrait être remplacé par : chars = list(punctuation) + [' - '] avec un from string import punctuation bien sûr Et enfin, pour la fonction filter_tweet_words tu peux remplacer filtered_words = [] tokeep = ['JJ', 'JJR', 'JJS', 'NN', 'NNS', 'NNP', 'NNPS', 'VB', 'VBD', 'VBG', 'VBN', 'VBP', 'VBZ'] text = preprocessing(tweet.text) token = nltk.word_tokenize(text) tags = nltk.pos_tag(token) for tag in tags: if tag[1] in tokeep: filtered_words.append(tag[0]) return filtered_words par tokeep = ['JJ', 'JJR', 'JJS', 'NN', 'NNS', 'NNP', 'NNPS', 'VB', 'VBD', 'VBG', 'VBN', 'VBP', 'VBZ'] text = preprocessing(tweet.text) token = nltk.word_tokenize(text) return filter(lambda tag: tag[1] in tokeep, nltk.pos_tag(token)) Dans utils.py, json_to_tweets_helper : if bad_data: screen_name = '' in_reply_to_status_id = \ in_reply_to_user_id =\ favorite_count = \ retweet_count = \ user_favorite_count = \ followers_count = \ friends_count = \ statuses_count = 0 verified = False Ça c’est pas très joli et en plus c’est inutile (tu n’économises même pas une ligne). Autant faire : if bad_data: screen_name = '' in_reply_to_status_id = 0 in_reply_to_user_id =0 favorite_count = 0 retweet_count = 0 user_favorite_count = 0 followers_count = 0 friends_count = 0 statuses_count = 0 verified = False Et ça : hashtags = [] for hashtag in tw['entities']['hashtags']: hashtags.append(h.Hashtags(hashtag['text'])) urls = [] for url in tw['entities']['urls']: urls.append(u.Url(url['display_url'])) Ça pourrait être fait à coup de map : hashtags = map(lambda hashtag: h.Hashtags(hashtag['text']), tw['entities']['hashtags']) urls = map(lambda url: u.Url(url['display_url']), tw['entities']['urls']) Sinon, de manière générale, je préfère utilisé format plutôt que %. Dernière modification par grim7reaper (Le 01/07/2013, à 05:02) Hors ligne #1491 Le 01/07/2013, à 22:30 Rolinh Re : /* Topic des codeurs [8] */ Pour la seconde fonction, use_idfne devrait pas être àTrue? Tout à fait. Seulement, on devait rendre le projet et avec use_idf à True, le classifieur plante (alors que sans l'idf il passe sans problèmes...). Il faut que je revienne dessus pour comprendre ce qui ne joue pas. Il y a deux fois ", et ça pourrait être remplacé par : chars = list(punctuation) + [' - '] avec un from string import punctuationbien sûr Bien vu et élégant. Et enfin, pour la fonction filter_tweet_wordstu peux remplacer (...) Bien vu le coup de la fonction lambda. Dans utils.py,json_to_tweets_helper(...) Ça c’est pas très joli et en plus c’est inutile (tu n’économises même pas une ligne). J'en conviens. Bien vu le coup du map pour les hashtags et urls. Je n'y avais même pas pensé... Sinon, de manière générale, je préfère utilisé formatplutôt que %. Une raison particulière à ça? Sinon, merci bien pour cette revue. Toujours bon à prendre. Bon, il faut aussi se dire que ce code à été écrit en 8-10 jours à des heures pas possibles alors que je bossais à 50%. Bref, on était pas mal à la bourre mais au final ça a bien fini. Sinon, un de mes anciens prof (François Flückiger) a été nominé pour les internet hall of fame 2013 dans la catégorie Innovators (Recognizing individuals who made outstanding technological, commercial, or policy advances and helped to expand the Internet’s reach), aux cotés notamment de Richard Stallman, Aaron Swartz (à titre posthume) et Jimmy Wales pour les noms qui vous évoquent forcément quelque chose. On verra le 3 août qui sera le "gagnant". Il était dans l'équipe de Tim Berners Lee quand ils ont mis au point le www au CERN et a repris la direction du l'équipe suite à son départ. Actuellement, c'est le grand manitou de l'informatique au CERN. J'ai eu la chance d'avoir eu droit à une visite privée des installations informatiques du CERN en 2009, présenté par F.Flückiger. C'était hyper intéressant pour moi qui n'avait jamais visité de datacenter auparavant, surtout avec la mise en perspective des défis informatiques liés aux expériences du CERN. Hors ligne #1492 Le 02/07/2013, à 02:21 grim7reaper Re : /* Topic des codeurs [8] */ grim7reaper a écrit : Pour la seconde fonction, use_idfne devrait pas être àTrue? Tout à fait. Seulement, on devait rendre le projet et avec use_idfàTrue, le classifieur plante (alors que sans l'idf il passe sans problèmes...). Il faut que je revienne dessus pour comprendre ce qui ne joue pas. Ha ok, ça me semblait bizarre aussi. grim7reaper a écrit : Sinon, de manière générale, je préfère utilisé formatplutôt que %. Une raison particulière à ça? Je trouve ça moins moche Plus sérieusement, même si % n’est pas déprécié il semblerait que format soit son successeur. This section contains examples of the new format syntax and comparison with the old %-formatting. Et format me semble aussi plus souple et plus puissant, mais ne connaissant pas trop % je me trompe peut-être. Sinon il y a aussi des import inutilisés, mais ça doit être à cause des bouts de code en commentaire. Sinon, merci bien pour cette revue. Toujours bon à prendre. Bon, il faut aussi se dire que ce code à été écrit en 8-10 jours à des heures pas possibles alors que je bossais à 50%. Bref, on était pas mal à la bourre mais au final ça a bien fini. Bah de rien. Et ça va, le code reste plutôt propre quand même Sinon, un de mes anciens prof (François Flückiger) a été nominé pour les internet hall of fame 2013 dans la catégorie Innovators(Recognizing individuals who made outstanding technological, commercial, or policy advances and helped to expand the Internet’s reach), aux cotés notamment de Richard Stallman, Aaron Swartz (à titre posthume) et Jimmy Wales pour les noms qui vous évoquent forcément quelque chose. On verra le 3 août qui sera le "gagnant". Il était dans l'équipe de Tim Berners Lee quand ils ont mis au point le www au CERN et a repris la direction du l'équipe suite à son départ. Actuellement, c'est le grand manitou de l'informatique au CERN. J'ai eu la chance d'avoir eu droit à une visite privée des installations informatiques du CERN en 2009, présenté par F.Flückiger. C'était hyper intéressant pour moi qui n'avait jamais visité de datacenter auparavant, surtout avec la mise en perspective des défis informatiques liés aux expériences du CERN. J’ai entendu parler de ce Hall of Fame. Tu as eu un sacré prof’ on dirait ^^ Ouais, le CERN c’est un truc assez impressionnant ^^ Hors ligne #1493 Le 02/07/2013, à 18:52 Shanx Re : /* Topic des codeurs [8] */ Je continue dans le python. Cette fois, je dois faire un data logger qui reçois des données en entrée (pour le moment, une température pour une zone à chaque heure), les stocke et les modifie au cours du temps (moyenne journalière pour les données vieille d’une semaine, et suppression au bout d’un an). Je n’ai pas encore la fonction pour recevoir les données, du coup une certaine partie de celles-ci est écrite en dur (et le reste est généré par un second script). Voici le script qui s’occupe de gérer la base de donnée, et le script de simulation qui me permet de remplir cette dernière. J’ai en partie repris du code que j’avais déjà fait, tout en réadaptant. Par contre, c’est moitié en français, moitié en anglais. Je sais que c’est un peu dégueulasse, je vais changer ça. De plus, comme vous vous en doutez, j’ai pas mal de question : j’ai placé tout ce qui concernait le curseur de la base de donnée en dehors du main, en tant que variable globale. Il me semble qu’en faire une classe serait un peu mieux, mais j’avoue ne pas du tout savoir comment faire la connexion à la bdd pourrait se faire avec un withou pas ? Est-ce que j’y gagnerai quelque chose ? d’une manière plus générale, avez-vous des remarques pour le code (robustesse, conventions, erreurs, etc.) ? Sans vraiment parler de ce code, j’ai encore quelques autres questions : J’utilise des tabulations pour indenter, et pas des espaces. À titre personnel, je trouve les tabulations vraiment plus pratiques. Quels sont les arguments expliquant que PEP8 conseille les espaces ? À partir des données stockées dans la bdd, je vais devoir faire des graphiques et des courbes. Que conseillez-vous pour le faire ? J’ai rapidement jeté un œil à GChartWrapper, mais je n’ai pas réussi à l’installer (je suis passé rapidement sur la question, si vous me dites que ça convient je verrais ça plus en profondeur demain) Hors ligne #1494 Le 02/07/2013, à 21:05 Rolinh Re : /* Topic des codeurs [8] */ Tu as eu un sacré prof’ on dirait ^^ Ouep, j'ai eu de la chance. Par contre, ce qui est dommage c'est qu'il n'est pas professeur ordinaire mais juste chargé de cours. Il a assez à faire au CERN j'imagine... Du coup, il donne juste 2 cours de première année donc pas de matière bien avancée, ce qui est carrément dommage. Ouais, le CERN c’est un truc assez impressionnant ^^ Carrément. (...) faire une classe serait un peu mieux, mais j’avoue ne pas du tout savoir comment faire class Foo: """Foobar class.""" def __init__(self, bar='bar'): self.bar = bar def putfoo(self): print("foo") print(self.bar) Le __init__ c'est ton constructeur (enfin, pas exactement, c'est une méthode qui est exécutée quand une classe est instanciée). Si tu mets ce code dans foo.py, tu peux l'importer depuis un autre fichier source et instancier ta classe comme ça: import foo blah = foo.Foo() d’une manière plus générale, avez-vous des remarques pour le code (robustesse, conventions, erreurs, etc.) ? J'ai juste jeté un très bref coup d’œil à ton code et oui, je vois des améliorations. Mais comme je me vraiment mis à Python il y a environ 3 semaines, je ne vois certainement pas tout.^^ Par exemple, ça: heures=['00','01','02','03','04','05','06','07','08','09','10','11','12','13','14','15','16','17','18','19','20','21','22','23'] Peut se remplacer par ça, qui est bien plus élégant: heures = ["%02d" % h for h in range(0,24)] Si tu veux, je peux jeter un vrai coup d’œil et te faire part de mes remarques (qui vaudront ce qu'elles vaudront). J’utilise des tabulations pour indenter, et pas des espaces. Tu vas te faire fusilier toi. ^^ Non, plus sérieusement, c'est bien de suivre les recommandations/bonnes pratiques d'un langage. Surtout que pour le coup, en Python l'indentation compte vraiment... Il suffit qu'un mec édite ton code source, ait un tab réglé sur 2 ou 8 (enfin, pas le même tab que toi quoi), il modifie 2 lignes et il flingue tout. Pour le côté pratique, il suffit de bien réglé son éditeur et du coup, l'utilisation d'espaces à la place de tabs devient transparent. J'ai des réglages spéciaux pour python dans mon vim par exemple: [robin@thor ~] % cat .vim/ftplugin/python.vim setlocal omnifunc=pythoncomplete#Complete setlocal shiftwidth=4 setlocal tabstop=4 setlocal textwidth=80 setlocal softtabstop=4 setlocal expandtab setlocal autoindent setlocal nowrap setlocal formatoptions+=c setlocal formatoptions+=r je vais devoir faire des graphiques et des courbes. Que conseillez-vous pour le faire ? Sinon, j'ai finalement utilisé web.py en combinaison avec twitter bootstrap en faisant tourner le tout via lighttpd et fastcgi pour l'appli web embarquée. Ça fonctionne plutôt bien et je dois avouer que comme petit framework, webpy est plutôt bien foutu. Il intègre son propre moteur de template qui permet d'incruster du python dans les templates html, ce qui rend la chose très pratique et évite de se farcir des tonnes de js et il gère bien l'url rewriting avec les définitions des routes. Pour un framework web, il permet de faire beaucoup en python. Le seul truc dommage, c'est qu'il n'est pas encore compatible python 3 (bien que le portage semble être en cours). Je dois avouer qu'il m'a même donné une idée pour une petite application. Vous en saurez plus bientôt. Hors ligne #1495 Le 02/07/2013, à 21:14 Shanx Re : /* Topic des codeurs [8] */ Merci Rolinh pour tes remarques. Concernant la classe, je ne voyais pas comment en faire une pour mon curseur. Je re-regarderai demain, je pense qu’en fouillant encore un peu je devrais arriver à quelque chose. Pour ton astuces pour remplir la liste des heures, ça a l’air franchement plus élégant, en effet. Si tu veux, je peux jeter un vrai coup d’œil et te faire part de mes remarques (qui vaudront ce qu'elles vaudront). Ce serait bien volontiers ! Hors ligne #1496 Le 02/07/2013, à 21:27 Rolinh Re : /* Topic des codeurs [8] */ Merci Rolinh pour tes remarques. Pas de quoi. Concernant la classe, je ne voyais pas comment en faire une pour mon curseur. Ah pardon, j'avais mal compris. Personnellement, je verrais ton problème différemment: se farcir du SQL, bah heu... faut vraiment le vouloir. ^^ D'autant plus qu'en passant directement tes requêtes SQL comme tu le fais, tu es directement dépendant de sqlite (ce qui n'est pas un problème en soi dans un simple script, j'en conviens). Donc à ta place, moi je ferais de l'ORM. Bien que je ne l'ai jamais utilisé, sqlalchemy à l'air pas mal pour ça (et il gère sqlite, évidemment). Il y a un tutoriel qui à l'air pas mal sur la doc. Tu risques de passer un petit moment à comprendre comment ça fonctionne mais je suis sûr que ça va te simplifier la vie par la suite. Sur ce, je vais jeter un coup d’œil à ton code et revenir avec quelques remarques supplémentaires si j'en ai. Hors ligne #1497 Le 02/07/2013, à 21:44 Rolinh Re : /* Topic des codeurs [8] */ @Shanx: Dans move: # Valeurs initiales normalement jamais atteinte (sinon ça ne va pas fonctionner) # Je trouve pas ça très propre, à revoir mini = 500 maxi = -50 Ça m'a un peu surpris. mini à 500 et max à -50 ? Toujours dans la même méthode: for row in cur: if (row[2] < mini): mini = row[2] if (row[2] > maxi): maxi = row[2] moy += row[2] row[2] ne mériterait pas une affectation là vu que tu l'utilises plusieurs fois? Avec un nom parlant ça aide aussi à comprendre de quoi il s'agit. Dans main: def main(): # Valeurs définies en dur pour les tests title = "temp_zone_1" date = "2013-07-03 00" value = 26 Tant qu'à faire, procède ainsi puisque ces paramètres semblent requis: def main(title="temp_zone_1", date="2013-07-03 00", value=26): Toujours dans le main, il sert à quoi i=0? Il n'est pas utilisé par la suite. Sinon, pour ta gestion de la db, cf mon post précédent. Des méthodes comme present1 ou present2 seront inutiles (par ailleurs, les noms de ces méthodes ne sont vraiment pas parlant...). Hors ligne #1498 Le 02/07/2013, à 22:04 Shanx Re : /* Topic des codeurs [8] */ Merci. En vrac : c’est pas la première fois que je “me farcis” du SQL, et je ne trouve pas ça très compliqué. J’irais même plus loin et dirais que c’est pratique, mais je ne connais pas les autres alternatives. Du coup, je ne vois pas trop ce que l’ORM va m’apporter… La bdd gérée par sqlite3 me permet d’avoir plusieurs applis qui la consultent, ce qui m’est pratique. Ce sera aussi le cas avec l’ORM ? Concernant les valeurs données à minetmax, comme dit en commentaire je n’en étais pas content (je ne sais pas ce qu’il m’a pris de faire ça comme ça ). Ça a depuis été changé. Bien vu pour l’affectation de row[2]. Après, ça fait partie du code de test qui me sert uniquement à remplir la base de donnée, donc c’est pas non plus le plus important. Mais c’est bien pour moi de prendre les bonnes habitudes. Enfin, les valeurs définies dans le mainne sont là qu’à fin de test, et elles sont vouées à disparaitre. Ça me paraît donc aussi simple de les définir comme je le fais, plutôt que de les passer en paramètres. Et la variableiest un vieux reste que je vais supprimer de ce pas. Hors ligne #1499 Le 02/07/2013, à 22:18 Rolinh Re : /* Topic des codeurs [8] */ c’est pas la première fois que je “me farcis” du SQL, et je ne trouve pas ça très compliqué. J’irais même plus loin et dirais que c’est pratique, mais je ne connais pas les autres alternatives. Du coup, je ne vois pas trop ce que l’ORM va m’apporter… La bdd gérée par sqlite3 me permet d’avoir plusieurs applis qui la consultent, ce qui m’est pratique. Ce sera aussi le cas avec l’ORM ? Ce n'est pas tellement le fait que SQL soit compliqué ou pas le problème. Passer par de l'ORM te permettra de notamment de "mapper tes objets en base de données". mais apporte aussi une couche d'abstraction, ce qui n'est pas une mauvaise chose. Évidemment, cela n'est utile que si tu rends ton code plus orienté objet. Ceci dit, je pense que tu n'as pas bien compris le principe. Si tu choisis une base sqlite, c'est toujours du sqlite qu'il y aura derrière en passant par sqlalchemy. Donc tu pourras évidemment toujours utiliser cette bdd comme bon te semble... Hors ligne #1500 Le 02/07/2013, à 22:25 Shanx Re : /* Topic des codeurs [8] */ Évidemment, cela n'est utile que si tu rends ton code plus orienté objet. Ça, c’est mon grand problème : j’ai du mal à réfléchir (et à codé) en orienté objet. Et je ne sais pas comment faire pour avoir le déclic (c’est d’ailleurs pour ça que j’ai beaucoup de mal avec le java). Sinon, je ne vois toujours pas les avantages de l’ORM. Je vais lire attentivement la doc demain, et voir ce que je peux en faire. Merci beaucoup. Hors ligne
I have a lenovo y460 laptop with hybrid graphics. it's a nvidia optimus card and a integrated intel graphics. I'm only using the integrated chip and i don't want use the nvidia card the problem occur in ubuntu 10.04 and ubuntu 11.10 i can not work when the flickering occur . that all right in windows 7 so i think it's a driver or kernel problem i have try the i915.powersave=0 but it's no use and i915.modeset=1 make the resultion horrible the only clue is the xorg.0.log,when the flickering occur the xorg.0.log full with : [ 2868.431] (II) intel(0): Modeline "1366x768"x0.0 71.00 1366 1414 1446 1502 768 771 776 788 -hsync -vsync (47.3 kHz) [ 2873.979] (II) intel(0): Printing DDC gathered Modelines: [ 2873.979] (II) intel(0): Modeline "1366x768"x0.0 71.00 1366 1414 1446 1502 768 771 776 788 -hsync -vsync (47.3 kHz) [ 2874.479] (II) intel(0): EDID vendor "LGD", prod id 654 [ 2874.479] (II) intel(0): Printing DDC gathered Modelines: [ 2874.479] (II) intel(0): Modeline "1366x768"x0.0 71.00 1366 1414 1446 1502 768 771 776 788 -hsync -vsync (47.3 kHz) [ 2881.539] (II) intel(0): EDID vendor "LGD", prod id 654 [ 2881.539] (II) intel(0): Printing DDC gathered Modelines: [ 2881.539] (II) intel(0): Modeline "1366x768"x0.0 71.00 1366 1414 1446 1502 768 771 776 788 -hsync -vsync (47.3 kHz) [ 2881.539] (II) intel(0): EDID vendor "LGD", prod id 654 [ 2881.539] (II) intel(0): Printing DDC gathered Modelines: [ 2881.539] (II) intel(0): Modeline "1366x768"x0.0 71.00 1366 1414 1446 1502 768 771 776 788 -hsync -vsync (47.3 kHz) i don't know who output the information and there is another clue when the flickering occur ,i switch to tty1 (crtl+alt+F1) ,i found there some char "^@" output to the screen. even when the os boot i found the char "^@" occur in the screen update:my problem maybe is a acpi problem so i have try below kernel params: acpi_osi=Linux acpi_backlight=vendor acpi=copy_dsdt nohz=off highres=off acpi=noirq pcie_aspm=force you also could try: acpi=off nolapic but it's a nuclear way because it make another problem
Sure thing. It is a bit tricky to do this with LINQ but certainly possible using only the standard query operators. UPDATE: This is the subject of my blog on Monday June 28th 2010; thanks for the great question. Also, a commenter on my blog noted that there is an even more elegant query than the one I gave. I'll update the code here to use it. The tricky part is to make the Cartesian product of arbitrarily many sequences. "Zipping" in the letters is trivial compared to that. You should study this to make sure that you understand how it works. Each part is simple enough but the way they are combined together takes some getting used to: static IEnumerable<IEnumerable<T>> CartesianProduct<T>(this IEnumerable<IEnumerable<T>> sequences) { IEnumerable<IEnumerable<T>> emptyProduct = new[] { Enumerable.Empty<T>()}; return sequences.Aggregate( emptyProduct, (accumulator, sequence) => from accseq in accumulator from item in sequence select accseq.Concat(new[] {item}) ); } To explain how this works, first understand what the "accumulate" operation is doing. The simplest accumulate operation is "add everything in this sequence together". The way you do that is: start with zero. For each item in the sequence, the current value of the accumulator is equal to the sum of the item and previous value of the accumulator. We're doing the same thing, except that instead of accumulating the sum based on the sum so far and the current item, we're accumulating the Cartesian product as we go. The way we're going to do that is to take advantage of the fact that we already have an operator in LINQ that computes the Cartesian product of two things: from x in xs from y in ys do something with each possible (x, y) By repeatedly taking the Cartesian product of the accumulator with the next item in the input sequence and doing a little pasting together of the results, we can generate the Cartesian product as we go. So think about the value of the accumulator. For illustrative purposes I'm going to show the value of the accumulator as the results of the sequence operators it contains. That is not what the accumulator actually contains. What the accumulator actually contains is the operators that produce these results. The whole operation here just builds up a massive tree of sequence operators, the result of which is the Cartesian product. But the final Cartesian product itself is not actually computed until the query is executed. For illustrative purposes I'll show what the results are at each stage of the way but remember, this actually contains the operators that produce those results. Suppose we are taking the Cartesian product of the sequence of sequences {{1, 2}, {3, 4}, {5, 6}}. The accumulator starts off as a sequence containing one empty sequence: { { } } On the first accumulation, accumulator is { { } } and item is {1, 2}. We do this: from accseq in accumulator from item in sequence select accseq.Concat(new[] {item}) So we are taking the Cartesian product of { { } } with {1, 2}, and for each pair, we concatenate: We have the pair ({ }, 1), so we concatenate { } and {1} to get {1}. We have the pair ({ }, 2}), so we concatenate { } and {2} to get {2}. Therefore we have {{1}, {2}} as the result. So on the second accumulation, accumulator is {{1}, {2}} and item is {3, 4}. Again, we compute the Cartesian product of these two sequences to get: {({1}, 3), ({1}, 4), ({2}, 3), ({2}, 4)} and then from those items, concatenate the second one onto the first. So the result is the sequence {{1, 3}, {1, 4}, {2, 3}, {2, 4}}, which is what we want. Now we accumulate again. We take the Cartesian product of the accumulator with {5, 6} to get {({ 1, 3}, 5), ({1, 3}, 6), ({1, 4}, 5), ... and then concatenate the second item onto the first to get: {{1, 3, 5}, {1, 3, 6}, {1, 4, 5}, {1, 4, 6} ... } and we're done. We've accumulated the Cartesian product. Now that we have a utility function that can take the Cartesian product of arbitrarily many sequences, the rest is easy by comparison: var arr1 = new[] {"a", "b", "c"}; var arr2 = new[] { 3, 2, 4 }; var result = from cpLine in CartesianProduct( from count in arr2 select Enumerable.Range(1, count)) select cpLine.Zip(arr1, (x1, x2) => x2 + x1); And now we have a sequence of sequences of strings, one sequence of strings per line: foreach (var line in result) { foreach (var s in line) Console.Write(s); Console.WriteLine(); } Easy peasy!
Code: Public Sub ProjectViewCmd(ID As Long, Stat As String) Dim i As Integer Dim MyBox As String 'if it is a project lead If Stat = "Active Lead" Or Stat = "Dead Lead" Then DoCmd.OpenForm "Project Leads", acNormal If Stat = "Dead Lead" Then Forms![Project Leads].Controls(BothOption).Value = True Forms![Project Leads].FilterOn = False Forms![Project Leads].Controls(ActiveOption).Value = False Forms![Project Leads].Controls(DeadOption).Value = False End If DoCmd.SearchForRecord acForm, "Project Leads", acFirst, "[Project ID]=" & ID 'if it belongs in the project list form (i.e. not a lead) Else DoCmd.OpenForm "Project List", acNormal For i = 0 To 4 MyBox = "Check" & CStr(i) If Forms![Project List].Controls(MyBox).Tag = Stat Then Forms![Project List].Controls(MyBox).Value = True End If Next i ProjectSort End If End SubThe problem lines are Code: Form_Load_Error: Call ErrorLog(Err.Name, Err.Number, Me.Name, Erl, "Form_Load") 1 Then If varOpenArgsRecord(2) = "NewSimple" Then Me.TabControl.Style = 2 Me.TabControl.TabFixedHeight = 0 End If End If End If Form_Load_Exit: Exit Sub Form_Load_Error: Call ErrorLog(Err.Name, Err.Number, Me.Name, Erl, "Form_Load") Resume Form_Load_Exit End Sub Code: Dim dbs As Database, Rst As Recordset Dim SRst As Recordset Dim scompany As String Dim saddress As String 'Subform fields Dim sSequenceNumber As Long Dim sSequenceDescription As String On Error GoTo Err_btnDuplicate_Click Set dbs = CurrentDb Set Rst = Me.RecordsetClone Set SRst = Me.RoutingSubform.Form.RecordsetClone scompany = "" & Me!company saddress = "" & Me!Address 'Subform Fields sSequenceNumber = "" & Me!RoutingSubform!SequenceNumber sSequenceDescription = "" & Me!RoutingSubform!SequenceDescription With Rst .AddNew !company = scompany !Address = saddress 'Subform fields With SRst .AddNew !SequenceNumber = sSequenceNumber !SequenceDescription = sSequenceDescription .Update ' Save changes. .Move 0, .LastModified End With Me.Bookmark = Rst.Bookmark Exit_btnduplicate_Click: Me.Refresh Exit Sub Err_btnDuplicate_Click: MsgBox Error$ Resume Exit_btnduplicate_Click: End With End Sub Code: Object doesn't support property or methodMy code is the following: Code: appExcel.ActiveSheet.Rows("23:23").Select appExcel.ActiveSheet.Range("B23").Activate appExcel.ActiveSheet.Selection.Insert 'Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove appExcel.ActiveSheet.Rows("30:30").Select appExcel.ActiveSheet.Range("B30").Activate appExcel.ActiveSheet.Selection.Insert 'Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove appExcel.ActiveSheet.Rows("18:18").Select appExcel.ActiveSheet.Range("B18").Activate appExcel.ActiveSheet.Selection.Copy appExcel.ActiveSheet.Rows("23:23").Select appExcel.ActiveSheet.Range("B23").Activate appExcel.ActiveSheet.ActiveSheet.Paste appExcel.ActiveSheet.Rows("30:30").Select appExcel.ActiveSheet.Range("B30").Activate appExcel.ActiveSheet.ActiveSheet.PasteWhere appExcel is my Excel Object declared as: Code: Dim appExcel As Object Set appExcel = CreateObject("Excel.Application")When debbuging the error is in the .Insert row even if I comment the shifting part and so. Code: Private Sub AddNewAccount_Click() On Error GoTo Err_AddNewAccount_Click Dim stDocName As String Dim AddCompID As Integer AddCompID = Me![CompanyID] stDocName = "subfrmAccountAdd1" Forms!frmCompanyEntry!subfrmAccountAdd1.Visible = True Me.subfrmAccountAdd1.SetFocus DoCmd.GoToRecord , , acNewRec Me.subfrmAccountAdd1.[CompanyID] = AddCompID Me.subfrmAccountAdd1.[AccountNumber].SetFocus Exit_AddNewAccount_Click: Exit Sub Err_AddNewAccount_Click: MsgBox Err.Description Resume Exit_AddNewAccount_Click End Suband here is the only code in the subform (to save record, move focus and set visibility to false Code: Private Sub SaveNewAccount_Click() On Error GoTo Err_SaveNewAccount_Click DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70 Forms!frmCompanyEntry!subfrmAccounts.Form.Requery Forms!frmCompanyEntry!CoName.SetFocus Forms!frmCompanyEntry!subfrmAccountAdd1.Visible = False Exit_SaveNewAccount_Click: Exit Sub Err_SaveNewAccount_Click: MsgBox Err.Description Resume Exit_SaveNewAccount_Click End SubI am very much a beginner at access so any advice would be helpful If Not (rs_subtaskcomments.EOF = True And rs_subtaskcomments.BOF = True) Then              '-----start of if comments rs non empty loop rs_subtaskcomments.MoveFirst   'initialize the comments counter that keeps track of superscript- one superscript per name,   CommentCounter = 1 Dim foundnamecell As Variant Dim orignamestring As String Dim lenorigstring As Long Dim commentstring_multline As String     'LOOP through Comments rs   Do While Not rs_subtaskcomments.EOF 'replace the space between different comment types with a new line commentstring_multline = Replace(rs_subtaskcomments.Fields("CommentsSet"), ". ", vbNewLine)   'paste comments string below temps section wb.sheets(currentsubtasktemplate).range("A" & lastrowtemps + 1).Value = _ CommentCounter & " " & commentstring_multline wb.sheets(currentsubtasktemplate).range("A" & lastrowtemps + 1).Characters(Start:=1, Length:=0).Font.Superscript = True wb.sheets(currentsubtasktemplate).range("A" & lastrowtemps + 1).Characters(Start:=2, Length:=0).Font.Superscript = False 'find the first place where employee name appears and paste superscript 'Set foundnamecell = Dim namevalue As String namevalue = rs_subtaskcomments.Fields("Name").Value Debug.Print namevalue   foundnamecell = wb.sheets(currentsubtasktemplate).range("A1:A200").Find(What:=namevalue, After:=wb.range("A200"), LookIn:=xlValues, LookAt:= _         xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False, SearchFormat:=False)   orignamestring = foundnamecell.Value lenorigstring = Len(orignamestring) foundnamecell.Value = orignamestring & CommentCounter 'convert inserted commentcounter to superscript foundnamecell.Characters(Start:=lenorigstring + 1, Length:=0).Font.Superscript = True 'go to next commentcounter CommentCounter = CommentCounter + 1 Loop End If   '-----end of comments loop  (working in access 2003) Code: Private Sub Form_Current() If Abs(DateDiff("d", Me![MembershipExpiryDate], Date)) < 30 Then Me![MembershipExpiryDate].ForeColor = 255 Else Me![MembershipExpiryDate].ForeColor = 0 End If End Sub Private Sub Form_Timer() If Me![MembershipExpiryDate].Visible = True Then Me![MembershipExpiryDate].Visible = False Else Me![MembershipExpiryDate].Visible = True End If End SubCan anyone see where i'm going wrong? It doesn't go red, or flash (like they should when the date is close) and also i get an error 438 'object doesn't support property or object' when viewing some empty fields. Dim ctl As Control For Each ctl In Me.Controls If Not ctl.Name = "SaveInvoiceRecord_button" And Not ctl.Name = "Box95" Then If ctl.BackColor = 10092543 And Len(ctl.Value Note: the first If statement excludes 2 controls that should not be checked because they don't support either the back color property or the value property. When I try to hit save, I get error 438: object doesn't support this property or method. The line PHP Code: If ctl.BackColor = 10092543 And Len(ctl.Value is highlighted. All of the controls are either text boxes or comboboxes. I tried just the backcolor criteria in that line and that works. It has to be the value criteria. I also tried the following, none of which work: if ctl.value= "" if ctl= "' if ctl.value= vbnullstring if ctl= nullstring if len(ctl.value)=0 Can anyone tell me why my textbox and combobox controls aren't supporting this property? Thank you. View Answers
V druhém díle našeho obludária si ukážeme další dva esoterické programovací jazyky. Prvním bude Single Four a ten druhý se jmenuje AAAAAAAAAAAAAA!!!!. Navíc se potom můžete zúčastnit malé soutěže, kterou najdete na konci článku. Single Four Single Four je programovací jazyk, který navrhla Starla Insigna, programátorka s extrémní oblibou čísla 4. Její osobní web můžete najít na FourIsland.com. Tento jazyk samotný je opravdu téměř nepoužitelný, protože jeho vyjadřovacími znaky jsou pouze mezera a číslice 4. Každá řádka programu potom sestává z volání funkcí, kterým se předávají parametry oddělené mezerou. Programování v Single Four je tedy opravdovou výzvou. Předdefinováno je celkem 21 základních funkcí (jejich seznam je k nalezení zde). Nejjednodušší je samozřejmě volání funkcí 4 a 44, u ostatních je to problematičtější, protože jejich číslo je nejprve třeba vypočítat. Uvedeme si dva základní programy. Ukázka 1 4 4 4 4 Tento program volá funkci číslo 4 (dělení) a dělí číslo 4 číslem 4 a výsledek ukládá do proměnné 4. Ukázka 2 4 4 44 4444 44 Tento program nejprve dělí (funkce 4) číslo 4 číslem 44. Výsledkem je 0 (jde o celočíselné dělení) a ta je uložena do proměnné 44. Druhý řádek volá funkci 44, která umožňuje zavolání funkce, která má ID rovné hodnotě v proměnné, která je jí předána jako parametr - tedy v našem případě voláme funkci 0, která ukončuje program. Hello, world! Pokud jste se těšili, že se dočkáte popisu programu "Hello, world!", musím vás zklamat. Tento program sice existuje, ale má 485 řádek, a tak by jeho popis nebyl příliš záživný. Každopádně zájemci si jej mohou přečíst u autorky zde, spolu s komentáři na každém řádku. AAAAAAAAAAAAAA!!!! Druhý dnešní jazyk má poměrně dlouhý název AAAAAAAAAAAAAA!!!! (pozor neplést s AAAAAAAAAAAA!!!! nebo AAAAAAAAAAAAAA!!, to už nejsou programovací jazyky, to již neznamená zhola nic :-) ). Tento programovací jazyk vytvořil Zzo38, který již má podobných jazyků na kontě desítky. AAAAAAAAAAAAAA!!!! používá poměrně malé množství znaků, konkrétně velké písmeno A, čárku, mezeru a vykřičník. Navíc je možné program zpřehlednit bílými znaky jako novými řádky, ty však interpret dle slov autora přeskakuje. Pro správné pochopení alespoň základní ukázky programu si musíme nejprve uvést ořezaný seznam příkazů, operátorů a operandů. Pokud budete chtít po dočtení článku svoje znalosti rozšířit, na stránce jazyka najdete další pokročilejší instrukce. Příkazy AA AAA n!- vypisuje číslo n jako znak AA AAAA AA!- ukončuje program AAA A AAA n!-začít definici subrutiny s názvemn AAAA A AAA!- konec subrutiny AAA A AA AAAA n!- vrátit návratovou hodnotun AAAAAA n!- zavolání subrutinyn Operátory, operandy AAAA- číslo 0 AAA- číslo 1 A- číslo 2 AA A- číslo 3 AA A,- součet čísela baab AA AA,- absolutní hodnota rozdílu (a - b)a b AAA,- součin čísela baab AAAAA A- volání subrutiny s názvemn, ana parametrema Z uvedeného výpisu si můžeme všimnout dvou překvapivých faktů. Prvním je to, že AAAAAAAAAAAAAA!!!! je schopné vypisovat pouze znaky, tedy pro výpis číselného výsledku je nutné jednotlivé číslice převádět na znaky. Druhým je to, že v programu si musíme vystačit pouze se čtyřmi čísly - 0, 1, 2 a 3 a jakákoliv jiná čísla musíme získat s jejich pomocí. Nyní již máme dostatek informací potřebných pro uvedení ukázkového programu, který kupodivu nevypisuje "Hello World", ale pouze "He". Ptáte se proč? Odpověď je snadná - bude nám to stačit, pochopení programu bude už tak dostatečně problematické. Nakonec ještě uvádím, že jde o kopii programu ze stránky jazyka a pro předvedení alespoň částečného arzenálu jazyka AAAAAAAAAAAAAA!!!! obsahuje i ukázku definice subrutiny, což však není nutností a jejím vynecháním by se program mírně (ale opravdu pouze mírně) zjednodušil. Inu, jdeme na to. Ukázkový program AA AAA AA AA, AAA, AAA, AA A AAA, AA A AA A AA A AAA, AA A AA A!AA AAA AA A, AAA AAAAA A AAAA, AAA!AA AAAA AA! AAA A AAA AAAA! AAA A AA AAAA AAA,AA A, AAA AAA, AA A AA A AA A,AAA AAA, AA A AA A! AAAA A AAA! Takže, půjdeme hezky postupně po jednotlivých příkazech, abychom se neztratili. Program začíná příkazem výpisu AA AAA, za kterým následuje číslo znaku, který chceme vypsat - pro získání tohoto čísla potřebujeme celý zbytek řádku až po vykřičník, který samotný výpis provádí. AA AA, nám uvádí, že budeme počítat absolutní hodnotu rozdílu. Prvním operandem tohoto rozdílu bude součin* (AAA,) součinu^ (další AAA,) čísla tři (AA A) a součinu (AAA,) čísel 3 a 3, a čísla 3 (druhý operand součinu^), a součinu čísel 3 a 3 (druhý operand součinu*). Když si to pomalu a pečlivě přepíšeme do přehlednějšího formátu, první řádek představuje následující: vypiš(absolutní hodnota rozdílu(součin(součin(3,součin(3,3)),3),součin(3,3))) Když si to přepočítáme, vyjde nám, že se vypíše znak odpovídající kódu 72 - po nahlédnutí do ASCII tabulky zjistíme, že jde o znak "H". Tak máme polovinu práce za sebou, teď tu druhou. Na druhém řádku je nejprve uveden příkaz výpisu a ten dostává jako parametr součet (AA A,) čísla 1 (AAA) a výsledku volání subrutiny s číslem 0 (AAAAA A AAAA, AAA). Všimněte si, že subrutině předáváme parametr 1, přestože jej nevyužije, ale neparametrické subrutiny jazyk AAAAAAAAAAAAAA!!!! nepovoluje. Třetí řádek nejprve ukončuje program (AA AAAA AA!) a poté začíná definici subrutiny s názvem 0 (AAA A AAA AAAA!). Ta obsahuje příkaz pro vrácení hodnoty (AAA A AA AAAA) výrazu až po nejbližší vykřičník. Zde opět musíme vypočítat součin součtu čísla 1 a součinu čísel 3 a 3 a součtu čísel 1 a součinu čísel 3 a 3. Popis jsem zkrátil, ale opět uvedu celý výraz v přehlednějším formátu: vrať(součin(součet(1,součin(3,3)),součet(1,součin(3,3)))) Subrutina je zakončena příkazem AAAA A AAA!. Když si spočítáme výslednou hodnotu, kterou naše subrutina spočítá, zjišťujeme, že jde o číslo 100. Nyní se vrátíme a vzpomeneme si, co dělal druhý řádek - vypisoval znak odpovídající hodnotě součtu čísla 1 a výsledku subrutiny. Tedy vypíše znak ASCII #101 - "e". Že to nebylo vůbec složité? Troufnete si program rozšířit na výpis celého "Hello, world!"? Závěr Dnešní obludárium je za námi, ale na další díl se můžete těšit brzy a opět si rozšíříme naši výstavku o dva esoterické programovací jazyky. Nakonec ještě vyhlašuji menší soutěž - kdo první zveřejní v komentářích k tomuto článku korektní zdrojový kód v jazyce AAAAAAAAAAAAAA!!!!, který vypisuje text "Hello, world!", bude uveden i se svým výtvorem hned v úvodu příštího dílu obludária!
I'm trying to go with-the-grain using Django TastyPie to update my models. I have an Identity model, acting as a wrapper around default Django user model: class Identity(ProfileBase): user = models.OneToOneField(User, related_name='identity') avatar = models.ImageField(upload_to=avatar_upload_path, blank=True, null=True) I have my UserResource: class UserResource(ModelResource): class Meta: resource_name = 'user' queryset = User.objects.all() fields = ['email', 'first_name', 'last_name'] include_resource_uri = False And I have my IdentityResource: class IdentityResource(ModelResource): user = fields.ToOneField(UserResource, 'user', full=True) class Meta: resource_name = 'identity' queryset = Identity.objects.select_related() fields = ['user', 'avatar'] always_return_data = True include_resource_uri = False authentication = OAuthTokenAuthentication() authorization = Authorization() I'm currently successfully updating first_name, last_name using the ModelResource obj_update method within IdentityResource: def obj_update(self, bundle, request, **kwargs): print 'updating object' bundle = self.full_hydrate(bundle) bundle.obj.user = request.user user = bundle.data['user'] bundle.obj.user.first_name = user['first_name'] bundle.obj.user.last_name = user['last_name'] return super(IdentityResource, self).obj_update(bundle, request, user=request.user) I want to make a PUT request and optionally update any field on the user or identity models (first_name, last_name on user, or the avatar field on identity). I would rather not have to manually access each field from the bundle data and set them on models manually, as I have done above. How can I do this naturally in TastyPie? Can someone explain a better approach to solving this problem? Any direction is GREATLY appreciated. :)
aeacides Re : Ultimate Smash Friends: un smash bros like en python Kewl! Bon boulot! De mon côté il me reste une semaine et demi de labeur, et après je devrais pouvoir m'y mettre :- ) @+ http://www.q-be.ca Hors ligne tshirtman Re : Ultimate Smash Friends: un smash bros like en python cool . Mon petit frère (qui a dessiné le premier perso, celui qui sert actuellement) semble vouloir faire des persos à partir des figurines en papier articulés qu'il à réalisé, on veras ce que ça donneras ça peut être sympa (mais bon je sais pas trop ou il en est vu que je suis à ~1000km de lui ^^). sinon j'ai pas trop testé (ça rentre pas dans l'écran de l'eee^^') mais j'ai vu le logiciel pencil pour faire des animations, il permet d'exporter frames par frames en png je crois, ça peut être pratique pour bosser. Hors ligne aeacides Re : Ultimate Smash Friends: un smash bros like en python cool . Mon petit frère (qui a dessiné le premier perso, celui qui sert actuellement) semble vouloir faire des persos à partir des figurines en papier articulés qu'il à réalisé, on veras ce que ça donneras ça peut être sympa (mais bon je sais pas trop ou il en est vu que je suis à ~1000km de lui ^^). sinon j'ai pas trop testé (ça rentre pas dans l'écran de l'eee^^') mais j'ai vu le logiciel pencil pour faire des animations, il permet d'exporter frames par frames en png je crois, ça peut être pratique pour bosser. Pour faire de l'animation traditionnelle j'utilise un logiciel de stop motion sous ubuntu. Si je me trompe pas, le nom c'est carrément «StopMotion» :- ) http://packages.ubuntu.com/gutsy/x11/stopmotion Dernière modification par aeacides (Le 18/04/2008, à 23:44) http://www.q-be.ca Hors ligne tshirtman Re : Ultimate Smash Friends: un smash bros like en python En fait: la condition cité hier est maintenant remplis, le perso change de sens quand on se déplace, les vecteurs sont bien transformés pour être dans le bon sens, les points agressifs sont modifié pour être du bon coté, et la projection résultant d'un coup est aussi dans le bon sens du coup j'ai mis ça à la place de l'alpha Hum, prochaine étape, abstraire les controles de touches pour binder facilement les touches a l'autre perso. Ensuite rendre le menu plus utilie (permetttre de lancer une partie avec des persos au choix depuis le menu, quitter...) Gérer les séquences de touches (une partie des choses necessaires est en place). Hors ligne tshirtman Re : Ultimate Smash Friends: un smash bros like en python touches -> fait j'ai ajouté l'icone des persos en bas de l'écran avec le pourcentage qui indique les coups qu'ils ont reçus, et qui as une influence sur la distance ou ils sont projetés. ça commence à rendre sympa je trouve. j'ai mis a jours l'alpha (encore oui ^^) et j'ai mis un tar.gz en téléchargement là; http://code.google.com/p/ultimate-smash-friends/downloads/list enjoy ah et il vas me falloire des musiques/sons/voix si quelqu'un est motivé il peut m'envoyer des bouts d'essais (faut que je vois si ça me convient avan de faire trop de boulot). Hors ligne MCMic(pas connecté) Re : Ultimate Smash Friends: un smash bros like en python Ouais, un bon projet délirant à suivre \o/ Je test ça dès que je suis de retour chez moi (ce soir) j'étudierai un peu le code voir si je peux aider mais chuis pas très doué en python, en tous cas je salue l'initiative, ça pourrait devenir un très bon jeu. PS: perso je bosse sur Slime Volley, c'est du C tshirtman Re : Ultimate Smash Friends: un smash bros like en python Ah oui j'avais vu ton projet il y as quelques temps ça a l'air sympatoche, j'aimais bien blobby volley dans le temps ^^. merci pour ton soutient, si tu veux regarder le code vas y, je trouve le python bien plus facile a comprendre que le C personellement (enfin on as aussi quelques syntaxe bien rigolote que tu peut pas deviner mais bon, c'est plus l'exeption que la règle). d'ailleur le svn as encore pas mal évolué par rapport a l'archive dont je met le lien au dessus, je pense en faire une autre bientot celle là est un peu brouillon ^^. Hors ligne MCMic Re : Ultimate Smash Friends: un smash bros like en python j'ai exécuté la commande présentée ici : http://code.google.com/p/ultimate-smash-friends/source/checkout et j'ai fait python main.py dans le dossier alpha, quand j'appuie sur certaine touches le jeu plante oO Traceback (most recent call last): File "main.py", line 29, in <module> main() File "main.py", line 27, in __init__ self.game.go() File "/home/come/ultimate-smash-friends-read-only/alpha/game.py", line 74, in go player.update( deltatime, self.last_clock, self.screen, self ) File "/home/come/ultimate-smash-friends-read-only/alpha/players.py", line 54, in update self.character.update( t, self.reversed) File "/home/come/ultimate-smash-friends-read-only/alpha/character.py", line 71, in update self.animation = self.animations[self.current_animation] KeyError: 'roll' le main.py du dossier trunk marche par contre. Dernière modification par MCMic (Le 21/04/2008, à 18:24) Hors ligne tshirtman Re : Ultimate Smash Friends: un smash bros like en python oui, c'est corrigé depuis, j'avais laissé trainé ça un peu trop longtemps (alors que c'était facile à corriger) c'est juste que l'action roulade n'est pas définie et "bas" tentait de la faire, donc pour l'instant j'ai juste désactivé, le temps d'avoir un perso avec tous les mouvement définis... c'est d'ailleur de ce coté là que le jeu peut le plus progresser actuellement, le moteur du jeu étant bien avancé, il ne manque plus que d'avoir des persos... (bon il reste quand même un peu de code à pondre hein pour que toutes les actions marchent vous affolez pas). Avis aux volontaires . Hors ligne MCMic Re : Ultimate Smash Friends: un smash bros like en python oui, c'est corrigé depuis, j'avais laissé trainé ça un peu trop longtemps (alors que c'était facile à corriger) c'est juste que l'action roulade n'est pas définie et "bas" tentait de la faire, donc pour l'instant j'ai juste désactivé, le temps d'avoir un perso avec tous les mouvement définis... c'est d'ailleur de ce coté là que le jeu peut le plus progresser actuellement, le moteur du jeu étant bien avancé, il ne manque plus que d'avoir des persos... (bon il reste quand même un peu de code à pondre hein pour que toutes les actions marchent vous affolez pas). Avis aux volontaires . ha je pensais avoir la dernière version en prenant sur ce svn... on la choppe où alors la dernière version? PS:pour le code python c'est définitivement hors de ma portée ^^ tout ce que je sais faire en python, c'est des ptits scripts pour le tux droid [EDIT] j'essaierai de faire un perso slime pour ton jeu (il faudrait reprendre le principe de super smash bros en reprenant toutes les mascottes de jeux vidéo libres, une slime, un super tux, le ptit gars de pang zero, un manchot rond de mtp target (il remplacerait rondoudou ou kirby), le héros de "wich the way is up", une moto d'armagetron, le perso de xmoto, le héros de metal blob solid, un truc de globulation, etc, etc, ... ^^) Dernière modification par MCMic (Le 21/04/2008, à 18:47) Hors ligne tshirtman Re : Ultimate Smash Friends: un smash bros like en python hop justement une release toute chaude http://ultimate-smash-friends.googlecode.com/files/ultimate-smash-friends_2008-04-22_01h_28m_11s.tar.gz c'est une archive, copie du svn il y as 1/4 d'h et avec quelques sympatiques améliorations nb: tu avais bien la dernière version, je n'ais pas été clair, je voulais dire que c'était corrigé dans trunk, mais pas dans alpha, (je copie trunk dans alpha quand je suis assez content des progres de trunk). la première archive a eu 9 téléchargement, sympa edit: pour l'idée de reprendre les persos de jeux libres ça peut être sympa, il faut juste qu'ils aient tous une palette de mouvement équivalente (marcher sauter, taper, taper en l'aire, rouler/ramper, faire un double saut, et au moins un ou deux coup spéciaux, mais bien plus si possible). A voir donc, toute contribution est bienvenue Dernière modification par tshirtman (Le 22/04/2008, à 02:00) Hors ligne MCMic Re : Ultimate Smash Friends: un smash bros like en python tu pourrais expliquer toutes les possibilités actuelles stp PS:les mouvements possibles et les touches correspondantes. Hors ligne tshirtman Re : Ultimate Smash Friends: un smash bros like en python ou peut se déplacer et sauter (touches de directions pour le perso noir, zqsd pour le bleu), et taper (l pour le noir, c pour le bleu). ces touches sont configurables dans le fichier UltimateSmashFriends.cfg edit: c'est vrais que j'ai du mal à inclure toutes les infos nécessaire dans chaques releases, y'as toujours trop de trucs qui me paraissent évidents -_-. Dernière modification par tshirtman (Le 22/04/2008, à 08:30) Hors ligne tshirtman Re : Ultimate Smash Friends: un smash bros like en python Hop hop hop, une nouvelle version toute chaude... http://ultimate-smash-friends.googlecode.com/files/ultimate-smash-friends-2008-04-27.tar.gz (ou svn update dans le dossier pour ceux qui ont pris le svn) les nouveautés (si j'en oublis pas): *bug de l'écran tremblant corrigé *les persos utilisent deux touches en plus de leur direction, appelés A et B (l et m pour le premier perso, voir le fichier .cfg) *gestion des actions necessitant plusieurs touches, les smash sont maintenant déclenché quand on fait une direction puis la touche B, quand on fait une direction puis la touche A ça fait une attaque spéciale, le systeme demande surement des réglages au niveau temps. *animations allant avec ces actions ajoutés bien sur. *corrections de bugs dans la gestions des collisions, qui n'était pas visibles avant. Dernière modification par tshirtman (Le 27/04/2008, à 20:34) Hors ligne MCMic Re : Ultimate Smash Friends: un smash bros like en python nickel, je teste Hors ligne MCMic Re : Ultimate Smash Friends: un smash bros like en python il faut bien faire "python main.py" pour lancer le jeu? Bon sinon, on a toujours un resultat mitigé, on souvent du mal à vouloir faire l'action qu'on veut avec son perso, parfoi il passe au travers des autres au lieu de les frapper, etc... bref, ya du progrès, mais c'est pas encore très convaincant. (je pense qu'il va falloir encore pas mal de boulot sur le moteur) Hors ligne tshirtman Re : Ultimate Smash Friends: un smash bros like en python Salut: MCMic : dsl j'avais pas vu ta dernière réponse, (le topic n'apparaissait pas en gras, donc j'ai pas vérifié -_-) en effet j'ai du boulot sur le moteur. mais ça avance. (sinon ./main.py suffit) la version svn a été mis à jours, le jeu supporte de zoomer dézoomer quand on a un niveau plus grand que l'écran, si les persos s'éloignent les uns des autres ça dézoom pour suivre, cet ajout m'a pris beaucoup de temps car ça faisait beaucoup rammer, mais je crois que la solurtion actuelle est une bonne solutions (zoom moins fluide et mise en cache des résultats). Il y as quelques nouveaux persos (un entièrement original et deux variations sur le premier) et un nouveau niveau, vite fait pour tester. Je ne fait pas tout de suite de release, en effet il y as quelques bugs qui ont trop trainé, notemment le fait de parfois passer au travers du sol (suite a un lag). Donc je vais essayer de stabiliser sur la qualité avant d'ajouter de nouvelles choses... si vous voulez quand même tester il y as le svn, (trunk) sinon la release peut être aujourd'hui (si miracle ) peut être avant lundi, peut être plus tard . ensuite le prochain objecyif seras un nettoyage du code en ressortant toute constante dans un fichier externe ça permettras de faire des tests sur les réglages plus facilement. voila, c'était les nouvelles pour dire que c'est pas mort . Dernière modification par tshirtman (Le 09/05/2008, à 13:12) Hors ligne Erlewyn Re : Ultimate Smash Friends: un smash bros like en python MCMic : dsl j'avais pas vu ta dernière réponse, (le topic n'apparaissait pas en gras, donc j'ai pas vérifié -_-) Vive les sujets suivis et la possibilité de s'abonner à un topic, hein Hors ligne tshirtman Re : Ultimate Smash Friends: un smash bros like en python j'y avais même pas pensé ^^', c'est vrais que je devrait m'abboner a celui là quand même je fait ça de ce pas...:) Hors ligne vida18 Re : Ultimate Smash Friends: un smash bros like en python Pourquoi vous ne permettez pas de choisir la résolution? afin de ne pas se cloitrer aux résolutions consoles... Pour le reste, petit conseil : prévoyez une vraie doc d'install. Hors ligne tshirtman Re : Ultimate Smash Friends: un smash bros like en python la résolution seras "bientot" changeable plus facilement (pas la version que je prépare mais la suivante), ça découleras directement d'un certain ménage du code... la résolution actuelle n'est guere adapté qu'a l'eeepc qui est la machine ou je développe. pour la doc d'installe oui, c'est necessaire en fait toute la (faible) doc a besoin de boulot, je manque déja de temps pour avancer le code alors ça prends du retards, j'en suis désolé. merci de votre intéret. Hors ligne tshirtman Re : Ultimate Smash Friends: un smash bros like en python http://ultimate-smash-friends.googlecode.com/files/ultimate-smash-friends-2008-05-15.tar.gz hop nouvelle version, comme d'habitude il suffit de décompresser, d'avoir python et python-pygame d'installé et de double cliquer sur main.py. nouveautées... * support de niveau de taille en théorie non limitée ( en pratique on vas rester raisonnable ) * support du zoom: quand les personnages s'éloignent trop les uns des autres le jeu "dézoome" pour que tout le monde reste a l'écran. * améliorations des collisions, ça reste pas tout a fait parfait dans les cas ou ça rame un peu (si la machine est un peu faible) j'èspère pouvoir encore progresser mais je crois que c'est pas mal. * ajout d'une minicarte du niveau qui affiche la géométrie réelle du niveau (par opposition au dessin du niveau). *diverses modifications sur les personnages, et surtout du blob dont les points agressifs étaient très mal a propos... voila je crois que j'ai fait le tour... enjoy Hors ligne LittleWhite Re : Ultimate Smash Friends: un smash bros like en python J'ai testé pour la première fois : J'ai vu un truc assez bizarre : Lorsque j'attaque en déplacement avec gauche et droite ( vu avec J1 et J2 ) et eu des sortes de "téléportation" du coup je suis tombé ^^. Mais la deuxième fois j'ai reussi à me téléporter en haut de l'ecran donc pas mort . Je le signale car je sais pas si c'est normal. Au sinon lorsque les persos sautent ils semblent restés figé en l'air lorsque qu'il arrive en haut de leur saut ( je pense que c'est l'utilisation d'un sinus ou un cosinus, mais du coup il reste trop longtemps sur des valeurs proches de zero ) J'ai planté le programme lorsque trois joueurs sont mort dans cette ordre ( J2 J1 J3 ), semble être à chaque fois qu'il reste un joueur Rapport : File "./main.py", line 29, in <module> main() File "./main.py", line 27, in __init__ self.game.go() File "/tmp/ultimate-smash-friends-2008-05-15/game.py", line 93, in go self.zoom=min(800.0/(rightwing-leftist),1.1) ZeroDivisionError: float division Certains deplacement ( scrolling ) de l'ecran sont trop brutes ( par acoup ) surtout sur la droite. Y a t'il un temps où lorsque l'on tombe on reapparait ? Voila , je crois que j'ai tout dis, je continue à suivre ce projet mais en y restant très éloigné . Bonne continuation, le travail est déjà conséquent. Dernière modification par LittleWhite (Le 15/05/2008, à 14:34) Linux ou mourir Pour avoir des problemes : demarrer Windows Script de compression multi archive : http://forum.ubuntu-fr.org/viewtopic.php?id=225297 Hors ligne kaoron Re : Ultimate Smash Friends: un smash bros like en python Salut! D'abord, bravo pour le boulot effectué sur ce projet. Petit rapport de bug ensuite : si je génere trop d'evenements souris (faire quelques mouvements), je perds la fenêtre pygame. Impossible d'en prendre le controle, de la fermer ou d'envoyer un signal de terminaison au process python, obligé de kill ou fermer le terminal. J'ai essayé de caler un pygame.event.pump() à chaque tour de boucle pour vider la file d'evenements non gérés, mais rien n'y fait. Et aussi, le stickman fait un mouvement sur la droite lors d'un simple saut sur place. Vouala, je m'abonne et bonne continuation! tshirtman Re : Ultimate Smash Friends: un smash bros like en python J'ai testé pour la première fois : J'ai vu un truc assez bizarre : Lorsque j'attaque en déplacement avec gauche et droite ( vu avec J1 et J2 ) et eu des sortes de "téléportation" du coup je suis tombé ^^. Mais la deuxième fois j'ai reussi à me téléporter en haut de l'ecran donc pas mort . Je le signale car je sais pas si c'est normal. Non c'est pas vraiement normal, ça ressemble fort a un bug de collision, preuve qu'il me reste du boulot de ce coté là, le jeu était bien fluide? (je n'ai plus de bugs de collisions quand le jeu est fluide, mais j'en ais quand il rame un peu). Au sinon lorsque les persos sautent ils semblent restés figé en l'air lorsque qu'il arrive en haut de leur saut ( je pense que c'est l'utilisation d'un sinus ou un cosinus, mais du coup il reste trop longtemps sur des valeurs proches de zero ) ni sinus ni cosinus, c'est plutot du newton, le personnage subis un vecteur quand il saute et un autre continuellement qui représente la gravité, donc *normalement* c'est plutot réaliste, (mais j'ai peut être loupé un truc, cat_loic m'ayant déja dit que ça ne lui semblait pas naturel non plus). J'ai planté le programme lorsque trois joueurs sont mort dans cette ordre ( J2 J1 J3 ), semble être à chaque fois qu'il reste un joueur Rapport :<metadata lang=Python prob=0.10 /> File "./main.py", line 29, in <module> main() File "./main.py", line 27, in __init__ self.game.go() File "/tmp/ultimate-smash-friends-2008-05-15/game.py", line 93, in go self.zoom=min(800.0/(rightwing-leftist),1.1) ZeroDivisionError: float division oui, je suis bête je laisse trainer les bugs les plus faciles à corriger -_-, la gestion de fin de jeu a été cassé il y a un certain temps il faut juste que je pense a le réparer... Certains deplacement ( scrolling ) de l'ecran sont trop brutes ( par acoup ) surtout sur la droite. en fait quand il y as un a coup c'est que le jeu a dézoomé, on ne comprends pas bien car le centrage du zoom n'est pas parfait, on peut rendre le dézoom plus fluide (de plus petits a coup) mais ça diminue les performances (je ne peut pas me permettre de recalculer l'étirement/compréssion du niveau a chaques images, donc la première fois qu'on tombe sur un niveau de zoom je le calcul et le met en mémoire, si on augmente la fluidité du zoom on calcul bien plus souvent, et donc le ralentissement devient sensible, sur mon eeepc en tout cas. Y a t'il un temps où lorsque l'on tombe on reapparait ? Non on réapparait tout de suite et c'est encore un peu buggé de ce coté là, car il arrive qu'on perde plus d'une vie d'un coup, je tacherais de me pencher là dessus ça doit pas être gros. Voila , je crois que j'ai tout dis, je continue à suivre ce projet mais en y restant très éloigné . Bonne continuation, le travail est déjà conséquent. Merci pour ton retour détaillé et tes encouragement Dernière modification par tshirtman (Le 15/05/2008, à 22:28) Hors ligne
Both PyQt4 and PySide have very similar mappings to the Qt API. There are, however, some differences, my opinions on which are described below: Maintenance They are both well maintained. The PySide produces a lot more regular releases at the moment: I think it's more closely linked to Qt than PyQt4 and as a newer project has a more active community at the moment. However, that is just my impression and it may be wrong. PyQt4 has the option of commercial support available (I don't know whether this is true for PySide or not). Licence PyQt4 is released under either a commercial licence or the GPL; PySide is released under the LGPL. For commercial applications, this is a significant difference. APIs and Python versions PyQt4 supports two different APIs. API version 1 is the default for python 2.x applications and API version 2 is the default for python 3.x applications. PySide only supports one API, which is roughly equivalent to PyQt4's API version 2. API version 2 (or the PySide API) is much nicer to work with than PyQt4's API version 1. In API version 1 you have a lot of code that casts python strings to QtCore.QStrings and back again. In API version 2 (and PySide) you just use python strings throughout. See below for a simple way of switching between PyQt4 and PySide if you want to play with both. Most code I write seems to work equally well in PyQt4 and PySide. Historically, I had always used PyQt4 for python GUIs but most new stuff I write now uses PySide (mainly due to the more flexible licensing). I'd certainly recommend you try both and see how you find them. If you use QtVariant.py (below), switching between them is trivial and when you make a decision there will only be one file that needs updating. Documentation The documentation for both PyQt4 and PySide are auto-generated from the main Qt documentation. In my opinion, the PySide documentation is a better representation of what you actually use, but in practice I tend to just use the Qt documentation anyway (it's quite easy to mentally translate the C++ documentation to python). External Libraries If you're using external libraries, some do not work with PySide yet. There aren't many that you need to work with PySide to be honest, but a couple of years ago I wrote some code that used twisted (with the Qt reactor) and matplotlib and that forced me down the line of using PyQt4 rather than PySide. I think it's quite likely that these libraries will have been updated to support both by now, but I haven't checked. Making Code work with either PyQt4 or PySide Assuming you're using python 2.x, you can fairly easily make your code compatible with both PySide and PyQt4 by making a QtVariant.py and using: from QtVariant import QtGui, QtCore or whatever. The QtVariant.py that I use looks like this: import sys import os default_variant = 'PySide' env_api = os.environ.get('QT_API', 'pyqt') if '--pyside' in sys.argv: variant = 'PySide' elif '--pyqt4' in sys.argv: variant = 'PyQt4' elif env_api == 'pyside': variant = 'PySide' elif env_api == 'pyqt': variant = 'PyQt4' else: variant = default_variant if variant == 'PySide': from PySide import QtGui, QtCore # This will be passed on to new versions of matplotlib os.environ['QT_API'] = 'pyside' def QtLoadUI(uifile): from PySide import QtUiTools loader = QtUiTools.QUiLoader() uif = QtCore.QFile(uifile) uif.open(QtCore.QFile.ReadOnly) result = loader.load(uif) uif.close() return result elif variant == 'PyQt4': import sip api2_classes = [ 'QData', 'QDateTime', 'QString', 'QTextStream', 'QTime', 'QUrl', 'QVariant', ] for cl in api2_classes: sip.setapi(cl, 2) from PyQt4 import QtGui, QtCore QtCore.Signal = QtCore.pyqtSignal QtCore.QString = str os.environ['QT_API'] = 'pyqt' def QtLoadUI(uifile): from PyQt4 import uic return uic.loadUi(uifile) else: raise ImportError("Python Variant not specified") __all__ = [QtGui, QtCore, QtLoadUI, variant]
raspouillas Re : Topic des lève-tôt… Faisons manger leurs caleçons aux couche-tard! [4] Je ne faisait aucune allusion au problème de @souen. Dernière modification par raspouillas (Le 15/06/2012, à 20:37) ljere Re : Topic des lève-tôt… Faisons manger leurs caleçons aux couche-tard! [4] alors voici la première partie du script et la j'ai besoin d'aide car je ne suis sure de rien ]#!/usr/bin/python # encoding: utf-8 from BeautifulSoup import BeautifulSoup import urllib2 import re import time import sys import mechanize# est ce que je peux mette ces 3 lignes sur 1 seul? ignoreList = ( 'compteur des leve tot', )# pourquoi on utilise """ au lieu d'un simple "en début et fin et ne peut on simplifié la phrase? class Day: """un jours dure de 5h à 9h du matin exclu ([5h:9h[) il contient la dernière entrée (points) de ce jour pour chaque joueurs""" def __init__(self): self.entries={} def __str__(self): for entry in self.entries.items(): print entry,'+',entries[entry]# c'est normal que ce def n'est pas aligné aux autres?def utcFrance(): return 1 + time.localtime(time.time())[-1] #1 + 1 si on est a l'heure d'été # ici je crois qu'on doit modifier en def __init__(self,tuple=(5,9),utc=utcFrance()):class Date: def __init__(self,tuple=(20,0),utc=utcFrance()): self.h = (int(tuple[0])-utcFrance()+24+utc)%24 self.m = int(tuple[1]) def __cmp__(self, other): return cmp(self.points(),other.points()) def points(self): pts = {5: 10, 6: 6, 7: 3, 8: 1} return pts.get(self.h, 0) si vous avez les réponses ou d'autres suggestions je vous écoute merci Hors ligne Pylades Re : Topic des lève-tôt… Faisons manger leurs caleçons aux couche-tard! [4] # est ce que je peux mette ces 3 lignes sur 1 seul? Oui, mais c’est mieux sur trois lignes. # pourquoi on utilise """ au lieu d'un simple "en début et fin et ne peut on simplifié la phrase? Pour pouvoir écrire cette docstring sur plusieurs lignes si besoin. On peut reformuler sans impacter le fonctionnement du programme. # c'est normal que ce def n'est pas aligné aux autres? Oui, faut pas toucher. # ici je crois qu'on doit modifier en def __init__(self,tuple=(5,9),utc=utcFrance()): Possible, mais c’est probablement plus compliqué… ce compteur est presque immaintenable. Mais bon, dans un futur plus ou moins proche, on va refaire un compteur propre pour le TdCT. Du coup, il s’adaptera ici en un clin d’œil. Dernière modification par Πυλάδης (Le 15/06/2012, à 18:49) “Any if-statement is a goto. As are all structured loops. “And sometimes structure is good. When it’s good, you should use it. “And sometimes structure is _bad_, and gets into the way, and using a goto is just much clearer.” Linus Torvalds – 12 janvier 2003 Hors ligne ljere Re : Topic des lève-tôt… Faisons manger leurs caleçons aux couche-tard! [4] Mais bon, dans un futur plus ou moins proche, on va refaire un compteur propre pour le TdCT. Du coup, il s’adaptera ici en un clin d’œil. c'est marrant nesthib m'a dit la même chose mais quand personne le sais .... donc en attendant si on veut bien continuer à m'aider j’apprends le python et j'arriverai peut être à avoir un compteur viable en attendant un compteur plus maintenable et en phase avec python 2.7.3 alors que le script de tshirtman est prévu pour du python 2.6.* /me est donc décidé à persévérer Hors ligne ljere Re : Topic des lève-tôt… Faisons manger leurs caleçons aux couche-tard! [4] peux t'on me dire que fait (veut dire) cette partie if ( (str_date.split(' ')[0] in ['Hier'] and int(str_date.split(' ')[2].split('<')[0].split(':')[0]) in range(5,24)) or (str_date.split(' ')[0] in ["Aujourd\'hui"] and int(str_date.split(' ')[2].split('<')[0].split(':')[0]) in range(5)) ): Hors ligne Floyd Pepper Re : Topic des lève-tôt… Faisons manger leurs caleçons aux couche-tard! [4] [ /me est donc décidé à persévérer /me t'encourage vivement, et j'espère que le truc grec t'a donné de vrais conseils hors forum, cause que vu d'ici, cette intervention est aussi péremptoire qu'inutile. Perso, je ne peux que te soutenir et te souhaiter de nous faire "the compteur des Lts" qui sera adapté au Cts. Vieux papy triste et Hétérocentriste (conditionné), en attente d'être complètement con×. J'aurais tendance à ne pas utiliser de smilleys. Le plus tu t'fais chier, le plus t'es emmerdé. Hors ligne ljere Re : Topic des lève-tôt… Faisons manger leurs caleçons aux couche-tard! [4] répondu golgoth42 Floyd Pepper merci pour les encouragements, par contre continu de poster le tien j'en ai besoin pour mes test Hors ligne Floyd Pepper Re : Topic des lève-tôt… Faisons manger leurs caleçons aux couche-tard! [4] 'jour Vieux papy triste et Hétérocentriste (conditionné), en attente d'être complètement con×. J'aurais tendance à ne pas utiliser de smilleys. Le plus tu t'fais chier, le plus t'es emmerdé. Hors ligne ljere Re : Topic des lève-tôt… Faisons manger leurs caleçons aux couche-tard! [4] bonjour tout le monde Hors ligne souen Re : Topic des lève-tôt… Faisons manger leurs caleçons aux couche-tard! [4] Hello bonjour Tu es programmé, mais tu es libre. Ubuntu Studio "Si il n'y a pas de solution, c'est qu'il n'y a pas problème !" (sagesse Shadok) Hors ligne PPdM Re : Topic des lève-tôt… Faisons manger leurs caleçons aux couche-tard! [4] Salutatous par Toutatis! Un vrai ennemi ne te laissera jamais tomber. Hors ligne raspouillas Re : Topic des lève-tôt… Faisons manger leurs caleçons aux couche-tard! [4] bonjour .... raspouillas Re : Topic des lève-tôt… Faisons manger leurs caleçons aux couche-tard! [4] PS: Je n'ai de retour de réponse ? Mindiell Re : Topic des lève-tôt… Faisons manger leurs caleçons aux couche-tard! [4] ... bonjour ! Une seconde, on est samedi @ljere: spli permet de séparer une chaine en n morceaux séparés par le caractère donné. En prenant la date affichée : Hier à 21:19 ou Aujourd'hui à 08:56 on obtient alors un tableau du type [0] => "Hier", [1] => "à", [2] => "21:19" Ensuite le triple split, resplite la chaine et utilise le 3eme élément pour tenter d'en extraire l'heure. le split avec '<' est inutile dans ce cas, il a du être rajouté à une époque lointaine (ancien forum ?). On obtient donc un seul élément égal au 3eme élément déjà pris en compte ("21:19"), puis on split par le ":" pour obtenir l'heure et on s'intéresse aux heures comprises entre 5 et 24. Le deuxième partie s'intéresse aux heures entre 0 et 5. Au final, tu obtiens donc les informations pour les dernières 24 heures, et on peut, dès lors, supposer que le compteur se lance tous les jours à 5h00 du matin PS: j'ai pas répondu en mp : c'était déjà fait, et puis ça peut en intéresser d'autres Hors ligne ljere Re : Topic des lève-tôt… Faisons manger leurs caleçons aux couche-tard! [4] donc comme pour nous on s’intéresse à une période de 6h à 9h if ( (str_date.split(' ')[0] in ["Aujourd\'hui"] and int(str_date.split(' ')[2].split(':')[6]) in range(8)) ): comme 9h est exclu je doit bien mettre 8? Hors ligne Floyd Pepper Re : Topic des lève-tôt… Faisons manger leurs caleçons aux couche-tard! [4] 1 1787 FloydPepper 2 1543 pierguiard 3 1463 MdMax 4 1247 Azurea 5 1199 souen 6 968 Ras&#039; 7 767 raspouillas 8 552 Arcans 9 428 peterp@n 10 359 golgoth42 11 293 mindiell 12 277 omc 13 219 Πυλάδης 14 176 pololasi 15 117 edge_one 16 101 nathéo 17 99 karameloneboudeplus 18 61 agarwood 19 60 Niltugor 20 52 1101011 20 52 jeyenkil 20 52 ljere 23 43 Crocoii 24 42 nakraïou 24 42 DaveNull 26 40 Biaise 27 39 Clem_ufo 28 38 Atem18 29 22 marinmarais 30 18 Ju 31 13 Le grand rohr sha 32 10 Phoenix 32 10 FLOZz 32 10 sakul 32 10 SopolesRâ 36 6 wiscot 36 6 timsy 36 6 Slystone 36 6 Hibou57 36 6 tshirtman 36 6 marting 36 6 c4nuser 43 4 Morgiver 43 4 :!pakman 45 3 Phoenamandre 45 3 gonzolero 45 3 helly 45 3 Le Rouge 49 1 herewegoagain 49 1 TheUploader 49 1 Kyansaa 49 1 Xiti29 Vieux papy triste et Hétérocentriste (conditionné), en attente d'être complètement con×. J'aurais tendance à ne pas utiliser de smilleys. Le plus tu t'fais chier, le plus t'es emmerdé. Hors ligne Ras&#039; Re : Topic des lève-tôt… Faisons manger leurs caleçons aux couche-tard! [4] J'me réveille -__________-' C'est trop tard pour les points ? Va t'faire shampouiner en GMT-4 ! http://blag.xserver-x.org/ Les types awesome n'ont rien à prouver. À personne. En ligne PPdM Re : Topic des lève-tôt… Faisons manger leurs caleçons aux couche-tard! [4] J'me réveille -__________-' C'est trop tard pour les points ? nan tu es en avance pour demain! Hors ligne Ras&#039; Re : Topic des lève-tôt… Faisons manger leurs caleçons aux couche-tard! [4] Va détourer ton avatar au lieu de te moquer ! Va t'faire shampouiner en GMT-4 ! http://blag.xserver-x.org/ Les types awesome n'ont rien à prouver. À personne. En ligne Mindiell Re : Topic des lève-tôt… Faisons manger leurs caleçons aux couche-tard! [4] donc comme pour nous on s’intéresse à une période de 6h à 9h if ( (str_date.split(' ')[0] in ["Aujourd\'hui"] and int(str_date.split(' ')[2].split(':')[6]) in range(8)) ): comme 9h est exclu je doit bien mettre 8? En fait j'aurai plutôt mis ça : if ( (str_date.split(' ')[0] in ["Aujourd\'hui"] and int(str_date.split(' ')[2].split(':')[0]) in range(5,8)) ): Car : - je ne sais pas pourquoi tu mets 6 au lieu de 0 dans le tableau : quand tu coupes 05:34 en chaines par rapport à ":", tu obtiens un tableau de deux éléments : "0" => "05", "1" => "34" - Il faut s'occuper uniquement de 5 à 8 heures Voilà PS: Ah oui, ça à l'air facile python ou pas ? Hors ligne raspouillas Re : Topic des lève-tôt… Faisons manger leurs caleçons aux couche-tard! [4] Bonjour ... ljere Re : Topic des lève-tôt… Faisons manger leurs caleçons aux couche-tard! [4] bonjour ... Hors ligne ljere Re : Topic des lève-tôt… Faisons manger leurs caleçons aux couche-tard! [4] @Mindiell ce n'est pas facile mais c'est intéressant encore merci pour tes conseils et explications Hors ligne Floyd Pepper Re : Topic des lève-tôt… Faisons manger leurs caleçons aux couche-tard! [4] 'jour Vieux papy triste et Hétérocentriste (conditionné), en attente d'être complètement con×. J'aurais tendance à ne pas utiliser de smilleys. Le plus tu t'fais chier, le plus t'es emmerdé. Hors ligne
Tony95 Re : Ella : projet de logiciel d'animation Flash & SVG pour Linux Salut à tous je savais pas trop où poster donc je le fais ici. J'ai un petit soucis en GTK, j'aimerais créer une interface permettant de charger et sauvegarder des fichiers mais j'arrive vraiment pas à m'en sortir pour le code. En gros j'ai une fenetre qui me sert de menu avec 4 boutons dont deux servant respectivement à charger et à sauvegarder des fichiers. J'ai du mal à connecter chaque bouton à la fonction qui va avec (c'est mon premier soucis). Ce que je veux dire c'est qu'après avoir cliqué sur le bouton "sauvegarder" j'aimerais avoir l'affichage de la fenêtre de chargement des fichiers. Et la même chose pour sauvegarder aussi. J'ai juste trouvé une fonction pour renvoyer le chemin du fichier sélectionné mais elle est un peu inutile. Je tien sà préciser que je suis nul en GTK et que j'ai juste des notions de base. Merci d'avance pour votre aide. Hors ligne philarmonie Re : Ella : projet de logiciel d'animation Flash & SVG pour Linux @ kevlar: c'est surtout les abscisses dont tu as besoin pour la position des events, non? et la police a un impact dessus? Pour ce qui est de la technique de surcharge, là ça rentre dans du C donc je ne comprends pas tout, mais on doit pouvoir faire sans. Normalement quelque soient les containers dans lesquels se trouve ton widget, ça n'a pas d'impact sur la façon de gérer les events. Pour le motion-notify-event en python je peux le capter sans problème #!/usr/bin/pyhton import gtk class Win: def __init__(self): self.win = gtk.Window() self.ruler = gtk.HRuler() self.ruler.set_size_request(200, 20) self.ruler.set_range(0, 200, 10, 200) # rajoute la gestion du clic pour le ruler self.ruler.add_events(gtk.gdk.BUTTON_PRESS_MASK) self.win.connect("delete-event", gtk.main_quit) self.win.add(self.ruler) self.ruler.connect('button-press-event', self.press) self.ruler.connect('motion-notify-event', self.move) self.win.show_all() def press(self, widget, event): print 'pressed on', event.get_coords() def move(self, widget, event): print 'move on', event.get_coords() if __name__ == '__main__': win = Win() gtk.main() Edit: ce n'est pas la peine de rajouter cet event, il est déjà capté par le ruler (et a déjà un callback dessus) il faut juste rajouter un callback dessus. @ Tony95: ouvre ton propre sujet et précise dans quel langage tu codes. Dernière modification par philarmonie (Le 08/06/2009, à 20:12) kevlar Re : Ella : projet de logiciel d'animation Flash & SVG pour Linux merci Philarmonie. En fait, je me débrouille en utilisant la dernière version(message #25), et maintenant, le déplacement de la règle est coordonné avec celui de la timeline, de l'indicateur de position dans l'animation, et cela sans utiliser les GTkRulers. Reste à terminer de répondre au défi en trouvant un moyen d'installer un "balayage" de la position courante, comme sur Macromedia Flash Pro, mais à mon avis ça peut se résoudre avec une gestion "habile" des icônes ... Ella : projet de logiciel d'animation Flash pour Linux http://forum.ubuntu-fr.org/viewtopic.php?id=321017&p=1 Projet Ella sur launchpad : https://launchpad.net/ella Le retour d'Ella animations avec le projet Renaissance est ici : https://launchpad.net/ella-renaissance et des fichiers de démo ici : http://ellarenaissance.voila.net/index.html Hors ligne kevlar Re : Ella : projet de logiciel d'animation Flash & SVG pour Linux eh bien, la solution aux limites de Gtk est un projet complémentaire, goocanvas ; il permet enfin une gestion "moderne" des éléments graphiques, permettant entre autres de faire répondre des morceaux de dessins à des clics souris, etc .. . Ella : projet de logiciel d'animation Flash pour Linux http://forum.ubuntu-fr.org/viewtopic.php?id=321017&p=1 Projet Ella sur launchpad : https://launchpad.net/ella Le retour d'Ella animations avec le projet Renaissance est ici : https://launchpad.net/ella-renaissance et des fichiers de démo ici : http://ellarenaissance.voila.net/index.html Hors ligne philarmonie Re : Ella : projet de logiciel d'animation Flash & SVG pour Linux eh bien, la solution aux limites de Gtk est un projet complémentaire, goocanvas; il permet enfin une gestion "moderne" des éléments graphiques,permettant entre autres de faire répondre des morceaux de dessins à des clics souris, etc.. . Bah on peut le faire en gtk sans goocanvas. J'ai fait une logiciel de création de thème usplash, j'ai une DrawingArea dans laquelle je dessine le thème avec son arrière plan, sa barre et sa zone de texte, et elle réagit très bien aux actions de la souris. Il me manque juste le redimensionnement des objets avec la souris mais c'est pas un problème de gestion des événements, mais plutôt d'apprendre à dessiner des rectangles transparents avec cairo. kevlar Re : Ella : projet de logiciel d'animation Flash & SVG pour Linux intéressant, tu peux mettre une copie d'écran ? (moi je ne peux pas, ImageShack ne répond pas en ce moment ...) Dernière modification par kevlar (Le 15/06/2009, à 17:31) Ella : projet de logiciel d'animation Flash pour Linux http://forum.ubuntu-fr.org/viewtopic.php?id=321017&p=1 Projet Ella sur launchpad : https://launchpad.net/ella Le retour d'Ella animations avec le projet Renaissance est ici : https://launchpad.net/ella-renaissance et des fichiers de démo ici : http://ellarenaissance.voila.net/index.html Hors ligne kevlar Re : Ella : projet de logiciel d'animation Flash & SVG pour Linux Voici une copie : la règle ne provient pas de Gtk : elle est gérée par goocanvas. Elle est composée d'éléments graphiques standards (lignes, texte) qui peuvent chacun émettre des événements. Ainsi, un clic sur une des graduations, ou sur le numéro de l'image, renvoit à un traitement à callback. A titre de comparaison, la dernière version "pure Gtk" est ci-dessous : Il est facile de voir qu'il me fallait TROIS lignes de widgets pour faire la même règle (capable, bien entendu, de réagir aux clics, il ne s'agissait déjà plus d'un GtkRuler). De plus, avec goocanvas, l'espace est mieux géré, je peux contrôler le rendu de la règle (car goocanvas s'appuie sur cairo ) Dernière modification par kevlar (Le 15/06/2009, à 17:42) Ella : projet de logiciel d'animation Flash pour Linux http://forum.ubuntu-fr.org/viewtopic.php?id=321017&p=1 Projet Ella sur launchpad : https://launchpad.net/ella Le retour d'Ella animations avec le projet Renaissance est ici : https://launchpad.net/ella-renaissance et des fichiers de démo ici : http://ellarenaissance.voila.net/index.html Hors ligne philarmonie Re : Ella : projet de logiciel d'animation Flash & SVG pour Linux L'image est composée de 3 éléments chacun dans un pixbuf: le fond, la barre et la zone de texte. Je peux déplacer la barre et la zone de texte avec la souris, comme on peut le faire avec n'importe quel icône sur le bureau par exemple. Si je fais un clic-droit sur la barre elle fait une rotation, Shif+clic gauche c'est un centrage verticale, shif+clic gauche c'est un centrage horizontale. Dernière modification par philarmonie (Le 15/06/2009, à 17:46) kevlar Re : Ella : projet de logiciel d'animation Flash & SVG pour Linux L'image est composée de 3 éléments chacun dans un pixbuf: le fond, la barre et la zone de texte. Je peux déplacer la barre et la zone de texte avec la souris, comme on peut le faire avec n'importe quel icône sur le bureau par exemple. Si je fais un clic-droit sur la barre elle fait une rotation, Shif+clic gauche c'est un centrage verticale, shif+clic gauche c'est un centrage horizontale. D'abord, une remarque : superbe ! Ensuite : pour déplacer les éléments visuels, tu dois faire un drag'n' drop ? Sache que sous goocanvas, il est très facile de faire des "poignées" autour d'un objet ; pour peu que ces "poignées" soient le dernier élément ajouté, il se comporte comme un sprite, et n'efface pas le contexte en arrière-plan. Cela devrait donc répondre à ta préoccupation. Voici comment je procède pour afficher/ effacer la position sur la timeline (petit triangle gris sur la règle) :afficher à la position image "position" en tenant compte de la taille des graduations : /************************************/ /* afficher le curseur de la règle */ /**********************************/ void affiche_curseur_regle(GooCanvasItem *root, gint position) { pRulerCursorItem = goo_canvas_image_new(root, GDK_PIXBUF(pIcoRulerCursor), position*RULER_WIDTH+(RULER_WIDTH/2)-6, RULER_HEIGHT-12,NULL); } effacer le curseur sans abîmer l'arrière-plan (une seule ligne de code ...) : /**********************************/ /* effacer le curseur de la règle */ /**********************************/ void efface_curseur_regle(void) { goo_canvas_item_remove(pRulerCursorItem); } Ella : projet de logiciel d'animation Flash pour Linux http://forum.ubuntu-fr.org/viewtopic.php?id=321017&p=1 Projet Ella sur launchpad : https://launchpad.net/ella Le retour d'Ella animations avec le projet Renaissance est ici : https://launchpad.net/ella-renaissance et des fichiers de démo ici : http://ellarenaissance.voila.net/index.html Hors ligne philarmonie Re : Ella : projet de logiciel d'animation Flash & SVG pour Linux D'abord, une remarque : superbe ! Merci, c'est le thème que j'ai au démarrage de mon pc Ensuite : pour déplacer les éléments visuels, tu dois faire un drag'n' drop ? Sache que sous goocanvas, il est très facile de faire des "poignées" autour d'un objet ; pour peu que ces "poignées" soient le dernier élément ajouté, il se comporte comme un sprite, et n'efface pas le contexte en arrière-plan. Cela devrait donc répondre à ta préoccupation. Oui c'est du drag'n drop. Qu'entends tu par sprite et n'efface pas le contexte en arrière plan? Tu veux dire que si je déplace la barre par exemple, la partie du background qui occupe l'ancienne position redevient visible? Ce comportement j'ai effectivement du en écrire le code. Voici comment je procède pour afficher/ effacer la position sur la timeline (petit triangle gris sur la règle) : afficher à la position image "position" en tenant compte de la taille des graduations :<metadata lang=R prob=0.14 /> /************************************/ /* afficher le curseur de la règle */ /**********************************/ void affiche_curseur_regle(GooCanvasItem *root, gint position) { pRulerCursorItem = goo_canvas_image_new(root, GDK_PIXBUF(pIcoRulerCursor), position*RULER_WIDTH+(RULER_WIDTH/2)-6, RULER_HEIGHT-12,NULL); } effacer le curseur sans abîmer l'arrière-plan (une seule ligne de code ...) :<metadata lang=CSS prob=0.12 /> /**********************************/ /* effacer le curseur de la règle */ /**********************************/ void efface_curseur_regle(void) { goo_canvas_item_remove(pRulerCursorItem); } Effectivement ça demande pas beaucoup de ligne de code, c'est pratique. Comme je code en python, faut que je regarde si goocanvas a été porté en python. Dernière modification par philarmonie (Le 15/06/2009, à 18:11) kevlar Re : Ella : projet de logiciel d'animation Flash & SVG pour Linux > oui, un sprite est un objet, initialement destiné aux jeux videos, dont le comportement s'apparente à ton pointeur de souris : déplacement propre, se met en superposition en respectant le fond pour peu que le GdkPixbuf source ait des parties transparentes. > tu as de la chance : porté en Python, et en plus, Google te renverra une foultitude d'exemples en python, et quasiment rien en C > en fait, goocanvas contient l'essentiel pour faire un éditeur vectoriel, un peu ce que fais ton programme ... Ella : projet de logiciel d'animation Flash pour Linux http://forum.ubuntu-fr.org/viewtopic.php?id=321017&p=1 Projet Ella sur launchpad : https://launchpad.net/ella Le retour d'Ella animations avec le projet Renaissance est ici : https://launchpad.net/ella-renaissance et des fichiers de démo ici : http://ellarenaissance.voila.net/index.html Hors ligne kevlar Re : Ella : projet de logiciel d'animation Flash & SVG pour Linux voici la nouvelle version : au menu, utilisation, comme dit précédemment, de la bibliothèque goocanvas, et, nouveauté, du modèle GtkListStore, GtkTreeView : - la partie "calques" à gauche est une GtkTreeView, parfaitement fonctionnelle (édition, duplication ...) - la partie de droite(règle, time line) est construite à partir de goocanvas. Dernière modification par kevlar (Le 18/06/2009, à 17:27) Ella : projet de logiciel d'animation Flash pour Linux http://forum.ubuntu-fr.org/viewtopic.php?id=321017&p=1 Projet Ella sur launchpad : https://launchpad.net/ella Le retour d'Ella animations avec le projet Renaissance est ici : https://launchpad.net/ella-renaissance et des fichiers de démo ici : http://ellarenaissance.voila.net/index.html Hors ligne kevlar Re : Ella : projet de logiciel d'animation Flash & SVG pour Linux le code est très simple : 1- créer une fonction génératrice pour le menu déroulant : void timeline_popup_menu_(GdkEventButton *event) { GtkWidget *menu, *item; menu = gtk_menu_new (); // this opens the downloader window, or brings it to the foreground if already open item = gtk_menu_item_new_with_mnemonic (("_Créer une image-clé")); g_signal_connect_swapped (item, "activate",G_CALLBACK (cb_new_keyframe), NULL); gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); item = gtk_menu_item_new_with_mnemonic (("_Supprimer l'image-clé")); g_signal_connect_swapped (item, "activate",G_CALLBACK (cb_remove_keyframe), NULL); gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); gtk_widget_show_all (menu); gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, NULL,/* pointeur datas */ event->button, /* bouton de la souris, automatique */ event->time); /* moment du clic, automatique */ } 2- brancher cette fonction dans la callback répondant aux clics-souris : /**************************** * réponse aux clics-souris * sur la timeline * *************************/ static gboolean on_timeline_button_press(GooCanvasItem *item, GooCanvasItem *target, GdkEventButton *event, GtkWidget *win) { /* clic-gauche ou clic-droit ? */ if (event->button==3) /* clic droit */ { timeline_popup_menu_(event); } Dernière modification par kevlar (Le 20/06/2009, à 17:30) Ella : projet de logiciel d'animation Flash pour Linux http://forum.ubuntu-fr.org/viewtopic.php?id=321017&p=1 Projet Ella sur launchpad : https://launchpad.net/ella Le retour d'Ella animations avec le projet Renaissance est ici : https://launchpad.net/ella-renaissance et des fichiers de démo ici : http://ellarenaissance.voila.net/index.html Hors ligne kevlar Re : Ella : projet de logiciel d'animation Flash & SVG pour Linux Ella : projet de logiciel d'animation Flash pour Linux http://forum.ubuntu-fr.org/viewtopic.php?id=321017&p=1 Projet Ella sur launchpad : https://launchpad.net/ella Le retour d'Ella animations avec le projet Renaissance est ici : https://launchpad.net/ella-renaissance et des fichiers de démo ici : http://ellarenaissance.voila.net/index.html Hors ligne kevlar Re : Ella : projet de logiciel d'animation Flash & SVG pour Linux aujourd'hui : gestion des sélections à la souris sur la time line (partie en vert de cette copie = zone sélectionnée). Les contrôles sont faits : impossible de sélectionner une zone ne contenant pas d'images, par exemple. en fait, gérer une sélection est très simple, après branchement des événements "motion_notify", et "button-release" sur les éléments du goocanvas. Reste une limite (si quelqu'un passe avec une idée ... ) : comment, lors de la sélection d'une zone, assurer en même temps le scrolling de la fenêtre dans laquelle se déplace la souris ? Faut-il réutiliser l'événement "motion_notify", et, lorsque le pointeur est à l'une des limites, provoquer le scrolling ? A voir ! Dernière modification par kevlar (Le 22/06/2009, à 14:56) Ella : projet de logiciel d'animation Flash pour Linux http://forum.ubuntu-fr.org/viewtopic.php?id=321017&p=1 Projet Ella sur launchpad : https://launchpad.net/ella Le retour d'Ella animations avec le projet Renaissance est ici : https://launchpad.net/ella-renaissance et des fichiers de démo ici : http://ellarenaissance.voila.net/index.html Hors ligne kevlar Re : Ella : projet de logiciel d'animation Flash & SVG pour Linux après une période de sommeil, voici le travail du jour : la mise en place d'une barre d'outils, destinée à l'hypothétique éditeur vectoriel qui sera (peut-être) un jour associé au programme ... Cette barre est construite avec les méthodes postérieures à Gtk 2.4 (voire même 2.12) ; elle est remplie d'icônes qui sont des gtk_radio_tool_button ; les fonctions de "markup" sont mises à profit pour enrichir le texte du titre de la barre d'outils, et les tooltips sont actifs, comme vous le voyez sur la copie. Le choix de boutons radio permet de n'avoir, automatiquement, qu'un seul outil activé à la fois, géré avec une callback réagissant à à l'événement toggled Dernière modification par kevlar (Le 02/07/2009, à 20:43) Ella : projet de logiciel d'animation Flash pour Linux http://forum.ubuntu-fr.org/viewtopic.php?id=321017&p=1 Projet Ella sur launchpad : https://launchpad.net/ella Le retour d'Ella animations avec le projet Renaissance est ici : https://launchpad.net/ella-renaissance et des fichiers de démo ici : http://ellarenaissance.voila.net/index.html Hors ligne kevlar Re : Ella : projet de logiciel d'animation Flash & SVG pour Linux Ella : projet de logiciel d'animation Flash pour Linux http://forum.ubuntu-fr.org/viewtopic.php?id=321017&p=1 Projet Ella sur launchpad : https://launchpad.net/ella Le retour d'Ella animations avec le projet Renaissance est ici : https://launchpad.net/ella-renaissance et des fichiers de démo ici : http://ellarenaissance.voila.net/index.html Hors ligne kevlar Re : Ella : projet de logiciel d'animation Flash & SVG pour Linux Et maintenant, la dernière étape facile ! Intégrer la barre d'outils dans une fenêtre contenant elle-même un GtkNotebook, qui portera, lui, , d'une part, l'éditeur vectoriel (le gros, gros morceau ), et, d'autre part, le lecteur flash, servant à la prévisualisation (beaucoup plus facile, grâce aux bibliothèques swfdec : L'éditeur vectoriel va utiliser au maximum la bibliothèque goocanvas, parfaitement adaptée à cet usage Dernière modification par kevlar (Le 03/07/2009, à 14:32) Ella : projet de logiciel d'animation Flash pour Linux http://forum.ubuntu-fr.org/viewtopic.php?id=321017&p=1 Projet Ella sur launchpad : https://launchpad.net/ella Le retour d'Ella animations avec le projet Renaissance est ici : https://launchpad.net/ella-renaissance et des fichiers de démo ici : http://ellarenaissance.voila.net/index.html Hors ligne haile_selassie Re : Ella : projet de logiciel d'animation Flash & SVG pour Linux Hop, sujet en marque-pages, ça m'intéresse Beau boulot, continue à donner des nouvelles! Hors ligne kevlar Re : Ella : projet de logiciel d'animation Flash & SVG pour Linux oui, tu devines l'objectif final, mais c'est encore loin, loin ... Ella : projet de logiciel d'animation Flash pour Linux http://forum.ubuntu-fr.org/viewtopic.php?id=321017&p=1 Projet Ella sur launchpad : https://launchpad.net/ella Le retour d'Ella animations avec le projet Renaissance est ici : https://launchpad.net/ella-renaissance et des fichiers de démo ici : http://ellarenaissance.voila.net/index.html Hors ligne haile_selassie Re : Ella : projet de logiciel d'animation Flash & SVG pour Linux oui, tu devines l'objectif final, mais c'est encore loin, loin ... Certainement. Mais perso, quand je programme, ce que j'aime, c'est apprendre de nouveaux trucs. Après, finir les objectifs que tu t'es fixés, c'est sur que c'est super plaisant aussi ^^ Tu es tout seul à le programmer ? non pas que je veuille t'aider, je ne connais pas GTK, mais ça parait quand meme ambitieux pour le réaliser seul, non? Hors ligne kevlar Re : Ella : projet de logiciel d'animation Flash & SVG pour Linux oui, tout seul, c'est effectivement fait sur le mode "loisirs", donc pas de contraintes ...:lol: Ella : projet de logiciel d'animation Flash pour Linux http://forum.ubuntu-fr.org/viewtopic.php?id=321017&p=1 Projet Ella sur launchpad : https://launchpad.net/ella Le retour d'Ella animations avec le projet Renaissance est ici : https://launchpad.net/ella-renaissance et des fichiers de démo ici : http://ellarenaissance.voila.net/index.html Hors ligne kevlar Re : Ella : projet de logiciel d'animation Flash & SVG pour Linux ce matin, début de mise en place réelle de l'éditeur vectoriel : tracé de lignes simples : les autres figures ne posent pas plus de problèmes ; ce qu'il faut, maintenant, c'est gérer en interne une base de données référençant tous les goocanvasitem (s) utilisés par l'éditeur vectoriel, et, d'autre part, associer les groupes de dessins au bon calque ... Ella : projet de logiciel d'animation Flash pour Linux http://forum.ubuntu-fr.org/viewtopic.php?id=321017&p=1 Projet Ella sur launchpad : https://launchpad.net/ella Le retour d'Ella animations avec le projet Renaissance est ici : https://launchpad.net/ella-renaissance et des fichiers de démo ici : http://ellarenaissance.voila.net/index.html Hors ligne kevlar Re : Ella : projet de logiciel d'animation Flash & SVG pour Linux aujourd'hui : - éditeur vectoriel complété avec les fonctions de tracés de boîtes (box) et de cercles (ellipses) - amélioration de la barre d'outils : j'ai ajouté la possibilité de choisir le style de ligne (icône en forme d'engrenage) et le style de texte (icône avec deux "A") ; les icônes de réglage sont regroupées dans la palette dans une rubrique "styles" - pour le projet lui-même, je pense que je vais associer à chacun des calques de la timeline( voir post #40) un élément très pratique de la bibliothèque goocanvas : les "groupes d'objets" ; l'astuce est de n'avoir qu'un seul canvas, dans lequel chaque calque forme un groupe, et chaque calque pourra pointer sur d'autres groupes d'objets ; ainsi, effacer un calque effacera tous les objets qu'il contient, sans toucher au reste du canvas. Ella : projet de logiciel d'animation Flash pour Linux http://forum.ubuntu-fr.org/viewtopic.php?id=321017&p=1 Projet Ella sur launchpad : https://launchpad.net/ella Le retour d'Ella animations avec le projet Renaissance est ici : https://launchpad.net/ella-renaissance et des fichiers de démo ici : http://ellarenaissance.voila.net/index.html Hors ligne kevlar Re : Ella : projet de logiciel d'animation Flash & SVG pour Linux bon, aujourd'hui, grosse rigolade (:(:(:() : tenter de modifier le style de trait en utilisant goocanvas ; pas le moindre exemple sur le net, documentation ultra limitée ; enfin, en croisant avec la documentation de cairo, et quelques erreurs de segmentation après, voici un code tout simple qui permet de préparer la mise en place de la sélection des objets par l'éditeur vectoriel ; voici le code du rectangle de sélection utilisant goocanvas: /********************************** * rectangle de sélection en cours * *******************************/ void selection_box(GooCanvasItem *ancetre, gdouble x1t,gdouble y1t,gdouble x2t,gdouble y2t) { gdouble t; static const double dashed1[] = {4.0, 4.0}; static int len1 = sizeof(dashed1) / sizeof(dashed1[0]); GooCanvasLineDash *style_trait; style_trait=goo_canvas_line_dash_newv(len1,(gdouble *)dashed1); SelectedArea=TRUE; /* vérifier les valeurs des coins */ if (x2t<x1t) { t=x1t; x1t=x2t; x2t=t; } if (y2t<y1t) { t=y1t; y1t=y2t; y2t=t; } pDrawings=goo_canvas_rect_new(ancetre, x1t+10,y1t+10, x2t-x1t,y2t-y1t, "line-width", 2.0, "radius-x", 1.0, "radius-y", 1.0, "stroke-color", "blue", "line-dash", style_trait, NULL); } Dernière modification par kevlar (Le 07/07/2009, à 16:30) Ella : projet de logiciel d'animation Flash pour Linux http://forum.ubuntu-fr.org/viewtopic.php?id=321017&p=1 Projet Ella sur launchpad : https://launchpad.net/ella Le retour d'Ella animations avec le projet Renaissance est ici : https://launchpad.net/ella-renaissance et des fichiers de démo ici : http://ellarenaissance.voila.net/index.html Hors ligne
joko Re : Qarte arte.tv browser (ex Qarte+7) bonjour, grands compliments à VinsS et consors, vraiment épaté. bravo à tous les p'tits fouineurs ! qualité vidéo géniale, rien à voir avec celle du site d'arte +7 !!! Dernière modification par joko (Le 06/11/2012, à 12:35) Je suis un homme, quoi de plus naturel en somme ? linux on the rocks Hors ligne kykyou Re : Qarte arte.tv browser (ex Qarte+7) bonjour, superbe programme , sauf que cela ne fonctionne pas chez moi j ai l erreur : qarte Erreur de segmentation (core dumped) j ai bien vu que je n etais pas le seul , mais j ai pas trop compris comment faire je suis sous xubuntu voyager 12.04 j ai cru comprendre que cela venais du 64 bit ! merci de votre aide .. resolu , j ai changé de theme et hop tout fonctionne ..... merci vinz Dernière modification par kykyou (Le 07/11/2012, à 14:48) Hors ligne VinsS Re : Qarte arte.tv browser (ex Qarte+7) Nouvelle version 1.5.0 L'extension des fichiers est redevenue .flv comme avant. Le format n'a pas changé bien sur mais l'extension .mp4 n'était pas exacte et on me signalait que des lecteurs multimédia ne les acceptaient pas obligeant les utilisateurs à renommer leurs fichiers. J'ai aussi ajouter dans la boîte de dialogue 'Préférences' une option pour rajouter à chaque téléchargement une vignette du même nom. Ceci n'est utile que pour certains serveur de médias comme Minidla qui utilisent cette icône pour leur cover. La mise à jour du ppa est en route, sinon, comme d'hab, j'ai mis un .tar.gz et un .all.deb sur la page Download de www.oqapy.eu Bon Arte Hors ligne mydjey Re : Qarte arte.tv browser (ex Qarte+7) Grand merci VinsS pour ce soft qui m'est très utile. Mon site : http://mydjey.eu/ Hors ligne souleika Re : Qarte arte.tv browser (ex Qarte+7) Bonjour, Je n'arrive pas à afficher la fenêtre des préférences. Elle est apparue la première fois que j'ai utlisé Qarte, mais maintenant impossible de l'afficher à nouveau. La rubrique "Options" du menu "options" n'affiche rien. A part ça c'est vraiment un super logiciel, merci Hors ligne LRDP Re : Qarte arte.tv browser (ex Qarte+7) Bonsoir, Bravo pour Qarte. Je n'arrivais pas à l'installer, mais en reprenant à l'instant le lien http://www.ubuntuupdates.org/package/xb … e/rtmpdump en installant un autre dépot, j'ai pu installer rtpmdump très simplement, puis Qarte dans la logithèque, et en voiture Simone! Excellent développement, excellente qualité. Hors ligne Api07 Re : Qarte arte.tv browser (ex Qarte+7) Comme je galérais grave pour regarder l'excellente série Breaking Bad sur le site d'arte+7 j'ai fini par découvrir et installer le non moins excellent qarte dont je remercie l'auteur. Le soucis est que je n'arrive à télécharger aucune vidéo car j'obtiens le message suivant : url introuvable. Serais-ce une erreur de paramétrage? Un problème de connexion? Comme je suis un novice total sur ubuntu merci de m'exposer votre éventuelle solution en termes adaptés à mon niveau. Merci. Hors ligne eochu Re : Qarte arte.tv browser (ex Qarte+7) Tout est question d'intention, quand j'ai repris le code d'arte+7recorder mon intention était bien de faire une application graphique et pas du tout une appli en ligne de commande. La partie graphique ne peut plus être dissociée du code sans une réécriture complète, ce que je ne ferais pas vu que j'ai du mal à en saisir l'intérêt et que, comme je l'ai dis, cela n'a jamais été dans mes intentions. Je comprends ton point de vue de vouloir faire une application graphique. Ce que je voulais dire, c'est qu'avec le langage et les bibliothèques que tu utilises pour développer ce programme, ça ne coûterait pas « plus cher » en temps de développement de faire une partie ligne de commande et une partie graphique à part (sauf peut-être maintenant puisque le développement n'a pas été pensé dans ce sens). L'intérêt, comme je le mentionnais dans mon précédent message, est de pouvoir faire tourner Qarte sur un serveur dépourvu de couche graphique. Ça ne concerne peut-être pas beaucoup de monde, mais c'est techniquement possible et facile de concevoir un programme qui fonctionne à la fois en CLI et avec une surcouche graphique pour ceux qui veulent. Là par exemple, si je veux faire en sorte que Qarte tourne sans couche graphique, ça va me demander beaucoup de travail (d'autant plus que je ne connais pas le code), un fork (donc deux projets séparés), et donc beaucoup de temps et d'énergie perdus. Je trouve ça dommage. Hors ligne atunoa Re : Qarte arte.tv browser (ex Qarte+7) Super, qarte est compatible avec voyager 12.10 - xubuntu 12.10. Merci pour tes améliorations continues sur un de mes programmes favoris. Dernière modification par atunoa (Le 13/11/2012, à 19:21) Panasonic cf-51 X 2 Obsolescence inconnue, Core Duo T2500 2.0 GHz / 2 Go (c'est court) ; Voyager 13.04 en étant passé par toutes les autres; Hors ligne tuxmarc Re : Qarte arte.tv browser (ex Qarte+7) SU-PER-BE Merci Vincent, quel magnifique travail !! J'ai vu un billet sur le sujet Voyager 12.10 et je me suis empressé d'installer en console. Tout baigne chez moi, autant sur le portable que sur la tour. Par la passé, j'avais réussi à télécharger des émissions d'Arte grâce à Arte7recorder puis TvDownloader, mais à cause ce changements de protocole chez Arte, c'était devenu un enfer, surtout pour les développeurs qui devaient courir derrière des modifs chez Arte, qu'on ne leur avait pas signalé. J'espère que leur politique de changer de protocole va se calmer ! Vive Richard Stalmann, Linus Torvalds, et tous les fondus de Linux. De l'Ordinosaure fait à 90% de récup, à un portable LDLC neuf sans système, en passant par une tour, un serveur et une carte mère sans boitier, tous libres !! Collection de 15 DD tous bien élevés au Linux sous la mère et se baladant d'une machine à l'autre. Parrain Linux sur www.parrain-linux.com et www.parrains.linux.free.fr Hors ligne Titanet Re : Qarte arte.tv browser (ex Qarte+7) Nouvelle version 1.5.0 L'extension des fichiers est redevenue .flv comme avant. Le format n'a pas changé bien sur mais l'extension .mp4 n'était pas exacte et on me signalait que des lecteurs multimédia ne les acceptaient pas obligeant les utilisateurs à renommer leurs fichiers. Bonjour Vincent, J'avoue que je ne comprends pas bien cette histoire de format de fichier, et pour quelle raison précisément tu as modifié l'extension. Je n'ai pas encore installé la nouvelle version que tu proposes, j'en suis resté à la version 1.4 que j'utilise régulièrement. Puisque le but de ton application est de s'affranchir du format Flash d'Adobe, pourquoi ajouter l'extension .flv ?? Quand je regarde les propriétés des fichiers téléchargés sous Ubuntu, je vois que le codec vidéo est H264 et le codec audio MPEG-4 AAC. En quoi l'extension .mp4 empêcherai d'autres utilisateurs de lire ces fichiers ?? Je ne comprends pas du tout où est le problème. Merci d'éclairer ma lanterne ! "Ce n’est pas parce que les choses sont difficiles que nous n’osons pas, c’est parce que nous n’osons pas qu’elles sont difficiles." Sénèque Sous Ubuntu 12.04 Precise Pangolin (desktop) et 14.04 beta (portable), avec Ubuntu depuis The Hoary Hedgehog 5.04 Hors ligne VinsS Re : Qarte arte.tv browser (ex Qarte+7) @ Titanet, Bonsoir, Comme je dis dans mon post, le format est inchangé, il s'agit donc toujours de paquets flash. L'extension .mp4 est due à une mauvaise interprétation de ma part de l'entête du fichier, erreur dont je ne me rendis pas compte du fait que j'utilise VLC qui ouvre tout ce qu'il reconnaît sans se formaliser de l'extension. Ce n'est pas le cas de tous les lecteurs multimédias. L'extension .flv était celle des versions Qarte+7 et cela ne posait aucun problème. Maintenant, si une option dans la boîte préférences pour le choix de l'extension peut être utile à certains, c'est très simple à ajouter. Dans le même sujet on m'a demandé si je pouvais ajouter un fonctionnalité de conversion de format. Ce n'est pas la finalité première de Qarte mais si ça peut rendre l'outil plus complet, pourquoi pas. Je suis ouvert au débat. Hors ligne Titanet Re : Qarte arte.tv browser (ex Qarte+7) Vincent, merci pour ta réponse rapide. Je suis désolé mais je ne comprends toujours pas ! J'utilise moi aussi VLC pour lire les vidéos téléchargées, et si j'essaye de les lire avec Totem, le lecteur par défaut dans Ubuntu, çà marche aussi. Dois-je comprendre que des utilisateurs de ton application utilisent un autre système (Windows ou une autre distribution) ? Quel autre lecteur multimédia utilisent-ils ? Ont-ils remonté ce problème ? De toute façon, les fichiers sont bien au format mp4, je veux dire l'entête semble bien être du mp4, pas flv, non ? En tant que partisan des formats libres et ouverts, et je ne pense pas être le seul, je ne saisi pas ce revirement. Si tu peux proposer le choix de l'extension de fichier dans une boite de dialogue, ce serait bien aussi. Et encore mieux si tu offres la possibilité de convertir les fichiers en les encapsulant dans un conteneur Matroska (.mkv). Un petit script de conversion utilisant ffmpeg doit pouvoir faire ce travail. Dernière modification par Titanet (Le 18/11/2012, à 00:44) "Ce n’est pas parce que les choses sont difficiles que nous n’osons pas, c’est parce que nous n’osons pas qu’elles sont difficiles." Sénèque Sous Ubuntu 12.04 Precise Pangolin (desktop) et 14.04 beta (portable), avec Ubuntu depuis The Hoary Hedgehog 5.04 Hors ligne Xavier21 Re : Qarte arte.tv browser (ex Qarte+7) Bonjour, Je prends part à cette discussion autour du format, modeste contribution de ma part, car je ne suis pas expert. Je note cependant qu'avec la dernière version de Qarte (avec l'extension flv), j'ai de grosse difficulté à convertir le fichier en mkv, seul moyen pour moi de lire le fichier sur mon lecteur de salon. Les petits fichiers passent sans difficulté, mais dès que le fichier est plus long, avidemux plante. Le fichier mkv est bien créé, mais l'image est quelque peu saccadée. Je précise qu'avant le changement de version, les fichiers mp4 se convertissaient sans problème. Je ne serai pas contre que le choix de l'extension soit proposé dans les versions futures. En tout état de cause, un grand merci pour cette application dont je suis devenu totalement accro ! Bonne journée à tous Dernière modification par Xavier21 (Le 20/11/2012, à 08:57) Hors ligne Zoulou.4556 Re : Qarte arte.tv browser (ex Qarte+7) slt VinsS, je trouve que l'idée du format de conversion que tu propose n'est pas mauvaise et personnellement ça me rendrait service, je partage souvent dans le cadre de ma famille ou de mes amis(e) les vidéos que je récupère sur Qarte . Une petite option en plus serait sympa ! Asus X66IC Manjaro 64bits dual Ubuntu 14.04 64 bits / Dell Latitude D520 Xubuntu 14.04 32 bits/ Aurore BG6-I3-4-H10S1 SSD 120 go +DD 1To Manjaro 64 bits dual Ubuntu 64 bits Hors ligne VinsS Re : Qarte arte.tv browser (ex Qarte+7) Je pense qu'une mise au point s'impose ici. Le format des vidéos téléchargées n'a jamais changé, il est toujours le même que depuis la première version de Qarte, le même format que précédemment avec Qarte+7 et toujours le même qu'avec Arte+7recorder. L'extension .flv ne posait aucun problème alors, il n'y a pas de raison que ce soit le cas maintenant. L'extension .mp4 était une mauvaise interprétation de ma part des metadata des fichiers, ce que j'ai rectifié, mais, j'insiste, il s'agit de l'extension et non du format réel, inchangé lui. Si Qarte ne propose pas de conversion de format des vidéos c'est parce que ce n'était pas la finalité première de ce logiciel. Les applications dans ce domaine ne manquent pas. Toutefois, comme je le dis déjà dans mon post #214, je ne suis pas opposé à l'ajout de fonctionnalités permettant à chacun de faire choix de son format de fichier. Hors ligne mydjey Re : Qarte arte.tv browser (ex Qarte+7) VinsS si je comprend bien ce que tu expliques, il suffit de renommer fichier.flv en fichier.mp4 et on obtient un fichier identique à celui que l'on obtenait avant que tu fasses cette modif ? Je me trompe ? Dernière modification par mydjey (Le 21/11/2012, à 09:14) Mon site : http://mydjey.eu/ Hors ligne Xavier21 Re : Qarte arte.tv browser (ex Qarte+7) Bonjour, J'ai suivi avec intérêt tes explications VinsS, et pour le coup, je me rends compte que j'ai eu de la chance dans mes conversions précédentes, car elles ne marchent pas à tous les coups non plus. J'ai converti un fichier que j'avais récupéré avec la version précédente de Qarte et il a planté également sur la fin. Pour le coup, cela n' a effectivement aucun lien avec le changement de version. À moi de trouver la bonne application qui fera bien le boulot de conversion ! Bonne journée Hors ligne souleika Re : Qarte arte.tv browser (ex Qarte+7) @ souleika, Lance-le dans un terminal avec l'argument -d (debug) qarte -d puis tu copies ici ce qui apparaîtra dans le terminal après que tu aies cliqué sur le menu Options. Bonjour, désolée pour le délai de réaction. Quand je clique sur Options > options, j'obtiens ceci 21:09:40: INFO - qarte Call setting dialogbox Traceback (most recent call last): File "/usr/share/qarte-1.5.0/qarte.py", line 208, in edit_settings sett.setupUi(Dialog, self) File "/usr/share/qarte-1.5.0/ui_config.py", line 369, in setupUi self.set_config() File "/usr/share/qarte-1.5.0/ui_config.py", line 385, in set_config self.cfg['cur_cat'])) ValueError: list.index(x): x not in list Hors ligne souleika Re : Qarte arte.tv browser (ex Qarte+7) @ souleika, M'a tout l'air que ta config contient encore un paramètre d'une ancienne version. Supprime ce fichier: ~/.Qarte/config.cfget relance Qarte, il le recréera. ( ~/représente ton dossier à toi) Merci ! Hors ligne Upsa Re : Qarte arte.tv browser (ex Qarte+7) Bonsoir VinsS, Bravo pour votre Qarte+. Je viens de changer d'ordinateur et d'installer Ubuntu 12.10 en 64 bits. Qarte ne fonctionne plus correctement en 64 bits alors que cela fonctionne correctement en 32 bits. Lorsque je lance qarte dans le terminal et que je veux simplement fermer la fenêtre "Qarte Préférences" ou bien si je clique sur n'importe où sur cette fenêtre voilà ce que j'obtiens : qarte Erreur de segmentation (core dumped) Dans le terminal, si je lance qarte -d et que je ferme simplement a fenêtre "Qarte Préférences" voici ce que j'obtiens : qarte -d 22:26:22: INFO - qarte Main thread: <_MainThread(MainThread, started 139759807784704)> 22:26:22: INFO - ui_main setup main window 22:26:22: INFO - ui_main set page arte+ 22:26:22: INFO - ui_main set button's group arte+ 22:26:22: INFO - ui_main set basket arte+ 22:26:22: INFO - ui_main set dwnld button arte+ 22:26:22: INFO - ui_main set page arteLive 22:26:22: INFO - ui_main set categories buttons 22:26:22: INFO - ui_main set button's group arteLive 22:26:22: INFO - ui_main set basket arteLive 22:26:22: INFO - ui_main set dwnld buttons 22:26:22: INFO - ui_main set page arteLive extra 22:26:22: INFO - ui_main set extra categories buttons 22:26:22: INFO - ui_main set button's group arteLive extra 22:26:22: INFO - ui_main set basket arteLive extra 22:26:22: INFO - ui_main set extra dwnld buttons 22:26:22: INFO - ui_main set menu bar 22:26:22: INFO - ui_main set status bar 22:26:22: INFO - ui_main set actions 22:26:22: INFO - ui_main make connections 22:26:22: INFO - ui_main set theme 22:26:22: INFO - ui_main main window complete 22:26:22: INFO - utils Updating 22:26:22: INFO - utils File /home/upsa/.Qarte/livedata_fr.py saved 22:26:22: INFO - utils The file has been updated at: lun. 17 sept. 2012 09:20:46 CEST 22:26:22: INFO - artePlus arte+7 folder: None 22:26:22: INFO - parsers Get page: http://liveweb.arte.tv/fr 22:26:22: INFO - parsers get page http://liveweb.arte.tv/fr 22:26:23: INFO - qarte Call setting dialogbox Erreur de segmentation (core dumped) Avez-vous une petite idée du problème ? Cordialement, Hors ligne
def buildTestCase(xmlfile, description, method, evalString): func = lambda self, xmlfile=xmlfile, method=method, evalString=evalString: \ method(self, evalString, feedparser.parse(xmlfile)) func.__doc__ = description return func Above is a code snippet from feedparser, why there is a "self" in function definition method(self, evalString, feedparser.parse(xmlfile))? Thanks.
fenix122 Re : erreur avec apache2 : « Unable to open logs » [RESOLU] non non je sais faire les serveur sans interface j'ai fait sa surtout pour simplifier après non je ne suis pas tout a lettre car le tuto que j'ai suivi avait des erreurs pour certaine chose surtout pour c'est source pas bonne j'ai du aller sur le site officier entre deux ainsi que pour les source j'ai suivi le tuto juste parce qu'il été plus claire et en français mais je voulais savoir comment il a pus m'infecté mon serveur car pendant quelque moi j'ai eu aucun souci en tout cas merci a tous de votre aide comment je met en résolu après car désolé je ne trouve pas Hors ligne tiramiseb Re : erreur avec apache2 : « Unable to open logs » [RESOLU] je voulais savoir comment il a pus m'infecté mon serveur car pendant quelque moi j'ai eu aucun souci As-tu bien maintenu ispconfig à jour en installant toutes les version qui sortaient au fur et à mesure ? As-tu bien maintenu les paquets Ubuntu à jour dès la sortie d'une mise à jour ? As-tu bien veillé à ce qu'aucun mot de passe lié à ce serveur ne transite en clair, même une fois (j'ai déjà la réponse : c'est non, vu que tu as du FTP, du POP et de l'IMAP) ? As-tu bien veillé à ce qu'un tel mot de passe ne soit jamais utilisé sur un réseau non sécurisé (wifi public par exemple) ? As-tu bien veillé à ne pas installer de clé SSH provenant de comptes potentiellement corrompus ? Tout ça (et bien plus) ça peut être des sources de piratage. Allez, au pif : tu avais un serveur FTP, donc des gens (toi ?) se connectaient en FTP, donc des mots de passe transitaient en clair. Si un seul de ces mots de passe est intercepté par quelqu'un (sur un wifi public, par exemple, c'est hyper facile) alors ce quelqu'un aura accès à ton serveur. Et si jamais le mot de passe en question est celui d'un compte administrateur, bingo ! Tu avais aussi un MDA (Courier). Les mots de passe transitaient-ils en clair ? Si oui, même punition. Hors ligne fenix122 Re : erreur avec apache2 : « Unable to open logs » [RESOLU] oui j'avais tout sa mais les mots de passe étais tous différent donc c'est pas du a une attaque après ispconfig étais a jour puisque sa ne faisait que quelque mois que j'ai le serveur mais je cherchais coté serveur donc ya aucun module a mettre qui aide a la protection et je ne passe jamais par wifi j'aime pas et après mot de passe en claire non après je me sert des logiciel comme filezilla etc je te remercie de ton aide peux tu me dire comment mettre en résolu s'il te plaie merci Hors ligne Elder Re : erreur avec apache2 : « Unable to open logs » [RESOLU] Vu qu'apache semble en avoir pris plein la poire (virtual host skynet ...) je commencerai par les logs d'apache et du système... Mais ceux-ci seront probablement détruits lors de la réinstallation. +1 tiramiseb, sur ce type de config il y a tellement de point d'entrée/d'écoute potentiel que ça pourrait venir de n'importe où... @+ Hors ligne Haleth Re : erreur avec apache2 : « Unable to open logs » [RESOLU] ton skynet, c'est juste une banderolle de login Soit tu l'as mis, soit un voisin l'as mis, soit t'as install un truc craignos qui l'a fait. sudo /etc/init.d/apache2.. en root, c'est inutile ta conf d'apache est pourri, y'a une doc en ligne, je te susurre de la lire avant d'écrire de la conf que tu comprends pas Ubuntu is an ancien African word which means "I can't configure Debian" Because accessor & mutator are against encapsulation (one of OOP principles), good OOP-programmers do not use them. Obviously, procedural-devs do not. In fact, only ugly-devs are still using them. Hors ligne fenix122 Re : erreur avec apache2 : « Unable to open logs » [RESOLU] non personne avait accés au serveur puis sa me connecté direct en root depuis sa aprés mon hebergeur lui meme ma anoncé sa Dear Sir! Please sort this problem within 24 hours to avoid server suspension. donc suis sur de l'infection ---------------------------- Hello abuse address for 46.17.97.111, The host at 46.17.97.111 seems to be infected with a worm. I believe that this is the case because over here at love.zweije.nl, I am receiving inexplicable TCP connect requests from that host. An extract from my system log (timezone +0100) is attached. Please ensure that the maintainer of 46.17.97.111 cleans up his host. Thank you. Vincent. Jan 31 08:43:25 love ippl: ssh connection attempt from 46.17.97.111 (46.17.97.111:17203->80.101.26.192:22) Jan 31 10:12:34 love ippl: ssh connection attempt from 46.17.97.111 (46.17.97.111:52283->80.101.26.192:22) Jan 31 10:12:35 love sshd[29541]: Connection from 46.17.97.111 port 52283 Jan 31 10:12:37 love sshd[29541]: debug1: PAM: setting PAM_RHOST to "46.17.97.111" Jan 31 10:12:37 love sshd[29541]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=46.17.97.111 user=root Jan 31 10:12:39 love ippl: ssh connection attempt from 46.17.97.111 (46.17.97.111:54605->80.101.26.192:22) Jan 31 10:12:39 love sshd[29541]: Failed password for root from 46.17.97.111 port 52283 ssh2 Jan 31 10:12:39 love sshd[29541]: Received disconnect from 46.17.97.111: 11: Bye Bye [preauth] Jan 31 10:12:39 love sshd[29543]: Connection from 46.17.97.111 port 54605 Jan 31 10:12:40 love sshd[29543]: debug1: PAM: setting PAM_RHOST to "46.17.97.111" Jan 31 10:12:41 love sshd[29543]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=46.17.97.111 user=root Jan 31 10:12:42 love ippl: ssh connection attempt from 46.17.97.111 (46.17.97.111:56845->80.101.26.192:22) Jan 31 10:12:42 love sshd[29543]: Failed password for root from 46.17.97.111 port 54605 ssh2 Jan 31 10:12:42 love sshd[29543]: Received disconnect from 46.17.97.111: 11: Bye Bye [preauth] Jan 31 10:12:42 love sshd[29545]: Connection from 46.17.97.111 port 56845 Jan 31 10:12:43 love sshd[29545]: debug1: PAM: setting PAM_RHOST to "46.17.97.111" Jan 31 10:12:43 love sshd[29545]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=46.17.97.111 user=root Jan 31 10:12:45 love ippl: ssh connection attempt from 46.17.97.111 (46.17.97.111:58920->80.101.26.192:22) Jan 31 10:12:45 love sshd[29545]: Failed password for root from 46.17.97.111 port 56845 ssh2 Jan 31 10:12:45 love sshd[29545]: Received disconnect from 46.17.97.111: 11: Bye Bye [preauth] Jan 31 10:12:45 love sshd[29547]: Connection from 46.17.97.111 port 58920 Jan 31 10:12:46 love sshd[29547]: debug1: PAM: setting PAM_RHOST to "46.17.97.111" Jan 31 10:12:46 love sshd[29547]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=46.17.97.111 user=root Jan 31 10:12:48 love ippl: ssh connection attempt from 46.17.97.111 (46.17.97.111:33714->80.101.26.192:22) Jan 31 10:12:48 love sshd[29547]: Failed password for root from 46.17.97.111 port 58920 ssh2 Jan 31 10:12:48 love sshd[29547]: Received disconnect from 46.17.97.111: 11: Bye Bye [preauth] Jan 31 10:12:48 love sshd[29549]: Connection from 46.17.97.111 port 33714 Jan 31 10:12:49 love sshd[29549]: debug1: PAM: setting PAM_RHOST to "46.17.97.111" Jan 31 10:12:49 love sshd[29549]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=46.17.97.111 user=root Jan 31 10:12:51 love ippl: ssh connection attempt from 46.17.97.111 (46.17.97.111:36290->80.101.26.192:22) Jan 31 10:12:51 love sshd[29549]: Failed password for root from 46.17.97.111 port 33714 ssh2 Jan 31 10:12:51 love sshd[29549]: Received disconnect from 46.17.97.111: 11: Bye Bye [preauth] Jan 31 10:12:51 love sshd[29551]: Connection from 46.17.97.111 port 36290 Jan 31 10:12:52 love sshd[29551]: debug1: PAM: setting PAM_RHOST to "46.17.97.111" Jan 31 10:12:52 love sshd[29551]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=46.17.97.111 user=root Jan 31 10:12:54 love ippl: ssh connection attempt from 46.17.97.111 (46.17.97.111:38511->80.101.26.192:22) Jan 31 10:12:54 love sshd[29551]: Failed password for root from 46.17.97.111 port 36290 ssh2 Jan 31 10:12:54 love sshd[29551]: Received disconnect from 46.17.97.111: 11: Bye Bye [preauth] Jan 31 10:12:54 love sshd[29553]: Connection from 46.17.97.111 port 38511 Jan 31 10:12:55 love sshd[29553]: debug1: PAM: setting PAM_RHOST to "46.17.97.111" Jan 31 10:12:55 love sshd[29553]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=46.17.97.111 user=root Jan 31 10:12:57 love ippl: ssh connection attempt from 46.17.97.111 (46.17.97.111:41110->80.101.26.192:22) Jan 31 10:12:57 love sshd[29553]: Failed password for root from 46.17.97.111 port 38511 ssh2 Jan 31 10:12:57 love sshd[29553]: Received disconnect from 46.17.97.111: 11: Bye Bye [preauth] Jan 31 10:12:57 love sshd[29555]: Connection from 46.17.97.111 port 41110 Jan 31 10:12:57 love sshd[29555]: debug1: PAM: setting PAM_RHOST to "46.17.97.111" Jan 31 10:12:57 love sshd[29555]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=46.17.97.111 user=root Jan 31 10:13:00 love ippl: ssh connection attempt from 46.17.97.111 (46.17.97.111:44092->80.101.26.192:22) Jan 31 10:13:00 love sshd[29555]: Failed password for root from 46.17.97.111 port 41110 ssh2 Jan 31 10:13:00 love sshd[29555]: Received disconnect from 46.17.97.111: 11: Bye Bye [preauth] Jan 31 10:13:00 love sshd[29557]: Connection from 46.17.97.111 port 44092 Jan 31 10:13:01 love sshd[29557]: debug1: PAM: setting PAM_RHOST to "46.17.97.111" Jan 31 10:13:01 love sshd[29557]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=46.17.97.111 user=root Jan 31 10:13:02 love sshd[29557]: Failed password for root from 46.17.97.111 port 44092 ssh2 Jan 31 10:13:03 love ippl: ssh connection attempt from 46.17.97.111 (46.17.97.111:46399->80.101.26.192:22) Jan 31 10:13:03 love sshd[29557]: Received disconnect from 46.17.97.111: 11: Bye Bye [preauth] Jan 31 10:13:03 love sshd[29559]: Connection from 46.17.97.111 port 46399 Jan 31 10:13:03 love sshd[29559]: debug1: PAM: setting PAM_RHOST to "46.17.97.111" Jan 31 10:13:03 love sshd[29559]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=46.17.97.111 user=root Jan 31 10:13:05 love ippl: ssh connection attempt from 46.17.97.111 (46.17.97.111:48460->80.101.26.192:22) Jan 31 10:13:05 love sshd[29559]: Failed password for root from 46.17.97.111 port 46399 ssh2 Jan 31 10:13:05 love sshd[29559]: Received disconnect from 46.17.97.111: 11: Bye Bye [preauth] Jan 31 10:13:05 love sshd[29561]: Connection from 46.17.97.111 port 48460 Jan 31 10:13:06 love sshd[29561]: debug1: PAM: setting PAM_RHOST to "46.17.97.111" Jan 31 10:13:06 love sshd[29561]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=46.17.97.111 user=root Jan 31 10:13:07 love ippl: ssh connection attempt from 46.17.97.111 (46.17.97.111:50206->80.101.26.192:22) Jan 31 10:13:07 love sshd[29561]: Failed password for root from 46.17.97.111 port 48460 ssh2 Jan 31 10:13:07 love sshd[29561]: Received disconnect from 46.17.97.111: 11: Bye Bye [preauth] Jan 31 10:13:07 love sshd[29563]: Connection from 46.17.97.111 port 50206 Jan 31 10:13:08 love sshd[29563]: debug1: PAM: setting PAM_RHOST to "46.17.97.111" Jan 31 10:13:08 love sshd[29563]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=46.17.97.111 user=root Jan 31 10:13:10 love ippl: ssh connection attempt from 46.17.97.111 (46.17.97.111:53045->80.101.26.192:22) Jan 31 10:13:10 love sshd[29563]: Failed password for root from 46.17.97.111 port 50206 ssh2 Jan 31 10:13:10 love sshd[29563]: Received disconnect from 46.17.97.111: 11: Bye Bye [preauth] Jan 31 10:13:10 love sshd[29565]: Connection from 46.17.97.111 port 53045 Jan 31 10:13:11 love sshd[29565]: debug1: PAM: setting PAM_RHOST to "46.17.97.111" Jan 31 10:13:11 love sshd[29565]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=46.17.97.111 user=root Jan 31 10:13:13 love ippl: ssh connection attempt from 46.17.97.111 (46.17.97.111:55378->80.101.26.192:22) Jan 31 10:13:13 love sshd[29565]: Failed password for root from 46.17.97.111 port 53045 ssh2 Jan 31 10:13:13 love sshd[29565]: Received disconnect from 46.17.97.111: 11: Bye Bye [preauth] Jan 31 10:13:13 love sshd[29567]: Connection from 46.17.97.111 port 55378 Jan 31 10:13:14 love sshd[29567]: debug1: PAM: setting PAM_RHOST to "46.17.97.111" Hors ligne Haleth Re : erreur avec apache2 : « Unable to open logs » [RESOLU] Vire tout, réinstalle, lit la doc avant de copier du code ALARACHE. Ubuntu is an ancien African word which means "I can't configure Debian" Because accessor & mutator are against encapsulation (one of OOP principles), good OOP-programmers do not use them. Obviously, procedural-devs do not. In fact, only ugly-devs are still using them. Hors ligne fenix122 Re : erreur avec apache2 : « Unable to open logs » [RESOLU] euuh j'ai pas dit j'ai copié du code a l’arrache et ce problème c'est la première fois que sa m'arrive sa fait deux ans que j'ai des serveur trés fréquenté c'est la premiere fois et pourtant toujours avec ispconfig mais je fait toujours les mise a jour Hors ligne Hoper Re : erreur avec apache2 : « Unable to open logs » [RESOLU] Whaou... 2 pages alors que le message d'erreur est explicite "could not open error log file" Ca veut quand meme bien dire ce que ca veut dire non ? apache n'arrive pas à ouvrir (ni même à créer je dirai) son fichier de log. Ce qui n'est pas surprenant puisque : -rw-r--r-- 1 root root 0 Jan 30 23:08 /var/log/apache2 Donc que seul root peut ecrire dedans, alors que je suppose que c'est l'utilisateur www-data qui dois essayer de créer le fichier. Bref, la première chose que je vérifierai moi, ce sont les droits du répertoire /var/log et /var/log/apache2, parce qu'on dirait qu'il y a eu des trucs pas très net de fait de ce coté la. Hors ligne Haleth Re : erreur avec apache2 : « Unable to open logs » [RESOLU] -rw-r----- 1 root adm 152204 1 févr. 14:18 error.log -rw-r----- 1 root adm 148947892 1 févr. 14:52 other_vhosts_access.log Ca marche. Ubuntu is an ancien African word which means "I can't configure Debian" Because accessor & mutator are against encapsulation (one of OOP principles), good OOP-programmers do not use them. Obviously, procedural-devs do not. In fact, only ugly-devs are still using them. Hors ligne Hoper Re : erreur avec apache2 : « Unable to open logs » [RESOLU] Ah oui tiens. Le processus apache qui cré les logs est bien root. Le message d'erreur reste très explicite et clairement etre la piste à suivre. (Fs monté en lecture seul ou je sais pas quoi dans le genre) Hors ligne Haleth Re : erreur avec apache2 : « Unable to open logs » [RESOLU] Regarde également la place et les inodes sur le FS. M'enfin, ca ne change rien au problème: ta machine est trouée. Ubuntu is an ancien African word which means "I can't configure Debian" Because accessor & mutator are against encapsulation (one of OOP principles), good OOP-programmers do not use them. Obviously, procedural-devs do not. In fact, only ugly-devs are still using them. Hors ligne Hoper Re : erreur avec apache2 : « Unable to open logs » [RESOLU] Tu as raison, une machine trouée, c'est ré-installation forcée... Hors ligne sorrodje Re : erreur avec apache2 : « Unable to open logs » [RESOLU] Hoper et Haleth : Hors ligne Haleth Re : erreur avec apache2 : « Unable to open logs » [RESOLU] Ubuntu is an ancien African word which means "I can't configure Debian" Because accessor & mutator are against encapsulation (one of OOP principles), good OOP-programmers do not use them. Obviously, procedural-devs do not. In fact, only ugly-devs are still using them. Hors ligne tiramiseb Re : erreur avec apache2 : « Unable to open logs » [RESOLU] Le message d'erreur reste très explicite et clairement etre la piste à suivre. (Fs monté en lecture seul ou je sais pas quoi dans le genre) Comme tu l'as cité toi-même : Ca veut quand meme bien dire ce que ca veut dire non ? apache n'arrive pas à ouvrir (ni même à créer je dirai) son fichier de log. Ce qui n'est pas surprenant puisque : -rw-r--r--1 root root 0 Jan 30 23:08 /var/log/apache2 Et comme je l'ai fait résoudre dans le message #8 : rm /var/log/apache2 mkdir /var/log/apache2 Le répertoire en question a été "transformé" en fichier (pas de "d" au début de la ligne de retour du "ld"). Vu le message suivant : j'ai juste trouver dans var/log/apache2/error.log (20)Not a directory: apache2: could not open error log file /var/log/ispconfig/httpd/monsite.com/error.log. Unable to open logs (20)Not a directory: apache2: could not open error log file /var/log/ispconfig/httpd/monsite.com/error.log. Unable to open logs (20)Not a directory: apache2: could not open error log file /var/log/ispconfig/httpd/monsite.com/error.log. Unable to open logs (20)Not a directory: apache2: could not open error log file /var/log/ispconfig/httpd/monsite.com/error.log. Unable to open logs Il est fort probable que ce soit la même chose sur ces fichiers/répertoires. Tu cherches à trouver une cause déjà trouvée Hors ligne Hoper Re : erreur avec apache2 : « Unable to open logs » [RESOLU] Pffff... c'est malin Tant qu'on me traite de vieux, ça me va plutôt bien. Le problème c'est que la suite logique ce sera forcément "vieux con", et la c'est sur, je vais mal le prendre Tu cherches à trouver une cause déjà trouvée En effet. Bien la preuve que je suis effectivement déjà devenu vieux... Et merde Dernière modification par Hoper (Le 01/02/2013, à 16:42) Hors ligne sorrodje Re : erreur avec apache2 : « Unable to open logs » [RESOLU] J'aurais pu mettre Heckel et Jeckel aussi ... spa trop l'âge qui me faisait rire mais le numéro de duettistes à se renvoyer la balle Hors ligne Hoper Re : erreur avec apache2 : « Unable to open logs » [RESOLU] J'aurais pu mettre Heckel et Jeckel aussi ... Remarque bien que vu les références utilisées (qui me font rires aussi hein), je suis pas le seul à être vieux ici Hors ligne sorrodje Re : erreur avec apache2 : « Unable to open logs » [RESOLU] Oulah non .. il faut y voir une forme de complicité de ma part d'autant que je suis assez complètement d'accord avec vos commentaires quant au sujet qui justifie le topic sur lequel nous devisons présentement Hors ligne fenix122 Re : erreur avec apache2 : « Unable to open logs » [RESOLU] excuser moi comment je met en résolu merci Hors ligne tiramiseb Re : erreur avec apache2 : « Unable to open logs » [RESOLU] Tu édites le tout premier message de la discussion et tu ajoutes [RESOLU] dans le titre. Hors ligne fenix122 Re : erreur avec apache2 : « Unable to open logs » [RESOLU] merci Hors ligne
Provided by Richard@AWS This example shows how to use Hadoop Streaming to count the number of times that words occur within a text collection. Hadoop streaming allows one to execute MapReduce programs written in languages such as Python, Ruby and PHP. Source Location on Amazon S3: s3://elasticmapreduce/samples/wordcount/wordSplitter.py Source License: Apache License, Version 2.0 How to Run this Application: To count the occurrence of words we need a map function that iterates through its input emitting word, count pairs. We can implement this in Python as   #!/usr/bin/python     import sys   import re     def main(argv):     line = sys.stdin.readline()     pattern = re.compile("[a-zA-Z][a-zA-Z0-9]*")     try:       while line:         for word in pattern.findall(line):           print "LongValueSum:" + word.lower() + "\t" + "1"         line = sys.stdin.readline()     except "end of file":       return None   if __name__ == "__main__":     main(sys.argv) In order to run a Hadoop Streaming job with Amazon Elastic MapReduce this program must be uploaded to Amazon S3. This can be done using tools such as s3cmd or the Firefox plugin S3 Organizer. Luckily this word count example has already been uploaded to Amazon S3 at the location:   s3://elasticmapreduce/samples/wordcount/wordSplitter.py This can be run on Amazon Elastic MapReduce using the AWS Management Console (https://console.aws.amazon.com). Choose the Amazon Elastic MapReduce tab and then the "Create New Job Flow" button. Next choose the word count example. You'll notice that the word count example is using the builtin reducer called aggregate. This reducer adds up the counts of words being emitted by the wordSplitter map function. It knows to use data type Long from the prefix on the words. It is also possible to run this example using the Elastic MapReduce Command Line Ruby Client with the command (Make sure you replace my-bucket in the output parameter with the name of one of your Amazon S3 buckets):   elastic-mapreduce --create --stream \     --mapper s3://elasticmapreduce/samples/wordcount/wordSplitter.py \     --input  s3://elasticmapreduce/samples/wordcount/input \     --output s3://my-bucket/output \     --reducer aggregate
evann83 Mode superutilisateur Bonjour Me voici avec un soucis que je n'arrive pas a résoudre: j'aimera utiliser la commande "javac" pour pouvoir compiler un fichier java sur mon bureau mais apparement il n'a pas envie puisque il me demande d'installer la JDK, logique je me suis dis après coups. Me voilà parti pour installier la JDK, passage en superutilisateur avec "sudo su" puis installation de la JDK avec : apt-get install openjdk-7-jdk Et la fail, petit message d'erreur : " E: impossible de récupérer quelques archives, peut être devrez-vous lancer la commande apt-get update ou essayer avec --fix-missing" Je lance " sudo apt-get update" encore un message d'erreur "W: le téléchargement de quelques fichiers d'index à échoué, ils ont été ignorés, ou les anciens ont été utilisés à la place" J'avoue que je suis un peu dans le floue artistique. Cordialement. Hors ligne Korak Re : Mode superutilisateur Bonjour, Quelle est ta version d'Ubuntu? Plus: ouvre un terminal et donne le retour complet (de la commande en elle-même jusqu'au retour au prompt) de la commande: sudo apt-get update Edit: En partie grillé par f.x0. Dernière modification par Korak (Le 27/01/2013, à 17:39) OS: Ubuntu 14.04 64 bits + Windows 8.1 64 bits en dualboot (BIOS UEFI, Secure Boot activé et table de partitions GPT) PC portable HP Pavilion g7-2335sb: Processeur: AMD A4-4300M APU Carte graphique: AMD Radeon HD 7420G Mémoire vive: 6 Go RAM Je suis Parrain-Linux En ligne tiramiseb Re : Mode superutilisateur "W: le téléchargement de quelques fichiers d'index à échoué, ils ont été ignorés, ou les anciens ont été utilisés à la place" De nombreux messages dans ce forum traitent de cette erreur, à vrai dire parfois plusieurs dans la même semaine... As-tu un peu creusé ? Hors ligne evann83 Re : Mode superutilisateur Bonjour alors tout d'abord je suis sur une machine virtuel avec la version ubuntu 12.10 voici le résultat en entier: Err http://fr.archive.ubuntu.com precise InRelease Err http://fr.archive.ubuntu.com precise-updates InRelease Err http://fr.archive.ubuntu.com precise-backports InRelease Err http://security.ubuntu.com precise-security InRelease Err http://security.ubuntu.com precise-security Release.gpg Ne parvient pas à résoudre « security.ubuntu.com » Err http://fr.archive.ubuntu.com precise Release.gpg Ne parvient pas à résoudre « fr.archive.ubuntu.com » Err http://fr.archive.ubuntu.com precise-updates Release.gpg Ne parvient pas à résoudre « fr.archive.ubuntu.com » Err http://fr.archive.ubuntu.com precise-backports Release.gpg Ne parvient pas à résoudre « fr.archive.ubuntu.com » Lecture des listes de paquets... Fait W: Impossible de récupérer http://fr.archive.ubuntu.com/ubuntu/dists/precise/InRelease W: Impossible de récupérer http://fr.archive.ubuntu.com/ubuntu/dists/precise-updates/InRelease W: Impossible de récupérer http://fr.archive.ubuntu.com/ubuntu/dists/precise-backports/InRelease W: Impossible de récupérer http://security.ubuntu.com/ubuntu/dists/precise-security/InRelease W: Impossible de récupérer http://fr.archive.ubuntu.com/ubuntu/dists/precise/Release.gpg Ne parvient pas à résoudre « fr.archive.ubuntu.com » W: Impossible de récupérer http://fr.archive.ubuntu.com/ubuntu/dists/precise-updates/Release.gpg Ne parvient pas à résoudre « fr.archive.ubuntu.com » W: Impossible de récupérer http://fr.archive.ubuntu.com/ubuntu/dists/precise-backports/Release.gpg Ne parvient pas à résoudre « fr.archive.ubuntu.com » W: Impossible de récupérer http://security.ubuntu.com/ubuntu/dists/precise-security/Release.gpg Ne parvient pas à résoudre « security.ubuntu.com » W: Le téléchargement de quelques fichiers d'index a échoué, ils ont été ignorés, ou les anciens ont été utilisés à la place. evann@evann-VirtualBox:~$ Hors ligne tiramiseb Re : Mode superutilisateur Tu n'as pas de résolution DNS. Comment as-tu configuré le réseau dans VirtualBox ? As-tu mis un paramétrage particulier ? Hors ligne Korak Re : Mode superutilisateur je suis sur une machine virtuel avec la version ubuntu 12.10 Cette erreur, et les suivantes: Err http://fr.archive.ubuntu.com precise InRelease Concerne des dépôts pour Ubuntu 12.04 (Precise) et pas pour Ubuntu 12.10 (Quantal). D'où les problèmes. Supprime les dépôts concernant Precise. OS: Ubuntu 14.04 64 bits + Windows 8.1 64 bits en dualboot (BIOS UEFI, Secure Boot activé et table de partitions GPT) PC portable HP Pavilion g7-2335sb: Processeur: AMD A4-4300M APU Carte graphique: AMD Radeon HD 7420G Mémoire vive: 6 Go RAM Je suis Parrain-Linux En ligne tiramiseb Re : Mode superutilisateur [...] Concerne des dépôts pour Ubuntu12.04(Precise) et pas pour Ubuntu12.10(Quantal). D'où les problèmes. Vraiment ? Un conflit entre la version de l'OS et les dépôts utilisés expliquerait un problème de résolution DNS ? evann83: ta machine virtuelle n'est-elle pas en 12.04 plutôt qu'en 12.10 ? Mes questions ci-dessus restent valables : Comment as-tu configuré le réseau dans VirtualBox ? As-tu mis un paramétrage particulier dans VirtualBox ? Et j'ajoute : Peux-tu exécuter les commandes suivantes ? ifconfig cat /etc/resolv.conf Hors ligne Korak Re : Mode superutilisateur Un conflit entre la version de l'OS et les dépôts utilisés expliquerait un problème de résolution DNS ? Non, je ne parle pas de problème de DNS. Ça m'étonnerais aussi que ce soit lié aux dépôts. Je parle seulement de la version de l'O.S. annoncée et des dépôts à problèmes. OS: Ubuntu 14.04 64 bits + Windows 8.1 64 bits en dualboot (BIOS UEFI, Secure Boot activé et table de partitions GPT) PC portable HP Pavilion g7-2335sb: Processeur: AMD A4-4300M APU Carte graphique: AMD Radeon HD 7420G Mémoire vive: 6 Go RAM Je suis Parrain-Linux En ligne tiramiseb Re : Mode superutilisateur Quels dépôts à problèmes ? Comment vois-tu qu'il y a des dépôts à problèmes ? Hors ligne Korak Re : Mode superutilisateur Ce que j'appelle "dépôts à problèmes", c'est ceux qui ne correspondent pas à l'O.S. annoncé. Pour l'histoire du DNS, je te laisse faire. Je comprend bien ce que signifie "Ne parvient pas à résoudre..." mais je ne suis pas assez calé sur ce point. C'est pour cette raison que je n'en ai pas parlé. Pour préciser ma pensée, il y aurait deux problèmes: - Le DNS. - Les dépôts ne correspondant pas à l'O.S. annoncé (ou evann83 s'est trompé dans la version de l'O.S.). OS: Ubuntu 14.04 64 bits + Windows 8.1 64 bits en dualboot (BIOS UEFI, Secure Boot activé et table de partitions GPT) PC portable HP Pavilion g7-2335sb: Processeur: AMD A4-4300M APU Carte graphique: AMD Radeon HD 7420G Mémoire vive: 6 Go RAM Je suis Parrain-Linux En ligne tiramiseb Re : Mode superutilisateur - Les dépôts ne correspondant pas à l'O.S. annoncé (ou evann83 s'est trompé dans la version de l'O.S.). Oui je suis d'accord. On attend donc le retour d'evann83 hein... (demain vers 10h du matin s'il garde le même rythme qu'entre ses deux premiers messages ) Hors ligne Korak Re : Mode superutilisateur On attend donc le retour d'evann83 hein... Oui, bien sûr. C'est le mieux. En espérant avoir une certification quand à la version de l'O.S.: 12.04 ou 12.10? OS: Ubuntu 14.04 64 bits + Windows 8.1 64 bits en dualboot (BIOS UEFI, Secure Boot activé et table de partitions GPT) PC portable HP Pavilion g7-2335sb: Processeur: AMD A4-4300M APU Carte graphique: AMD Radeon HD 7420G Mémoire vive: 6 Go RAM Je suis Parrain-Linux En ligne tiramiseb Re : Mode superutilisateur Allez, j'vais faire l’extrémiste de la langue française : s/quand/quant/ Hors ligne Korak Re : Mode superutilisateur j'vais faire l’extrémiste de la langue française : s/quand/quant/ Emmerdeur (et là, je suis sûr de l'orthographe). OS: Ubuntu 14.04 64 bits + Windows 8.1 64 bits en dualboot (BIOS UEFI, Secure Boot activé et table de partitions GPT) PC portable HP Pavilion g7-2335sb: Processeur: AMD A4-4300M APU Carte graphique: AMD Radeon HD 7420G Mémoire vive: 6 Go RAM Je suis Parrain-Linux En ligne evann83 Re : Mode superutilisateur Désolé de mon retard alors j'ai eu récemmennt un problème de connexion avec ma carte wifi, je l'ai résolu grâce à ce forum : http://forum.ubuntu-fr.org/viewtopic.ph … #p12319021 Oui sûr c'est 12_10 eth1 Link encap:Ethernet HWaddr 08:00:27:24:37:45 inet adr:192.168.30.72 Bcast:192.168.30.255 Masque:255.255.255.0 adr inet6: fe80::a00:27ff:fe24:3745/64 Scope:Lien UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 Packets reçus:22067 erreurs:0 :0 overruns:0 frame:0 TX packets:9977 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 lg file transmission:1000 Octets reçus:3401036 (3.4 MB) Octets transmis:1801559 (1.8 MB) Interruption:10 Adresse de base:0xd020 lo Link encap:Boucle locale inet adr:127.0.0.1 Masque:255.0.0.0 adr inet6: ::1/128 Scope:Hôte UP LOOPBACK RUNNING MTU:16436 Metric:1 Packets reçus:254 erreurs:0 :0 overruns:0 frame:0 TX packets:254 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 lg file transmission:0 Octets reçus:21006 (21.0 KB) Octets transmis:21006 (21.0 KB) # Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8) # DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN nameserver 127.0.0.1 search newton Hors ligne tiramiseb Re : Mode superutilisateur Peux-tu nous donner également les retours de : lsb_release -a grep -h domain-name-servers /var/lib/dhcp/dhclient*.lease | uniq cat /etc/apt/sources.list ls /etc/apt/sources.list.d cat /etc/apt/sources.list.d/* host google.com apt-get update PS : Dans le premier message tu as écrit : passage en superutilisateur avec "sudo su" puis installation de la JDK avec : apt-get install openjdk-7-jdk C'est à éviter. Dans ce cas fais plutôt "sudo apt-get install openjdk-7-jdk". (et si tu veux passer en root, plutôt que de faire "sudo su" tu peux faire "sudo -i" ou "sudo -s", c'est un chouïa plus propre) Dernière modification par tiramiseb (Le 30/01/2013, à 18:09) Hors ligne evann83 Re : Mode superutilisateur lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 12.04.1 LTS Release: 12.04 Codename: precise grep -h domain-name-servers /var/lib/dhcp/dhclient*.lease | uniq option domain-name-servers 192.168.30.1; option domain-name-servers 192.168.1.1; option domain-name-servers 10.136.127.253; cat /etc/apt/sources.list # See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to # newer versions of the distribution. deb http://fr.archive.ubuntu.com/ubuntu/ precise main restricted deb-src http://fr.archive.ubuntu.com/ubuntu/ precise main restricted ## Major bug fix updates produced after the final release of the ## distribution. deb http://fr.archive.ubuntu.com/ubuntu/ precise-updates main restricted deb-src http://fr.archive.ubuntu.com/ubuntu/ precise-updates main restricted ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu ## team. Also, please note that software in universe WILL NOT receive any ## review or updates from the Ubuntu security team. deb http://fr.archive.ubuntu.com/ubuntu/ precise universe deb-src http://fr.archive.ubuntu.com/ubuntu/ precise universe deb http://fr.archive.ubuntu.com/ubuntu/ precise-updates universe deb-src http://fr.archive.ubuntu.com/ubuntu/ precise-updates universe ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu ## team, and may not be under a free licence. Please satisfy yourself as to ## your rights to use the software. Also, please note that software in ## multiverse WILL NOT receive any review or updates from the Ubuntu ## security team. deb http://fr.archive.ubuntu.com/ubuntu/ precise multiverse deb-src http://fr.archive.ubuntu.com/ubuntu/ precise multiverse deb http://fr.archive.ubuntu.com/ubuntu/ precise-updates multiverse deb-src http://fr.archive.ubuntu.com/ubuntu/ precise-updates multiverse ## N.B. software from this repository may not have been tested as ## extensively as that contained in the main release, although it includes ## newer versions of some applications which may provide useful features. ## Also, please note that software in backports WILL NOT receive any review ## or updates from the Ubuntu security team. deb http://fr.archive.ubuntu.com/ubuntu/ precise-backports main restricted universe multiverse deb-src http://fr.archive.ubuntu.com/ubuntu/ precise-backports main restricted universe multiverse deb http://security.ubuntu.com/ubuntu precise-security main restricted deb-src http://security.ubuntu.com/ubuntu precise-security main restricted deb http://security.ubuntu.com/ubuntu precise-security universe deb-src http://security.ubuntu.com/ubuntu precise-security universe deb http://security.ubuntu.com/ubuntu precise-security multiverse deb-src http://security.ubuntu.com/ubuntu precise-security multiverse ## Uncomment the following two lines to add software from Canonical's ## 'partner' repository. ## This software is not part of Ubuntu, but is offered by Canonical and the ## respective vendors as a service to Ubuntu users. # deb http://archive.canonical.com/ubuntu precise partner # deb-src http://archive.canonical.com/ubuntu precise partner ## Uncomment the following two lines to add software from Ubuntu's ## 'extras' repository. ## This software is not part of Ubuntu, but is offered by third-party ## developers who want to ship their latest software. # deb http://extras.ubuntu.com/ubuntu precise main # deb-src http://extras.ubuntu.com/ubuntu precise main ls /etc/apt/sources.list.d => rien cat /etc/apt/sources.list.d/* cat: /etc/apt/sources.list.d/*: Aucun fichier ou dossier de ce type host google.com google.com has address 173.194.34.0 google.com has address 173.194.34.1 google.com has address 173.194.34.2 google.com has address 173.194.34.3 google.com has address 173.194.34.4 google.com has address 173.194.34.5 google.com has address 173.194.34.6 google.com has address 173.194.34.7 google.com has address 173.194.34.8 google.com has address 173.194.34.9 google.com has address 173.194.34.14 Host google.com.home not found: 4(NOTIMP) google.com mail is handled by 40 alt3.aspmx.l.google.com. google.com mail is handled by 50 alt4.aspmx.l.google.com. google.com mail is handled by 10 aspmx.l.google.com. google.com mail is handled by 20 alt1.aspmx.l.google.com. google.com mail is handled by 30 alt2.aspmx.l.google.com. apt-get update E: Impossible d'ouvrir le fichier verrou /var/lib/apt/lists/lock - open (13: Permission non accordée) E: Impossible de verrouiller le répertoire /var/lib/apt/lists/ E: Impossible d'ouvrir le fichier verrou /var/lib/dpkg/lock - open (13: Permission non accordée) E: Impossible de verrouiller le répertoire d'administration (/var/lib/dpkg/). Avez-vous les privilèges du superutilisateur ? Quelle est la différence pour le mode super utilisateur ? Hors ligne tiramiseb Re : Mode superutilisateur Ton système est bien Ubuntu 12.04 et non Ubuntu 12.10 comme tu sembles le penser. Pour le mode super utilisateur, la différence est de l'ordre de la bonne pratique. Concrètement pour toi sur le moment ça ne change pas grand chose. Mais quand tu passes "en super utilisateur" tu as tous les droits, et si là tu fais une connerie (te tromper de terminal, exécuter une commande "destructive" en root alors que tu voulais l'exécuter ailleurs en utilisateur normal, par exemple) tu ne pourras t'en prendre qu'à toi-même... Alors il vaut mieux limiter les risques et n'utiliser sudo que lorsque c'est nécessaire. Désolé, pour la dernière commande ça aurait dû être : sudo apt-get update Peux-tu l'exécuter ? Hors ligne
March 8th, 2012 at 9:45 pm by Dr. Drang @macdrifter Um, doesn’t Devon know that appscript has been end-of-lifed? appscript.sourceforge.net/status.html — Dr. Drang (@drdrang) Wed Mar 7 2012 Appscript was—and still is—a library for writing scripts that use Apple Events without having to write in AppleScript. There were actually three versions of the appscript library, one each for Python, Ruby, and Objective C. Clark and I were both users of the Python flavor.1 Appscript still works, and will almost certainly continue to work under Lion. But the Carbon API it depends on has been deprecated by Apple since Snow Leopard, so there’s no guarantee it’ll keep working beyond Lion. Sanderson was hoping that the replacement Cocoa APIs would gain the capabilities he needs to keep appscript working, but he’s now given up that hope. It’s a shame. For me, the great advantage of using appscript was that I didn’t have to abandon the pleasant syntax and powerful text manipulation features of Python just to send a few Apple Events. I still struggled sometimes with the appscript syntax, but most of that was due to the underlying AppleScript syntax of the application I was trying to communicate with. My first use of appscript was back in 2007, and I was still using it in November of last year. By January, though, I’d learned that Sanderson was telling users to avoid it for new projects, and I did. So what now? AppleScript is no substitute for Python, but without appscript Python is no substitute for AppleScript, either. I’ll have to render unto Caesar and use both. Most likely, I’ll write and debug the AppleScript parts in the AppleScript Editor, paste them into my Python scripts as multiline strings, and execute them from within Python via subprocess calls to the osascript command. A simple example would be something like this: python: #!/usr/bin/python from subprocess import * ascript = '''tell application "Safari" get URL of front document end tell''' frontURL = Popen(['osascript', '-'], stdin=PIPE, stdout=PIPE).communicate(input=ascript)[0] print "The page is from", frontURL.split('//')[1].split('/')[0] I’m not a big fan of the subprocess syntax, but I can live with it. Gabe has responded to Clark’s post with a prediction that all languages for the Mac between Automator at the low end and Objective C at the high end are in danger of being scrapped by Apple. This is even more dire than his comment here a couple of weeks ago Despite the threat from sandboxing and the lack of recent improvements to AppleScript, I think he’s too pessimistic. OS X is still Unix, and Unix is a programmer’s environment. Unless Apple takes away the Terminal, we’ll still be able to write scripts. And as for AppleScript, I still say Apple won’t get rid of it without plenty of notice and probably not without an alternative way—apart from Objective C—to handle Apple Events. Apple’s been pushing scriptability for Mac applications for too long to drop it suddenly. This is one situation for which Steve Jobs’ absence works in our favor: Apple won’t be as mercurial without him. And if I’m wrong about all this? Well, I switched from the Mac to Linux once. If necessary, I can do it again.
A bug I've recently seen in production code gave me the idea for this blog post. Probably smarter people already wrote better things on this topic, so this is mostly for myself, to better summarise my own thoughts. Corrections are welcome, please leave a comment! Let's say we have a somewhat standard API in Python or C++: a function (init_t) to create/initialise our data type, which returns an object of typet the object then has some properties or methods that we can call Signalling failures to initialise the object can be done in two ways: either by raising an exception, or by returning a null/None result. There are advantages and disadvantages to both: if using exceptions, then you must be sure to catch and handle all possible exceptions that the initialisation function can raise (otherwise more of your code can be aborted than you want) if using None as return value, then you mustcheck that the value is correct before using it, otherwise you get an exception or null pointer dereference The None model can create latent bugs, for example in the following code: ok = True for arg in input_list: t = init_t(arg) if t is None: ok = False continue t.process() return ok The presence of the continue statement there is critical. Removingit, or moving it after some other statements which work with t willresult in a bug. So using value-based returns forces us to introduce(manually) control points, without having the possibility to validatethe model by the compiler (e.g. in C++). So it would seem that this kind of latent bugs pushes us to use the exception model, with its drawbacks. Let's look at how this interface would be implemented in (IMHO)idiomatic Haskell (where the a and b types represent the input andoutput types): initT :: a -> Maybe T processT :: T -> b my_fn = … case initT arg of Nothing -> -- handle failure Just v -> processT v Yes, this can be written better, but it's beside the main point. Themain point is that by introducing a wrapper type “around” our maintype (T), we are forced via the type system to handle the failurecase. We can't simply pass the result of initT to a function whichaccepts T, because it won't type check. And, no matter what we dowith the result value, there are no exceptions involved here, so weonly have to think about types/values, and not control flowchanges. In effect, types become automatically-validated control-flowinstructions. Or so it looks to me ☺. So using types properly, we can avoid the exception-vs-return-valuedebate, and have all advantages without the disadvantages ofeither. If that is the case, why isn't this technique used more inother languages? At least in statically typed languages, it would bepossible to implement it (I believe), via a C++ template, forexample. In Python, you can't actually apply it, as there's no staticway of enforcing the correct decapsulation. I was very saddened to seethat Google's Go language, which is quite recent, has many exampleswhere initialisation functions return a tuple err, value = …,separating the actual value from the error, making it not safer thanPython. It might be that polymorphic types are not as easy to workwith, or it might be the lack of pattern matching. In any case, Idon't think this was the last time I've seen a null pointerdereference (or the equivalent AttributeError: 'NoneType' object hasno attribute …). Sadly ☹ You can even go further in Haskell and introduce more control flow structure via wrapper types. Please bear another contrived example: an HTML form that gets some input data from the user, validates it, saves it to the database, and echoes it back to the user. Without types, you would have to perform these steps manually, and ensure they are kept in the correct order when doing future modifications. With types, you only have to design the types correctly and export only smart contructors (but not the plain ones): module Foo ( ValidatedValue , validateValue , RecordId , CommittedValue , commitValue , buildFeedbackForm ) where data ValidatedValue a = ValidatedValue a validateValue :: a -> Maybe (ValidatedValue a) data RecordId = … data CommittedValue a = CommittedValue a RecordId commitValue :: ValidatedValue a -> ComittedValue a buildFeedbackForm :: CommittedValue a -> HTMLDoc From these types, it follows more or less that the only correct workflow is: get a value from the user validate it commit it, getting a transaction/record ID send the response to the user In other words: handleFeedbackForm = buildFeedbackForm . commitValue . validateValue There are still issues here, e.g. the type a is completely hiddenbehind the wrapper types, and we can't recover some basic properties(even if we use newtype, unless we useGeneralizedNewtypeDeriving). But it does offer a way to improvecontrol flow safety. And that is my 0.02 currency unit for today.
Bismut Re : [HOW TO] adesklets : configuration des desklets Bon, je ne trouve toujours pas le moyen d'afficher mes desklets au bon endroit, voici le contenu de mes fichiers : .adesklets # This is adesklets configuration file. # # It gets automatically updated every time a desklet main window # parameter is changed, so avoid manual modification whenever # a desklet is running. In fact, manual changes to this file # should rarely be needed. See `info adesklets'. [/home/raph/.adesklets Desklets/yab-0.0.2/yab.py] id=0 screen=0 x=1000 y=600 Quel que soit les valeurs x et y, mon Yab se pointe en haut à gauche... J'ai beau le déplacer et le fermer, le relancer, rien n'y fait, aucun changement dans ce fichier... config.txt de mon Yab id0 = {'bar_background_1': 'AAAAAA', 'bar_background_2': None, 'bar_foreground': '000000', 'bar_gradient_angle': 0, 'bar_height': 32, 'bar_opacity_1': 100, 'bar_opacity_2': None, 'caption_above': True, 'caption_color': 'AAAAAA', 'caption_delay': 0.10000000000000001, 'caption_fade_in': True, 'caption_fade_in_duration': 0.5, 'caption_fade_in_steps': 10, 'caption_font': 'Vera', 'caption_size': 20, 'click_effect': 'tint(alpha=100,red=255,green=255,blue=255);', 'click_effect_duration': 0.10000000000000001, 'icon_max_height': 128, 'icon_max_width': 128, 'icon_maximize_threshold': 0.90000000000000002, 'icon_min_height': 64, 'icon_min_width': 64, 'icon_spacing': 5, 'icons': [('emacs.png', 'GNU Emacs', 'emacs'), ('firefox.png', 'Firefox', 'firefox'), ('gimp.png', 'The GIMP', 'gimp-2.0'), ('terminal.png', 'Terminal', 'xterm'), ('xmms.png', 'XMMS', 'xmms')]} Voilà, je ne comprends vraiment pas... Mac Mini 2009 avec Archlinux Asus EeePC S101 avec Archlinux HTC Magic avec Android Hors ligne toma222 Re : [HOW TO] adesklets : configuration des desklets belou : je ne sais pas du tout si c'est possible de garder Modubar au dessus des fenêtres. Bismut : j'ai du mal à comprendre le contenu de ton fichier .adesklets. Moi j'ai [/home/thomas/desklets/yab-0.0.2/yab.py] id=0 screen=0 x=176 y=0 pour Yab. Pourrais-tu préciser dans quel dossier tu as placé tes desklets stp ? Hors ligne toma222 Re : [HOW TO] adesklets : configuration des desklets Tiens, j'en profite également pour demander un coup de main. J'essaie de faire marcher ce desklet : http://markbokil.org/index.php?section=desklets&content=c_desklets.php (qui semble très sympa). Lorsque je le teste, impeccable mais quand je l'enregistre, il se met bien dans le fichier .adesklets mais ne s'affiche pas. Si quelqu'un a une petite idée... Hors ligne Bismut Re : [HOW TO] adesklets : configuration des desklets Ben toma222, j'ai le même fichier .adesklets que toi, regarde mieux... (y a juste des commentaires avant, sinon c'est le même...) La seule chose qui change c'est le chemin d'accès car je les ai mis dans un dossier caché (.adesklets Desklets) pour pas gêner, tu crois que ça pourrait venir de ça ? Mac Mini 2009 avec Archlinux Asus EeePC S101 avec Archlinux HTC Magic avec Android Hors ligne toma222 Re : [HOW TO] adesklets : configuration des desklets Oui, c'est justement ça qui me semble bizarre. Ca ne pose peut-être pas de soucis mais au cas où, essayes de les mettre dans un dossier normal (desklets par exemple). Si ça ne marche toujours pas, je ne vois pas d'où peut venir ton problème. Hors ligne seb2py Re : [HOW TO] adesklets : configuration des desklets Salut ! Je reviens sur Modubar... Question certainement bête, mais y a-t-il moyen de lancer un script sh avec modubar ? Si oui, comment ? Sous Ubuntu Precise / Unity Hors ligne Bismut Re : [HOW TO] adesklets : configuration des desklets Oui, c'est justement ça qui me semble bizarre. Ca ne pose peut-être pas de soucis mais au cas où, essayes de les mettre dans un dossier normal (desklets par exemple). Si ça ne marche toujours pas, je ne vois pas d'où peut venir ton problème. En fait, avec un dossier non caché, ça marche... enfin ça marche à peu près... La 1ère fois que je lance tout va bien, il se place bien au bon endroit... Je ferme... Je relance... Rien ne se passe, je vais voir mon fichier .adesklets : Y a plus rien dedans ! Vraiment étrange comme phénomène, je commence à désepérer de aDesklets... Mac Mini 2009 avec Archlinux Asus EeePC S101 avec Archlinux HTC Magic avec Android Hors ligne gnu69 Re : [HOW TO] adesklets : configuration des desklets Bonsoir à tous, Mon soucy est que les applications se lancent en root. Comment faire pour les lancer en simple user? Merci Hors ligne gnu69 Re : [HOW TO] adesklets : configuration des desklets J'ai une autre question: comment franciser le adesklets 'weatherforecast'? Merci. Hors ligne Haazheel Re : [HOW TO] adesklets : configuration des desklets Salut gnu69 alors j'ai eu la même réflexion que toi et voila le premier résultat : http://forum.ubuntu-fr.org/viewtopic.php?pid=151669#p151669 "ma" solution a été de modifier directement le fichier .py Je sais c'est moche mais bon en attendant... Hors ligne Toscan Re : [HOW TO] adesklets : configuration des desklets question peut être idiote mais rien n'y a répondu dans ce poste... J'ai installé adesklets avec synaptic (il y était), mais aucune icone dans mes menus. Et rien ne se passe quand le lance dans un terminal, j'ai essayé "adesklets -v" mais j'au eu juste la version de adesklets : "novitch@Amstrad6128:~$ adesklets -vadesklets 0.4.8 Ma question?? comment utiliser adesklets ? /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ La star Meta-Locale : http://stephanomariano.free.fr \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ Hors ligne Haazheel Re : [HOW TO] adesklets : configuration des desklets Adesklets est donc bien installé maintenant il te faut choisir les desklets que tu souhaite en faisant : adesklets_installer Ensuite tu choisis ton desklet, tu le download, tu te rends dans /home/Toscan/.desklets/xxx dans xxx tu auras un fichier .py, tu le lance et tu fait test. Si ca marche tu register Après toute l'aide est déjà dispo sur le forum quasiment sur ce post Hors ligne Toscan Re : [HOW TO] adesklets : configuration des desklets J'ai encore un pb, adesklets_installer ne donne rien.... novitch@Amstrad6128:~$ adesklets -vadesklets 0.4.8novitch@Amstrad6128:~$ adeskletsnovitch@Amstrad6128:~$ adesklets_installerbash: adesklets_installer: command not foundnovitch@Amstrad6128:~$ /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ La star Meta-Locale : http://stephanomariano.free.fr \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ Hors ligne toma222 Re : [HOW TO] adesklets : configuration des desklets Salut, Honnetement la version disponible dans Synaptic risque de te poser pas mal de problèmes (il s'agit de la 0.4.8 alors que la version disponible en source est la 0.5.0). Je n'ai jamais réussi à la faire fonctionner correctement (notamment pour l'affichage des desklets avec Nautilus). Je te conseille donc de plutôt suivre le tuto pour l'installation à partir des sources (si tu suis les instructions à la lettre, tu ne devrais pas rencontrer de problèmes). Hors ligne Toscan Re : [HOW TO] adesklets : configuration des desklets Mais l'installation de sources ne pose pas de pb concernant les mises à jours ? /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ La star Meta-Locale : http://stephanomariano.free.fr \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ Hors ligne toma222 Re : [HOW TO] adesklets : configuration des desklets Pour les mises à jours, il suffit de supprimer les anciens fichiers et de recompiler la nouvelle version (c'est très simple). De toute façon avec Synaptic, le paquet adesklets ne semble pas être mis à jour (la mise à jour arrivera sans doute avec Dapper). Hors ligne Toscan Re : [HOW TO] adesklets : configuration des desklets j'ai fait tout ce qu'il faut, j'ai reussi a ne pas avoir de message d'erreur durant la compilation, j'ai fait adesklet_installer tout fonctionne . j'ai installé les desklets souhaités. Mais là que je fasse "adesklet" ou "adesklet --nautilus" , rien ne se passe, abolument rien ! Il faut redémarrer ? d'autres manip ? je n'arrive pas non plus à trouver le fichier de configuration "config.txt" ... J'ai pas mal parcouru http://adesklets.sourceforge.net/doc/fr/ mais rien ne me parle... Modif : j'ai reussi a aller dans le fichier de configuration en allant /home/monnom/.adesklets Mais dès que j'essaye d'aller dans les fichiers de conf des desklets installés précédemment (avec adesklets_installer) un message "impossible, ceci n'est pas un repertoire" ou alors "fichier introuvable" apparait... QUE FAIRE ? bouhouuuu n'y arriverai-je donc jamais? j'ai essayé kxdocker, pas vraiment la classe. peut de parametrages et bcp de plantages incohérents. Dernière modification par Toscan (Le 25/12/2005, à 20:21) /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ La star Meta-Locale : http://stephanomariano.free.fr \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ Hors ligne Haazheel Re : [HOW TO] adesklets : configuration des desklets Mais là que je fasse "adesklet" ou "adesklet --nautilus" , rien ne se passe, abolument rien ! Tout a fait normal L'installer ne fait que downloader le desklet et ne l'install pas vraiment (oui je sais c'est con) Ton desklet est donc sur ton pc mais pas "register" et donc quadn tu lance la commande et bien aucun desklet n'est enregistré donc absolument rien ne se passe Normal Il faut redémarrer ? d'autres manip ? je n'arrive pas non plus à trouver le fichier de configuration "config.txt" ... Alors il y a un config.txt par desklet et non pas un seul pour tout Les autres manips à faire sont : Aller dans le répertoire du desklet (ex : modubar-xxx-jesaisplus) faire un truc du genre ./modubar.py Faite un test (appuyez sur t) Si ca marche tu relance et fait register (appuyez sur r) Et là quand tu feras adesklets ca se lancera Tu auras aussi à faire une manip pour que cela se lance au démarrage (c'est dans le wiki/doc/forum) j'ai reussi a aller dans le fichier de configuration en allant /home/monnom/.adesklets Mais dès que j'essaye d'aller dans les fichiers de conf des desklets installés précédemment (avec adesklets_installer) un message "impossible, ceci n'est pas un repertoire" ou alors "fichier introuvable" apparait... Et merde mes explications tombent à l'eau de tête le répertoire doit être /home/monnom/.desklets et pas .adesklets (en tout cas chez moi) Que te donne la commande ls -lisa dans le répertoire des desklets ? Courage ca va marcher bientôt Mmm ce que tu peux faire c'est aussi aller dl les desklets sur le site d'adesklets plutôt que de les installer à partir de l'installler non ? Idée comme ça je n'ai pas testé. Hors ligne seb2py Re : [HOW TO] adesklets : configuration des desklets Mmm ce que tu peux faire c'est aussi aller dl les desklets sur le site d'adesklets plutôt que de les installer à partir de l'installler non ? Idée comme ça je n'ai pas testé. Je confirme, ça fonctionne très bien. Tu vas sur le site de adesklets (plus précisemment http://adesklets.sourceforge.net/desklets.html) et tu cliques sur le desklet que tu souhaites utiliser pour le télécharger. Après téléchargement, tu le décompresses. Personnellement, j'ai créé dans mon Home un dossier adesklets (visible) et j'ai mis dedans tous les dossiers des desklets décompressés. Ensuite, via le terminal, tu te places dans le dossier précédemment décompressé, par exemple: cd adesklets/modubar-0.0.1 et tu lances le fichier python, par exemple: ./modubar.py Et comme l'a si bien expliqué Haazheel: Faite un test (appuyez sur t) Si ca marche tu relance et fait register (appuyez sur r) Et là quand tu feras adesklets ca se lancera smile Le fichier config.txt te permet de modifier les caractéristiques de tes desklets. Par exemple, c'est dans le config.txt de modubar que tu vas ajouter, modifier, ou supprimer des éléments de la barre de lancement. Le fichier qui gère l'affichage et l'emplacement des desklets, c'est .adesklets (fichier caché donc) qui se trouve dans ton dossier Home. OUF !!! J'espère que cela t'aidera. J'y ai mis du temps aussi. Mais maintenant, j'ai compris le système. Reste à apprendre à fabriquer un desklet, mais ça... Sous Ubuntu Precise / Unity Hors ligne toma222 Re : [HOW TO] adesklets : configuration des desklets C'est vrai que le fonctionnement de adesklets n'est pas forcément intuitif (mais il faut préciser que ce soft n'a qu'un an). Et une fois qu'on a compris le principe, ça roule. Hors ligne gnu69 Re : [HOW TO] adesklets : configuration des desklets Vous lancez adesklets en root ou en user? Car chez moi, en user rien n'apparait. En root pas de probleme. Mais je pense qu'il y a un soucis là. Hors ligne Haazheel Re : [HOW TO] adesklets : configuration des desklets Pour moi c'est avec mon user (peut-être un problème de droit dans les répertoires où tu as mis les desklets?) Hors ligne Toscan Re : [HOW TO] adesklets : configuration des desklets Pour les sources, c'est ok je les ai installé dès la recommandation de toma222. bon j'ai pas terminé mais je suis sur la bonne voie grace a quelques infos à souligner pour les futurs utilisateurs nioubi comme moi : - le répertoire doit être /home/monnom/.desklets et pas .adesklets :D:D ça c'est parfait ça marche pour moi ! ! ! - Je continue et je vous tiens au courant ! MERCI ! à toute de suite. /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ La star Meta-Locale : http://stephanomariano.free.fr \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ Hors ligne Toscan Re : [HOW TO] adesklets : configuration des desklets Bon, he bien, ça marche nickel tout parfait comme il faut. J'ai plus qu'à passer un petit bout de temps à personnaliser tout ces config.txt et je colle d'ici peu (heu on va voir le temps que ça met...!) un lien vers une petite capture d'ecran. un énorme merci pour votre disponibilité je commence a y croire, au monde du libre. /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ La star Meta-Locale : http://stephanomariano.free.fr \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/ Hors ligne toma222 Re : [HOW TO] adesklets : configuration des desklets Ok, félicitation alors (c'est vrai que c'est pas forcément évident, mais en persistant et avec l'aide des gens de ce forum, on s'en sort toujours). Bonne personnalisation. Hors ligne
Intro For nearly nine years, I worked almost exclusively in Java. For me, Java was a productivity enhancer, over C and C++, and I greatly enjoyed working in it. Lately, however, I’ve been programming in Python almost exclusively, and I’m having so much fun with it that I have little desire to go back to programming in Java. Given that I developed code quite happily in Java for a long time, this is an interesting, though not unprecedented, turn of events. I’ve been mulling over why I find programming in Python to be so much more fun . In this article, I am going to capture and explore some of those thoughts. But first, a few caveats and disclaimers: These comments are entirelysubjective. I am not attempting a rational, scientific, rigorous analysis of these two languages; nor do I claim to be making a comprehensive comparison of Java and Python. I’m only sharing some musings. I do notsuddenly hate Java. If you’re a Java enthusiast and this article makes you want to yank out the napalm, realize that (a) I’m not bashing Java, and (b) I’m wearing my asbestos longjohns. I’ve been a Java programmer for a long time, and I bear no ill will toward a language I happily used for many years. I’m just trying to capture why I find Python to be more fun. I am ignoring architectural reasons to favor one platform over the other.In a real system, these considerations must be taken into account. I’mignoring them here because I am onlytrying to figure out why the Python programming language seems to be more fun to program than Java does (to me). I’m not a mindless Python fanboy. I was honestly surprised by how muchfun I found Python programming to be, and I’ve been mentally exploringwhyI find it so much fun. This article is really little more than a brain dump of those thoughts. I’m sure Your Favorite Language is every bit as much fun as Python, but I’m not programming in Your Favorite Language right now. I’m comparing one language I used almost exclusively for nine years with another one I’ve delved into very deeply in this last year. Having said all that, there will still be people who bash me and this article because (a) they think I’m disrespecting their Java, (b) they think I’ve left out some important stuff, (c) they’re annoyed that I didn’t consider how much fun Groovy or Erlang or Ruby or … are, (d) view me as some sort of Java Benedict Arnold or (e) they just don’t like what I have to say. Oh, well. adjusts longjohns I’ve organized this article as a set of observations, with an explanation of my thinking immediately following each observation. Observation 1: Python is a unique mixture of readability and brevity The first reaction nearly everyone has about Python is, “Indentation ispart of the language’s syntax? Yuck!” That was my first reaction, too. But,as it turns out, that feature contributes greatly to Python’s readability.Most people indent their code anyway, but most languages ignoreindentation; they rely, instead, on syntax elements (curly braces, do andend keywords, etc.) to determine where code blocks begin and end.Python’s awareness of indentation dispenses with the need for curly bracesor do/end keywords, leading to a brevity of syntax that still retainsits readability. As an example, compare the following Java code and Python code snippets, both of which do the same job. Java: 1 2 3 4 5 6 7 8 9 10 public class Test { public static void main(String[] args) { for (String s : args[0].split("\\s+")) System.out.println(s); System.exit(0); } } Granted, the System.exit(0) doesn’t really need to be there; I got in thehabit of putting it in, though, when using versions of Java that wouldn’texit properly without such a call. But even if you remove that line, it’sstill more verbose than the Python version: 1 2 3 4 import sys for s in sys.argv[1].split(): print s Yes, I could make the Java example shorter by putting the braces on thesame line as the code, as most people do, but I actually find that to beeven less readable. (That’ a personal stylistic preference. It has littleto do with the real point of this article.) The point is, Python’s syntax is brief without being overly terse. But it gets even more pronounced. Observation 2: No need for set/get methods in Python Python code doesn’t typically use the get and set methods so common inJava. Normally, when writing Java code, you carefully protect your instancevariables by making the private, so callers can only interact with them viagetter and setter methods. Why? Well, consider this scenario. Suppose youwrite a class called Point that looks something like this: 1 2 3 4 5 6 7 8 9 10 11 public class Point { public int x; public int y; public Point(int x, int y) { this.x = x; this.y = y; } } Pretty soon, all over the code base, people are writing code like this: 1 2 3 4 point1 = new Point(...) point2 = new Point(...) point2.x = point1.x - deltaX point2.y = point1.y - deltaY That’s actually quite readable, but there’s a problem: Suppose your requirements change, and now you have to ensure that all coordinates are positive. Crap. Now you realize that you should have written your Point class likethis: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 public class Point { private int x; private int y; public Point(int x, int y) { this.x = x; this.y = y; } public int getX() { return this.x; } public int setX(int newX) { this.x = newX; } public int getY() { return this.y; } public int setY(int newY) { this.y = newY; } } If you’d written it that way, people would’ve had to use it like this: 1 2 3 4 point1 = new Point(...) point2 = new Point(...) point2.setX(point1.getX() - deltaX) point2.setY(point1.getY() - deltaY) point2.setX(point1.getX() - deltaX) isn’t anywhere near as intuitive ornice-looking as point2.x = point1.x - deltaX, but it’s a lot safer. Andif you’d written it that way, you would only have to go into the set()methods and add your constraint checks to ensure the arguments arepositive, without having to go change a whole bunch of calling code. Forinstance: 1 2 3 4 5 6 7 public int setX(int newX) { if (newX > 0) throw new IllegalArgumentException("Negative X value."); this.x = newX; } Okay, why is Python’s solution to this problem more readable? BecausePython has a neat construct called a property. As Python’s inventor,Guido van Rossum, puts it: Properties are a neat way to implement attributes whose usage resembles attribute access, but whose implementation uses method calls. These are sometimes known as “managed attributes”. Basically, a property is a way to make a function call look like aninstance variable reference, which allows one to write code that adheresbetter to the Uniform Access Principal. Let’s take our example, above,and do it in Python. First, the Point class: 1 2 3 4 5 class Point(object): def __init__(self, x, y): self.x = x self.y = y (You’ll note that it’s a tad shorter than the equivalent Java class, while being just as readable.) So, as before, people start using your Point class: 1 2 3 4 point1 = Point(...) point2 = Point(...) point2.x = point1.x - delta_x point2.y = point1.y - delta_y Okay, now along comes that pesky requirement that all coordinates must bepositive. Instead of going back and changing all the callers to use newset methods, you can simply wrap access to x and y in functions, asshow below. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 class Point(object): def __init__(self, x, y): self.__x = x self.__y = y def getx(self): return self.__x def setx(self, newx) if newx > 0: raise ValueError, 'Negative X value' self.__x = newx x = property(getx, setx, doc='X coordinate') def gety(self): return self.__y def sety(self, newy) if newy > 0: raise ValueError, 'Negative Y value' self.__y = newy y = property(gety, sety, doc='Y coordinate') Now, whenever someone writes point.x, they’re really callingpoint.getx(). Similarly, point.x = 1 results in a call to thepoint.setx() method. You’ve added getters and setters, but the callers of your Point classstill get to use the original, simpler, easier-to-read syntax for accessingthe value. You get the best of both worlds: clean and simple client accessto your Point class, and protection and flexibility within the class. Again, this tends to lead to more readable code. Observation 3: Python has useful constructs Java lacks Python has some features that both make it easier to code certain common constructs and contribute to the resulting code’s readability. Here are a few examples. Function Objects In Python, functions are first class objects. That is, you can define a function pretty much anywhere you want, then call it or use a reference to it. This is beneficial in many areas, but for illustration, I’ll focus on just two: Callbacks Factory methods Callbacks Between interfaces and inner classes, Java can accomplish a lot of the things people use callback functions for, but functions are more compact, more flexible, and easier to read. For example, consider a function to traverse a data structure (a tree, for instance) to find objects that match certain criteria. The matching function is generic: It traverses the structure and calls a caller-supplied matching function to match two objects. It makes sense to have the tree class supply the matching logic (which hides the details of efficiently traversing the tree), while allowing the caller to specify the matching function. Here’s how you might implement that logic in Java, using an interface. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 import java.util.Collection; import java.util.ArrayList; public interface Matcher<T> { boolean matches(T o); } public class MyTree<T> { // details omitted Collection<T> matches(Matcher matcher) { Collection<T> result = new ArrayList<T>(); for (element : this.treeElements) if (matcher.matches(element)) result.add(element); return result; } } And here’s how a caller might use it, using an anonymous inner class: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 MyTree<String> keywords = new MyTree<String>(); // Code that fills the tree goes here // Now, get all keywords starting with 'a'. (Yeah, it's contrived...) Collection<String> matches = keywords.matches (new Matcher<String>() { public boolean matches(String s) { return s.startsWith("a"); } }); Now let’s look at the same thing in Python. First the class: 1 2 3 4 5 6 class MyTree(object): # details omitted def matches(self, match_func): return [element for element in self.__tree_elements if match_func(element)] And now the caller: 1 2 3 4 5 6 7 keywords = MyTree() # Code that fills the tree goes here # Now, get all keywords starting with 'a'. matches = keywords.matches(lambda element: element.startswith('a')) It’s also possible to use a “real” function, rather than a lambda: 1 2 3 4 def match(element): return element[0] == 'a' matches = keywords.matches(match) In simple cases like this, however, it’s easier and more straightforward to use a lambda. Once again, the Python code is simpler and (in my opinion) easier to read and faster to code. Factories In Java, a factory is typically a static method that is called to produce an object. Factories are used for a variety of reasons, including: Construction of singletons. Hiding instantiation of one of several possible underlying implementations. In Java, since methods cannot occur outside of a class, you are sometimes forced to write a class just to provide a factory function. Here’s an example. Consider a remote procedure call (RPC) layer that has many different RPC implements (e.g., “XML-RPC”, “JSON-RPC”, “SOAP”, etc.) Each implementation is encoded in a concrete class, and all classes adhere to a specific interface: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 public interface RPC { public Object callRemote(String function, Object ... args); } class XMLRPC implements RPC { // ... public Object callRemote(String function, Object ... args) { // ... } } class JSONRPC implements RPC { // ... public Object callRemote(String function, Object ... args) { // ... } } // etc. Now, suppose your application is going to support a configuration optionthat allows the user to specify the desired RPC mechanism using a string,and you want to map that string to an instance of the appropriate RPCclass. The easiest solution is a factory method. But where to you put thatmethod? You can’t hang it off the RPC interface, because that’s just aninterface. You have two choices: Convert the RPCinterface to an abstract class, and put the method there. Doing that, of course, means that RPC subclasses can’t extend any other abstract classes, which may cause some implementation headaches (or might not, depending). Create a special RPCFactoryclass, which is clumsy, but is probably the safest way to go. 1 2 3 4 5 6 7 8 9 public class RPCFactory { public static RPC getRPC(String identifier) { if (identifier.toLowerCase().equals("xmlrpc")) return new XMLRPC() ... } } With Python, it’s easier: Simply create a factory method right in yourmodule. To make things even simpler, you can use a hash table to look upthe implementing classes. (You can do that with Java, too, but you end uphaving to use the Reflection API, which is clumsier than in Python. (SeeObservation 4: Introspection is easier in Python, below.) 1 2 3 4 5 6 7 8 9 RPC_CLASSES = {'xmlrpc' : XMLRPC, 'jsonrpc' : JSONRPC, ... } def get_rpc(identifier): try: return RPC_CLASSES[identifier]() except KeyError: raise ValueError, '"%s" is an unknown RPC type' % identifier Closures Python doesn’t have true closures, in the Ruby or LISP sense of the term, but it’s a heck of a lot closer than Java. While there are proposals to add (true) closures to Java (such as this one), it doesn’t have them yet, and it may be awhile until it does. The closest thing Java has to a closure is an anonymous inner class, and it isn’t really a closure. It’s also clumsy to use and can lead to less readable code. I’m not going to go into the differences between inner classes and closures; there are plenty of discussions on that issue already. For further reading, here are a few pointers: Since I’m mostly concerned about “fun”, readability and productivity, let’slook at one example. Closures are useful for a lot of things; this isjust one simple example. I’ve adapted this scenario from Neal Gafter’sUse cases for closures blog entry. The situation is simple: You have to provide a function that increments a counter for a key; the counters are stored in a hash table-like object. If the counter for a key isn’t present, then it must be created and initialized to 1. The wrinkle is that the hash table-like object is in a shared resource. (Perhaps it’s a file, or perhaps it’s shared memory; that part doesn’t matter here.) Since the table is shared, it must be locked to prevent corruption. You have to be sure to release the lock, even if an error occurs. The standard pattern for this approach (using Python, in this case) is something like: 1 2 3 4 5 6 7 8 9 10 def increment(key): self.lock.lock() try: value = self.counter_table.get(self, key) if not value: self.counter_table.add(key, 1) value = 1 return value finally: lock.unlock() There are two problems with that code: You end up with that locking pattern all over your code. Wouldn’t it benice to hide it somewhere? Wouldn’t it reallybe nice if it were part of the lock API? The lock API cannot enforce that pattern. The requirement can bedocumented it, and the documentation can wag its finger (as it were) atthe programmer, saying, “Always, always, alwaysmake sure you release your locks!” But it cannotenforcethe restriction programmatically. And if someone forgets thefinallyblock, he’ll introduce a bug–one that’s often tricky to track down. Closures solve that problem. Using closures, you can augment the locking API (or write a local front-end function) that looks like this: 1 2 3 4 5 6 def with_lock(lock, action, *args, **keyword_args): try: lock.lock() action(*args, **keyword_args) finally: lock.unlock() Now our function becomes much simpler: 1 2 3 4 5 6 7 8 9 10 def increment(key): value = None def do_incr(key): value = self.counter_table.get(key) if not value: self.counter_table.add(key, 1) value = 1 with_lock(self.lock, do_incr, key) Better yet, the locking semantics are enforced in one place: thewith_lock() function. Note that the do_incr() function has access to, and can change, theparent function’s value object. It closes over any objects already inscope when it is declared, hence the term “closure”. You cannot do the same thing in Java, even with an anonymous innerclass, because any objects your inner class closes over must befinal. Newer versions of Python make it even easier by providing a withstatement (available in the __future__ module). For complete details, seePEP 343, but here’s the general idea. First, the lock API can provide a context manager function, like this: 1 2 3 4 5 6 7 8 9 from contextlib import contextmanager @contextmanger def lock(the_lock): the_lock.lock() try: yield the_lock finally: the_lock.unlock() Now, the calling code becomes even more straightforward: 1 2 3 4 5 6 7 8 from __future__ import with_statement def increment(key): with lock(self.lock): value = self.counter_table.get(key) if not value: self.counter_table.add(key, 1) value = 1 You can’t do that in Java very cleanly right now, though the various closures proposals, targeted at Java 7, attempt to address that problem. Neal Gafter’s Use cases for closures goes through his favored closure proposal in detail. Using that approach, you’d do something like this: 1 2 3 4 5 6 7 8 9 10 11 12 13 <E extends Exception> public static void withLock(Lock lock, void()throws E block) throws E { lock.lock(); try { block(); } finally { lock.unlock(); } } That block of code defines the method that will run my code within a lock.The Java closure proposal also adds some syntactic sugar that says,basically, “if the passed block argument is the last argument in the list,it can be specified outside the argument list’s final parenthesis.” That means you can invoke withLock() like this: 1 2 3 4 withLock(myLock) { // code (closure) that operates within the lock } The code between the curly braces is really the last argument to thewithLock() method. And it truly is a closure: Unlike an anonymous innerclass, the code block has read-write access to all the identifiers in theparent block’s scope. I heard about the closures-in-Java proposals while I was still programming Java for my previous employer. I was very excited about the idea, since it makes a lot of programming tasks easier and safer. However, while adding closures to Java would be a good thing, they’re still not as simple as closures are in other languages, such as Python. Array and String Support Both Java and Python have built-in support for strings and arrays, but Python has a lot more syntactic sugar for both, leading to simpler and more readable code. Here are some examples: String or Array Slicing In Java, to get a “slice” out of a string, you have to use methodson the java.lang.String class, like so: 1 2 3 4 5 String s = "foo and bar" s1 = s.substring(4, 7); // get the word "and" last = s.charAt(s.length() - 1); // get the last character in the string first = s.charAt(0); // get the first character in the string The same operations are simpler and more readable in Python: 1 2 3 4 5 s = 'foo and bar' s1 = s[4:7] # get the word 'and' last = s[-1] # get the last character in the string first = s[0] # get the first character in the string Further, while Java allows strings to be concatenated via the “+” operator, that usage is discouraged for building up strings, since it can be inefficient. So, instead of the readable: 1 you end up writing: 1 2 3 4 5 buf = StringBuffer() buf.append("I don't recognize the command \""); buf.append(s); buf.append("\" Sorry."); message = buf.toString(); Oh, joy. UPDATE In the reddit.com Programming forum, someone pointed outthat using “+” for string concatenation isn’t really encouraged in Python,either. The author of the comment suggests one of the following, instead: 1 2 message = 'I don\'t recognize the command "%s". Sorry.' % s message = ' '.join(['I don\'t recognize the command "', s, '". Sorry.']) Fair enough, but my point still holds: Both of those alternatives are more readable and shorter than the Java alternative. Python also permits slicing and concatenation via “+” on arrays and tuples, not just strings. (Think of a tuple as a read-only array.) Again, this means you write less code to accomplish an array operation, and the code you do write tends to be more readable. Dictionary Syntax Python has built-in support for dictionaries (also called “associativearrays” in some languages and “hash tables” in others). In Java, you have avariety of Map implementations that provide the same capability, andthey’re quite rich. The JDK’s Map interface is well-defined andsufficiently abstract. I even wrote a FileHashMap class that looks likea Map, but keeps its values in a file rather than in memory. But Java does not have built-in syntax support for maps, so dealing withthem requires more code. Consider this simple example, a symbol table ofkeywords. Let’s assume the existence of a Symbol class that capturesinformation about a symbol (the line where it’s defined, its type, etc.). 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 public class SymbolTable { private Map<String,Symbol> symbols = new HashMap<String,Symbol>(); // ... public Symbol getSymbol(String identifier) { // Get or create the symbol Symbol sym = symbols.get(identifier); if (sym == null) { sym = Symbol(identifier); symbols.put(identifier); } return sym; } } Here’s the equivalent Python code: 1 2 3 4 5 6 7 8 9 10 11 12 class SymbolTable(object): symbols = {} def get_symbol(identifier): try: sym = symbols[identifier] except KeyError: sym = Symbol(identifier) symbols[identifier] = sym return sym It may seem like I’m nit-picking, but the Python approach just seemssimpler and more natural. (And believe me, I’ve used my share of Java Mapclasses over the years.) Observation 4: Introspection is easier in Python This is a big one. Both Java and Python carry object information around at run time, and you can query that information programmatically. But it’s a pain in the ass in Java. Let’s suppose you want to write a function that’ll take any object thathas a method with this signature: 1 boolean compare(String s1, String s2); Further, you don’t want to constrain the objects to implementing a specificinterface. (Though this situation doesn’t sound likely, and isn’t somethingyou’d normally want to do, it does come up.) To do that in Java requires resorting to the Reflection API. Here’s the code you have to write to verify that the object has such a method, and then to call that method with two strings: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 import java.lang.reflect.Method; ... public Object callCompare(Object o, String s1, String s2) { Class cls = o.getClass(); try { Method method = cls.getMethod("compare", String.class, String.class); return method.invoke(o, s1, s2); } catch (NoSuchMethodException ex) { ... } catch (IllegalAccessException ex) { ... } catch (IllegalArgumentException ex) { ... } catch (InvocationTargetException ex) { ... } That code is ugly for a few reasons. (It used to be worse, before Java 5 introduced variable arguments.) All those exceptions either have to be caught or propagated. If the method itself throws an exception, it’ll be wrapped in anInvocationTargetException, and you have to unwrap it if you want to re-throw the real exception. Does the above code look like it’s calling an object’s compare()method toyou? Here’s how you do the same thing in Python: 1 2 3 4 5 6 7 8 9 o = ... s1 = ... s2 = ... try: result = o.compare(s1, s2) except AttributeError: # Doesn't have that method. ... In addition to being short and to-the-point, the Python code actuallylooks like what it’s doing. Observation 5: Python has an rich library I mention this one only because Java also has a rich library. Between the JDK and the open source Java code out there, there’s lots of help building Java applications. When I started doing a lot of Python, I found the same thing to be true, so I didn’t lose anything there. There is this sense, though, that a lot of things are just easier inPython. For instance, the Django web framework makes incrementallybuilding an application so easy, it’s ridiculous. It’s much easier to getstarted with Django than with even a simple Java web container likeTomcat. (Of course, this isn’t evidence; it’s an anecdote. You’re freeto draw your own conclusions.) Observation 6: Dynamic Typing (a mixed bag) I mention dynamic typing because so many people either tout it as the best thing since sliced luncheon meats or decry it as an evil feature considered as harmful as the GOTO statement. Reality, of course, is somewhere in between–as is my experience. There are more carefully considered opinions, of course, but they tend toget lost in the noise. See, for instance, an excellent paper entitledStatic Typing Where Possible, Dynamic Typing When Needed (PDF) for agood and balanced discussion of the issue. I’m not going to waste time debating which one is “better” (for some values of “better”). There are plenty of people who do a better job of that than I will. (Start with the paper I just mentioned, for instance.) I’m just going to share my own experiences with the two approaches, using Java and Python as my examples. Recall that Java is statically typed, which has several advantages. Compiler-time checks First, the compiler can ensure that you don’t assign the wrong type of object to a variable or pass the wrong type of object to a method (unless, of course, you use type casting to thwart the compiler, but good Java programmers try to avoid having to cast). I have long been a fan of compile-time protection. The more problems thecompiler can find for you, the fewer things you have to root out at runtime. Oddly enough, though, I haven’t found the lack of compile time typechecking to be a big problem with Python so far. I suspect this is becauseI’ve been writing well-encapsulated code with lots of automated unit tests.A paper called Why dynamic typing? (link now dead) puts it this way: Why does dynamic typing (as done with Smalltalk) not negatively affect the stability of large applications? Because large applications written in a dynamic OO language still have well encapsulated parts that can be verified independently, and the total implementation can be about 1/2 to 1/3 the size of the implementation in Java (or another static-typed language) In the small you may get a type error that static-typing could have [caught], but you also get to build a system such that you never have to write 40-70% of the code you might otherwise have to. And a line of code not written is a 100% guaranteed correct line of code. It’s an interesting argument. I’m not sure I agree completely with the last statement, but there’s merit in the observations. For me, so far, the lack of compile-time type protection in Python simply hasn’t been as big a deal as I thought it would be. UPDATE: Over time, it turned out to be quite a big deal, which is whyI’ve migrated to Scala; it offers a similar brevity of expression, whilebeing compile-time type-safe. Syntax-based introspection Another advantage of static typing is that IDEs can tell a variable’s type no matter where it appears, which is a boon for things like auto-completion. This is where I’ve most noticed the lack of type information. Lately, I’vebeen using the excellent Wing IDE to develop Python. (Why I’m usingWing instead of my old trusty friend, Emacs, is a subject for a futurearticle.) Unlike any Java IDE, there are cases where Wing just cannot tellthe type of a variable and, therefore, cannot help me determine what fieldsand methods that variable provides. Here’s a case where it can tell: 1 2 3 4 my_foo = Foo() my_foo.a ^ If I invoke auto-completion where the caret is, Wing can show me allattributes that start with “a”, because the assignment of a Foo object tomy_foo is within scope. However, here’s a case where it cannot tell: 1 2 3 def somefunc(foo): foo.a ^ At runtime, the argument foo can be anything, so the IDE cannot tell whatfields it might have (other than, of course, the fields that all Pythonobjects have). Sometimes, I miss the ability for the IDE (or any other tool) to be able to introspect a variable by syntactic analysis, but it honestly hasn’t been enough of an issue to take the fun out of Python. Observation 7: The Interactive Shell Python comes with an interactive shell, and there’s an even better one (IPython) available for free. When I’m not sure how something works, or I want to try something manually, or run a quick test, I can simply fire up the Python shell and try the code, right then and there. (Ruby and other so-called scripting languages have similar tools.) It’s impossible to overstate the usefulness of a command-line interface to the language interpreter. Nothing quite like it exists for Java. The BeanShell console comes close, but the latest version as of this writing doesn’t fully support Java 5. (It’s missing support for generics, for instance.) Jack Repenning also pointed out, in a private email, that the brevity argument applies here, as well: Even in environments with a fairly competent Java Interactive Shell, what you have to type in is still Java, and the extra prolixity of Java hurts all the more when you’re just trying to confirm the results of a function call, or the shape of an object, or any of those other explorations the interactive shell is so good at. Final Comments I’m sure there are differences I’ve missed. And, as I noted above, I’m not trying to convince anyone who uses Java that it’d be better to jump ship and join the Pythonistas. I used Java for a long time, and I’m sure I’ll do more work in Java. Nor will I complain a lot if I have to do so. Both Java and Python (as well as Ruby and other languages) allow me to develop and test my software on any platform, unlike (say) most C# work, which locks me into a platform I don’t like all that much (Mono notwithstanding). I’m just trying to figure out why Python is so damned fun. Time to stop thinking for a bit and have some fun… UPDATE: 29 July, 2008 I have received some emailed comments. Thanks to everyone who took the time to send me a comment. Both Dan Barbus dan.barbus /at/ gmail.com and Simon Lieschke simon atlieschke.net pointed out an oversight. My original Python matches()function (see Callbacks, above) was written like this: 1 2 3 4 5 6 def matches(self, match_func): for element in self.__tree_elements: if match_func(element): result.append(element) return result Both Dan and Simon pointed out that the function can be reduced to a one-liner: 1 2 def matches(self, match_func): return [element for element in self.__tree_elements if match_func(element)] One-liner list comprehensions like that are one of the things I like about Python, and I’m not sure why I wrote the function the “long” way originally. Chalk it up to a brain fart. Michael Easter (codetojoy /at/ gmail.com) noted out that, likeBeanShell, Groovy also has a shell that allows interpretative Java.So does Pnuts, a very fast Java scripting language I’ve used quiteheavily in the past. These are good tools to keep in one’s Java toolbox. Fred van Dijk (fredvd /at/ gmail.com) pointed out a cut-and-paste typo inone of my examples. Thanks, Fred. Florian Bosch (pyalot /at/ gmail.com) wrote: I’ve read your article and I think I you might find my perspective on dynamic typing also interesting, and why it actually works, and works very well. To my shame I have to admit I’m not a big user of unit tests. I’ve used them to great effect sometimes, and some software I wrote has a lot of them, but generally there’s very little of it around my code. On any account, python still is making me way more productive, and if your argument was true, that your unit tests safe you from being harmed by dynamic typing, then I would be burned badly, but I am not. I think I can explain that. Put simply, I think typing does not essentially catch the larger domain of logical errors that happen during programming. However, it does introduce considerable overhead. Logically, when you take typing constraints away, a small amount of errors that would’ve been cought before slip by to runtime, however you get a lot less overhead to deal with, which more then makes this up. Put not so simply, Typing is a school of formalism that attempts to describe a systems constraints in terms of types involved. That is a special form of a constraint system, like clipse or prolog. These systems work great for specific domains, but they’re not a great way to do all things. Enforcing constraint oriented programming on all parts of your code is not a very smart idea to increase productivity, because most code actually does not benefit from that particular flavor of constraint system. Fair enough, though there are still times where I want both (or either). Florian followed up with: Python actually has strong types, as opposed to say PHP or Perl. And you absolutely can write static looking code today in python, for instance: @types(int, str) def foo(arg1, arg2): pass And annotations for python loom on the horizon, which would make it possible to write things like this: @typechecked def foo(int arg1, str arg2): pass I’m not sure if this is coming in Python 3000 or not. (If someone knows, please enlighten me.) I know that there are already some packages out there that provide similar annotations, such as: The typecheck module provides various typechecking features,including an @acceptsannotation that looks a lot like the@typeannotation noted above. Pyanno also has some typechecking annotations. UPDATE: 16 September, 2008 Jésus Gómez (jgomo3 /at/ gmail.com) wrote: About Observation 3 and factories. You could avoid the use of (and maintaining the) dict you use in this code: RPC_CLASSES = {'xmlrpc' : XMLRPC, 'jsonrpc' : JSONRPC, ... } def get_rpc(identifier): try: return RPC_CLASSES[identifier]() except KeyError: raise ValueError, '"%s" is an unknown RPC type' % identifier by redefining the get_rpcfunction as:<metadata lang=Python prob=0.11 /> def get_rpc(identifier): try: return getattr(<<module_which_define_the_classes>>, identifier)() except KeyError: raise AttributeError, '"%s" is an unknown RPC type' % identifier UPDATE: 13 October, 2008 Regarding my get_symbol() method, in the section onDictionary Syntax, Kevin Samuel (info.ksamuel /at/ googlemail.com)wrote: I’d like to share a little trick. When you say: class SymbolTable(object): symbols = {} def get_symbol(identifier): try: sym = symbols[identifier] except KeyError: sym = Symbol(identifier) symbols[identifier] = sym return sym You could just use the built-in: d = {} value = d.setdefault(identifier, default_value) setdefaultis a bad name since it does return a value or the default value (orNoneis no value is given). The Python documentation on dictionaries says: a.setdefault(k[,x]) returnsa[k] ifkina, elsex(also setting it) It further elaborates: setdefault()is likeget(), except that ifkis missing,xis both returned and inserted into the dictionary as the value ofk.xdefaults toNone. I confess that I missed this behavior when I read the Python documentation. Thanks, Kevin.
I have an object subclass which implements a dynamic dispatch __ iter __ using a caching generator (I also have a method for invalidating the iter cache) like so: def __iter__(self): print("iter called") if self.__iter_cache is None: iter_seen = {} iter_cache = [] for name in self.__slots: value = self.__slots[name] iter_seen[name] = True item = (name, value) iter_cache.append(item) yield item for d in self.__dc_list: for name, value in iter(d): if name not in iter_seen: iter_seen[name] = True item = (name, value) iter_cache.append(item) yield item self.__iter_cache = iter_cache else: print("iter cache hit") for item in self.__iter_cache: yield item It seems to be working... Are there any gotchas I may not be aware of? Am I doing something ridiculous?
I have set import matplotlib as mpl AXES_COLOR = '#333333' mpl.rc('axes', edgecolor=AXES_COLOR, labelcolor=AXES_COLOR, grid=True) mpl.rc('xtick', color=AXES_COLOR) mpl.rc('ytick', color=AXES_COLOR) mpl.rc('grid', color=AXES_COLOR) The color of the axes labels and the ticks are properly set both in 2D and in 3D. However, the edgecolor doesn't apply to 3D axes and they remain black. Likewise, the grid isn't affected. I think figured out how to access the individual axes of a 3D plot: import matplotlib.pyplot as plt import mpl_toolkits.mplot3d # Needed for 3d projection. fig = plt.figure() ax = fig.add_subplot(111, projection='3d') ax.w_zaxis # <- the z axis The documentation mentions a property that we can use until the developers have finished refactoring their 3D code: import pprint pprint.pprint(ax.w_xaxis._AXINFO) {'x': {'color': (0.95, 0.95, 0.95, 0.5), 'i': 0, 'juggled': (1, 0, 2), 'tickdir': 1}, 'y': {'color': (0.9, 0.9, 0.9, 0.5), 'i': 1, 'juggled': (0, 1, 2), 'tickdir': 0}, 'z': {'color': (0.925, 0.925, 0.925, 0.5), 'i': 2, 'juggled': (0, 2, 1), 'tickdir': 0}} However, the color parameter changes the color of the background of the axes planes (between the wired of the grid), not the color of the edges of these planes. Am I digging too deep ?
CSS jossshr — 2010-03-15T17:58:42-04:00 — #1 I am trying to create a simple webpage with a horizontal list as the navigation, but IE (at least IE7) isn't accepting my horizontal list or my font colors. I've got it as inline, but it's still not working. Works great in FF, Safari and Chrome. The website is www DOT familylegacy2010 DOT com Here is the applicable CSS and HTML: #nav { position:relative; text-align:right; margin-right: 80px; margin-top:50px; list-style: none; } #nav li { display:inline; } #nav li a { padding-left: 25px; color:#ffffff; text-decoration: none; font-variant:small-caps; font-weight:bold; } #nav li a:hover { color: #000000; text-decoration: underline; } <div id="nav"> <ul> <li><a href = "http://www.familylegacy2010.com/banquet.html">the banquet</a></li><li><a href = "http://www.familylegacy2010.com/table.html">reserve a table</a></li><li><a href = "http://www.familylegacy2010.com/zambia.html">about zambia</a></li><li><a href = "http://www.familylegacy2010.com/familylegacy.html">about us</a></li><li><a href = "http://www.legacymissions.org">legacymissions.org</a></li></ul></div> wildsue — 2010-03-16T06:20:35-04:00 — #2 Hi, first you could try to give your document a document type declaration. And then close the script-tag without backslash. Because at the moment the IE 8 doesn't recognize your CSS. Susanne ryanreese — 2010-03-16T13:36:59-04:00 — #3 Hi, ignoring the fact you don't have a doctype on your page (which will slightly screw up your simple page as of right now) the problem is the quotation mark you have at the end of the background rule. It's making IE ignore the other rules body{ margin:0px auto; font-size: 18px; font-family: Helvetica, Verdana, Arial, Sans-Serif; background: #536e8d url('images/background.jpg') no-repeat top center;<font color='red'>"</font> color: #ffffff; }
Python httplib Performance Problems 25 March 2008 13:50 I've run into a tricky performance problem with my CouchDB client for Python. I recently started getting some reports about really bad performance of the client on Linux, where you apparently couldn't get more than about 25 requests per second in throughput (that number may sound familiar.) I develop on Mac OS X, and could not reproduce the problem. In fact, on OS X couchdb-python was often faster than the other methods. But when I went on to run the performance tests on this server (a Debian 4 install with Python 2.4.4, running on a Xen-powered Linode), I was seeing the very same problem. So I've been trying to figure out where the code is going wrong. And right now I'm just puzzled. I'd be grateful if anyone could point me in the right direction. The Basics For the HTTP communication with the CouchDB server, couchdb-python uses httplib2, which in turn uses the httplib module in the Python standard library. After being able to reproduce the problem, I stripped down the example code to use just httplib2, and then httplib directly. The basic pattern with httplib is the following: import httplib conn = httplib.HTTPConnection("127.0.0.1:5984") conn.request('GET', '/') resp = conn.get_response() conn.request('GET', '/') resp = conn.get_response() The HTTPConnection object is reused between requests. The first request goes through as expected. And then you would've expected the second request to run a bit faster, right? Because CouchDB doesn't close the connection, and uses chunked encoding so we know when the entity body has been completely consumed, we should be able to just send the next request over the same socket, enabling a faster response. Right? The Numbers Unfortunately though, the numbers on Linux don't exactly meet the expectation here. The following table compares the numbers between creating a new HTTPConnection object for every request, and reusing the same HTTPConnection object for all the requests: Separate connections Persistent connection 12.09ms 12.84ms 1.94ms 40.46ms 1.83ms 40.70ms 1.99ms 40.88ms 2.26ms 40.89ms 2.06ms 40.98ms No, I did not mix up the columns here: for persistent connections, subsequent requests take over 300% the time of the initial request. But when you recreate the HTTPConnection for every request, subsequent requests are actually significantly faster for some reason I do not comprehend. Profiling the example reveals that all the additional time is spent in the socket.readline() function. The Server So next I suspected CouchDB (or the underlying inets code) may be implementing/using chunked encoding incorrectly. Inspection of the code and the bytes on the ether didn't reveal any problems, but to completely rule out the server, I used the CherryPy “HelloWorld” application to test against. Here's the code: import cherrypy class HelloWorld(object): def index(self): return "Hello World!" index.exposed = True cherrypy.quickstart(HelloWorld()) Running the test code against the CherryPy server produces the exact same slowdown after the first request as before. I first tried with chunked encoding, but that doesn't actually seem to make a difference. I've so far been unable to reproduce the performance problem with persistent connections when testing against static files served by the Apache HTTPD 2.2 server. With CouchDB and CherryPy I am seeing the slowdown, but not with Apache. All three provide keepalive connections by default, and chunked encoding doesn't seem to make a difference. Lost I'm currently completely lost as to what the cause of the problem may be. Note that the tests perform pretty much as expected on OS X: using persistent connections speeds things up a bit (though not as much as I'd have expected.) Google searches didn't really turn up anything related; I did find an old Python bug report about httplib using unbuffered socket I/O. But monkey patching some buffering into httplib did not change the results I was seeing in any way. So, does anyone out there have an idea what the problem may be, or the skills needed to figure this out? Oh, and I've recently added bare bones comment functionality to my blog, so if you have any ideas, just post a comment here. Thanks! Reactions Dave says: 25 March 2008 22:20 This is weird, I set up my own much more simple benchmark and it behaved as expected (ie, faster for persistent connection). However, when I run your benchmark, I get the results you are seeing. I'm not sure how that's possible since mine was doing pretty much the exact same thing. Colin Percival says: 25 March 2008 22:27 I'd guess that you're running into the interaction of nagling and delayed ACKs. Run a tcpdump and look at the timestamps to see where things are getting held up. Dave says: 25 March 2008 22:47 And I'm a doof. The reason my original benchmark was so much faster is that I was only doing one request per command. Whatever the delay is, it occurs between requests whether or not you're making another immediate request. So every individual call to the database over the persistent connection was fast, but once they're stuck in a loop, I see the same delay as you. Sam says: 26 March 2008 05:09 Note that the Linux delayed ack timer is set to 40ms by default, and this also happens to be the time your persistent requests are taking. I suggest you follow Colin's advice and use tcpdump (or WireShark) to take a look at the packets and see which one is being delayed. Then read up on the Nagle algorithm if you don't already know about it, and see if a combination of that and delayed acks are at fault, and if so, which end of the connection is creating the problem. Or just don't use persistent connections. Dave says: 26 March 2008 05:56 I decided to whip up a benchmark without httplib, and unfortunately got the exact same results. This means httplib isn't the culprit after all. I also tried disabling nagle and delayed ack, but there was no significant difference. My quickly and poorly coded benchmark can be found here. Dave says: 26 March 2008 14:24 Found a fix on the couchdb end. Not sure if this is the proper way to do it, but it is the delayed ack problem. In the couch inets directory of the couchdb source, edit httptransport.erl. On lines 124 and 128, add {nodelay, true} to the line of options so that they read: sock_opt(ip_comm, Addr, [{backlog, 128}, {reuseaddr,true}, {fd,Fd}, {nodelay, true}])}; and sock_opt(ip_comm, Addr, [{backlog, 128}, {reuseaddr, true}, {nodelay, true}])} Running the benchmarks on this version produces pretty much identical results in both shared and reused connections on my local machine, but only opens one socket instead of 1 for each request. Evan Jones says: 26 March 2008 14:28 This issue is on the server side. The problem is the Nagle algorithm, which delays sending partial packets in order to wait for more data. This is efficient if the application generates lots of small writes, as it will combine them into a single TCP packet. This is bad if the application (in this case, CherryPy or CouchDB) does one small write: Linux waits up to 40 ms before sending it out. The solution: Enable TCP_NODELAY on the server. Adding this hack to the top of your CherryPy "hello world" app fixes the times: realsocket = socket.socket def socketwrap(family=socket.AF_INET, type=socket.SOCK_STREAM, proto=0): sockobj = realsocket(family, type, proto) sockobj.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1) return sockobj socket.socket = socketwrap The real fix is that CherryPy, CouchDB, and your client should probably all enable this option. This is what Apache does, and why you don't see a problem with it. See the "Nagle Interaction" section in the following page for more information: http://www.w3.org/Protocols/HTTP/Performance/Pipeline.html This document explains in more detail: http://www.isi.edu/lsam/publications/phttp tcpinteractions/node2.html#SECTION00023000000000000000 I suggest you pass this reference and this bug report on to the CouchDB developers, in order to get the problem resolved. Evan Jones Christopher Lenz says: 26 March 2008 15:35 Dave, Evan, thanks a lot for your comments! We'll see what we can do to fix this on the CouchDB side.
So I have a mysql table and I am trying to take each element from one of the fields of the table. The field and table are both called "keywords". In the field there are many different random words and I am trying to take all of those and save them to a text file. Any help on how to implement this would be great, here is what I have so far. #!/usr/bin/env python import MySQLdb db = MySQLdb.connect(host="", user="", passwd="", db="") cursor = db.cursor() sql = """SELECT DISTINCT keywords FROM keywords""" cursor.execute(sql) cursor.fetchall() db.close() for s in sql: tweets = open("keywords.txt", "w") What I was thinking is to turn what sql fetches into a list if possible and write that to the file. But I am open to any suggestions, thanks.
Judepaum [Résolu] Twinview changement résolution impossible Bonjour et bonne année ! Je viens de faire une installation fraîche de 12.10 et j'ai pas mal de soucis pour retrouver la configuration de TwinView que j'avais sur 12.04 ... Donc, dans les faits, dans nvidia-settings je ne peux choisir que Off ou Auto pour la résolution et cette dernière est bloquée sur 800x600 alors que je souhaite du 1024x768 ... Mais le plus troublant c'est que si je supprime /etc/X11/xorg.conf, que je redémarre, que je recrée xorg.conf avec nvidia-xconfig je peux choisir la résolution que je veux pour mon deuxième écran dans nvidia-settings ! Malheureusement, après un redémarrage mon deuxième écran revient en 800x600 alors que j'avais bien sauvegarder mon xorg.conf ... Dans le doute, j'ai essayé nvidia-current, nvidia-current-updates et nvidia-experimental-310 mais j'ai toujours le même résultat ... Voici mon xorg.conf : # nvidia-settings: X configuration file generated by nvidia-settings # nvidia-settings: version 304.51 (buildd@batsu) Fri Oct 12 12:53:54 UTC 2012 # nvidia-xconfig: X configuration file generated by nvidia-xconfig # nvidia-xconfig: version 310.14 ([email protected]) Tue Oct 9 13:04:01 PDT 2012 Section "ServerLayout" Identifier "Layout0" Screen 0 "Screen0" 0 0 InputDevice "Keyboard0" "CoreKeyboard" InputDevice "Mouse0" "CorePointer" Option "Xinerama" "0" EndSection Section "Files" EndSection Section "InputDevice" # generated from default Identifier "Mouse0" Driver "mouse" Option "Protocol" "auto" Option "Device" "/dev/psaux" Option "Emulate3Buttons" "no" Option "ZAxisMapping" "4 5" EndSection Section "InputDevice" # generated from default Identifier "Keyboard0" Driver "kbd" EndSection Section "Monitor" Identifier "Monitor0" VendorName "Unknown" ModelName "HannStar Display Corp HSD160PHW1" HorizSync 30.0 - 75.0 VertRefresh 59.0 Option "DPMS" EndSection Section "Device" Identifier "Device0" Driver "nvidia" VendorName "NVIDIA Corporation" BoardName "GeForce GTX 260M" EndSection Section "Screen" Identifier "Screen0" Device "Device0" Monitor "Monitor0" DefaultDepth 24 Option "Stereo" "0" Option "nvidiaXineramaInfoOrder" "DFP-0" Option "metamodes" "DFP: nvidia-auto-select +0+0, CRT: nvidia-auto-select +1366+0" SubSection "Display" Depth 24 EndSubSection EndSection Merci d'avance Dernière modification par Judepaum (Le 14/01/2013, à 11:34) Hors ligne Maisondouf Re : [Résolu] Twinview changement résolution impossible Forcément si tu laisses le choix au driver avec "nvidia-auto-select", il va pas forcer, le gars .... Remplaces ta ligne "metamodes" avec une comme ça où tu mets tes résolutions d'écran: Option "metamodes" "DFP: 1366x768+0+0, CRT: 1024x768+1366+0" Surtout, mets bien le bon décalage sur le deuxième écran. ASUS M5A88-v EVO avec AMD FX(tm)-8120 Eight-Core Processor, OS principal Precise 12.04.1 LTS 63bits½ Bricoleur, menteur, inculte, inadapté social et mythomane, enfin d'après certains.... "the secret of my form is summed up in two words, no sport" (Winston Churchill) Hors ligne Judepaum Re : [Résolu] Twinview changement résolution impossible J'avais déjà essayé de modifier cette ligne manuellement pour forcer la résolution et ça ne marche pas ... Dans le doute j'ai retenté avec la tienne et ça ne fonctionne pas mieux .... D'ailleurs quand je mets cette ligne manuellement, mon deuxième écran n'est pas détecté sur la page de login alors que c'était le cas avant et que c'est le cas aussi avec nvidia-auto-select. Hors ligne Judepaum Re : [Résolu] Twinview changement résolution impossible Up Hors ligne Angelsword Re : [Résolu] Twinview changement résolution impossible La sauvegarde à chaque redémarrage est aussi un problème pour moi, mais moi c'est pour le rafraîchissement, donc je surveille ce topic au cas ou ... Hors ligne classdroogies Re : [Résolu] Twinview changement résolution impossible Salut, Supprime ton xorg.conf et essai de faire ta config avec xrandr. Poste le contenu de /var/log/Xorg.0.log Hors ligne Angelsword Re : [Résolu] Twinview changement résolution impossible Salut et merci pour ta réponse. Je ne sais pas ce qu'il s'est passé, mais ce matin les paramètres étaient sauvegardé comme je l'ai souhaité o_0 Et depuis tout va bien, j'ai gardé le Xorg.conf, après j'ai fait tellement de manipulations que je ne saurais dire ce qui a validé tout ça. Je me souviens avoir utilisé la commande : gksu nvidia-settings Mais je me souviens qu'au redémarrage ça n'avait pas fonctionné. Mon Xorg.conf : # nvidia-settings: X configuration file generated by nvidia-settings # nvidia-settings: version 304.51 (buildd@aatxe) Fri Oct 12 12:54:02 UTC 2012 Section "ServerLayout" Identifier "Layout0" Screen 0 "Screen0" 0 0 InputDevice "Keyboard0" "CoreKeyboard" InputDevice "Mouse0" "CorePointer" Option "Xinerama" "0" EndSection Section "Files" EndSection Section "InputDevice" # generated from default Identifier "Mouse0" Driver "mouse" Option "Protocol" "auto" Option "Device" "/dev/psaux" Option "Emulate3Buttons" "no" Option "ZAxisMapping" "4 5" EndSection Section "InputDevice" # generated from default Identifier "Keyboard0" Driver "kbd" EndSection Section "InputClass" Identifier "Mouse Remap" MatchDevicePath "/dev/input/event*" Option "ButtonMapping" "1 2 3 4 5 6 7 8 9 10 11 12 0 0 0 16 17 18 19 20 21" EndSection Section "Monitor" # HorizSync source: edid, VertRefresh source: edid Identifier "Monitor0" VendorName "Unknown" ModelName "BenQ XL2420T" HorizSync 30.0 - 140.0 VertRefresh 56.0 - 120.0 Option "DPMS" EndSection Section "Device" Identifier "Device0" Driver "nvidia" VendorName "NVIDIA Corporation" BoardName "GeForce GTX 275" EndSection Section "Screen" # Removed Option "metamodes" "DFP-1: 1920x1080_120 +0+0, DFP-0: 1920x1080_60 +1920+0; DFP-0: nvidia-auto-select +0+0; DFP-0: 1920x1080 +0+0; DFP-0: 1920x1080_60 +0+0; DFP-0: 1920x1080_60_0 +0+0; DFP-0: 1680x1050 +0+0; DFP-0: 1680x1050_60 +0+0; DFP-0: 1280x1024 +0+0; DFP-0: 1280x1024_75 +0+0; DFP-0: 1280x1024_60 +0+0; DFP-0: 1280x960 +0+0; DFP-0: 1280x960_60 +0+0; DFP-0: 1152x864 +0+0; DFP-0: 1152x864_75 +0+0; DFP-0: 1024x768 +0+0; DFP-0: 1024x768_75 +0+0; DFP-0: 1024x768_60 +0+0; DFP-0: 800x600 +0+0; DFP-0: 800x600_75 +0+0; DFP-0: 800x600_60 +0+0; DFP-0: 800x600_56 +0+0; DFP-0: 640x480 +0+0; DFP-0: 640x480_75 +0+0; DFP-0: 640x480_60 +0+0; DFP-0: nvidia-auto-select +0+0" # Removed Option "metamodes" "DFP-1: 1920x1080_120 +0+0, DFP-0: 1920x1080_60 +1920+0; DFP-0: nvidia-auto-select +0+0; DFP-0: nvidia-auto-select +0+0; DFP-0: 1920x1080 +0+0; DFP-0: 1920x1080 +0+0; DFP-0: 1920x1080_60 +0+0; DFP-0: 1920x1080_60 +0+0; DFP-0: 1920x1080_60_0 +0+0; DFP-0: 1920x1080_60_0 +0+0; DFP-0: 1680x1050 +0+0; DFP-0: 1680x1050 +0+0; DFP-0: 1680x1050_60 +0+0; DFP-0: 1680x1050_60 +0+0; DFP-0: 1280x1024 +0+0; DFP-0: 1280x1024 +0+0; DFP-0: 1280x1024_75 +0+0; DFP-0: 1280x1024_75 +0+0; DFP-0: 1280x1024_60 +0+0; DFP-0: 1280x1024_60 +0+0; DFP-0: 1280x960 +0+0; DFP-0: 1280x960 +0+0; DFP-0: 1280x960_60 +0+0; DFP-0: 1280x960_60 +0+0; DFP-0: 1152x864 +0+0; DFP-0: 1152x864 +0+0; DFP-0: 1152x864_75 +0+0; DFP-0: 1152x864_75 +0+0; DFP-0: 1024x768 +0+0; DFP-0: 1024x768 +0+0; DFP-0: 1024x768_75 +0+0; DFP-0: 1024x768_75 +0+0; DFP-0: 1024x768_60 +0+0; DFP-0: 1024x768_60 +0+0; DFP-0: 800x600 +0+0; DFP-0: 800x600 +0+0; DFP-0: 800x600_75 +0+0; DFP-0: 800x600_75 +0+0; DFP-0: 800x600_60 +0+0; DFP-0: 800x600_60 +0+0; DFP-0: 800x600_56 +0+0; DFP-0: 800x600_56 +0+0; DFP-0: 640x480 +0+0; DFP-0: 640x480 +0+0; DFP-0: 640x480_75 +0+0; DFP-0: 640x480_75 +0+0; DFP-0: 640x480_60 +0+0; DFP-0: 640x480_60 +0+0; DFP-0: nvidia-auto-select +0+0; DFP-0: nvidia-auto-select +0+0" Identifier "Screen0" Device "Device0" Monitor "Monitor0" DefaultDepth 24 Option "Stereo" "0" Option "nvidiaXineramaInfoOrder" "DFP-1" Option "metamodes" "DFP-1: 1920x1080_120 +0+0, DFP-0: 1920x1080_60 +1920+0; DFP-0: nvidia-auto-select +0+0; DFP-0: nvidia-auto-select +0+0; DFP-0: 1920x1080 +0+0; DFP-0: 1920x1080 +0+0; DFP-0: 1920x1080_60 +0+0; DFP-0: 1920x1080_60 +0+0; DFP-0: 1920x1080_60_0 +0+0; DFP-0: 1920x1080_60_0 +0+0; DFP-0: 1680x1050 +0+0; DFP-0: 1680x1050 +0+0; DFP-0: 1680x1050_60 +0+0; DFP-0: 1680x1050_60 +0+0; DFP-0: 1280x1024 +0+0; DFP-0: 1280x1024 +0+0; DFP-0: 1280x1024_75 +0+0; DFP-0: 1280x1024_75 +0+0; DFP-0: 1280x1024_60 +0+0; DFP-0: 1280x1024_60 +0+0; DFP-0: 1280x960 +0+0; DFP-0: 1280x960 +0+0; DFP-0: 1280x960_60 +0+0; DFP-0: 1280x960_60 +0+0; DFP-0: 1152x864 +0+0; DFP-0: 1152x864 +0+0; DFP-0: 1152x864_75 +0+0; DFP-0: 1152x864_75 +0+0; DFP-0: 1024x768 +0+0; DFP-0: 1024x768 +0+0; DFP-0: 1024x768_75 +0+0; DFP-0: 1024x768_75 +0+0; DFP-0: 1024x768_60 +0+0; DFP-0: 1024x768_60 +0+0; DFP-0: 800x600 +0+0; DFP-0: 800x600 +0+0" SubSection "Display" Depth 24 EndSubSection EndSection Hors ligne Judepaum Re : [Résolu] Twinview changement résolution impossible Merci beaucoup classdroogies ! Ca fonctionne au poil avec xrandr et sans xorg.conf ! Tu as une idée du pourquoi du comment ? Mon Xorg.0.log si ça peut aider à trouver pourquoi je ne peux pas directement faire ça avec nvidia-settings : [ 95.762] X.Org X Server 1.13.0 Release Date: 2012-09-05 [ 95.762] X Protocol Version 11, Revision 0 [ 95.762] Build Operating System: Linux 3.2.0-32-generic x86_64 Ubuntu [ 95.762] Current Operating System: Linux ju-G60J 3.5.0-21-generic #32-Ubuntu SMP Tue Dec 11 18:51:59 UTC 2012 x86_64 [ 95.762] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-3.5.0-21-generic root=UUID=b27dfa5d-f893-4a8c-90cd-db237f878bb1 ro quiet splash [ 95.762] Build Date: 27 November 2012 07:44:35AM [ 95.762] xorg-server 2:1.13.0-0ubuntu6.1 (For technical support please see http://www.ubuntu.com/support) [ 95.762] Current version of pixman: 0.26.0 [ 95.762] Before reporting problems, check http://wiki.x.org to make sure that you have the latest version. [ 95.762] Markers: (--) probed, (**) from config file, (==) default setting, (++) from command line, (!!) notice, (II) informational, (WW) warning, (EE) error, (NI) not implemented, (??) unknown. [ 95.762] (==) Log file: "/var/log/Xorg.0.log", Time: Mon Jan 14 10:29:01 2013 [ 95.763] (==) Using system config directory "/usr/share/X11/xorg.conf.d" [ 95.763] (==) No Layout section. Using the first Screen section. [ 95.763] (==) No screen section available. Using defaults. [ 95.763] (**) |-->Screen "Default Screen Section" (0) [ 95.763] (**) | |-->Monitor "<default monitor>" [ 95.763] (==) No monitor specified for screen "Default Screen Section". Using a default monitor configuration. [ 95.764] (==) Automatically adding devices [ 95.764] (==) Automatically enabling devices [ 95.764] (==) Automatically adding GPU devices [ 95.764] (WW) The directory "/usr/share/fonts/X11/cyrillic" does not exist. [ 95.764] Entry deleted from font path. [ 95.764] (WW) The directory "/usr/share/fonts/X11/100dpi/" does not exist. [ 95.764] Entry deleted from font path. [ 95.764] (WW) The directory "/usr/share/fonts/X11/75dpi/" does not exist. [ 95.764] Entry deleted from font path. [ 95.764] (WW) The directory "/usr/share/fonts/X11/100dpi" does not exist. [ 95.764] Entry deleted from font path. [ 95.764] (WW) The directory "/usr/share/fonts/X11/75dpi" does not exist. [ 95.764] Entry deleted from font path. [ 95.764] (WW) The directory "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType" does not exist. [ 95.764] Entry deleted from font path. [ 95.764] (==) FontPath set to: /usr/share/fonts/X11/misc, /usr/share/fonts/X11/Type1, built-ins [ 95.764] (==) ModulePath set to "/usr/lib/x86_64-linux-gnu/xorg/extra-modules,/usr/lib/xorg/extra-modules,/usr/lib/xorg/modules" [ 95.764] (II) The server relies on udev to provide the list of input devices. If no devices become available, reconfigure udev or disable AutoAddDevices. [ 95.764] (II) Loader magic: 0x7fc5b3286c40 [ 95.764] (II) Module ABI versions: [ 95.764] X.Org ANSI C Emulation: 0.4 [ 95.764] X.Org Video Driver: 13.0 [ 95.764] X.Org XInput driver : 18.0 [ 95.764] X.Org Server Extension : 7.0 [ 95.767] (--) PCI:*(0:1:0:0) 10de:0618:1043:2033 rev 162, Mem @ 0xf2000000/16777216, 0xe0000000/268435456, 0xf0000000/33554432, I/O @ 0x0000d000/128, BIOS @ 0x????????/131072 [ 95.767] (II) Open ACPI successful (/var/run/acpid.socket) [ 95.767] Initializing built-in extension Generic Event Extension [ 95.767] Initializing built-in extension SHAPE [ 95.767] Initializing built-in extension MIT-SHM [ 95.767] Initializing built-in extension XInputExtension [ 95.767] Initializing built-in extension XTEST [ 95.767] Initializing built-in extension BIG-REQUESTS [ 95.767] Initializing built-in extension SYNC [ 95.767] Initializing built-in extension XKEYBOARD [ 95.767] Initializing built-in extension XC-MISC [ 95.767] Initializing built-in extension SECURITY [ 95.767] Initializing built-in extension XINERAMA [ 95.768] Initializing built-in extension XFIXES [ 95.768] Initializing built-in extension RENDER [ 95.768] Initializing built-in extension RANDR [ 95.768] Initializing built-in extension COMPOSITE [ 95.768] Initializing built-in extension DAMAGE [ 95.768] Initializing built-in extension MIT-SCREEN-SAVER [ 95.768] Initializing built-in extension DOUBLE-BUFFER [ 95.768] Initializing built-in extension RECORD [ 95.768] Initializing built-in extension DPMS [ 95.768] Initializing built-in extension X-Resource [ 95.768] Initializing built-in extension XVideo [ 95.768] Initializing built-in extension XVideo-MotionCompensation [ 95.768] Initializing built-in extension XFree86-VidModeExtension [ 95.768] Initializing built-in extension XFree86-DGA [ 95.768] Initializing built-in extension XFree86-DRI [ 95.768] Initializing built-in extension DRI2 [ 95.768] (II) LoadModule: "glx" [ 95.768] (II) Loading /usr/lib/x86_64-linux-gnu/xorg/extra-modules/libglx.so [ 95.783] (II) Module glx: vendor="NVIDIA Corporation" [ 95.783] compiled for 4.0.2, module version = 1.0.0 [ 95.783] Module class: X.Org Server Extension [ 95.783] (II) NVIDIA GLX Module 310.14 Tue Oct 9 12:14:30 PDT 2012 [ 95.783] Loading extension GLX [ 95.783] (==) Matched nvidia as autoconfigured driver 0 [ 95.783] (==) Matched nouveau as autoconfigured driver 1 [ 95.783] (==) Matched nv as autoconfigured driver 2 [ 95.783] (==) Matched vesa as autoconfigured driver 3 [ 95.783] (==) Matched modesetting as autoconfigured driver 4 [ 95.783] (==) Matched fbdev as autoconfigured driver 5 [ 95.783] (==) Assigned the driver to the xf86ConfigLayout [ 95.783] (II) LoadModule: "nvidia" [ 95.783] (II) Loading /usr/lib/x86_64-linux-gnu/xorg/extra-modules/nvidia_drv.so [ 95.783] (II) Module nvidia: vendor="NVIDIA Corporation" [ 95.783] compiled for 4.0.2, module version = 1.0.0 [ 95.783] Module class: X.Org Video Driver [ 95.783] (II) LoadModule: "nouveau" [ 95.783] (II) Loading /usr/lib/xorg/modules/drivers/nouveau_drv.so [ 95.784] (II) Module nouveau: vendor="X.Org Foundation" [ 95.784] compiled for 1.13.0, module version = 1.0.2 [ 95.784] Module class: X.Org Video Driver [ 95.784] ABI class: X.Org Video Driver, version 13.0 [ 95.784] (II) LoadModule: "nv" [ 95.784] (WW) Warning, couldn't open module nv [ 95.784] (II) UnloadModule: "nv" [ 95.784] (II) Unloading nv [ 95.784] (EE) Failed to load module "nv" (module does not exist, 0) [ 95.784] (II) LoadModule: "vesa" [ 95.784] (II) Loading /usr/lib/xorg/modules/drivers/vesa_drv.so [ 95.784] (II) Module vesa: vendor="X.Org Foundation" [ 95.784] compiled for 1.12.99.902, module version = 2.3.2 [ 95.784] Module class: X.Org Video Driver [ 95.784] ABI class: X.Org Video Driver, version 13.0 [ 95.784] (II) LoadModule: "modesetting" [ 95.784] (II) Loading /usr/lib/xorg/modules/drivers/modesetting_drv.so [ 95.784] (II) Module modesetting: vendor="X.Org Foundation" [ 95.784] compiled for 1.13.0, module version = 0.5.0 [ 95.784] Module class: X.Org Video Driver [ 95.784] ABI class: X.Org Video Driver, version 13.0 [ 95.784] (II) LoadModule: "fbdev" [ 95.785] (II) Loading /usr/lib/xorg/modules/drivers/fbdev_drv.so [ 95.785] (II) Module fbdev: vendor="X.Org Foundation" [ 95.785] compiled for 1.12.99.902, module version = 0.4.3 [ 95.785] Module class: X.Org Video Driver [ 95.785] ABI class: X.Org Video Driver, version 13.0 [ 95.785] (==) Matched nvidia as autoconfigured driver 0 [ 95.785] (==) Matched nouveau as autoconfigured driver 1 [ 95.785] (==) Matched nv as autoconfigured driver 2 [ 95.785] (==) Matched vesa as autoconfigured driver 3 [ 95.785] (==) Matched modesetting as autoconfigured driver 4 [ 95.785] (==) Matched fbdev as autoconfigured driver 5 [ 95.785] (==) Assigned the driver to the xf86ConfigLayout [ 95.785] (II) LoadModule: "nvidia" [ 95.785] (II) Loading /usr/lib/x86_64-linux-gnu/xorg/extra-modules/nvidia_drv.so [ 95.785] (II) Module nvidia: vendor="NVIDIA Corporation" [ 95.785] compiled for 4.0.2, module version = 1.0.0 [ 95.785] Module class: X.Org Video Driver [ 95.785] (II) UnloadModule: "nvidia" [ 95.785] (II) Unloading nvidia [ 95.785] (II) Failed to load module "nvidia" (already loaded, 32709) [ 95.785] (II) LoadModule: "nouveau" [ 95.785] (II) Loading /usr/lib/xorg/modules/drivers/nouveau_drv.so [ 95.785] (II) Module nouveau: vendor="X.Org Foundation" [ 95.785] compiled for 1.13.0, module version = 1.0.2 [ 95.785] Module class: X.Org Video Driver [ 95.785] ABI class: X.Org Video Driver, version 13.0 [ 95.785] (II) UnloadModule: "nouveau" [ 95.785] (II) Unloading nouveau [ 95.785] (II) Failed to load module "nouveau" (already loaded, 32709) [ 95.785] (II) LoadModule: "nv" [ 95.785] (WW) Warning, couldn't open module nv [ 95.785] (II) UnloadModule: "nv" [ 95.785] (II) Unloading nv [ 95.785] (EE) Failed to load module "nv" (module does not exist, 0) [ 95.785] (II) LoadModule: "vesa" [ 95.785] (II) Loading /usr/lib/xorg/modules/drivers/vesa_drv.so [ 95.785] (II) Module vesa: vendor="X.Org Foundation" [ 95.785] compiled for 1.12.99.902, module version = 2.3.2 [ 95.785] Module class: X.Org Video Driver [ 95.785] ABI class: X.Org Video Driver, version 13.0 [ 95.785] (II) UnloadModule: "vesa" [ 95.785] (II) Unloading vesa [ 95.785] (II) Failed to load module "vesa" (already loaded, 0) [ 95.785] (II) LoadModule: "modesetting" [ 95.786] (II) Loading /usr/lib/xorg/modules/drivers/modesetting_drv.so [ 95.786] (II) Module modesetting: vendor="X.Org Foundation" [ 95.786] compiled for 1.13.0, module version = 0.5.0 [ 95.786] Module class: X.Org Video Driver [ 95.786] ABI class: X.Org Video Driver, version 13.0 [ 95.786] (II) UnloadModule: "modesetting" [ 95.786] (II) Unloading modesetting [ 95.786] (II) Failed to load module "modesetting" (already loaded, 0) [ 95.786] (II) LoadModule: "fbdev" [ 95.786] (II) Loading /usr/lib/xorg/modules/drivers/fbdev_drv.so [ 95.786] (II) Module fbdev: vendor="X.Org Foundation" [ 95.786] compiled for 1.12.99.902, module version = 0.4.3 [ 95.786] Module class: X.Org Video Driver [ 95.786] ABI class: X.Org Video Driver, version 13.0 [ 95.786] (II) UnloadModule: "fbdev" [ 95.786] (II) Unloading fbdev [ 95.786] (II) Failed to load module "fbdev" (already loaded, 0) [ 95.786] (II) NVIDIA dlloader X Driver 310.14 Tue Oct 9 11:54:19 PDT 2012 [ 95.786] (II) NVIDIA Unified Driver for all Supported NVIDIA GPUs [ 95.786] (II) NOUVEAU driver Date: Wed Sep 12 13:42:43 2012 +0200 [ 95.786] (II) NOUVEAU driver for NVIDIA chipset families : [ 95.786] RIVA TNT (NV04) [ 95.786] RIVA TNT2 (NV05) [ 95.786] GeForce 256 (NV10) [ 95.786] GeForce 2 (NV11, NV15) [ 95.786] GeForce 4MX (NV17, NV18) [ 95.786] GeForce 3 (NV20) [ 95.786] GeForce 4Ti (NV25, NV28) [ 95.786] GeForce FX (NV3x) [ 95.786] GeForce 6 (NV4x) [ 95.786] GeForce 7 (G7x) [ 95.786] GeForce 8 (G8x) [ 95.786] GeForce GTX 200 (NVA0) [ 95.786] GeForce GTX 400 (NVC0) [ 95.786] (II) VESA: driver for VESA chipsets: vesa [ 95.786] (II) modesetting: Driver for Modesetting Kernel Drivers: kms [ 95.786] (II) FBDEV: driver for framebuffer: fbdev [ 95.786] (++) using VT number 7 [ 95.787] (II) Loading sub module "wfb" [ 95.787] (II) LoadModule: "wfb" [ 95.787] (II) Loading /usr/lib/xorg/modules/libwfb.so [ 95.788] (II) Module wfb: vendor="X.Org Foundation" [ 95.788] compiled for 1.13.0, module version = 1.0.0 [ 95.788] ABI class: X.Org ANSI C Emulation, version 0.4 [ 95.788] (II) Loading sub module "ramdac" [ 95.788] (II) LoadModule: "ramdac" [ 95.788] (II) Module "ramdac" already built-in [ 95.788] (WW) Falling back to old probe method for vesa [ 95.788] (WW) Falling back to old probe method for modesetting [ 95.788] (EE) open /dev/dri/card0: No such file or directory [ 95.788] (EE) open /dev/dri/card0: No such file or directory [ 95.788] (WW) Falling back to old probe method for fbdev [ 95.788] (II) Loading sub module "fbdevhw" [ 95.788] (II) LoadModule: "fbdevhw" [ 95.788] (II) Loading /usr/lib/xorg/modules/libfbdevhw.so [ 95.788] (II) Module fbdevhw: vendor="X.Org Foundation" [ 95.788] compiled for 1.13.0, module version = 0.0.2 [ 95.788] ABI class: X.Org Video Driver, version 13.0 [ 95.788] (EE) open /dev/fb0: No such file or directory [ 95.788] (II) NVIDIA(0): Creating default Display subsection in Screen section "Default Screen Section" for depth/fbbpp 24/32 [ 95.788] (==) NVIDIA(0): Depth 24, (==) framebuffer bpp 32 [ 95.788] (==) NVIDIA(0): RGB weight 888 [ 95.788] (==) NVIDIA(0): Default visual is TrueColor [ 95.788] (==) NVIDIA(0): Using gamma correction (1.0, 1.0, 1.0) [ 95.788] (**) NVIDIA(0): Enabling 2D acceleration [ 96.555] (WW) NVIDIA(GPU-0): The EDID read for display device CRT-0 is invalid: [ 96.555] (WW) NVIDIA(GPU-0): unrecognized EDID Header. [ 96.555] (--) NVIDIA(GPU-0): [ 96.555] (--) NVIDIA(GPU-0): Raw EDID bytes: [ 96.555] (--) NVIDIA(GPU-0): [ 96.555] (--) NVIDIA(GPU-0): fd df fe fe fe fe fe fd 26 cd 50 46 00 00 00 00 [ 96.555] (--) NVIDIA(GPU-0): 28 0c 01 03 0e 22 1b 78 eb a6 9c a1 5a 4b 98 24 [ 96.555] (--) NVIDIA(GPU-0): 16 4c 57 bf ef 00 81 80 81 8f 71 40 71 4f 01 01 [ 96.555] (--) NVIDIA(GPU-0): 01 01 01 01 01 01 30 2a 00 98 51 00 2a 40 30 70 [ 96.555] (--) NVIDIA(GPU-0): 13 00 52 0e 11 00 00 1e 00 00 00 fd 00 32 4b 18 [ 96.555] (--) NVIDIA(GPU-0): 50 0e 00 0a 20 20 20 20 20 20 00 00 00 ff 00 30 [ 96.555] (--) NVIDIA(GPU-0): 0a 20 20 20 20 20 20 20 20 20 20 20 00 00 00 fc [ 96.555] (--) NVIDIA(GPU-0): 00 41 53 34 33 31 35 20 20 20 20 20 20 20 00 e3 [ 96.555] (--) NVIDIA(GPU-0): [ 96.555] (--) NVIDIA(GPU-0): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 96.555] (--) NVIDIA(GPU-0): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 96.555] (--) NVIDIA(GPU-0): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 96.555] (--) NVIDIA(GPU-0): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 96.555] (--) NVIDIA(GPU-0): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 96.556] (--) NVIDIA(GPU-0): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 96.556] (--) NVIDIA(GPU-0): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 96.556] (--) NVIDIA(GPU-0): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 96.556] (--) NVIDIA(GPU-0): [ 96.556] (II) NVIDIA(GPU-0): Display (HannStar Display Corp HSD160PHW1 (DFP-0)) does not [ 96.556] (II) NVIDIA(GPU-0): support NVIDIA 3D Vision stereo. [ 96.557] (II) NVIDIA(0): NVIDIA GPU GeForce GTX 260M (G92) at PCI:1:0:0 (GPU-0) [ 96.557] (--) NVIDIA(0): Memory: 1048576 kBytes [ 96.557] (--) NVIDIA(0): VideoBIOS: 62.92.a2.00.08 [ 96.557] (II) NVIDIA(0): Detected PCI Express Link width: 16X [ 96.565] (--) NVIDIA(0): Valid display device(s) on GeForce GTX 260M at PCI:1:0:0 [ 96.565] (--) NVIDIA(0): CRT-0 (connected) [ 96.565] (--) NVIDIA(0): HannStar Display Corp HSD160PHW1 (DFP-0) (connected) [ 96.565] (--) NVIDIA(0): DFP-1 [ 96.565] (--) NVIDIA(0): CRT-0: 400.0 MHz maximum pixel clock [ 96.565] (--) NVIDIA(0): HannStar Display Corp HSD160PHW1 (DFP-0): 330.0 MHz maximum pixel clock [ 96.565] (--) NVIDIA(0): HannStar Display Corp HSD160PHW1 (DFP-0): Internal Dual Link LVDS [ 96.565] (--) NVIDIA(0): DFP-1: 165.0 MHz maximum pixel clock [ 96.565] (--) NVIDIA(0): DFP-1: Internal Single Link TMDS [ 96.565] (**) NVIDIA(0): Using HorizSync/VertRefresh ranges from the EDID for display [ 96.565] (**) NVIDIA(0): device CRT-0 (Using EDID frequencies has been enabled on [ 96.565] (**) NVIDIA(0): all display devices.) [ 96.570] (**) NVIDIA(0): Using HorizSync/VertRefresh ranges from the EDID for display [ 96.570] (**) NVIDIA(0): device HannStar Display Corp HSD160PHW1 (DFP-0) (Using [ 96.570] (**) NVIDIA(0): EDID frequencies has been enabled on all display [ 96.570] (**) NVIDIA(0): devices.) [ 96.570] (==) NVIDIA(0): [ 96.570] (==) NVIDIA(0): No modes were requested; the default mode "nvidia-auto-select" [ 96.570] (==) NVIDIA(0): will be used as the requested mode. [ 96.570] (==) NVIDIA(0): [ 96.571] (II) NVIDIA(0): Validated MetaModes: [ 96.571] (II) NVIDIA(0): "DFP-0:nvidia-auto-select,CRT-0:nvidia-auto-select" [ 96.571] (II) NVIDIA(0): Virtual screen size determined to be 2390 x 768 [ 97.639] (--) NVIDIA(0): DPI set to (99, 97); computed from "UseEdidDpi" X config [ 97.639] (--) NVIDIA(0): option [ 97.639] (II) UnloadModule: "nouveau" [ 97.639] (II) Unloading nouveau [ 97.639] (II) UnloadModule: "vesa" [ 97.639] (II) Unloading vesa [ 97.639] (II) UnloadModule: "modesetting" [ 97.639] (II) Unloading modesetting [ 97.639] (II) UnloadModule: "fbdev" [ 97.639] (II) Unloading fbdev [ 97.639] (II) UnloadSubModule: "fbdevhw" [ 97.639] (II) Unloading fbdevhw [ 97.639] (--) Depth 24 pixmap format is 32 bpp [ 97.640] (II) NVIDIA: Using 768.00 MB of virtual memory for indirect memory access. [ 97.652] (II) NVIDIA(0): Setting mode "DFP-0:nvidia-auto-select,CRT-0:nvidia-auto-select" [ 97.957] Loading extension NV-GLX [ 97.999] (==) NVIDIA(0): Disabling shared memory pixmaps [ 97.999] (==) NVIDIA(0): Backing store disabled [ 97.999] (==) NVIDIA(0): Silken mouse enabled [ 97.999] (==) NVIDIA(0): DPMS enabled [ 97.999] Loading extension NV-CONTROL [ 97.999] Loading extension XINERAMA [ 97.999] (II) Loading sub module "dri2" [ 97.999] (II) LoadModule: "dri2" [ 97.999] (II) Module "dri2" already built-in [ 97.999] (II) NVIDIA(0): [DRI2] Setup complete [ 97.999] (II) NVIDIA(0): [DRI2] VDPAU driver: nvidia [ 97.999] (--) RandR disabled [ 98.004] (II) Initializing extension GLX [ 98.016] (II) XKB: reuse xkmfile /var/lib/xkb/server-B20D7FC79C7F597315E3E501AEF10E0D866E8E92.xkm [ 98.018] (II) config/udev: Adding input device Power Button (/dev/input/event2) [ 98.018] (**) Power Button: Applying InputClass "evdev keyboard catchall" [ 98.018] (II) LoadModule: "evdev" [ 98.018] (II) Loading /usr/lib/xorg/modules/input/evdev_drv.so [ 98.018] (II) Module evdev: vendor="X.Org Foundation" [ 98.018] compiled for 1.13.0, module version = 2.7.3 [ 98.018] Module class: X.Org XInput Driver [ 98.018] ABI class: X.Org XInput driver, version 18.0 [ 98.018] (II) Using input driver 'evdev' for 'Power Button' [ 98.018] (**) Power Button: always reports core events [ 98.018] (**) evdev: Power Button: Device: "/dev/input/event2" [ 98.018] (--) evdev: Power Button: Vendor 0 Product 0x1 [ 98.018] (--) evdev: Power Button: Found keys [ 98.018] (II) evdev: Power Button: Configuring as keyboard [ 98.018] (**) Option "config_info" "udev:/sys/devices/LNXSYSTM:00/LNXPWRBN:00/input/input2/event2" [ 98.018] (II) XINPUT: Adding extended input device "Power Button" (type: KEYBOARD, id 6) [ 98.018] (**) Option "xkb_rules" "evdev" [ 98.018] (**) Option "xkb_model" "pc105" [ 98.018] (**) Option "xkb_layout" "fr" [ 98.018] (**) Option "xkb_variant" "latin9" [ 98.020] (II) XKB: reuse xkmfile /var/lib/xkb/server-816A055A5FF7D63897839A4BDEDC3908551E49DA.xkm [ 98.020] (II) config/udev: Adding input device Video Bus (/dev/input/event4) [ 98.020] (**) Video Bus: Applying InputClass "evdev keyboard catchall" [ 98.020] (II) Using input driver 'evdev' for 'Video Bus' [ 98.020] (**) Video Bus: always reports core events [ 98.020] (**) evdev: Video Bus: Device: "/dev/input/event4" [ 98.020] (--) evdev: Video Bus: Vendor 0 Product 0x6 [ 98.020] (--) evdev: Video Bus: Found keys [ 98.020] (II) evdev: Video Bus: Configuring as keyboard [ 98.020] (**) Option "config_info" "udev:/sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:41/LNXVIDEO:00/input/input4/event4" [ 98.020] (II) XINPUT: Adding extended input device "Video Bus" (type: KEYBOARD, id 7) [ 98.020] (**) Option "xkb_rules" "evdev" [ 98.020] (**) Option "xkb_model" "pc105" [ 98.020] (**) Option "xkb_layout" "fr" [ 98.020] (**) Option "xkb_variant" "latin9" [ 98.021] (II) config/udev: Adding input device Lid Switch (/dev/input/event0) [ 98.021] (II) No input driver specified, ignoring this device. [ 98.021] (II) This device may have been added with another device file. [ 98.021] (II) config/udev: Adding input device Sleep Button (/dev/input/event1) [ 98.021] (**) Sleep Button: Applying InputClass "evdev keyboard catchall" [ 98.021] (II) Using input driver 'evdev' for 'Sleep Button' [ 98.021] (**) Sleep Button: always reports core events [ 98.021] (**) evdev: Sleep Button: Device: "/dev/input/event1" [ 98.021] (--) evdev: Sleep Button: Vendor 0 Product 0x3 [ 98.021] (--) evdev: Sleep Button: Found keys [ 98.021] (II) evdev: Sleep Button: Configuring as keyboard [ 98.021] (**) Option "config_info" "udev:/sys/devices/LNXSYSTM:00/device:00/PNP0C0E:00/input/input1/event1" [ 98.021] (II) XINPUT: Adding extended input device "Sleep Button" (type: KEYBOARD, id 8) [ 98.021] (**) Option "xkb_rules" "evdev" [ 98.021] (**) Option "xkb_model" "pc105" [ 98.021] (**) Option "xkb_layout" "fr" [ 98.021] (**) Option "xkb_variant" "latin9" [ 98.021] (II) config/udev: Adding input device USB 2.0 UVC 2.0M Webcam (/dev/input/event11) [ 98.021] (**) USB 2.0 UVC 2.0M Webcam: Applying InputClass "evdev keyboard catchall" [ 98.021] (II) Using input driver 'evdev' for 'USB 2.0 UVC 2.0M Webcam' [ 98.021] (**) USB 2.0 UVC 2.0M Webcam: always reports core events [ 98.021] (**) evdev: USB 2.0 UVC 2.0M Webcam: Device: "/dev/input/event11" [ 98.021] (--) evdev: USB 2.0 UVC 2.0M Webcam: Vendor 0x64e Product 0xa122 [ 98.021] (--) evdev: USB 2.0 UVC 2.0M Webcam: Found keys [ 98.021] (II) evdev: USB 2.0 UVC 2.0M Webcam: Configuring as keyboard [ 98.021] (**) Option "config_info" "udev:/sys/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.6/1-1.6:1.0/input/input11/event11" [ 98.021] (II) XINPUT: Adding extended input device "USB 2.0 UVC 2.0M Webcam" (type: KEYBOARD, id 9) [ 98.021] (**) Option "xkb_rules" "evdev" [ 98.021] (**) Option "xkb_model" "pc105" [ 98.021] (**) Option "xkb_layout" "fr" [ 98.021] (**) Option "xkb_variant" "latin9" [ 98.022] (II) config/udev: Adding input device HDA Intel Headphone (/dev/input/event10) [ 98.022] (II) No input driver specified, ignoring this device. [ 98.022] (II) This device may have been added with another device file. [ 98.022] (II) config/udev: Adding input device HDA Intel Line (/dev/input/event8) [ 98.022] (II) No input driver specified, ignoring this device. [ 98.022] (II) This device may have been added with another device file. [ 98.022] (II) config/udev: Adding input device HDA Intel Mic (/dev/input/event9) [ 98.022] (II) No input driver specified, ignoring this device. [ 98.022] (II) This device may have been added with another device file. [ 98.022] (II) config/udev: Adding input device ROCCAT ROCCAT Kova[+] (/dev/input/event7) [ 98.022] (**) ROCCAT ROCCAT Kova[+]: Applying InputClass "evdev pointer catchall" [ 98.022] (**) ROCCAT ROCCAT Kova[+]: Applying InputClass "evdev keyboard catchall" [ 98.022] (II) Using input driver 'evdev' for 'ROCCAT ROCCAT Kova[+]' [ 98.022] (**) ROCCAT ROCCAT Kova[+]: always reports core events [ 98.022] (**) evdev: ROCCAT ROCCAT Kova[+]: Device: "/dev/input/event7" [ 98.022] (--) evdev: ROCCAT ROCCAT Kova[+]: Vendor 0x1e7d Product 0x2d50 [ 98.022] (--) evdev: ROCCAT ROCCAT Kova[+]: Found 9 mouse buttons [ 98.022] (--) evdev: ROCCAT ROCCAT Kova[+]: Found scroll wheel(s) [ 98.022] (--) evdev: ROCCAT ROCCAT Kova[+]: Found relative axes [ 98.022] (--) evdev: ROCCAT ROCCAT Kova[+]: Found x and y relative axes [ 98.022] (--) evdev: ROCCAT ROCCAT Kova[+]: Found absolute axes [ 98.022] (II) evdev: ROCCAT ROCCAT Kova[+]: Forcing absolute x/y axes to exist. [ 98.022] (--) evdev: ROCCAT ROCCAT Kova[+]: Found keys [ 98.022] (II) evdev: ROCCAT ROCCAT Kova[+]: Configuring as mouse [ 98.022] (II) evdev: ROCCAT ROCCAT Kova[+]: Configuring as keyboard [ 98.022] (II) evdev: ROCCAT ROCCAT Kova[+]: Adding scrollwheel support [ 98.022] (**) evdev: ROCCAT ROCCAT Kova[+]: YAxisMapping: buttons 4 and 5 [ 98.022] (**) evdev: ROCCAT ROCCAT Kova[+]: EmulateWheelButton: 4, EmulateWheelInertia: 10, EmulateWheelTimeout: 200 [ 98.022] (**) Option "config_info" "udev:/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.4/2-1.4:1.0/input/input7/event7" [ 98.022] (II) XINPUT: Adding extended input device "ROCCAT ROCCAT Kova[+]" (type: KEYBOARD, id 10) [ 98.022] (**) Option "xkb_rules" "evdev" [ 98.022] (**) Option "xkb_model" "pc105" [ 98.022] (**) Option "xkb_layout" "fr" [ 98.022] (**) Option "xkb_variant" "latin9" [ 98.023] (II) evdev: ROCCAT ROCCAT Kova[+]: initialized for relative axes. [ 98.023] (WW) evdev: ROCCAT ROCCAT Kova[+]: ignoring absolute axes. [ 98.023] (**) ROCCAT ROCCAT Kova[+]: (accel) keeping acceleration scheme 1 [ 98.023] (**) ROCCAT ROCCAT Kova[+]: (accel) acceleration profile 0 [ 98.023] (**) ROCCAT ROCCAT Kova[+]: (accel) acceleration factor: 2.000 [ 98.023] (**) ROCCAT ROCCAT Kova[+]: (accel) acceleration threshold: 4 [ 98.023] (II) config/udev: Adding input device ROCCAT ROCCAT Kova[+] (/dev/input/mouse1) [ 98.023] (II) No input driver specified, ignoring this device. [ 98.023] (II) This device may have been added with another device file. [ 98.023] (II) config/udev: Adding input device ROCCAT ROCCAT Kova[+] (/dev/input/event12) [ 98.023] (**) ROCCAT ROCCAT Kova[+]: Applying InputClass "evdev keyboard catchall" [ 98.023] (II) Using input driver 'evdev' for 'ROCCAT ROCCAT Kova[+]' [ 98.023] (**) ROCCAT ROCCAT Kova[+]: always reports core events [ 98.023] (**) evdev: ROCCAT ROCCAT Kova[+]: Device: "/dev/input/event12" [ 98.023] (--) evdev: ROCCAT ROCCAT Kova[+]: Vendor 0x1e7d Product 0x2d50 [ 98.023] (--) evdev: ROCCAT ROCCAT Kova[+]: Found keys [ 98.023] (II) evdev: ROCCAT ROCCAT Kova[+]: Configuring as keyboard [ 98.023] (**) Option "config_info" "udev:/sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.4/2-1.4:1.1/input/input12/event12" [ 98.023] (II) XINPUT: Adding extended input device "ROCCAT ROCCAT Kova[+]" (type: KEYBOARD, id 11) [ 98.023] (**) Option "xkb_rules" "evdev" [ 98.023] (**) Option "xkb_model" "pc105" [ 98.023] (**) Option "xkb_layout" "fr" [ 98.023] (**) Option "xkb_variant" "latin9" [ 98.024] (II) config/udev: Adding input device Asus Laptop extra buttons (/dev/input/event5) [ 98.024] (**) Asus Laptop extra buttons: Applying InputClass "evdev keyboard catchall" [ 98.024] (II) Using input driver 'evdev' for 'Asus Laptop extra buttons' [ 98.024] (**) Asus Laptop extra buttons: always reports core events [ 98.024] (**) evdev: Asus Laptop extra buttons: Device: "/dev/input/event5" [ 98.024] (--) evdev: Asus Laptop extra buttons: Vendor 0 Product 0 [ 98.024] (--) evdev: Asus Laptop extra buttons: Found keys [ 98.024] (II) evdev: Asus Laptop extra buttons: Configuring as keyboard [ 98.024] (**) Option "config_info" "udev:/sys/devices/platform/asus_laptop/input/input5/event5" [ 98.024] (II) XINPUT: Adding extended input device "Asus Laptop extra buttons" (type: KEYBOARD, id 12) [ 98.024] (**) Option "xkb_rules" "evdev" [ 98.024] (**) Option "xkb_model" "pc105" [ 98.024] (**) Option "xkb_layout" "fr" [ 98.024] (**) Option "xkb_variant" "latin9" [ 98.024] (II) config/udev: Adding input device AT Translated Set 2 keyboard (/dev/input/event3) [ 98.024] (**) AT Translated Set 2 keyboard: Applying InputClass "evdev keyboard catchall" [ 98.024] (II) Using input driver 'evdev' for 'AT Translated Set 2 keyboard' [ 98.024] (**) AT Translated Set 2 keyboard: always reports core events [ 98.024] (**) evdev: AT Translated Set 2 keyboard: Device: "/dev/input/event3" [ 98.024] (--) evdev: AT Translated Set 2 keyboard: Vendor 0x1 Product 0x1 [ 98.024] (--) evdev: AT Translated Set 2 keyboard: Found keys [ 98.024] (II) evdev: AT Translated Set 2 keyboard: Configuring as keyboard [ 98.024] (**) Option "config_info" "udev:/sys/devices/platform/i8042/serio0/input/input3/event3" [ 98.024] (II) XINPUT: Adding extended input device "AT Translated Set 2 keyboard" (type: KEYBOARD, id 13) [ 98.024] (**) Option "xkb_rules" "evdev" [ 98.024] (**) Option "xkb_model" "pc105" [ 98.024] (**) Option "xkb_layout" "fr" [ 98.024] (**) Option "xkb_variant" "latin9" [ 98.025] (II) config/udev: Adding input device SynPS/2 Synaptics TouchPad (/dev/input/event6) [ 98.025] (**) SynPS/2 Synaptics TouchPad: Applying InputClass "evdev touchpad catchall" [ 98.025] (**) SynPS/2 Synaptics TouchPad: Applying InputClass "touchpad catchall" [ 98.025] (**) SynPS/2 Synaptics TouchPad: Applying InputClass "Default clickpad buttons" [ 98.025] (II) LoadModule: "synaptics" [ 98.025] (II) Loading /usr/lib/xorg/modules/input/synaptics_drv.so [ 98.025] (II) Module synaptics: vendor="X.Org Foundation" [ 98.025] compiled for 1.12.99.905, module version = 1.6.2 [ 98.025] Module class: X.Org XInput Driver [ 98.025] ABI class: X.Org XInput driver, version 18.0 [ 98.025] (II) Using input driver 'synaptics' for 'SynPS/2 Synaptics TouchPad' [ 98.025] (**) SynPS/2 Synaptics TouchPad: always reports core events [ 98.025] (**) Option "Device" "/dev/input/event6" [ 98.025] (--) synaptics: SynPS/2 Synaptics TouchPad: x-axis range 1472 - 5626 [ 98.025] (--) synaptics: SynPS/2 Synaptics TouchPad: y-axis range 1408 - 4716 [ 98.025] (--) synaptics: SynPS/2 Synaptics TouchPad: pressure range 0 - 255 [ 98.025] (--) synaptics: SynPS/2 Synaptics TouchPad: finger width range 0 - 15 [ 98.025] (--) synaptics: SynPS/2 Synaptics TouchPad: buttons: left right [ 98.025] (--) synaptics: SynPS/2 Synaptics TouchPad: Vendor 0x2 Product 0x7 [ 98.025] (--) synaptics: SynPS/2 Synaptics TouchPad: touchpad found [ 98.025] (**) SynPS/2 Synaptics TouchPad: always reports core events [ 98.026] (**) Option "config_info" "udev:/sys/devices/platform/i8042/serio4/input/input6/event6" [ 98.026] (II) XINPUT: Adding extended input device "SynPS/2 Synaptics TouchPad" (type: TOUCHPAD, id 14) [ 98.026] (**) synaptics: SynPS/2 Synaptics TouchPad: (accel) MinSpeed is now constant deceleration 2.5 [ 98.026] (**) synaptics: SynPS/2 Synaptics TouchPad: MaxSpeed is now 1.75 [ 98.026] (**) synaptics: SynPS/2 Synaptics TouchPad: AccelFactor is now 0.038 [ 98.026] (**) SynPS/2 Synaptics TouchPad: (accel) keeping acceleration scheme 1 [ 98.026] (**) SynPS/2 Synaptics TouchPad: (accel) acceleration profile 1 [ 98.026] (**) SynPS/2 Synaptics TouchPad: (accel) acceleration factor: 2.000 [ 98.026] (**) SynPS/2 Synaptics TouchPad: (accel) acceleration threshold: 4 [ 98.026] (--) synaptics: SynPS/2 Synaptics TouchPad: touchpad found [ 98.026] (II) config/udev: Adding input device SynPS/2 Synaptics TouchPad (/dev/input/mouse0) [ 98.026] (**) SynPS/2 Synaptics TouchPad: Ignoring device from InputClass "touchpad ignore duplicates" [ 98.501] (WW) NVIDIA(GPU-0): The EDID read for display device CRT-0 is invalid: [ 98.501] (WW) NVIDIA(GPU-0): unrecognized EDID Header. [ 98.501] (--) NVIDIA(GPU-0): [ 98.501] (--) NVIDIA(GPU-0): Raw EDID bytes: [ 98.501] (--) NVIDIA(GPU-0): [ 98.501] (--) NVIDIA(GPU-0): fd df fe fe fe fe fe fd 26 cd 50 46 00 00 00 00 [ 98.501] (--) NVIDIA(GPU-0): 28 0c 01 03 0e 22 1b 78 eb a6 9c a1 5a 4b 98 24 [ 98.501] (--) NVIDIA(GPU-0): 16 4c 57 bf ef 00 81 80 81 8f 71 40 71 4f 01 01 [ 98.501] (--) NVIDIA(GPU-0): 01 01 01 01 01 01 30 2a 00 98 51 00 2a 40 30 70 [ 98.501] (--) NVIDIA(GPU-0): 13 00 52 0e 11 00 00 1e 00 00 00 fd 00 32 4b 18 [ 98.501] (--) NVIDIA(GPU-0): 50 0e 00 0a 20 20 20 20 20 20 00 00 00 ff 00 30 [ 98.501] (--) NVIDIA(GPU-0): 0a 20 20 20 20 20 20 20 20 20 20 20 00 00 00 fc [ 98.501] (--) NVIDIA(GPU-0): 00 41 53 34 33 31 35 20 20 20 20 20 20 20 00 e3 [ 98.501] (--) NVIDIA(GPU-0): [ 98.501] (--) NVIDIA(GPU-0): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 98.501] (--) NVIDIA(GPU-0): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 98.501] (--) NVIDIA(GPU-0): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 98.501] (--) NVIDIA(GPU-0): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 98.501] (--) NVIDIA(GPU-0): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 98.501] (--) NVIDIA(GPU-0): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 98.501] (--) NVIDIA(GPU-0): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 98.501] (--) NVIDIA(GPU-0): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 98.501] (--) NVIDIA(GPU-0): [ 98.501] (**) NVIDIA(0): Using HorizSync/VertRefresh ranges from the EDID for display [ 98.501] (**) NVIDIA(0): device CRT-0 (Using EDID frequencies has been enabled on [ 98.501] (**) NVIDIA(0): all display devices.) [ 98.505] (II) NVIDIA(GPU-0): Display (HannStar Display Corp HSD160PHW1 (DFP-0)) does not [ 98.505] (II) NVIDIA(GPU-0): support NVIDIA 3D Vision stereo. [ 98.505] (**) NVIDIA(0): Using HorizSync/VertRefresh ranges from the EDID for display [ 98.505] (**) NVIDIA(0): device HannStar Display Corp HSD160PHW1 (DFP-0) (Using [ 98.506] (**) NVIDIA(0): EDID frequencies has been enabled on all display [ 98.506] (**) NVIDIA(0): devices.) [ 98.758] (WW) NVIDIA(GPU-0): The EDID read for display device CRT-0 is invalid: [ 98.758] (WW) NVIDIA(GPU-0): unrecognized EDID Header. [ 98.758] (--) NVIDIA(GPU-0): [ 98.758] (--) NVIDIA(GPU-0): Raw EDID bytes: [ 98.758] (--) NVIDIA(GPU-0): [ 98.758] (--) NVIDIA(GPU-0): fd df fe fe fe fe fe fd 26 cd 50 46 00 00 00 00 [ 98.758] (--) NVIDIA(GPU-0): 28 0c 01 03 0e 22 1b 78 eb a6 9c a1 5a 4b 98 24 [ 98.758] (--) NVIDIA(GPU-0): 16 4c 57 bf ef 00 81 80 81 8f 71 40 71 4f 01 01 [ 98.758] (--) NVIDIA(GPU-0): 01 01 01 01 01 01 30 2a 00 98 51 00 2a 40 30 70 [ 98.758] (--) NVIDIA(GPU-0): 13 00 52 0e 11 00 00 1e 00 00 00 fd 00 32 4b 18 [ 98.758] (--) NVIDIA(GPU-0): 50 0e 00 0a 20 20 20 20 20 20 00 00 00 ff 00 30 [ 98.758] (--) NVIDIA(GPU-0): 0a 20 20 20 20 20 20 20 20 20 20 20 00 00 00 fc [ 98.758] (--) NVIDIA(GPU-0): 00 41 53 34 33 31 35 20 20 20 20 20 20 20 00 e3 [ 98.758] (--) NVIDIA(GPU-0): [ 98.758] (--) NVIDIA(GPU-0): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 98.758] (--) NVIDIA(GPU-0): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 98.758] (--) NVIDIA(GPU-0): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 98.758] (--) NVIDIA(GPU-0): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 98.758] (--) NVIDIA(GPU-0): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 98.758] (--) NVIDIA(GPU-0): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 98.758] (--) NVIDIA(GPU-0): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 98.758] (--) NVIDIA(GPU-0): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 98.758] (--) NVIDIA(GPU-0): [ 98.758] (**) NVIDIA(0): Using HorizSync/VertRefresh ranges from the EDID for display [ 98.758] (**) NVIDIA(0): device CRT-0 (Using EDID frequencies has been enabled on [ 98.758] (**) NVIDIA(0): all display devices.) [ 98.763] (II) NVIDIA(GPU-0): Display (HannStar Display Corp HSD160PHW1 (DFP-0)) does not [ 98.763] (II) NVIDIA(GPU-0): support NVIDIA 3D Vision stereo. [ 98.763] (**) NVIDIA(0): Using HorizSync/VertRefresh ranges from the EDID for display [ 98.764] (**) NVIDIA(0): device HannStar Display Corp HSD160PHW1 (DFP-0) (Using [ 98.764] (**) NVIDIA(0): EDID frequencies has been enabled on all display [ 98.764] (**) NVIDIA(0): devices.) [ 104.130] (WW) NVIDIA(GPU-0): The EDID read for display device CRT-0 is invalid: [ 104.130] (WW) NVIDIA(GPU-0): unrecognized EDID Header. [ 104.130] (--) NVIDIA(GPU-0): [ 104.130] (--) NVIDIA(GPU-0): Raw EDID bytes: [ 104.130] (--) NVIDIA(GPU-0): [ 104.130] (--) NVIDIA(GPU-0): fd df fe fe fe fe fe fd 26 cd 50 46 00 00 00 00 [ 104.130] (--) NVIDIA(GPU-0): 28 0c 01 03 0e 22 1b 78 eb a6 9c a1 5a 4b 98 24 [ 104.130] (--) NVIDIA(GPU-0): 16 4c 57 bf ef 00 81 80 81 8f 71 40 71 4f 01 01 [ 104.130] (--) NVIDIA(GPU-0): 01 01 01 01 01 01 30 2a 00 98 51 00 2a 40 30 70 [ 104.130] (--) NVIDIA(GPU-0): 13 00 52 0e 11 00 00 1e 00 00 00 fd 00 32 4b 18 [ 104.130] (--) NVIDIA(GPU-0): 50 0e 00 0a 20 20 20 20 20 20 00 00 00 ff 00 30 [ 104.130] (--) NVIDIA(GPU-0): 0a 20 20 20 20 20 20 20 20 20 20 20 00 00 00 fc [ 104.130] (--) NVIDIA(GPU-0): 00 41 53 34 33 31 35 20 20 20 20 20 20 20 00 e3 [ 104.130] (--) NVIDIA(GPU-0): [ 104.130] (--) NVIDIA(GPU-0): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 104.130] (--) NVIDIA(GPU-0): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 104.130] (--) NVIDIA(GPU-0): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 104.130] (--) NVIDIA(GPU-0): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 104.130] (--) NVIDIA(GPU-0): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 104.130] (--) NVIDIA(GPU-0): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 104.130] (--) NVIDIA(GPU-0): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 104.130] (--) NVIDIA(GPU-0): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 104.130] (--) NVIDIA(GPU-0): [ 104.130] (**) NVIDIA(0): Using HorizSync/VertRefresh ranges from the EDID for display [ 104.130] (**) NVIDIA(0): device CRT-0 (Using EDID frequencies has been enabled on [ 104.130] (**) NVIDIA(0): all display devices.) [ 104.136] (II) NVIDIA(GPU-0): Display (HannStar Display Corp HSD160PHW1 (DFP-0)) does not [ 104.136] (II) NVIDIA(GPU-0): support NVIDIA 3D Vision stereo. [ 104.136] (**) NVIDIA(0): Using HorizSync/VertRefresh ranges from the EDID for display [ 104.136] (**) NVIDIA(0): device HannStar Display Corp HSD160PHW1 (DFP-0) (Using [ 104.136] (**) NVIDIA(0): EDID frequencies has been enabled on all display [ 104.136] (**) NVIDIA(0): devices.) [ 105.505] (II) NVIDIA(0): Setting mode "LVDS-0: nvidia-auto-select @1366x768 +0+0" [ 106.888] (II) NVIDIA(0): Setting mode "LVDS-0: nvidia-auto-select @1366x768 +0+0, VGA-0: 800x600_60 @800x600 +1366+0" [ 107.395] (WW) NVIDIA(GPU-0): The EDID read for display device CRT-0 is invalid: [ 107.395] (WW) NVIDIA(GPU-0): unrecognized EDID Header. [ 107.395] (--) NVIDIA(GPU-0): [ 107.395] (--) NVIDIA(GPU-0): Raw EDID bytes: [ 107.395] (--) NVIDIA(GPU-0): [ 107.395] (--) NVIDIA(GPU-0): fd df fe fe fe fe fe fd 26 cd 50 46 00 00 00 00 [ 107.395] (--) NVIDIA(GPU-0): 28 0c 01 03 0e 22 1b 78 eb a6 9c a1 5a 4b 98 24 [ 107.395] (--) NVIDIA(GPU-0): 16 4c 57 bf ef 00 81 80 81 8f 71 40 71 4f 01 01 [ 107.395] (--) NVIDIA(GPU-0): 01 01 01 01 01 01 30 2a 00 98 51 00 2a 40 30 70 [ 107.395] (--) NVIDIA(GPU-0): 13 00 52 0e 11 00 00 1e 00 00 00 fd 00 32 4b 18 [ 107.395] (--) NVIDIA(GPU-0): 50 0e 00 0a 20 20 20 20 20 20 00 00 00 ff 00 30 [ 107.395] (--) NVIDIA(GPU-0): 0a 20 20 20 20 20 20 20 20 20 20 20 00 00 00 fc [ 107.395] (--) NVIDIA(GPU-0): 00 41 53 34 33 31 35 20 20 20 20 20 20 20 00 e3 [ 107.395] (--) NVIDIA(GPU-0): [ 107.395] (--) NVIDIA(GPU-0): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 107.396] (--) NVIDIA(GPU-0): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 107.396] (--) NVIDIA(GPU-0): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 107.396] (--) NVIDIA(GPU-0): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 107.396] (--) NVIDIA(GPU-0): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 107.396] (--) NVIDIA(GPU-0): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 107.396] (--) NVIDIA(GPU-0): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 107.396] (--) NVIDIA(GPU-0): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 107.396] (--) NVIDIA(GPU-0): [ 107.396] (**) NVIDIA(0): Using HorizSync/VertRefresh ranges from the EDID for display [ 107.396] (**) NVIDIA(0): device CRT-0 (Using EDID frequencies has been enabled on [ 107.396] (**) NVIDIA(0): all display devices.) [ 107.399] (II) NVIDIA(GPU-0): Display (HannStar Display Corp HSD160PHW1 (DFP-0)) does not [ 107.399] (II) NVIDIA(GPU-0): support NVIDIA 3D Vision stereo. [ 107.399] (**) NVIDIA(0): Using HorizSync/VertRefresh ranges from the EDID for display [ 107.399] (**) NVIDIA(0): device HannStar Display Corp HSD160PHW1 (DFP-0) (Using [ 107.399] (**) NVIDIA(0): EDID frequencies has been enabled on all display [ 107.399] (**) NVIDIA(0): devices.) [ 107.585] (WW) NVIDIA(GPU-0): The EDID read for display device CRT-0 is invalid: [ 107.727] (WW) NVIDIA(GPU-0): unrecognized EDID Header. [ 107.727] (--) NVIDIA(GPU-0): [ 107.727] (--) NVIDIA(GPU-0): Raw EDID bytes: [ 107.727] (--) NVIDIA(GPU-0): [ 107.727] (--) NVIDIA(GPU-0): fd df fe fe fe fe fe fd 26 cd 50 46 00 00 00 00 [ 107.727] (--) NVIDIA(GPU-0): 28 0c 01 03 0e 22 1b 78 eb a6 9c a1 5a 4b 98 24 [ 107.727] (--) NVIDIA(GPU-0): 16 4c 57 bf ef 00 81 80 81 8f 71 40 71 4f 01 01 [ 107.727] (--) NVIDIA(GPU-0): 01 01 01 01 01 01 30 2a 00 98 51 00 2a 40 30 70 [ 107.727] (--) NVIDIA(GPU-0): 13 00 52 0e 11 00 00 1e 00 00 00 fd 00 32 4b 18 [ 107.727] (--) NVIDIA(GPU-0): 50 0e 00 0a 20 20 20 20 20 20 00 00 00 ff 00 30 [ 107.727] (--) NVIDIA(GPU-0): 0a 20 20 20 20 20 20 20 20 20 20 20 00 00 00 fc [ 107.727] (--) NVIDIA(GPU-0): 00 41 53 34 33 31 35 20 20 20 20 20 20 20 00 e3 [ 107.727] (--) NVIDIA(GPU-0): [ 107.727] (--) NVIDIA(GPU-0): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 107.727] (--) NVIDIA(GPU-0): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 107.727] (--) NVIDIA(GPU-0): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 107.727] (--) NVIDIA(GPU-0): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 107.727] (--) NVIDIA(GPU-0): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 107.727] (--) NVIDIA(GPU-0): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 107.727] (--) NVIDIA(GPU-0): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 107.727] (--) NVIDIA(GPU-0): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 107.727] (--) NVIDIA(GPU-0): [ 107.727] (**) NVIDIA(0): Using HorizSync/VertRefresh ranges from the EDID for display [ 107.727] (**) NVIDIA(0): device CRT-0 (Using EDID frequencies has been enabled on [ 107.727] (**) NVIDIA(0): all display devices.) [ 107.732] (II) NVIDIA(GPU-0): Display (HannStar Display Corp HSD160PHW1 (DFP-0)) does not [ 107.732] (II) NVIDIA(GPU-0): support NVIDIA 3D Vision stereo. [ 107.732] (**) NVIDIA(0): Using HorizSync/VertRefresh ranges from the EDID for display [ 107.732] (**) NVIDIA(0): device HannStar Display Corp HSD160PHW1 (DFP-0) (Using [ 107.732] (**) NVIDIA(0): EDID frequencies has been enabled on all display [ 107.732] (**) NVIDIA(0): devices.) [ 107.858] (WW) NVIDIA(GPU-0): The EDID read for display device CRT-0 is invalid: [ 107.858] (WW) NVIDIA(GPU-0): unrecognized EDID Header. [ 107.858] (--) NVIDIA(GPU-0): [ 107.858] (--) NVIDIA(GPU-0): Raw EDID bytes: [ 107.858] (--) NVIDIA(GPU-0): [ 107.858] (--) NVIDIA(GPU-0): fd df fe fe fe fe fe fd 26 cd 50 46 00 00 00 00 [ 107.858] (--) NVIDIA(GPU-0): 28 0c 01 03 0e 22 1b 78 eb a6 9c a1 5a 4b 98 24 [ 107.858] (--) NVIDIA(GPU-0): 16 4c 57 bf ef 00 81 80 81 8f 71 40 71 4f 01 01 [ 107.858] (--) NVIDIA(GPU-0): 01 01 01 01 01 01 30 2a 00 98 51 00 2a 40 30 70 [ 107.858] (--) NVIDIA(GPU-0): 13 00 52 0e 11 00 00 1e 00 00 00 fd 00 32 4b 18 [ 107.858] (--) NVIDIA(GPU-0): 50 0e 00 0a 20 20 20 20 20 20 00 00 00 ff 00 30 [ 107.858] (--) NVIDIA(GPU-0): 0a 20 20 20 20 20 20 20 20 20 20 20 00 00 00 fc [ 107.858] (--) NVIDIA(GPU-0): 00 41 53 34 33 31 35 20 20 20 20 20 20 20 00 e3 [ 107.858] (--) NVIDIA(GPU-0): [ 107.858] (--) NVIDIA(GPU-0): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 107.858] (--) NVIDIA(GPU-0): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 107.858] (--) NVIDIA(GPU-0): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 107.858] (--) NVIDIA(GPU-0): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 107.858] (--) NVIDIA(GPU-0): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 107.858] (--) NVIDIA(GPU-0): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 107.858] (--) NVIDIA(GPU-0): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 107.858] (--) NVIDIA(GPU-0): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 107.858] (--) NVIDIA(GPU-0): [ 107.858] (**) NVIDIA(0): Using HorizSync/VertRefresh ranges from the EDID for display [ 107.858] (**) NVIDIA(0): device CRT-0 (Using EDID frequencies has been enabled on [ 107.858] (**) NVIDIA(0): all display devices.) [ 107.864] (II) NVIDIA(GPU-0): Display (HannStar Display Corp HSD160PHW1 (DFP-0)) does not [ 107.864] (II) NVIDIA(GPU-0): support NVIDIA 3D Vision stereo. [ 107.864] (**) NVIDIA(0): Using HorizSync/VertRefresh ranges from the EDID for display [ 107.864] (**) NVIDIA(0): device HannStar Display Corp HSD160PHW1 (DFP-0) (Using [ 107.864] (**) NVIDIA(0): EDID frequencies has been enabled on all display [ 107.864] (**) NVIDIA(0): devices.) [ 109.032] (II) NVIDIA(0): Setting mode "LVDS-0: nvidia-auto-select @1366x768 +0+0, VGA-0: nvidia-auto-select @1024x768 +1366+0" [ 110.378] (II) XKB: reuse xkmfile /var/lib/xkb/server-C814AC61323ADD9F3C69F18721C056518480B483.xkm Hors ligne classdroogies Re : [Résolu] Twinview changement résolution impossible Le fichier xorg.conf n'est plus indispensable et nvidia utilise de plus en plus xrandr, après le pilote proprio depuis plusieurs versions c'est D'après ce que je vois il semblerait qu'un des écrans soit mal détecté. Pour plus d'infos il faudrait le fichier Xorg.0.log, en utilisant le fichier xorg.conf que tu avais mis en place. Pour le test si tu remplace ceci dans ton ancien xorg.conf : Option "metamodes" "DFP: nvidia-auto-select +0+0, CRT: nvidia-auto-select +1366+0" Par : Option "MetaModes" "LVDS-0: nvidia-auto-select @1366x768 +0+0, VGA-0: nvidia-auto-select @1024x768 +1366+0" Ca devrait marcher..... Enfin ça marche déjà de toute façon Dernière modification par classdroogies (Le 14/01/2013, à 22:36) Hors ligne Maisondouf Re : [Résolu] Twinview changement résolution impossible C'est sur qu'avec ça, elle va marcher beaucoup moins bien... [ 95.783] (==) Matched nvidia as autoconfigured driver 0[ 95.783] (==) Matched nouveau as autoconfigured driver 1[ 95.783] (==) Matched nv as autoconfigured driver 2[ 95.783] (==) Matched vesa as autoconfigured driver 3[ 95.783] (==) Matched modesetting as autoconfigured driver 4[ 95.783] (==) Matched fbdev as autoconfigured driver 5 ASUS M5A88-v EVO avec AMD FX(tm)-8120 Eight-Core Processor, OS principal Precise 12.04.1 LTS 63bits½ Bricoleur, menteur, inculte, inadapté social et mythomane, enfin d'après certains.... "the secret of my form is summed up in two words, no sport" (Winston Churchill) Hors ligne
gmli Cerise 0.8 - TPE, freelances, artisans Hello, je me suis dit qu'une petit présentation pourrait intéresser du monde ici. Je viens de sortir aujourd'hui la version 0.8 de mon petit soft de gestion d'entreprise (cf. l'article sur le blog http://leblog.cfait.fr/post/2008/09/07/Cerise-08) Vous pouvez trouver une liste des fonctionnalités ici : http://cerise-pgi.com/index.php/features. C'est destiné aux TPE, artisans et freelances. En gros vu de loin ça donne : factures, devis, contacts, règlements, dépenses, rapport TVA, produits. Le but est d'avoir un système qui permet de facturer et gérer un peu tout ça, le plus facilement le plus rapidement possible. Pour info, c'est codé en Python, avec TurboGears, ça utilise au choix SQLite, MySQL ou PostgreSQL. L'installation des dépendances n'est pas toujours super évidente, mais Cerise en elle même est très facile à installer / configurer. Je ne sais pas précisément qui l'utilise aujourd'hui en dehors de mes clients, mais ça va de moi (freelance), à un ESAT (50 personnes) en passant par une maison d'hôtes. Dernière petite info, mais qui a sont importance, vous pouvez faire appel à moi pour du support, des développements, etc. D'ailleurs je réfléchis à une offre en ce moment, un hébergement Cerise ouvert à tous (donc vous n'avez plus rien à faire, mise à part demander de nouvelles fonctionnalités ), avec un prix au choix, allant de 0 à ce que vous voulez. Un peu comme l'album de Radiohead l'année dernière. Le but étant de fournir un service de qualité, libre, pour les petites boites, pas cher, mais qui progresse rapidement grâce aux sommes récoltés. Éventuellement lié à d'autres logiciels libres destinés aux entreprises. Enfin ça reste une idée.. si ça vous intéresse dites-le. EDIT : il y a une demo ici : http://demo.cerise-pgi.com, avec les identifiants suivante : admin/admin Dernière modification par gmli (Le 07/09/2008, à 17:43) Hors ligne snowycub Re : Cerise 0.8 - TPE, freelances, artisans Je voulais ajouter un mot pour offrir un témoignage et confirmer la qualité du travail de Guillaume. La "Maison d'hôtes" c'est moi . Après avoir cherché un peu partout une solution de facturation tournant sous linux, j'ai fait la connaissance de Cerise. Je l'ai installé pour utiliser la facturation, ca tourne depuis 3 mois, et ca marche très bien. C'est vrai qu'il y a encore ici et là quelques bugs, mais Guillaume est extrêmement réactif et le projet avance à grands pas ! Par rapport à des solutions comme Bedesk (propriétaire) ou Laurux (libre) le logiciel est certes plus compliqué à installer (d'où l'intérêt de l'offre d'hébergement pour ceux que cela rebuterait). En revanche, il est INCOMPARABLEMENT plus élégant et facile à utiliser, allez voir la démo et vous comprendrez. De plus, il est possible de customiser la sortie des factures "à mort" ce qui est vraiment appréciable (à mon gout). Le seul problème, malheureusement, semble être le peu d'intérêt (pour l'instant) de la communauté du libre pour ce projet qui en vaut vraiment la peine, il n'y a qu'à voir la réactivité sur ce forum pour des posts concernant des logiciels propriétaires, chers, à faire tourner des fois avec wine, et ce post . Alors que vraiment ce projet en vaut la peine ! Alors testez-le et aidez Guillaume à le faire avancer, ils en valent vraiment la peine (CerisePGI, et Guillaume aussi )... Christouf Re : Cerise 0.8 - TPE, freelances, artisans Une gestion de stock est prévu? Hors ligne gmli Re : Cerise 0.8 - TPE, freelances, artisans Merci beaucoup snowycub pour ton commentaire, ça m'a fait vraiment très plaisir Concernant la gestion des stocks, elle est partiellement codé même. Le problème étant que je n'ai jamais eu personnellement à gérer des stocks, et donc je ne suis pas certain de prendre les bonnes décisions. Si tu as du temps Christouf, je viens de créer cette page : http://trac.cfait.fr/CerisePGI-Trac/wiki/GestionDesStocks Je vais tâcher d'entrer le boulot déjà réalisé. Mais si tu pouvais mettre une sorte de retour d'expérience, la manière dont tu gères tes stocks, ça me serait très utile. Une dernière chose, pour la demo, on peut tester avec Bénenuts et les identifiants admin/admin. Hors ligne Alph Re : Cerise 0.8 - TPE, freelances, artisans Bonjour, Cerise semble pas mal en effet mais.... Je vais donc faire le râleur du coin 1- sur le site http://www.cerise-pgi.com/ je n'ai pas trouvé comment installer Cerise sur mon ordi , il y a bien un lien vers le code-source, mais après... Alors, facile l'install pour le néophyte ? Je ne pense pas. S'il faut naviguer entre un site un blog et que sais-je pour trouver une info, excusé, mais la ce n'est pas pratique du tout. Viiiite un tuto sur Ubuntu.fr serait bienvenue Hors ligne gmli Re : Cerise 0.8 - TPE, freelances, artisans En fait tout est sur le site de développement. C'est vrai qu'il faudrait être plus clair sur le site principal. La page expliquant l'installation est ici : http://trac.cfait.fr/CerisePGI-Trac/wik … eCerisePGI Hors ligne yris Re : Cerise 0.8 - TPE, freelances, artisans Bonjour, Je suis un utilisateur néophyte de Ubuntu (8.04LTS). J'ai essayé Cerise depuis cerise-pgi.com et souhaite l'adopter pour mon activité. Je rencontre des difficultés lors du lancement du serveur: j'ai pu "créer une nouvelle entreprise". Je peux me connecter grâce à mes identifiants mais j'obtiens la page suivante: 500 Internal error The server encountered an unexpected condition which prevented it from fulfilling the request. Page handler: <bound method Root.dashboard of <cerisepgi.controllers.root.Root object at 0x8c58e0c>> Traceback (most recent call last): File "/var/lib/python-support/python2.5/cherrypy/_cphttptools.py", line 105, in _run self.main() File "/var/lib/python-support/python2.5/cherrypy/_cphttptools.py", line 254, in main body = page_handler(*virtual_path, **self.params) File "<string>", line 3, in dashboard File "/var/lib/python-support/python2.5/turbogears/controllers.py", line 363, in expose *args, **kw) File "<string>", line 5, in run_with_transaction File "/var/lib/python-support/python2.5/turbogears/database.py", line 356, in so_rwt retval = func(*args, **kw) File "<string>", line 5, in _expose File "/var/lib/python-support/python2.5/turbogears/controllers.py", line 378, in <lambda> mapping, fragment, args, kw))) File "/var/lib/python-support/python2.5/turbogears/controllers.py", line 405, in _execute_func output = errorhandling.try_call(func, *args, **kw) File "/var/lib/python-support/python2.5/turbogears/errorhandling.py", line 72, in try_call return func(self, *args, **kw) File "<string>", line 3, in dashboard File "/var/lib/python-support/python2.5/turbogears/identity/conditions.py", line 242, in require return fn(self, *args, **kwargs) File "/home/gml/cerise/0.8/CerisePGI/cerisepgi/controllers/root.py", line 80, in dashboard File "/usr/lib/python2.5/site-packages/sqlobject/sqlbuilder.py", line 381, in __getattr__ raise AttributeError("%s instance has no attribute '%s'" % (self.soClass.__name__, attr)) AttributeError: Invoice instance has no attribute 'enterprise' Et là, je sèche complètement, mes connaissances en serveurs et BdD étant, disons-le, nulles! Pour l'installation, j'ai suivi le tuto de Guillaume, mais je n'ai pas tout compris.:( Pouvez-vous m'aider pour la dernière ligne droite, SVP? Merci d'avance Hors ligne gmli Re : Cerise 0.8 - TPE, freelances, artisans As-tu fait "tg-admin sql create" à la racine du projet ? Hors ligne yris Re : Cerise 0.8 - TPE, freelances, artisans Voici la réponse que j'obtiens lors de la commande "tg-admin sql create": Using database URI sqlite:///var/www/html/CerisePGI/devdata.sqlite Warning: a circular reference was detected in the model. Unable to sort the classes by dependency: they will be treated in alphabetic order. This may or may not work depending on your database backend. The error was: Found a circular reference: Activity --> Enterprise --> Address --> Contact --> Company --> Contact Exception exceptions.AttributeError: "'sqlite3.Connection' object has no attribute 'autocommit'" in <bound method Transaction.__del__ of <sqlobject.dbconnection.Transaction object at 0x8d0b2ec>> ignored Hors ligne yris Re : Cerise 0.8 - TPE, freelances, artisans Info complémentaire qui a peut-être son importance: dans le répertoire /var/www/html , j'ai installé précédemment SugarCRM qui contient aussi une BdD. Hors ligne jeanclaude1946 Re : Cerise 0.8 - TPE, freelances, artisans Bonjour, Je suis cette liste avec intérêt, je pense que c'est très bien, j'ai été commerçant pendant 20 ans, le principale problème à mon avis c'est que c'est très difficile à installer, pour quelqu'un qui m'a pas le temps, et peut être pas les connaissances nécessaires, c'est tout à fait impossible d'installer ce logiciel, pour faire plus simple, un paquet deb , pour mon cas personnel serait plus approprié. Merci Hors ligne Le Monolecte Re : Cerise 0.8 - TPE, freelances, artisans Bonjour à tous, Je trouve que cerise est probablement le petit logiciel libre de facturation qui va bien pour les TPE et les indé. Par contre, pour l'installation, c'est super coton. J'ai tenté d'installer en téléchargeant la svn, ce qui se fait facilement en ligne de commande et en suivant le tuto. Sous Ubuntu, j'ai LAMP qui tourne. J'ai tenté de modifié dev.cfg pour que ça le fasse, en décommentant la ligne # sqlobject.dburi="mysql://utilisateur:mot de pass@localhost:8080/cerise", cerise étant la base de données que j'ai créé dans phpmyadmin pour cerise... mais elle n'était pas sur le gâteau. J'ai pris la version de _renderPM.so qui va bien en la renommant directement dans les fichiers installés par svn et je lance tg-admin sql create Et là, c'est le drame : Using database URI mysql://[i]l'utilisateur de mysql[/i]:[i]le mot de passe de cet utilisateur[/i]@localhost:8080/cerise Traceback (most recent call last): File "/usr/bin/tg-admin", line 8, in <module> load_entry_point('TurboGears==1.0.4.3', 'console_scripts', 'tg-admin')() File "/var/lib/python-support/python2.5/turbogears/command/base.py", line 379, in main command.run() File "/var/lib/python-support/python2.5/turbogears/command/base.py", line 128, in run command.the_runner.run(sys.argv) File "/usr/lib/python2.5/site-packages/sqlobject/manager/command.py", line 101, in run runner.run() File "/usr/lib/python2.5/site-packages/sqlobject/manager/command.py", line 307, in run self.command() File "/usr/lib/python2.5/site-packages/sqlobject/manager/command.py", line 628, in command for soClass in self.classes(require_some=True): File "/usr/lib/python2.5/site-packages/sqlobject/manager/command.py", line 329, in classes conn = self.connection() File "/usr/lib/python2.5/site-packages/sqlobject/manager/command.py", line 390, in connection return sqlobject.connectionForURI(self.options.connection_uri) File "/usr/lib/python2.5/site-packages/sqlobject/dbconnection.py", line 1079, in connectionForURI conn = self.schemeBuilders[scheme]().connectionFromURI(uri) File "/usr/lib/python2.5/site-packages/sqlobject/mysql/mysqlconnection.py", line 56, in connectionFromURI host=host or 'localhost', port=port or 0, **args) File "/usr/lib/python2.5/site-packages/sqlobject/mysql/mysqlconnection.py", line 23, in __init__ import MySQLdb, MySQLdb.constants.CR, MySQLdb.constants.ER ImportError: No module named MySQLdb Donc, quoi qu'il faut faire? Le dossier de cerise s'est installé par défaut à la racine de mon dossier utilisateur. Il faut que je le déplace dans mon interface WWW pour mysql (que j'ai placé sur le /home par mesure de Sécurité)? Bref, j'aimerais vraiment bien pouvoir tester cerise en local pour le valider, voir s'il me convient en production pour ensuite rémunérer (modestement, hélas) le créateur et faire la pub du truc!:) 13.10 (64) - Dell Latitude E4310 Hors ligne gmli Re : Cerise 0.8 - TPE, freelances, artisans Hello, désolé du délai de réponse, j'étais en plein déménagement, et j'avais quelques soucis de ligne ADSL.. Je crois que je vais modifier la page d'installation, en effet sous Ubuntu les paquets Python utilisés par TurboGears et Cerise sont assez foireux. Je conseille de les installer via easy_install, ça règle 99.99% des problèmes. Donc : sudo aptitude install python-setuptools Et ensuite : sudo easy_install sqlobject Idem pour sqlite. MySQLdb devrait passer avec. Ça devrait régler vos problèmes à vous deux. Concernant la facilité d'installation, si on installe tout avec easy_install, très honnêtement, c'est bien plus simple d'installer Cerise que n'importe quel autre PGI web Je manque cruellement de temps, mais je ne désespère pas de faire un paquet Python (un EGG), ça évitera quasi tous les problèmes. En tout cas si des gens (autres que mes clients) commencent à utiliser le logiciel et à rapporter des bugs, des retours d'expérience, etc, çe n'en sera que très bénéfique, donc merci à vous de tester ce logiciel assez jeune. Hors ligne yris Re : Cerise 0.8 - TPE, freelances, artisans Bonsoir Guillaume, je viens de recommencer l'installation comme tu viens de la décrire. J'ai dû passer par Synaptic pour installer SQLite et MySQLdb. Peux-tu nous expliquer ce que signifie cette phrase (en langage néophyte ): Il est conseillé de recompiler la librairie renderPM et de l'installer de façon "classique" : python setup.py install. Elle peut être récupérée sur http://www.reportlab.org/downloads.html section renderPM 1.06. Quelles sont les infos à entrer dans le fichier CerisePGI/devCFG? Une fois ceci expliqué, on doit tenir le bon bout, non? Hors ligne gmli Re : Cerise 0.8 - TPE, freelances, artisans Bonsoir Guillaume, je viens de recommencer l'installation comme tu viens de la décrire. J'ai dû passer par Synaptic pour installer SQLite et MySQLdb. Peux-tu nous expliquer ce que signifie cette phrase (en langage néophyte ): Il est conseillé de recompiler la librairie renderPM et de l'installer de façon "classique" : python setup.py install. Elle peut être récupérée sur http://www.reportlab.org/downloads.html section renderPM 1.06. Quelles sont les infos à entrer dans le fichier CerisePGI/devCFG? Une fois ceci expliqué, on doit tenir le bon bout, non? Je ne suis pas l'auteur de la phrase En fait ça dit juste qu'il est préférable (mais pas du tout obligatoire) de recompiler renderPM, plutôt que d'utiliser le fichier _renderPM.so fourni avec Cerise. Mais tu peux ignorer cette phrase, normalement ça ne pose aucun soucis. Pour le fichier dev.cfg, en fait si tu ne modifie rien du tout ça fonctionne quand même, Cerise va utiliser un fichier SQLITE pour la base de donnée, et le port de connexion sera le 8080. Le fichier sert juste à modifier ça principalement. Hors ligne yris Re : Cerise 0.8 - TPE, freelances, artisans Que signifie recompiler renderPM et comment fait-on pour recompiler renderPM? Hors ligne gmli Re : Cerise 0.8 - TPE, freelances, artisans Là tu recherches la complexité renderPM est une lib de Reportlab (pour générer les images), qui doit être compilée (on passe du code source à un fichier binaire). Elle est déjà compilée, c'est le fichier .so à la racine, mais si on veut on peut la recompiler pour son système. Mais premièrement, comme déjà dit, c'est inutile, et secondement Cerise dans sa version actuelle n'utilise même plus renderPM (je suis passé à du flash pour les graphiques). Mais je le garde car j'en aurais peut-être encore besoin. Voilà Hors ligne yris Re : Cerise 0.8 - TPE, freelances, artisans J'espérais juste avoir oublié, zappé une étape qui explique mes problèmes d'installation. Hors ligne gmli Re : Cerise 0.8 - TPE, freelances, artisans Il te reste quoi comme problème ? J'ai installé Cerise dans une machine virtuelle sous Ubuntu 8.04 hier soir avec les commandes que je t'ai cité, et ça fonctionne sans soucis. Hors ligne yris Re : Cerise 0.8 - TPE, freelances, artisans J'ai pu créer mon entreprise depuis la page d'accueil mais dès que je valide, j'obtiens... Bon, voila que je n'arrive plus à démarrer le serveur CerisePGI. A la commande, j'obtiens ça: root@studio-desktop:~# python start-cerisepgi.py python: can't open file 'start-cerisepgi.py': [Errno 2] No such file or directory Hors ligne yris Re : Cerise 0.8 - TPE, freelances, artisans Je suis obligé de regénérer une BdB avec tg-admin sql create pour pouvoir ensuite lancer le serveur. A la création de la BdD, j'obtiens à nouveau la réponse que j'ai posté dans mon messge n°9 plus haut. Ensuite, lorsque je me connecte avec mes ID au serveur, j'obtiens ce message en accueil: 500 Internal error The server encountered an unexpected condition which prevented it from fulfilling the request. Page handler: <bound method Root.dashboard of <cerisepgi.controllers.root.Root object at 0x8ed8e2c>> Traceback (most recent call last): File "/var/lib/python-support/python2.5/cherrypy/_cphttptools.py", line 105, in _run self.main() File "/var/lib/python-support/python2.5/cherrypy/_cphttptools.py", line 254, in main body = page_handler(*virtual_path, **self.params) File "<string>", line 3, in dashboard File "/var/lib/python-support/python2.5/turbogears/controllers.py", line 363, in expose *args, **kw) File "<string>", line 5, in run_with_transaction File "/var/lib/python-support/python2.5/turbogears/database.py", line 356, in so_rwt retval = func(*args, **kw) File "<string>", line 5, in _expose File "/var/lib/python-support/python2.5/turbogears/controllers.py", line 378, in <lambda> mapping, fragment, args, kw))) File "/var/lib/python-support/python2.5/turbogears/controllers.py", line 405, in _execute_func output = errorhandling.try_call(func, *args, **kw) File "/var/lib/python-support/python2.5/turbogears/errorhandling.py", line 72, in try_call return func(self, *args, **kw) File "<string>", line 3, in dashboard File "/var/lib/python-support/python2.5/turbogears/identity/conditions.py", line 242, in require return fn(self, *args, **kwargs) File "/home/gml/cerise/0.8/CerisePGI/cerisepgi/controllers/root.py", line 80, in dashboard File "/usr/lib/python2.5/site-packages/sqlobject/sqlbuilder.py", line 381, in __getattr__ raise AttributeError("%s instance has no attribute '%s'" % (self.soClass.__name__, attr)) AttributeError: Invoice instance has no attribute 'enterprise' Hors ligne yris Re : Cerise 0.8 - TPE, freelances, artisans Tout se résout en installant la dernière version de SQLObject là: http://packages.ubuntu.com/fr/intrepid/ … t/download Hors ligne yanfox Re : Cerise 0.8 - TPE, freelances, artisans Bonsoir, je suis dans la panade également, j'ai voulu installer cerise 0.8 mais j'obtiens le même message d'erreur que cité plus haut : Warning: a circular reference was detected in the model. Unable to sort the classes by dependency: they will be treated in alphabetic order. This may or may not work depending on your database backend. The error was:Found a circular reference: Activity --> Enterprise --> Address --> Contact --> Company --> Contact j'ai suivi les instructions du wiki à la lettre mais rien 'y fait... j'ai également tenté de faire les manipulations décrites plus haut sans succès... j'ai cette fichue erreur lorsque je créé ma bdd. Merci de votre aide EDIT : Bon j'ai toujours le message d'erreur mais le script veux bien lancer à présent, je commence à m'immerger dans ce logiciel qui me semble très prometteur. Au bout de 3 minutes d'utilisation je suis quasi conquis, il ne manque plus qu'un peu de personnalisation dans tout ça et ça va être d'enfer EDIT 2 : je suis emballé quelques petites remarques qui serons j'espère utiles : - Au niveau de la gestion client, il serait bien d'avoir quelques champs supplémentaires genre mail, téléphone etc. - Toujours niveau client, j'en ai certains qui ont plusieurs sociétés, ça serait génial si il était possible d'avoir un client lié à plusieurs sociétés (avec différentes fonctions, numéro de téléphone... etc), ca éviterai les doublons. - Un peu plus de personnalisation sur l'apparence des devis/factures, genre un logo ou autre. Peux-être via un système de skin (?). L'ajout de quelques lignes en fin de factures telles que : règlement par chèque ou virement le matériel reste la propriété de "entreprise" jusqu'au paiement complet des sommes dues... - au niveau de l'aide au calcul de TVA, un affichage par mois ou trimestre serait bien Par ailleurs je voulais m'inscrire à la mailing list mais visiblement ele est en vrac pour le moment Félicitations pour ce bel outil qui a un bel avenir je pense Je vais d'ailleurs commencer a travailler en doublon avec mon système de facturation actuel histoire de m'y faire ! Dernière modification par yanfox (Le 27/11/2008, à 20:02) Hors ligne HKH Re : Cerise 0.8 - TPE, freelances, artisans hello j ai testé ce petit logiciel bien sympa. J avais la même erreur que Yris sous ubuntu Hardy 8.04.1 , résolu en installant la dernière version de SQLObject comme péconisé par Yris lui même...merci Un petit retour d'expérience : j ai consaté que le numéro de Devis contient la lettre "F" comme le numéro de Facture .. ? Au niveau de la gestion des produits , il serait peut etre pratique d'avoir un classement par catégorie voir sous catégorie..pour ceux qui ont plusieurs types de produits ( exemple d une entreprise multiservice) Peut etre que c est deja prévu pour la version future.. Vivement la version 0.9 qui ne devrait pas tarder ( vue sur le blog de GMLI ) Dernière modification par HKH (Le 22/12/2008, à 14:17) Hors ligne phil33 Re : Cerise 0.8 - TPE, freelances, artisans bonjour, comment entrer dans l'entreprise test, j'ai choisi benenuts et admin admin mais connection impossible ??
I’m writing a web app that includes, among other things, a good amount of (rational) non-integer numbers. Whenever I’m in this situation, and I’m using a language that supports Decimals (as opposed to just floats and doubles), I always wonder which one I should use. If you’re a programmer, you understand the difference and the dilemma. Floats/doubles are very fast, as all computers (built within the last 15 years) have hardware specifically made to deal with them. However, they’re not perfectly accurate; because of binary representation, numbers that we use a lot (like 1/10 or 0.1) cause the same problems that 1/3 (0.33333…) cause in base 10. Decimals, on the other hand, are slow. They are handled entirely in software, and thus take hundreds of instructions to do things that would take less than 10 with floats/doubles. The upside is that they’re perfectly accurate; 0.1 is 0.1 is 0.1. So the question becomes twofold: Do I really need my numbers to be perfectly accurate? How much slower are decimals than floats/doubles? In my case, the accuracy would be nice, but not completely necessary. And thus, the latter question becomes important. I’m not writing a large application, and I don’t expect it to get too popular too quickly, so if the slowdown is only moderate, I’ll take the accuracy. To learn what the slowdown was, I wrote two quick Python test programs: 1 2 3 4 5 6 7 from decimal import Decimal a = 0 for i in range(0, 20000): a = Decimal('%d.%d' % (i, i)) print(a) 1 2 3 4 5 6 7 8 from decimal import Decimal # kept this in on the float version # so they'd have the same overhead a = 0 for i in range(0, 20000): a = float('%d.%d' % (i, i)) print(a) When I ran each of these with /usr/bin/time (which I just learned about a couple weeks ago, and has replaced counting seconds on my fingers as my favorite benchmarking tool), the decimal version took an average of about 1.5 seconds (over 10 runs), while the float version took an average of 0.5. Just to make sure no overhead was getting in the way, I upped the limit to 40000 and ran it again. Decimal took 3.0 seconds, float 1.0. I can now confidently say that Python floats are about 3x the speed of Python decimals. Or are they? While this tests the creation and printing of decimals and floats, it doesn’t test mathematical operations. So, I wrote two more tests. I’m going to be doing a lot of division on these numbers, and that’s definitely the most expensive mathematical operation to compute, so I made sure to do it in the tests (along with some subtraction). 1 2 3 4 5 6 7 from decimal import Decimal a = 0 for i in range(2, 20002): a = Decimal('%d.%d' % (i, i)) / Decimal('%d.%d' % (i - 1, i - 1)) print(a) 1 2 3 4 5 6 7 from decimal import Decimal a = 0 for i in range(2, 20002): a = float('%d.%d' % (i, i)) / float('%d.%d' % (i - 1, i - 1)) print(a) This time, the float version averaged about 0.6 seconds (1.15 with 40,000 iterations instead of 20,000), while the decimal version averaged over 11 seconds (23 with 40,000 iterations instead of 20,000). So while Python float creation and printing is merely 3x as fast as Python decimal creation and printing, Python float division is almost 20x as fast as Python decimal division. So what did I choose? Decimals. In the context of these tests, the decimal slowdown may seem significant, but if I finished my app using decimals and profiled it, I can almost guarantee (based on the speeds here) that the bottleneck would not be decimal division performance. If I was running an app that was handling hundreds of simultaneous requests, I may consider switching (I may also spring for better hardware, but that’s a different topic). However, for my purpose, 1/20th the speed of floats is more than fast enough. P.S. As my very late discovery of /usr/bin/time should suggest, I’m extremely new to benchmarking. If anyone has any suggestions for me, or criticisms of my method, please leave your thoughts. This is something I’d like to get better at.
I'm having issue with arranging code to make it easily testable. I have 2 major modules in my code: cache generator and modifier builder, both have approximately the same level of complexity. Modifier builder is used in one of the methods of child objects of cache generator. I already have full test suite which covers functionality of modifier builder. I want to add tests which cover all functionality of cache generator, but in order to significantly reduce complexity of these tests, i need to replace modifier builder with some stub, which returns predefined 'canned data' based on the arguments i passed to it. My actual problem lies within the choosing the way of replacing real modifier builder with stub, which looks good code-wise and which is still convenient for testing. Take a look at following code: Code from GitHub: cacheGenerator / generator.py: class CacheGenerator: def __init__(self, logger): ... self._converter = Converter(logger) def run(self, dataHandler): ... data = self._converter.convert(data) cacheGenerator / converter.py: class Converter: ... def convert(self, data): ... self._buildModifiers(data) def _buildModifiers(self, data): ... builder = ModifierBuilder(data['expressions'], self._logger) ... modifiers, buildStatus = builder.buildEffect(...) What are the ways of replacing modifier builder with stub? I suppose at least next few variants exist: Changes to code: Instantiate modifier builder in converter's init() and assign its instance as object attribute. For testing - make subclass of real converter, overridinginit(), where we substitute real modifier builder with stub, then subclassing cache generator, replacing real converter with subclassed one in similar way. However, such approach will require modification of modifier builder: i will need to split data loading frominit() method, which is undesirable Like 1), but move parts of Converter()._buildModifiers() method, which work with modifier builder, to separate methods to make them easily overriddable Like 1), but specify just modifier builder class (not instance) in cleaner's init(). This allows us to keep modifier builder as-is. Passing modifier builder class from the very top of cache generator (so that class we need to replace for testing is controllable by cache generator instantiation) Any other variants exist? Like some import magic? Some of variants among 1-4 look acceptable, but ideally I'd like to keep code as close as possible (to original), so I'm investigating alternative ways of stub'bing child objects.
I have a python script which needs to execute several command line utilities. The stdout output is sometimes used for further processing. In all cases, I want to log the results and raise an exception if an error is detected. I use the following function to achieve this: def execute(cmd, logsink): logsink.log("executing: %s\n" % cmd) popen_obj = subprocess.Popen(\ cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) (stdout, stderr) = popen_obj.communicate() returncode = popen_obj.returncode if (returncode <> 0): logsink.log(" RETURN CODE: %s\n" % str(returncode)) if (len(stdout.strip()) > 0): logsink.log(" STDOUT:\n%s\n" % stdout) if (len(stderr.strip()) > 0): logsink.log(" STDERR:\n%s\n" % stderr) if (returncode <> 0): raise Exception, "execute failed with error output:\n%s" % stderr return stdout "logsink" can be any python object with a log method. I typically use this to forward the logging data to a specific file, or echo it to the console, or both, or something else... This works pretty good, except for three problems where I need more fine-grained control than the communicate() method provides: stdout and stderr output can be interleaved on the console, but the above function logs them separately. This can complicate the interpretation of the log. How do I log stdout and stderr lines interleaved, in the same order as they were output? The above function will only log the command output once the command has completed. This complicates diagnosis of issues when commands get stuck in an infinite loop or take a very long time for some other reason. How do I get the log in real-time, while the command is still executing? If the logs are large, it can get hard to interpret which command generated which output. Is there a way to prefix each line with something (e.g. the first word of the cmd string followed by :).
UPDATE: 2.x support is now mainline! Please read the wiki page for important information about the update. A warm welcome to you, traveller. You have arrived at the home of Py-StackExchange, the library definitively proven† to be the best library for using the SE API from Python. If you are still interested (and by golly, you should be) after glancing at the masterpiece below, please check the wiki on Github. † Ahem. About So, what is Py-StackExchange? Well, I'm glad you asked. It is a Python library for querying the StackExchange API from your Python applications. Integration, ahoy! So why should you use it? After all, the SE API is sooo simple that you might think it'd be quicker to just write your own, and that it'd be faster and you wouldn't have to look at all that documentation and do all that thinking... well: Let's start with the API coverage - what can the API do? And, more importantly, what can the library do? Access any StackExchangesite, with just its URL! Even those that aren't online yet! If you just can't decide which one to use, you can use StackAuthto look up the full list of sites. Once you're online, you can view everything about users,questions,answers,badges,commentsandtags. You can even go back in time by playing with post revisions. StalkGenerate a detailed profile of a user's lifeHelp users by looking upevery StackExchange account they have. Every single one. And, on any of those sites, peruse a detailed history of everything they've ever done - every edit, every comment, every time they were awarded a badge... Watch StackOverflow become the new Facebook overnight with the timelinefeature. See how well an SE site is doing; obsessively check its site statistics. Searchthe questions of StackExchange sites. So, why not write your own classes to consume said pure, concentrated brilliance? Let someone else deal with all that laborious HTTP request business... you know you want to... All the little idiosyncratic potholes on your road to API happiness have been filled in for you. We have little elves which jump into your code and parse your JSON and your dates and your lists until every response is itself a little baby python. URLs change 99.9% more often than the interface of this module. Fact. It's faster than Michael Palin on a broken bicycle. It also knows about request throttling, so when it gets too fast for its own good, it applies the brakes just enough to restore order. It loads lazily information that would take another request to fetch, meaning you never use more of your limit than you need to. It caches requests automatically, so you need to care slightly less about writing efficient code! (new in 1.1) Now, onto the religious advantages: Documentation? Bah, we have naming conventions. (This feature was inspired by Rails.) Pssst- don't tell anyone, but there is documentation too, if that's your style. (README/Wiki) Naming conventions? Who needs them? Wehave an interactive program that writes your code for you while you look around the StackExchange site of your choice. (This feature was inspired by Jon Skeet.) Almost-sentient, artificially intelligent programming programs? Ugh, how 20thcentury. There are metric heaps of example code available in the source repo, a small excerpt of which is presented below for your viewing pleasure. Please note: This is not an official product of Stack Overflow Internet Services, Inc. Code Snippet #!/usr/bin/env python # a hack so you can run it 'python demo/stats.py' import sys from stackauth import StackAuth from stackexchange import Site, StackOverflow user_id = 41981 if len(sys.argv) < 2 else int(sys.argv[1]) print 'StackOverflow user %d\'s accounts:' % user_id stack_auth = StackAuth() so = Site(StackOverflow) accounts = stack_auth.associated(so, user_id) reputation = {} for account in accounts: print ' %s: %s / %d reputation' % (account.display_name, account.on_site.name, account.reputation) reputation[account.reputation] = account.on_site.name print 'Most reputation on: %s' % reputation[max(reputation)] Or how about a scrolling list of questions? import stackexchange so = stackexchange.StackOverflow() for q in so.questions(pagesize=50): print q.title About This is a Python library/wrapper around the StackExchange and StackAuth APIs. It provides a clean, object-oriented API for accessing the various sites. License The script is licensed under the Simplified BSD license. You can find the full text of the license here, but the gist of it is that: You need to give attribution when you distribute (compiled or in source form) the library - not your application unlessyou include the library files `in the box'. The standard "NO WARRANTY" (in caps!) is provided. Other than that you can more or less do what you like! Download In the bad old days (i.e. about 2 hours before I wrote this), you had to manually install Py-StackExchange after cloning the Git repository. You can still do this: http://github.com/lucjon/Py-StackExchange. You can also download a ZIP or TGZ file from there. However, there is a new and improved way to get Py-StackExchange: you can install it straight from the PyPI! Just type: ~$ easy_install py-stackexchange Also, distutils gives me fantastical benefits on the side, such as a completely original Windows installer with an all-new design. You can also find a stable source distribution on the downloads page @ Github. Platform The library is written in standard Python 2.6, with, as far as I am aware, no specific platform dependency. As long as your Python install has the full standard library available, it should work fine. Python 2.6 is required for the json module. (EDIT: @ADB in the comments has noted that the SimpleJson library can be used instead. This means it works on Python 2.5 and also on the Google App Engine.) Python 3.x is also supported.
On the link that contains 'alpha' in the URL has many links(hrefs) which I would like to collect from 20 different pages and paste onto the end of the general url(second last line). The href are found in a table which class is mys-elastic mys-left for the td and the a is obviously the element which contains the href attribute. Any help would greatly be appreciated for I have been working at this for about a week. for i in range(1, 11): # The HTML Scraper for the 20 pages that list all the exhibitors url = 'http://ahr13.mapyourshow.com/5_0/exhibitor_results.cfm?alpha=%40&type=alpha&page=' + str(i) + '#GotoResults' print url list_html = scraperwiki.scrape(url) root = lxml.html.fromstring(list_html) href_element = root.cssselect('td.mys-elastic mys-left a') for element in href_element: # Convert HTMl to lxml Object href = href_element.get('href') print href page_html = scraperwiki.scrape('http://ahr13.mapyourshow.com' + href) print page_html
After configuring and installing IPython to run under python3, as explained by this wiki, and having completed all the steps, I still get: gmask@Gbuntu:~$ ipython3 qtconsole No command 'ipython3' found, did you mean: Command 'ipythonx' from package 'ipython' (universe) Command 'ipython' from package 'ipython' (universe) Command 'python3' from package 'python3-minimal' (main) ipython3: command not found No idea what I am doing wrong...
Let’s start with something easy. Here’s the mirepoix bar = "chicken" You know single quotes and double quotes, right? These are our salt and pepper. 'frickin #{bar}' # => "frickin #{bar}" "frickin #{bar}" # => "frickin chicken" Have you seen %%q and %%Q? %%q(frickin #{bar}) # => "frickin #{bar}" %%Q(frickin #{bar}) # => "frickin chicken" %%q{frickin #{bar}} # => "frickin #{bar}" %%Q{frickin #{bar}} # => "frickin chicken" You’ve also seen “”” (triple-quotes) right? """frickin #{bar}""" # => "fricken chicken" """frickin '#{bar}'""" # => "fricken 'chicken'" """frickin "#{bar}"""" # => "fricken " UPDATE: As John points out in the comments, in addition to triple quotes there are also quintuple quotes, septuple quotes, and so forth. In fact, you can invent your own quoting operator for any odd number of quotes. (Just kidding.) The truth is, singly and doubly-quoted object concatenate simply by juxtaposition! "frickin " "chicken" # => "fricken chicken" 'frickin ' 'chicken' # => "fricken chicken" "frickin " bar # => kabooom! %%q{frickin } %%q{chicken} # => kablooey! """" #=> "" """frickin chicken" # => "frickin chicken" Hokay. So that is all child’s play. These are the quoting operators for the big boys. This is why Ruby’s Grammar is not Context-Free: def foo(x) x.reverse end foo(<<-EOS) Your mom EOS # => "mom ruoY" foo(<<-EOS).reverse amanaplanacanalpanama EOS # => "amanaplanacanalpanama" Even better: puts(DATA.read.reverse) __END__ Your mom # => "mom ruoY" You actually have to copy the above code into a ruby file and run it — it wont work in IRB.
xxkirastarothxx Re : MegaUpload : BotMU v1.0.1 Tucan a l'avantage de gérer les captcha pour les services qui en ont (enfin... un popup s'ouvre avec l'image, et l'utilisateur doit saisir lui même le texte) Aaah ok c'est comme ça qu'il fait. Par-ce que j'ai déjà essayé de pété des capcha avec des OCR, pour certains ça fonctionne, mais pour les capcha "recapcha" (de google de crois) j'ai jammais reussis a le passer automatiquement. Mais alors, quel interet par rapport a un navigateur web, puisque de coup je suppose que tant que le capcha est pas rentré manuellement les téléchargements sont en attente !? ah oui! au fait: j'adore le logo/icone (fan de SW) Merci lol ^^ C'est le premier truc qui m'est passé par la tête en pensant à un robot alors... Hors ligne loubrix Re : MegaUpload : BotMU v1.0.1 Par-ce que j'ai déjà essayé de pété des capcha avec des OCR, pour certains ça fonctionne, mais pour les capcha "recapcha" (de google de crois) j'ai jammais reussis a le passer automatiquement. Mais alors, quel interet par rapport a un navigateur web, puisque de coup je suppose que tant que le capcha est pas rentré manuellement les téléchargements sont en attente !? c'est ça, chaque fois qu'un téléchargement se termine, il faut saisir le captcha du suivant, donc être devant l'écran (ce qui fait perdre tout l'intéret de se genre de soft). c'est pour ça que je préfère MU... de toute façon te casse pas la tête: les captcha sont conçus justement pour qu'aucun logiciel ne puisse les lire; à chaque fois qu'on fait des progrès dans la reconnaissance de caractère, les captcha sont complexifiés (si bien que c'est même devenu difficile de les lire avec un oeil humain): c'est une guerre sans fin... à mon avis la faille doit se situer dans la partie accès au déficient visuel, parce que je crois qu'une bibliothèque de reconnaissance vocale doit faire l'affaire (mais peut-être que je m'égare). mais il vaut mieux se concentrer sur les services qui n'ont pas de captcha, et l'ajout de la gestion du compte premium (et là le code de Tucan doit pouvoir t'aider). Hors ligne xxkirastarothxx Re : MegaUpload : BotMU v1.0.1 Update: Mise à jour 1.0.1 Disponible n'hesitez pas a me prévenir si vous rencontrez des bugs (vu l'urgence je n'ai pas eu le temps de trop pousser les tests avant de publier) /* ------------ Changelog ------------- */ Mise à jour plateforme MegauploadAjout de la convertion en mp3 sur la platforme Youtube Ajout d'une fenêtre popup plus complete pour l'ajout de fichier Fenêtre d'options avancées Fonction Up et Down Focus du fichier nouvellement ajouté Rennome les fichier de façon "Fichier-1", "Fichier-2" tant que ce fichier existe déjà Couleur des progress bars en fonction du status: -> rouge: stop/erreur -> bleu: attente/téléchargement -> vert: terminé Correction bug d'alerte lorsque le programme était minimisé Correction de l'annulation pendant la récupération des noms de fichier Correction de la récupération des nom de fichier auto (nommé automatiquement "lien invalide" par exemple) Correction du bug lors du lancement du téléchargement si le disque n'existe pas/n'est pas monté /* ---------------------------------------- */ Bon téléchargements à tous Dernière modification par xxkirastarothxx (Le 16/12/2011, à 17:02) Hors ligne loubrix Re : MegaUpload : BotMU v1.0.1 Bon ben on va tester; ça tombe bien, j'ai des trucs à aller chercher sur MU... Edit: ça a l'air de fonctionner; j'ai téléchargé 2 fichiers sur MU sans problème... juste je comprenais pas pourquoi le deuxième avait été renommé "-1." (sans extension), alors que le premier portait son vrai nom, mais en lisant le changelog, j'ai compris (quoique c'est bizarre qu'il aie su récupérer le nom du premier fichier et pas du deuxième). sinon, deux ou trois remarques (que j'espère constructives): -la barre d'avancement du bas: avant de m'en servir, je pensais qu'elle allait faire une synthèse de tous les téléchargements, mais en fait, elle est calquée sur celle de chaque fichier, et du coup, ne sert pas à grand chose et fait doublon. -en parlant de doublons, les boutons "départ" et "stop" en bas font doublons avec ceux de la barre d'outils. -j'allais faire remarquer que les tooltips sont illisibles (blancs sur jaune-clair), mais c'est vrai que BotMU est en Qt, et qu'il doit falloir paramètrer l'intégration au sein de Gnome-Unity (ce que je n'ai pas encore fait). -dans le changelog, tu parles d'une fenêtre "options avancées", mais je la trouve pas (dans "préférences", je n'ai que 4 onglets: "général", "megaupload", "youtube" et "classique"). voilà, je n'ai que des bricoles à te rapporter; dans l'ensemble, soft génial, qui fait ce qu'on lui demande sans sourciller... j'ai déjà viré Tucan de mon dock (mais je le garde pour le cas où je suis obligé d'utiliser un autre service que MU), et si tu as besoin d'aide pour la suite, demande... Dernière modification par loubrix (Le 16/12/2011, à 21:57) Hors ligne atichu Re : MegaUpload : BotMU v1.0.1 Bon va faloir torturé le programme... 3 nouvelle dépendance^..^ il a un probléme de detection des liens.. j'ai detecté 1lien après il ne veut plus en detecté. j'ai redémarré sa semble marché^^. j'ai fait une mise à jour.. je suis sous précise^^.. pour le moment rien a dire. j'ai rentré un lien en manuel en mettant auto en nom il a cherché le nom Dernière modification par atichu (Le 16/12/2011, à 22:07) Je ne suis pas un geek ni un informaticien mais j'aime linux/ubuntu. acer aspire5741G (unity 12.04))+une vieillebousse(xfce 12.04) +teste de la version instable Hors ligne xxkirastarothxx Re : MegaUpload : BotMU v1.0.1 Alors, pour le problème de renommage, j'avoue que la fonction est un peu jeune, et je n'ai pas eu trop le temps de la tester encore, je reverrai ça pour la prochaine update ^^ La barre, je l'ai simplement laissée Enfait, au début du programme il n'y avait pas de barre de téléchargement par fichier mais seulement cette barre principale; mais l'idée d'en faire une barre de progression générale est sympa, je garde ça dans un coin Pour les boutons, tu suggères de supprimer ceux de la toolbar ? J'avoue que le "doublon" ne me gène pas spécialement ici; à voir ce qu'en pensent d'autres = ) Sinon, Les "options avancées" sont justement ces quatre fenêtres qui permettent de gérer chaque plateforme indépendamment ; avant ça il n'y avait que l'onglet général. C'est vrai que pour les nouveaux utilisateurs je me suis mal exprimé ^^ Et pour les tooltips merci beaucoup, je n'avais encore aucune idée de pourquoi ça plantait, puisque sur ma debian, ma vm xp et ubuntu (10.04) ça fonctionne bien. Maintenant j'ai une piste à explorer 3 nouvelle dépendance^..^ Et oui ^^ j'ai pas le code sous les yeux mais de mémoire, y'a ffmpeg pour la conversion mp3, chardet pour une meilleur gestion de l'encodage du presse-papier, et je me demande si j'ai pas laisser la 3ème par erreur lors de mes test pour la conversion en mp3 ; ou sinon c'est une dépendance nécessaire pour ffmpeg, il faut que je vérifie ça je sais plus trop xD. Et sinon, pour fini j'ai pus trouver (encore :'( lol) quelques bugs, comme une erreur 416 qui se place de temps en temps, peux être un mauvais calcul de ma part sur la plage de bits lors de la reprise d'un téléchargement. Et je me demande également si l'updater ne déconne pas, mais bon ça ne concerne pas les utilisateurs de linux ^^' Merci bien pour toutes ces petites remarques qui me permettront d'avancer plus vite Hors ligne atichu Re : MegaUpload : BotMU v1.0.1 je confirme au boud d'un certain temps sur précise il veut plus ajouté de lien.. faudrai que je teste sur maverick et onerick hybride:p Dernière modification par atichu (Le 18/12/2011, à 01:34) Je ne suis pas un geek ni un informaticien mais j'aime linux/ubuntu. acer aspire5741G (unity 12.04))+une vieillebousse(xfce 12.04) +teste de la version instable Hors ligne JLK Re : MegaUpload : BotMU v1.0.1 Donc BotMU, c'est un Jdownloader mais Java en moins, et donc plus réactif et beaucoup moins boufficiel, si je comprends bien ? Hors ligne helly Re : MegaUpload : BotMU v1.0.1 Ho le vilain troll ^^. Hors ligne loubrix Re : MegaUpload : BotMU v1.0.1 Pour les boutons, tu suggères de supprimer ceux de la toolbar ? J'avoue que le "doublon" ne me gène pas spécialement ici; à voir ce qu'en pensent d'autres = ) Pourquoi pas ? ça libèrerait de la place, pour, par exemple, agrandir la taille de la fenêtre de download... Et pour les tooltips merci beaucoup, je n'avais encore aucune idée de pourquoi ça plantait, puisque sur ma debian, ma vm xp et ubuntu (10.04) ça fonctionne bien. chez moi, ça ne plante pas, il y a juste un problème de couleur qui les rend illisible, mais je pense qu'il faudrait suivre un tuto dans ce genre pour régler ça... pour le problème de renommage, j'avoue que la fonction est un peu jeune, et je n'ai pas eu trop le temps de la tester encore, je reverrai ça pour la prochaine update il faudrait au moins que l'extension soit conservée (en pensant au type qui a téléchargé une video, mais n'a pas vu qu'elle était dans un zip). je pense aussi au gars qui a téléchargé les 24 épisodes de sa série préférée: pour peu qu'il n'aie pas ajouter les liens dans l'ordre, il va ramer pour trier... Donc BotMU, c'est un Jdownloader mais Java en moins, et donc plus réactif et beaucoup moins boufficiel, si je comprends bien ? autant faire plus léger que Jdownloader me semble simple, autant faire plus lourd frôle l'impossible (quitte à troller, hein ) plus sérieusement, ce n'est pas comparable: Jdownloader est une usine à gaz qui peut (presque) tout faire, BotMU se contente (pour le moment) de Megaupload, Youtube, et les téléchargements classiques; à chacun de décider de ce dont il a besoin... Hors ligne atichu Re : MegaUpload : BotMU v1.0.1 une question^^ botmu pourrai vérifié si la taille final correspond a celle de départ? non car la j'ai des 100% alors que j'ai même pas 10% des fichier.. Je ne suis pas un geek ni un informaticien mais j'aime linux/ubuntu. acer aspire5741G (unity 12.04))+une vieillebousse(xfce 12.04) +teste de la version instable Hors ligne xxkirastarothxx Re : MegaUpload : BotMU v1.0.1 Donc BotMU, c'est un Jdownloader mais Java en moins, et donc plus réactif et beaucoup moins boufficiel, si je comprends bien ? Je pense que loubrix a bien répondu, je n'ai pas encore parcouru l'étendue des possibilités de Jdownloader mais je suis certain qu'il des fonctionnalités que BotMU ne reprendra sûrement jamais. Simplement par-ce que je compte bien à ce que BotMU reste une logiciel léger. Déjà en utilisant Python plutôt que Java, je pense être sur la bonne voie ^^' (quoi ? on à tous le droits de troller un tout petit peu ) ; ça aurais sûrement été encore mieux en C/C++ mais je n'y connais strictement rien donc... Une autre raison est que je suis seul à programmer sur ce projet, en tout cas pour le moment, et qu'il y a de nombreuse fonctionnalités qui me prendraient un temps pas possible à reproduire, et ceci n'était pas le but de mon logiciel ^^ A la base je voulais simplement me faire un petit robot pour megaupload, et en profiter pour le partager. Par la suite de nombreuses idées m'ont plues et je les aies ajoutées petit à petit; et d'autres viendrons encore, vu comme c'est parti Donc, en bref, tout est une question de choix: performance VS fonctionnalités @loubrix: Merci pour le lien,. J'ai commencé à le lire, mais ça à l'air de plutôt être des manip à faire coté utilisateur non ? enfin y'a des infos intéressantes quand même. En tout cas maintenant que je sais d'où viens le problème je vais voir si j'arrive à régler ça. Et pour le renommage, je fais ça ^^ une question^^ botmu pourrai vérifier si la taille final correspond à celle de départ? non car la j'ai des 100% alors que j'ai même pas 10% des fichier... Bah, ça je pensais le faire pour la dernière mise à jour, mais vu que megaupload à changé son interface j'ai pas eu le temps de le faire ^^ Prochainement, donc = ) Dernière modification par xxkirastarothxx (Le 19/12/2011, à 12:42) Hors ligne loubrix Re : MegaUpload : BotMU v1.0.1 J'ai commencé à le lire, mais ça à l'air de plutôt être des manip à faire coté utilisateur non ? enfin y'a des infos intéressantes quand même. bien sûr, c'est à l'utilisateur de gérer l'intégration les applications Qt dans son environnement Gtk; ceci dit, même en suivant les indications, rien à faire, les tooltips sont toujours de la mauvaise couleur... edit: téléchargement de 9 videos, voici ce que j'ai à la fin: david@phobos:~$ ls ~/Téléchargements/ -1. -1-2-3. -1-2-3-4-5. -1-2-3-4-5-6-7. -1-2-3-4-5-6-7-8-9. -1-2. -1-2-3-4. -1-2-3-4-5-6. -1-2-3-4-5-6-7-8. si je comprends bien le code (mais Python et moi pas trop copains), les fichiers ne devraient être renommés que s'ils existent déjà dans le répertoire de destination, mais là en fait, il renomme s'il y a déjà un fichier dans le rep, sans se soucier de son nom, donc le problème semble venir de là (megaupload.py): if continuedl==0: nbFile = 0 while os.path.exists(os.path.join(self.parent.destination, dest)): nbFile+=1 if len(dest.split("."))>0: filename = str("".join(dest.split(".")[0:-1])) ext = str("".join(dest.split(".")[-1])) dest = "%s-%s.%s" % (filename, nbFile, ext) else: dest = "%s-%s" % (dest, nbFile) self.filename = dest ce serait pas "nbFile = 0" le problème ? Dernière modification par loubrix (Le 20/12/2011, à 23:32) Hors ligne xxkirastarothxx Re : MegaUpload : BotMU v1.0.1 C'est assez bizzare quand même: chez moi la foncion de renommage déconne effectivement, mais pas a ce point: moi il me renomme mes fichiers "nomdufichier-1-1-1.ext" alors que chez toi, la variable "dest" à l'air vide Y'avait le même problème dans Youtube.py Mais je te rassure j'ai déjà réglé le problème (je dois encore tester un peu), ainsi que celui des tooltips (simplement en forçant la couleur ) Si vous voyez d'autres bugs urgents, c'est le moment, sinon je publie une correction de mise à jours d'ici quelques jours. [HS] Et pour continuer dans un légé hs: Python c'est cro biiieenn ^^' J'ai toucher à pas mal de langage, et Python est vraiment celui qui ma taper dans l'oeil: c'est l'un des rares langages avec lequel, sans aucun notions de celui ci, j'ai tout de même réussis a tout comprendre très facilement. En plus de ça, le système de syntaxe est geniale je trouve, puisque l'indentation est une obligation; donc même quand on tombe sur un code d'un mec qui sait pas coder, le code reste propre, et ça c'est que du bonheur Par contre, la librairie graphique Qt ma saouler xD [/HS] Dernière modification par xxkirastarothxx (Le 21/12/2011, à 11:30) Hors ligne atichu Re : MegaUpload : BotMU v1.0.1 mega on encore changé les temps d'attente...^^ j'ai du 10 seconde parfois Je ne suis pas un geek ni un informaticien mais j'aime linux/ubuntu. acer aspire5741G (unity 12.04))+une vieillebousse(xfce 12.04) +teste de la version instable Hors ligne loubrix Re : MegaUpload : BotMU v1.0.1 effectivement, j'ai même eu 5 secondes ce matin... par contre, mes problèmes de renommage de fichier ont cessé, bizarrement: maintenant, tout arrive avec le bon nom... Hors ligne xxkirastarothxx Re : MegaUpload : BotMU v1.0.1 Ouais j'ai eu l'occasion de m'en rendre compte. Sur la dernière update j'ai laissé à 65sec par défaut, c'est le max je crois; mais dans la prochaine version je verrai a récupérer le vrai temps d'attente. Sinon j'ai réussis à ajouter Rapidshare qui serra donc dans la prochaine release. par contre, mes problèmes de renommage de fichier ont cessé, bizarrement: maintenant, tout arrive avec le bon nom... Peut etre une instabilité temporaire de megaupload... je t'avoue que je ne suis pas encore tombé sur ton problème. Dans tout les cas la fonction de renommage de fichier a été complètement remodelée. Bonne année à tous. Dernière modification par xxkirastarothxx (Le 03/01/2012, à 18:07) Hors ligne kboo Re : MegaUpload : BotMU v1.0.1 Coucou, après avoir essayé pendant une bonne semaine ce soft, je me suis résigner à en utiliser un autre: quelque plantages (rien de méchant) mais surtout des téléchargement fini à 100% alors qu'il n'y a rien dans le répertoire.... j'ai beau chercher si j'ai pas fait une mauvaise manip mais rien à faire ---> out Je reviendrai quand ça marchera mieux (aussi bien que JDownloader ça serai bien ! même si ça fonctionne que pour MU) Bon courage Hors ligne xxkirastarothxx Re : MegaUpload : BotMU v1.0.1 Salut, Tant pis, je comprends, snif ^^ je dois admettre que j'ai eu tendance à publier trop rapidement mes patchs; surtout avec la dernière, du fait de la modification de l'interface de Megaupload. J'ai faillis refaire la même bêtise dernièrement, mais, cette fois, je vais attendre avant de mètre en ligne la prochaine version. Histoire de faire une bonne grosse batterie de test. il faut aussi que j’approfondisse ma connaissance en SVN afin de pouvoir faire deux branches différentes de mon soft (sable et test) Je pense également mètre en place un système d’envoi de log, avec accord de l'utilisateur évidement, afin de faciliter le debug. en attendant, kboo, si tu as encore ton /home/[user]/.BotMU/botmu.log, pourrais tu le poster ? Voila, j’espère que la prochaine édition pourra satisfaire plus de monde. Dans tout les cas, merci pour ton retour. Hors ligne atichu Re : MegaUpload : BotMU v1.0.1 botmu au placard XD enfin l'onglet mega XD Je ne suis pas un geek ni un informaticien mais j'aime linux/ubuntu. acer aspire5741G (unity 12.04))+une vieillebousse(xfce 12.04) +teste de la version instable Hors ligne Siap Re : MegaUpload : BotMU v1.0.1 Salut, xxkirastarothxx te prend pas trop la tête quand même: http://trucbuntu.wordpress.com/2012/01/ … disparait/ t'as le temps maintenant pour publier les patchs Hors ligne xxkirastarothxx Re : MegaUpload : BotMU v1.0.1 ,-------. / ,' `. ,--' ,' `. ,-;-- _.- pow! / \ ---;-' _.=.---'' +-------------+ ; X X ---=-----'' _.------- | ----- |--| \-----=---:i- +XX|'i:'''''''' : ;`--._ ''---':---- /X+-) \ / ''--._ `- .XXX|) `. ____ ,' ''---. X\/) `. ,' `- \ `---+---' \ | \. | `-------------------+ edit: ... heureusement que j'ai intégré rapidshare (et peut etre mediafire) dans la prochaine version (tant pis pour la surprise ^^''') Dernière modification par xxkirastarothxx (Le 20/01/2012, à 10:29) Hors ligne JLK Re : MegaUpload : BotMU v1.0.1 Que devient BotMU depuis que les gros serveurs sont atteint de panique ? Hors ligne xxkirastarothxx Re : MegaUpload : BotMU v1.0.1 Salut, Et bien pour le moment le logiciel est plus ou moins mort, bien qu'il fonctionne toujours pour youtube; le but principale était tout de même megaupload ^^ Donc, J'attends un peu que ça ce calme histoire de voir qui reste, de plus que pas mal de site en on profité pour changer leur fonctionnement interne/scripts. Une fois que tout serra stabilisé je compte bien le remettre en route. A l'heure actuelle, j'ai prévu d'ajouter rapidshare et mediafire (disponible sur la version svn) mais ça ne fonctionne pas très bien (surtout mediafire, puisque de temps à autre il y a un capcha), pas pour tout les liens, et j'ai l'impression que ça déconne complètement sur windows alors que mieux sous Linux... comprends pas trop pourquoi Pour ceux qui voudraient tester: mkdir botmu_svn svn co https://botmu.svn.sourceforge.net/svnroot/botmu botmu_svn cd botmu_svn python BotMU.py je bosse dessus donc vous aurez la dernière version en cours, mais c'est pas forcement stable ^^ Dernière modification par xxkirastarothxx (Le 03/02/2012, à 11:44) Hors ligne
fffredo traduction française (résolu) Bonjour la communauté, je suis sous kde 4.12.1 et ubuntu 13.10. Tout marche bien sur ma monture depuis un bon moment et là d'un coup j'ai kickoff qui passe en anglais tout comme libreoffice et les menus clic droit ???? j'ai bien depuis longtemps les paquets de langue installé (je les ai même enlever puis purgés et réinstallés) kde l10n-fr et language pack base fr et toujours de l'anglais. quelqu'un a t il eut le même souci ? merci de me dire svp Dernière modification par fffredo (Le 16/02/2014, à 17:09) kubuntu 14.04 (64 bits) / kde 4.13 / 3Go RAM / AMD 64 / sous GNU/linux depuis 2010 Hors ligne nam1962 Re : traduction française (résolu) Mon tuto pour optimiser / finaliser une install : http://forum.ubuntu-fr.org/viewtopic.ph … #p15041961 Xubuntu 14.10 sur portable, 14.04 sur fixe, 14.04 chez mes amis. Score : 49 convertis IRL (leur ai pas donné le choix, aussi...). Un jeune site que j'aime bien, qui fait du T-shirt la nouvelle élégance ...bio en plus : http://goudronblanc.com En ligne fffredo Re : traduction française (résolu) merci nam1962 tu as répondu vite et j'ai tout de suite essayé mais non pas marché je viens de redemarrer et idem, je cherche encore merci d'avoir essayé kubuntu 14.04 (64 bits) / kde 4.13 / 3Go RAM / AMD 64 / sous GNU/linux depuis 2010 Hors ligne nam1962 Re : traduction française (résolu) Peux tu donner le retour de sudo apt-get update sudo apt-get dist-upgrade Mon tuto pour optimiser / finaliser une install : http://forum.ubuntu-fr.org/viewtopic.ph … #p15041961 Xubuntu 14.10 sur portable, 14.04 sur fixe, 14.04 chez mes amis. Score : 49 convertis IRL (leur ai pas donné le choix, aussi...). Un jeune site que j'aime bien, qui fait du T-shirt la nouvelle élégance ...bio en plus : http://goudronblanc.com En ligne fffredo Re : traduction française (résolu) voilà apt-get update: Ign http://download.tuxfamily.org saucy InRelease Hit http://deb.playonlinux.com precise InRelease Ign http://fr.archive.ubuntu.com saucy InRelease Ign http://archive.canonical.com saucy InRelease Ign http://extras.ubuntu.com saucy InRelease Get:1 http://download.tuxfamily.org saucy Release.gpg [198 B] Ign http://ppa.launchpad.net saucy InRelease Ign http://dl.google.com stable InRelease Ign http://fr.archive.ubuntu.com saucy-updates InRelease Ign http://fr.archive.ubuntu.com saucy-backports InRelease Hit http://archive.canonical.com saucy Release.gpg Ign http://repository.mein-neues-blog.de:9000 InRelease Ign http://ppa.launchpad.net saucy InRelease Get:2 http://download.tuxfamily.org saucy Release [4037 B] Get:3 http://extras.ubuntu.com saucy Release.gpg [72 B] Hit http://fr.archive.ubuntu.com saucy Release.gpg Ign http://ppa.launchpad.net saucy InRelease Hit http://archive.canonical.com saucy Release Hit http://extras.ubuntu.com saucy Release Get:4 http://fr.archive.ubuntu.com saucy-updates Release.gpg [933 B] Hit http://repository.mein-neues-blog.de:9000 Release.gpg Ign http://ppa.launchpad.net saucy InRelease Hit http://fr.archive.ubuntu.com saucy-backports Release.gpg Ign http://ppa.launchpad.net saucy InRelease Hit http://repository.mein-neues-blog.de:9000 Release Hit http://fr.archive.ubuntu.com saucy Release Ign http://security.ubuntu.com saucy-security InRelease Ign http://ppa.launchpad.net saucy InRelease Get:5 http://fr.archive.ubuntu.com saucy-updates Release [49.6 kB] Hit http://ppa.launchpad.net saucy Release.gpg Ign http://ppa.launchpad.net saucy Release.gpg Hit http://deb.playonlinux.com precise/main amd64 Packages Hit http://dl.google.com stable Release.gpg Hit http://fr.archive.ubuntu.com saucy-backports Release Hit http://security.ubuntu.com saucy-security Release.gpg Ign http://ppa.launchpad.net saucy Release.gpg Hit http://deb.playonlinux.com precise/main i386 Packages Get:6 http://download.tuxfamily.org saucy/cairo-dock amd64 Packages [5921 B] Hit http://ppa.launchpad.net saucy Release.gpg Hit http://ppa.launchpad.net saucy Release.gpg Hit http://dl.google.com stable Release Get:7 http://download.tuxfamily.org saucy/cairo-dock i386 Packages [5942 B] Hit http://ppa.launchpad.net saucy Release.gpg Hit http://archive.canonical.com saucy/partner Sources Hit http://security.ubuntu.com saucy-security Release Hit http://archive.canonical.com saucy/partner amd64 Packages Hit http://ppa.launchpad.net saucy Release Hit http://extras.ubuntu.com saucy/main Sources Hit http://archive.canonical.com saucy/partner i386 Packages Ign http://ppa.launchpad.net saucy Release Hit http://extras.ubuntu.com saucy/main amd64 Packages Ign http://ppa.launchpad.net saucy Release Hit http://repository.mein-neues-blog.de:9000 Packages Hit http://extras.ubuntu.com saucy/main i386 Packages Hit http://ppa.launchpad.net saucy Release Hit http://fr.archive.ubuntu.com saucy/main Sources Hit http://ppa.launchpad.net saucy Release Hit http://fr.archive.ubuntu.com saucy/universe Sources Hit http://ppa.launchpad.net saucy Release Hit http://fr.archive.ubuntu.com saucy/restricted Sources Hit http://fr.archive.ubuntu.com saucy/multiverse Sources Hit http://fr.archive.ubuntu.com saucy/main amd64 Packages Ign http://download.tuxfamily.org saucy/cairo-dock Translation-en Ign http://deb.playonlinux.com precise/main Translation-en Hit http://fr.archive.ubuntu.com saucy/restricted amd64 Packages Ign http://download.tuxfamily.org saucy/cairo-dock Translation-fr Hit http://dl.google.com stable/main amd64 Packages Hit http://fr.archive.ubuntu.com saucy/universe amd64 Packages Ign http://deb.playonlinux.com precise/main Translation-fr Hit http://dl.google.com stable/main i386 Packages Hit http://fr.archive.ubuntu.com saucy/multiverse amd64 Packages Ign http://archive.canonical.com saucy/partner Translation-en Ign http://archive.canonical.com saucy/partner Translation-fr Hit http://security.ubuntu.com saucy-security/main Sources Ign http://extras.ubuntu.com saucy/main Translation-en Ign http://extras.ubuntu.com saucy/main Translation-fr Hit http://fr.archive.ubuntu.com saucy/main i386 Packages Hit http://fr.archive.ubuntu.com saucy/restricted i386 Packages Ign http://repository.mein-neues-blog.de:9000 Translation-en Hit http://security.ubuntu.com saucy-security/universe Sources Hit http://fr.archive.ubuntu.com saucy/universe i386 Packages Hit http://fr.archive.ubuntu.com saucy/multiverse i386 Packages Ign http://repository.mein-neues-blog.de:9000 Translation-fr Hit http://fr.archive.ubuntu.com saucy/main Translation-en Hit http://fr.archive.ubuntu.com saucy/main Translation-fr Hit http://fr.archive.ubuntu.com saucy/multiverse Translation-en Hit http://security.ubuntu.com saucy-security/restricted Sources Hit http://fr.archive.ubuntu.com saucy/multiverse Translation-fr Ign http://dl.google.com stable/main Translation-en Hit http://ppa.launchpad.net saucy/main Sources Hit http://fr.archive.ubuntu.com saucy/restricted Translation-en Hit http://fr.archive.ubuntu.com saucy/restricted Translation-fr Hit http://ppa.launchpad.net saucy/main amd64 Packages Ign http://dl.google.com stable/main Translation-fr Hit http://fr.archive.ubuntu.com saucy/universe Translation-en Hit http://security.ubuntu.com saucy-security/multiverse Sources Hit http://ppa.launchpad.net saucy/main i386 Packages Hit http://fr.archive.ubuntu.com saucy/universe Translation-fr Get:8 http://fr.archive.ubuntu.com saucy-updates/main Sources [71.8 kB] Get:9 http://fr.archive.ubuntu.com saucy-updates/universe Sources [65.4 kB] Hit http://ppa.launchpad.net saucy/main Sources Hit http://ppa.launchpad.net saucy/main amd64 Packages Get:10 http://fr.archive.ubuntu.com saucy-updates/restricted Sources [14 B] Hit http://ppa.launchpad.net saucy/main i386 Packages Get:11 http://fr.archive.ubuntu.com saucy-updates/multiverse Sources [1360 B] Hit http://ppa.launchpad.net saucy/main Sources Hit http://ppa.launchpad.net saucy/main amd64 Packages Get:12 http://fr.archive.ubuntu.com saucy-updates/main amd64 Packages [202 kB] Hit http://security.ubuntu.com saucy-security/main amd64 Packages Hit http://ppa.launchpad.net saucy/main i386 Packages Hit http://security.ubuntu.com saucy-security/restricted amd64 Packages Hit http://ppa.launchpad.net saucy/main Sources Get:13 http://fr.archive.ubuntu.com saucy-updates/restricted amd64 Packages [14 B] Hit http://ppa.launchpad.net saucy/main amd64 Packages Get:14 http://fr.archive.ubuntu.com saucy-updates/universe amd64 Packages [148 kB] Hit http://security.ubuntu.com saucy-security/universe amd64 Packages Hit http://ppa.launchpad.net saucy/main i386 Packages Get:15 http://fr.archive.ubuntu.com saucy-updates/multiverse amd64 Packages [1563 B] Get:16 http://fr.archive.ubuntu.com saucy-updates/main i386 Packages [201 kB] Hit http://security.ubuntu.com saucy-security/multiverse amd64 Packages Get:17 http://fr.archive.ubuntu.com saucy-updates/restricted i386 Packages [14 B] Hit http://security.ubuntu.com saucy-security/main i386 Packages Get:18 http://fr.archive.ubuntu.com saucy-updates/universe i386 Packages [148 kB] Get:19 http://fr.archive.ubuntu.com saucy-updates/multiverse i386 Packages [1777 B] Hit http://security.ubuntu.com saucy-security/restricted i386 Packages Hit http://fr.archive.ubuntu.com saucy-updates/main Translation-en Hit http://fr.archive.ubuntu.com saucy-updates/main Translation-fr Hit http://fr.archive.ubuntu.com saucy-updates/multiverse Translation-en Hit http://fr.archive.ubuntu.com saucy-updates/multiverse Translation-fr Hit http://security.ubuntu.com saucy-security/universe i386 Packages Hit http://fr.archive.ubuntu.com saucy-updates/restricted Translation-en Hit http://fr.archive.ubuntu.com saucy-updates/restricted Translation-fr Hit http://fr.archive.ubuntu.com saucy-updates/universe Translation-en Hit http://fr.archive.ubuntu.com saucy-updates/universe Translation-fr Hit http://security.ubuntu.com saucy-security/multiverse i386 Packages Hit http://security.ubuntu.com saucy-security/main Translation-en Hit http://fr.archive.ubuntu.com saucy-backports/main Sources Hit http://fr.archive.ubuntu.com saucy-backports/restricted Sources Hit http://fr.archive.ubuntu.com saucy-backports/universe Sources Hit http://fr.archive.ubuntu.com saucy-backports/multiverse Sources Hit http://fr.archive.ubuntu.com saucy-backports/main amd64 Packages Hit http://fr.archive.ubuntu.com saucy-backports/restricted amd64 Packages Hit http://fr.archive.ubuntu.com saucy-backports/universe amd64 Packages Hit http://fr.archive.ubuntu.com saucy-backports/multiverse amd64 Packages Hit http://fr.archive.ubuntu.com saucy-backports/main i386 Packages Hit http://fr.archive.ubuntu.com saucy-backports/restricted i386 Packages Hit http://fr.archive.ubuntu.com saucy-backports/universe i386 Packages Hit http://fr.archive.ubuntu.com saucy-backports/multiverse i386 Packages Hit http://fr.archive.ubuntu.com saucy-backports/main Translation-en Hit http://security.ubuntu.com saucy-security/multiverse Translation-en Hit http://fr.archive.ubuntu.com saucy-backports/multiverse Translation-en Hit http://fr.archive.ubuntu.com saucy-backports/restricted Translation-en Hit http://security.ubuntu.com saucy-security/restricted Translation-en Hit http://fr.archive.ubuntu.com saucy-backports/universe Translation-en Hit http://security.ubuntu.com saucy-security/universe Translation-en Ign http://fr.archive.ubuntu.com saucy-backports/main Translation-fr Err http://ppa.launchpad.net saucy/main Sources 404 Not Found Ign http://fr.archive.ubuntu.com saucy-backports/multiverse Translation-fr Err http://ppa.launchpad.net saucy/main amd64 Packages 404 Not Found Ign http://fr.archive.ubuntu.com saucy-backports/restricted Translation-fr Err http://ppa.launchpad.net saucy/main i386 Packages 404 Not Found Ign http://fr.archive.ubuntu.com saucy-backports/universe Translation-fr Ign http://ppa.launchpad.net saucy/main Translation-en Ign http://ppa.launchpad.net saucy/main Translation-fr Err http://ppa.launchpad.net saucy/main Sources 404 Not Found Err http://ppa.launchpad.net saucy/main amd64 Packages 404 Not Found Err http://ppa.launchpad.net saucy/main i386 Packages 404 Not Found Ign http://ppa.launchpad.net saucy/main Translation-en Ign http://ppa.launchpad.net saucy/main Translation-fr Ign http://ppa.launchpad.net saucy/main Translation-en Ign http://ppa.launchpad.net saucy/main Translation-fr Ign http://ppa.launchpad.net saucy/main Translation-en Ign http://ppa.launchpad.net saucy/main Translation-fr Ign http://ppa.launchpad.net saucy/main Translation-en Ign http://ppa.launchpad.net saucy/main Translation-fr Ign http://ppa.launchpad.net saucy/main Translation-en Ign http://ppa.launchpad.net saucy/main Translation-fr Ign http://security.ubuntu.com saucy-security/main Translation-fr Ign http://security.ubuntu.com saucy-security/multiverse Translation-fr Ign http://security.ubuntu.com saucy-security/restricted Translation-fr Ign http://security.ubuntu.com saucy-security/universe Translation-fr Fetched 908 kB in 5s (167 kB/s) W: Failed to fetch http://ppa.launchpad.net/blueleaflinux/ … ce/Sources 404 Not Found W: Failed to fetch http://ppa.launchpad.net/blueleaflinux/ … 4/Packages 404 Not Found W: Failed to fetch http://ppa.launchpad.net/blueleaflinux/ … 6/Packages 404 Not Found W: Failed to fetch http://ppa.launchpad.net/fyrmir/livewal … ce/Sources 404 Not Found W: Failed to fetch http://ppa.launchpad.net/fyrmir/livewal … 4/Packages 404 Not Found W: Failed to fetch http://ppa.launchpad.net/fyrmir/livewal … 6/Packages 404 Not Found E: Some index files failed to download. They have been ignored, or old ones used instead. et dist-upgrade: Reading package lists... DoneBuilding dependency tree Reading state information... DoneCalculating upgrade... Done0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. Dernière modification par fffredo (Le 17/02/2014, à 10:44) kubuntu 14.04 (64 bits) / kde 4.13 / 3Go RAM / AMD 64 / sous GNU/linux depuis 2010 Hors ligne fffredo Re : traduction française (résolu) bizarre ces 404 W: Failed to fetch.....404 not found kubuntu 14.04 (64 bits) / kde 4.13 / 3Go RAM / AMD 64 / sous GNU/linux depuis 2010 Hors ligne nam1962 Re : traduction française (résolu) Houlà, il y a une certaine salade. Pourquoi des dépôts precise pour playonlinux ? Regarde le début du tuto dans ma signature pour mettre au carré (et change precise en saucy pour playonlinux au passage) Puis à nouveau update Mon tuto pour optimiser / finaliser une install : http://forum.ubuntu-fr.org/viewtopic.ph … #p15041961 Xubuntu 14.10 sur portable, 14.04 sur fixe, 14.04 chez mes amis. Score : 49 convertis IRL (leur ai pas donné le choix, aussi...). Un jeune site que j'aime bien, qui fait du T-shirt la nouvelle élégance ...bio en plus : http://goudronblanc.com En ligne fffredo Re : traduction française (résolu) je vois ça demain, je peux pas acceder a mes sources de logiciel, muon ne veut pas A Nous allons d'abord bien définir les dépôts - soit en accédant à sources de logiciels dans menu des application - gestionnaire de paramètres, ou en faisant : software-properties-gtk Là, - vérifier que tout est coché sur l'onglet "logiciels ubuntu" (sauf code source) - puis sur l'onglet "autres logiciels" . décocher tout ce qui se rapporte au CD . cocher "partenaires de Canonical" - sur l'onglet "mises à jour" tout cocher sauf "mises à jour proposées - proposed" (dangereux si activé) - enfin, si on est sur une version long terme, bien vérifier que tout en bas on est "versions long terme" (!) c'est bien ce que je veux faire mais je peux pas Demain maintin après café je m'y met kubuntu 14.04 (64 bits) / kde 4.13 / 3Go RAM / AMD 64 / sous GNU/linux depuis 2010 Hors ligne nam1962 Re : traduction française (résolu) Et par sudo gedit /etc/apt/sources.list Mon tuto pour optimiser / finaliser une install : http://forum.ubuntu-fr.org/viewtopic.ph … #p15041961 Xubuntu 14.10 sur portable, 14.04 sur fixe, 14.04 chez mes amis. Score : 49 convertis IRL (leur ai pas donné le choix, aussi...). Un jeune site que j'aime bien, qui fait du T-shirt la nouvelle élégance ...bio en plus : http://goudronblanc.com En ligne fffredo Re : traduction française (résolu) salut nam, et merci encore d'essayer de m'aider quand je veux supprimer une source, voilà ce qu'il me dit : "could not download package" et sudo kate /etc/apt/sources.list me donne ça: # deb cdrom:[Kubuntu 13.10 _Saucy Salamander_ - Release amd64 (20131016.1)]/ saucy main multiverse restricted universe # See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to # newer versions of the distribution. deb http://fr.archive.ubuntu.com/ubuntu/ saucy main restricted deb-src http://fr.archive.ubuntu.com/ubuntu/ saucy main universe restricted multiverse #Added by software-properties ## Major bug fix updates produced after the final release of the ## distribution. deb http://fr.archive.ubuntu.com/ubuntu/ saucy-updates main restricted deb-src http://fr.archive.ubuntu.com/ubuntu/ saucy-updates main universe restricted multiverse #Added by software-properties ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu ## team. Also, please note that software in universe WILL NOT receive any ## review or updates from the Ubuntu security team. deb http://fr.archive.ubuntu.com/ubuntu/ saucy universe deb http://fr.archive.ubuntu.com/ubuntu/ saucy-updates universe ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu ## team, and may not be under a free licence. Please satisfy yourself as to ## your rights to use the software. Also, please note that software in ## multiverse WILL NOT receive any review or updates from the Ubuntu ## security team. deb http://fr.archive.ubuntu.com/ubuntu/ saucy multiverse deb http://fr.archive.ubuntu.com/ubuntu/ saucy-updates multiverse ## N.B. software from this repository may not have been tested as ## extensively as that contained in the main release, although it includes ## newer versions of some applications which may provide useful features. ## Also, please note that software in backports WILL NOT receive any review ## or updates from the Ubuntu security team. deb http://fr.archive.ubuntu.com/ubuntu/ saucy-backports main restricted universe multiverse deb-src http://fr.archive.ubuntu.com/ubuntu/ saucy-backports main restricted universe multiverse #Added by software-properties deb http://security.ubuntu.com/ubuntu saucy-security main restricted deb-src http://security.ubuntu.com/ubuntu saucy-security main universe restricted multiverse #Added by software-properties deb http://security.ubuntu.com/ubuntu saucy-security universe deb http://security.ubuntu.com/ubuntu saucy-security multiverse ## Uncomment the following two lines to add software from Canonical's ## 'partner' repository. ## This software is not part of Ubuntu, but is offered by Canonical and the ## respective vendors as a service to Ubuntu users. deb http://archive.canonical.com/ubuntu saucy partner deb-src http://archive.canonical.com/ubuntu saucy partner ## This software is not part of Ubuntu, but is offered by third-party ## developers who want to ship their latest software. deb http://extras.ubuntu.com/ubuntu saucy main deb-src http://extras.ubuntu.com/ubuntu saucy main en root je peux pas acceder a mes ppa, je l'explique pas alors que je pouvais sans problème avant, je sens que vais réinstaller kde! qu'en dit tu? j'avais fait du ménage en suivant ce site la semaine dernière j'ai ouvert mon pc et grand nettoyage et je suis passé de 80°c pour la carte graphique à 58°c et il a commencé à parlé anglais le lendemain je crois mais au début c'était le menu kickoff puis les menu fenetres et la le clic droit, et puis quasi tout sauf sous wine et chromium !!! je comprend pas mal kubuntu ayant mis les mains dans le tas plusieurs fois et ça me gène pas plus que ça mais là je sèche je comprend l'anglais mais bon en french c'est mieux Dernière modification par fffredo (Le 16/02/2014, à 10:26) kubuntu 14.04 (64 bits) / kde 4.13 / 3Go RAM / AMD 64 / sous GNU/linux depuis 2010 Hors ligne nam1962 Re : traduction française (résolu) ..et si tu tentes par software-properties-kde Mon tuto pour optimiser / finaliser une install : http://forum.ubuntu-fr.org/viewtopic.ph … #p15041961 Xubuntu 14.10 sur portable, 14.04 sur fixe, 14.04 chez mes amis. Score : 49 convertis IRL (leur ai pas donné le choix, aussi...). Un jeune site que j'aime bien, qui fait du T-shirt la nouvelle élégance ...bio en plus : http://goudronblanc.com En ligne fffredo Re : traduction française (résolu) déjà là la commande donne : :~$ sudo software-properties-kde Error: "/var/tmp/kdecache-frede" is owned by uid 1000 instead of uid 0. gpg: /tmp/tmprtzdfb/trustdb.gpg: trustdb created Traceback (most recent call last): File "/usr/bin/software-properties-kde", line 130, in <module> app = SoftwarePropertiesKDE(datadir=data_dir, options=options, file=afile, attachWinID=attachWinID) File "/usr/lib/python3/dist-packages/softwareproperties/kde/SoftwarePropertiesKDE.py", line 99, in __init__ self.show_keys() File "/usr/lib/python3/dist-packages/softwareproperties/kde/SoftwarePropertiesKDE.py", line 592, in show_keys for key in self.apt_key.list(): File "/usr/lib/python3/dist-packages/softwareproperties/AptAuth.py", line 77, in list for line in p: File "/usr/lib/python3.3/encodings/ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1040: ordinal not in range(128) je suis dans synaptic et je peux décocher les sources, donc je décoche les "src" ? kubuntu 14.04 (64 bits) / kde 4.13 / 3Go RAM / AMD 64 / sous GNU/linux depuis 2010 Hors ligne fffredo Re : traduction française (résolu) en installant synaptic j'ai était interpelé par ses lignes dans la console : perl: warning: Setting locale failed. perl: warning: Please check that your locale settings: LANGUAGE = "en_US:en", LC_ALL = (unset), LC_TIME = "fr_FR.UTF-8", LC_MONETARY = "fr_FR.UTF-8", LC_ADDRESS = "fr_FR.UTF-8", LC_TELEPHONE = "fr_FR.UTF-8", LC_NAME = "fr_FR.UTF-8", LC_MEASUREMENT = "fr_FR.UTF-8", LC_IDENTIFICATION = "fr_FR.UTF-8", LC_NUMERIC = "fr_FR.UTF-8", LC_PAPER = "fr_FR.UTF-8", LANG = "en_US.UTF-8" are supported and installed on your system. perl: warning: Falling back to the standard locale ("C"). locale: Cannot set LC_CTYPE to default locale: No such file or directory locale: Cannot set LC_MESSAGES to default locale: No such file or directory locale: Cannot set LC_ALL to default locale: No such file or directory Selecting previously unselected package libept1.4.12. toujours un problème de locale ??? kubuntu 14.04 (64 bits) / kde 4.13 / 3Go RAM / AMD 64 / sous GNU/linux depuis 2010 Hors ligne nam1962 Re : traduction française (résolu) Sauf que ce n'est pas le problème de locales qui fiche le bazar dans tes dépots, c'est sans doute l'inverse. Je ne pige pas bien ce qui t'arrive. Qu'as tu quand tu fais software-properties-gtk Mon tuto pour optimiser / finaliser une install : http://forum.ubuntu-fr.org/viewtopic.ph … #p15041961 Xubuntu 14.10 sur portable, 14.04 sur fixe, 14.04 chez mes amis. Score : 49 convertis IRL (leur ai pas donné le choix, aussi...). Un jeune site que j'aime bien, qui fait du T-shirt la nouvelle élégance ...bio en plus : http://goudronblanc.com En ligne fffredo Re : traduction française (résolu) ça donne ça: frede@frede-KX575AA-ABF-a6520-fr:~$ software-properties-gtk Sorry, command-not-found has crashed! Please file a bug report at: https://bugs.launchpad.net/command-not-found/+filebug Please include the following information with the report: command-not-found version: 0.3 Python version: 3.3.2 final 0 Distributor ID: Ubuntu Description: Ubuntu 13.10 Release: 13.10 Codename: saucy Exception information: unsupported locale setting Traceback (most recent call last): File "/usr/lib/python3/dist-packages/CommandNotFound/util.py", line 24, in crash_guard callback() File "/usr/lib/command-not-found", line 69, in main enable_i18n() File "/usr/lib/command-not-found", line 40, in enable_i18n locale.setlocale(locale.LC_ALL, '') File "/usr/lib/python3.3/locale.py", line 541, in setlocale return _setlocale(category, locale) locale.Error: unsupported locale setting frede@frede-KX575AA-ABF-a6520-fr:~$ kubuntu 14.04 (64 bits) / kde 4.13 / 3Go RAM / AMD 64 / sous GNU/linux depuis 2010 Hors ligne fffredo Re : traduction française (résolu) je sent que je vais réinstalle à neuf car je garde toujours mon /home et malgrès le nettoyage il doit y rester des petit bout de tout et de rien, j'aurais préféré attendre la mise à niveau dans 2 mois mais quand il faut il faut et je pense que cela va résoudre le problème !!!! puis remettre mais logiciel ce qui va me permettre de faire le vide lol kubuntu 14.04 (64 bits) / kde 4.13 / 3Go RAM / AMD 64 / sous GNU/linux depuis 2010 Hors ligne nam1962 Re : traduction française (résolu) Essaie un : sudo apt-get autoclean sudo apt-get clean sudo apt-get autoremove sudo apt-get install --reinstall software-properties-gtk Puis relance le Mon tuto pour optimiser / finaliser une install : http://forum.ubuntu-fr.org/viewtopic.ph … #p15041961 Xubuntu 14.10 sur portable, 14.04 sur fixe, 14.04 chez mes amis. Score : 49 convertis IRL (leur ai pas donné le choix, aussi...). Un jeune site que j'aime bien, qui fait du T-shirt la nouvelle élégance ...bio en plus : http://goudronblanc.com En ligne fffredo Re : traduction française (résolu) une fois fais comme demandé ça me dit : frede@frede-KX575AA-ABF-a6520-fr:~$ software-properties-gtk (software-properties-gtk:9618): Gtk-WARNING **: Locale not supported by C library. Using the fallback 'C' locale. Cannot set locale: unsupported locale setting gpg: /tmp/tmpmzqlxx/trustdb.gpg: trustdb created Traceback (most recent call last): File "/usr/bin/software-properties-gtk", line 101, in <module> app = SoftwarePropertiesGtk(datadir=options.data_dir, options=options, file=file) File "/usr/lib/python3/dist-packages/softwareproperties/gtk/SoftwarePropertiesGtk.py", line 169, in __init__ self.show_keys() File "/usr/lib/python3/dist-packages/softwareproperties/gtk/SoftwarePropertiesGtk.py", line 847, in show_keys for key in self.apt_key.list(): File "/usr/lib/python3/dist-packages/softwareproperties/AptAuth.py", line 77, in list for line in p: File "/usr/lib/python3.3/encodings/ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1040: ordinal not in range(128) kubuntu 14.04 (64 bits) / kde 4.13 / 3Go RAM / AMD 64 / sous GNU/linux depuis 2010 Hors ligne fffredo Re : traduction française (résolu) bon beh voilà un kubuntu tout neuf et tout est ok, je te remerci nam1962 pour ton coup de main, mais ça a était plus simple et rapide me reste à mettre mes logiciels au fur et à mesure de mes besoins et récupérer mes document dans mon DD de sauvegarde je vais mettre résolu kubuntu 14.04 (64 bits) / kde 4.13 / 3Go RAM / AMD 64 / sous GNU/linux depuis 2010 Hors ligne fffredo Re : traduction française (résolu) petite question nam toi qui connais mieux les PPA que moi lors de l'installation d'un programme avec un dépôt spécifique, on met le dépôt puis update, puis install du prog et après il faut le viré le PPA ou le décocher ou autre? et pour les mises a jours de ce dit programme, sans son PPA comment il procède? si tu pouvez m'éclairer ce serait sympa, pour une démarche à suivre avec les dépôt ou un lien, merci kubuntu 14.04 (64 bits) / kde 4.13 / 3Go RAM / AMD 64 / sous GNU/linux depuis 2010 Hors ligne nam1962 Re : traduction française (résolu) En fait ça dépend du dépot. Les dépots "externes" sont toujours à manier avec précaution : ce que tu y charge peut présenter des risques (par exemple d'incomptatibilité avec ton install). Certains dépots, un peu bricolo peuvent avoir envie de remplacer certains paquets qui sont sur ton install par des trucs plus ou moins bricolés. Ca vaut toujours le coup d'aller voir le dépot pour regarder ce qu'il y a dedans. Par contre, d'autres dépots sont sains et t'assurent le mise à jour. Dans mon tuto, j'ai mis des dépots qu'on peut garder, en principe sains. Mon tuto pour optimiser / finaliser une install : http://forum.ubuntu-fr.org/viewtopic.ph … #p15041961 Xubuntu 14.10 sur portable, 14.04 sur fixe, 14.04 chez mes amis. Score : 49 convertis IRL (leur ai pas donné le choix, aussi...). Un jeune site que j'aime bien, qui fait du T-shirt la nouvelle élégance ...bio en plus : http://goudronblanc.com En ligne fffredo Re : traduction française (résolu) merci nam kubuntu 14.04 (64 bits) / kde 4.13 / 3Go RAM / AMD 64 / sous GNU/linux depuis 2010 Hors ligne
icares Impossible de mettre à jour les dépots Voilà ce que j'obtiens avec un apt-get update mathieu@mathieu-dd:~$ sudo apt-get update Password: Err http://be.archive.ubuntu.com dapper Release.gpg Échec de la connexion [IP : 85.133.25.23 80] Err http://be.archive.ubuntu.com dapper-updates Release.gpg Échec de la connexion [IP : 195.248.90.23 80] Err http://be.archive.ubuntu.com dapper-backports Release.gpg Échec de la connexion [IP : 85.133.25.23 80] Ign http://be.archive.ubuntu.com dapper Release Ign http://be.archive.ubuntu.com dapper-updates Release Ign http://be.archive.ubuntu.com dapper-backports Release Ign http://be.archive.ubuntu.com dapper/main Packages Ign http://be.archive.ubuntu.com dapper/restricted Packages Ign http://be.archive.ubuntu.com dapper-updates/main Packages Ign http://be.archive.ubuntu.com dapper-updates/restricted Packages Ign http://be.archive.ubuntu.com dapper-backports/main Packages Err http://security.ubuntu.com dapper-security Release.gpg Échec de la connexion Ign http://be.archive.ubuntu.com dapper-backports/restricted Packages Ign http://security.ubuntu.com dapper-security Release Err http://be.archive.ubuntu.com dapper/main Packages Échec de la connexion [IP : 85.133.25.23 80] Ign http://security.ubuntu.com dapper-security/main Packages Err http://be.archive.ubuntu.com dapper/restricted Packages Échec de la connexion [IP : 195.248.90.23 80] Ign http://security.ubuntu.com dapper-security/restricted Packages Err http://be.archive.ubuntu.com dapper-updates/main Packages Échec de la connexion [IP : 85.133.25.23 80] Err http://be.archive.ubuntu.com dapper-updates/restricted Packages Échec de la connexion [IP : 195.248.90.23 80] Err http://be.archive.ubuntu.com dapper-backports/main Packages Échec de la connexion [IP : 85.133.25.23 80] Err http://be.archive.ubuntu.com dapper-backports/restricted Packages Échec de la connexion [IP : 195.248.90.23 80] Err http://security.ubuntu.com dapper-security/main Packages Échec de la connexion Err http://security.ubuntu.com dapper-security/restricted Packages Échec de la connexion Impossible de récupérer http://be.archive.ubuntu.com/ubuntu/dists/dapper/Release.gpg Échec de la connexion [IP : 85.133.25.23 80] Impossible de récupérer http://be.archive.ubuntu.com/ubuntu/dists/dapper-updates/Release.gpg Échec de la connexion [IP : 195.248.90.23 80] Impossible de récupérer http://security.ubuntu.com/ubuntu/dists/dapper-security/Release.gpg Échec de la connexion Impossible de récupérer http://be.archive.ubuntu.com/ubuntu/dists/dapper-backports/Release.gpg Échec de la connexion [IP : 85.133.25.23 80] Impossible de récupérer http://be.archive.ubuntu.com/ubuntu/dists/dapper/main/binary-i386/Packages.gz Échec de la connexion [IP : 85.133.25.23 80] Impossible de récupérer http://be.archive.ubuntu.com/ubuntu/dists/dapper/restricted/binary-i386/Packages.gz Échec de la connexion [IP : 195.248.90.23 80] Impossible de récupérer http://be.archive.ubuntu.com/ubuntu/dists/dapper-updates/main/binary-i386/Packages.gz Échec de la connexion [IP : 85.133.25.23 80] Impossible de récupérer http://be.archive.ubuntu.com/ubuntu/dists/dapper-updates/restricted/binary-i386/Packages.gz Échec de la connexion [IP : 195.248.90.23 80] Impossible de récupérer http://be.archive.ubuntu.com/ubuntu/dists/dapper-backports/main/binary-i386/Packages.gz Échec de la connexion [IP : 85.133.25.23 80] Impossible de récupérer http://be.archive.ubuntu.com/ubuntu/dists/dapper-backports/restricted/binary-i386/Packages.gz Échec de la connexion [IP : 195.248.90.23 80] Impossible de récupérer http://security.ubuntu.com/ubuntu/dists/dapper-security/main/binary-i386/Packages.gz Échec de la connexion Impossible de récupérer http://security.ubuntu.com/ubuntu/dists/dapper-security/restricted/binary-i386/Packages.gz Échec de la connexion Lecture des listes de paquets... Fait E: Le téléchargement de quelques fichiers d'index a échoué, ils ont été ignorés, ou les anciens ont été utilisés à la place. mathieu@mathieu-dd:~$ J'ai essayer avec les depots fraancais, américains, et belge : toujours le même resultat : impos Icare Re : Impossible de mettre à jour les dépots A noter que j'ai ubuntu sur un disque dur externe (bien que cela ne soit pas ma première installation de linux, ni de ubuntu) Je suis derrière un routeur linksys. De plus apt semble se connecter au serveur mais n'arrive pas à telecharger les listes !! Par contre j'accede à ces listes avec firefox sans problème !! Dernière modification par Icare (Le 30/08/2006, à 00:11) Ubuntu sur un portable Médion ? http://www.linuxonmedion.fr.tc Hors ligne Icare Re : Impossible de mettre à jour les dépots up Ubuntu sur un portable Médion ? http://www.linuxonmedion.fr.tc Hors ligne davidd Re : Impossible de mettre à jour les dépots J'ai le méme probléme, et je suis en réseau, car je poste ce message depuis mon systéme ubuntu. Des idés ? ben645 Re : Impossible de mettre à jour les dépots idem pour moi ... michel2652 Re : Impossible de mettre à jour les dépots Bonjour, Essayez celui ci : deb-src http://archive.ubuntu.com/ubuntu/ dapper main restricted deb http://archive.ubuntu.com/ubuntu/ dapper-updates main restricted deb-src http://archive.ubuntu.com/ubuntu/ dapper-updates main restricted deb http://archive.ubuntu.com/ubuntu/ dapper universe main restricted multiverse deb-src http://archive.ubuntu.com/ubuntu/ dapper universe deb http://archive.ubuntu.com/ubuntu/ dapper-backports main restricted universe multiverse deb-src http://archive.ubuntu.com/ubuntu/ dapper-backports main restricted universe multiverse deb http://security.ubuntu.com/ubuntu dapper-security main restricted deb-src http://security.ubuntu.com/ubuntu dapper-security main restricted deb http://security.ubuntu.com/ubuntu dapper-security universe deb-src http://security.ubuntu.com/ubuntu dapper-security universe ## Dépôt Pouit ## Clé GPG : wget -q http://mrpouit.tuxfamily.org/12B83718.gpg -O- | sudo apt-key add - deb http://mrpouit.tuxfamily.org dapper-pouit contrib custom deb-src http://mrpouit.tuxfamily.org dapper-pouit contrib custom ## Ubuntu PLF # http 100mbit/s Dedibox deb http://packages.freecontrib.org/ubuntu/plf/ dapper free non-free deb-src http://packages.freecontrib.org/ubuntu/plf/ dapper free non-free ## Ubuntu Freecontrib # http 100mbit/s Dedibox deb http://packages.freecontrib.org/ubuntu/freecontrib/ dapper free non-free deb-src http://packages.freecontrib.org/ubuntu/freecontrib/ dapper free non-free # Dépôt Listen deb http://theli.free.fr/packages/ dapper listen deb http://theli.free.fr/packages/ dapper listen-unstable # Dépots Logiciels commerciaux deb http://archive.canonical.com dapper-commercial main # Dépot Tvfreeplayer Dapper deb http://www.tvfreeplayer.com/linux/ubuntu/dapper/ unstable main # Dépot Lprod.org deb http://lprod.org/deb/dapper/ ./ deb-src http://lprod.org/deb/dapper/ ./ Pour la clé du dépot mr_pouit, il y a la commande dans les lignes commentées du dépot sur le sources.list. A+ ben645 Re : Impossible de mettre à jour les dépots Tjr la meme chose aucun changement !
Coeur Noir [résolu] Langue du système ...pas d'interface KCmodule... Hello, je viens de réinstaller Kubuntu12.04 - seul - sur partition dédiée avec son propre utilisateur dans un /home sur un 2nd DD. Sur une autre partition il y a Ubuntu12.04 et son autre utilisateur, dans le même /home (/home contient donc 2 utilisateurs) Je précise car jusqu'alors je testais divers DE sur une seule partition et ça coinçait un peu des fois... Parenthèse première : à l'installation de Kubuntu pas moyen d'utiliser une partition déjà formatée pour /home → messsage d'erreur d'ubiquity, crash. J'ai donc déplacé mon /home après install' Ce qui m'ennuie maintenant : - thunderbird partiellement en français, ou essentiellement en anglais selon le point de vue :-p- un crash de la configuration graphique à chaque fois que je veux préciser la langue du système car ce dernier n'est que partiellement traduit en français. ...pas d'interface KCmodule avec le mot clé language-selector/language-selector.py... ______edit______ pour TB c'est OK, après installation de thunderbird-locale-fr âne de moi ! Dernière modification par Coeur Noir (Le 13/06/2012, à 12:13) Hors ligne Coeur Noir Re : [résolu] Langue du système ...pas d'interface KCmodule... Y-a-t-il une autre manip' pour "franciser" son système ? Une liste de paquets à installer par exemple ? Hors ligne bruno Re : [résolu] Langue du système ...pas d'interface KCmodule... Pour le problème avec le crash du module kcm, vérifie que le paquet language-selector-kde est bien installé. Pour les paquets de langues, il faut au minimum : language-pack-fr language-pack-kde-fr ( et language-pack-gnome-fr si tu utilises des applis Gnome) les dépendances suivront. Hors ligne Coeur Noir Re : [résolu] Langue du système ...pas d'interface KCmodule... Hors ligne bruno Re : [résolu] Langue du système ...pas d'interface KCmodule... Et ce fichier est bien présent sur ton système ? /usr/share/kde4/apps/language-selector/language-selector.py Hors ligne Coeur Noir Re : [résolu] Langue du système ...pas d'interface KCmodule... Affirmatif, bien présent. Hors ligne bruno Re : [résolu] Langue du système ...pas d'interface KCmodule... Bon, vérifie que ton système est bien à jour et fait toutes les mises à jour le cas échéant. Je suppose que c'est pareil en ligne de commande : kcmshell4 language-selector peut-être d'autres messages d'erreur ? Tu peux aussi tenter la réinstallation des paquets cités cités précédemment. Hors ligne Coeur Noir Re : [résolu] Langue du système ...pas d'interface KCmodule... Tu supposes bien mais avec ces infos en plus : koeur-noir@CompaQ:~$ kcmshell4 language-selector kcmshell(2047)/python (plugin): Error while running factory function for Python plugin: "language-selector/language-selector.py" Traceback (most recent call last): File "<string>", line 18, in kpythonpluginfactory_bridge File "/usr/share/kde4/apps/language-selector/language-selector.py", line 9, in CreatePlugin return QtLanguageSelector("/usr/share/language-selector/", component_data, widget_parent) File "/usr/lib/python2.7/dist-packages/LanguageSelector/qt/QtLanguageSelector.py", line 52, in __init__ self.init() File "/usr/lib/python2.7/dist-packages/LanguageSelector/qt/QtLanguageSelector.py", line 67, in init self.openCache(apt.progress.OpProgress()) File "/usr/lib/python2.7/dist-packages/LanguageSelector/LanguageSelector.py", line 31, in openCache self._cache = LangCache.LanguageSelectorPkgCache(self._localeinfo, progress) File "/usr/lib/python2.7/dist-packages/LanguageSelector/LangCache.py", line 74, in __init__ apt.Cache.__init__(self, progress) File "/usr/lib/python2.7/dist-packages/apt/cache.py", line 102, in __init__ self.open(progress) File "/usr/lib/python2.7/dist-packages/apt/cache.py", line 149, in open self._list.read_main_list() SystemError: E:Ouverture de /etc/apt/sources.list.d/ubuntu-mozilla-security-ppa-precise.list - ifstream::ifstream (13: Permission non accordée) kcmshell(2047)/python (plugin): Failed to import module kcmshell(2047)/kcontrol KCModuleLoader::loadModule: This module has no valid entry symbol at all. The reason could be that it's still using K_EXPORT_COMPONENT_FACTORY with a custom X-KDE-FactoryName which is not supported anymore J'ai depuis désactivé le dépôt mozilla-security, réinstallé les paquets que tu suggères - ça ne change rien au problème pour l'instant. Y-aurait-il eu un pépin lors de l'installation (récente) ? Dernière modification par Coeur Noir (Le 12/06/2012, à 17:55) Hors ligne bruno Re : [résolu] Langue du système ...pas d'interface KCmodule... Il y a bien ce rapport de bogue, mais c'est censé être corrigé depuis longtemps. Normalement tu devrais avoir la version 0.79 de language-selector. Est-ce que tu as ce problème avec d'autre modules de la « Configuration du système » qui utilisent Python comme la configuration de l'imprimante ? Hors ligne Coeur Noir Re : [résolu] Langue du système ...pas d'interface KCmodule... Aucun souci avec la configuration de l'imprimante - rien eu à faire à part la mettre sous tension, merci HP. J'ai language-selector-common et language-selector-kde installés, les deux en version 0.79. Il y a un language-selector "tout court" dispo dans les dépôts, qui installe en dépendance language-selector-gnome, et un -qt, j'installe aussi ? Dernière modification par Coeur Noir (Le 13/06/2012, à 10:04) Hors ligne bruno Re : [résolu] Langue du système ...pas d'interface KCmodule... Non ces paquets sont obsolètes, cela ne sert à rien de les installer. Je ne vois pas d'où viens le problème… Rien de plus à te suggérer à part forcer la réinstallation des paquets language-selector-common, language-selector-kde et python-kde4 Hors ligne Coeur Noir Re : [résolu] Langue du système ...pas d'interface KCmodule... ________edit________ un redémarrage plus tard, tout est rentré dans l'ordre : à priori c'est la réinstall' de python-kde qui a fait du bien... Ca réglera peut-être aussi un souci avec apport-kde (qui s'ouvre mais ne trouve jamais rien...) (curieux, sous kde les modif's ne sont pas prises en compte, faut redémarrer systématiquement ?) Dernière modification par Coeur Noir (Le 13/06/2012, à 12:13) Hors ligne bruno Re : [résolu] Langue du système ...pas d'interface KCmodule... Je pense que fermer et rouvrir la session aurait suffit. Il fallait que Python retrouve ses petits Hors ligne Coeur Noir Re : [résolu] Langue du système ...pas d'interface KCmodule... En tout cas merci pour le coup de main ! Hors ligne Nicologx Re : [résolu] Langue du système ...pas d'interface KCmodule... Salut à tous, J'ai ce problème sur 2 postes (bureau et portable) depuis la mise à niveau vers kubuntu 12.10. J'ai suivi les indications, réinstallé les différents paquets avec le gestionnaire de paquets Muon… mais rien n'y fait… Toutefois, le problème étant ici résolu, je continuerais cette discussion là. Merci pour les infos malgré tout. Hors ligne
1 Este pack contiene los siguientes vídeos musicales (con sus m4a's correspondientes): Demi Lovato - Really Don't Care (Official Video) ft. Cher Lloyd David Bisbal - Tú Y Yo Foster The People - Best Friend Arctic Monkeys - Snap Out Of It (Official Video) Kasabian - eez-eh Villagers - Occupy Your Mind (Official Video) - Incluye vídeo 3D Sam Smith - Money On My Mind Jungle - Busy Earnin' Lana Del Rey - West Coast ............ Especificación técnica de muestra Format : MPEG-4 File size : 102 MiB Duration : 4mn 7s Width : 1 920 pixels Height : 1 080 pixels Display aspect ratio : 16:9 Enlaces de Descarga 1 http://uploaded.net/file/piqwh4tp/Sfrd41240vi.part1.rar http://uploaded.net/file/hbs3645x/Sfrd41240vi.part2.rar http://www.ddlstorage.com/sucd1i66yf2y/Sfrd41240vi.part1.rar.htm http://www.ddlstorage.com/ev3ap5ui3tlo/Sfrd41240vi.part2.rar.htm http://www.uploadable.ch/file/EpcArj4HDJrv/Sfrd41240vi.part1.rar http://www.uploadable.ch/file/CuT2qecyBMfR/Sfrd41240vi.part2.rar https://www.oboom.com/6SB6F32M/Sfrd41240vi.part1.rar https://www.oboom.com/BRMDR9HQ/Sfrd41240vi.part2.rar Enlaces de Descarga 2 Enlaces de Descarga 3
I've been looking for a way to update my Twitter status from a Python client. As this client only needs to access one Twitter account, it should be possible to do this with a pre-generated oauth_token and secret, according to http://dev.twitter.com/pages/oauth_single_token However the sample code does not seem to work, I'm getting 'could not authenticate you' or 'incorrect signature'.. As there are a bunch of different python-twitter library out there (and not all of them are up-to-date) I'd really appreciate if anybody could point me a library that's currently working for POST requests, or post some sample code! Update:I've tried Pavel's solution, and it works as long as the new message is only one word long, but as soon as it contains spaces, i get this error: status = api.PostUpdate('hello world') Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\Python26\lib\site-packages\python_twitter\twitter.py", line 2459, in PostUpdate self._CheckForTwitterError(data) File "C:\Python26\lib\site-packages\python_twitter\twitter.py", line 3394, in _CheckForTwitterErro r raise TwitterError(data['error']) python_twitter.twitter.TwitterError: Incorrect signature If however the update is just one word, it works: status = api.PostUpdate('helloworld') {'status': 'helloworld'} Any idea why this might be happening? Thanks a lot in advance, Hoff
Load Testing Web Services with Grinder by Jim Alateras I first came across Grinder a year or so ago but never got beyond installing it on my machine. The latest version, which is still in beta, has a lot of new features, including support for the Jython scripting engine. The latest version also has a console, which collects and displays timing information generated by the load tests. First impressions have been very positive indeed. I was able to install and run a simple Jython-scripted example in less that 1 hour. After one day with Jython and Grinder I was able to leverage some existing JUnit test cases to do some ad hoc load testing on my web service. Initial contact with Jython has also been very positive and I intend on learning more about this scripting language. I found the Introduction to Jython Part 1 and Part 2 tutorials, from IBM devWorks, very useful. Below is a simple Jython test script, which can be executed by Grinder. (Check the Grinder Tutorial for more details) from net.grinder.script import Test; from net.grinder.script.Grinder import grinder; from com.comware.wm.test.rest.load import RestWorkManagerSession; log = grinder.logger.output; test = Test(1, "Create, Accept and Complete"); class TestRunner: def __call__(self): session = test.wrap(RestWorkManagerSession()); session.getMyWorkList(); This test basically leverages an existing Java class called RestWorkManagerSession (partially shown below) and makes a call to the Work Manager web service to retrieve my work list. public class RestWorkManagerSession extends AbstractRestTestCase { ... public WorkItems getMyWorkList() { String myWorkListUrl = getLocationUri() + _sessionId + "/workLists/myWorkList"; try { return getWorkList(myWorkListUrl); } catch (Exception exception) { // convert to a runtime exception throw new RuntimeException("getMyWorkList", exception); } } } Grinder uses a property file to parametize particular aspects of a load test. In the property file you can configure the number of processes, threads and iterations for a instance of grinder. You can also configure sleep time between each iteration, which is useful for simulating web service transaction rates. # # Example grinder.properties # grinder.processes=1 grinder.threads=2 grinder.runs=10 grinder.jvm.classpath=build/classes;build/test grinder.jvm.arguments=-Dpython.home=/applications/jython-2.1 grinder.useConsole=false grinder.consolePort=6372 grinder.logDirectory=logs grinder.numberOfOldLogs=2 grinder.logProcessStreams=false grinder.initialSleepTime=500 grinder.sleepTimeFactor=0.01 grinder.sleepTimeVariation=0.005 grinder.script=src/test/load/grinder/CreateAcceptCompleteScenario.py To run grinder you simply pass it the property file grinder.bat grinder.properties The next step is to determine whether I can configure grinder to execute the following load test 10 users concurrently retrieving work lists every 5 seconds and 5 users concurrently creating work items every 10 seconds and 3 users accepting and completing work items every 15 seconds <?xml version="1.0"?> <OpenExecConfiguration> <Scheduler /> <Logger /> <Users> <User userName="chris" /> <User userName="jima" maxConcurrentThreads="1" /> <User userName="jimm" maxConcurrentThreads="2" /> </Users> <Scenarios> <Scenario className="SleepExecutable" scenarioName="sleep100"> <Properties> <Property name="sleep.time" value="100" /> </Properties> </Scenario> <Scenario className="SleepExecutable" scenarioName="sleep1000"> <Properties> <Property name="sleep.time" value="1000" /> </Properties> </Scenario> <Scenario className="SleepExecutable" scenarioName="sleep10000"> <Properties> <Property name="sleep.time" value="10000" /> </Properties> </Scenario> </Scenarios> <UserScenarios> <UserScenario interval="500" delay="0" serialSceduling="false" executionCount="20" userName="chris" scenarioName="sleep1000"/> <UserScenario interval="500" delay="15000" serialSceduling="false" executionCount="20" userName="jima" scenarioName="sleep1000"/> <UserScenario interval="500" delay="40000" serialSceduling="false" executionCount="20" userName="jimm" scenarioName="sleep10000"/> </UserScenarios> </OpenExecConfiguration> ...the CVS logs show that it hasn't been touched for 4 years :-(
I guess it’s on everybody’s mind lately, but here is an excellent overview of “new” languages to come out in the past few years. Definitely a lot more than I thought there were at first. In this post I will provide a list of fairly new languages (let’s say 5 years with a little flex) that display interesting features and display higher-order thinking in the way that they tend toward an evolution of past learnings in programming language thinking. [source…] The one that sticks out to me is Shen which has a few very interesting features. It is lispy, focusing in a very portable core instruction set It supports ML pattern matching It supports Prolog “question resolution” Taking a look at each point in turn, once you get past the parenthesis, lisp syntax is very cool. If you try to do a good job of following functional / immutable / transormative programming you end up changing the way you write code. // procedural style var abc = 6; double( abc ); triple( abc ); assert( abc == 36 ); // functional style var abc = 6; var def = double( abc ); var result = triple( def ); assert( 36 == result ); // "clean" functional style var result = triple( double( 6 ) ); assert( 36 == result ); Obviously the above is a contrived example (to be even “cleaner” you would do away with the temporary “result” variable), but you can see that as you get “more functional” you naturally tend to collect parenthesis, no matter the language you are working in. The “pattern matching” aspect that I really liked from ML is pretty much syntactic sugar for if / else or case / switch but built in to the language. I find that I’m often writing code like this: // old style function foo( a, b ) { if ( 1 == a ) { alert( 'foo ' + b ); } else if ( 2 == a ) { alert( 'bar ' + b ); } else { alert( "unknown action: " + a ); } } // new style function foo( a, b ) { var mapping = { 1: function( b ) { alert( 'foo ' + b ); }, 2: function( b ) { alert( 'bar ' + b ); }, } if ( mapping.hasOwnProperty( a ) ) { mapping[a]( b ); } else { alert( "unknown action: " + a ); } } // "better" new style function foo( a, b ) { var mapping = { 1: doAlertWithFoo_ref, 2: doAlertWithBar_ref } if ( mapping.hasOwnProperty( a ) ) { mapping[a]( b ); } else { alert( "unknown action: " + a ); } } // "hypothetical" pattern-matching style function foo( 1, b ) { alert( 'foo ' + b ); } function foo( 2, b ) { alert( 'bar ' + b ); } function foo( a, b ) { alert( "unknown action: " + a ); } Again, an extremely contrived example, the point being that you treat conditionals as mappings instead of bare if/else clauses. Then, the only bugs you can have are “I am missing a mapping” or “My mapping is criss-crossed” or worst “My target action is buggy”. The pattern-matching aspect of a language makes it easier (supposedly!) to reason about functions. Instead of having to read inside a function to determine how it behaves (for many if/else cases), you can promote that to the top level of function definition (in the above, read function foo( 1, b ) as: when foo is called with 1 as the first parameter). The coup de grâce for me though is the inclusion of a version of Prolog core within the language. In the same way that regexes make string processing a million times easier, prolog makes logic processing a million times easier. And who would have thought… but logic processing turns out to be a useful thing to optimize from time to time. You’ll have to bear with me on this one because it’s a little harder to explain. But let’s say we have a computer. def isComputer( x ): return x has memory and x has cpu and x has hard_drive def 4gig_o_ram is memory def 2gig_o_ram is memory def 1gig_o_ram is memory def amd_chip is cpu def intel is cpu def seagate is hard_drive def western_digital is hard_drive my_computer = 4gig_o_ram and intel and western_digital def canRunWindowsVista( x ): isComputer( x ) and has 4gig_o_ram canRunWindowsVista( my_computer )? => true Again, a really contrived, terrible example with incorrect syntax. But the idea is that you set out the facts and you let the computer (90% of the time) figure out all the boring crap of making sure your arbitrary constraints aren’t violated. You run into this problem All. The. Time. when working with config files, validating function parameters, determining if a user has permission to perform an action, etc, etc, etc. Regexes are very information dense around a well-defined problem. “Prolog” is a bit more verbose around problems that you define yourself, which is my theory as to why there has never been a “like-a-regex-but-for-prolog” included in any languages. I can tell you it excites me to see this Shen project try. Definitely worth paying attention to.
The Software Center has a section of For Purchase programs —see screenshot below—, which is annonying me every time I want to install something. Is there any way to remove or hide these programs from the Software Center? Links to answers: The Software Center has a section of Is there any way to For 12.04 1. Ignore the purchasable apps Open a gksu gedit /usr/share/software-center/softwarecenter/db/update.py And press Enter. You'll be prompted for your password. doc = make_doc_from_parser(parser, cache) if not doc: LOG.debug("make_doc_from_parser() returned '%s', ignoring" % doc) return term_generator.set_document(doc) name = doc.get_data() Immediately after those lines, paste the following ( if doc.get_value(XapianValues.PRICE) not in (""): return Save the file ( 2. Remove the "For purchase" channel (optional) To also remove that "For purchase" item in the menu, open a terminal and type: gksu gedit /usr/share/software-center/softwarecenter/backend/channel_impl/aptchannels.py Locate these lines: if get_distro().PURCHASE_APP_URL: channels.append(for_purchase_channel) And disable them by putting a #if get_distro().PURCHASE_APP_URL: # channels.append(for_purchase_channel) Save and enjoy a software center without ads! Side notes: The. files. are. packaged. What does this mean, you ask? This means that, Undo the modifications If you want to restore the original state of the files, sudo apt-get install --reinstall software-center && exit Again, you will be prompted for your password, this time on the terminal. For 11.10 and earlier You can edit: and comment out (or delete) the following lines: for_purchase_channel = None #create a "magic" channel to display items available for purchase ` for_purchase_query = xapian.Query("AH" + AVAILABLE_FOR_PURCHASE_MAGIC_CHANNEL_NAME) for_purchase_channel = SoftwareChannel(self.icons, "For Purchase", None, None, channel_icon=None, # FIXME: need an icon channel_query=for_purchase_query, installed_only=installed_only) if partner_channel is not None: # channels.append(partner_channel) #channels.append(for_purchase_channel) Of course, you should have in mind that consequent updates to Check out this link for more details ;-) Note: for 12.04 the filename is I found a way to hide commercial results for 12.04: In /usr/share/software-center/softwarecenter/ui/gtk3/models/appstore2.py: After the lines: def set_from_matches(self, matches): """ set the content of the liststore based on a list of xapian.MSetItems """ LOG.debug("set_from_matches len(matches)='%s'" % len(matches)) Add the following line: matches[:] = [m for m in matches if (m.document.get_value(XapianValues.PRICE) in _FREE_AS_IN_BEER)] It should only change what is displayed, but I did not test it much yet, so use at your own risks. And enjoy an ad-free software center. For completeness, here is the solution that worked for me in 13.10: sudo aptitude install gksu gksu gedit /usr/share/software-center/softwarecenter/db/update.py Find this: def make_doc(self, cache): """Build a Xapian document from the desktop info.""" doc = xapian.Document() And add this (make sure you have the right indentation of TABS (python requires this): if self.has_option_desktop("X-AppInstall-Price"): if self.get_desktop("X-AppInstall-Price") > 0: return BTW this was my first python evar :-) For 12.10 and later Close the Software Center if it's open. gksu gedit /usr/share/software-center/softwarecenter/db/update.py And press Enter. You'll be prompted for your password. doc = self.make_doc(cache) if not doc: LOG.debug("%r.index_app_info: returned invalid doc %r, ignoring.", self.__class__.__name__, doc) return name = doc.get_data() Immediately after those lines, paste the following ( if doc.get_value(XapianValues.PRICE) not in (""): return Save the file ( gksu gedit /usr/share/software-center/softwarecenter/backend/channel_impl/aptchannels.py Press ENTER. An editor will appear again. Locate these lines: if get_distro().PURCHASE_APP_URL: channels.append(for_purchase_channel) And disable them by putting a #if get_distro().PURCHASE_APP_URL: # channels.append(for_purchase_channel) Save the file, close the editor but not the terminal. gksu echo; sudo update-software-center && exit Wait a bit, the terminal will automatically close when finished... Side notes: The. files. are. packaged. What does this mean, you ask? This means that, Undo the modifications If you want to restore the original state of the files, gksu echo; sudo apt-get install --reinstall software-center && exit Again, you will be prompted for your password. I tried this it it worked for me: only FREE gksu gedit /usr/share/software-center/softwarecenter/db/update.py Find this: def make_doc_from_parser(parser, cache): # XXX 2012-01-19 michaeln I'm just pulling this code out from # index_app_info_from_parser, but it'd be great to further # refactor it - it looks quite scary :-) doc = xapian.Document() # app name is the data Then add the following code: if parser.has_option_desktop("X-AppInstall-Price"): if parser.get_desktop("X-AppInstall-Price") > 0: return You can do this more simply by selecting View -> Canonical Maintained Software instead of All Software. This has the benefit of not being overwritten by software updates. This may hide some additional items but at least it gets rid of the annoying magazines and for sale software in my experience.
python python-ogre/BuildModule.py -g -c ogre --usesystem python python-ogre/BuildModule.py -g -c ois cegui --usesystem python python-ogre/BuildModule.py -b install  --usesystem PythonOgre.BuildModule DEBUG Traceback (most recent call last): File "generate_code.py", line 36, in <module> import common_utils File "../common_utils/__init__.py", line 3, in <module> import shared_ptr File "../common_utils/shared_ptr.py", line 3, in <module> from pyplusplus import messages ImportError: No module named pyplusplus python python-ogre/BuildModule.py -r pyplusplus python python-ogre/BuildModule.py -b pyplusplus --usesystem Mohican wrote:>python python-ogre/BuildModule.py -g -v ogreterrain >python python-ogre/BuildModule.py -c -v ogreterrain (Note: ogreterrain compiles on rev 1098 - above that, iteratorWrapper errors that '_tree' is not part of 'std') Mohican wrote:>python python-ogre/BuildModule.py -g -v ogrepcz >python python-ogre/BuildModule.py -c -v ogrepcz --ERROR-- cannot find -lPlugin_PCZSceneManager Mohican wrote:<< OgreOggSound Add-on >> >sudo apt-get install libogg-dev >sudo apt-get install libopenal-dev >sudo apt-get install libvorbis-dev >python python-ogre/BuildModule.py -r ogreoggsound >python python-ogre/BuildModule.py -b -v ogreoggsound >ogreoggsound/cmake . -DCMAKE_INSTALL_PREFIX=/home/mohican/pyogre/root/usr >ogreoggsound/make >ogreoggsound/make install >python python-ogre/BuildModule.py -g -v ogreoggsound >python python-ogre/BuildModule.py -c -v ogreoggsound --ERROR-- generated/ogreoggsound_1.21/OgreOggSoundRecord.pypp.cpp:89:1: instantiated from here /home/mohican/pyogre/root/usr/include/boost/python/type_id.hpp:89:9: error: invalid use of incomplete type ‘struct ALCdevice_struct’ /usr/include/AL/alc.h:43:16: error: forward declaration of ‘struct ALCdevice_struct’ scons: *** [build_dir_2.7/ogreoggsound_1.21/OgreOggSoundRecord.pypp.os] Error 1 09-18 22:57 PythonOgre.BuildModule DEBUG scons: warning: BuildDir() and the build_dir keyword have been deprecated;         use VariantDir() and the variant_dir keyword instead. File "/home/eliot/python-ogre/SConstruct", line 228, in <module> In file included from /home/eliot/root/usr/include/boost/python/instance_holder.hpp:11,                  from /home/eliot/root/usr/include/boost/python/object/pointer_holder.hpp:14,                  from /home/eliot/root/usr/include/boost/python/to_python_indirect.hpp:10,                  from /home/eliot/root/usr/include/boost/python/converter/arg_to_python.hpp:10,                  from /home/eliot/root/usr/include/boost/python/call.hpp:15,                  from /home/eliot/root/usr/include/boost/python/object_core.hpp:12,                  from /home/eliot/root/usr/include/boost/python/args.hpp:25,                  from /home/eliot/root/usr/include/boost/python.hpp:11,                  from generated/ogreoggsound_1.21/OgreOggSoundRecord.pypp.cpp:3: /home/eliot/root/usr/include/boost/python/type_id.hpp: In function 'boost::python::type_info boost::python::type_id() [with T = ALCdevice&]': /home/eliot/root/usr/include/boost/python/detail/signature.hpp:98:   instantiated from 'static const boost::python::detail::signature_element* boost::python::detail::signature_arity<2u>::impl<Sig>::elements() [with Sig = boost::mpl::vector3<void, PyObject*, ALCdevice&>]' /home/eliot/root/usr/include/boost/python/detail/caller.hpp:232:   instantiated from 'static boost::python::detail::py_func_sig_info boost::python::detail::caller_arity<2u>::impl<F, Policies, Sig>::signature() [with F = void (*)(PyObject*, ALCdevice&), Policies = boost::python::default_call_policies, Sig = boost::mpl::vector3<void, PyObject*, ALCdevice&>]' /home/eliot/root/usr/include/boost/python/object/py_function.hpp:48:   instantiated from 'boost::python::detail::py_func_sig_info boost::python::objects::caller_py_function_impl<Caller>::signature() const [with Caller = boost::python::detail::caller<void (*)(PyObject*, ALCdevice&), boost::python::default_call_policies, boost::mpl::vector3<void, PyObject*, ALCdevice&> >]' generated/ogreoggsound_1.21/OgreOggSoundRecord.pypp.cpp:89:   instantiated from here /home/eliot/root/usr/include/boost/python/type_id.hpp:89: error: invalid use of incomplete type 'struct ALCdevice_struct' /usr/include/AL/alc.h:44: error: forward declaration of 'struct ALCdevice_struct' /home/eliot/root/usr/include/boost/python/type_id.hpp: In function 'boost::python::type_info boost::python::type_id() [with T = const volatile ALCdevice_struct&]': /home/eliot/root/usr/include/boost/python/converter/registered.hpp:87:   instantiated from 'const boost::python::converter::registration& boost::python::converter::detail::registry_lookup2(T& (*)()) [with T = const volatile ALCdevice_struct]' /home/eliot/root/usr/include/boost/python/converter/registered.hpp:94:   instantiated from 'const boost::python::converter::registration& boost::python::converter::detail::registry_lookup1(boost::type<Target>) [with T = const volatile ALCdevice_struct&]' /home/eliot/root/usr/include/boost/python/converter/registered.hpp:105:   instantiated from 'const boost::python::converter::registration& boost::python::converter::detail::registered_base<const volatile ALCdevice_struct&>::converters' /home/eliot/root/usr/include/boost/python/converter/arg_from_python.hpp:283:   instantiated from 'boost::python::converter::reference_arg_from_python<T>::reference_arg_from_python(PyObject*) [with T = ALCdevice&]' /home/eliot/root/usr/include/boost/python/arg_from_python.hpp:70:   instantiated from 'boost::python::arg_from_python<T>::arg_from_python(PyObject*) [with T = ALCdevice&]' /home/eliot/root/usr/include/boost/preprocessor/iteration/detail/local.hpp:37:   instantiated from 'PyObject* boost::python::detail::caller_arity<2u>::impl<F, Policies, Sig>::operator()(PyObject*, PyObject*) [with F = void (*)(PyObject*, ALCdevice&), Policies = boost::python::default_call_policies, Sig = boost::mpl::vector3<void, PyObject*, ALCdevice&>]' /home/eliot/root/usr/include/boost/python/object/py_function.hpp:38:   instantiated from 'PyObject* boost::python::objects::caller_py_function_impl<Caller>::operator()(PyObject*, PyObject*) [with Caller = boost::python::detail::caller<void (*)(PyObject*, ALCdevice&), boost::python::default_call_policies, boost::mpl::vector3<void, PyObject*, ALCdevice&> >]' generated/ogreoggsound_1.21/OgreOggSoundRecord.pypp.cpp:89:   instantiated from here /home/eliot/root/usr/include/boost/python/type_id.hpp:89: error: invalid use of incomplete type 'struct ALCdevice_struct' /usr/include/AL/alc.h:44: error: forward declaration of 'struct ALCdevice_struct' scons: *** [build_dir_2.6/ogreoggsound_1.21/OgreOggSoundRecord.pypp.os] Error 1 igrok wrote:Mohican wrote:<< OgreOggSound Add-on >> >sudo apt-get install libogg-dev >sudo apt-get install libopenal-dev >sudo apt-get install libvorbis-dev >python python-ogre/BuildModule.py -r ogreoggsound >python python-ogre/BuildModule.py -b -v ogreoggsound >ogreoggsound/cmake . -DCMAKE_INSTALL_PREFIX=/home/mohican/pyogre/root/usr >ogreoggsound/make >ogreoggsound/make install >python python-ogre/BuildModule.py -g -v ogreoggsound >python python-ogre/BuildModule.py -c -v ogreoggsound --ERROR-- generated/ogreoggsound_1.21/OgreOggSoundRecord.pypp.cpp:89:1: instantiated from here /home/mohican/pyogre/root/usr/include/boost/python/type_id.hpp:89:9: error: invalid use of incomplete type ‘struct ALCdevice_struct’ /usr/include/AL/alc.h:43:16: error: forward declaration of ‘struct ALCdevice_struct’ scons: *** [build_dir_2.7/ogreoggsound_1.21/OgreOggSoundRecord.pypp.os] Error 1 I'm seeing a quite similar issue - forward declaration of ‘struct ALCdevice_struct’. I've looked through the sources mentioned, but I have to admit I'm lost. I'm using Gentoo with openal-soft-1.11.753 and boost-1.42 Code: Select all 09-18 22:57 PythonOgre.BuildModule DEBUG scons: warning: BuildDir() and the build_dir keyword have been deprecated;         use VariantDir() and the variant_dir keyword instead. File "/home/eliot/python-ogre/SConstruct", line 228, in <module> In file included from /home/eliot/root/usr/include/boost/python/instance_holder.hpp:11,                  from /home/eliot/root/usr/include/boost/python/object/pointer_holder.hpp:14,                  from /home/eliot/root/usr/include/boost/python/to_python_indirect.hpp:10,                  from /home/eliot/root/usr/include/boost/python/converter/arg_to_python.hpp:10,                  from /home/eliot/root/usr/include/boost/python/call.hpp:15,                  from /home/eliot/root/usr/include/boost/python/object_core.hpp:12,                  from /home/eliot/root/usr/include/boost/python/args.hpp:25,                  from /home/eliot/root/usr/include/boost/python.hpp:11,                  from generated/ogreoggsound_1.21/OgreOggSoundRecord.pypp.cpp:3: /home/eliot/root/usr/include/boost/python/type_id.hpp: In function 'boost::python::type_info boost::python::type_id() [with T = ALCdevice&]': /home/eliot/root/usr/include/boost/python/detail/signature.hpp:98:   instantiated from 'static const boost::python::detail::signature_element* boost::python::detail::signature_arity<2u>::impl<Sig>::elements() [with Sig = boost::mpl::vector3<void, PyObject*, ALCdevice&>]' /home/eliot/root/usr/include/boost/python/detail/caller.hpp:232:   instantiated from 'static boost::python::detail::py_func_sig_info boost::python::detail::caller_arity<2u>::impl<F, Policies, Sig>::signature() [with F = void (*)(PyObject*, ALCdevice&), Policies = boost::python::default_call_policies, Sig = boost::mpl::vector3<void, PyObject*, ALCdevice&>]' /home/eliot/root/usr/include/boost/python/object/py_function.hpp:48:   instantiated from 'boost::python::detail::py_func_sig_info boost::python::objects::caller_py_function_impl<Caller>::signature() const [with Caller = boost::python::detail::caller<void (*)(PyObject*, ALCdevice&), boost::python::default_call_policies, boost::mpl::vector3<void, PyObject*, ALCdevice&> >]' generated/ogreoggsound_1.21/OgreOggSoundRecord.pypp.cpp:89:   instantiated from here /home/eliot/root/usr/include/boost/python/type_id.hpp:89: error: invalid use of incomplete type 'struct ALCdevice_struct' /usr/include/AL/alc.h:44: error: forward declaration of 'struct ALCdevice_struct' /home/eliot/root/usr/include/boost/python/type_id.hpp: In function 'boost::python::type_info boost::python::type_id() [with T = const volatile ALCdevice_struct&]': /home/eliot/root/usr/include/boost/python/converter/registered.hpp:87:   instantiated from 'const boost::python::converter::registration& boost::python::converter::detail::registry_lookup2(T& (*)()) [with T = const volatile ALCdevice_struct]' /home/eliot/root/usr/include/boost/python/converter/registered.hpp:94:   instantiated from 'const boost::python::converter::registration& boost::python::converter::detail::registry_lookup1(boost::type<Target>) [with T = const volatile ALCdevice_struct&]' /home/eliot/root/usr/include/boost/python/converter/registered.hpp:105:   instantiated from 'const boost::python::converter::registration& boost::python::converter::detail::registered_base<const volatile ALCdevice_struct&>::converters' /home/eliot/root/usr/include/boost/python/converter/arg_from_python.hpp:283:   instantiated from 'boost::python::converter::reference_arg_from_python<T>::reference_arg_from_python(PyObject*) [with T = ALCdevice&]' /home/eliot/root/usr/include/boost/python/arg_from_python.hpp:70:   instantiated from 'boost::python::arg_from_python<T>::arg_from_python(PyObject*) [with T = ALCdevice&]' /home/eliot/root/usr/include/boost/preprocessor/iteration/detail/local.hpp:37:   instantiated from 'PyObject* boost::python::detail::caller_arity<2u>::impl<F, Policies, Sig>::operator()(PyObject*, PyObject*) [with F = void (*)(PyObject*, ALCdevice&), Policies = boost::python::default_call_policies, Sig = boost::mpl::vector3<void, PyObject*, ALCdevice&>]' /home/eliot/root/usr/include/boost/python/object/py_function.hpp:38:   instantiated from 'PyObject* boost::python::objects::caller_py_function_impl<Caller>::operator()(PyObject*, PyObject*) [with Caller = boost::python::detail::caller<void (*)(PyObject*, ALCdevice&), boost::python::default_call_policies, boost::mpl::vector3<void, PyObject*, ALCdevice&> >]' generated/ogreoggsound_1.21/OgreOggSoundRecord.pypp.cpp:89:   instantiated from here /home/eliot/root/usr/include/boost/python/type_id.hpp:89: error: invalid use of incomplete type 'struct ALCdevice_struct' /usr/include/AL/alc.h:44: error: forward declaration of 'struct ALCdevice_struct' scons: *** [build_dir_2.6/ogreoggsound_1.21/OgreOggSoundRecord.pypp.os] Error 1 #if OGRE_PLATFORM == OGRE_PLATFORM_WIN32       OgreOggSoundRecord* createRecorder();       /** Gets recording device        */       OgreOggSoundRecord* getRecorder() { return mRecorder; }       /** Returns whether a capture device is available        */       bool isRecordingAvailable() const;       /** Creates a recordable object        */ #endif def ManualExclude ( mb ):     global_ns = mb.global_ns     if MAIN_NAMESPACE:         main_ns = global_ns.namespace( MAIN_NAMESPACE )     else:         main_ns = global_ns        excludes=['::OgreOggSound::WAVEHEADER'             ] ->    if os.name =='posix': ->        excludes.append("::OgreOggSound::OgreOggSoundRecord")     for e in excludes:         main_ns.class_(e).exclude() ... Loading library libOgreOggSound Installing plugin: OgreOggSound MovableObjectFactory for type 'OgreOggISound' registered. Plugin successfully installed ***************************************** *** --- Initialising OgreOggSound --- *** *** ---     OgreOggSound v1.21    --- *** ***************************************** *** --- OpenAL version 1.1 *** --- AVAILABLE DEVICES --- *** *** --- PulseAudio Default *** --- ALSA Default *** --- No Output *** --- Choosing: PulseAudio Default (Default device) *** --- OpenAL Device successfully created *** --- OpenAL Context successfully created *** --- SUPPORTED FORMATS *** --- Created 100 sources for simultaneous sounds *** --- Using BOOST threads for streaming ***************************************** *** ---  OgreOggSound Initialised --- *** ***************************************** <ogre.sound.ogreoggsound._ogreoggsound_.OgreOggStreamWavSound object at 0x2b480c0> terminate called after throwing an instance of 'Ogre::InternalErrorException'   what():  OGRE EXCEPTION(7:InternalErrorException): Not a valid WAVE file in OgreOggStreamWavWavSound::_openImpl() at .../development/ogreoggsound/src/OgreOggStreamWavSound.cpp (line 156) Aborted thios wrote:Curiously, running the demo on ubuntu 11.04 with the resulting library fails with: Code: Select all Loading library libOgreOggSound Installing plugin: OgreOggSound MovableObjectFactory for type 'OgreOggISound' registered. Plugin successfully installed ***************************************** *** --- Initialising OgreOggSound --- *** *** ---     OgreOggSound v1.21    --- *** ***************************************** *** --- OpenAL version 1.1 *** --- AVAILABLE DEVICES --- *** *** --- PulseAudio Default *** --- ALSA Default *** --- No Output *** --- Choosing: PulseAudio Default (Default device) *** --- OpenAL Device successfully created *** --- OpenAL Context successfully created *** --- SUPPORTED FORMATS *** --- Created 100 sources for simultaneous sounds *** --- Using BOOST threads for streaming ***************************************** *** ---  OgreOggSound Initialised --- *** ***************************************** <ogre.sound.ogreoggsound._ogreoggsound_.OgreOggStreamWavSound object at 0x2b480c0> terminate called after throwing an instance of 'Ogre::InternalErrorException'   what():  OGRE EXCEPTION(7:InternalErrorException): Not a valid WAVE file in OgreOggStreamWavWavSound::_openImpl() at .../development/ogreoggsound/src/OgreOggStreamWavSound.cpp (line 156) Aborted I haven't been able to figure this out in a while now so I ended up using ogreal instead, both on linux and windows. While we're on the subject though, I thought I'd bring it up. import wave as w import struct f = open("./media/roar.wav", "rb") format = "<4sL4s4sLHHLLHH" print struct.unpack(format, f.read(36)) f.close() $ qwavheaderdump roar.wav roar.wav (118316 bytes):         riff: 'RIFF'         riff length: 118308         wave: 'WAVE'         fmt: 'fmt '         fmt length: 16         format: 1         channels: 1         sample rate: 22050         bytes/second: 44100         bytes/sample: 2         bits/sample: 16         data: 'fact'                 data field should be 'data'         data length: 4                 data length field should be 118272 thios wrote:There's also another thread that deals with what seems to be the same problem, but no solution has been offered. http://www.ogre3d.org/addonforums/viewtopic.php?f=19&t=14791 I'll try to look into it further (but any help is of course welcome). Users browsing this forum: No registered users and 1 guest
I create a custom command via def spawn_pot(ctx): ctx.recurse ('po') class spawnpot(BuildContext): cmd = 'spawnpot' fun = 'spawn_pot' and I would like to set a tooltip, but I could not find how to do that. Currently the waf --help looks like this (truncated): Main commands (example: ./waf build -j4) build : executes the build ... updatepo : ...
If you are computing an L2-norm, you could compute it directly (using the axis=-1 argument to sum along rows): np.sum(np.abs(x)**2,axis=-1)**(1./2) Lp-norms can be computed similarly of course. It is considerably faster than np.apply_along_axis, though perhaps not as convenient: In [48]: %timeit np.apply_along_axis(np.linalg.norm, 1, x) 1000 loops, best of 3: 208 us per loop In [49]: %timeit np.sum(np.abs(x)**2,axis=-1)**(1./2) 100000 loops, best of 3: 18.3 us per loop Other ord forms of norm can be computed directly too (with similar speedups): In [55]: %timeit np.apply_along_axis(lambda row:np.linalg.norm(row,ord=1), 1, x) 1000 loops, best of 3: 203 us per loop In [54]: %timeit np.sum(abs(x), axis=-1) 100000 loops, best of 3: 10.9 us per loop
How would I write the following Java PriorityQueue in Python? PriorityQueue<Integer[]> pq = new PriorityQueue<Integer[]>(11, new Comparator<Integer[]>() { public int compare(Integer[] A, Integer[] B) { return A[0] < B[0] ? -1 : 1; } }); I got as far as from Queue import PriorityQueue def my_method(self): pq = # I got stuck here since I need to include "comparator" I have looked through many examples such as Creating a python priority Queue but they don't seem to be defining a priorty function or comparator of some sort.
FTL Performance FTL Optimization Strategy LLVM Patch Points FTL-Style LLVM IR MCJIT and the LLVM C API Linking WebKit with LLVM FTL Efficiency Optimization Improvements Extending Patch Points Conclusion Before translating to LLVM IR, WebKit's optimizing JIT operates on an IR that clearly expresses JavaScript semantics. Through type inference and profile-driven speculation, WebKit removes as much of the JavaScript abstraction penalty as possible. LLVM IR has now adopted features for supporting speculative, profile-driven optimization and avoiding the performance penalty associated with abstractions when they cannot be removed. Figure 1: Time to run benchmarks from LLVM test-suite. [1]. One reason for the discrepancy between clang and FTL is the call overhead required for maintaining the JavaScript runtime's additional frame information. Another reason is that LLVM loop optimizations are not yet sophisticated enough to remove bounds and overflow checks and thus have not been enabled. These benchmarks are very tight loops, so a minor inefficiency, such as an extra compare or store in the loop, can result in a significant slowdown. [1]gcc-loops is currently an outlier because clang performance recently sped up dramatically from auto-vectorization that has not been enabled yet in FTL. Figure 2.The DFG and FTL JIT optimization pipelines (from Introducing the WebKit FTL JIT). Figure 3.The FTL optimization pipeline after lowering to LLVM IR. The dynamic link time initialization overhead of the static initializers that LLVM defines is unacceptable at program launch time - especially if only parts of the library or nothing at all are used. LLVM initializes global variables that require running exit-time destructors. This causes a multi-threaded parent application that attempts to exit normally to crash instead. As with static initializers, weak vtables introduce an unnecessary and unacceptable dynamic link time overhead. In general only a limited set of methods - the LLVM API - should be exported from the shared library. LLVM usurps process-level API calls like assert, raise, and abort. The resulting size of the LLVM shared library naively built from static libraries is larger than it needs to be. Build logic and conditional compilation should be added to ensure that only the passes and platform support required by the JIT client are ultimately linked into the shared library. %a = cmp <TrapConditionA> call @patchpoint(1, %a, <state-before-loop>) Loop: %b = cmp <TrapConditionB> @patchpoint(2, %b, <state-inside-loop>) <do something...> Could be safely optimized into: %c = cmp <TrapConditionC> // where C implies both A and B @patchpoint(1, %c, <state-before-loop>) Loop: do something... Note that the first patch point operand is an identifier that tells the runtime the program location of the intrinsic, allowing it find the correct stack map record for the program state at that location. After the above optimization, not only does LLVM avoid performing repeated checks within the loop, but it also avoids maintaining additional runtime state throughout the loop body. Generally, high level optimization requiring knowledge of language-specific semantics is best performed on a higher level IR. But in this case, extending LLVM with one aspect of high level semantics allows LLVM's loop and expression analysis to be directly leveraged and naturally extended into a new class of optimization.
JavaScript heinz_stapff — 2011-10-09T13:34:24-04:00 — #1 I don't understand why I can't get either of these methodes to work but for sure there are syntax errors in the script that are not being reported by 'Developer' tools in IE8. Script not working function getprompt(){ /* f1.innerHTML=' '; var f1prompt=document.createElement('div'); f1prompt.id='f1prompt'; var label=document.createElement('label'); label.setAttribute("for", "productreturn"); f1prompt.appendChild(label); var productreturn=document.createElement('input'); productreturn.id='productreturn'; productreturn.value=products.slice(-1); f1prompt.appendChild(productreturn); var breturn=document.createElement('button'); breturn.id='breturn'; f1prompt.appendChild(breturn); document.getElementById('f1').appendChild(f1prompt);//doesn't work? */ f1.innerHTML='<div id="f1prompt">\ '; //must be syntax error f1.innerHTML+='<label for="productreturn">You must return to the product page:</label>\ '; f1.innerHTML+='<input id="productreturn" type="text" value="products.slice(-1)" />\ '; f1.innerHTML+='<button id="return">Return</button>\ '; f1.innerHTML+='</div>'; } function viewcart(){ var items=cartbody.rows.length; if(f1.className=='htmlpage'){ //prompt('You need to return to product page: ',products.slice(-1));//works getprompt();//f1 returns blank? //f1.innerHTML=getprompt(); tried & returned blank f1? } Spacing-out:nono: again! Any help greatly appreciated. felgall — 2011-10-09T14:24:33-04:00 — #2 Where is the id="f1" in the HTML? heinz_stapff — 2011-10-09T14:53:12-04:00 — #3 Hey felgall It's Bellow the Horizontal logo and right of vertical sidebar nav. index.html <div id="f1" class="htmlpage"> </div> index.css #f1 { display:inline; position:absolute; left:17%; top:31%; width:82.6%; height:58.5%; overflow:auto; overflow-x:hidden !important; border:2px solid #e8b23d; margin:0; } #f1prompt { display:none; position:absolute; left:17%; top:31%; width:82.6%; height:58.5%; overflow:hidden; border:2px solid red; margin:0; z-index:100; background:#fff; } //sorry posted f1label by mistake .htmlpage { width:100%; height:100%; background:#e8b235; overflow-x:hidden !important; z-index:-200;} The 'f1prompt' is right on top of 'f1' with z-index but any objects written to 'f1' show through 'f1promt' if 'f1prompt' is written as div in index.html and called in function to change CSS from display none to display block so I still have to call 'f1' innerHTML ' '/BLANK to get the 'f1prompt' to show regardless of what z-index I guess the object has the ultimate z-index even though I set z-index on class 'htmlpage' to -200? So I have to write the 'f1promt' directly to 'f1' innerHTML. heinz_stapff — 2011-10-09T15:19:04-04:00 — #4 Writing the 'f1prompt' div directly into the Index.html allowed me to style the div correctly and apply an addEvent to the OK./Return button 'f1prompt' contains but I need to write it to the innerHTML of div id 'f1' directly and apply the onclick to the return button. Then restyle the 'f1prompt' to fit. ulricht609 — 2011-10-10T08:23:44-04:00 — #5 maybe this can help you out: its not coded so well but could be tweek for better performance it seems like something that could be of assistance <html> <head runat="server"> <title>window interface</title> <script type="text/javascript"> var global_obj; var global_obj_width; var global_obj_height; var global_obj_top; var global_obj_left; var global_obj_right; var global_obj_bottom; var clickcounter = 0; var gloabl_obj_name; var global_objnameAJT = new Array(); global_objnameAJT[0] = "main"; global_objnameAJT[1] = "options"; var global_zIndexAJT = new Array(); global_zIndexAJT[0] = "1000"; global_zIndexAJT[1] = "999"; //====================================================== function setGlobalVariables(temp_obj, temp_obj_width, temp_obj_height, temp_obj_top, temp_obj_left, temp_obj_right, temp_obj_bottom, obj_name) { global_obj = temp_obj; global_obj_width = temp_obj_width; global_obj_height = temp_obj_height; global_obj_top = temp_obj_top; global_obj_left = temp_obj_left; global_obj_right = temp_obj_right; global_obj_bottom = temp_obj_bottom; gloabl_obj_name = obj_name; } //============MOVING THE DIV WITH THE MOUSE============= function moveDIV(obj_name, _x, _y) { var obj = document.getElementById(obj_name + 'DIV'); var obj_width = parseInt(obj.style.width); var obj_height = parseInt(obj.style.height); var obj_top = parseInt(obj.style.top); var obj_left = parseInt(obj.style.left); var obj_right = obj_left + obj_width; var obj_bottom = obj_top + obj_height; obj.style.top = (_y - 15) + 'px'; obj.style.left = (_x - (obj_width / 2)) + 'px'; } //end function moveDIV(obj_name, _x, _y) //this function captures the div //and basically prepares it for being dragged/moved function onmousedown_captureDIV(obj_name) { clickcounter = 1; var obj = document.getElementById(obj_name + 'DIV'); var obj_width = parseInt(obj.style.width); var obj_height = parseInt(obj.style.height); var obj_top = parseInt(obj.style.top); var obj_left = parseInt(obj.style.left); var obj_right = obj_left + obj_width; var obj_bottom = obj_top + obj_height; setGlobalVariables(obj, obj_width, obj_height, obj_top, obj_left, obj_right, obj_bottom, obj_name); set_movingDIV_style(obj_name); reArrangeWindowOrder(obj_name); } //this function stops the move function onmouseup_releaseDIV(obj_name) { clickcounter = 0; set_stationaryDIV_style(obj_name); } //changes the divs style to the movingn style function set_movingDIV_style(obj_name) { var mainobj = document.getElementById(obj_name + 'DIV'); var obj_titlebar = document.getElementById(obj_name + '_titlebarDIV'); var obj_content = document.getElementById(obj_name + '_contentDIV'); obj_titlebar.style.display = "none"; obj_content.style.display = "none"; mainobj.style.backgroundColor = "Transparent"; mainobj.style.border = "1pt dashed black"; mainobj.style.cursor = "move"; } //changes the divs style to stationary style function set_stationaryDIV_style(obj_name) { var mainobj = document.getElementById(obj_name + 'DIV'); var obj_titlebar = document.getElementById(obj_name + '_titlebarDIV'); var obj_content = document.getElementById(obj_name + '_contentDIV'); obj_titlebar.style.display = "block"; if (mainobj.style.height == "30px") { } else { obj_content.style.display = "block"; } mainobj.style.backgroundColor = "White"; mainobj.style.border = "1pt solid black"; mainobj.style.cursor = "default"; } function reArrangeWindowOrder(obj_name) { // alert(obj_name); //----------------------------------------------------------- //store the windows/divs names in a temporary array var temp1 = new Array(global_objnameAJT.length); for (var i = 0; i &lt; global_objnameAJT.length; i++) { temp1[i] = global_objnameAJT[i]; } //------------------------------------------------------------ //-------------------------------------------------------------------------------- //set the selected object as the first in array, or on top in order of z-index global_objnameAJT[0] = obj_name; //---------------------------------------------------------------------------------- //-------------------------------------------------------------------------------- //re order the array var counter = 1; for (var i = 0; i &lt; temp1.length; i++) { if (temp1[i] != obj_name) { global_objnameAJT[counter] = temp1[i]; counter++; } else { } } //------------------------------------------------------------------------------------ //--------------------------------------------------------------------------- //set the divs zindex to 1234 for (var i = 0; i &lt; global_objnameAJT.length; i++) { var tempobj = document.getElementById(global_objnameAJT[i] + 'DIV'); tempobj.style.zIndex = global_zIndexAJT[i]; //alert(global_zIndexAJT[i]); } //------------------------------------------------------------------------------- } //===================================================== //==================WINDOW/DIV FUNCTIONS=================================== //minimize the div, make only the titlebar visible function minimize_maximizeDIV(obj_name) { var mainobj = document.getElementById(obj_name + 'DIV'); var obj_titlebar = document.getElementById(obj_name + '_titlebarDIV'); var obj_content = document.getElementById(obj_name + '_contentDIV'); if (mainobj.style.height == "30px") { //maximize obj_titlebar.style.display = "block"; obj_content.style.display = "block"; var obj_titlebar_height = parseInt(obj_titlebar.style.height); var obj_content_height = parseInt(obj_content.style.height); document.getElementById('minmax_' + obj_name).innerHTML = "_"; document.getElementById('minmax_' + obj_name).title = "Minimize"; var winW = 630, winH = 460; if (document.body && document.body.offsetWidth) { winW = document.body.offsetWidth; winH = document.body.offsetHeight; } if (document.compatMode == 'CSS1Compat' && document.documentElement && document.documentElement.offsetWidth) { winW = document.documentElement.offsetWidth; winH = document.documentElement.offsetHeight; } if (window.innerWidth && window.innerHeight) { winW = window.innerWidth; winH = window.innerHeight; } var page_height = winH; var page_width = winW; if ((parseInt(mainobj.style.top) + parseInt(mainobj.style.height)) &gt;= (parseInt(page_height) - 100)) { mainobj.style.top = (parseInt(page_height) - (obj_titlebar_height + obj_content_height)) + 'px'; } mainobj.style.height = (obj_titlebar_height + obj_content_height) + 'px'; } else { //minimize obj_titlebar.style.display = "block"; obj_content.style.display = "none"; document.getElementById('minmax_' + obj_name).innerHTML = "+"; document.getElementById('minmax_' + obj_name).title = "Maximize"; var winW = 630, winH = 460; if (document.body && document.body.offsetWidth) { winW = document.body.offsetWidth; winH = document.body.offsetHeight; } if (document.compatMode == 'CSS1Compat' && document.documentElement && document.documentElement.offsetWidth) { winW = document.documentElement.offsetWidth; winH = document.documentElement.offsetHeight; } if (window.innerWidth && window.innerHeight) { winW = window.innerWidth; winH = window.innerHeight; } var page_height = winH; var page_width = winW; if ((parseInt(mainobj.style.top) + parseInt(mainobj.style.height)) &gt;= (parseInt(page_height) - 100)) { mainobj.style.top = (parseInt(page_height) - 40) + 'px'; } mainobj.style.height = "30px"; } reArrangeWindowOrder(obj_name); } //========================================================================= //==============MOUSE CAPTURE========================== var IE = document.all ? true : false; if (!IE) document.captureEvents(Event.MOUSEMOVE) document.onmousemove = getMouseXY; var tempX = 0; var tempY = 0; function getMouseXY(e) { if (IE) { // grab the x-y pos.s if browser is IE tempX = event.clientX + document.body.scrollLeft; tempY = event.clientY + document.body.scrollTop; } else { // grab the x-y pos.s if browser is NS tempX = e.pageX; tempY = e.pageY; } if (tempX &lt; 0) { tempX = 0; } if (tempY &lt; 0) { tempY = 0; } //------------------------------------------------------------ //now it works in FireFox, Chrome, and Internet Explorer if (clickcounter == 1) { moveDIV(gloabl_obj_name, tempX, tempY); } //------------------------------------------------------------ return true; } //===================================================== //===============Setting up the layout========================= function set_newPosition() { var new_obj = document.getElementById('newDIV'); var new_obj_width = parseInt(new_obj.style.width); var new_obj_height = parseInt(new_obj.style.height); var new_obj_top = parseInt(new_obj.style.top); var new_obj_left = parseInt(new_obj.style.left); var new_obj_right = new_obj_left + new_obj_width; var new_obj_bottom = new_obj_top + new_obj_height; var winW = 630, winH = 460; if (document.body && document.body.offsetWidth) { winW = document.body.offsetWidth; winH = document.body.offsetHeight; } if (document.compatMode == 'CSS1Compat' && document.documentElement && document.documentElement.offsetWidth) { winW = document.documentElement.offsetWidth; winH = document.documentElement.offsetHeight; } if (window.innerWidth && window.innerHeight) { winW = window.innerWidth; winH = window.innerHeight; } var page_height = winH; var page_width = winW; new_obj.style.top = (page_height - new_obj_height) + 'px'; } //end function set_newPosition() var newwindowcounter = 0; function CreateNewWindow() { newwindowcounter++; /* This method deals with creating a new window object. there is an erro here with the userMe and userYou variables their values keep/ sometimes coming back as undefined, but other times they work just fine */ var id = "newwindow" + newwindowcounter.toString(); //alert(id); var width = "250px"; var height = "300px"; var left = "100px"; var top = "100px"; var newdiv = document.createElement("div"); //creates the element //--------------------------------------------Sets attributes and properties of the div element newdiv.setAttribute('id', id + "DIV"); newdiv.style.width = width; newdiv.style.height = height; newdiv.style.position = "absolute"; newdiv.style.left = left; newdiv.style.top = top; newdiv.style.background = "orange"; //should be random colors, or no two boxes have the same color newdiv.style.border = "1pt solid black"; var htmlstring = "&lt;div id='" + id + "_titlebarDIV' style='border: 1pt solid black; width:250px; height: 30px; background-color:White; position: absolute; top:0px; left: 0px;' onmouseup='onmouseup_releaseDIV('" + id + "');'&gt;" + "&lt;table height='30px' width='100%' cellpadding='0' cellspacing='0'&gt;"+ "&lt;tr&gt;"+ "&lt;td id='title_" + id + "' align='left' style='width:220px; cursor:move;' onmousedown='onmousedown_captureDIV('" + id + "');'&gt;" + "New Window : " + id + "&lt;/td&gt;"+ "&lt;td id='minmax_" + id + "' align='center' style='width:30px; cursor:pointer;' title='Minimize' onclick='minimize_maximizeDIV('" + id + "')'&gt;" + " _"+ "&lt;/td&gt;"+ "&lt;/tr&gt;"+ "&lt;/table&gt;"+ "&lt;/div&gt;"+ "&lt;div id='" + id + "_contentDIV' style='border: 1pt solid black; width:250px; height: 270px; background-color:Silver; position: absolute; top:30px; left: 0px;'&gt;" + "&lt;table border='1' cellspacing='0' cellpadding='0'&gt;" + "&lt;tr&gt;" + "&lt;td colspan='2' align='center' style='border-bottom: 1pt solid black;'&gt;" + "&lt;u&gt;A NEW WINDOW&lt;/u&gt;" + "&lt;/td&gt;" + "&lt;/tr&gt;" + "&lt;tr&gt;" + "&lt;td valign='top' align='left' style='border-right: 3pt solid gray; border-bottom: 1pt solid black;'&gt;" + "Something here" "&lt;/td&gt;" + "&lt;/tr&gt;" + "&lt;/table&gt;" + "&lt;/div&gt;"; newdiv.innerHTML = htmlstring; newdiv.onmouseup = function() { onmouseup_releaseDIV(id); }; //onmouseup="onmouseup_releaseDIV('games');" newdiv.onclick = function() { reArrangeWindowOrder(id); };//re arranges the windows //-------------------------------------------------------------------------------------------- document.body.appendChild(newdiv); //adds the element to the body global_objnameAJT[global_objnameAJT.length] = id; global_zIndexAJT[global_zIndexAJT.length] = global_zIndexAJT[global_zIndexAJT.length - 1] - 1; reArrangeWindowOrder(id); } //function CreateNewObject() //================================= &lt;/script&gt; </head> <body> <form id="form1" runat="server"> <div id="optionsDIV" style="border: 1pt solid black; width:400px; height: 200px; background-color:White; position: absolute; top:0px; left: 0px;" onclick="reArrangeWindowOrder('options');" onmouseup="onmouseup_releaseDIV('options');"> <div id="options_titlebarDIV" style="border: 1pt solid black; width:400px; height: 30px; background-color:White; position: absolute; top:0px; left: 0px;" onmouseup="onmouseup_releaseDIV('options');"> <table height="30px" width="100%" cellpadding="0" cellspacing="0"> <tr> <td id="title_options" align="left" style="width:370px; cursor:move;" onmousedown="onmousedown_captureDIV('options');"> OPTIONS </td> <td id="minmax_options" align="center" style="width:30px; cursor:pointer;" title="Minimize" onclick="minimize_maximizeDIV('options')"> _ </td> </tr> </table> </div> <div id="options_contentDIV" style="border: 1pt solid black; width:400px; height: 170px; background-color:Silver; position: absolute; top:30px; left: 0px;"> the options: <br /> more tabs, <br /> more windows; <br /> <a href="javascript:CreateNewWindow();">create new window</a> </div> </div> &lt;div id="mainDIV" style="border: 1pt solid black; width:600px; height: 800px; background-color:White; position: absolute; top:80px; left: 250px;" onclick="reArrangeWindowOrder('main');" onmouseup="onmouseup_releaseDIV('main');"&gt; &lt;div id="main_titlebarDIV" style="border: 1pt solid black; width:600px; height: 30px; background-color:White; position: absolute; top:0px; left: 0px;" onmouseup="onmouseup_releaseDIV('main');"&gt; &lt;table height="30px" width="100%" cellpadding="0" cellspacing="0"&gt; &lt;tr&gt; &lt;td id="title_main" align="left" style="width:570px; cursor:move;" onmousedown="onmousedown_captureDIV('main');"&gt; MAIN &lt;/td&gt; &lt;td id="minmax_main" align="center" style="width:30px; cursor:pointer;" title="Minimize" onclick="minimize_maximizeDIV('main')"&gt; _ &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/div&gt; &lt;div id="main_contentDIV" style="border: 1pt solid black; width:600px; height: 770px; background-color:Silver; position: absolute; top:30px; left: 0px;"&gt; here the main content will go &lt;/div&gt; &lt;/div&gt; &lt;/form&gt; </body> </html> ulricht609 — 2011-10-11T03:10:15-04:00 — #6 the function CreateNewWindow() has three lines of code that must be changed... when the code was posted it changed the { &.#.0.3.9.; (without . obviously)} to ' (single quote) so for the code to work correctly three lines must be replaced the three to be replaced are : 1) var htmlstring = "<div id='" + id + "titlebarDIV' style='border: 1pt solid black; width:250px; height: 30px; background-color:White; position: absolute; top:0px; left: 0px;' onmouseup='onmouseupreleaseDIV('" + id + "');'>" + 2)"<td id='title_" + id + "' align='left' style='width:220px; cursor:move;' onmousedown='onmousedown_captureDIV('" + id + "');'>" + 3)"<td id='minmax_" + id + "' align='center' style='width:30px; cursor: pointer;' title='Minimize' onclick='minimize_maximizeDIV('" + id + "')'>" + if the code is rendered incorrectly; -> then just change in the green parts the single quotes to the the (&#) equivalent http://www.w3schools.com/tags/ref_ascii.asp replace with: 1) var htmlstring = "<div id='" + id + "_titlebarDIV' style='border: 1pt solid black; width:250px; height: 30px; background-color:White; position: absolute; top:0px; left: 0px;' onmouseup='onmouseup_releaseDIV('" + id + "');'>" + 2) "<td id='title_" + id + "' align='left' style='width:220px; cursor:move;' onmousedown='onmousedown_captureDIV('" + id + "');'>" + 3) "<td id='minmax_" + id + "' align='center' style='width:30px; cursor: pointer;' title='Minimize' onclick='minimize_maximizeDIV('" + id + "')'>" + also the in cursor:pointer have turned out cursorointer, to correct this replace with cursor: pointer apologies for the inconvenience heinz_stapff — 2011-10-11T10:37:43-04:00 — #7 ulricht609 Thanks bud, I think I got it and have to check it out later. The real syntax problem was the 'var+=' wass wrong and not necessary? I tend to use single quotes in .js files so that anything inside would contain double quotes ". SOMETHING LIKE THIS f1.innerHTML='<div id="f1prompt"></br>'+//plus sign '<input type="button" id="breturn">Return</input></br>'+//I think 'return' is reserved javascript word? hence id 'b'return '<input type="text" id="productreturn" value="" /></br>'+ '</div>'; Right now I have several divs hardcoded in the HTML so I can use display none and display block to show and hide them for styling purposes. I probably should keep them but feel that pseudo prompts should be kept out of the html deepending on how the server side and PHP handles them. Thanks for the CORRECT syntax ulricht609 (: heinz_stapff — 2011-10-11T13:10:12-04:00 — #8 ulricht609 Hey I'm realizing how long your previous post was. Thanks for that. Seems you use double quotes in your .js where I use singlequote. So I'm still getting a blank 'f1' div with this syntax: index.js function viewcart(){ var items=cartbody.rows.length; if(f1.className=='htmlpage'){ f1.className='product';//change to appropriate class f1.innerHTML='<div id="f1prompt">'+ //f1 innerHTML returns blank?? syntax must be wrong? '<label for="productreturn">You must return to the product page:</label>'+ '<button id="breturn" onclick="preturn()">Return</button>'+//add onclick '<input id="productreturn" type="text" value="" />'+ '</div>'; document.getElementById('productreturn').value=products.slice(-1);//put value in new 'productreturn' text input } else{ //other stuff }} function preturn(){ //function for 'breturn' onclick f1.className='product'; //just realized I dulicated class change will take out var p=document.getElementById('productreturn').value; alert('Getting product: '+p); getproduct(p); f1prompt.style.display='none';//also not needed EvalSound2(); viewcart(); } heinz_stapff — 2011-10-11T13:33:32-04:00 — #9 :nono: Yeah ulricht609 I'm still getting a blank 'f1' div with this updated code so it's got to be a sequance or syntax error index.js function viewcart(){ var items=cartbody.rows.length; if(f1.className=='htmlpage'){ f1.className='product'; f1.innerHTML='<div id="f1prompt">'+ '<label for="productreturn">You must return to the product page:</label>'+ '<button id="breturn" onclick="preturn()">Return</button>'+ '<input id="productreturn" type="text" value="" />'+ '</div>'; //Not printing? document.getElementById('productreturn').value=products.slice(-1); } else{ //other stuff }} function preturn(){ var p=document.getElementById('productreturn').value; alert('Getting product: '+p); getproduct(p); EvalSound2(); } Still returns blank 'f1' div:x OK! It helps if you don't have the CSS declaring 'f1prompt display None!!!' Sorry about that ulricht609 it does work as far as the innerHTML syntax goes! I'll post back after restyling to get it correct. Thanks for your patience. heinz_stapff — 2011-10-11T14:19:35-04:00 — #10 ulricht609 Thanks again for everything. I got it runing perfectly writing to 'f1' innerHTML which allows me to take the 'f1prompt' completly out of the index.html. Of course there was a problem with the IE8 CSS with width and height on elements with borders but a little adjusting got it right. index.css /*All elements created by writing to innerHTML of #f1 div styled correctly*/ #f1prompt { display:block; position:relative; left:0%; top:0%; width:99.5%; height:98%; overflow:hidden; border:2px solid #2c3664; margin:0; background:#fff; } //wierd height and widths in IE8 produces width 100% and height 100% of #f1 div? #f1prompt label{ color:#2c3664; float:left; text-align:center; margin:20% 2% 10% 10%; font:normal normal Bold 150%/150% "times new roman", arial, courier;} #f1prompt input[type="text"] { display:inline; width:21%; margin:21% 0% 10% 0%; } #breturn{ display:inline; color:#e8b23d; background:#2c3664; padding:.5%; margin:21% 1% 10% 0%; border:2px solid #e8b23d; font-family:"times new roman"; font-size:100%; font-weight:bold; text-decoration:none; } #breturn:hover{ color:white; background:#2c3664; padding:.5%; margin:21% 0% 10% 0%; border:2px solid #e8b23d; font-family:"times new roman"; font-size:100%; font-weight:bold; text-decoration:none; } index.js function viewcart(){ var items=cartbody.rows.length; if(f1.className=='htmlpage'){ f1.className='product'; //prompt('You need to return to product page: ',products.slice(-1)); //to remind me what I was trying to do f1.innerHTML='<div id="f1prompt">'+ '<label for="productreturn">You must return to the product page:</label>'+ '<button id="breturn" onclick="preturn()">Return</button>'+ '<input id="productreturn" type="text" value="" />'+ '</div>'; document.getElementById('productreturn').value=products.slice(-1); //works fine!! } else if(items<=1){ alert('You have not ordered an Item. '); //works fine!! } else if((f2.className=='register')&&(items>=2)){ f2.className='viewcheckout'; submitbutton.style.visibility='hidden'; printorder.style.visibility='hidden'; orderinfo.style.visibility='hidden'; header.className='header'; carttable.style.top='0px'; carthead.setAttribute('title','Click Header to Continue Shopping'); ordersum.setAttribute('title','Click to Continue Shopping'); getinvoice(); getorderdate(); //works fine!! } else{ f2.className='register'; header.className='header2'; carttable.style.top='22px'; carthead.setAttribute('title','Click Header to View more of Your Order'); ordersum.setAttribute('title','Click to View more of Your Order'); //works fine!! }} function preturn(){ var p=document.getElementById('productreturn').value; alert('Getting product: '+p); getproduct(p); EvalSound2(); } //short and sweet! works fine Thanks again ulricht609, your the best ulricht609 — 2011-10-12T03:01:47-04:00 — #11 its a pressure Heinz, im glad its working now, and if theres anything else i will gladly try and assist ulricht609 — 2011-10-12T03:06:18-04:00 — #12 regarding the double / single quotes issue. i generally use doubles to encase the entire string, single for the id, etc,. and [ (&#.039;)-without the . ] for any other quote(s) needed. the single quotes equivalent (&#) http://www.w3schools.com/tags/ref_ascii.asp example: var htmlstring = "<div id='" + id + "titlebarDIV' style='border: 1pt solid black; width:250px; height: 30px; background-color:White; position: absolute; top:0px; left: 0px;' onmouseup='onmouseupreleaseDIV(&#.039;" + id + "&#.039;);'>"; again without the . in &#.039;
krystoo Comment installer des mises à jour téléchargées ? Bonsoir, alors je vais faire le tour je crois ^^ après troisième installe sur le pc portable, se coup ci j'avais 197 mises à jour. J'ai fait en plusieurs fois car sinon interminable. Quand aux 6 dernières màj que j'ai téléchargé, visiblement elles ne se sont pas installées après redémarrage. J'ai tenté de les installé depuis le terminal avec "sudo apt-get upgrade" = Lecture des listes de paquets... Fait Construction de l'arbre des dépendances Lecture des informations d'état... Fait Les paquets suivants seront mis à jour : software-properties-common software-properties-gtk transmission-common transmission-gtk tzdata xul-ext-ubufox 6 mis à jour, 0 nouvellement installés, 0 à enlever et 0 non mis à jour. Il est nécessaire de prendre 0 o/1 198 ko dans les archives. Après cette opération, 25,6 ko d'espace disque supplémentaires seront utilisés. Souhaitez-vous continuer [O/n] ? Donc je dit "o" = Préconfiguration des paquets... (Lecture de la base de données... 55%dpkg : erreur fatale irréversible, abandon : lecture de la liste des fichiers du paquet « linux-headers-3.2.0-35 »: Erreur d'entrée/sortie E: Sub-process /usr/bin/dpkg returned an error code (2) Sachant que 55% dure bien 30 secondes avant d'enchainer. J'ai tenté depuis le tableau de bord clic droit et "Installer toutes les mises à jour" = installArchives() failed: Prconfiguration des paquets... Prconfiguration des paquets... Prconfiguration des paquets... (Reading database ... (Reading database ... 5%% (Reading database ... 10%% (Reading database ... 15%% (Reading database ... 20%% (Reading database ... 25%% (Reading database ... 30%% (Reading database ... 35%% (Reading database ... 40%% (Reading database ... 45%% (Reading database ... 50%% (Reading database ... 55%%dpkg: unrecoverable fatal error, aborting: reading files list for package 'linux-headers-3.2.0-35': Input/output error Error in function: SystemError: E:Sub-process /usr/bin/dpkg returned an error code (2) Et dans le gestionnaire de mises à jour on me dit toujours que j'ai ces 6 màj et on m'indique en dessous de la liste : 6 mises à jour ont été sélectionnées. Les mises à jour ont déjà étaient téléchargées, mais pas encore installées. Dernière modification par krystoo (Le 28/12/2012, à 01:12) Ubuntu 14.04 lts - carte graph : Intel(R) 82865G Graphics Controller - Q45/Q43 Chipset Boosté à fond rame un poil sur les vidéos -- & -- Ubuntu 14.04 lts - Lenovo 3000-N200 -- & -- un PC ACER Aspire M1600-EB7Z sauvé de la poubelle, nettoyé et dépoussiéré qui avait aussi vista qui ramait par a coups et de façon aléatoire 1.20Ghz redevenu 1.60Ghz grâce à Ubuntu et maintenant fuse. Hors ligne Maisondouf Re : Comment installer des mises à jour téléchargées ? Il doit y avoir des paquets à demi téléchargés, il faut vider le cache et refaire l'upgrade. Ça ve télécharger juste ce qui manque. sudo apt-get clean sudo apt-get update sudo apt-get upgrade ASUS M5A88-v EVO avec AMD FX(tm)-8120 Eight-Core Processor, OS principal Precise 12.04.1 LTS 63bits½ Bricoleur, menteur, inculte, inadapté social et mythomane, enfin d'après certains.... "the secret of my form is summed up in two words, no sport" (Winston Churchill) Hors ligne tiramiseb Re : Comment installer des mises à jour téléchargées ? Une erreur d'entrée-sortie peut signifier une défaillance du disque dur. Je pense que des paquets à moitié téléchargés généreraient une autre erreur... Hors ligne Maisondouf Re : Comment installer des mises à jour téléchargées ? Et il est où le message d'erreur ? Faut que je m'achète d'autre lunettes, peut-être.... ASUS M5A88-v EVO avec AMD FX(tm)-8120 Eight-Core Processor, OS principal Precise 12.04.1 LTS 63bits½ Bricoleur, menteur, inculte, inadapté social et mythomane, enfin d'après certains.... "the secret of my form is summed up in two words, no sport" (Winston Churchill) Hors ligne tiramiseb Re : Comment installer des mises à jour téléchargées ? Apparemment oui il te faut acheter de nouvelles lunettes Hors ligne krystoo Re : Comment installer des mises à jour téléchargées ? Re, pour : sudo apt-get clean sudo apt-get update sudo apt-get upgrade on me dit : krystoo@krystoo-3000-N200:~$ sudo apt-get clean [sudo] password for krystoo: krystoo@krystoo-3000-N200:~$ sudo apt-get update Ign http://security.ubuntu.com precise-security InRelease Ign http://extras.ubuntu.com precise InRelease Ign http://fr.archive.ubuntu.com precise InRelease Ign http://fr.archive.ubuntu.com precise-updates InRelease Ign http://fr.archive.ubuntu.com precise-backports InRelease Atteint http://security.ubuntu.com precise-security Release.gpg Réception de : 1 http://extras.ubuntu.com precise Release.gpg [72 B] Atteint http://fr.archive.ubuntu.com precise Release.gpg Atteint http://security.ubuntu.com precise-security Release Atteint http://fr.archive.ubuntu.com precise-updates Release.gpg Atteint http://extras.ubuntu.com precise Release Atteint http://fr.archive.ubuntu.com precise-backports Release.gpg Atteint http://fr.archive.ubuntu.com precise Release Atteint http://fr.archive.ubuntu.com precise-updates Release Atteint http://security.ubuntu.com precise-security/main Sources Atteint http://extras.ubuntu.com precise/main Sources Atteint http://fr.archive.ubuntu.com precise-backports Release Atteint http://fr.archive.ubuntu.com precise/main Sources Atteint http://fr.archive.ubuntu.com precise/restricted Sources Atteint http://fr.archive.ubuntu.com precise/universe Sources Atteint http://fr.archive.ubuntu.com precise/multiverse Sources Atteint http://fr.archive.ubuntu.com precise/main i386 Packages Atteint http://security.ubuntu.com precise-security/restricted Sources Atteint http://security.ubuntu.com precise-security/universe Sources Atteint http://security.ubuntu.com precise-security/multiverse Sources Atteint http://security.ubuntu.com precise-security/main i386 Packages Atteint http://security.ubuntu.com precise-security/restricted i386 Packages Atteint http://security.ubuntu.com precise-security/universe i386 Packages Atteint http://security.ubuntu.com precise-security/multiverse i386 Packages Atteint http://security.ubuntu.com precise-security/main TranslationIndex Atteint http://security.ubuntu.com precise-security/multiverse TranslationIndex Atteint http://security.ubuntu.com precise-security/restricted TranslationIndex Atteint http://fr.archive.ubuntu.com precise/restricted i386 Packages Atteint http://fr.archive.ubuntu.com precise/universe i386 Packages Atteint http://fr.archive.ubuntu.com precise/multiverse i386 Packages Atteint http://fr.archive.ubuntu.com precise/main TranslationIndex Atteint http://extras.ubuntu.com precise/main i386 Packages Ign http://extras.ubuntu.com precise/main TranslationIndex Atteint http://fr.archive.ubuntu.com precise/multiverse TranslationIndex Atteint http://fr.archive.ubuntu.com precise/restricted TranslationIndex Atteint http://fr.archive.ubuntu.com precise/universe TranslationIndex Atteint http://fr.archive.ubuntu.com precise-updates/main Sources Atteint http://fr.archive.ubuntu.com precise-updates/restricted Sources Atteint http://fr.archive.ubuntu.com precise-updates/universe Sources Atteint http://security.ubuntu.com precise-security/universe TranslationIndex Atteint http://fr.archive.ubuntu.com precise-updates/multiverse Sources Atteint http://fr.archive.ubuntu.com precise-updates/main i386 Packages Atteint http://fr.archive.ubuntu.com precise-updates/restricted i386 Packages Atteint http://fr.archive.ubuntu.com precise-updates/universe i386 Packages Atteint http://fr.archive.ubuntu.com precise-updates/multiverse i386 Packages Atteint http://fr.archive.ubuntu.com precise-updates/main TranslationIndex Atteint http://fr.archive.ubuntu.com precise-updates/multiverse TranslationIndex Atteint http://fr.archive.ubuntu.com precise-updates/restricted TranslationIndex Atteint http://fr.archive.ubuntu.com precise-updates/universe TranslationIndex Atteint http://security.ubuntu.com precise-security/main Translation-en Atteint http://security.ubuntu.com precise-security/multiverse Translation-en Atteint http://fr.archive.ubuntu.com precise-backports/main Sources Atteint http://fr.archive.ubuntu.com precise-backports/restricted Sources Atteint http://fr.archive.ubuntu.com precise-backports/universe Sources Atteint http://fr.archive.ubuntu.com precise-backports/multiverse Sources Atteint http://fr.archive.ubuntu.com precise-backports/main i386 Packages Atteint http://fr.archive.ubuntu.com precise-backports/restricted i386 Packages Atteint http://security.ubuntu.com precise-security/restricted Translation-en Atteint http://fr.archive.ubuntu.com precise-backports/universe i386 Packages Atteint http://fr.archive.ubuntu.com precise-backports/multiverse i386 Packages Atteint http://fr.archive.ubuntu.com precise-backports/main TranslationIndex Atteint http://fr.archive.ubuntu.com precise-backports/multiverse TranslationIndex Atteint http://fr.archive.ubuntu.com precise-backports/restricted TranslationIndex Atteint http://fr.archive.ubuntu.com precise-backports/universe TranslationIndex Réception de : 2 http://fr.archive.ubuntu.com precise/main Translation-fr_FR [494 kB] Atteint http://security.ubuntu.com precise-security/universe Translation-en Ign http://extras.ubuntu.com precise/main Translation-fr_FR Ign http://extras.ubuntu.com precise/main Translation-fr Ign http://extras.ubuntu.com precise/main Translation-en Atteint http://fr.archive.ubuntu.com precise/main Translation-fr Atteint http://fr.archive.ubuntu.com precise/main Translation-en Réception de : 3 http://fr.archive.ubuntu.com precise/multiverse Translation-fr_FR [93,8 kB] Atteint http://fr.archive.ubuntu.com precise/multiverse Translation-fr Atteint http://fr.archive.ubuntu.com precise/multiverse Translation-en Réception de : 4 http://fr.archive.ubuntu.com precise/restricted Translation-fr_FR [2 506 B] Atteint http://fr.archive.ubuntu.com precise/restricted Translation-fr Atteint http://fr.archive.ubuntu.com precise/restricted Translation-en Réception de : 5 http://fr.archive.ubuntu.com precise/universe Translation-fr_FR [870 kB] Atteint http://fr.archive.ubuntu.com precise/universe Translation-fr Atteint http://fr.archive.ubuntu.com precise/universe Translation-en Atteint http://fr.archive.ubuntu.com precise-updates/main Translation-fr Atteint http://fr.archive.ubuntu.com precise-updates/main Translation-en Atteint http://fr.archive.ubuntu.com precise-updates/multiverse Translation-fr Atteint http://fr.archive.ubuntu.com precise-updates/multiverse Translation-en Atteint http://fr.archive.ubuntu.com precise-updates/restricted Translation-fr Atteint http://fr.archive.ubuntu.com precise-updates/restricted Translation-en Atteint http://fr.archive.ubuntu.com precise-updates/universe Translation-fr Atteint http://fr.archive.ubuntu.com precise-updates/universe Translation-en Atteint http://fr.archive.ubuntu.com precise-backports/main Translation-en Atteint http://fr.archive.ubuntu.com precise-backports/multiverse Translation-en Atteint http://fr.archive.ubuntu.com precise-backports/restricted Translation-en Atteint http://fr.archive.ubuntu.com precise-backports/universe Translation-en 1 460 ko réceptionnés en 7s (195 ko/s) Lecture des listes de paquets... Fait krystoo@krystoo-3000-N200:~$ sudo apt-get upgrade Lecture des listes de paquets... Fait Construction de l'arbre des dépendances Lecture des informations d'état... Fait Les paquets suivants seront mis à jour : software-properties-common software-properties-gtk transmission-common transmission-gtk tzdata xul-ext-ubufox 6 mis à jour, 0 nouvellement installés, 0 à enlever et 0 non mis à jour. Il est nécessaire de prendre 1 198 ko dans les archives. Après cette opération, 25,6 ko d'espace disque supplémentaires seront utilisés. Souhaitez-vous continuer [O/n] ? o Réception de : 1 http://fr.archive.ubuntu.com/ubuntu/ precise-updates/main tzdata all 2012e-0ubuntu0.12.04.1 [474 kB] Réception de : 2 http://fr.archive.ubuntu.com/ubuntu/ precise-updates/main software-properties-common all 0.82.7.3 [9 048 B] Réception de : 3 http://fr.archive.ubuntu.com/ubuntu/ precise-updates/main software-properties-gtk all 0.82.7.3 [34,2 kB] Réception de : 4 http://fr.archive.ubuntu.com/ubuntu/ precise-updates/main transmission-common all 2.51-0ubuntu1.1 [267 kB] Réception de : 5 http://fr.archive.ubuntu.com/ubuntu/ precise-updates/main transmission-gtk i386 2.51-0ubuntu1.1 [355 kB] Réception de : 6 http://fr.archive.ubuntu.com/ubuntu/ precise-updates/main xul-ext-ubufox all 2.6-0ubuntu0.12.04.1 [58,5 kB] 1 198 ko réceptionnés en 4s (244 ko/s) Préconfiguration des paquets... (Lecture de la base de données... 55%dpkg : erreur fatale irréversible, abandon : lecture de la liste des fichiers du paquet « linux-headers-3.2.0-35 »: Erreur d'entrée/sortie E: Sub-process /usr/bin/dpkg returned an error code (2) Comment ça une défaillance du disc dur ? Il à était changé l'été dernier et avait eu quelques mois win et je m'en suis pas trop servit jusqu'à maintenant ou je compte bien m'en servir. Après dans synaptic pour supprimé des logiciels et même pour en installer on me dit que tous les paquets n'ont pu être entièrement installé ou supprimé. = au final toujours AbiWord et Guneric et toujours pas LibreOffice. Toujours Pdgin et toujours pas aMSN. Et en voulant mettre du contenu sur clef usb, je pouvais et d'un seul coup je ne peut plus car je n'aurais pas tous les droits avec mon seul compte (sur lequel j'écrit ici). Dernière modification par krystoo (Le 28/12/2012, à 17:53) Ubuntu 14.04 lts - carte graph : Intel(R) 82865G Graphics Controller - Q45/Q43 Chipset Boosté à fond rame un poil sur les vidéos -- & -- Ubuntu 14.04 lts - Lenovo 3000-N200 -- & -- un PC ACER Aspire M1600-EB7Z sauvé de la poubelle, nettoyé et dépoussiéré qui avait aussi vista qui ramait par a coups et de façon aléatoire 1.20Ghz redevenu 1.60Ghz grâce à Ubuntu et maintenant fuse. Hors ligne ljere Re : Comment installer des mises à jour téléchargées ? il ne faut pas utiliser sudo apt-get upgrade mais sudo apt-get dist-upgrade d'apres la doc il faut faire un clean puis réinstaller le paquet genant sudo apt-get clean puis sudo apt-get install linux-headers-3.2.0-35 Hors ligne Korak Re : Comment installer des mises à jour téléchargées ? Bonjour, j'avais 197 mises à jour. J'ai fait en plusieurs fois. Il vaut mieux faire toutes les mises-à-jour proposées en une seule fois car un paquet en dépend d'un autre et ainsi de suite. car sinon interminable Ce qui veut dire? Combien de temps? Quand j'installe un nouvel Ubuntu 12.04 sur un PC, il y a environ 400 mises-à-jour a faire après l'installation. Et ces 400 mises-à-jour prennent plus ou moins 30 minutes pour le téléchargement et l'installation des mises-à-jour. Dernière modification par Korak (Le 28/12/2012, à 18:34) OS: Ubuntu 14.04 64 bits + Windows 8.1 64 bits en dualboot (BIOS UEFI, Secure Boot activé et table de partitions GPT) PC portable HP Pavilion g7-2335sb: Processeur: AMD A4-4300M APU Carte graphique: AMD Radeon HD 7420G Mémoire vive: 6 Go RAM Je suis Parrain-Linux En ligne krystoo Re : Comment installer des mises à jour téléchargées ? Merci ljere, mais j'ai toujours les mêmes problèmes : krystoo@krystoo-3000-N200:~$ sudo apt-get dist-upgrade [sudo] password for krystoo: E: Impossible d'obtenir le verrou /var/lib/dpkg/lock - open (11: Ressource temporairement non disponible) E: Impossible de verrouiller le répertoire d'administration (/var/lib/dpkg/). Il est possible qu'un autre processus l'utilise. krystoo@krystoo-3000-N200:~$ sudo apt-get clean krystoo@krystoo-3000-N200:~$ sudo apt-get install linux-headers-3.2.0-35 Lecture des listes de paquets... Fait Construction de l'arbre des dépendances Lecture des informations d'état... Fait linux-headers-3.2.0-35 est déjà la plus récente version disponible. Les paquets suivants ont été installés automatiquement et ne sont plus nécessaires : linux-headers-3.2.0-29-generic linux-headers-3.2.0-29 Veuillez utiliser « apt-get autoremove » pour les supprimer. 0 mis à jour, 0 nouvellement installés, 0 à enlever et 6 non mis à jour. krystoo@krystoo-3000-N200:~$ Korak : La fois passé plus d'une heure sans voir le liseré en barre de défilement, en gros toujours au même stade. Dernière modification par krystoo (Le 28/12/2012, à 19:59) Ubuntu 14.04 lts - carte graph : Intel(R) 82865G Graphics Controller - Q45/Q43 Chipset Boosté à fond rame un poil sur les vidéos -- & -- Ubuntu 14.04 lts - Lenovo 3000-N200 -- & -- un PC ACER Aspire M1600-EB7Z sauvé de la poubelle, nettoyé et dépoussiéré qui avait aussi vista qui ramait par a coups et de façon aléatoire 1.20Ghz redevenu 1.60Ghz grâce à Ubuntu et maintenant fuse. Hors ligne ljere Re : Comment installer des mises à jour téléchargées ? relance sudo apt-get dist-upgrade Hors ligne tiramiseb Re : Comment installer des mises à jour téléchargées ? il ne faut pas utiliser sudo apt-get upgrade mais sudo apt-get dist-upgrade Il serait bon de ne pas faire de telle affirmation sans préciser les cas de figure où il faut faire telle commande au lieu de telle autre. Ici, un visiteur peut croire qu'il ne faut jamais faire "upgrade". En l'occurrence, je ne vois pas pourquoi "dist-upgrade" serait plus adapté qu'"upgrade". Merci ljere, mais j'ai toujours les mêmes problèmes : krystoo@krystoo-3000-N200:~$ sudo apt-get dist-upgrade [sudo] password for krystoo: E: Impossible d'obtenir le verrou /var/lib/dpkg/lock - open (11: Ressource temporairement non disponible) [...] Non, ce n'est pas le même problème. Ce n'est pas parce qu'il y a un blocage/problème que c'est le même qu'avant. Lis les messages d'erreur. Ici ça veut dire que tu avais déjà une mise à jour (ou autre action qui utilise la base des paquets) en cours : on ne peut pas lancer plusieurs mises à jour / installations / désinstallations en même temps. Tout le monde : Le problème d'origine semble plutôt par là : dpkg : erreur fatale irréversible, abandon : lecture de la liste des fichiers du paquet « linux-headers-3.2.0-35 »: Erreur d'entrée/sortie (deux fois dans les messages ci-dessus) dpkg: unrecoverable fatal error, aborting: reading files list for package 'linux-headers-3.2.0-35': Input/output error (une fois dans les messages ci-dessus) Proposer des upgrade, des dist-upgrade, tout ça, ne changera jamais une erreur d'entrée/sortie qu'il y a sur un même fichier. krystoo : une erreur d'entrée/sortie (input/output ou I/O) est liée à la difficulté constante de l'ordinateur à lire ou écrire un dans ou sur un périphérique. C'est une erreur très générale. Une erreur d'I/O sur le réseau, par exemple, peut signifier un problème de carte réseau. Une erreur d'I/O sur le disque peut signifier un problème de disque dur. Ça ne veut pas dire assurément que ton disque dur est mort, mais il est certain que l'ordinateur a des difficultés à lire ce fichier particulier. Il faut utiliser la commande fsck pour vérifier le filesystem, puis potentiellement supprimer le fichier concerné (/var/cache/apt/archives/linux-headers-3.2.0-35*.deb). http://doc.ubuntu-fr.org/verification_de_fichiers http://doc.ubuntu-fr.org/fsck Dernière modification par tiramiseb (Le 28/12/2012, à 20:39) Hors ligne ljere Re : Comment installer des mises à jour téléchargées ? bonjour tiramiseb dist-upgrade La commande dist-upgrade effectue la fonction upgrade en y ajoutant une gestion intelligente des changements de dépendances dans les nouvelles versions des paquets ; apt-get possède un système « intelligent » de résolution des conflits et il essaye, quand c'est nécessaire, de mettre à niveau les paquets les plus importants aux dépens des paquets les moins importants. Le fichier /etc/apt/sources.list contient une liste de sources où récupérer les paquets désirés. Voyez aussi apt_preferences(5) pour un mécanisme d'annulation des paramètres d'un simple paquet. donc apt-get upgrade ne marchera pas, il ne mettra pas un paquet à jour si il nécessite l'installation d'un nouveau paquet C'est donc dist-upgrade qu'il faut utiliser dans ces cas-là. ensuite j'ai bien lu la doc qui dit La commande qui va vous sauver est toute simple : sudo apt-get clean Puis réinstaller le ou les paquets qui posaient problème : sudo apt-get install "nom_du_paquet" c'est bien ce que je lui ai proposé Hors ligne tiramiseb Re : Comment installer des mises à jour téléchargées ? apt-get upgrade ne marchera pas, il ne mettra pas un paquet à jour si il nécessite l'installation d'un nouveau paquet Où as-tu vu qu'il est dans ce cas ? Il n'a aucune mise à jour qui nécessite l'installation d'un nouveau paquet à exécuter ; je cite le message #1 : 6 mis à jour, 0 nouvellement installés, 0 à enlever et 0 non mis à jour. "0 non mis à jour" lorsque l'on fait un "upgrade", cela signifie qu'aucun paquet ne nécessite un dist-upgrade. Dernière modification par tiramiseb (Le 28/12/2012, à 21:29) Hors ligne tiramiseb Re : Comment installer des mises à jour téléchargées ? J'avais mal analysé l'erreur. J'aimerais préciser que je me suis un peu gouré sur le diagnostic, l'erreur d'entrée/sortie n'est pas sur le package dans /var/cache/apt/archives/ mais dans le fichier /var/lib/dpkg/info/linux-headers-3.2.0-35.list. Là (pour le moment en tout cas) je n'ai pas d'astuce pour réparer/supprimer/corriger/remplacer ce fichier. Si quelqu'un a une idée... Dernière modification par tiramiseb (Le 28/12/2012, à 21:33) Hors ligne ljere Re : Comment installer des mises à jour téléchargées ? si tu veux, en tout cas je sais par expérience qu'il vaut mieux prendre l'habitude d'utiliser dist-upgrade qu'upgrade tout seul, car il n'y a pas d'inconvénient à utiliser dist-upgrade alors que ce n'est pas la première fois que je vois des membres qui n'ont plus de mise à jour du noyaux à cause d'upgrade peut etre nous donner le retour de cat /var/lib/dpkg/info/linux-headers-3.2.0-35.list Dernière modification par ljere (Le 28/12/2012, à 21:44) Hors ligne tiramiseb Re : Comment installer des mises à jour téléchargées ? il n'y a pas d'inconvénient à utiliser dist-upgrade Ça dépend des situations. Par expérience, je sais le contraire. Chacun son expérience, hein Mais comme je l'ai indiqué, je pense qu'il est préférable de ne pas conseiller des commandes à tort et à travers... surtout quand il s'avère qu'elles ne changeront absolument rien à la situation présentée ; là on ne parle pas de mise à jour de noyau, on parle d'erreur d'entrée/sortie lors de la mise à jour de paquets banals. Hors ligne tiramiseb Re : Comment installer des mises à jour téléchargées ? peut etre nous donner le retour de cat /var/lib/dpkg/info/linux-headers-3.2.0-35.list Pour ma part, je suis prêt à parier que le retour de cette commande terminera sur une erreur d'entrée/sortie Hors ligne ljere Re : Comment installer des mises à jour téléchargées ? ça me rassure on est au moins d'accord la dessus Hors ligne krystoo Re : Comment installer des mises à jour téléchargées ? krystoo : une erreur d'entrée/sortie (input/output ou I/O) est liée à la difficulté constante de l'ordinateur à lire ou écrire un dans ou sur un périphérique. C'est une erreur très générale. Une erreur d'I/O sur le réseau, par exemple, peut signifier un problème de carte réseau. Une erreur d'I/O sur le disque peut signifier un problème de disque dur. Ça ne veut pas dire assurément que ton disque dur est mort, mais il est certain que l'ordinateur a des difficultés à lire ce fichier particulier. Il faut utiliser la commande fsck pour vérifier le filesystem, puis potentiellement supprimer le fichier concerné (/var/cache/apt/archives/linux-headers-3.2.0-35*.deb). http://doc.ubuntu-fr.org/verification_de_fichiers http://doc.ubuntu-fr.org/fsck Pas de linux-headers-3.2.0-35*.deb dans /var/cache/apt/archives/linux-headers-3.2.0-35*.deb peut etre nous donner le retour de cat /var/lib/dpkg/info/linux-headers-3.2.0-35.list Pour ma part, je suis prêt à parier que le retour de cette commande terminera sur une erreur d'entrée/sortie Résultat : krystoo@krystoo-3000-N200:~$ cat /var/lib/dpkg/info/linux-headers-3.2.0.35.list cat: /var/lib/dpkg/info/linux-headers-3.2.0.35.list: Aucun fichier ou dossier de ce type Ubuntu 14.04 lts - carte graph : Intel(R) 82865G Graphics Controller - Q45/Q43 Chipset Boosté à fond rame un poil sur les vidéos -- & -- Ubuntu 14.04 lts - Lenovo 3000-N200 -- & -- un PC ACER Aspire M1600-EB7Z sauvé de la poubelle, nettoyé et dépoussiéré qui avait aussi vista qui ramait par a coups et de façon aléatoire 1.20Ghz redevenu 1.60Ghz grâce à Ubuntu et maintenant fuse. Hors ligne tiramiseb Re : Comment installer des mises à jour téléchargées ? Pas de linux-headers-3.2.0-35*.deb dans /var/cache/apt/archives/linux-headers-3.2.0-35*.deb As-tu lu mon message #14 qui dit que je me suis trompé et que ce n'est pas ce fichier ? Résultat : krystoo@krystoo-3000-N200:~$ cat /var/lib/dpkg/info/linux-headers-3.2.0.35.list cat: /var/lib/dpkg/info/linux-headers-3.2.0.35.list: Aucun fichier ou dossier de ce type Bon, on a dû se tromper sur le nom précis du fichier... Fais d'abord : ls /var/lib/dpkg/info/linux-headers-*.list Hors ligne krystoo Re : Comment installer des mises à jour téléchargées ? Juste au cas ou vis à vis des deux liens données quelques commandes : krystoo@krystoo-3000-N200:~$ fdisk -1 fdisk : option invalide -- '1' Usage: fdisk [options] <disk> change partition table fdisk [options] -l <disk> list partition table(s) fdisk -s <partition> give partition size(s) in blocks Options: -b <size> sector size (512, 1024, 2048 or 4096) -c[=<mode>] compatible mode: 'dos' or 'nondos' (default) -h print this help text -u[=<unit>] display units: 'cylinders' or 'sectors' (default) -v print program version -C <number> specify the number of cylinders -H <number> specify the number of heads -S <number> specify the number of sectors per track krystoo@krystoo-3000-N200:~$ fdisk -l krystoo@krystoo-3000-N200:~$ fsck.ext3 -y /dev/... e2fsck 1.42 (29-Nov-2011) fsck.ext3: Aucun fichier ou dossier de ce type lors de la tentative d'ouverture de /dev/... Périphérique peut-être inexistant ? krystoo@krystoo-3000-N200:~$ sudo fsck [sudo] password for krystoo: fsck de util-linux 2.20.1 e2fsck 1.42 (29-Nov-2011) /dev/sda1 est monté. AVERTISSEMENT !!! Le système de fichiers est monté. Si vous continuez vous ***ALLEZ*** causer des dommages ***SÉVÈRES*** au système de fichiers. Souhaitez-vous réellement continuer<n>? oui /dev/sda1 : récupération du journal uiLors de l'effacement de l'i-noeud orphelin 6029324 (uid=1000, gid=1000, mode=0100600, taille=65536) Définition du compteur d'i-noeuds libres à 19300542 (était 19300546) Définition du compteur des blocs libres à 75946142 (était 75946200) /dev/sda1 : propre, 171842/19472384 fichiers, 1936738/77882880 blocs krystoo@krystoo-3000-N200:~$ ui Le programme 'ui' n'est pas encore installé. Vous pouvez l'installer en tapant : sudo apt-get install userinfo krystoo@krystoo-3000-N200:~$ sudo passwd root Entrez le nouveau mot de passe UNIX : Retapez le nouveau mot de passe UNIX : passwd : le mot de passe a été mis à jour avec succès krystoo@krystoo-3000-N200:~$ $ cat /etc/fstab $ : commande introuvable krystoo@krystoo-3000-N200:~$ cat /etc/fstab # /etc/fstab: static file system information. # # Use 'blkid' to print the universally unique identifier for a # device; this may be used with UUID= as a more robust way to name devices # that works even if disks are added and removed. See fstab(5). # # <file system> <mount point> <type> <options> <dump> <pass> proc /proc proc nodev,noexec,nosuid 0 0 # / was on /dev/sda1 during installation UUID=4e15f889-4999-4585-87d1-734e9e154d1c / ext4 errors=remount-ro 0 1 # swap was on /dev/sda5 during installation UUID=c81e2e84-1fce-48de-925c-2c9dd726dfbd none swap sw 0 0 pour ls /var/lib/dpkg/info/linux-headers-*.list $ ls /var/lib/dpkg/info/linux-headers-*.list /var/lib/dpkg/info/linux-headers-3.2.0-29-generic.list /var/lib/dpkg/info/linux-headers-3.2.0-29.list /var/lib/dpkg/info/linux-headers-3.2.0-35-generic.list /var/lib/dpkg/info/linux-headers-3.2.0-35.list /var/lib/dpkg/info/linux-headers-generic.list Ubuntu 14.04 lts - carte graph : Intel(R) 82865G Graphics Controller - Q45/Q43 Chipset Boosté à fond rame un poil sur les vidéos -- & -- Ubuntu 14.04 lts - Lenovo 3000-N200 -- & -- un PC ACER Aspire M1600-EB7Z sauvé de la poubelle, nettoyé et dépoussiéré qui avait aussi vista qui ramait par a coups et de façon aléatoire 1.20Ghz redevenu 1.60Ghz grâce à Ubuntu et maintenant fuse. Hors ligne tiramiseb Re : Comment installer des mises à jour téléchargées ? Quand tu lis : AVERTISSEMENT !!! Le système de fichiers est monté. Si vous continuez vous ***ALLEZ*** causer des dommages ***SÉVÈRES*** au système de fichiers. Souhaitez-vous réellement continuer<n>? ... tu réponds "oui" ? Tu n'as vraiment pas peur... Et dans la documentation, le message suivant sur fond rouge : Il faut impérativement que votre partition soit démontée, c'est-à-dire non accessible, ce qui est le cas avec un live CD ... ça t'a pas inquiété ? Si tu as un quelconque grave problème sur tes fichiers à cause de cela, toi seul pourra être tenu pour responsable étant donné que tu as ignoré les avertissements. ---------- Bon, sinon, retournons à nos moutons... Avec ton "ls" on voit que je me suis gouré et que j'ai mis un "." au lieu d'un "-" dans le nom du fichier. Avec un peu de jugeotte, tu peux comprendre que la commande devrait être : cat /var/lib/dpkg/info/linux-headers-3.2.0-35.list Note bien que NOUS N'AVONS PAS BESOIN DU RETOUR COMPLET DE CETTE COMMANDE, C'EST UN ÉNORME FICHIER POUR LEQUEL ON N'A PAS BESOIN DU CONTENU. On a juste besoin de vérifier qu' , c'est à ça que tu dois faire attention.à la fin ça te donne une erreur d'entrée/sortie Hors ligne krystoo Re : Comment installer des mises à jour téléchargées ? Oui tiramiseb, je sais hein puis encore débutant Alors ta commande me donne : ... long listing ... /usr/src/linux-heacat: /var/lib/dpkg/info/linux-headers-3.2.0-35.list: Erreur d'entrée/sortie Ubuntu 14.04 lts - carte graph : Intel(R) 82865G Graphics Controller - Q45/Q43 Chipset Boosté à fond rame un poil sur les vidéos -- & -- Ubuntu 14.04 lts - Lenovo 3000-N200 -- & -- un PC ACER Aspire M1600-EB7Z sauvé de la poubelle, nettoyé et dépoussiéré qui avait aussi vista qui ramait par a coups et de façon aléatoire 1.20Ghz redevenu 1.60Ghz grâce à Ubuntu et maintenant fuse. Hors ligne tiramiseb Re : Comment installer des mises à jour téléchargées ? Tente de redémarrer sur un LiveCD et de réparer le système de fichiers avec fsck... Hors ligne krystoo Re : Comment installer des mises à jour téléchargées ? Oui j'ai éssayé, mais comment on répare ? Il y a choix de langue donc fr, éssayer ou installer. Après dans installer on remplace ou installe en parallèle et autre c'est pour repartitionner. Ubuntu 14.04 lts - carte graph : Intel(R) 82865G Graphics Controller - Q45/Q43 Chipset Boosté à fond rame un poil sur les vidéos -- & -- Ubuntu 14.04 lts - Lenovo 3000-N200 -- & -- un PC ACER Aspire M1600-EB7Z sauvé de la poubelle, nettoyé et dépoussiéré qui avait aussi vista qui ramait par a coups et de façon aléatoire 1.20Ghz redevenu 1.60Ghz grâce à Ubuntu et maintenant fuse. Hors ligne
I need to make HTTP and HTTPS requests using POST, GET and other methods and specifying headers and timeouts. On the Internet there are many examples, and they are all different: import urllib.parse import urllib.request url = 'http://www.someserver.com/cgi-bin/register.cgi' user_agent = 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)' values = {'name' : 'Michael Foord', 'location' : 'Northampton', 'language' : 'Python' } headers = { 'User-Agent' : user_agent } data = urllib.parse.urlencode(values) req = urllib.request.Request(url, data, headers) response = urllib.request.urlopen(req) the_page = response.read() or fetcher = urllib2.build_opener() fetcher.addheaders.append(('Cookie', 'aaaa=%s' % aaaa)) res = fetcher.open(settings.ABC_URL) or req = urllib2.Request(url=url) req.add_header('X-Real-IP', request.META['REMOTE_ADDR']) req.add_header('Cookie', request.META['HTTP_COOKIE']) req.add_header('User-Agent', request.META['HTTP_USER_AGENT']) resp = urllib2.urlopen(req).read() or handler = urllib.urlopen('http://...') response = handler.read() I guess under the hood some of these methods use the same mechanism. There also other examples using httplib, httplib2. And i read urllib2 is the preferred lib to use. Which one is preferred method? Which advantages and disadvantages each of them has?
{ "teachers" : [ {"name": "Lucy", "id": 3, course: "history"}, {"name": "Mark", "id": 6, "course": "maths"}, {"name": "Joan", "id": 20, course: "French"} ] } This document is in the "school" collection. I have been trying to access these imbedded documents using db.school.find({teachers:{id:3}}) I also tried db.school.find({teacher.id:3}) but I understand it isn't working since mongo can't look inside an embedded array. Therefore I would like to turn these imbedded documents into individual documents. That is, remove the embedding and the "teachers" key, creating an individual document for each teacher. The final "school" collection would be {"name": "Lucy", "id": 3, "course": "history"}, {"name": "Mark", "id": 6, "course": "maths"}, {"name": "Joan", "id": 20, "course": "French"} i would like to do it with python and save the new documents into a collection. EDIT this is what i have come up with for now: import pymongo import sys connection = pymongo.Connection("mongodb://localhost", safe=True) db = connection.hello shows = db.school for doc in db.school: for indiv in "teachers": try: db.individual.insert(indiv) except: print "Unexpected error", sys.exc_info()[0]
In a Python program I'm writing, I've built up a linked list using a dictionary which maps each node to its successor (with the last node mapped to None). (Actually, the dictionary holds what Wikipedia tells me is called a spaghetti stack, which is a tree where each node is linked to its parent but not its children. This means there are many partially-overlapping paths from the leaf nodes to the root node. I only care about one of those paths, starting from a specific leaf node. This doesn't really matter for the question, other than to rule out any solution that involves iterating over all the elements in the dictionary.) I need to pass this list to another function as an iterable. I know I can do this using a generator function (see code below), but it seems like there ought to be a built-in function to make the iterator I need in one line (or a perhaps a generator expression). I've done a bit of searching through the documentation, but there's nothing in the itertools or functools modules seems applicable, and I'm not sure where else to look. Here's the generator function I have now. The outer function can be eliminated (inlined) but the inner generator seems to be the only simple way to make an iterable for the data: def makeListGenerator(nextDict, start): def gen(node): while node: yield node node = nextDict[node] return gen(start) It seems like there should be a pattern for this sort of generator, but I'm not sure what it would be called. Here's a generic version: def makeGenericGenerator(nextFunc, continueFunc, start): def gen(value): while continueFunc(value): yield value value = nextFunc(value) return gen(start) I could implement the specific version using this one using the call: makeGenericGenerator(lambda v: nextDict[v], bool, start) Does something like that already exist in the Python standard library?
PHP reubenrd — 2012-02-06T09:54:09-05:00 — #1 Hello, It appears one my gets is not grabbing the detail correctly for some reason. Output of ECHO'D details equals grabbed via the $_GET: date1: 2012-02-90, date2: 1 URI = "....date_from=2012-02-09&date_to=2012-02-11...." HTML FORM CODE: <form name='refined_search' action='searchresults.php' method='GET'> ..... <input type='text' name='date_from' id='' readonly size='12' onClick="displayCalendar(document.forms['refined_search'].date_from,'yyyy-mm-dd',this)"> <input type='text' name='date_to' id='' readonly size='12' onClick="displayCalendar(document.forms['refined_search'].date_to,'yyyy-mm-dd',this)"> ..... </form> PHP CODE: $date1 = $_GET['date_from']; $date2 = $_GET['date_to']; echo "date1: $date1,<br>date2: $date2"; Any ideas??? reubenrd — 2012-02-06T10:19:52-05:00 — #2 michael_morris1 — 2012-02-06T12:30:25-05:00 — #3 spikez — 2012-02-06T13:39:46-05:00 — #4 AWESOME!!!!!!!!!!!!!!!!!!! reubenrd — 2012-02-06T15:48:02-05:00 — #5 The second GET request was being reset by this following IF statement SOMEHOW... if($_GET['date_from'] && $_GET['date_to'] != null) { $date1 = $_GET['date_from']; $date2 = $_GET['date_to'];
lexouille Depuis la MàJ d'ajd, mon ordi plante!! Bonjour, je suis complètement novice et ne comprends pas grand chose à Linux c'est pourquoi je vous sollicite: aujourd'hui linux m'a demandé de mettre à jour des paquets, ce qui a été fait mais 2 d'entres eux n'ont pu l'être car ils étaient "cassés"... Il s'agissait de header files kernel linux 3.2.0-55.85 et linux kernel headers for 3.2.0 32 bit x86 SMP. Lorsque je rallume mon PC il y a un sens interdit en haut de l'écran et lorsque je veux relancer l'installation mon ordinateur s'éteint complètement!!!! Par ailleurs, la police a changé également et mon PC tourne au ralenti. Pouvez-vous m'aider svp? Merci d'avance Hors ligne ljere Re : Depuis la MàJ d'ajd, mon ordi plante!! as tu accès aux terminal si oui essaye sudo apt-get clean sudo dpkg --configure -a sudo apt-get update sudo apt-get install -f sudo apt-get update && sudo apt-get dist-upgrade Hors ligne lexouille Re : Depuis la MàJ d'ajd, mon ordi plante!! pardon mais je suis vraiment novice... Ou se trouve le terminal??? Comment y accéder?? Désolée je suis vraiment nulle... Dois-je redémarrer l'ordinateur en mise sans échec? Hors ligne tiramiseb Re : Depuis la MàJ d'ajd, mon ordi plante!! Tu vas dans le lanceur d'applications et tu lances l'application qui s'appelle "Terminal" http://doc.ubuntu-fr.org/terminal Hors ligne lexouille Re : Depuis la MàJ d'ajd, mon ordi plante!! Merci j'ai pu accéder à l'application Terminal, cependant je n'ai pu taper que la 1ere étape car en 2eme position on me demandait un mot de passe... j'ai alors essayé de taper la 2e ligne de votre réponse, sans succès... oui je suis un boulet en informatique désolée... merci pour votre patience... Hors ligne lexouille Re : Depuis la MàJ d'ajd, mon ordi plante!! Voilà, j'ai lu votre lien, j'ai entré toutes les commandes et maintenant? dois-je fermer la page? Hors ligne lexouille Re : Depuis la MàJ d'ajd, mon ordi plante!! alexandra@Gargamel:~$ sudo apt-get clean [sudo] password for alexandra: Sorry, try again. [sudo] password for alexandra: alexandra@Gargamel:~$ sudo dpkg --configure -a dpkg : des problèmes de dépendances empêchent la configuration de linux-headers-3.2.0-55-generic : linux-headers-3.2.0-55-generic dépend de linux-headers-3.2.0-55 ; cependant : Le paquet linux-headers-3.2.0-55 n'est pas installé. dpkg : erreur de traitement de linux-headers-3.2.0-55-generic (--configure) : problèmes de dépendances - laissé non configuré dpkg : des problèmes de dépendances empêchent la configuration de linux-headers-generic-pae : linux-headers-generic-pae dépend de linux-headers-3.2.0-55-generic-pae ; cependant : Le paquet linux-headers-3.2.0-55-generic-pae n'est pas installé. dpkg : erreur de traitement de linux-headers-generic-pae (--configure) : problèmes de dépendances - laissé non configuré dpkg : des problèmes de dépendances empêchent la configuration de linux-headers-generic : linux-headers-generic dépend de linux-headers-3.2.0-55-generic ; cependant : Le paquet linux-headers-3.2.0-55-generic n'est pas encore configuré. dpkg : erreur de traitement de linux-headers-generic (--configure) : problèmes de dépendances - laissé non configuré dpkg : des problèmes de dépendances empêchent la configuration de linux-generic : linux-generic dépend de linux-headers-generic (= 3.2.0.55.65) ; cependant : Le paquet linux-headers-generic n'est pas encore configuré. dpkg : erreur de traitement de linux-generic (--configure) : problèmes de dépendances - laissé non configuré Des erreurs ont été rencontrées pendant l'exécution : linux-headers-3.2.0-55-generic linux-headers-generic-pae linux-headers-generic linux-generic alexandra@Gargamel:~$ sudo apt-get update Atteint http://fr.archive.ubuntu.com precise Release.gpg Réception de : 1 http://fr.archive.ubuntu.com precise-updates Release.gpg [198 B] Réception de : 2 http://security.ubuntu.com precise-security Release.gpg [198 B] Atteint http://fr.archive.ubuntu.com precise Release Réception de : 3 http://security.ubuntu.com precise-security Release [49,6 kB] Réception de : 4 http://fr.archive.ubuntu.com precise-updates Release [49,6 kB] Atteint http://archive.canonical.com precise Release.gpg Atteint http://fr.archive.ubuntu.com precise/main Sources Atteint http://fr.archive.ubuntu.com precise/restricted Sources Atteint http://fr.archive.ubuntu.com precise/universe Sources Atteint http://fr.archive.ubuntu.com precise/multiverse Sources Atteint http://fr.archive.ubuntu.com precise/main i386 Packages Atteint http://fr.archive.ubuntu.com precise/restricted i386 Packages Atteint http://fr.archive.ubuntu.com precise/universe i386 Packages Atteint http://fr.archive.ubuntu.com precise/multiverse i386 Packages Atteint http://fr.archive.ubuntu.com precise/main TranslationIndex Atteint http://fr.archive.ubuntu.com precise/multiverse TranslationIndex Atteint http://archive.canonical.com precise Release Atteint http://fr.archive.ubuntu.com precise/restricted TranslationIndex Atteint http://fr.archive.ubuntu.com precise/universe TranslationIndex Réception de : 5 http://fr.archive.ubuntu.com precise-updates/main Sources [422 kB] Réception de : 6 http://security.ubuntu.com precise-security/main Sources [91,7 kB] Atteint http://archive.canonical.com precise/partner i386 Packages Ign http://archive.canonical.com precise/partner TranslationIndex Réception de : 7 http://fr.archive.ubuntu.com precise-updates/restricted Sources [7 006 B] Réception de : 8 http://fr.archive.ubuntu.com precise-updates/universe Sources [98,0 kB] Réception de : 9 http://fr.archive.ubuntu.com precise-updates/multiverse Sources [8 343 B] Réception de : 10 http://fr.archive.ubuntu.com precise-updates/main i386 Packages [722 kB] Réception de : 11 http://security.ubuntu.com precise-security/restricted Sources [2 494 B] Réception de : 12 http://security.ubuntu.com precise-security/universe Sources [28,4 kB] Ign http://archive.canonical.com precise/partner Translation-fr_FR Réception de : 13 http://security.ubuntu.com precise-security/multiverse Sources [1 804 B] Réception de : 14 http://security.ubuntu.com precise-security/main i386 Packages [353 kB] Ign http://archive.canonical.com precise/partner Translation-fr Réception de : 15 http://fr.archive.ubuntu.com precise-updates/restricted i386 Packages [11,4 kB] Réception de : 16 http://fr.archive.ubuntu.com precise-updates/universe i386 Packages [224 kB] Ign http://archive.canonical.com precise/partner Translation-en Réception de : 17 http://fr.archive.ubuntu.com precise-updates/multiverse i386 Packages [14,0 kB] Atteint http://fr.archive.ubuntu.com precise-updates/main TranslationIndex Atteint http://fr.archive.ubuntu.com precise-updates/multiverse TranslationIndex Atteint http://fr.archive.ubuntu.com precise-updates/restricted TranslationIndex Atteint http://fr.archive.ubuntu.com precise-updates/universe TranslationIndex Réception de : 18 http://fr.archive.ubuntu.com precise/main Translation-fr_FR [494 kB] Atteint http://fr.archive.ubuntu.com precise/main Translation-fr Atteint http://fr.archive.ubuntu.com precise/main Translation-en Réception de : 19 http://fr.archive.ubuntu.com precise/multiverse Translation-fr_FR [93,8 kB] Atteint http://fr.archive.ubuntu.com precise/multiverse Translation-fr Atteint http://fr.archive.ubuntu.com precise/multiverse Translation-en Réception de : 20 http://fr.archive.ubuntu.com precise/restricted Translation-fr_FR [2 506 B] Atteint http://fr.archive.ubuntu.com precise/restricted Translation-fr Atteint http://fr.archive.ubuntu.com precise/restricted Translation-en Réception de : 21 http://fr.archive.ubuntu.com precise/universe Translation-fr_FR [870 kB] Atteint http://fr.archive.ubuntu.com precise/universe Translation-fr Atteint http://fr.archive.ubuntu.com precise/universe Translation-en Atteint http://fr.archive.ubuntu.com precise-updates/main Translation-fr Atteint http://fr.archive.ubuntu.com precise-updates/main Translation-en Atteint http://fr.archive.ubuntu.com precise-updates/multiverse Translation-fr Atteint http://fr.archive.ubuntu.com precise-updates/multiverse Translation-en Atteint http://fr.archive.ubuntu.com precise-updates/restricted Translation-fr Atteint http://fr.archive.ubuntu.com precise-updates/restricted Translation-en Atteint http://fr.archive.ubuntu.com precise-updates/universe Translation-fr Atteint http://fr.archive.ubuntu.com precise-updates/universe Translation-en Réception de : 22 http://security.ubuntu.com precise-security/restricted i386 Packages [4 620 B] Réception de : 23 http://security.ubuntu.com precise-security/universe i386 Packages [87,1 kB] Réception de : 24 http://security.ubuntu.com precise-security/multiverse i386 Packages [2 640 B] Atteint http://security.ubuntu.com precise-security/main TranslationIndex Atteint http://security.ubuntu.com precise-security/multiverse TranslationIndex Atteint http://security.ubuntu.com precise-security/restricted TranslationIndex Atteint http://security.ubuntu.com precise-security/universe TranslationIndex Atteint http://security.ubuntu.com precise-security/main Translation-en Atteint http://security.ubuntu.com precise-security/multiverse Translation-en Atteint http://security.ubuntu.com precise-security/restricted Translation-en Atteint http://security.ubuntu.com precise-security/universe Translation-en 3 638 ko réceptionnés en 7s (467 ko/s) Lecture des listes de paquets... Fait W: Duplicate sources.list entry http://archive.canonical.com/ubuntu/ precise/partner i386 Packages (/var/lib/apt/lists/archive.canonical.com_ubuntu_dists_precise_partner_binary-i386_Packages) W: Vous pouvez lancer « apt-get update » pour corriger ces problèmes. alexandra@Gargamel:~$ sudo apt-get install -f Lecture des listes de paquets... Fait Construction de l'arbre des dépendances Lecture des informations d'état... Fait Correction des dépendances... Fait Les paquets suivants ont été installés automatiquement et ne sont plus nécessaires : libutouch-grail1 linux-headers-3.2.0-29-generic nvidia-settings linux-headers-3.2.0-30 linux-headers-3.2.0-29 linux-headers-3.2.0-30-generic-pae linux-headers-3.2.0-29-generic-pae libutouch-evemu1 libutouch-frame1 linux-headers-3.2.0-30-generic libutouch-geis1 Veuillez utiliser « apt-get autoremove » pour les supprimer. Les paquets supplémentaires suivants seront installés : linux-headers-3.2.0-55 linux-headers-3.2.0-55-generic-pae Les NOUVEAUX paquets suivants seront installés : linux-headers-3.2.0-55 linux-headers-3.2.0-55-generic-pae 0 mis à jour, 2 nouvellement installés, 0 à enlever et 0 non mis à jour. 4 partiellement installés ou enlevés. Il est nécessaire de prendre 12,7 Mo dans les archives. Après cette opération, 67,7 Mo d'espace disque supplémentaires seront utilisés. Souhaitez-vous continuer [O/n] ? o Réception de : 1 http://fr.archive.ubuntu.com/ubuntu/ precise-updates/main linux-headers-3.2.0-55 all 3.2.0-55.85 [11,7 MB] Réception de : 2 http://fr.archive.ubuntu.com/ubuntu/ precise-updates/main linux-headers-3.2.0-55-generic-pae i386 3.2.0-55.85 [971 kB] 12,7 Mo réceptionnés en 9s (1 357 ko/s) (Lecture de la base de données... 973844 fichiers et répertoires déjà installés.) Dépaquetage de linux-headers-3.2.0-55 (à partir de .../linux-headers-3.2.0-55_3.2.0-55.85_all.deb) ... dpkg : erreur de traitement de /var/cache/apt/archives/linux-headers-3.2.0-55_3.2.0-55.85_all.deb (--unpack) : impossible de créer « /usr/src/linux-headers-3.2.0-55/arch/m68k/include/asm/q40ints.h.dpkg-new » (pendant le traitement de « ./usr/src/linux-headers-3.2.0-55/arch/m68k/include/asm/q40ints.h »): Aucun espace disponible sur le périphérique Aucun rapport « apport » écrit car MaxReports a déjà été atteint dpkg-deb : erreur : le sous-processus coller a été tué par le signal (Relais brisé (pipe)) Dépaquetage de linux-headers-3.2.0-55-generic-pae (à partir de .../linux-headers-3.2.0-55-generic-pae_3.2.0-55.85_i386.deb) ... dpkg : erreur de traitement de /var/cache/apt/archives/linux-headers-3.2.0-55-generic-pae_3.2.0-55.85_i386.deb (--unpack) : impossible de créer « /usr/src/linux-headers-3.2.0-55-generic-pae/include/config/de620.h.dpkg-new » (pendant le traitement de « ./usr/src/linux-headers-3.2.0-55-generic-pae/include/config/de620.h »): Aucun espace disponible sur le périphérique Aucun rapport « apport » écrit car MaxReports a déjà été atteint dpkg-deb : erreur : le sous-processus coller a été tué par le signal (Relais brisé (pipe)) Des erreurs ont été rencontrées pendant l'exécution : /var/cache/apt/archives/linux-headers-3.2.0-55_3.2.0-55.85_all.deb /var/cache/apt/archives/linux-headers-3.2.0-55-generic-pae_3.2.0-55.85_i386.deb E: Sub-process /usr/bin/dpkg returned an error code (1) alexandra@Gargamel:~$ sudo apt-get update && sudo apt-get dist-upgrade Atteint http://fr.archive.ubuntu.com precise Release.gpg Atteint http://fr.archive.ubuntu.com precise-updates Release.gpg Atteint http://fr.archive.ubuntu.com precise Release Atteint http://archive.canonical.com precise Release.gpg Atteint http://fr.archive.ubuntu.com precise-updates Release Atteint http://archive.canonical.com precise Release Atteint http://fr.archive.ubuntu.com precise/main Sources Atteint http://fr.archive.ubuntu.com precise/restricted Sources Atteint http://fr.archive.ubuntu.com precise/universe Sources Atteint http://fr.archive.ubuntu.com precise/multiverse Sources Atteint http://fr.archive.ubuntu.com precise/main i386 Packages Atteint http://fr.archive.ubuntu.com precise/restricted i386 Packages Atteint http://fr.archive.ubuntu.com precise/universe i386 Packages Atteint http://fr.archive.ubuntu.com precise/multiverse i386 Packages Atteint http://fr.archive.ubuntu.com precise/main TranslationIndex Atteint http://fr.archive.ubuntu.com precise/multiverse TranslationIndex Atteint http://fr.archive.ubuntu.com precise/restricted TranslationIndex Atteint http://fr.archive.ubuntu.com precise/universe TranslationIndex Atteint http://fr.archive.ubuntu.com precise-updates/main Sources Atteint http://fr.archive.ubuntu.com precise-updates/restricted Sources Atteint http://fr.archive.ubuntu.com precise-updates/universe Sources Atteint http://fr.archive.ubuntu.com precise-updates/multiverse Sources Atteint http://fr.archive.ubuntu.com precise-updates/main i386 Packages Atteint http://fr.archive.ubuntu.com precise-updates/restricted i386 Packages Atteint http://fr.archive.ubuntu.com precise-updates/universe i386 Packages Atteint http://fr.archive.ubuntu.com precise-updates/multiverse i386 Packages Atteint http://fr.archive.ubuntu.com precise-updates/main TranslationIndex Atteint http://fr.archive.ubuntu.com precise-updates/multiverse TranslationIndex Atteint http://fr.archive.ubuntu.com precise-updates/restricted TranslationIndex Atteint http://fr.archive.ubuntu.com precise-updates/universe TranslationIndex Atteint http://archive.canonical.com precise/partner i386 Packages Atteint http://fr.archive.ubuntu.com precise/main Translation-fr_FR Atteint http://fr.archive.ubuntu.com precise/main Translation-fr Atteint http://fr.archive.ubuntu.com precise/main Translation-en Atteint http://fr.archive.ubuntu.com precise/multiverse Translation-fr_FR Atteint http://fr.archive.ubuntu.com precise/multiverse Translation-fr Atteint http://fr.archive.ubuntu.com precise/multiverse Translation-en Atteint http://fr.archive.ubuntu.com precise/restricted Translation-fr_FR Atteint http://fr.archive.ubuntu.com precise/restricted Translation-fr Atteint http://fr.archive.ubuntu.com precise/restricted Translation-en Atteint http://fr.archive.ubuntu.com precise/universe Translation-fr_FR Ign http://archive.canonical.com precise/partner TranslationIndex Atteint http://fr.archive.ubuntu.com precise/universe Translation-fr Atteint http://fr.archive.ubuntu.com precise/universe Translation-en Atteint http://fr.archive.ubuntu.com precise-updates/main Translation-fr Atteint http://fr.archive.ubuntu.com precise-updates/main Translation-en Atteint http://fr.archive.ubuntu.com precise-updates/multiverse Translation-fr Atteint http://fr.archive.ubuntu.com precise-updates/multiverse Translation-en Atteint http://fr.archive.ubuntu.com precise-updates/restricted Translation-fr Atteint http://fr.archive.ubuntu.com precise-updates/restricted Translation-en Atteint http://fr.archive.ubuntu.com precise-updates/universe Translation-fr Atteint http://fr.archive.ubuntu.com precise-updates/universe Translation-en Ign http://archive.canonical.com precise/partner Translation-fr_FR Ign http://archive.canonical.com precise/partner Translation-fr Ign http://archive.canonical.com precise/partner Translation-en Atteint http://security.ubuntu.com precise-security Release.gpg Atteint http://security.ubuntu.com precise-security Release Atteint http://security.ubuntu.com precise-security/main Sources Atteint http://security.ubuntu.com precise-security/restricted Sources Atteint http://security.ubuntu.com precise-security/universe Sources Atteint http://security.ubuntu.com precise-security/multiverse Sources Atteint http://security.ubuntu.com precise-security/main i386 Packages Atteint http://security.ubuntu.com precise-security/restricted i386 Packages Atteint http://security.ubuntu.com precise-security/universe i386 Packages Atteint http://security.ubuntu.com precise-security/multiverse i386 Packages Atteint http://security.ubuntu.com precise-security/main TranslationIndex Atteint http://security.ubuntu.com precise-security/multiverse TranslationIndex Atteint http://security.ubuntu.com precise-security/restricted TranslationIndex Atteint http://security.ubuntu.com precise-security/universe TranslationIndex Atteint http://security.ubuntu.com precise-security/main Translation-en Atteint http://security.ubuntu.com precise-security/multiverse Translation-en Atteint http://security.ubuntu.com precise-security/restricted Translation-en Atteint http://security.ubuntu.com precise-security/universe Translation-en Lecture des listes de paquets... Fait W: Duplicate sources.list entry http://archive.canonical.com/ubuntu/ precise/partner i386 Packages (/var/lib/apt/lists/archive.canonical.com_ubuntu_dists_precise_partner_binary-i386_Packages) W: Vous pouvez lancer « apt-get update » pour corriger ces problèmes. Lecture des listes de paquets... Fait Construction de l'arbre des dépendances Lecture des informations d'état... Fait Vous pouvez lancer « apt-get -f install » pour corriger ces problèmes. Les paquets suivants contiennent des dépendances non satisfaites : linux-headers-3.2.0-55-generic : Dépend: linux-headers-3.2.0-55 mais il n'est pas installé linux-headers-generic-pae : Dépend: linux-headers-3.2.0-55-generic-pae mais il n'est pas installé E: Dépendances manquantes. Essayez d'utiliser l'option -f. Voilà la réponse Dernière modification par ljere (Le 23/10/2013, à 09:27) Hors ligne tiramiseb Re : Depuis la MàJ d'ajd, mon ordi plante!! En fouillant dans ces retours, on trouve un message assez clair : « Aucun espace disponible sur le périphérique ». Ton problème a été remonté plusieurs dizaines de fois sur ce même forum depuis le début de l'année. Je suis en train d'écrire un billet de blog dans lequel j'explique précisément ce qu'il faut faire pour corriger ce problème. Afin de ne pas réécrire une 36000me fois les mêmes explications, je te renverrai vers ce billet de blog quand il sera publié (aujourd'hui). Hors ligne ljere Re : Depuis la MàJ d'ajd, mon ordi plante!! pour la prochaine fois merci de penser à mettre tes retours entre des balises code c'est l'icone <> au dessus de la zone de texte Hors ligne tiramiseb Re : Depuis la MàJ d'ajd, mon ordi plante!! Salut, Voici mon billet de blog qui explique ce problème de manière détaillée : https://www.tiramiseb.fr/2013/10/23/ubu … ipherique/ Hors ligne ljere Re : Depuis la MàJ d'ajd, mon ordi plante!! billet super intéressant, je t'ajoutes à mes sites amis si ça ne te dérange pas Hors ligne tiramiseb Re : Depuis la MàJ d'ajd, mon ordi plante!! Tu fais comme tu veux, les hyperliens c'est la base du web Hors ligne lexouille Re : Depuis la MàJ d'ajd, mon ordi plante!! pour la prochaine fois merci de penser à mettre tes retours entre des balises code c'est l'icone <> au dessus de la zone de texte http://pix.tdct.org/upload/original/1369359175.gif désolée, je n'ai pas vraiment l'habitude... j'ai suivi ce qu'il y a écrit sur ton blog et voiçi ce que ca me dit: alexandra@Gargamel:~$ sudo apt-get upgrade Lecture des listes de paquets... Fait Construction de l'arbre des dépendances Lecture des informations d'état... Fait Vous pouvez lancer « apt-get -f install » pour corriger ces problèmes. Les paquets suivants contiennent des dépendances non satisfaites : linux-headers-3.2.0-55-generic : Dépend: linux-headers-3.2.0-55 mais il n'est pas installé linux-headers-generic-pae : Dépend: linux-headers-3.2.0-55-generic-pae mais il n'est pas installé E: Dépendances manquantes. Essayez d'utiliser l'option -f. Dernière modification par ljere (Le 23/10/2013, à 15:05) Hors ligne tiramiseb Re : Depuis la MàJ d'ajd, mon ordi plante!! Où en es-tu dans la procédure ? As-tu déjà désinstallé la majorité des paquets "linux-image" et "linux-headers" (nettoyage) ? Si oui, essaie : sudo apt-get install -f Sinon, il faut d'abord libérer de la place en nettoyant afin de ne pas retomber immédiatement sur le même problème. Hors ligne ljere Re : Depuis la MàJ d'ajd, mon ordi plante!! alors on va reprendre depuis le début (en tout cas la balise quote, elle est maîtrisé) 1 pour les balises code regarde l'image animé il faut utiliser [code]ton retour[/code] 2 donne le retour de df -h 3 donne le retour de dpkg -l | grep linux-image 4 donne le retour de dpkg -l | grep linux-headers ensuite on verra pour gagner de la place Hors ligne lexouille Re : Depuis la MàJ d'ajd, mon ordi plante!! Où en es-tu dans la procédure ? As-tu déjà désinstallé la majorité des paquets "linux-image" et "linux-headers" (nettoyage) ? Si oui, essaie : sudo apt-get install -f Sinon, il faut d'abord libérer de la place en nettoyant afin de ne pas retomber immédiatement sur le même problème. j'ai pu libérer 53000 inodes... pu jai fait votre manip' qui ne fonctionnait pas la 1ere fois, là voiçi le résultat: sudalexandra@Gargamel:~$ sudo apt-get install -f [sudo] password for alexandra: Lecture des listes de paquets... Fait Construction de l'arbre des dépendances Lecture des informations d'état... Fait Correction des dépendances... Fait Les paquets suivants ont été installés automatiquement et ne sont plus nécessaires : libutouch-grail1 linux-headers-3.2.0-29-generic nvidia-settings linux-headers-3.2.0-30 linux-headers-3.2.0-29 linux-headers-3.2.0-30-generic-pae linux-headers-3.2.0-29-generic-pae libutouch-evemu1 libutouch-frame1 linux-headers-3.2.0-30-generic libutouch-geis1 Veuillez utiliser « apt-get autoremove » pour les supprimer. Les paquets supplémentaires suivants seront installés : linux-headers-3.2.0-55 linux-headers-3.2.0-55-generic-pae Les NOUVEAUX paquets suivants seront installés : linux-headers-3.2.0-55 linux-headers-3.2.0-55-generic-pae 0 mis à jour, 2 nouvellement installés, 0 à enlever et 0 non mis à jour. 4 partiellement installés ou enlevés. Il est nécessaire de prendre 0 o/12,7 Mo dans les archives. Après cette opération, 67,7 Mo d'espace disque supplémentaires seront utilisés. Souhaitez-vous continuer [O/n] ? o (Lecture de la base de données... 973844 fichiers et répertoires déjà installés.) Dépaquetage de linux-headers-3.2.0-55 (à partir de .../linux-headers-3.2.0-55_3.2.0-55.85_all.deb) ... Dépaquetage de linux-headers-3.2.0-55-generic-pae (à partir de .../linux-headers-3.2.0-55-generic-pae_3.2.0-55.85_i386.deb) ... Paramétrage de linux-headers-3.2.0-55 (3.2.0-55.85) ... Paramétrage de linux-headers-3.2.0-55-generic (3.2.0-55.85) ... Examining /etc/kernel/header_postinst.d. run-parts: executing /etc/kernel/header_postinst.d/dkms 3.2.0-55-generic /boot/vmlinuz-3.2.0-55-generic Paramétrage de linux-headers-generic (3.2.0.55.65) ... Paramétrage de linux-generic (3.2.0.55.65) ... Paramétrage de linux-headers-3.2.0-55-generic-pae (3.2.0-55.85) ... Examining /etc/kernel/header_postinst.d. run-parts: executing /etc/kernel/header_postinst.d/dkms 3.2.0-55-generic-pae /boot/vmlinuz-3.2.0-55-generic-pae dois-je à présent tout éteindre? Dernière modification par ljere (Le 23/10/2013, à 16:15) Hors ligne tiramiseb Re : Depuis la MàJ d'ajd, mon ordi plante!! On dirait que tout a bien fonctionné. Si tu refais "sudo apt-get upgrade", il devrait ne plus te dire grand chose... ça voudra dire que tout s'est bien passé et que tu peux nettoyer en supprimant la majorité des versions du noyau, si tu ne l'as pas déjà fait. PS : ça fait deux fois que ljere t'explique de manière détaillée comment utiliser la balise "[ code ]", en cliquant sur le bouton . Pourquoi fais-tu précéder et suivre tes retours des caractères "<" et ">", dont on ne t'a jamais parlé ? Hors ligne tiramiseb Re : Depuis la MàJ d'ajd, mon ordi plante!! Pour savoir où tu en es, peux-tu faire ce que demande ljere, nous montrer le retour des commandes suivantes ? df -h df -i dpkg -l | grep linux-image dpkg -l | grep linux-headers Hors ligne lexouille Re : Depuis la MàJ d'ajd, mon ordi plante!! alexandra@Gargamel:~$ df -h Sys. de fichiers Taille Utilisé Dispo Uti% Monté sur /dev/sda1 16G 11G 3,9G 74% / udev 428M 4,0K 428M 1% /dev tmpfs 175M 816K 175M 1% /run none 5,0M 0 5,0M 0% /run/lock none 438M 152K 438M 1% /run/shm /dev/sda6 129G 67G 57G 55% /home alexandra@Gargamel:~$ df -i Sys. de fichiers Inœuds IUtil. ILibre IUti% Monté sur /dev/sda1 1001712 967858 33854 97% / udev 109426 483 108943 1% /dev tmpfs 111935 404 111531 1% /run none 111935 3 111932 1% /run/lock none 111935 6 111929 1% /run/shm /dev/sda6 8585216 31617 8553599 1% /home alexandra@Gargamel:~$ dpkg -l | grep linux-image rc linux-image-2.6.32-21-generic 2.6.32-21.32 Linux kernel image for version 2.6.32 on x86/x86_64 rc linux-image-2.6.32-22-generic 2.6.32-22.36 Linux kernel image for version 2.6.32 on x86/x86_64 rc linux-image-2.6.32-23-generic 2.6.32-23.37 Linux kernel image for version 2.6.32 on x86/x86_64 rc linux-image-2.6.32-24-generic 2.6.32-24.43 Linux kernel image for version 2.6.32 on x86/x86_64 rc linux-image-2.6.32-25-generic 2.6.32-25.45 Linux kernel image for version 2.6.32 on x86/x86_64 rc linux-image-2.6.32-27-generic 2.6.32-27.49 Linux kernel image for version 2.6.32 on x86/x86_64 rc linux-image-2.6.32-28-generic 2.6.32-28.55 Linux kernel image for version 2.6.32 on x86/x86_64 rc linux-image-2.6.32-29-generic 2.6.32-29.58 Linux kernel image for version 2.6.32 on x86/x86_64 rc linux-image-2.6.32-30-generic 2.6.32-30.59 Linux kernel image for version 2.6.32 on x86/x86_64 rc linux-image-2.6.32-32-generic 2.6.32-32.62 Linux kernel image for version 2.6.32 on x86/x86_64 rc linux-image-2.6.32-33-generic 2.6.32-33.72 Linux kernel image for version 2.6.32 on x86/x86_64 rc linux-image-2.6.32-34-generic 2.6.32-34.77 Linux kernel image for version 2.6.32 on x86/x86_64 rc linux-image-2.6.32-35-generic 2.6.32-35.78 Linux kernel image for version 2.6.32 on x86/x86_64 rc linux-image-2.6.32-36-generic 2.6.32-36.79 Linux kernel image for version 2.6.32 on x86/x86_64 rc linux-image-2.6.32-37-generic 2.6.32-37.81 Linux kernel image for version 2.6.32 on x86/x86_64 rc linux-image-2.6.32-38-generic 2.6.32-38.83 Linux kernel image for version 2.6.32 on x86/x86_64 rc linux-image-2.6.32-39-generic 2.6.32-39.86 Linux kernel image for version 2.6.32 on x86/x86_64 rc linux-image-2.6.32-40-generic 2.6.32-40.87 Linux kernel image for version 2.6.32 on x86/x86_64 rc linux-image-2.6.32-41-generic 2.6.32-41.94 Linux kernel image for version 2.6.32 on x86/x86_64 ii linux-image-2.6.32-42-generic 2.6.32-42.95 Linux kernel image for version 2.6.32 on x86/x86_64 ii linux-image-3.2.0-29-generic 3.2.0-29.46 Linux kernel image for version 3.2.0 on 32 bit x86 SMP ii linux-image-3.2.0-30-generic 3.2.0-30.48 Linux kernel image for version 3.2.0 on 32 bit x86 SMP ii linux-image-3.2.0-31-generic 3.2.0-31.50 Linux kernel image for version 3.2.0 on 32 bit x86 SMP ii linux-image-3.2.0-32-generic 3.2.0-32.51 Linux kernel image for version 3.2.0 on 32 bit x86 SMP ii linux-image-3.2.0-33-generic 3.2.0-33.52 Linux kernel image for version 3.2.0 on 32 bit x86 SMP ii linux-image-3.2.0-34-generic 3.2.0-34.53 Linux kernel image for version 3.2.0 on 32 bit x86 SMP ii linux-image-3.2.0-35-generic 3.2.0-35.55 Linux kernel image for version 3.2.0 on 32 bit x86 SMP ii linux-image-3.2.0-36-generic 3.2.0-36.57 Linux kernel image for version 3.2.0 on 32 bit x86 SMP ii linux-image-3.2.0-37-generic 3.2.0-37.58 Linux kernel image for version 3.2.0 on 32 bit x86 SMP ii linux-image-3.2.0-38-generic 3.2.0-38.61 Linux kernel image for version 3.2.0 on 32 bit x86 SMP ii linux-image-3.2.0-39-generic 3.2.0-39.62 Linux kernel image for version 3.2.0 on 32 bit x86 SMP ii linux-image-3.2.0-40-generic 3.2.0-40.64 Linux kernel image for version 3.2.0 on 32 bit x86 SMP ii linux-image-3.2.0-41-generic 3.2.0-41.66 Linux kernel image for version 3.2.0 on 32 bit x86 SMP ii linux-image-3.2.0-43-generic 3.2.0-43.68 Linux kernel image for version 3.2.0 on 32 bit x86 SMP ii linux-image-3.2.0-44-generic 3.2.0-44.69 Linux kernel image for version 3.2.0 on 32 bit x86 SMP ii linux-image-3.2.0-45-generic 3.2.0-45.70 Linux kernel image for version 3.2.0 on 32 bit x86 SMP ii linux-image-3.2.0-48-generic 3.2.0-48.74 Linux kernel image for version 3.2.0 on 32 bit x86 SMP ii linux-image-3.2.0-49-generic 3.2.0-49.75 Linux kernel image for version 3.2.0 on 32 bit x86 SMP ii linux-image-3.2.0-51-generic 3.2.0-51.77 Linux kernel image for version 3.2.0 on 32 bit x86 SMP ii linux-image-3.2.0-52-generic 3.2.0-52.78 Linux kernel image for version 3.2.0 on 32 bit x86 SMP ii linux-image-3.2.0-53-generic 3.2.0-53.81 Linux kernel image for version 3.2.0 on 32 bit x86 SMP ii linux-image-3.2.0-54-generic 3.2.0-54.82 Linux kernel image for version 3.2.0 on 32 bit x86 SMP ii linux-image-3.2.0-55-generic 3.2.0-55.85 Linux kernel image for version 3.2.0 on 32 bit x86 SMP ii linux-image-generic 3.2.0.55.65 Generic Linux kernel image alexandra@Gargamel:~$ dpkg -l | grep linux-headers ii linux-headers-3.2.0-29 3.2.0-29.46 Header files related to Linux kernel version 3.2.0 ii linux-headers-3.2.0-29-generic 3.2.0-29.46 Linux kernel headers for version 3.2.0 on 32 bit x86 SMP ii linux-headers-3.2.0-29-generic-pae 3.2.0-29.46 Linux kernel headers for version 3.2.0 on 32 bit x86 SMP ii linux-headers-3.2.0-30 3.2.0-30.48 Header files related to Linux kernel version 3.2.0 ii linux-headers-3.2.0-30-generic 3.2.0-30.48 Linux kernel headers for version 3.2.0 on 32 bit x86 SMP ii linux-headers-3.2.0-30-generic-pae 3.2.0-30.48 Linux kernel headers for version 3.2.0 on 32 bit x86 SMP ii linux-headers-3.2.0-31 3.2.0-31.50 Header files related to Linux kernel version 3.2.0 ii linux-headers-3.2.0-31-generic 3.2.0-31.50 Linux kernel headers for version 3.2.0 on 32 bit x86 SMP ii linux-headers-3.2.0-31-generic-pae 3.2.0-31.50 Linux kernel headers for version 3.2.0 on 32 bit x86 SMP ii linux-headers-3.2.0-32 3.2.0-32.51 Header files related to Linux kernel version 3.2.0 ii linux-headers-3.2.0-32-generic 3.2.0-32.51 Linux kernel headers for version 3.2.0 on 32 bit x86 SMP ii linux-headers-3.2.0-32-generic-pae 3.2.0-32.51 Linux kernel headers for version 3.2.0 on 32 bit x86 SMP ii linux-headers-3.2.0-33 3.2.0-33.52 Header files related to Linux kernel version 3.2.0 ii linux-headers-3.2.0-33-generic 3.2.0-33.52 Linux kernel headers for version 3.2.0 on 32 bit x86 SMP ii linux-headers-3.2.0-33-generic-pae 3.2.0-33.52 Linux kernel headers for version 3.2.0 on 32 bit x86 SMP ii linux-headers-3.2.0-34 3.2.0-34.53 Header files related to Linux kernel version 3.2.0 ii linux-headers-3.2.0-34-generic 3.2.0-34.53 Linux kernel headers for version 3.2.0 on 32 bit x86 SMP ii linux-headers-3.2.0-34-generic-pae 3.2.0-34.53 Linux kernel headers for version 3.2.0 on 32 bit x86 SMP ii linux-headers-3.2.0-35 3.2.0-35.55 Header files related to Linux kernel version 3.2.0 ii linux-headers-3.2.0-35-generic 3.2.0-35.55 Linux kernel headers for version 3.2.0 on 32 bit x86 SMP ii linux-headers-3.2.0-35-generic-pae 3.2.0-35.55 Linux kernel headers for version 3.2.0 on 32 bit x86 SMP ii linux-headers-3.2.0-36 3.2.0-36.57 Header files related to Linux kernel version 3.2.0 ii linux-headers-3.2.0-36-generic 3.2.0-36.57 Linux kernel headers for version 3.2.0 on 32 bit x86 SMP ii linux-headers-3.2.0-36-generic-pae 3.2.0-36.57 Linux kernel headers for version 3.2.0 on 32 bit x86 SMP ii linux-headers-3.2.0-37 3.2.0-37.58 Header files related to Linux kernel version 3.2.0 ii linux-headers-3.2.0-37-generic 3.2.0-37.58 Linux kernel headers for version 3.2.0 on 32 bit x86 SMP ii linux-headers-3.2.0-37-generic-pae 3.2.0-37.58 Linux kernel headers for version 3.2.0 on 32 bit x86 SMP ii linux-headers-3.2.0-38 3.2.0-38.61 Header files related to Linux kernel version 3.2.0 ii linux-headers-3.2.0-38-generic 3.2.0-38.61 Linux kernel headers for version 3.2.0 on 32 bit x86 SMP ii linux-headers-3.2.0-38-generic-pae 3.2.0-38.61 Linux kernel headers for version 3.2.0 on 32 bit x86 SMP ii linux-headers-3.2.0-39 3.2.0-39.62 Header files related to Linux kernel version 3.2.0 ii linux-headers-3.2.0-39-generic 3.2.0-39.62 Linux kernel headers for version 3.2.0 on 32 bit x86 SMP ii linux-headers-3.2.0-39-generic-pae 3.2.0-39.62 Linux kernel headers for version 3.2.0 on 32 bit x86 SMP ii linux-headers-3.2.0-40 3.2.0-40.64 Header files related to Linux kernel version 3.2.0 ii linux-headers-3.2.0-40-generic 3.2.0-40.64 Linux kernel headers for version 3.2.0 on 32 bit x86 SMP ii linux-headers-3.2.0-40-generic-pae 3.2.0-40.64 Linux kernel headers for version 3.2.0 on 32 bit x86 SMP ii linux-headers-3.2.0-41 3.2.0-41.66 Header files related to Linux kernel version 3.2.0 ii linux-headers-3.2.0-41-generic 3.2.0-41.66 Linux kernel headers for version 3.2.0 on 32 bit x86 SMP ii linux-headers-3.2.0-41-generic-pae 3.2.0-41.66 Linux kernel headers for version 3.2.0 on 32 bit x86 SMP ii linux-headers-3.2.0-43 3.2.0-43.68 Header files related to Linux kernel version 3.2.0 ii linux-headers-3.2.0-43-generic 3.2.0-43.68 Linux kernel headers for version 3.2.0 on 32 bit x86 SMP ii linux-headers-3.2.0-43-generic-pae 3.2.0-43.68 Linux kernel headers for version 3.2.0 on 32 bit x86 SMP ii linux-headers-3.2.0-44 3.2.0-44.69 Header files related to Linux kernel version 3.2.0 ii linux-headers-3.2.0-44-generic 3.2.0-44.69 Linux kernel headers for version 3.2.0 on 32 bit x86 SMP ii linux-headers-3.2.0-44-generic-pae 3.2.0-44.69 Linux kernel headers for version 3.2.0 on 32 bit x86 SMP ii linux-headers-3.2.0-45 3.2.0-45.70 Header files related to Linux kernel version 3.2.0 ii linux-headers-3.2.0-45-generic 3.2.0-45.70 Linux kernel headers for version 3.2.0 on 32 bit x86 SMP ii linux-headers-3.2.0-45-generic-pae 3.2.0-45.70 Linux kernel headers for version 3.2.0 on 32 bit x86 SMP ii linux-headers-3.2.0-48 3.2.0-48.74 Header files related to Linux kernel version 3.2.0 ii linux-headers-3.2.0-48-generic 3.2.0-48.74 Linux kernel headers for version 3.2.0 on 32 bit x86 SMP ii linux-headers-3.2.0-48-generic-pae 3.2.0-48.74 Linux kernel headers for version 3.2.0 on 32 bit x86 SMP ii linux-headers-3.2.0-49 3.2.0-49.75 Header files related to Linux kernel version 3.2.0 ii linux-headers-3.2.0-49-generic 3.2.0-49.75 Linux kernel headers for version 3.2.0 on 32 bit x86 SMP ii linux-headers-3.2.0-49-generic-pae 3.2.0-49.75 Linux kernel headers for version 3.2.0 on 32 bit x86 SMP ii linux-headers-3.2.0-51 3.2.0-51.77 Header files related to Linux kernel version 3.2.0 ii linux-headers-3.2.0-51-generic 3.2.0-51.77 Linux kernel headers for version 3.2.0 on 32 bit x86 SMP ii linux-headers-3.2.0-51-generic-pae 3.2.0-51.77 Linux kernel headers for version 3.2.0 on 32 bit x86 SMP ii linux-headers-3.2.0-52 3.2.0-52.78 Header files related to Linux kernel version 3.2.0 ii linux-headers-3.2.0-52-generic 3.2.0-52.78 Linux kernel headers for version 3.2.0 on 32 bit x86 SMP ii linux-headers-3.2.0-52-generic-pae 3.2.0-52.78 Linux kernel headers for version 3.2.0 on 32 bit x86 SMP ii linux-headers-3.2.0-53 3.2.0-53.81 Header files related to Linux kernel version 3.2.0 ii linux-headers-3.2.0-53-generic 3.2.0-53.81 Linux kernel headers for version 3.2.0 on 32 bit x86 SMP ii linux-headers-3.2.0-53-generic-pae 3.2.0-53.81 Linux kernel headers for version 3.2.0 on 32 bit x86 SMP ii linux-headers-3.2.0-54 3.2.0-54.82 Header files related to Linux kernel version 3.2.0 ii linux-headers-3.2.0-54-generic 3.2.0-54.82 Linux kernel headers for version 3.2.0 on 32 bit x86 SMP ii linux-headers-3.2.0-54-generic-pae 3.2.0-54.82 Linux kernel headers for version 3.2.0 on 32 bit x86 SMP ii linux-headers-3.2.0-55 3.2.0-55.85 Header files related to Linux kernel version 3.2.0 ii linux-headers-3.2.0-55-generic 3.2.0-55.85 Linux kernel headers for version 3.2.0 on 32 bit x86 SMP ii linux-headers-3.2.0-55-generic-pae 3.2.0-55.85 Linux kernel headers for version 3.2.0 on 32 bit x86 SMP ii linux-headers-generic 3.2.0.55.65 Generic Linux kernel headers ii linux-headers-generic-pae 3.2.0.55.65 Generic Linux kernel headers Hé oui il me faut le temps pour comprendre certaines choses désolée... Hors ligne tiramiseb Re : Depuis la MàJ d'ajd, mon ordi plante!! Ok donc là tu semble être dans la situation juste avant le nettoyage, je t'invite alors à lire la dernière partie de mon billet de blog, "Nettoyer le système". Hors ligne lexouille Re : Depuis la MàJ d'ajd, mon ordi plante!! ok, par contre j'ai fait "sudo apt-get upgrade" comme vous me l'aviez demandé, il m'a dit que je pouvais lancer "apt-get update" pour "corriger ces problèmes": alexandra@Gargamel:~$ sudo apt-get upgrade [sudo] password for alexandra: Lecture des listes de paquets... Fait Construction de l'arbre des dépendances Lecture des informations d'état... Fait 0 mis à jour, 0 nouvellement installés, 0 à enlever et 0 non mis à jour. W: Duplicate sources.list entry http://archive.canonical.com/ubuntu/ precise/partner i386 Packages (/var/lib/apt/lists/archive.canonical.com_ubuntu_dists_precise_partner_binary-i386_Packages) W: Vous pouvez lancer « apt-get update » pour corriger ces problèmes. Hors ligne ljere Re : Depuis la MàJ d'ajd, mon ordi plante!! tu crées ce fichier clean-kernel.sh sudo gedit ~/clean-kernel.sh tu y mets ces quelques ligne #!/bin/bash #auteur: nesthib KEEP=2 KERNELS=($(dpkg -l | awk '/ii linux-image-[0-9]\./{print gensub("-generic","",1,$2)}')) KERNELS_TO_REMOVE=(${KERNELS[@]:0:${#KERNELS[@]}-$KEEP}) sudo apt-get remove ${KERNELS_TO_REMOVE[@]} ${KERNELS_TO_REMOVE[@]/image/headers} puis sudo chmod +x ~/clean-kernel.sh sudo ./clean-kernel.sh Hors ligne tiramiseb Re : Depuis la MàJ d'ajd, mon ordi plante!! W: Duplicate sources.list entry http://archive.canonical.com/ubuntu/ precise/partner i386 Packages (/var/lib/apt/lists/archive.canonical.com_ubuntu_dists_precise_partner_binary-i386_Packages) W: Vous pouvez lancer « apt-get update » pour corriger ces problèmes. Tu as l'entrée en question en double dans tes sources. Probablement une dans /etc/apt/sources.list et une dans un répertoire de /etc/apt/sources.list.d/ Peut-être suite à une manipulation hasardeuse de ta part. En tout cas, ça n'a aucun lien avec les manipulations que je t'ai fait effectuer. Que donne la commande suivante ? grep -r partner /etc/apt/sources.list* Hors ligne lexouille Re : Depuis la MàJ d'ajd, mon ordi plante!! W: Duplicate sources.list entry http://archive.canonical.com/ubuntu/ precise/partner i386 Packages (/var/lib/apt/lists/archive.canonical.com_ubuntu_dists_precise_partner_binary-i386_Packages) W: Vous pouvez lancer « apt-get update » pour corriger ces problèmes. Tu as l'entrée en question en double dans tes sources. Probablement une dans /etc/apt/sources.list et une dans un répertoire de /etc/apt/sources.list.d/ Peut-être suite à une manipulation hasardeuse de ta part. En tout cas, ça n'a aucun lien avec les manipulations que je t'ai fait effectuer. Que donne la commande suivante ?<metadata lang=Batchfile prob=0.06 /> grep -r partner /etc/apt/sources.list* Non, je n'ai pas manipulé du tout l'ordinateur sans vous avoir demandé avant!! Comme l'ordi ne m'a pas toujours appartenu il est possible que ca vienne de cela mais je vous ai dit auparavant que j'étais NOVICE, je ne touche pas à ce que je ne connais pas sans demander avant à des personnes qui s'y connaissent comme vous (trop peur de froisser ma machine...)!! Comme mon ordi s'est déconnecté pendant que vous me répondiez, je n'ai pas fait vos procédures sus-citée, par contre j'avais entamé le nettoyage du système! J'ai donc nettoyé les commandes initialement citées (linux-headers-3.2.0-29 et linux-headers-3.2.0-30) et deux de plus (linux-headers-3.2.0-31 et 32)... Ai-je bien fait? Par ailleurs, autre question d'une novice qui comprend peu mais cherche à comprendre, j'ai parcouru les commandes qui s'affichaient et j'ai vu "linux-image-3.2.0" et "linux-headers-3.2.0" mais aussi "linux-image-2.6.0" (mais pas linux-headers-2.6.0), dois-je éliminer la commande "linux-image.2.6.0? SI oui, comment? est-ce une ancienne "version"? désolée je n'ai pas les termes appropriés... Enfin, ayant enfin pu me reconnecter et rallumer mon PC "comme avant" (en plus rapide peut etre? ou bien juste une impression?), dois-je faire la manip' dont vous venez tous 2 de me parler concernant la commande ""apt-get update" pour "corriger ces problèmes"?? Si oui, je dois donc retaper cette dernière commande? Hors ligne tiramiseb Re : Depuis la MàJ d'ajd, mon ordi plante!! "linux-image-3.2.0", "linux-headers-3.2.0" et "linux-image-2.6.0", ce sont des paquets, pas des commandes. Les commandes, c'est par exemple "sudo", "apt-get" ou encore "grep". Les "linux-image-2.6" sont en effet des anciennes versions de noyaux. Par contre, ils sont déjà majoritairement désinstallés : le "rc" du début de ligne veut dire qu'ils sont supprimés mais qu'il reste juste quelques éléments de configuration pour eux. Tu peux les supprimer complètement avec la commande suivante : sudo dpkg --purge linux-image-2.6.32-21-generic linux-image-2.6.32-22-generic linux-image-2.6.32-23-generic [...] Je te laisse compléter cette commande et ajouter les noms de paquets après le "23" toi-même selon la liste ci-dessus Tu sembles être sur la bonne voie. Au final, il faut que tu aies supprimé tous les paquets listés ci-dessus sauf les suivants : - linux-headers-3.2.0-54 - linux-headers-3.2.0-54-generic - linux-headers-3.2.0-55 - linux-headers-3.2.0-55-generic - linux-image-3.2.0-54-generic - linux-image-3.2.0-55-generic Dernière modification par tiramiseb (Le 23/10/2013, à 18:24) Hors ligne
gtk.glade.XML — Allows dynamic loading of user interfaces from XML descriptions. class gtk.glade.XML(gobject.GObject): gtk.glade.XML(fname, root=None, domain="", typedict={}) def signal_connect(handler_name, func) def signal_autoconnect(dict) def get_widget(name) def get_widget_prefix(name) def relative_file(filename) Functions def gtk.glade.xml_new_from_buffer(buffer, size, root="", domain="", typedict={}) def gtk.glade.get_widget_name(widget) def gtk.glade.get_widget_tree(widget) def gtk.glade.set_custom_handler(handler, user_data) def gtk.glade.bindtextdomain(domainname, dirname="") def gtk.glade.textdomain(domainname="") def gtk.glade.set_custom_widget_callbacks(dict) +--gobject.GObject+-- gtk.glade.XML This object represents an `instantiation' of an XML interfacedescription. When one of these objects is created, the XML file is read,and the interface is created. The gtk.glade.XML objectthen provides an interface for accessing the widgets in the interface by thenames assigned to them inside the XML description. The gtk.glade.XML objectcan also be used to connect handlers to the named signals in thedescription. Libglade also provides an interface by which it can look upthe signal handler names in the program's symbol table and automaticallyconnect as many handlers up as it can that way. gtk.glade.XML(fname, root=None, domain="", typedict={}) the XML file name the widget node in tostart building from (or fnameNone) the translation domain for the XML file (or"" for default) A dictionary used to lookup types (or{} for default) a new gtk.glade.XMLobject Creates a new gtk.glade.XML object(and the corresponding widgets) from the XML file specified by fname. Optionally it will only build the interfacefrom the widget node specified by rootNone). This feature is useful if you only want to buildsay a toolbar or menu from the XML file, but not the window it is embeddedin. Note also that the XML parse tree is cached to speed up creating anothergtk.glade.XMLobject for the same file. def signal_connect(handler_name, func) the signal handler name the signal handler function In the glade interface descriptions, signal handlers arespecified for widgets by name. The signal_connect()method allows you to connect a callback specified by func to all signals in the gtk.glade.XML filewith the signal handler name specified byhandler_name def signal_autoconnect(dict) a mapping or an instance The signal_autoconnect() method is avariation of the gtk.glade.XML.signal_connectmethod. It uses Python's introspective features to look at the keys (if dict is a mapping) or attributes (if dictdict due to compatibilityreasons since originally only the mapping interface was supported. Theinstance variant was introduced in PyGTK 2.0. def get_widget(name) the name of the widget the widget matching the name orNone The get_widget() method returns areference to the gtk.Widget specifiedby name in the interfacedescription. None is returned, ifname def get_widget_prefix(name) the prefix the widget names or"" for all widgets A list of widgets that match as the start of their name or nameNone The get_widget_prefix() method returnsa list of interface gtk.Widget objectsthat have names prefixed by name. None is returned if nointerface widget names match the prefix name def relative_file(filename) a relative file pathname the absolute file pathname The relative_file() method resolves therelative pathname specified by filename, using thedirectory of the XML file as a base. If filename def gtk.image_new_from_buffer(buffer, size, root="", domain="", typedict={}) the string containing the XML buffer size of the string the widget node in fname to start building from(or "") the translation domain for the XML file (or"" for default) A dictionary used to lookup types (or{} for default) a new gtk.glade.XML object. The gtk.glade.xml_new_from_buffer()function creates a new gtk.glade.XML object(and the corresponding widgets) from the string specified by buffer. Optionally it will only build the interfacefrom the widget node specified by root""). This feature is useful if you only want to buildsay a toolbar or menu from the XML document, but not the window it isembedded in. def gtk.glade.get_widget_name(widget) a gtk.Widget the name of the widget def gtk.glade.get_widget_tree(widget) a gtk.Widget the gtk.glade.XMLobject that built widget def gtk.glade.set_custom_handler(handler, user_data) the custom widget handler. user data passed to the custom handler. This gtk.glade.set_custom_handler() function allows you to override the default behaviour when a Custom widget is found in an interface. def gtk.glade.bindtextdomain(domainname, dirname) the name of the application. the directory where to find locales. the value of dirname This gtk.glade.bindtextdomain() function allows you to use internationalisation with glade. def gtk.glade.textdomain(domainname) the name of the application. the value of domainname This gtk.glade.textdomain() function allows you to use internationalisation with glade. def gtk.glade.set_custom_widget_callbacks(dict) a dictionary of function names. This gtk.glade.set_custom_widget_callbacks() function takes a dictionary of function names->functions, for an example see PyGTK FAQ 22.7 for an example.
I need some help. In my models.py I have a table for Note. What I want to to do with this table is to create a form where a user could enter some notes in a text field for a particular client. models.py class Note(models.Model): client = models.ForeignKey(Client) datetime = models.DateTimeField(default=datetime.now) user = models.ForeignKey(User) note = models.TextField() def __unicode__(self): return unicode(self.user) Now when the user enters a note, they should only see the note text field. Once the form has been submitted the form should auto-save the date+time to what ever the time and date is.I seem to be having with the user field. Once the form has been submitted the authenticated user should be auto save. I am not really sure how you can do this. I also want to auto-save the client as well so who ever client's page you got to (r'^clients/(?P<client_id>\d+)/$', views.get_client), auto-save from that client. Here is what I wrote in my forms.py forms.py class NoteForm(forms.ModelForm): class Meta: model = models.Note exclude = ('client','user','datetime') And here my views as well. Views.py def add_notes(request, client_id): client = models.Client.objects.get(pk = client_id) notes = client.note_set.all() if request.method == 'POST': form = forms.NoteForm(request.POST) if form.is_valid(): form.save(True) request.user.message_set.create(message = "Note is successfully added.") return HttpResponse("<script language=\"javascript\" type=\"text/javascript\">window.opener.location = window.opener.location; window.close();</script>") else: form = forms.NoteForm() return render_to_response('note_form.html', {'form':form, 'client':client,'notes':notes}, context_instance = RequestContext(request))
ProDy works quite well, especially from within an existing Python script. The following code takes an existing PDB file, performs some selection query on it, then saves it to another file. import prody def pdbsubset(inpdb, outpdb, selection): with open(inpdb) as protf: prot = prody.parsePDBStream(protf) atoms = prot.select(selection) prody.writePDB(outpdb, atoms) An example selection query builder residues is a list e.g. ['A12', 'A39'] with each element in the form <chain><residue number>. They were captured from the command line using argparse with parser.add_argument('-i', '--residues', nargs='+') so you would specify -i A12 A39 or whatever. pdb and outpdb are file paths radius is the distance in angstroms to expand the selection by. reslist = ["(chid {0} and resid {1})".format(res[0], res[1:]) for res in residues] selector = 'within {0} of ({1})'.format(radius, ' or '.join(reslist)) # and running it: pdbsubset(pdb, outpdb, selector) The documentation on ProDy selection queries is not the most straightforward, but fairly analogous to PyMol, so doable.
gmli Cerise 0.8 - TPE, freelances, artisans Hello, je me suis dit qu'une petit présentation pourrait intéresser du monde ici. Je viens de sortir aujourd'hui la version 0.8 de mon petit soft de gestion d'entreprise (cf. l'article sur le blog http://leblog.cfait.fr/post/2008/09/07/Cerise-08) Vous pouvez trouver une liste des fonctionnalités ici : http://cerise-pgi.com/index.php/features. C'est destiné aux TPE, artisans et freelances. En gros vu de loin ça donne : factures, devis, contacts, règlements, dépenses, rapport TVA, produits. Le but est d'avoir un système qui permet de facturer et gérer un peu tout ça, le plus facilement le plus rapidement possible. Pour info, c'est codé en Python, avec TurboGears, ça utilise au choix SQLite, MySQL ou PostgreSQL. L'installation des dépendances n'est pas toujours super évidente, mais Cerise en elle même est très facile à installer / configurer. Je ne sais pas précisément qui l'utilise aujourd'hui en dehors de mes clients, mais ça va de moi (freelance), à un ESAT (50 personnes) en passant par une maison d'hôtes. Dernière petite info, mais qui a sont importance, vous pouvez faire appel à moi pour du support, des développements, etc. D'ailleurs je réfléchis à une offre en ce moment, un hébergement Cerise ouvert à tous (donc vous n'avez plus rien à faire, mise à part demander de nouvelles fonctionnalités ), avec un prix au choix, allant de 0 à ce que vous voulez. Un peu comme l'album de Radiohead l'année dernière. Le but étant de fournir un service de qualité, libre, pour les petites boites, pas cher, mais qui progresse rapidement grâce aux sommes récoltés. Éventuellement lié à d'autres logiciels libres destinés aux entreprises. Enfin ça reste une idée.. si ça vous intéresse dites-le. EDIT : il y a une demo ici : http://demo.cerise-pgi.com, avec les identifiants suivante : admin/admin Dernière modification par gmli (Le 07/09/2008, à 17:43) Hors ligne snowycub Re : Cerise 0.8 - TPE, freelances, artisans Je voulais ajouter un mot pour offrir un témoignage et confirmer la qualité du travail de Guillaume. La "Maison d'hôtes" c'est moi . Après avoir cherché un peu partout une solution de facturation tournant sous linux, j'ai fait la connaissance de Cerise. Je l'ai installé pour utiliser la facturation, ca tourne depuis 3 mois, et ca marche très bien. C'est vrai qu'il y a encore ici et là quelques bugs, mais Guillaume est extrêmement réactif et le projet avance à grands pas ! Par rapport à des solutions comme Bedesk (propriétaire) ou Laurux (libre) le logiciel est certes plus compliqué à installer (d'où l'intérêt de l'offre d'hébergement pour ceux que cela rebuterait). En revanche, il est INCOMPARABLEMENT plus élégant et facile à utiliser, allez voir la démo et vous comprendrez. De plus, il est possible de customiser la sortie des factures "à mort" ce qui est vraiment appréciable (à mon gout). Le seul problème, malheureusement, semble être le peu d'intérêt (pour l'instant) de la communauté du libre pour ce projet qui en vaut vraiment la peine, il n'y a qu'à voir la réactivité sur ce forum pour des posts concernant des logiciels propriétaires, chers, à faire tourner des fois avec wine, et ce post . Alors que vraiment ce projet en vaut la peine ! Alors testez-le et aidez Guillaume à le faire avancer, ils en valent vraiment la peine (CerisePGI, et Guillaume aussi )... Christouf Re : Cerise 0.8 - TPE, freelances, artisans Une gestion de stock est prévu? Hors ligne gmli Re : Cerise 0.8 - TPE, freelances, artisans Merci beaucoup snowycub pour ton commentaire, ça m'a fait vraiment très plaisir Concernant la gestion des stocks, elle est partiellement codé même. Le problème étant que je n'ai jamais eu personnellement à gérer des stocks, et donc je ne suis pas certain de prendre les bonnes décisions. Si tu as du temps Christouf, je viens de créer cette page : http://trac.cfait.fr/CerisePGI-Trac/wiki/GestionDesStocks Je vais tâcher d'entrer le boulot déjà réalisé. Mais si tu pouvais mettre une sorte de retour d'expérience, la manière dont tu gères tes stocks, ça me serait très utile. Une dernière chose, pour la demo, on peut tester avec Bénenuts et les identifiants admin/admin. Hors ligne Alph Re : Cerise 0.8 - TPE, freelances, artisans Bonjour, Cerise semble pas mal en effet mais.... Je vais donc faire le râleur du coin 1- sur le site http://www.cerise-pgi.com/ je n'ai pas trouvé comment installer Cerise sur mon ordi , il y a bien un lien vers le code-source, mais après... Alors, facile l'install pour le néophyte ? Je ne pense pas. S'il faut naviguer entre un site un blog et que sais-je pour trouver une info, excusé, mais la ce n'est pas pratique du tout. Viiiite un tuto sur Ubuntu.fr serait bienvenue Hors ligne gmli Re : Cerise 0.8 - TPE, freelances, artisans En fait tout est sur le site de développement. C'est vrai qu'il faudrait être plus clair sur le site principal. La page expliquant l'installation est ici : http://trac.cfait.fr/CerisePGI-Trac/wik … eCerisePGI Hors ligne yris Re : Cerise 0.8 - TPE, freelances, artisans Bonjour, Je suis un utilisateur néophyte de Ubuntu (8.04LTS). J'ai essayé Cerise depuis cerise-pgi.com et souhaite l'adopter pour mon activité. Je rencontre des difficultés lors du lancement du serveur: j'ai pu "créer une nouvelle entreprise". Je peux me connecter grâce à mes identifiants mais j'obtiens la page suivante: 500 Internal error The server encountered an unexpected condition which prevented it from fulfilling the request. Page handler: <bound method Root.dashboard of <cerisepgi.controllers.root.Root object at 0x8c58e0c>> Traceback (most recent call last): File "/var/lib/python-support/python2.5/cherrypy/_cphttptools.py", line 105, in _run self.main() File "/var/lib/python-support/python2.5/cherrypy/_cphttptools.py", line 254, in main body = page_handler(*virtual_path, **self.params) File "<string>", line 3, in dashboard File "/var/lib/python-support/python2.5/turbogears/controllers.py", line 363, in expose *args, **kw) File "<string>", line 5, in run_with_transaction File "/var/lib/python-support/python2.5/turbogears/database.py", line 356, in so_rwt retval = func(*args, **kw) File "<string>", line 5, in _expose File "/var/lib/python-support/python2.5/turbogears/controllers.py", line 378, in <lambda> mapping, fragment, args, kw))) File "/var/lib/python-support/python2.5/turbogears/controllers.py", line 405, in _execute_func output = errorhandling.try_call(func, *args, **kw) File "/var/lib/python-support/python2.5/turbogears/errorhandling.py", line 72, in try_call return func(self, *args, **kw) File "<string>", line 3, in dashboard File "/var/lib/python-support/python2.5/turbogears/identity/conditions.py", line 242, in require return fn(self, *args, **kwargs) File "/home/gml/cerise/0.8/CerisePGI/cerisepgi/controllers/root.py", line 80, in dashboard File "/usr/lib/python2.5/site-packages/sqlobject/sqlbuilder.py", line 381, in __getattr__ raise AttributeError("%s instance has no attribute '%s'" % (self.soClass.__name__, attr)) AttributeError: Invoice instance has no attribute 'enterprise' Et là, je sèche complètement, mes connaissances en serveurs et BdD étant, disons-le, nulles! Pour l'installation, j'ai suivi le tuto de Guillaume, mais je n'ai pas tout compris.:( Pouvez-vous m'aider pour la dernière ligne droite, SVP? Merci d'avance Hors ligne gmli Re : Cerise 0.8 - TPE, freelances, artisans As-tu fait "tg-admin sql create" à la racine du projet ? Hors ligne yris Re : Cerise 0.8 - TPE, freelances, artisans Voici la réponse que j'obtiens lors de la commande "tg-admin sql create": Using database URI sqlite:///var/www/html/CerisePGI/devdata.sqlite Warning: a circular reference was detected in the model. Unable to sort the classes by dependency: they will be treated in alphabetic order. This may or may not work depending on your database backend. The error was: Found a circular reference: Activity --> Enterprise --> Address --> Contact --> Company --> Contact Exception exceptions.AttributeError: "'sqlite3.Connection' object has no attribute 'autocommit'" in <bound method Transaction.__del__ of <sqlobject.dbconnection.Transaction object at 0x8d0b2ec>> ignored Hors ligne yris Re : Cerise 0.8 - TPE, freelances, artisans Info complémentaire qui a peut-être son importance: dans le répertoire /var/www/html , j'ai installé précédemment SugarCRM qui contient aussi une BdD. Hors ligne jeanclaude1946 Re : Cerise 0.8 - TPE, freelances, artisans Bonjour, Je suis cette liste avec intérêt, je pense que c'est très bien, j'ai été commerçant pendant 20 ans, le principale problème à mon avis c'est que c'est très difficile à installer, pour quelqu'un qui m'a pas le temps, et peut être pas les connaissances nécessaires, c'est tout à fait impossible d'installer ce logiciel, pour faire plus simple, un paquet deb , pour mon cas personnel serait plus approprié. Merci Hors ligne Le Monolecte Re : Cerise 0.8 - TPE, freelances, artisans Bonjour à tous, Je trouve que cerise est probablement le petit logiciel libre de facturation qui va bien pour les TPE et les indé. Par contre, pour l'installation, c'est super coton. J'ai tenté d'installer en téléchargeant la svn, ce qui se fait facilement en ligne de commande et en suivant le tuto. Sous Ubuntu, j'ai LAMP qui tourne. J'ai tenté de modifié dev.cfg pour que ça le fasse, en décommentant la ligne # sqlobject.dburi="mysql://utilisateur:mot de pass@localhost:8080/cerise", cerise étant la base de données que j'ai créé dans phpmyadmin pour cerise... mais elle n'était pas sur le gâteau. J'ai pris la version de _renderPM.so qui va bien en la renommant directement dans les fichiers installés par svn et je lance tg-admin sql create Et là, c'est le drame : Using database URI mysql://[i]l'utilisateur de mysql[/i]:[i]le mot de passe de cet utilisateur[/i]@localhost:8080/cerise Traceback (most recent call last): File "/usr/bin/tg-admin", line 8, in <module> load_entry_point('TurboGears==1.0.4.3', 'console_scripts', 'tg-admin')() File "/var/lib/python-support/python2.5/turbogears/command/base.py", line 379, in main command.run() File "/var/lib/python-support/python2.5/turbogears/command/base.py", line 128, in run command.the_runner.run(sys.argv) File "/usr/lib/python2.5/site-packages/sqlobject/manager/command.py", line 101, in run runner.run() File "/usr/lib/python2.5/site-packages/sqlobject/manager/command.py", line 307, in run self.command() File "/usr/lib/python2.5/site-packages/sqlobject/manager/command.py", line 628, in command for soClass in self.classes(require_some=True): File "/usr/lib/python2.5/site-packages/sqlobject/manager/command.py", line 329, in classes conn = self.connection() File "/usr/lib/python2.5/site-packages/sqlobject/manager/command.py", line 390, in connection return sqlobject.connectionForURI(self.options.connection_uri) File "/usr/lib/python2.5/site-packages/sqlobject/dbconnection.py", line 1079, in connectionForURI conn = self.schemeBuilders[scheme]().connectionFromURI(uri) File "/usr/lib/python2.5/site-packages/sqlobject/mysql/mysqlconnection.py", line 56, in connectionFromURI host=host or 'localhost', port=port or 0, **args) File "/usr/lib/python2.5/site-packages/sqlobject/mysql/mysqlconnection.py", line 23, in __init__ import MySQLdb, MySQLdb.constants.CR, MySQLdb.constants.ER ImportError: No module named MySQLdb Donc, quoi qu'il faut faire? Le dossier de cerise s'est installé par défaut à la racine de mon dossier utilisateur. Il faut que je le déplace dans mon interface WWW pour mysql (que j'ai placé sur le /home par mesure de Sécurité)? Bref, j'aimerais vraiment bien pouvoir tester cerise en local pour le valider, voir s'il me convient en production pour ensuite rémunérer (modestement, hélas) le créateur et faire la pub du truc!:) 13.10 (64) - Dell Latitude E4310 Hors ligne gmli Re : Cerise 0.8 - TPE, freelances, artisans Hello, désolé du délai de réponse, j'étais en plein déménagement, et j'avais quelques soucis de ligne ADSL.. Je crois que je vais modifier la page d'installation, en effet sous Ubuntu les paquets Python utilisés par TurboGears et Cerise sont assez foireux. Je conseille de les installer via easy_install, ça règle 99.99% des problèmes. Donc : sudo aptitude install python-setuptools Et ensuite : sudo easy_install sqlobject Idem pour sqlite. MySQLdb devrait passer avec. Ça devrait régler vos problèmes à vous deux. Concernant la facilité d'installation, si on installe tout avec easy_install, très honnêtement, c'est bien plus simple d'installer Cerise que n'importe quel autre PGI web Je manque cruellement de temps, mais je ne désespère pas de faire un paquet Python (un EGG), ça évitera quasi tous les problèmes. En tout cas si des gens (autres que mes clients) commencent à utiliser le logiciel et à rapporter des bugs, des retours d'expérience, etc, çe n'en sera que très bénéfique, donc merci à vous de tester ce logiciel assez jeune. Hors ligne yris Re : Cerise 0.8 - TPE, freelances, artisans Bonsoir Guillaume, je viens de recommencer l'installation comme tu viens de la décrire. J'ai dû passer par Synaptic pour installer SQLite et MySQLdb. Peux-tu nous expliquer ce que signifie cette phrase (en langage néophyte ): Il est conseillé de recompiler la librairie renderPM et de l'installer de façon "classique" : python setup.py install. Elle peut être récupérée sur http://www.reportlab.org/downloads.html section renderPM 1.06. Quelles sont les infos à entrer dans le fichier CerisePGI/devCFG? Une fois ceci expliqué, on doit tenir le bon bout, non? Hors ligne gmli Re : Cerise 0.8 - TPE, freelances, artisans Bonsoir Guillaume, je viens de recommencer l'installation comme tu viens de la décrire. J'ai dû passer par Synaptic pour installer SQLite et MySQLdb. Peux-tu nous expliquer ce que signifie cette phrase (en langage néophyte ): Il est conseillé de recompiler la librairie renderPM et de l'installer de façon "classique" : python setup.py install. Elle peut être récupérée sur http://www.reportlab.org/downloads.html section renderPM 1.06. Quelles sont les infos à entrer dans le fichier CerisePGI/devCFG? Une fois ceci expliqué, on doit tenir le bon bout, non? Je ne suis pas l'auteur de la phrase En fait ça dit juste qu'il est préférable (mais pas du tout obligatoire) de recompiler renderPM, plutôt que d'utiliser le fichier _renderPM.so fourni avec Cerise. Mais tu peux ignorer cette phrase, normalement ça ne pose aucun soucis. Pour le fichier dev.cfg, en fait si tu ne modifie rien du tout ça fonctionne quand même, Cerise va utiliser un fichier SQLITE pour la base de donnée, et le port de connexion sera le 8080. Le fichier sert juste à modifier ça principalement. Hors ligne yris Re : Cerise 0.8 - TPE, freelances, artisans Que signifie recompiler renderPM et comment fait-on pour recompiler renderPM? Hors ligne gmli Re : Cerise 0.8 - TPE, freelances, artisans Là tu recherches la complexité renderPM est une lib de Reportlab (pour générer les images), qui doit être compilée (on passe du code source à un fichier binaire). Elle est déjà compilée, c'est le fichier .so à la racine, mais si on veut on peut la recompiler pour son système. Mais premièrement, comme déjà dit, c'est inutile, et secondement Cerise dans sa version actuelle n'utilise même plus renderPM (je suis passé à du flash pour les graphiques). Mais je le garde car j'en aurais peut-être encore besoin. Voilà Hors ligne yris Re : Cerise 0.8 - TPE, freelances, artisans J'espérais juste avoir oublié, zappé une étape qui explique mes problèmes d'installation. Hors ligne gmli Re : Cerise 0.8 - TPE, freelances, artisans Il te reste quoi comme problème ? J'ai installé Cerise dans une machine virtuelle sous Ubuntu 8.04 hier soir avec les commandes que je t'ai cité, et ça fonctionne sans soucis. Hors ligne yris Re : Cerise 0.8 - TPE, freelances, artisans J'ai pu créer mon entreprise depuis la page d'accueil mais dès que je valide, j'obtiens... Bon, voila que je n'arrive plus à démarrer le serveur CerisePGI. A la commande, j'obtiens ça: root@studio-desktop:~# python start-cerisepgi.py python: can't open file 'start-cerisepgi.py': [Errno 2] No such file or directory Hors ligne yris Re : Cerise 0.8 - TPE, freelances, artisans Je suis obligé de regénérer une BdB avec tg-admin sql create pour pouvoir ensuite lancer le serveur. A la création de la BdD, j'obtiens à nouveau la réponse que j'ai posté dans mon messge n°9 plus haut. Ensuite, lorsque je me connecte avec mes ID au serveur, j'obtiens ce message en accueil: 500 Internal error The server encountered an unexpected condition which prevented it from fulfilling the request. Page handler: <bound method Root.dashboard of <cerisepgi.controllers.root.Root object at 0x8ed8e2c>> Traceback (most recent call last): File "/var/lib/python-support/python2.5/cherrypy/_cphttptools.py", line 105, in _run self.main() File "/var/lib/python-support/python2.5/cherrypy/_cphttptools.py", line 254, in main body = page_handler(*virtual_path, **self.params) File "<string>", line 3, in dashboard File "/var/lib/python-support/python2.5/turbogears/controllers.py", line 363, in expose *args, **kw) File "<string>", line 5, in run_with_transaction File "/var/lib/python-support/python2.5/turbogears/database.py", line 356, in so_rwt retval = func(*args, **kw) File "<string>", line 5, in _expose File "/var/lib/python-support/python2.5/turbogears/controllers.py", line 378, in <lambda> mapping, fragment, args, kw))) File "/var/lib/python-support/python2.5/turbogears/controllers.py", line 405, in _execute_func output = errorhandling.try_call(func, *args, **kw) File "/var/lib/python-support/python2.5/turbogears/errorhandling.py", line 72, in try_call return func(self, *args, **kw) File "<string>", line 3, in dashboard File "/var/lib/python-support/python2.5/turbogears/identity/conditions.py", line 242, in require return fn(self, *args, **kwargs) File "/home/gml/cerise/0.8/CerisePGI/cerisepgi/controllers/root.py", line 80, in dashboard File "/usr/lib/python2.5/site-packages/sqlobject/sqlbuilder.py", line 381, in __getattr__ raise AttributeError("%s instance has no attribute '%s'" % (self.soClass.__name__, attr)) AttributeError: Invoice instance has no attribute 'enterprise' Hors ligne yris Re : Cerise 0.8 - TPE, freelances, artisans Tout se résout en installant la dernière version de SQLObject là: http://packages.ubuntu.com/fr/intrepid/ … t/download Hors ligne yanfox Re : Cerise 0.8 - TPE, freelances, artisans Bonsoir, je suis dans la panade également, j'ai voulu installer cerise 0.8 mais j'obtiens le même message d'erreur que cité plus haut : Warning: a circular reference was detected in the model. Unable to sort the classes by dependency: they will be treated in alphabetic order. This may or may not work depending on your database backend. The error was:Found a circular reference: Activity --> Enterprise --> Address --> Contact --> Company --> Contact j'ai suivi les instructions du wiki à la lettre mais rien 'y fait... j'ai également tenté de faire les manipulations décrites plus haut sans succès... j'ai cette fichue erreur lorsque je créé ma bdd. Merci de votre aide EDIT : Bon j'ai toujours le message d'erreur mais le script veux bien lancer à présent, je commence à m'immerger dans ce logiciel qui me semble très prometteur. Au bout de 3 minutes d'utilisation je suis quasi conquis, il ne manque plus qu'un peu de personnalisation dans tout ça et ça va être d'enfer EDIT 2 : je suis emballé quelques petites remarques qui serons j'espère utiles : - Au niveau de la gestion client, il serait bien d'avoir quelques champs supplémentaires genre mail, téléphone etc. - Toujours niveau client, j'en ai certains qui ont plusieurs sociétés, ça serait génial si il était possible d'avoir un client lié à plusieurs sociétés (avec différentes fonctions, numéro de téléphone... etc), ca éviterai les doublons. - Un peu plus de personnalisation sur l'apparence des devis/factures, genre un logo ou autre. Peux-être via un système de skin (?). L'ajout de quelques lignes en fin de factures telles que : règlement par chèque ou virement le matériel reste la propriété de "entreprise" jusqu'au paiement complet des sommes dues... - au niveau de l'aide au calcul de TVA, un affichage par mois ou trimestre serait bien Par ailleurs je voulais m'inscrire à la mailing list mais visiblement ele est en vrac pour le moment Félicitations pour ce bel outil qui a un bel avenir je pense Je vais d'ailleurs commencer a travailler en doublon avec mon système de facturation actuel histoire de m'y faire ! Dernière modification par yanfox (Le 27/11/2008, à 20:02) Hors ligne HKH Re : Cerise 0.8 - TPE, freelances, artisans hello j ai testé ce petit logiciel bien sympa. J avais la même erreur que Yris sous ubuntu Hardy 8.04.1 , résolu en installant la dernière version de SQLObject comme péconisé par Yris lui même...merci Un petit retour d'expérience : j ai consaté que le numéro de Devis contient la lettre "F" comme le numéro de Facture .. ? Au niveau de la gestion des produits , il serait peut etre pratique d'avoir un classement par catégorie voir sous catégorie..pour ceux qui ont plusieurs types de produits ( exemple d une entreprise multiservice) Peut etre que c est deja prévu pour la version future.. Vivement la version 0.9 qui ne devrait pas tarder ( vue sur le blog de GMLI ) Dernière modification par HKH (Le 22/12/2008, à 14:17) Hors ligne phil33 Re : Cerise 0.8 - TPE, freelances, artisans bonjour, comment entrer dans l'entreprise test, j'ai choisi benenuts et admin admin mais connection impossible ??
The question is for Python 2.6, that is what we have in production. I have this requirement for formatting a number (like 1234567.0987 or 1234567.0) with comma, and specified number of digits after decimal points. So, it if precision is three, 1234567.0987 may look like 1,234,567.099. I tried using Locale, as suggested by answers to many questions, the problem is that results in two digits after decimal, which is not acceptable for my requirement. I tried searching in other places, but did not find any solution, and finally I created a method by my own: def format_float(value, precision = 4): formatString = "%0." + str(precision) + "f" str_val = formatString % value first, second = str_val.split('.') first = int(first) group = [] while True: result, mod = first / 1000, first % 1000 group.append(str(mod)) if result == 0: break first = result group.reverse() return ','.join(group) + '.' + second I tried to run some tests to test out the method and it works fine: # default 4 digits precision assert format_float(1234567890.0876543) == '1,234,567,890.0877' assert format_float(1.2) == '1.2000' assert format_float(1234) == '1,234.0000' assert format_float(0) == '0.0000' # 3 digits precision assert format_float(1234567890.0876543, precision=3) == '1,234,567,890.088' assert format_float(0, precision=3) == '0.000' Being new to Python, my question is whether this is an acceptable solution. As this formatting has to be done many times in a tight for-loop, I would appreciate if someone can point to a better solution. Thanks and Regards to All
Another key point is that the mouse messages all report the position in "Screen Coordinates" (i.e., relative to the top-left corner of the screen) rather than in "Client Coordinates" (i.e., relative to the top-left corner of our window). You use a member function PyCWnd.ScreenToClient() to transform these coordinates. The final step to complete the View is to draw all your strokes whenever the window requires updating. This code is simple: you iterate over the list of strokes for the document, drawing lines between the coordinates. To obtain this behavior, use the code: def OnDraw(self, dc): # All we need to is get the strokes, and paint them. doc = self.GetDocument() for startPos, endPos in doc.GetStrokes(): dc.MoveTo(startPos) dc.LineTo(endPos) And that's it! You now have a fully functional drawing application, capable of loading and saving itself from disk. Creating the Application Object The simplest way to create an application object for Scribble is to subclass one of the standard application objects. The PythonWin application object is implemented in pywin.framework.intpyapp, and it derives from the CApp class in pywin.framework.app. This base class provides much of the functionality for an application, so we too will derive our application from CApp. This makes the application object small and simple. You obviously may need to enhance certain aspects; in this case, you should use the pywin.framework modules as a guide. The minimal application object looks like: # scribbleApp.py # # The application object for Python. from pywin.framework.app import CApp   class ScribbleApplication(CApp): def InitInstance(self): # All we need do is call the base class, # then import our document template. CApp.InitInstance(self) import scribble2   # And create our application object. ScribbleApplication() To run this, use the following command line: C:\Scripts> start pythonwin /app scribbleApp.py An instance of Pythonwin.exe now starts, but uses the application object you defined. Therefore, there'a no Interactive Window, the application doesn't offer to open .py files, etc. The Scribble application should look like Figure 20-5. There is also a technique to avoid this command line, but you need a copy of a resource editor (such as Microsoft Visual C++). You can take a copy of Pythonwin.exe (name it something suitable for your application), then open the .exe in the resource editor and locate an entry in the string table with the value pywin.framework.startup. This is the name of a module executed to boot the PythonWin application; the default script parses the "/app" off the command line and loads that application. You can change this to any value you like, and PythonWin then loads your startup script. See startup.py in the PythonWin distribution for an example of a startup script. PythonWin and Resources As we've discussed, MFC provides a framework architecture, and much of this architecture is tied together by resource IDs, integers that identify Windows resources in a DLL or executable. For example, when you define a DocumentTemplate, you specify a resource ID. The previous example doesn't specify a resource ID, so the default of win32ui.IDR_PYTHONTYPE is used. When a document is created, MFC uses the resource ID in the following ways: The menu with the ID is loaded and used for the document's frame. This allows each document supported in an application to have a unique set of menus as is common in MDI applications. The icon with the ID is loaded and used for the document's frame. The accelerator with that ID is loaded, providing document-specific shortcut keys to many of the menu functions. Another example of the reliance on resource IDs is in the processing and definition of menu and toolbar items. Each command in the application is assigned an ID. When you define menu or toolbar items, you specify the menu text (or toolbar bitmap) and the command ID. When MFC displays a menu item, it uses a string defined with the same ID and places this text automatically in the application's status bar. When the mouse hovers over a toolbar item, MFC again looks for a string with the specified ID and uses it for the tooltip-text for the button. This architecture has a number of advantages: Hooking the various pieces of your application together becomes simple. You define an icon, menu, accelerators, strings, and so forth with the same resource ID, and MFC automatically ties all these together for your application. If you are working with an existing MFC or C++ application, there's a good chance you already use resources in a similar fashion, so PythonWin often fits naturally when embedded in these applications. When you need to respond to a GUI command, specify the command ID. The same code then handles the command regardless of whether it was sourced from the keyboard, toolbar or menu. Localizing your application for other languages becomes simpler. You define new resources in the new language but use the same IDs, and the application still works regardless of the particular resources in use at the time. However, it also has a number of disadvantages: Python doesn't have a technique for defining resources, such as dialogs, menus, toolbars, or strings. So while this scheme works well using MFC from Microsoft Visual C++ (which does provide this facility), it doesn't work as well from Python. It's a pain to move beyond the MFC-provided framework. As soon as you begin manually defining and managing these resources, you aren't much better off than if you simply had used the raw Windows GUI API. PythonWin can use resources from arbitrary DLLs, thus you can define your own DLL containing only resources. PythonWin makes it easy to use these resources; just load the DLL (using win32ui.LoadLibrary()), and PythonWin locates and uses the resources in this DLL. If you are writing a large application, you'll probably find it worthwhile to define your own resource DLL when using PythonWin. The benefits offered by the framework make it worth the pain of initially setting everything up. On the other hand, it does make PythonWin somewhat cumbersome for defining these applications purely from Python code. PythonWin Conclusion For the vast majority of Python users in Windows, PythonWin will never be more than an interesting IDE environment for developing Python applications. But many other Windows developers are beginning to use PythonWin to develop Windows applications. When comparing the three GUI toolkits available in this book, you will probably come to the conclusion that PythonWin is the least suitable for simple, small GUI applications written in Python, and this would be fair. However, depending on your particular circumstances (usually either because you have an existing MFC investment or it's important to use some user-interface features offered only by PythonWin), it may be a good choice. PythonWin suffers from a lack of decent documentation. A Windows help file is included that contains a reference guide for all of the objects and methods exposed by PythonWin, but PythonWin doesn't include a comprehensive overview of the MFC framework. There are many good MFC books available, so a specific recommendation is impossible. Information from Microsoft on MFC can be found at http://msdn.microsoft.com/visualc/. Mark Hammond is an independent Microsoft Windows consultant working out of Melbourne, Australia. Andy Robinson is a London-based consultant specializing in business analysis, object-oriented design, and Windows development. Discuss this article in the O'Reilly Network Python Forum. Return to the Python DevCenter.
I am playing with Python's logging system. I have noticed a strange behavior while removing handlers from a Logger object in a loop. Namely, my for loop removes all but one handler. Additional call to .removeHandler removes the last handler smoothly. No error messages are issued during the calls. This is the test code: import logging import sys logging.basicConfig() dbg = logging.getLogger('dbg') dbg.setLevel(logging.DEBUG) testLogger = logging.getLogger('mylogger') sh = logging.StreamHandler(sys.stdout) fh = logging.FileHandler('mylogfile.log') dbg.debug('before adding handlers: %d handlers'%len(testLogger.handlers)) testLogger.addHandler(fh) testLogger.addHandler(sh) dbg.debug('before removing. %d handlers: %s'%(len(testLogger.handlers), str(testLogger.handlers))) for h in testLogger.handlers: dbg.debug('removing handler %s'%str(h)) testLogger.removeHandler(h) dbg.debug('%d more to go'%len(testLogger.handlers)) #HERE I EXPECT THAT NO HANDLER WILL REMAIN dbg.debug('after removing: %d handlers: %s'%(len(testLogger.handlers), str(testLogger.handlers))) if len(testLogger.handlers) > 0: #Why is this happening? testLogger.removeHandler(testLogger.handlers[0]) dbg.debug('after manually removing the last handler: %d handlers'%len(testLogger.handlers)) I expect that at the end of the loop no handlers will remain in the testLogger object, howeverthe last call to .removeHandler apparently fails, as can be seen from the output below. Neverthelessadditional call to this function removes the handler as expected. Here is the output: DEBUG:dbg:before adding handlers: 0 handlersDEBUG:dbg:before removing. 2 handlers: [<logging.FileHandler instance at 0x021263F0>, <logging.StreamHandler instance at 0x021262B0>]DEBUG:dbg:removing handler <logging.FileHandler instance at 0x021263F0>DEBUG:dbg:1 more to goDEBUG:dbg:after removing: 1 handlers: [<logging.StreamHandler instance at 0x021262B0>]DEBUG:dbg:after manually removing the last handler: 0 handlers More interestingly, if I replace the original loop with the following one, the loopworks as expected and no handlers remain in the testLogger object at the end of the loop. Here is the modified loop: while len(testLogger.handlers) > 0: h = testLogger.handlers[0] dbg.debug('removing handler %s'%str(h)) testLogger.removeHandler(h) dbg.debug('%d more to go'%len(testLogger.handlers)) What explains this behaviour? Is this a bug or am I missing something?
How can I improve this code (elegance, best practices, etc)? """ Simple in-memory database as a response to the Thumbtack coding challenge. """ class SimpleDb(object): """ Simple in-memory database as a response to the Thumbtack coding challenge. """ def __init__(self): """ Initialize SimpleDb instance. """ self.__db = {} self.__num_equal_to_cache = {} self.__transactions = [] # Stores previous values to allow rollback def assign(self, name, value): """ Sets value of name to value. Inserts name into database if it doesn't already exist. """ current_value = self.get(name) if current_value == value: return self.__update_num_equal_to(current_value, value) self.__update_current_transaction(name, current_value) self.__db[name] = value def get(self, name): """ Returns value of name if it exists in the database, otherwise returns None. """ return self.__db[name] if name in self.__db else None def get_num_equal_to(self, value): """ Returns number of entries in the database that have the specified value. """ return self.__num_equal_to_cache[value] if value in self.__num_equal_to_cache else 0 def unset(self, name): """ Removes name from database if it's present. """ current_value = self.__db.pop(name, None) if current_value is None: return self.__update_num_equal_to(current_value) self.__update_current_transaction(name, current_value) def begin(self): """ Opens transaction block. """ self.__transactions += [{}] def rollback(self): """ Reverts database to its state before most current transaction. Returns True on success, returns False if there aren't any open transactions. """ if not self.__transactions: return False for name, value in self.__transactions.pop().iteritems(): current_value = self.get(name) if current_value == value: continue self.__update_num_equal_to(current_value, value) if value is None: del self.__db[name] else: self.__db[name] = value return True def commit(self): """ Commits all transactions to database. Returns True on success, returns False if there aren't any open transactions. """ if not self.__transactions: return False self.__transactions = [] return True def __update_num_equal_to(self, current_value, new_value=None): """ Decrements by one the number items present with current_value (if current_value is not equal to None) and increments by one the number present with new_value (if new_value is not equal to None). """ for amount_to_add, value in [(-1, current_value), (1, new_value)]: if value is not None: self.__num_equal_to_cache.setdefault(value, 0) self.__num_equal_to_cache[value] += amount_to_add def __update_current_transaction(self, name, value): """ Stores current value of name if not already stored to most recent transaction (if any transactions open) to enable restoration of previous state on rollback. """ if self.__transactions and name not in self.__transactions[-1]: self.__transactions[-1][name] = value def display(value, default=None): """ Prints value to stdout. If value is None and a default value is specified (and not None), then the default value is printed instead. Otherwise the None value is printed. """ if value is None and default is not None: value = default print value OPS = { 'GET': (2, lambda db, name: display(db.get(name), "NULL")), 'NUMEQUALTO': (2, lambda db, value: display(db.get_num_equal_to(value))), 'UNSET': (2, lambda db, name: db.unset(name)), 'BEGIN': (1, lambda db: db.begin()), 'ROLLBACK': (1, lambda db: db.rollback() or display("NO TRANSACTION")), 'COMMIT': (1, lambda db: db.commit() or display("NO TRANSACTION")), 'END': (1, lambda db: False), 'SET': (3, lambda db, name, value: db.assign(name, value)), } def process_command(simpleDb, command): """ Parses string commands and applies them to the database. Returning False indicates that no more commands should be passed in. """ command = command.split() opcode = command.pop(0).upper() if len(command) > 0 else None if opcode is None or opcode not in OPS or len(command) != (OPS[opcode][0] - 1): print "INVALID COMMAND" elif 'END' == opcode: return False else: OPS[opcode][1](simpleDb, *command) return True def run(): """ Reads database command from the command line and passes it through for processing. """ # BEGIN \n SET a 30 \n BEGIN \n SET a 40 \n COMMIT \n GET a \n ROLLBACK \n END simpleDb = SimpleDb() while process_command(simpleDb, raw_input()): pass run() (As suggested in comments, code re-written to not touch database until user sends commit command.) "Simple in-memory database as a response to the Thumbtack coding challenge." from collections import OrderedDict class SimpleDb(object): "Simple in-memory database as a response to the Thumbtack coding challenge." def __init__(self): "Initialize SimpleDb instance." self.__db = {} self.__value_frequency = {} self.__num_open_transactions = 0 self.__transactions = {} self.__transaction_value_frequency = {} def assign(self, name, value): "Inserts/updates value of name in database." self.__update_value(name, value) def get(self, name): "Returns value of name if it exists in the database, otherwise returns None." if self.__isTransactionOpen() and name in self.__transactions: return self.__transactions[name][self.__getLastKey(self.__transactions[name])] elif name in self.__db: return self.__db[name] else: return None def get_num_equal_to(self, value): "Returns number of entries in the database that have the specified value." t_v_freq = self.__transaction_value_frequency return ((self.__value_frequency[value] if value in self.__value_frequency else 0) + (t_v_freq[value] if self.__isTransactionOpen() and value in t_v_freq else 0)) def unset(self, name): "Removes name from database if it's present." self.__update_value(name, None) def begin(self): "Opens transaction block." self.__num_open_transactions += 1 def rollback(self): "Rolls back most recent transaction, returning False if no open transactions." if not self.__isTransactionOpen(): return False for name in self.__transactions.keys(): if self.__num_open_transactions in self.__transactions[name]: value = self.__transactions[name].pop(self.__num_open_transactions) self.__transactions[name] or self.__transactions.pop(name) self.__update_num_equal_to(value, self.get(name)) self.__num_open_transactions -= 1 return True def commit(self): "Commits all transactions, returning False if no open transactions." if not self.__isTransactionOpen(): return False self.__num_open_transactions = 0 any(self.__update_value(name, values[self.__getLastKey(values)]) for name, values in self.__transactions.iteritems()) self.__transactions = {} self.__transaction_value_frequency = {} return True def __getLastKey(self, ordered): "Returns key (or value if list, etc) most recently added to ordered." return next(reversed(ordered)) if ordered else None def __isTransactionOpen(self): "Returns True if there is currently a pending transaction. Returns False otherwise." return self.__num_open_transactions > 0 def __update_num_equal_to(self, current_value, new_value=None): "Swaps current_value (lowers count by 1) with new_value (add 1). Skips None values." target = (self.__transaction_value_frequency if self.__isTransactionOpen() else self.__value_frequency) for amount_to_add, value in [(-1, current_value), (1, new_value)]: if value is not None: target.setdefault(value, 0) target[value] += amount_to_add def __update_value(self, name, value): "Updates value (adding/editing/deleting) in database." current_value = self.get(name) if current_value == value: return elif self.__isTransactionOpen(): self.__transactions.setdefault(name, OrderedDict()) self.__transactions[name][self.__num_open_transactions] = value elif value is None: del self.__db[name] else: self.__db[name] = value self.__update_num_equal_to(current_value, value) def display(value, default=None): "Prints value to stdout, or default if value is None and default is not None." print value if value is not None or default is None else default OPS = { 'GET': (2, lambda db, name: display(db.get(name), "NULL")), 'NUMEQUALTO': (2, lambda db, value: display(db.get_num_equal_to(value))), 'UNSET': (2, lambda db, name: db.unset(name)), 'BEGIN': (1, lambda db: db.begin()), 'ROLLBACK': (1, lambda db: db.rollback() or display("NO TRANSACTION")), 'COMMIT': (1, lambda db: db.commit() or display("NO TRANSACTION")), 'END': (1, lambda db: False), 'SET': (3, lambda db, name, value: db.assign(name, value)), } def process_command(simpleDb, command): "Applies command to the database. Returns False when stream of commands should end." command = command.split() opcode = command.pop(0).upper() if command else None if opcode is None or opcode not in OPS or len(command) != (OPS[opcode][0] - 1): print "INVALID COMMAND" elif 'END' == opcode: return False else: OPS[opcode][1](simpleDb, *command) return True def run(): "Reads commands from the command line and passes them through for processing." simpleDb = SimpleDb() all(iter(lambda: process_command(simpleDb, raw_input()), False)) run()