Wednesday, June 19, 2013

Important sites

சில பயனுள்ள இனையத்தளங்கள்!

சான்றிதழ்கள்

1) பட்டா / சிட்டா அடங்கல்
http://taluk.tn.nic.in/edistrict_certificate/land/chitta_ta.html?lan=ta

2) அ-பதிவேடு விவரங்களை பார்வையிட
http://taluk.tn.nic.in/eservicesnew/land/areg_ta.html?lan=ta

3) வில்லங்க சான்றிதழ்
http://www.tnreginet.net/igr/webAppln/EC.asp?tams=0

4) பிறப்பு மற்றும் இறப்பு சான்றிதழ்
http://www.tn.gov.in/appforms/birth.pdf

http://www.tn.gov.in/appforms/death.pdf

5) சாதி சான்றிதழ் / வாரிசு சான்றிதழ்
http://www.tn.gov.in/appforms/cert-community.pdf

6) இருப்பிட மற்றும் வருமான சான்றிதழ்
http://www.tn.gov.in/appforms/cert-income.pdf

C. E-டிக்கெட் முன் பதிவு

1) ரயில் மற்றும் பஸ் பயண சீட்டு
http://tnstc.ticketcounters.in/TNSTCOnline/

http://www.irctc.co.in/

http://www.yatra.com/

http://www.redbus.in/

2) விமான பயண சீட்டு
http://www.cleartrip.com/

http://www.makemytrip.com/

http://www.ezeego1.co.in/

D. E-Payments (Online)

1) BSNL தொலைபேசி மற்றும் Mobile Bill கட்டணம் செலுத்தும் வசதி
http://portal.bsnl.in/portal/aspxfiles/login.aspx

2) Mobile ரீ- சார்ஜ் மற்றும் டாப் அப் செய்யும் வசதி
https://www.oximall.com/

http://www.rechargeitnow.com/

http://www.itzcash.com/

3) E.B. Bill கட்டணம் செலுத்தும் வசதி
http://www.itzcash.com/

https://www.oximall.com/

http://www.rechargeitnow.com/

4) NEFT / RTGS மூலம் பிறர் ACCOUNT ‘க்கு பணம் மாற்றும் வசதி

5) E-Payment செய்து வேண்டிய பொருள் வாங்கும் வசதி
http://www.ebay.co.in/

http://shopping.indiatimes.com/

http://shopping.rediff.com/shopping/index.html

6) Share Market – பங்குச் சந்தையில் On-Line வணிகம் செய்யும் வசதி
http://www.icicidirect.com/

http://www.hdfcsec.com/

http://www.religareonline.com/

http://www.kotaksecurities.com/

http://www.sharekhan.com/

E. கல்வி மற்றும் வேலை வாய்ப்பு சார்ந்த சேவைகள் (Online)

1) மாணவர்கள் மேற்படிப்புக்கான வங்கிக் கடன் விவரங்கள் மற்றும் விண்ணப்பங்கள்
https://www.sbi.co.in/user.htm?action=viewsection&lang=0&id=0%2C1%2C20%2C118

http://www.indianbank.in/education.php

http://www.iob.in/vidya_jyothi.aspx

http://www.bankofindia.com/eduloans1.aspx

http://www.bankofbaroda.com/pfs/eduloans.asp

http://www.axisbank.com/personal/loans/studypower/Education-Loan.asp

http://www.hdfcbank.com/personal/loans/educational_loan/el_indian/el_indian.htm

2) பள்ளி மற்றும் கல்லூரி தேர்வு முடிவு / மதிப்பெண் பற்றிய தகவல் அறிந்துக் கொள்ளும் வசதி
http://www.tn.gov.in/dge/

http://www.tnresults.nic.in/

http://www.dge1.tn.nic.in/

http://www.dge2.tn.nic.in/

http://www.Pallikalvi.in/

http://www.results.southindia.com/

http://www.chennaionline.com/results

3) சமச்சீர் கல்வி பாட புத்தகங்களை பதிவிறக்கம் செய்ய
http://www.tn.gov.in/dge

4) இனையதளங்கள் மூலமாக 10th, 12th Std பாடங்களை கற்றுக்கொள்ளும் வசதி
http://www.classteacher.com/

http://www.lampsglow.com/

http://www.classontheweb.com/

http://www.edurite.com/

http://www.cbse.com/

