Quantcast
Channel: AFPy's Planet
Viewing all 3409 articles
Browse latest View live

[hautefeuille] Les meilleures adresses pour se fournir en électronique


[hautefeuille] Kismet et la source dont on ne se souvient jamais

$
0
0

kismet

Editez :

/etc/kismet/kismet.conf

Cherchez la ligne qui concerne la source.

  • Carte Alfa

    source = rt8180, wlan0, ALFA

  • Carte Ralink

    source = rt73, rausb0, Ralink

  • Carte Realtek

    source = rt8180, wlan0, RTL8187

  • Carte Atheros

    source = madwifi_g, wifi0, Atheros

  • Carte Zydas

    source = zd1211, eth0, ZyDAS

[j-mad] Pytong, des tongs, une plage, des présentations et des gens biens

$
0
0
La semaine dernière j’ai eu le plaisir d’assister (et de prendre la parole) à la première édition de Pytong, première édition, un événement organisé par Laurent et David à Toulon. Le samedi, direction la Cantine de Toulon dans les locaux de l’ISEN. La journée s’est découpée en deux parties, conférences et ligthing talk jusqu’à 15h [...]

[Biologeek] Des piolets et des hommes

$
0
0

Cette décontraction du sentiment d'interdit se repère aussi à la manière dont les filles se hiérarchisent dans la société. Alors que les petits garçons, très tôt, inventent des jeux de compétition, les filles inventent des jeux de coopération. Les garçons grimpent dans la hiérarchie ou s'en excluent, constituant ainsi la majorité aux grandes écoles, parmi les clochards et les délinquants. Ce n'est pas le cas des filles, qui intègrent moins les grandes écoles et deviennent rarement clochardes ou délinquantes car cette manière de se socialiser par le triomphe ou l'exclusion n'a pas de valeur sociale pour elles, alors qu'elle peut éventuellement en avoir une sexuelle.

[…]

Il semble donc que les femmes se socialisent par leurs manières d'aimer tandis que les hommes se socialisent par leurs manières d'agir. D'ailleurs, les sexes ne s'y trompent pas, puisque les femmes sont plutôt séduites par les indices sociaux que les hommes manifestent comme des promesses d'existence ; alors que les hommes sont plutôt séduits par les indices physiques et affectifs que les femmes portent sur elles comme des promesses d'amour.

Les Nourritures affectives, Boris Cyrulnik

J'ai découvert, avec l'alpinisme, un milieu où la proportion d'hommes est encore plus importante que l'informatique (en moins jeune). Et ça m'interroge forcément sur mon attirance involontaire pour ces disciplines. Qu'est-ce que j'y cherche ?

Je ne pense pas y chercher (ni y trouver d'ailleurs) une quelconque reconnaissance sociale. Il y a une sorte de momentum en ce moment autour du geek qui est un simple contrecoup du cliché d'informaticien boutonneux de ces dernières décennies mais cela va se stabiliser assez vite. C'est ce qu'il s'est également produit avec l'alpinisme qui tend à se banaliser (et à se consommer mais ce sera l'objet d'un futur billet).

Je ne pense pas non plus y chercher un père « spirituel » suite à mon défaut de père biologique. La lecture de Boris Cyrulnik m'aide à comprendre certains mécanismes complexes à ce niveau et me conforte — ou au moins clarifie — cette prise de position. Si ce n'est pas la testostérone qui est en jeu, il va falloir creuser un peu plus.

J'ai l'impression d'être davantage attiré par la capacité d'adaptation que l'on retrouve dans l'informatique et l'alpinisme : prendre connaissance de l'environnement, choisir sa voie, échanger ses connaissances et ses expériences (résilience), faire des choses en petites équipes (pluridisciplinarité). Toutes ces actions reviennent pour moi à définir l'intelligence et c'est peut-être ce que je cherche à travers tout ça : faire travailler mes cellules.

Merci pour la psychanalyse mes petits canards numériques :-).

[Biologeek] Media: Mont-Blanc

[Biologeek] Mont-Blanc

$
0
0

