mercredi 11 décembre 2013

openCV in your face

Install OpenCV (choose which version)

jeudi 14 novembre 2013

Drone

http://gauth.fr/2011/09/introduction-to-the-ar-drone-sdk/
https://ffmpeg.org/trac/ffmpeg/wiki/UbuntuCompilationGuide

Navdata for flight demonstrations =====================
Control state : 0 mV 0.000  [vY] 0.000  [vZPsi] 0.000
Control state : 131072] 0.000  [Phi] 0.000  [Psi] 0.000
Battery level : 61 mVa] 0.000  [Phi] 0.000  [Psi] 0.000
Orientation   : [Theta] 3276.000  [Phi] -2533.000  [Psi] 8627.000
Altitude      : 218] 0.000  [vY] 0.000  [vZPsi] 0.000
Speed         : [vX] 3276.000  [vY] -2533.000  [vZPsi] 8627.000

mardi 5 novembre 2013

eibd

eibd

Install bug
checking for GNU Pth... *FAILED*
 +------------------------------------------------------------------------+
 | Found pthsem 2.0.8 under /usr/local, but
 | was unable to perform a sanity execution check. This usually
 | means that the pthsem shared library libpthsem.so is present
 | but $LD_LIBRARY_PATH is incomplete to execute a Pth test.
 | In this case either disable this test via --without-pth-test,
 | or extend $LD_LIBRARY_PATH, or build pthsem as a static
 | library only via its --disable-shared Autoconf option.
 | We used the following build environment:
 |    CC="gcc"
 |    CFLAGS="-g -O2 -I/usr/local/include"
 |    LDFLAGS=" -L/usr/local/lib"
 |    LIBS=" -lpthsem"
 | See config.log for possibly more details.
 +------------------------------------------------------------------------+

pi@raspberrypi ~ $ sudo findknxusb 
Possible addresses for KNX USB devices:
device: 1:4:1:0:0 (Merten GmbH & Co. KG:KNX-USB Data Interface)


eibd --help
Usage: eibd [OPTION...] URL
eibd -- a commonication stack for EIB
(C) 2005-2011 Martin Koegler <mkoegler@auto.tuwien.ac.at>
supported URLs are:
ft12:/dev/ttySx
ipt:router-ip[:dest-port[:src-port[:nat-ip[:data-port]]]]]
iptn:router-ip[:dest-port[:src-port]]
usb:[bus[:device[:config[:interface]]]]

ft12 connects over a serial line without any driver with the FT1.2 Protocol to
a BCU 2

ipt connects with the EIBnet/IP Tunneling protocol over an EIBnet/IP gateway.
The gateway must be so configured, that it routes the necessary addresses

iptn connects with the EIBnet/IP Tunneling protocol over an EIBnet/IP gateway
using the NAT mode

usb connects over a KNX USB interface



  -c, --GroupCache           enable caching of group communication network
                             state
  -d, --daemon[=FILE]        start the programm as daemon, the output will be
                             written to FILE, if the argument present
  -D, --Discovery            enable the EIBnet/IP server to answer discovery
                             and description requests (SEARCH, DESCRIPTION)
  -e, --eibaddr=EIBADDR      set our own EIB-address to EIBADDR (default
                             0.0.1), for drivers, which need an address
  -f, --error=LEVEL          set error level
  -i, --listen-tcp[=PORT]    listen at TCP port PORT (default 6720)
      --no-tunnel-client-queuing   do not assume KNXnet/IP Tunneling bus
                             interface can handle parallel cEMI requests
  -p, --pid-file=FILE        write the PID of the process to FILE
  -R, --Routing              enable EIBnet/IP Routing in the EIBnet/IP server
  -S, --Server[=ip[:port]]   starts the EIBnet/IP server part
  -t, --trace=LEVEL          set trace level
  -T, --Tunnelling           enable EIBnet/IP Tunneling in the EIBnet/IP
                             server
  -u, --listen-local[=FILE]  listen at Unix domain socket FILE (default
                             /tmp/eib)
  -?, --help                 Give this help list
      --usage                Give a short usage message
  -V, --version              Print program version