5) 10th & 12th வகுப்பிற்கான அரசு தேர்வு மாதிரி கேள்வி தாள்கள் மற்றும் பாடங்களை படிக்க அல்லது பதிவிறக்கம் செய்ய
http://www.kalvisolai.com/

6) UPSC/ TNPSC/ BSRB / RRB / TRB க்கான பயிற்சி, தேர்வு மற்றும் வேலை வாய்ப்புகள் பற்றிய தகவல் அறிந்துக் கொள்ளும் வசதி
http://www.tnpsc.gov.in/

http://www.upsc.gov.in/

http://upscportal.com/civilservices/

http://www.iba.org.in/

http://www.rrcb.gov.in/

http://trb.tn.nic.in/

7) உள் நாடு மற்றும் உலக நாடுகளில் வேலை வாய்ப்புகள் பற்றிய தகவல் அறிந்துக் கொள்ளும் வசதி, பதிவு செய்து விண்ணப்பிக்கும் வசதி
http://www.employmentnews.gov.in/

http://www.omcmanpower.com/

http://www.naukri.com/

http://www.monster.com/
.இந்திய ராணுவத்தில் வேலை வாய்ப்புகள் அறிய
http://www.ssbrectt.gov.in/

http://bsf.nic.in/en/career.html

http://indianarmy.nic.in/

9) இந்திய கப்பல் படையில் பயிற்சி மற்றும் வேலை வாய்ப்புகள் அறிய
http://nausena-bharti.nic.in/

10) Face to Face chat / Interview நேர்காணல் செய்யும் வசதி
http://www.skype.com/

http://www.gmail.com/

http://www.yahoochat.com/

http://www.meebo.com/

F. கணினி பயிற்சிகள் (Online)

1) அடிப்படை கணினி பயிற்சி
http://www.homeandlearn.co.uk/

http://www.intelligentedu.com/

http://www.ehow.com/about_6133736_online-basic-computer-training.html

2) சிறார்களுக்கு கணினி பயிற்சி
http://www.ehow.com/video_5846782_basic-computer-training-children.html

3) இ – விளையாட்டுக்கள்
http://www.zapak.com/

http://www.miniclip.com/

http://www.pogo.com/

http://www.freeonlinegames.com/

http://www.roundgames.com/

4) ப்ரௌசிங், இ-மெயில், சாட்டிங், வெப் கான்ஃபெரென்ஸ், தகவல் தேடுதள்
http://www.google.com/

http://www.wikipedia.com/

http://www.hotmail.com/

http://www.yahoo.com/

http://www.ebuddy.com/

http://www.skype.com/

G. பொது சேவைகள் (Online)

1) தகவல் அறியும் உரிமை சட்டம்
http://rti.gov.in/

http://www.rtiindia.org/forum/content/

http://rti.india.gov.in/

http://www.rti.org/

2) சுற்றுலா மற்றும் முக்கிய தலங்கள் பற்றிய தகவல் பெறும் வசதி
http://www.incredibleindia.org/

http://www.india-tourism.com/

http://www.theashokgroup.com/

http://www.smartindiaonline.com/

3) திருமணம் புரிய விரும்புவோர் இணையதளங்கள் மூலமாக பதிவு செய்து தங்கள் வாழ்க்கை துணையை தேடி தேர்வு செய்யும் வசதி
http://www.tamilmatrimony.com/

http://kalyanamalai.net/

http://www.bharatmatrimony.com/

http://www.shaadi.com/

4) குழந்தைகளுக்கான தமிழ் பெயர்களை அர்த்ததோடு பார்க்கவும் மற்றும் தமிழ் அகராதி, தமிழ் புத்தகங்களை பார்க்க மற்றும் பதிவிறக்கம் செய்ய
http://www.tamilcube.com/

5) ஜாதகம் மற்றும் ராசிபலனை அறிந்துக் கொள்ள
http://www.koodal.com/

http://freehoroscopesonline.in/horoscope.php

6) இனையதளம் மூலமாக இந்தியாவில் எந்த ஒரு மொபைலுக்கும் இலவசமாக SMS அனுப்பும் வசதி
http://www.way2sms.com/

7) இனையதளம் மூலமாக உங்களுக்கு தேவையான VIDEO படங்களை தேடி கண்டு மகிழலாம்
http://www.youtube.com/
இனையதளம் மூலமாக உங்களுக்கு தேவையான தொழில் / வர்த்தகம் மற்றும் ஸ்தாபனங்கின் முகவரி / தொலைபேசி தகவல்கலை இலவசமாக தேடி தெரிந்து கொள்ளலாம்
http://www.justdial.com/