Jour 1 : Réveil à 7h pour aller prendre le tramway du Mont-Blanc au col de Voza après une courte nuit sous la tente. On aperçoit déjà le refuge du Goûter qui brille tout là-haut, à 3835 mètres d'altitude. L'objectif de la journée est de le rejoindre sans trop forcer — ce qui va s'avérer plus difficile que prévu. Premier stress : essayer de faire rentrer tout l'équipement nécessaire dans mon sac de 22 litres, ça déborde un peu mais je sais que je ne vais pas tenir longtemps en t-shirt. À la descente du tramway au Nid d'aigle (2372 mètres), une longue file ininterrompue se forme pour rejoindre le refuge de Tête Rousse (3167 mètres) que l'on rejoint en mode randonnée classique. Quelques pas sur des névés et on arrive à la difficulté de la journée : le couloir du Goûter — rebaptisé « couloir de la mort » en raison du nombre d'accidents lors de sa traversée. En effet, des pierres dévalent en continu les 500 mètres de couloir qu'il faut traverser. Casques et rapidité sont de rigueur sur un sol qui ne permet pas non plus de courir en raison des chutes de neige de ces derniers jours. Quelques esquives plus tard, il faut maintenant monter jusqu'au refuge en escalade facile (si la roche n'était pas aussi friable). Il me faut quelques minutes pour être à l'aise avec les crampons dans les rochers et faire confiance au matériel. Arrivée au nouveau refuge du Goûter qui se veut être le fleuron de ce que l'on peut faire en matière d'écologie et de technologie. On se retrouve avec une pièce commune qui semble être designée par Ikea, à se demander si l'avenir est à la montagne aseptisée et déshumanisée, au moins ont-ils réussi à insonoriser les lieux ce qui est appréciable lorsque 120 personnes se mettent à table. Grosse sensation de fatigue accumulée sur ces derniers jours, exacerbée par la dernière montée qui a laissée des traces, pas terrible pour partir en confiance le lendemain… heureusement aucune trace de mal aigu des montagnes, il faut croire que la journée d'acclimatation à l'aiguille du Midi a porté ses fruits.

Jour 2 : Réveil à 3h pour un petit déjeuner express, l'ambiance est à l'économie de paroles, de gestes, de souffle. C'est une peu la cohue dans la salle où tout le monde chausse et s'encorde mais ça reste raisonnable. Crampons ajustés, bâtons vissés, corde avalée, c'est parti pour le dôme du Goûter (4304 mètres) à la suite de quelques cordées qui donnent un rythme irrégulier, cassant. Le dôme que l'on apercevait du refuge semble maintenant si loin, et le vent commence à souffler faisant tomber la température aux alentours des -15°C. Difficile entrée en matière, on décide de faire une pause au sommet pour boire un peu et prendre une barre après 1h30 d'effort. Le temps de se refroidir et de constater que la pipette à eau est en train de geler… Petite descente avant d'attaquer la montée vers l'abri Vallot (4362 mètres), les extrémités commencent à geler ce qui m'oblige à faire bouger mes doigts en permanence, l'inclinaison de la pente est telle qu'il faut parfois avancer avec la pointe des crampons en biais mais le soleil réconfortant commence à éclairer l'horizon de manière spectaculaire. On distingue les sommets environnants qui semblent tout petits malgré leurs 4000 mètres. Un coup d'œil vers le haut me permet d'apercevoir l'arrête sommitale, je me retourne vers mon oncle avec un grand sourire : « on va le faire ! ». C'est le moment où la fatigue commence à arriver après 3 heures d'effort dans le froid et l'oxygène se fait de plus en plus rare (45% en moins au sommet du Mont-Blanc). On dépasse quand même quelques cordées ce qui me rassure sur mon niveau de forme. On aperçoit enfin le sommet (4810 mètres), j'avale les quelques mètres de corde qui me séparent de mon compagnon de cordée pour que l'on finisse ensemble et on laisse éclater notre joie avant de se couvrir rapidement car il y a un peu de vent. On savoure ce moment unique en passant une petite heure au sommet, ce qui nous permet de récupérer aussi après 3h30 de montée !

La descente jusqu'au refuge est très agréable, surtout après l'euphorie sommitale, on y fait une pause pour se rassasier un peu et surtout se réhydrater vu que ma poche à eau avait gelée à la montée. Un peu de désescalade pour arriver jusqu'au couloir où l'on profite d'une accalmie dans les chutes de pierres pour passer sans trop de stress. Il est temps de regarder les horaires du tramway pour redescendre, il n'y en a qu'un toutes les 1h40 ! Et le prochain est dans 1 heure, on tente le coup malgré les 800 mètres de dénivelés à se faire. Dur pour les genoux mais on arrive à temps, ouf ! Avec le recul ça aura été le plus fatigant de la journée :p

