Friday, September 23, 2011

Udayavani Download-Perl Script

I always read Udayavani. I read Udayvani to understand the cultural and social face of Udupi. It is almost "pakka" that my permanent nest will be in Udupi. (extra to main topic)..

I read the paper online in the link: http://epaper.udayavani.com/. I had a problem here:After reading first page, I needed to wait sometime to download second page and so on. Most of the time I got irritate with this. In order to solve the problem, I used a small script which download the whole paper to the desktop directory.

Nb: There is nothing special in this code. Just(Junk) do it(JDI).

The perl code is here
#### New udayavani, with self date and directory of download.
###date 10/09/2011.

print "===================================\n
Welcome to Udayavani e-paper
\n===================================\n";

($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime(time);
$dd=$mday;
$mm=$mon+1;
$yy=$year+1900;
print "Date:",$dd,"-",$mm,"-",$yy,"\n";
print "\n===================================\n";

#=====Date conversion
if ($dd<10){
@day[0]=0;
@day[1]=$dd;
}
else{
@sdd=split(//,$dd);
@day[0]=@sdd[0];
@day[1]=@sdd[1];
}
#=== @day;

#==========month conversion;
if ($mm<10){
@month[0]=0;
@month[1]=$mm;
}
else{
@smm=split(//,$mm);
@month[0]=@smm[0];
@month[1]=@smm[1];
}
#===@month;
#=================year conversion;
@syy=split(//,$yy);
shift(@syy);
shift(@syy);
$date=@day[0].@day[1].@month[0].@month[1].@syy[0].@syy[1];
#print "\n\n", $date,"\n\n"; converted value.


#========download converion for links
@letters=split(//,$date);
$date_part="2011-".@letters[2].@letters[3]."-".@letters[0].@letters[1];
$j=0;
for($i=1;$i<17;$i++){
if($i<10){
@letters[9]=0;
@letters[10]=$i;
}
else{
@letters[9]=1;
@letters[10]=$j;
$j=$j+1;
}
#print @letters,"\n";
$pageName=join("",@letters);
$pageName="Man".$pageName."M.pdf";
$link="http://epaper.udayavani.com/PDF/MANIPAL/".$date_part."\/".$pageName;
print $link,"\n";
#print $pageName;
system("wget --directory-prefix=/home/venkat/Desktop/Udayavani $link");
}

====end of the code =====

Thursday, September 8, 2011

Audio Volume-In noisy environments

Hello,
While roaming with Motorola s305 stereo headset, I conceived an idea!
Many times, we need to be in different environments/surroundings where noise level is not constant. If we are listening music in the cool surroundings the volume of the audio may be 5% of the maximum, however, if we are in market area we may need to raise it to 100%.

Since surrounding noise(also called as ambient noise) greatly influence on the volume of audio we like to have. My idea is why we should not design a volume controller such that volume of audio automatically increases or decreased depending on the ambient noise level ?  

There is some kind of technique called ANC-Active Noise Cancellations (http://en.wikipedia.org/wiki/Active_noise_control). But I failed to understand whether I am talking is ANC in different way?

Friday, September 2, 2011

Bluetooth and Wifi

Hello, welcome to wire'less' world. I recently bought Motorola S305 bluetooth stereo headset. It is good one..!Enjoying.

   I have android G-i5801,samsung galaxy 3 mobile. Interesting thing is that it has wifi,bluetooth and lots of application (available in android market). 

My head cracked yesterday..! You know why, battery is 60% in  half an hour!! Before having headset I was to use only wifi and now adding bluetooth stereo headset, the mobile is more power hungry. 

I am thinking, if  wifi and bluetooth are of operating at  same frequency(with different protocols:it is a group of software programs which controls the hardware) why can not both share the same hardware? If we are able to share the hardware,whatever, complexity within the protocols can be compromised in the coding. I believe that if we make some changes in design, wifi can acts a bluetooth or wifi with a single hardware. Power will be saved, silicon area will be saved, $s will be saved.

Anybody have counter argument for this? Your suggestions are most welcomed.