9) இனையதளம் மூலமாக உங்களுக்கு தேவையான மொழியில் தினசரி / வார நாளிதல்களை இலவசமாக வாசித்து செய்திகளை அறியலாம்
http://www.dinamalar.com/

http://www.dinamani.com/

http://www.dailythanthi.com/

http://www.tamilnewspaper.net/

http://www.vikatan.com/

http://www.puthiyathalaimurai.com/

http://www.nakkheeran.in/

10) இனையதளம் மூலமாக உங்களுக்கு தேவையான தொலைக்காட்சியில் ஒளிபரப்பாகும் நிகழ்ச்சிகளை நேரலையாக இலவசமாக கண்டு மகிழலாம்
http://puthiyathalaimurai.tv/new/

http://www.bbc.co.uk/

11) SPEED POST மூலமாக நீங்கள் அனுப்பும் தபால்களை இந்திய தபால் துறையின் இனையதளம் மூலமாக தபால் சேர்ந்த விவரம் அறியலாம்
http://services.ptcmysore.gov.in/Speednettracking/Track.aspx

12) இந்திய தபால் துறையின் INTERNATIONAL SPEED POST / ELECRTONIC MONEY ORDER / REGISTERED POST / EXPRESS PARCEL / E-VPP சேவைகளை தபால் துறையின் இனையதளம் மூலமாக விவரம் அறியலாம்.
http://www.indiapost.gov.in/tracking.aspx

H. மென்பொருள் (Software) பதிவிறக்கம் செய்ய

1) இனையதளம் மூலமாக உங்களுக்கு தேவையான மென்பொறுளை இலவசமாக பதிவிறக்கம் செய்து உபயோகிக்கலாம்
http://www.filehippo.com/

I. வணிகம் (Economy)

1) தமிழ் நாட்டின் இன்றைய தங்கம் மற்றும் வெள்ளியின் விலை விவரம் அறியலாம்
http://www.goldenchennai.com/

http://www.rates.goldenchennai.com/

http://www.bullionrates.in/p/live-bullion-rates.html

2) வெளிநாட்டின் பணமதிப்புக்கு இந்திய ரூபாயின் அன்றைய மாற்றத்தக்க மதிப்பை அறியலாம்
http://www.gocurrency.com/

http://www.xe.com/

H. அரசு சார்ந்த விண்ணப்ப படிவங்கள் (Online)

1) பாஸ்போர்ட் விண்ணப்பம்
http://www.passport.gov.in/

2) பட்டதாரிகள் அரசு வேலைவாய்ப்பிற்கு பதிவு செய்ய
http://www.tn.gov.in/services/employment.html

J. அரசு நலத் திட்ட படிவங்கள் (Online)

1) குடும்ப அட்டை
http://www.tn.gov.in/appforms/ration.pdf

2) மகளிர் சுய வேலை வாய்ப்பு திட்டத்தின் கீழ் வங்கிக் கடன் பெறுவதற்கான விண்ணப்பம்
http://www.tn.gov.in/tamiltngov/appforms/socialwelfare/wses_bankloan_form.pdf

3) பெண்கள் திருமணத்திற்கு கோரப்படும் உதவித் தொகை விண்ணப்பம் மற்றும் பெண் குழந்தை பாதுகாப்பு திட்டம்
http://www.tn.gov.in/tamiltngov/appforms/socialwelfare/socialwelfareschemes.pdf

4) நலிந்தோர் குடும்ப நல நிதியுதவி பெருவதற்கான மனு
http://www.tn.gov.in/tamiltngov/appforms/pdf-drs.pdf

5) ஆதரவற்ற முதியோர் / விதவைகள் / கணவனால் கைவிடப்பட்ட பெண்கள் / உடல் ஊனமுற்றோர் உதவி தொகைக்கான மனு
http://www.tn.gov.in/tamiltngov/appforms/pdf-oap.pdf

http://www.tn.gov.in/schemes/swnmp/social_security_net.pdf

6) புல எல்லை அளந்து அத்து காட்டக் கோருவதற்கான விண்ணப்பம்
http://www.tn.gov.in/tamiltngov/appforms/pdf-boundary.pdf