Vouloir atteindre le sommet du Mont-Blanc est un premier pas dans l'alpinisme. Cela demande une bonne condition physique, une bonne acclimatation, une bonne météo et un peu de chance pour passer le couloir du Goûter sans se prendre un caillou mal placé. Rien d'inaccessible ni de technique et relativement peu de dangers (surtout vu l'affluence) si l'on est correctement équipé et entraîné. Je ne souhaite pas minimiser le risque pour autant d'une telle course et je vous invite à vous faire accompagner d'un guide, d'autant plus si vous souhaitez emprunter une autre voie.

J'ai publié quelques photos de cette ascension.

[hautefeuille] Kismet et la source dont on ne se souvient jamais

$
0
0

kismet

Editez :

/etc/kismet/kismet.conf

Cherchez la ligne qui concerne la source.

  • Carte Alfa

    source = rt8180, wlan0, ALFA

  • Carte Ralink

    source = rt73, rausb0, Ralink

  • Carte Realtek

    source = rt8180, wlan0, RTL8187

  • Carte Atheros

    source = madwifi_g, wifi0, Atheros

  • Carte Zydas

    source = zd1211, eth0, ZyDAS

[j-mad] Pytong, des tongs, une plage, des présentations et des gens biens

$
0
0
La semaine dernière j’ai eu le plaisir d’assister (et de prendre la parole) à la première édition de Pytong, première édition, un événement organisé par Laurent et David à Toulon. Le samedi, direction la Cantine de Toulon dans les locaux de l’ISEN. La journée s’est découpée en deux parties, conférences et ligthing talk jusqu’à 15h [...]

[afpyro] AFPyro à Bruxelles (BE) - vendredi 28 Juin

$
0
0

Un AFPyro est un apéro rassemblant des pythonistes de tout genre, c’est l’occasion de rencontrer le petit monde de la communauté Python en Belgique, peu importe votre niveau.

Ça sera également l’occasion de discuter à propos de la création d’une association Python en Belgique.

Le début des festivités est fixé à 19h30.

Restaurant la Bécasse : Chaussée de Boondael 476 - 1050 BRUXELLES ( IXELLES ): http://www.resto.be/restaurant/bruxelles-ixelles/148-becasse/

Merci de vous inscrire au doodle ici pour que nous puissions reservez le bon nombre de place: http://www.doodle.com/ehxknid6iz9bzkpe

[hautefeuille] Les meilleures adresses pour se fournir en électronique

[Biologeek] Données intimes

$
0
0

Now that we have enough details about how the NSA eavesdrops on the internet, including today's disclosures of the NSA's deliberate weakening of cryptographic systems, we can finally start to figure out how to protect ourselves.

NSA surveillance: A guide to staying secure, Bruce Schneier

Bruce donne quelques conseils dédiés aux citoyens mais je m'interroge sur ma responsabilité en tant que développeur : comment faire en sorte qu'une rencontre avec les services secrets soit la moins problématique ? Comment préserver l'intimité de l'ensemble de mes utilisateurs ?

Une première action à entreprendre pourrait être de séparer les données des utilisateurs par pays/juridiction afin de n'en révéler qu'une partie. On pourrait même aller plus loin dans le découpage afin de pouvoir fournir uniquement les données propres à un utilisateur ou aux amis de ses amis.

Une seconde action qui irait probablement aux limites de la législation en vigueur dans les états concernés serait de mettre en place une commande de suppression des relations (attention, pas des données) et de délivrer les données à plat sans pouvoir suivre les liens entre les personnes/media/discussion/etc.

Une autre option est de ne stocker que des données chiffrées côté client, c'est ce que fait le service ZeroBin par exemple (il y a même une version en Python). Même avec un très gros datacenter ça prend quelques temps à déchiffrer si chaque clé unique est générée par chaque utilisateur.

Enfin il y a énormément de choses à inventer en matière de pair-à-pair et, même si des connexions asymétriques rendent les échanges de données moins performantes, la démocratisation du haut-débit est suffisante pour échanger au moins du texte de manière privée et sécurisée.

Je suis surpris qu'il y ait si peu d'initiatives de résistance de la part des geeks pour mettre en place les solutions techniques qui sont à notre disposition afin de réacquérir une intimité à nos échanges sur le web.

[afpyro] AFPyro à Bruxelles (BE) - vendredi 28 Juin

$
0
0

Un AFPyro est un apéro rassemblant des pythonistes de tout genre, c’est l’occasion de rencontrer le petit monde de la communauté Python en Belgique, peu importe votre niveau.

Ça sera également l’occasion de discuter à propos de la création d’une association Python en Belgique.

Le début des festivités est fixé à 19h30.

Restaurant la Bécasse : Chaussée de Boondael 476 - 1050 BRUXELLES ( IXELLES ): http://www.resto.be/restaurant/bruxelles-ixelles/148-becasse/

Merci de vous inscrire au doodle ici pour que nous puissions reservez le bon nombre de place: http://www.doodle.com/ehxknid6iz9bzkpe

[Inspyration] Python et les téléphones portables

$
0
0
Voici un article qui présage un meilleur support de Python pour les téléphones portable

[logilab] Going to EuroScipy2013

$
0
0

The EuroScipy2013 conference was held in Bruxelles at the Université libre de Bruxelles.

http://www.logilab.org/file/175984/raw/logo-807286783.png

As usual the first two days were dedicated to tutorials while the last two ones were dedicated to scientific presentations and general python related talks. The meeting was extended by one more day for sprint sessions during which enthusiasts were able to help free software projects, namely sage, vispy and scipy.

Jérôme and I had the great opportunity to represent Logilab during the scientific tracks and the sprint day. We enjoyed many talks about scientific applications using python. We're not going to describe the whole conference. Visit the conference website if you want the complete list of talks. In this article we will try to focus on the ones we found the most interesting.

First of all the keynote by Cameron Neylon about Network ready research was very interesting. He presented some graphs about the impact of a group job on resolving complex problems. They revealed that there is a critical network size for which the effectiveness for solving a problem drastically increase. He pointed that the source code accessibility "friction" limits the "getting help" variable. Open sourcing software could be the best way to reduce this "friction" while unit testing and ongoing integration are facilitators. And, in general, process reproducibility is very important, not only in computing research. Retrieving experimental settings, metadata, and process environment is vital. We agree with this as we are experimenting it everyday in our work. That is why we encourage open source licenses and develop a collaborative platform that provides the distributed simulation traceability and reproducibility platform Simulagora (in french).

Ian Ozsvald's talk dealt with key points and tips from his own experience to grow a business based on open source and python, as well as mistakes to avoid (e.g. not checking beforehand there are paying customers interested by what you want to develop). His talk was comprehensive and mentioned a wide panel of situations.

http://vispy.org/_static/img/logo.png

We got a very nice presentation of a young but interesting visualization tools: Vispy. It is 6 months old and the first public release was early August. It is the result of the merge of 4 separated libraries, oriented toward interactive visualisation (vs. static figure generation for Matplotlib) and using OpenGL on GPUs to avoid CPU overload. A demonstration with large datasets showed vispy displaying millions of points in real time at 40 frames per second. During the talk we got interesting information about OpenGL features like anti-grain compared to Matplotlib Agg using CPU.

We also got to learn about cartopy which is an open source Python library originally written for weather and climate science. It provides useful and simple API to manipulate cartographic mapping.

Distributed computing systems was a hot topic and many talks were related to this theme.

https://www.openstack.org/themes/openstack/images/openstack-logo-preview-full-color.png

Gael Varoquaux reminded us what are the keys problems with "biggish data" and the key points to successfully process them. I think that some of his recommendations are generally useful like "choose simple solutions", "fail gracefully", "make it easy to debug". For big data processing when I/O limit is the constraint, first try to split the problem into random fractions of the data, then run algorithms and aggregate the results to circumvent this limit. He also presented mini-batch that takes a bunch of observations (trade-off memory usage/vectorization) and joblib.parallel that makes I/O faster using compression (CPUs are faster than disk access).

Benoit Da Mota talked about shared memory in parallel computing and Antonio Messina gave us a quick overview on how to build a computing cluster with Elasticluster, using OpenStack/Slurm/ansible. He demonstrated starting and stopping a cluster on OpenStack: once all VMs are started, ansible configures them as hosts to the cluster and new VMs can be created and added to the cluster on the fly thanks to a command line interface.

We also got a keynote by Peter Wang (from Continuum Analytics) about the future of data analysis with Python. As a PhD in physics I loved his metaphor of giving mass to data. He tried to explain the pain that scientists have when using databases.

https://scikits.appspot.com/static/images/scipyshiny_small.png

After the conference we participated to the numpy/scipy sprint. It was organized by Ralph Gommers and Pauli Virtanen. There were 18 people trying to close issues from different difficulty levels and had a quick tutorial on how easy it is to contribute: the easiest is to fork from the github project page on your own github account (you can create one for free), so that later your patch submission will be a simple "Pull Request" (PR). Clone locally your scipy fork repository, and make a new branch (git checkout -b <newbranch>) to tackle one specific issue. Once your patch is ready, commit it locally, push it on your github repository and from the github interface choose "Push request". You will be able to add something to your commit message before your PR is sent and looked at by the project lead developers. For example using "gh-XXXX" in your commit message will automatically add a link to the issue no. XXXX. Here is the list of open issues for scipy; you can filter them, e.g. displaying only the ones considered easy to fix :D

For more information: Contributing to SciPy.

[logilab] Emacs turned into a IDE with CEDET

$
0
0

Abstract

In this post you will find one way, namely thanks to CEDET, of turning your Emacs into an IDE offering features for semantic browsing and refactoring assistance similar to what you can find in major IDE like Visual Studio or Eclipse.

div.abstract p.topic-title {font-weight: bold; color: #E6820E;} div.abstract {font-style: italic}

Introduction

Emacs is a tool of choice for the developer: it is very powerful, highly configurable and has a wealth of so called modes to improve many aspects of daily work, especially when editing code.

The point, as you might have realised in case you have already worked with an IDE like Eclipse or Visual Studio, is that Emacs (code) browsing abilities are quite rudimentary... at least out of the box!

In this post I will walk through one way to configure Emacs + CEDET which works for me. This is by far not the only way to get to it but finding this path required several days of wandering between inconsistent resources, distribution pitfall and the like.

I will try to convey relevant parts of what I have learnt on the way, to warn about some pitfalls and also to indicate some interesting direction I haven't followed (be it by choice or necessity) and encourage you to try. Should you try to push this adventure further, your experience will be very much appreciated... and in any case your feedback on this post is also very welcome.

The first part gives some deemed useful background to understand what's going on. If you want to go straight to the how-to please jump directly to the second part.

Sketch map of the jungle

This all started because I needed a development environment to do work remotely on a big, legacy C++ code base from quite a lightweight machine and a weak network connection.

My former habit of using Eclipse CDT and compiling locally was not an option any longer but I couldn't stick to a bare text editor plus remote compilation either because of the complexity of the code base. So I googled emacs IDE code browser and started this journey to set CEDET + ECB up...

I quickly got lost in a jungle of seemingly inconsistent options and I reckon that some background facts are welcome at this point as to why.

Up to this date - sept. 2013 - most of the world is in-between two major releases of Emacs. Whereas Emacs 23.x is still packaged in many stable Linux distribution, the latest release is Emacs 24.3. In this post we will use Emacs 24.x which brings lots of improvements, two of those are really relevant to us:

  • the introduction of a package manager, which is great and (but) changes initialisation
  • the partial integration of some version of CEDET into Emacs since version 23.2

Emacs 24 initialisation

Very basically, Emacs used to read the user's Emacs config (~/.emacs or ~/.emacs.d/init.el) which was responsible for adapting the load-path and issuing the right (require 'stuff) commands and configuring each library in some appropriate sequence.

Emacs 24 introduces ELPA, a new package system and official packages repository. It can be extended by other packages repositories such as Marmalade or MELPA

By default in Emacs 24, the initialisation order is a bit more complex due to packages loading: the user's config is still read but should NOT require the libraries installed through the package system: those are automatically loaded (the former load-path adjustment and (require 'stuff) steps) after the ~/.emacs or ~/.emacs.d/init.el has finished. This makes configuring the loaded libraries much more error-prone, especially for libraries designed to be configured the old way (as of today most libraries, notably CEDET).