Mandatory or optional arguments to long options are also mandatory or optional
for any corresponding short options.


pi@raspberrypi ~ $ sudo eibd --trace=1 -u usb:1:4:1:0
W00000001: EIBD should not run as root
Layer 0(014ABF98,527910F5) StartRecv
Layer 0(014ABF98,527910F5) Send(064): 01 13 09 00 08 00 01 0F 01 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Layer 0(014ABF98,527910F5) StartSend
Layer 0(014ABF98,527910F5) SendComplete 64
Layer 0(014ABF98,527910F5) RecvComplete 64
Layer 0(014ABF98,527910F5) RecvUSB(064): 01 13 0B 00 08 00 03 0F 02 00 00 01 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Layer 0(014ABF98,527910F5) StartRecv
Layer 0(014ABF98,527910F5) Send(064): 01 13 0A 00 08 00 02 0F 03 00 00 05 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Layer 0(014ABF98,527910F5) StartSend
Layer 0(014AC820,527910F5) Send-EMI(005): 46 01 00 60 12
Layer 0(014ABF98,527910F5) SendComplete 64
Layer 0(014ABF98,527910F5) Send(064): 01 13 0D 00 08 00 05 01 01 00 00 46 01 00 60 12 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Layer 0(014ABF98,527910F5) StartSend
Layer 0(014ABF98,527910F5) SendComplete 64
^CLayer 0(014AC820,527910FF) Send-EMI(005): 46 01 00 60 C0
Layer 0(014ABF98,527910FF) Send(064): 01 13 0D 00 08 00 05 01 01 00 00 46 01 00 60 C0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Layer 0(014ABF98,527910FF) StartSend
Layer 0(014ABF98,527910FF) SendComplete 64

sudo eibd -d -D -i -S -T usb:1:4:1:0:0
pi@raspberrypi ~ $ groupswrite ip:127.0.0.1 0/0/1 0
Send request
pi@raspberrypi ~ $ groupswrite ip:127.0.0.1 0/0/1 1
Send request
pi@raspberrypi ~ $ groupswrite ip:127.0.0.1 0/0/1 0
Send request

jeudi 24 octobre 2013

slider jquery


Creating a Volume Controller with jQuery UI Slider

By . Filed in Web Design

tag to be exact.
<script src="js/jquery-1.7.2.min.js"></script>   
<script src="js/jquery-ui-1.8.21.custom.min.js"></script>  

Step 2: HTML markup

The markup for the slider is very simple, we wrapped all necessary markup – the tooltip, the slider, and the volume – inside an HTML5 section tag. The jQuery UI will then automatically generate the rest.
<section>    
    <span class="tooltip"></span>    
    <div id="slider"></div>   
    <span class="volume"></span>   
</section>  

Step 3: Install the Slider UI

The snippet below will install the Slider on the page, but it applies only the default configuration.
  1. $(function() {  
  2.     $( "#slider" ).slider();  
  3. });  
So here we will enhance the slider a little by adding other configurations.
First, we store the slider element as a variable.
  1. var slider = $('#slider'),  
Then we set the minimum default value of the slider to be about 35, when it is firstly loaded.
  1. slider.slider({  
  2.     range: "min",  
  3.     value: 35,  
  4. });  
At this point, we won’t see anything on the browser yet, because the jQuery UI is basically only generating the markup. So, we need to apply some styles to start seeing the result visually on the browser.

Step 4: The Styles