7) திருமணப்பதிவிற்கான குறிப்பாவணம் மற்றும் விண்ணப்ப படிவம்
http://www.tnreginet.net/english/Applforms/appln3.doc

http://www.tnreginet.net/english/Applforms/compulsory_marriage/Comp_Marriage_Application_Tamil.pdf
பட்டா பதிவு மாற்றம் கோருவதற்கான விண்ணப்ப படிவம் – சாதாரண பெயர் மாற்றம் / உட்பிரிவு மாற்றம்
http://www.tn.gov.in/tamiltngov/appforms/pdf-patta-transfer.pdf

K. விவசாய சந்தை சேவைகள் (Online)

1) தேசிய அளவிலான விற்பனை நிலவரம்
http://agmarknet.nic.in/

2) பதிவு செய்து தினசரி சந்தை விலைகளை பெறும் வசதி
http://indg.in/agriculture/e2030aci-nya2039-aea3153oiTM-moo2039/

3) தோட்டப்பயிரகளின் சந்தை நிலவரம்
http://nhb.gov.in/OnlineClient/categorywiseallvarietyreport.aspx

4) முக்கிய வியாபாரிகள் பற்றிய விவரம்
http://indg.in/agriculture/major-traders-database/

5) தமிழ்நாட்டில் உள்ள விவசாய அமைப்புகள் / சங்கங்கள்
http://indg.in/agriculture/database-of-growers-federations-farmers-associations-in-tamil-nadu/

6) கொள்முதல் விலை நிலவரம்
http://www.tnsamb.gov.in/price/login.php

7) ஒழுங்குமுறை விற்பனை கூடம்
http://www.tnsamb.gov.in/mktcom.php
தினசரி சந்தை விற்பனை விலை நிலவரம்
http://59.90.246.98/pricelist/

9) வானிலை செய்திகள்
http://services.indg.in/weather-forecast/

L. தொழில் நுட்பங்கள்

1) பயிர் சாகுபடி, பாதுகாப்பு மற்றும் பயிர் பெருக்கம்
http://www.agritech.tnau.ac.in/ta/Agriculture/agri_index_ta.html

http://www.agritech.tnau.ac.in/ta/crop_protection/crop_prot_ta.html

2) விதை கொள்முதல் செய்ய இருப்பு நிலை விவரம்
http://www.tnagrisnet.tn.gov.in/website/availabilityReports.php?type=Seed

3) உயிரிய தொழில்நுட்பம்
http://www.agritech.tnau.ac.in/ta/bio_tech/biotech_ta.html

4) அறுவடை பின்சார் தொழில் நுட்பம்
http://www.agritech.tnau.ac.in/ta/post_harvest/post_harvest_ta.html

5) உயிரி எரிபொருள்
http://www.agritech.tnau.ac.in/ta/bio_fuels/bio_fuels_ta.html

M. வேளாண் செய்திகள்

1) பாரம்பரிய வேளாண்மை
http://www.agritech.tnau.ac.in/ta/itk/indi_farm_ta.html

http://www.agritech.tnau.ac.in/ta/crop_protection/crop_prot_ta.html

2) வளம்குன்றா வேளாண்மை
http://www.agritech.tnau.ac.in/ta/sustainable_agri/susagri_ta.html

3) பண்ணை சார் தொழில்கள்
http://www.agritech.tnau.ac.in/ta/farm_enterprises/farm_enter_ta.html

4) ஊட்டச்சத்து
http://www.agritech.tnau.ac.in/ta/nutrition/nutrition_ta.html

5) உழவர்களின் கண்டுபிடிப்பு
http://www.agritech.tnau.ac.in/ta/farm_innovations/farm_innovations.html

N. திட்டம் மற்றும் சேவைகள்

1) ஊரக வளர்ச்சி மற்றும் ஊராட்சி துறையின் திட்டங்கள் & சேவைகள்
http://www.tnrd.gov.in/schemes_states.html

2) வேளாண் மற்றும் ஊரக வளர்ச்சிக்கான திட்டங்கள் & சேவைகள்
http://www.agritech.tnau.ac.in/ta/govt_schemes_services/govt_serv_schemes_ta.html

3) வட்டார வளர்ச்சி
http://www.agritech.tnau.ac.in/ta/dev_blocks/indextnmap_ta.html

4) வங்கி சேவை & கடனுதவி
http://www.agritech.tnau.ac.in/ta/banking/credit_bank_ta.htm