Here is a good analysis of the situation and possible options. And for those interested in the details of the new initialisation process, see following sections of the manual:

I first tried to stick to the new-way, setting up hooks in ~/.emacs.d/init.el to be called after loading the various libraries, each library having its own configuration hook, and praying for the interaction between the package manager load order and my hooks to be ok... in vain. So I ended up forcing the initialisation to the old way (see Emacs 24 below).

What is CEDET ?

CEDET is a Collection of Emacs Development Environment Tools. The major word here is collection, do not expect it to be an integrated environment. The main components of (or coupled with) CEDET are:

Semantic
Extract a common semantic from source code in different languages
(e)ctags / GNU global
Traditional (exhuberant) CTags or GNU global can be used as a source of information for Semantic
SemanticDB
SemanticDB provides for caching the outcome of semantic analysis in some database to reduce analysis overhead across several editing sessions
Emacs Code Browser
This component uses information provided by Semantic to offer a browsing GUI with windows for traversing files, classes, dependencies and the like
EDE
This provides a notion of project analogous to most IDE. Even if the features related to building projects are very Emacs/ Linux/ Autotools-centric (and thus not necessarily very helful depending on your project setup), the main point of EDE is providing scoping of source code for Semantic to analyse and include path customisation at the project level.
AutoComplete
This is not part of CEDET but Semantic can be configured as a source of completions for auto-complete to propose to the user.
and more...
Senator, SRecode, Cogre, Speedbar, EIEIO, EAssist are other components of CEDET I've not looked at yet.

