vendredi 20 décembre 2013
mercredi 11 décembre 2013
openCV in your face
Install OpenCV (choose which version)
- OpenCV 2.4.6.1 from source (best choice):
sudo su -
wget https://raw.github.com/sgjava/cvp/master/scripts/ubuntu1204/install-opencv247.sh
chmod a+x install-opencv247.sh
./install-opencv247.sh
mardi 10 décembre 2013
lundi 25 novembre 2013
vendredi 22 novembre 2013
vendredi 15 novembre 2013
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
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
lundi 11 novembre 2013
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
However, please take note that this tutorial is intended for intermediate levels of experience. Having said that, It’s still relatively easy to follow, so long as you are fairly familiar with CSS and jQuery.
All right, now let’s get started.
Step 1: the jQuery UI
We obviously need the jQuery and the jQuery UI Library, and we have two option to utilize them. First, we can link the jQuery and the jQuery UI directly from the following CDN: Google Ajax API CDN, Microsoft CDN, and jQuery CDN, there are lots of advantages of using the hosted CDN file when we put our site live online.But since we will only be working on it offline, we will be using the second way instead.
We will download and customize the jQuery UI library from the official download page. As we only need the Slider plugin, we will select only the Slider library along with its dependencies and leave the others. That way the files we use will be much slimmer and can load faster. After that, link all those libraries to the HTML document, preferably at the bottom of the page or before the close
<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 HTML5section
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.- $(function() {
- $( "#slider" ).slider();
- });
First, we store the slider element as a variable.
- var slider = $('#slider'),
- slider.slider({
- range: "min",
- value: 35,
- });
Step 4: The Styles
Before proceeding, we need some assets from the PSD source file such as the background texture and the icon.- Converting a Design from PSD to HTML – Nettuts+
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
.- body {
- background: url('../images/bg.jpg') repeat top left;
- }
- section {
- width: 150px;
- height: auto;
- margin: 100px auto 0;
- position: relative;
- }
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’swidth
.- #slider{
- border-width: 1px;
- border-style: solid;
- border-color: #333 #333 #777 #333;
- border-radius: 25px;
- width: 100px;
- position: absolute;
- height: 13px;
- background-color: #8e8d8d;
- background: url('../images/bg-track.png') repeat top left;
- box-shadow: inset 0 1px 5px 0px rgba(0, 0, 0, .5),
- 0 1px 0 0px rgba(250, 250, 250, .5);
- left: 20px;
- }
Tooltip
The tooltip will be positioned above the slider by specifying its position absolutely with-25px
for its top position.- .tooltip {
- position: absolute;
- display: block;
- top: -25px;
- width: 35px;
- height: 20px;
- color: #fff;
- text-align: center;
- font: 10pt Tahoma, Arial, sans-serif ;
- border-radius: 3px;
- border: 1px solid #333;
- box-shadow: 1px 1px 2px 0px rgba(0, 0, 0, .3);
- box-sizing: border-box;
- background: linear-gradient(top, rgba(69,72,77,0.5) 0%,rgba(0,0,0,0.5) 100%);
- }
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 {
display: inline-block;
width: 25px;
height: 25px;
rightright: -5px;
background: url('../images/volume.png') no-repeat 0 -50px;
position: absolute;
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.- .ui-slider-handle {
- position: absolute;
- z-index: 2;
- width: 25px;
- height: 25px;
- cursor: pointer;
- background: url('../images/handle.png') no-repeat 50% 50%;
- font-weight: bold;
- color: #1C94C4;
- outline: none;
- top: -7px;
- margin-left: -12px;
- }
The Slider Range
The slider range will have a slightly white gradient color.- .ui-slider-range {
- background: linear-gradient(top, #ffffff 0%,#eaeaea 100%);
- position: absolute;
- border: 0;
- top: 0;
- height: 100%;
- border-radius: 25px;
- }
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.
- var tooltip = $('.tooltip');
- slide: function(event, ui) {
- var value = slider.slider('value'),
- tooltip.css('left', value).text(ui.value);
- tooltip.hide();
- start: function(event,ui) {
- tooltip.fadeIn('fast');
- },
- stop: function(event,ui) {
- tooltip.fadeOut('fast');
- },
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.
- volume = $('.volume');
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.
- if(value <= 5) {
- volume.css('background-position', '0 0');
- }
- else if (value <= 25) {
- volume.css('background-position', '0 -25px');
- }
- else if (value <= 75) {
- volume.css('background-position', '0 -50px');
- }
- else {
- volume.css('background-position', '0 -75px');
- };
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.- $(function() {
- var slider = $('#slider'),
- tooltip = $('.tooltip');
- tooltip.hide();
- slider.slider({
- range: "min",
- min: 1,
- value: 35,
- start: function(event,ui) {
- tooltip.fadeIn('fast');
- },
- slide: function(event, ui) {
- var value = slider.slider('value'),
- volume = $('.volume');
- tooltip.css('left', value).text(ui.value);
- if(value <= 5) {
- volume.css('background-position', '0 0');
- }
- else if (value <= 25) {
- volume.css('background-position', '0 -25px');
- }
- else if (value <= 75) {
- volume.css('background-position', '0 -50px');
- }
- else {
- volume.css('background-position', '0 -75px');
- };
- },
- stop: function(event,ui) {
- tooltip.fadeOut('fast');
- },
- });
- });
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/
vendredi 4 octobre 2013
lundi 23 septembre 2013
vendredi 13 septembre 2013
dimanche 4 août 2013
lundi 29 juillet 2013
dimanche 28 juillet 2013
samedi 15 juin 2013
jeudi 6 juin 2013
mercredi 5 juin 2013
jeudi 23 mai 2013
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; }
vendredi 17 mai 2013
lundi 6 mai 2013
jeudi 25 avril 2013
mercredi 24 avril 2013
mardi 23 avril 2013
lundi 22 avril 2013
dimanche 21 avril 2013
mercredi 17 avril 2013
git reading
Reading framework
On my way looking for some stillish slider and framework found those sites
http://web-ui-fw.github.io/
http://www.andysowards.com/blog/2012/40-best-web-ui-interface-framework-kits/
http://dribbble.com/
nodeJS framework
https://github.com/joyent/node/wiki/modules#wiki-web-frameworks-full
http://web-ui-fw.github.io/
http://www.andysowards.com/blog/2012/40-best-web-ui-interface-framework-kits/
http://dribbble.com/
nodeJS framework
https://github.com/joyent/node/wiki/modules#wiki-web-frameworks-full
dimanche 14 avril 2013
ST2 over SSH
- 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).
- If you don't already have Sublime Text's wonderful package manager, install it.
- Hit Ctrl+Shift+P, start typing "install" and select "Install Package"
- Start typing "rsub" and select it.
- Once it's installed, get on your terminal and do
nano ~/.ssh/config
- Paste the following lines:
Host your_remote_server.com RemoteForward 52698 127.0.0.1:52698
- Save (ctrl+w) and SSH into your server (ssh username@your_remote_server.com).
- 'Install' the rsub remote script:
sudo wget -O /usr/local/bin/rsub https://raw.github.com/aurora/rmate/master/rmate
- Make that script executable:
sudo chmod +x /usr/local/bin/rsub
- 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!
http://log.liminastudio.com/writing/tutorials/sublime-tunnel-of-love-how-to-edit-remote-files-with-sublime-text-via-an-ssh-tunnel
vendredi 5 avril 2013
coffee + sublime text2
Preferences > Browse Packages gets you to the right directory git clone git://github.com/jashkenas/coffee-script-tmbundle CoffeeScript git clone https://github.com/miksago/jade-tmbundle.git Jade git clone https://github.com/LearnBoost/stylus.git Stylus
lundi 18 février 2013
dimanche 17 février 2013
node noduino
vendredi 15 février 2013
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
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
$ 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
jeudi 3 janvier 2013
Inscription à :
Articles (Atom)