5) பயிர் காப்பீடு
http://www.agritech.tnau.ac.in/ta/crop_insurance/crop_ins_ta.html

6) Krishi Vigyan Kendra (KVK) | Agricultural Technology Management Agency (ATMA)
http://www.agritech.tnau.ac.in/ta/kvk/kvk_ta.html

http://www.agritech.tnau.ac.in/ta/atma/atma_ta.html

7) NGOs & SHGs
http://www.agritech.tnau.ac.in/ta/ngo_shg/ngo_shg_ta.html
அக்ரி கிளினிக்
http://www.agriclinics.net/

9) கிசான் அழைப்பு மையம்
http://www.agritech.tnau.ac.in/ta/kisan/kisan_ta.html

10) பல்லாண்டு மேம்பாட்டு குறிக்கோள்
http://www.agritech.tnau.ac.in/ta/mdg/mdg_ta.html

11) கேள்வி பதில்
http://www.agritech.tnau.ac.in/ta/faq_ta.html

12) பல்கலைக்கழக வெளியீடுகள்
http://www.agritech.tnau.ac.in/ta/tnau_publications/tnau_publish_ta.html

O. ஈ – வேளாண்மை செய்தி மற்றும் சேவைகள்

1) தோட்டக்கலை
http://www.agritech.tnau.ac.in/ta/horticulture/horti_index_ta.html

2) வேளாண் பொறியியல்
http://www.agritech.tnau.ac.in/ta/agrl_engg/agriengg_index_ta.html

3) விதை சான்றிதழ்
http://www.agritech.tnau.ac.in/ta/seed_certification/seedcertification_index_ta.html

4) அங்கக சான்றிதழ்
http://www.agritech.tnau.ac.in/ta/org_farm/orgfarm_index_ta.html

5) பட்டுபுழு வளர்பு
http://www.agritech.tnau.ac.in/ta/sericulture/seri_index_ta.html

6) வனவியல்
http://www.agritech.tnau.ac.in/ta/forestry/forestry_tamil_index.html

7) மீன்வளம் மற்றும் கால்நடை
http://www.agritech.tnau.ac.in/ta/fisheries/fish_index_ta.html
தினசரி வானிலை, மழைப்பொழிவு மற்றும் நீர்த்தேக்க நிலைகள்
http://services.indg.in/weather-forecast/

9) விதை மற்றும் உரம் தயாரிப்பாளர் விபரம்
http://www.tnsamb.gov.in/seedcomp.html

http://www.tnsamb.gov.in/fertilizers.html

10) உரங்களின் விலை விபரம்
http://www.tnagrisnet.tn.gov.in/website/FertilizerPrice.php

P. போக்குவரத்து துறை

1) ஓட்டுனர் பழகுனர் உரிமம் மனு முன்பதிவு
http://www.tn.gov.in/appforms/form2.pdf

2) புகார்/கோரிக்கைப் பதிவு
http://transport.tn.nic.in/transport/registerGrievanceLoad.do

3) வாகன வரி விகிதங்கள்
http://www.tn.gov.in/sta/taxtables.html

4) புகார்/கோரிக்கை நிலவரம்
http://transport.tn.nic.in/transport/grievance_statusLoad.do

5) ஓட்டுனர் உரிமம் சேவை முன்பதிவு
http://tnsta.gov.in/transport/transportTamMain.do

6) தொடக்க வாகன பதிவு எண்
http://transport.tn.nic.in/transport/rtoStartNoListAct.do

Monday, January 28, 2013

Form Select Helper in Ruby on Rails


It's crazy how little documentation there is on using selects (drop down lists) inside form-helpers in Rails.  So, it can get quite confusing when it comes to using the different select helpers; select, select_tag and collection_select.
In order to address this inadequate documentation and examples, I thought I would post here, some of the differnces between them with some examples so you can choose for yourself, the best one to use.

The selection box has some key parts, the name, which is required, and used by the browser when submitting the select tag.There are three different select form helpers in ruby on rails, "Select", "select_tag" and "collection_select". Let's compare them.

select(object, method, choices, options = {}, html_options = {})
Defined in ActionView::Helpers::FormOptionsHelper

  1. <%= select( "payment", "id", { "Male" => "1", "Female" => "2"}) %>
Select can be used in conjunction with a model object as seen in this example, an instance variable is passed into choices, but is being converted into an array of arrays.
  1. <%= f.select :gender_id, @genders.map {|r| [r.name,r.id] } %>