To add some more complexity, CEDET itself is also undergoing heavy changes and is in-between major versions. The last standalone release is 1.1 but it has the old source layout and activation method. The current head of development says it is version 2.0, has new layout and activation method, plus some more features but is not released yet.

Integration of CEDET into Emacs

Since Emacs 23.2, CEDET is built into Emacs. More exactly parts of some version of new CEDET are built into Emacs, but of course this built-in version is older than the current head of new CEDET... As for the notable parts not built into Emacs, ECB is the most prominent! But it is packaged into Marmalade in a recent version following head of development closely which, mitigates the inconvenience.

My first choice was using built-in CEDET with ECB installed from the packages repository: the installation was perfectly smooth but I was not able to configure cleanly enough the whole to get proper operation. Although I tried hard, I could not get Semantic to take into account the include paths I configured using my EDE project for example.

I would strongly encourage you to try this way, as it is supposed to require much less effort to set up and less maintenance. Should you succeed I would greatly appreciate some feedback of you experience!

As for me I got down to install the latest version from the source repositories following as closely as possible Alex Ott's advices and using his own fork of ECB to make it compliant with most recent CEDET:

How to set up CEDET + ECB in Emacs 24

Emacs 24

Install Emacs 24 as you wish, I will not cover the various options here but simply summarise the local install from sources I choose.

  1. Get the source archive from http://ftpmirror.gnu.org/emacs/
  2. Extract it somewhere and run the usual (or see the INSTALL file) - configure --prefix=~/local, - make, - make install