Before proceeding, we need some assets from the PSD source file such as the background texture and the icon.
We will not talk about how to slice in this article, we will just focus on the code. If you aren’t sure how to slice, watch the following screencast first before proceeding.
All right, now let’s begin adding the styles.
We will start by positioning the slider at the center of the browser’s window and attach the background that we had sliced out from the PSD to the body.
  1. body {  
  2.     backgroundurl('../images/bg.jpg'repeat top left;  
  3. }  
  4. section {  
  5.     width150px;  
  6.     heightauto;  
  7.     margin100px auto 0;  
  8.     positionrelative;  
  9. }  
Next, we will apply the styles for the tooltip, the volume, the handle, the slider range and the slider itself.
We will do this part by part, starting with…

Slider

Since we did not define the maximum value for the Slider itself, the jQuery UI will apply the default; that is 100. Therefore, we can also apply 100 (px) for the slider’s width.
  1. #slider{  
  2.     border-width1px;  
  3.     border-stylesolid;  
  4.     border-color#333 #333 #777 #333;  
  5.     border-radius: 25px;  
  6.     width100px;  
  7.     positionabsolute;  
  8.     height13px;  
  9.     background-color#8e8d8d;  
  10.     backgroundurl('../images/bg-track.png'repeat top left;  
  11.   box-shadow: inset 0 1px 5px 0px rgba(0, 0, 0, .5),   
  12.                  0 1px 0 0px rgba(250, 250, 250, .5);  
  13.   left20px;  
  14. }  

Tooltip

The tooltip will be positioned above the slider by specifying its position absolutely with -25px for its top position.
  1. .tooltip {  
  2.     positionabsolute;  
  3.     displayblock;  
  4.     top: -25px;  
  5.     width35px;  
  6.     height20px;  
  7.     color#fff;  
  8.     text-aligncenter;  
  9.     font10pt TahomaArialsans-serif ;  
  10.     border-radius: 3px;  
  11.     border1px solid #333;  
  12.   box-shadow: 1px 1px 2px 0px rgba(0, 0, 0, .3);  
  13.     box-sizing: border-box;  
  14.     background: linear-gradient(top, rgba(69,72,77,0.5) 0%,rgba(0,0,0,0.5) 100%);  
  15. }  

Volume

We have modified the volume icon a bit to meet our idea. The idea is we are going to create an effect to raise the volume bar gradually in accordance with the slider’s value. I’m sure you often seen such an effect in a media player user interface.
.volume {   
    displayinline-block;   
    width25px;   
    height25px;   
    rightright: -5px;   
    backgroundurl('../images/volume.png'no-repeat 0 -50px;   
    positionabsolute;   
    margin-top: -5px 
}  

The UI Handle

The handle’s style is quite simple; it will have an icon that looks like a metallic circle, sliced from the PSD, and attached as the background.
We will also change the cursor mode to pointer, so the user will notice that this element is drag-able.
  1. .ui-slider-handle {  
  2.     positionabsolute;  
  3.     z-index: 2;  
  4.     width25px;  
  5.     height25px;  
  6.     cursorpointer;  
  7.     backgroundurl('../images/handle.png'no-repeat 50% 50%;  
  8.     font-weightbold;  
  9.     color#1C94C4;  
  10.     outlinenone;  
  11.     top: -7px;  
  12.     margin-left: -12px;  
  13. }  

The Slider Range

The slider range will have a slightly white gradient color.
  1. .ui-slider-range {  
  2.     background: linear-gradient(top#ffffff 0%,#eaeaea 100%);  
  3.     positionabsolute;  
  4.     border: 0;  
  5.     top: 0;  
  6.     height: 100%;  
  7.     border-radius: 25px;  
  8. }  

Step 5: The Effect

In this step we are going to start working on the Slider’s special effect.

Tooltip

At this point, the tooltip has no content yet, so we are going to fill it with the slider’s value. Also, the tooltip’s horizontal position will be correspond with the handle’s position.
First of all, we store the tooltip element as a variable.
  1. var tooltip = $('.tooltip');  
Then we define the tooltip’s effect we have mentioned above inside the Slide Event.
  1. slide: function(event, ui) {   
  2. var value = slider.slider('value'),  
  3. tooltip.css('left', value).text(ui.value);  
But, we also want the tooltip to be initially hidden.
  1. tooltip.hide();  
After that, when the handle is about to start sliding, it will be shown with a fade-in effect.
  1. start: function(event,ui) {  
  2.       tooltip.fadeIn('fast');  
  3. },  
And, when the user stops sliding the handle, the tooltip will fade-out and be hidden.
  1. stop: function(event,ui) {  
  2.      tooltip.fadeOut('fast');  
  3. },  

Volume

As we have mentioned above in the Styles section, we plan the volume icon to change correspondingly with the handle’s position or to be exact, the slider’s value. So, we will apply the following conditional statement to create this effect.
But, firstly, we store the volume element as well as the slider’s value as a variable.
  1. volume = $('.volume');  
Then we start the conditional statement.
When the slider’s value is lower or equal to 5 the volume icon will have no bars at all, indicating that the volume is very low, but when the slider’s value is increasing, the volume bar will start increasing as well.
  1. if(value <= 5) {   
  2.     volume.css('background-position''0 0');  
  3. }   
  4. else if (value <= 25) {  
  5.     volume.css('background-position''0 -25px');  
  6. }   
  7. else if (value <= 75) {  
  8.     volume.css('background-position''0 -50px');  
  9. }   
  10. else {  
  11.     volume.css('background-position''0 -75px');  
  12. };  

Put them all together

All right, in case you are confused with all the above stuff, don’t be. Here is the shortcut. Put all the following codes into your document.
  1. $(function() {  
  2.   
  3.     var slider = $('#slider'),  
  4.         tooltip = $('.tooltip');  
  5.   
  6.     tooltip.hide();  
  7.   
  8.     slider.slider({  
  9.         range: "min",  
  10.         min: 1,  
  11.         value: 35,  
  12.   
  13.         start: function(event,ui) {  
  14.           tooltip.fadeIn('fast');  
  15.         },  
  16.   
  17.         slide: function(event, ui) {  
  18.   
  19.             var value = slider.slider('value'),  
  20.                 volume = $('.volume');  
  21.   
  22.             tooltip.css('left', value).text(ui.value);  
  23.   
  24.             if(value <= 5) {   
  25.                 volume.css('background-position', '0 0');  
  26.             }   
  27.             else if (value <= 25) {  
  28.                 volume.css('background-position', '0 -25px');  
  29.             }   
  30.             else if (value <= 75) {  
  31.                 volume.css('background-position', '0 -50px');  
  32.             }   
  33.             else {  
  34.                 volume.css('background-position', '0 -75px');  
  35.             };  
  36.   
  37.         },  
  38.   
  39.         stop: function(event,ui) {  
  40.           tooltip.fadeOut('fast');  
  41.         },  
  42.     });  
  43.   
  44. });  
All right, let’s now view the result in the browser.

Conclusion

Today we have successfully created a more elegant jQuery UI theme but at the same time we have also successfully translated a PSD User Interface into a functional volume controller.
We hope this tutorial inspires you and could help you understand how to turn a PSD into a more usable product.
Lastly, if you have any question regarding this tutorial, feel free to add it in the comments section below.
source 

http://www.hongkiat.com/blog/jquery-volumn-slider/

lundi 20 mai 2013

time JS

  function displayTime() {      var str = "";        var currentTime = new Date()      var hours = currentTime.getHours()      var minutes = currentTime.getMinutes()      var seconds = currentTime.getSeconds()        if (minutes < 10) {          minutes = "0" + minutes      }      if (seconds < 10) {          seconds = "0" + seconds      }      str += hours + ":" + minutes + ":" + seconds + " ";      if(hours > 11){          str += "PM"      } else {          str += "AM"      }      return str;  }

dimanche 21 avril 2013

dimanche 14 avril 2013

readings

ST2 over SSH


  1. As of writing, these instructions work only for Sublime Text 2.  If I get a chance I'll look into forking rsub for the newly released ST3 (which runs Python3).
  2. If you don't already have Sublime Text's wonderful package manager, install it.
  3. Hit Ctrl+Shift+P, start typing "install" and select "Install Package"
  4. Start typing "rsub" and select it.
  5. Once it's installed, get on your terminal and do
    nano ~/.ssh/config
  6. Paste the following lines:
    Host your_remote_server.com      RemoteForward 52698 127.0.0.1:52698
  7. Save (ctrl+w) and SSH into your server (ssh username@your_remote_server.com).
  8. 'Install' the rsub remote script:
    sudo wget -O /usr/local/bin/rsub https://raw.github.com/aurora/rmate/master/rmate
  9. Make that script executable:
    sudo chmod +x /usr/local/bin/rsub
  10. Lastly, run rsub on the remote file you want to edit locally:
    rsub ~/my_project/my_file.html
    and it should magically open in Sublime Text!
source
http://log.liminastudio.com/writing/tutorials/sublime-tunnel-of-love-how-to-edit-remote-files-with-sublime-text-via-an-ssh-tunnel

lundi 18 février 2013

noduino

rep : noduino/duino/lib/board.js

noduino

BUG!! usb parser not working

dimanche 17 février 2013

node noduino

  • $ > git clone git@github.com:semu/noduino.git
  • $ > cd noduino
  • $ > git submodule update --init
  • $ > npm install
  • $ > node app.js
  • vendredi 15 février 2013

    noduino

    eclipse 12.04 bug

    to fix it

    on my Ubuntu 12.04 32 bit. I edit the command to:

    ln -s /usr/lib/jni/libswt-* ~/.swt/lib/linux/x86/

    And on Ubuntu 12.04 64 bit try:

    ln -s /usr/lib/jni/libswt-* ~/.swt/lib/linux/x86_64/

    jeudi 7 février 2013

    nodeJS raspberry pi

    how to install nodejs on the raspberry

    wget http://nodejs.org/dist/v0.8.11/node-v0.8.11.tar.gz
    tar -zxf node-v0.8.11.tar.gz
    cd node-v0.8.11
    ./configure
    make
    sudo make install

    and after 2h... it's ok


    $ curl http://nodejs.org/dist/v0.8.16/node-v0.8.16.tar.gz | tar xz
    $ cd node-v0.8.16
    $ ./configure
    $ make
    (... two hours of build output gibberish ...)
    $ make install

    or 
    $ curl http://nodejs.org/dist/node-latest.tar.gz | tar xz 


    $ node -v
    v0.8.16
    $ npm -v
    1.1.69
    $ which node
    /usr/local/bin/node
    $ ldd `which node`
      /usr/lib/arm-linux-gnueabihf/libcofi_rpi.so (0x40236000)
      libdl.so.2 => /lib/arm-linux-gnueabihf/libdl.so.2 (0x40074000)
      librt.so.1 => /lib/arm-linux-gnueabihf/librt.so.1 (0x40036000)
      libstdc++.so.6 => /usr/lib/arm-linux-gnueabihf/libstdc++.so.6 (0x40107000)
      libm.so.6 => /lib/arm-linux-gnueabihf/libm.so.6 (0x4023f000)
      libgcc_s.so.1 => /lib/arm-linux-gnueabihf/libgcc_s.so.1 (0x4007f000)
      libpthread.so.0 => /lib/arm-linux-gnueabihf/libpthread.so.0 (0x400a7000)
      libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0x402b0000)
      /lib/ld-linux-armhf.so.3 (0x400d2000)
    $



    mardi 15 janvier 2013

    unipolar -> bipolar

    phase A : Red
    phase B : White
    Phase C : Brown
    Phase D : Green