Displaying 20 results from an estimated 40000 matches similar to: "Running Linux Command Through Ruby"
2006 Aug 08
5
off topic: running non-ruby programs through command line
Hi all,
Slightly OT, but is there any way to run command-line programs through Ruby?
I have a rails web application that performs some database work. After a
certain action is performed, the rails app should then call a java program
that performs additional work to our mainframe. This is under Win 2003
Server.
Any ideas?
Thanks,
Jin Lee
-------------- next part --------------
An HTML attachment
2009 Feb 22
1
running console commands in rails
Hey,
how can i run console commands form my rails app. I have tried using
backticks. eg
result = `svn checkout <url> <path>`
They work fine when i run the sciprt from the command line with
ruby something.rb
but when the same script is run form my rails app nothing happens. It
seems the commands are ignored. Does anyone know a different way of
doing this with out backticks or a
2014 Apr 11
1
4.0 stopped working after updating xubuntu 13.04
Hi
I got some strange issues on my samba4.0.1 install yesterday. It
happened a while after updating my xubuntu server 13.04 not 13.10.
Everything seems to be working fine except shares. Kerberos
authentication seem to function properly, also DNS works fine but shares
seem semi-broken.
I can't mount any shares on my Windows box, including netlogon,
profiles. I have one share that is
2007 Dec 05
5
Running php from RoR
Hello...
I am trying to execute a php script from within rails.
The action is triggered by a button.
def load_stock
if result = system(''php test.php'')
flash[:notice] = result
end
end
However, it keeps returning false.
If I run the command from the Windows command line it works.
Any ideas?
Thank you.
GPB
--~--~---------~--~----~------------~-------~--~----~
2012 Jul 26
2
ruby bindings, ruby 1.9.3 and xapian
Hello,
I've problem with xapian or sth.
Ubuntu 8.04, ruby 1.9.3 with rvm, when Im trying to initialize
database, Im getting this error:
irb > require 'xapian'
==> true
irb > database = Xapian::WritableDatabase.new('/full_path/db/xapian_db/development', Xapian::DB_CREATE_OR_OPEN)
ArgumentError: Wrong arguments for overloaded method
2004 Jun 14
2
error with barplot command?
when i use barplot ,it seems there is sth wrong with it.
my command are:
> beer = scan()
1: 3 4 1 1 3 4 3 3 1 3 2 1 2 1 2 3 2 3 1 1 1 1 4 3 1
26:
Read 25 items
> barplot(table(beer))
but it does NOT produce what i want.
> version
_
platform i386-pc-mingw32
arch i386
os mingw32
system i386, mingw32
status
major
2004 Jul 01
2
DISA and AGI: authenticate by caller ID?
I'm having trouble getting an AGI exec command to spawn app_disa. The
script executes properly, but does not spawn DISA. The CLI gives no helpful
clues. Am I doing the exec incorrectly?
I want to have a way to authenticate callers to the extension by Caller
ID... if their caller ID is in my database and set to active, they can call
out. [like a calling card but auth'd by CID instead
2012 May 18
5
[LLVMdev] Phi + Select Optimization
Hi all,
I've just written a small enhancement to SimplifyPHINode.
The idea is the following:
If we have this:
a = phi(X, X, undef, undef, X, undef)
X = select cond, sth, a
or this:
a = phi(X, X, undef, undef, X, undef)
X = select cond, a, sth
we can replace the phi by 'a' and the select by 'sth'.
Why does this work?
Well, in those cases where control-flow happens to
2009 Aug 23
2
difficult "for"
Hi,
My english isn't brilliant and my problem is very difficult to describe but
I try ;)
My first question is: May I write loop "for" like this or similar - for (i
in sth : sth[length(sth)], k in sth_else : length(sth_else) ) - I'd like
to have two independent conditions in the same loop "for".
My secound question depend on program below. I'd like to write every
2012 May 20
0
[LLVMdev] Phi + Select Optimization
Hi Roland,
> If we have this:
>
> a = phi(X, X, undef, undef, X, undef)
such a phi should already be replaced by X if X dominates this basic block.
Is this not the case? Or does each X here not necessary represent the same
value?
Ciao, Duncan.
> X = select cond, sth, a
>
> or this:
>
> a = phi(X, X, undef, undef, X, undef)
> X = select cond, a, sth
>
> we can
2017 Aug 02
2
can llvm-lit pass output of one RUN command as an argument to another RUN command
Is there a way to do this with llvm-lit, i.e., use the equivalent of
backticks?
foo takes a single argument, but doesn't read from stdin.
// RUN foo some_arg > %t; FileCheck %s < %t
// RUN foo `cat %t` | FileCheck --check-prefix=INVERSE
// CHECK: {{^[0-9]+$}}
// INVERSE: some_arg
thanks...
don
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
2007 Oct 09
5
Backticks wrapping SQL values in polymorphic associations...
Hopefully the subject line didn''t scare you. That said...
I have a simple polymorphic relationship (is that possible?):
class Part
has_many :attachments, :as => :attachable
end
class Attachment
belongs_to :attachable, :polymorphic => true
end
Calling Part.find(:first).attachments yields this SQL error:
ActiveRecord::StatementInvalid:
Mysql::Error: Unknown column
2005 Mar 21
1
ASTCC: perl / mysql or me???
I try to change something in ASTCC, but I am now totally blind, ....
I hang on one line now. I changed:
vpbx:/var/lib/asterisk/agi-bin # diff astcc-original.agi astcc.agi
22c22
< # exten => _00XXXXXXXXX,1,DeadAGI(astcc.agi,${CALLERIDNUM},${EXTEN})
---
> # exten =>
_00XXXXXXXXX,1,DeadAGI(astcc.agi,${CALLERIDNUM},${TARIFF},${EXTEN})
35c35
< # exten =>
2006 Sep 04
1
Command line cut-off
Hi,
I noticed that, when working with R on a command line, I cannot enter
anything into the command line which is longer than 1023 characters.
If I input sth longer, it'l be just cut off at this lenght, and a "+"
will be presented to me on the command line.
It's not as bad since I can copy'n'paste commands longer than this with
newline characters in between onto the
2006 Mar 19
3
String keys in hash
Hi all,
My app is going to count sth based on poll id in the url. The url
looks like:
http://address.com?id=dwNKiItvcyrQ5sycnIhmJablDfXsc9tshaGIVyNIei7.e7&some_other_parameters
In a controller, I''ve created a hash where the keys are the ids:
@codes = {
''dwNKiItvcyrQ5sycnIhmJablDfXsc9tshaGIVyNIei7.e7'' =>
{:partner_id => 0,
2006 Aug 08
8
Generating a unique id ?
Hello, I need to generate a unique ID, so far I''ve unit tested this
under 100000 iterations and it seems to work :
now.to_i.to_s + ''-'' + now.usec.to_s + ''-'' + rand(1000).to_s
Is there a better way ?
Thanks
Notes :
1) without usec, few percents of generated values are not uniques
2) the id generated is a string so the presence of
2009 Apr 19
1
data$ID -> I always get a NULL
I have database write as .csv file.
When I want to get sth from my database I get NULL, but I know that there is
sth!
For example:
> data$ID
NULL
> data$kod
NULL
but command like below is always recognize by R
> data[2,3]
[1] '082'
In my opinion this problem is also connect with my attempt to create a tree.
I always get errors.
> t.tree0=rpart(ID~.,t.train)
Error in
2009 Nov 15
1
where is a value in my list
I heve got a list:
lista=list()
a=c(2,4,5,5,6)
b=c(3,5,4,2)
c=c(1,1,1,8)
lista[[1]]=a
lista[[2]]=b
lista[[3]]=c
> lista
[[1]]
[1] 2 4 5 5 6
[[2]]
[1] 3 5 4 2
[[3]]
[1] 1 1 1 8
I would like to know where is number 5 (which line)?
For example I have got a loop:
k= vector(mode = "integer", length = 3)
for(i in 1:3)
{
for (j in 1:length(lista[[i]])){
if
2009 Feb 15
2
Collapsible Fieldset
Hey there,
(First steps in Ruby and Rails...)
I''m trying to make a fieldset collapsible, like they are, for example,
on many Drupal pages.
What I''ve figuared out is the following:
<fieldset id="addressdata" class="collapsible collapsed">
<legend>
<%= link_to_function("Show/Hide Addressdata") { |page| page[:
2006 Jun 23
2
Generate Models & Controllers from Ruby program
Hi All.
I would like to create a model, database, and controller (if possible)
from a webapp. Each model and controller will each have 4 methods, and
the database will always have the same number of fields. I will
probably create the database through create_table or a direct SQL
command.
My question is this - is there a method that I can call to create the
model and controllers? Would it