This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.smartcloudcompany.onclickinxml; | |
import android.app.Activity; | |
import android.os.Bundle; | |
import android.view.View; | |
import android.view.View.OnClickListener; | |
import android.widget.Button; | |
import android.widget.Toast; | |
public class AndroidOnClickDefinitionInXMLActivity extends Activity implements OnClickListener { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#This will run Perl and Python scripts respectively in Rails console using 'gem escape'. Gem Escape allows to format path to the scripts properly. | |
perl_cmd = Escape.shell_command(['perl', "#{RAILS_ROOT}/bin/test_perl_script.pl"]).to_s | |
system perl_cmd | |
python_cmd = Escape.shell_command(['python', "#{RAILS_ROOT}/bin/test_python_script.py"]).to_s | |
system python_cmd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def dec2bin(number) | |
number = Integer(number) | |
if(number == 0) then 0 end | |
ret_bin = "" | |
while(number != 0) | |
ret_bin = String(number % 2) + ret_bin | |
number = number / 2 | |
end | |
ret_bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RAILS_ENV=development lib/daemons/mailer_ctl start | |
RAILS_ENV=development lib/daemons/mailer_ctl stop |
NewerOlder