Create your emacs personal directory and configuration file ~/.emacs.d/site-lisp/ and ~/.emacs.d/init.el and put this inside the latter:

;; this is intended for manually installed libraries
(add-to-list 'load-path "~/.emacs.d/site-lisp/")

;; load the package system and add some repositories
(require 'package)
(add-to-list 'package-archives
             '("marmalade" . "http://marmalade-repo.org/packages/"))
(add-to-list 'package-archives
             '("melpa" . "http://melpa.milkbox.net/packages/") t)

;; Install a hook running post-init.el *after* initialization took place
(add-hook 'after-init-hook (lambda () (load "post-init.el")))

;; Do here basic initialization, (require) non-ELPA packages, etc.

;; disable automatic loading of packages after init.el is done
(setq package-enable-at-startup nil)
;; and force it to happen now
(package-initialize)
;; NOW you can (require) your ELPA packages and configure them as normal

Useful Emacs packages

Using the emacs commands M-x package-list-packages interactively or M-x package-install <package name>, you can install many packages easily. For example I installed:

Choose your own! I just recommend against installing ECB or other CEDET since we are going to install those from source.

You can also insert or load your usual Emacs configuration here, simply beware of configuring ELPA, Marmalade et al. packages after (package-initialize).

CEDET

  • Get the source and put it under ~/.emacs.d/site-lisp/cedet-bzr. You can either download a snapshot from http://www.randomsample.de/cedet-snapshots/ or check it out of the bazaar repository with:

    ~/.emacs.d/site-lisp$ bzr checkout --lightweight \
    bzr://cedet.bzr.sourceforge.net/bzrroot/cedet/code/trunk cedet-bzr
    
  • Run make (and optionnaly make install-info) in cedet-bzr or see the INSTALL file for more details.

  • Get Alex Ott's minimal CEDET configuration file to ~/.emacs.d/config/cedet.el for example

  • Adapt it to your system by editing the first lines as follows

    (setq cedet-root-path
        (file-name-as-directory (expand-file-name
            "~/.emacs.d/site-lisp/cedet-bzr/")))
    (add-to-list 'Info-directory-list
            "~/projects/cedet-bzr/doc/info")
    
  • Don't forget to load it from your ~/.emacs.d/init.el:

    ;; this is intended for configuration snippets
    (add-to-list 'load-path "~/.emacs.d/")
    ...
    (load "config/cedet.el")
    
  • restart your emacs to check everything is OK; the --debug-init option is of great help for that purpose.

ECB

  • Get Alex Ott ECB fork into ~/.emacs.d/site-lisp/ecb-alexott:

    ~/.emacs.d/site-lisp$ git clone --depth 1  https://github.com/alexott/ecb/
    
  • Run make in ecb-alexott and see the README file for more details.

  • Don't forget to load it from your ~/.emacs.d/init.el:

    (add-to-list 'load-path (expand-file-name
          "~/.emacs.d/site-lisp/ecb-alexott/"))
    (require 'ecb)
    ;(require 'ecb-autoloads)
    

    Note

    You can theoretically use (require 'ecb-autoloads) instead of (require 'ecb) in order to load ECB by need. I encountered various misbehaviours trying this option and finally dropped it, but I encourage you to try it and comment on your experience.

  • restart your emacs to check everything is OK (you probably want to use the --debug-init option).

  • Create a hello.cpp with you CEDET enable Emacs and say M-x ecb-activate to check that ECB is actually installed.

Tune your configuration

Now, it is time to tune your configuration. There is no good recipe from here onward... But I'll try to propose some snippets below. Some of them are adapted from Alex Ott personal configuration

More Semantic options

You can use the following lines just before (semantic-mode 1) to add to the activated features list:

(add-to-list 'semantic-default-submodes 'global-semantic-decoration-mode)
(add-to-list 'semantic-default-submodes 'global-semantic-idle-local-symbol-highlight-mode)
(add-to-list 'semantic-default-submodes 'global-semantic-idle-scheduler-mode)
(add-to-list 'semantic-default-submodes 'global-semantic-idle-completions-mode)

You can also load additional capabilities with those lines after (semantic-mode 1):

(require 'semantic/ia)
(require 'semantic/bovine/gcc) ; or depending on you compiler
; (require 'semantic/bovine/clang)
Auto-completion

If you want to use auto-complete you can tell it to interface with Semantic by configuring it as follows (where AAAAMMDD.rrrr is the date.revision suffix of the version od auti-complete installed by you package manager):

;; Autocomplete
(require 'auto-complete-config)
(add-to-list 'ac-dictionary-directories (expand-file-name
             "~/.emacs.d/elpa/auto-complete-AAAAMMDD.rrrr/dict"))
(setq ac-comphist-file (expand-file-name
             "~/.emacs.d/ac-comphist.dat"))
(ac-config-default)

and activating it in your cedet hook, for example:

...
;; customisation of modes
(defun alexott/cedet-hook ()
...
    (add-to-list 'ac-sources 'ac-source-semantic)
) ; defun alexott/cedet-hook ()
Support for GNU global a/o (e)ctags
;; if you want to enable support for gnu global
(when (cedet-gnu-global-version-check t)
  (semanticdb-enable-gnu-global-databases 'c-mode)
  (semanticdb-enable-gnu-global-databases 'c++-mode))

;; enable ctags for some languages:
;;  Unix Shell, Perl, Pascal, Tcl, Fortran, Asm
(when (cedet-ectag-version-check)
  (semantic-load-enable-primary-exuberent-ctags-support))

Using CEDET for development

Once CEDET + ECB + EDE is up you can start using it for actual development. How to actually use it is beyond the scope of this already too long post. I can only invite you to have a look at:

Conclusion

CEDET provides an impressive set of features both to allow your emacs environment to "understand" your code and to provide powerful interfaces to this "understanding". It is probably one of the very few solution to work with complex C++ code base in case you can't or don't want to use a heavy-weight IDE like Eclipse CDT.

But its being highly configurable also means, at least for now, some lack of integration, or at least a pretty complex configuration. I hope this post will help you to do your first steps with CEDET and find your way to setup and configure it to you own taste.


[Inspyration] Substance D

$
0
0
Un RAD conçu au dessus de Pyramid dans l'esprit de Zope2.

[logilab] JDEV2013 - Software development conference of CNRS

$
0
0

I had the pleasure to be invited to lead a tutorial at JDEV2013 titled Learning TDD and Python in Dojo mode.

I quickly introduced the keywords with a single slide to keep it simple:

http://Python.org
+ Test Driven Development (Test, Code, Refactor)
+ Dojo (house of training: Kata / Randori)
= Calculators
  - Reverse Polish Notation
  - Formulas with Roman Numbers
  - Formulas with Numbers in letters

As you can see, I had three types of calculators, hence at least three Kata to practice, but as usual with beginners, it took us the whole tutorial to get done with the first one.

The room was a class room that we set up as our coding dojo with the coder and his copilot working on a laptop, facing the rest of the participants, with the large screen at their back. The pair-programmers could freely discuss with the people facing them, who were following the typing on the large screen.

We switched every ten minutes: the copilot became coder, the coder went back to his seat in the class and someone else stood up to became the copilot.

The session was allocated 3 hours split over two slots of 1h30. It took me less than 10 minutes to open the session with the above slide, 10 minutes as first coder and 10 minutes to close it. Over a time span of 3 hours, that left 150 minutes for coding, hence 15 people. Luckily, the whole group was about that size and almost everyone got a chance to type.

I completely skipped explaining Python, its syntax and the unittest framework and we jumped right into writing our first tests with if and print statements. Since they knew about other programming languages, they picked up the Python langage on the way.

After more than an hour of slowly discovering Python and TDD, someone in the room realized they had been focusing more on handling exception cases and failures than implementing the parsing and computation of the formulas because the specifications where not clearly understood. He then asked me the right question by trying to define Reverse Polish Notation in one sentence and checking that he got it right.

Different algorithms to parse and compute RPN formulas where devised at the blackboard over the pause while part of the group went for a coffee break.

The implementation took about another hour to get right, with me making sure they would not wander too far from the actual goal. Once the stack-based solution was found and implemented, I asked them to delete the files, switch coder and start again. They had forgotten about the Kata definition and were surprised, but quickly enjoyed it when they realized that progress was much faster on the second attempt.

Since it is always better to show that you can walk the talk, I closed the session by praticing the RPN calculator kata myself in a bit less than 10 minutes. The order in which to write the tests is the tricky part, because it can easily appear far-fetched for such a small problem when you already know an algorithm that solves it.

Here it is:

import operator

OPERATORS = {'+': operator.add,
             '*': operator.mul,
             '/': operator.div,
             '-': operator.sub,
             }

def compute(args):
    items = args.split()
    stack = []
    for item in items:
        if item in OPERATORS:
            b,a = stack.pop(), stack.pop()
            stack.append(OPERATORS[item](a,b))
        else:
            stack.append(int(item))
    return stack[0]

with the accompanying tests:

import unittest
from npi import compute

class TestTC(unittest.TestCase):

    def test_unit(self):
        self.assertEqual(compute('1'), 1)

    def test_dual(self):
        self.assertEqual(compute('1 2 +'), 3)

    def test_tri(self):
        self.assertEqual(compute('1 2 3 + +'), 6)
        self.assertEqual(compute('1 2 + 3 +'), 6)

    def test_precedence(self):
        self.assertEqual(compute('1 2 + 3 *'), 9)
        self.assertEqual(compute('1 2 * 3 +'), 5)

    def test_zerodiv(self):
        self.assertRaises(ZeroDivisionError, compute, '10 0 /')

unittest.main()

Apparently, it did not go too bad, for I had positive comments at the end from people that enjoyed discovering in a single session Python, Test Driven Development and the Dojo mode of learning.

I had fun doing this tutorial and thank the organizators for this conference!

[Inspyration] Développez rapidement des IHM efficaces pour console

$
0
0
la bibliothèque pyscreen repose sur curse pour proposer de développer très rapidement des Interfaces Homme Machine efficaces pour la console.

[gvaroquaux] Publishing scientific software matters

$
0
0
Christophe Pradal, Hans Peter Langtangen, and myself recently edited a version of the Journal of Computational Science on scientific software, in particular those written in Python. We wrote an editorial defending writing and publishing open source scientific software that I wish to summarize here. The full text preprint is openly available in my publications list [...]

[cubicweb] Brainomics - A management system for exploring and merging heterogeneous brain mapping data

Viewing all 3409 articles
Browse latest View live