Use select_tag when you require a drop-down selection box populated with data not sourced from a database, and are happy to hard code the default selected option tag. Select_tag should also be used when you want to process your form as a GET, rather than a POST.
  1. <%= select_tag "payment", options_for_select([ "Male", "Female" ], "Male") %>
or
  1. <%= select_tag "payment", options_for_select(%w{ Male Female }) %>
You can also do multi-select boxes:
  1. <%= select_tag 'payment[]', options_for_select(@genders),
  2. :multiple => true, :size => 3 %>
(where the controller defines @genders as a hash of values).
In this example the gender methods are being added to the select box via a model object, notice how we use the option, :prompt to add an additional option tag to the select box, which will be selected by default. Note that if @object.method matches one of the option tags, this will be selected by default, and :prompt wont appear in the list.
  1. <%= collection_select(:gender, :id, @genders, :id, :name,
  2. options ={:prompt => "-Select a gender"}, :class =>"gender") %>
In sum:
Use select when you require a basic drop-down selection box populated with data not sourced from a database.
  • The object is the name of an instance variable. This is typically a model object (singular name of the table whose data your displaying, or in other words, the table record).
  • The method is the attribute of that instance variable. This is typically a field/column of the table whose data your displaying (really an ActiveRecord method).
  • Together the object and method specify the name of the select statement in the generated html choices can be any enumerable object e.g arrays and hashes and results of database queries, and contains the option tags for the select box.
  • The optional options argument takes various "options" some of which are listed below in the examples.
  • The optional html_options argument allows css to be used for styling the select box.
  • If one of the option tags in choices matches @object.method, that option tag will be selected.
Use collection_select when you require a drop-down selection box, whose source is a model/object
  • The object is the singular name of the table whose data your displaying (the table record).
  • The method is the field/column of the the relevant data (really an ActiveRecord method).
  • Together the object and method specify the name of the select statement in the generated html collection takes the option tags for the select box, this can be a hash or array.
  • The value_method is the field/column to use for the value of the option tags in your html.
  • The text_method is the field/column to use for the visible text of the option tags in your html.
  • The optional options argument takes various "options" some of which are listed below in the examples.
  • The optional html_options argument allows css to be used for styling the select box.
  • If one of the option tags in collection matches @object.method, that option tag will be selected.

Monday, January 24, 2011

Installing Ruby on Rails on Ubuntu 10.04

Open a console and install it with the following command.

sudo apt-get install ruby-full build-essential

To install gem:
mkdir gems
cd gems
wget http://rubyforge.org/frs/download.php/70696/rubygems-1.3.7.tgz
tar -xf rubygems-1.3.7.tgz
cd rubygems-1.3.7
sudo ruby setup.rb

The ruby setup script doesn’t automatically place a link to the gems application in your /usr/bin folder so add it now.

sudo ln -s /usr/bin/gem1.8 /usr/bin/gem

To install older version of rails

gem install rails --version 2.1.2
gem install rails --version 2.2.2
gem install rails --version 2.3.2
gem install rails --version 2.3.3
gem install rails --version 2.3.4
gem install rails --version 2.3.5

If you want latest version
gem install rails


To install mysql

apt-get install mysql-server libmysqlclient16 libmysqlclient16-dev mysql-client mysql-common
gem install mysql

Monday, April 5, 2010

Open or Editing larger size files (more than 4GB)

Today i am facing problem to open the large size file,its upto 2Gb.I have tried all editor but its fails.Finally i tried with notepad++ ,which is the powerful editor, it can open file size upto 5GB.My today issues is solved.

Friday, November 27, 2009

utilizing Google spreadsheet API In Ruby

In this class you just need to edit the username and password and the googlespreadsheetkey... That it!!!!!!!!!!!!!!!

Finally You can able to post Your data into your google docs.



class Myspreadsheet

require 'net/http'
require 'net/https'
require 'rubygems'
require 'xmlsimple'

def posts #(uri, data, headers)
http = Net::HTTP.new('www.google.com', 443)
http.use_ssl = true
path = '/accounts/ClientLogin'
data = 'accountType=HOSTED_OR_GOOGLE&Email=username@gmail.com&Passwd=password&service=wise'

headers ={ 'Content-Type' => 'application/x-www-form-urlencoded'}
resp, data = http.post(path, data, headers)
cl_string = data[/Auth=(.*)/, 1]
headers["Authorization"] = "GoogleLogin auth=#{cl_string}"

