Category Archives: Programming Scripting Languages

A simple Ruby method to send email

scmuser created the topic: A simple Ruby method to send email A simple Ruby method to send email send_email “admnistrator@example.com”, :body => “This was easy to send” Source – jerodsanto.net/2009/02/a-simple-ruby-method-to-send-email/

What is the way to iterate through an array in Ruby?

scmuser created the topic: What is the way to iterate through an array in Ruby? What is the way to iterate through an array in Ruby? This will iterate through all the elements: This will iterate through all the elements giving you the value and the index: Source – stackoverflow.com/questions/310634/what-…ugh-an-array-in-ruby

Common ways to read a file in Ruby?

scmuser created the topic: Common ways to read a file in Ruby? It is also possible to explicitly close file after as above (pass a block to open closes it for you): Source – stackoverflow.com/questions/5545068/what…-read-a-file-in-ruby

Script for time stamp update.

scmuser created the topic: Script for time stamp update. write a batch Script for time stamp update? sgadmin replied the topic: Re:Script for time stamp update. for (( i = 2 ; i <= tfile ; i++ )) do mfile=`cat $data |head -$i|tail -1|tr -s ” ” ” ” |cut -f8 -d” “` mdate=`grep -i… Read More »

%~dp0 VS %cd%

rajeshkumar created the topic: %~dp0 VS %cd% Use of %~dp0 and Use of %cd% They are not equivalent. %cd% is available either to a batch file or at the command prompt and expands to the drive letter and path of the current directory (which can change e.g. by using the CD command) %~dp0 is only… Read More »