Pages

Monday 28 November 2011

setTimeOut() javascript function

function timer()
 {   
  // Calculate new YValue for the DataPoint
  var newYValue = Math.abs(Math.random() * 100 - 10 * dataPointIndex);

  // Update a YValue property of a DataPoint
  updateYValue(newYValue, dataPointIndex);

  // Update dataPointIndex
  dataPointIndex = (dataPointIndex > 4) ? 0 : dataPointIndex + 1;

  // Set timeout for timer() function
  setTimeout(timer, 5000);
 }

jquery ui changing themes

Some undocumented Google CDN Feature

link to stylesheet in the head section:
<link href="./jquery/css/start/jquery-ui.css" type="text/css" rel="stylesheet" />

javascript function to change theme:
function ThemeChange(mytheme){
  $("link[rel=stylesheet]").attr({href : "./jquery/css/" + mytheme + "/jquery-ui-1.7.2.custom.css"});
  $("#mytab").tabs('select', 0);
}

html code that is calling the javascript function:
<div id="divloadfiles" style="display: block; font-size: 10px; text-align: left;">
<select id="mytheme" onchange="javascript:ThemeChange(this.value);">
  <option value="redmond">redmond</option>
  <option value="sunny">sunny</option>
  <option value="smoothness">smoothness</option>
  <option value="vader">vader</option>
  <option value="blitzer">blitzer</option>
  <option value="le-frog">le-frog</option>
  <option value="overcast" selected="selected">overcast</option> 
  <option value="pepper-grinder">pepper-grinder</option>
  <option value="start">start</option>
</select>
</div>

linux ripping Audio-CDs

cdrdao read-toc --with-cddb --fast-toc --device 1,0,0 ddddlxy.txt > deneme1.log 2>&1
cdrdao scanbus
cdparanoia -vsQ > deneme2.log 2>&1

linux ripping and encoding audio files

linux'ta komut satırından cd yakmak

terminal'de...

önce ilk komut ile yazılacak device'ın device numarası alınır. buradaki örnekte 1,0,0

sonra ape flac veya wv wav haline getirilir.

cdimage.cue'da cdimage.wav olarak düzeltme yapılır ve
cdrdao write --speed 4 --device 1,0,0 --eject CDImage.cue
komutu ile yazılır.

her yerde sorunsuz çalışır.

#Scan the SCSI and IDE buses
cdrecord -scanbus

#Burn Audio CD from cuesheet
cdrdao write --speed 4 --device 1,0,0 --eject CDImage.cue

#Decode ape to wav
mac "CDImage.ape" "CDImage.wav" -d

#Decode flac to wav
flac -d CDImage.flac

mbr, grub

mbr backup & restore
# backup bootsector
sudo dd if=/dev/sda of=bootsector.img bs=512 count=1

# restore bootsector - boot with a LiveCD and issue the following command:
sudo dd if=bootsector.img of=/dev/sda


# backup bootsector (to a usb stick)
sudo dd if=/dev/sda of=/media/disk/boot.mbr bs=512 count=1

# restore bootsector (boot with a LiveCD, insert the usb stick, and issue the following command):
sudo dd if=/media/disk/boot.mbr of=/dev/sda bs=512 count=1


grub restore
# boot with a LiveCD and issue the following commands:

sudo grub
find /boot/grub/stage1
# Use the output from this command in the next command.
# For instance, if the root partition is the second partition of the first harddisk:
root (hd0,1)
setup (hd0)
quit