spreadsheets_uri = 'http://spreadsheets.google.com/feeds/spreadsheets/private/full'


def get_feed(uri, headers=nil)
uri = URI.parse(uri)
Net::HTTP.start(uri.host, uri.port) do |http|
return http.get(uri.path, headers)
end
end
my_spreadsheets = get_feed(spreadsheets_uri, headers)


puts my_spreadsheets.body

doc = XmlSimple.xml_in(my_spreadsheets.body, 'KeyAttr' => 'name')
require 'pp'

puts pp doc
spreadsheet_key = doc["entry"][0]["id"][0][/full\/(.*)/, 1]
worksheet_feed_uri = "http://spreadsheets.google.com/feeds/worksheets/#{spreadsheet_key}/private/full"

worksheet_response = get_feed(worksheet_feed_uri, headers)
worksheet_data = XmlSimple.xml_in(worksheet_response.body, 'KeyAttr' => 'name')

puts pp worksheet_data

listfeed_uri = worksheet_data["entry"][0]["link"][0]["href"]

response = get_feed(listfeed_uri, headers)
listfeed_doc = XmlSimple.xml_in(response.body, 'KeyAttr' => 'name')

puts pp listfeed_doc

cellfeed_uri = worksheet_data["entry"][0]["link"][1]["href"]

response = get_feed(cellfeed_uri, headers)


# Parse into datastructure and print
cellfeed_doc = XmlSimple.xml_in(response.body, 'KeyAttr' => 'name')


puts pp cellfeed_doc
# Set up our POST url


#"http://spreadsheets.google.com/feeds/list/tcIStC1pH2D2ohWewXnPIbQ/od6/private/full"
end

def encode_query(params)

puts params.map(){ |k, v| uri_encode(k) + "=" + uri_encode(v) }.join("&")

return params.map(){ |k, v| uri_encode(k) + "=" + uri_encode(v) }.join("&")
end

def uri_encode(str)
return URI.encode(str, /#{URI::UNSAFE}|&/n)
end

def h(str)
return CGI.escapeHTML(str.to_s())
end

def http_request(method, url, data, header = {})
uri = URI.parse(url)
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
http.start() do
path = uri.path + (uri.query ? "?#{uri.query}" : "")
if method == :delete
response = http.__send__(method, path, header)
else
response = http.__send__(method, path, data, header)
end
if !(response.code =~ /^2/)
raise(GoogleSpreadsheet::Error, "Response code #{response.code} for POST #{url}: " +
CGI.unescapeHTML(response.body))
end
return response.body
end
end

def post(uri, data)
@auth_token = nil
headers = Hash.new
headers["Content-Type"] = "application/atom+xml"
params = {
"accountType" => "HOSTED_OR_GOOGLE",
"Email" => 'username',
"Passwd" => 'password',
"service" => "wise",

}
response = http_request(:post,
"https://www.google.com/accounts/ClientLogin", encode_query(params))
@auth_token = response.slice(/^Auth=(.*)$/, 1)
#headers = { 'Content-Type' => 'application/atom+xml'}

headers["Authorization"] = "GoogleLogin auth=#{@auth_token}"

uri = URI.parse(uri)
http = Net::HTTP.new(uri.host, uri.port)

puts http.post(uri.path, data, headers)
return http.post(uri.path, data, headers)
end




p = Myspreadsheet.new
p.posts
post_url = "http://spreadsheets.google.com/feeds/list/tcIStC1pH2D2ohWewXnPIbQ/od6/private/full"


new_row = '' 'ruby' '' 'http://ruby-lang.org'
p.post(post_url, new_row)


end

Drag drop images from the desktop

To drag and drop images from the desktop ,we can able to achieve it by applet

download the jar file
download


Then include this applet into yr view file





you can achive it by adding this code ... very simple

Friday, August 21, 2009

Creating cronjob in ubuntu

Type : crontab -e

Then we can mention our command
# m h dom mon dow command

*/15 * * * * /deploy/project/cronjobs/alert.sh (Path file for where we have that sh file)

This will run for every 15 minute.

Example for run the rake task:
----------------------------------------------------

In the sh file we need to write the following details,
open the alert.sh and type the following

cd /home/deploy/applicationdirectory
/usr/bin/rake alerts

here this is the script for running the alerts tasks