Displaying 20 results from an estimated 7000 matches similar to: "How to use bash command in R script?"
2011 May 26
3
change function scope?
I'm still getting used to R's scoping. I've run into the following situation
value=0
thefunction <- function() print( value )
somefunction <- function() { value=99; thefunction() }
somefunction()
now, I understand that somefunction() returns 0 because thefunction() was
defined with value=0 in its parent envrionment, it dosent look at all in the
environment of somefunction. My
2006 Mar 31
3
Howto cut the first digit
Hi, sorry for this noop question,
but does anybody know how to cut the first digit of a variable?
example:
044612345
should be after cut operation:
44612345
My try in the extension.conf:
exten => _0[0-9].,2,Cut(mynum=EXTEN,/ ,1)
exten => _0[0-9].,3,Dial(Zap/g1/${mynum},90,T)
but it didn't work, my problem is the delemiter, I have no delemiter,
the default is "-" but how to
2006 Jul 18
1
SpeexEncoder requires 320 samples to process a Frame, not 160
Hi guys
I have tried compiling this attached code, I made all the buffers 320, there is no trace of a 160 buffer, but I get a "
SpeexEncoder requires 320 samples to process a Frame, not 160" error.
Maybe there's something I'm missing, here's my code:
import java.io.IOException;
import java.io.FileOutputStream;
import java.io.File;
import
2009 Feb 26
2
[PATCH 1/2] exa: turn WaitMarker into a NOP.
- map should handle this.
---
src/nouveau_exa.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/nouveau_exa.c b/src/nouveau_exa.c
index b656ca7..20ad380 100644
--- a/src/nouveau_exa.c
+++ b/src/nouveau_exa.c
@@ -259,7 +259,7 @@ nouveau_exa_mark_sync(ScreenPtr pScreen)
static void
nouveau_exa_wait_marker(ScreenPtr pScreen, int marker)
{
-
2011 Feb 14
1
Asterisk Call File using Local Channel not passing Variable back to Dialplan
Hi Everyone,
I am trying to pass a variable using the .call files but it turns out blank.
Can someone please point out what might be wrong here:
*/tmp/spool-file.sh*
*----------------------------------------------------------------------*
echo "Channel: Local/s at callback_leg*1*/n
CallerID: \"Call-back\" <123456>
MaxRetries: 0
RetryTime: 10
WaitTime: 45
Context:
2011 Dec 04
2
Extract last 3 characters from numeric vector
Hi all,
I have a numeric vector with 1 decimal place, and I'd like to extract
the last 3 characters, including the decimal point. The vector ranges
from 0 to 20.
x <- round(runif(100)*20, digits=1)
Some of numbers have 3 characters, and some have 4. I've read up on
the substr() function but that extracts characters based on exact
positions. How can I extract just the last 3
2011 Mar 30
3
how about a "<p-" operator?
I was cursing Matlab again today (what else is new) because the default
action for every Matlab command is to spew the result to the console,
and one must remember to put that darn ";" at the end of every line.
So I just wondered: was there ever a discussion as to providing some
modified version of the "<-" and "->" operators in R to do the reverse?
2006 Mar 21
2
Multiple commands per priority
Hi everybody.
I have been searching and trying for an answer, but no luck, so here I go..
Is there anyway to execute multiple commands on a single priority in
extensions.conf?
eg:
exten => X.,1,Dial(SIP/1111) & somefunction(${EXTEN})
I need the dial command to dial internal extensions, and the
"somefunction" to
kick of our own outgoing system for redirection to outside lines;
2016 Jun 14
2
Calling a null pointer. How undefined it is?
Hi all:
This question is related to a state machine generated by LLVM for a coroutine.
I stripped all coroutine related details to get to the essence of the question.
Let's say I have a state machine that looks like this:
struct State {
FnPtr Fn;
State() : Fn(&SomeFunction) {}
void Go() { (*Fn)(); }
void Stop() { Fn = nullptr; }
bool IsDone() { return Fn ==
2005 Sep 14
1
TE110P - Asterisk@Home Install Problems
I am having problems sending and receiving calls over the T1. They never seem to connect - outbound keeps ringing, inbound gets busy. The T1 looks ok - no errors on the line. Any ideas on what is wrong? I have tried a variety of fxsks and fxoks configurations without avail. This is a single asterisk@home system with a single T1 card. Robbed Bit T1 ami, d4.
------------------inbound call
2010 Dec 01
2
default arguments and '...' in a function
Dear R-users,
I'm trying to work out a way to set default values for arguments in a function which includes the optional argument '...'.
In practice, I have a 'plot' method for a function which specifies different types of plots. Every different plot should have different default arguments (for example for 'col', 'ylim' etc), plus the argument '...' to
2009 Oct 11
3
[LLVMdev] Problems linking shared library with __declspec(dllexport)
Hi all,
I am trying to use llvm-gcc to link shared libraries on windows/mingw32.
When I try to link libraries that contain functions declared with
__declspec(dllexport) someFunction();
I get the link error:
Cannot export _someFunction: symbol not found
Removing the declspec directive solves the problem, but this is not a
very feasible solution for me.
Using 'regular' gcc does not
2019 Mar 10
4
internal call record
Hello
Mynum: 6001 , Othernum: 6002.
I can record as follows. But I do not enter individual records for each internal
required. I want to do it more smoothly with a Macro.
Thanks.
exten => _6001,1,NoOp()
exten => _6001,n,MixMonitor(${UNIQUEID}.wav,ab)
exten => _6001,n,Dial(SIP/6001,20)
exten => _6001,n,StopMixMonitor()
exten => _6001,n,Hangup()
On Sat, Mar 9, 2019 at 6:50 PM
2002 Nov 07
2
combinations
I need to construct all possible combinations of an vector of length N taken
X at a time for simulation purposes. Taking a a small vector as an example:
>input <- c('a','b','c','d')
>somefunction(input)
a,b,c
a,b,d
a,c,d
b,c,d
my only solution thus far is:
somefunction <- function(x){
...a series of grotesque and horribly inefficient loops
2016 Oct 21
2
Problem with REMAINDER? 957%60 be 15 remainder 57 not 15 remainder -3 ?
I'm not mathematically gifted, but shouldn't 957%60 be 15 remainder 57?
Google and my desktop calculator certainly think so.
So where am I going wrong here? The following code
exten => 7,1,Verbose(Context: ${CONTEXT} Exten:${EXTEN})
same => n,Set(myNum=957)
same => n,Set(sec=$[REMAINDER(${myNum},60)])
same => n,Set(sec=$[ABS(${sec})])
same =>
2006 Jul 14
1
Open files
Hello
I'm running a Win2K box with a dialogic voice application. The prompt files
are on an AIX 5.1 box. By using smbstatus I'm finding that the prompt files
aren't closing. The open files build up until the server hits the per
process limit, at which point everything falls apart.
I was running samba 2.07, but I just upgraded to 3.0.23rc3 and I still have
the problem.
I used
2009 Oct 11
0
[LLVMdev] Problems linking shared library with __declspec(dllexport)
> I am trying to use llvm-gcc to link shared libraries on windows/mingw32.
> When I try to link libraries that contain functions declared with
> __declspec(dllexport) someFunction();
>
> I get the link error:
>
> Cannot export _someFunction: symbol not found
dllexport declspec should be put on the function definition, in this
example there is nothing to export - dllexport
2009 Oct 26
2
What is the most efficient practice to develop an R package?
I am reading Section 5 and 6 of
http://cran.r-project.org/doc/contrib/Leisch-CreatingPackages.pdf
It seems that I have to do the following two steps in order to make an
R package. But when I am testing these package, these two steps will
run many times, which may take a lot of time. So when I still develop
the package, shall I always source('linmod.R') to test it. Once the
code in
2015 Mar 02
2
[LLVMdev] clang change function name
On Mon, Mar 02, 2015 at 12:12:34AM -0500, John Criswell wrote:
> On 3/2/15 12:07 AM, Haopeng Liu wrote:
> >Got it, thanks. But in my pass, I use function name to locate. Can I
> >disable mangling in clang?
>
> No, but you can probably fine a library that can either mangle the original
> name or demangle the name you're seeing in the LLVM bitcode.
>
> As an FYI,
2011 Apr 22
1
Dual colour ramps based on pos/neg values
Hi Everyone:
I'm going a little nuts here and am hoping someone might have some
ideas to help out. Here is my problem:
I am using the calendarHeatMap function
(http://blog.revolutionanalytics.com/2009/11/charting-time-series-as-calendar-heat-maps-in-r.html)
to plot some values of percentages above or below a watermark. In
other words, I have a time series whose data can range arbitrarily