Using * in a name of directory - directory

I am trying to generalize a command line and I can't understand why it doesn't work. The command line 2 works well and I tried write the line 1 just like the line 2 and I can't understand why doesn't executes the same command that the line 2.
1)/app/fsl/fsl-5.0.0/bin/eddy_correct /scratch/ld478/controls/${i}/I_2*/Series_*_ep2d_diff_FREE_63_p2/nii /scratch/ld478/controls/${i}/I_2/Series_*_ep2d_diff_FREE_63_p2/data 0
2)#/app/fsl/fsl-5.0.0/bin/eddy_correct /scratch/ld478/controls/10459/I_20100412_U-ID18515/Series_016_ep2d_diff_FREE_63_p2/DATA_0016.nii /scratch/ld478/controls/10459/I_20100412_U-ID18515/Series_016_ep2d_diff_FREE_63_p2/data 0

Related

Lookup Table (CombiTimeTable) in OpenModelica

I have some trouble using CombiTimeTable.
I want to fill the table using a txt file that contains two columns, the first is the time and the second is the related value (a current sample). Furthermore, I add #1 in the first line as the manual says.
Moreover, I add the following parameters:
tableOnFile=true,
fileName="C:/Users/gg/Desktop/CurrentDrivingCycle.txt"
I also have to add the parameter tableName but I don't know how to define it. I tried to define it using the name of the file (i.e. CurrentDrivingCycle) but I got this error message at the end of the simulation:
Table matrix "CurrentDrivingCycle" not found on file "C:/Users/ggalli/Desktop/CurrentDrivingCycle.txt".
simulation terminated by an assertion at initialization
Simulation process failed. Exited with code -1.
Do you know how can I solve this issue?
Thank you in advance!
See the documentation:
https://build.openmodelica.org/Documentation/Modelica.Blocks.Sources.CombiTimeTable.html
The name tab1(6,2) in the example of the documentation is the tableName. So yours should look something like:
#1
double CurrentDrivingCycle(6,2) # comment line
0 0
1 0
1 1
2 4
3 9
4 16

Instrumenting R programs using intel-pin

I am instrumenting R programs using pinatrace.so tool to generate trace for read and write memory instructions. What I observe is that multiple #eof statements get printed in the trace file at different places(which should have been actually get printed only at the end of the trace). Also, the immediate next line after #eof gets distorted and is not printed properly.
I am invoking R shell and my R program using the following command:
../../../pin -follow_execv -t obj-intel64/pinatrace.so -- /home/R-3.5.3./bin/R -f hello.R
The trace file gets printed as shown:
0 0x7ffc812cd1c8
1 0x7ffc812cd1c8
0 0x7f7f8555ee78
#eof
f6971ce8
1 0x6f4518
0 0x7ffc171a0b70
.....
.....
1 0x7ffc6da8f078
0 0x7f7c38786e78
#eof
ffc171a07c8
0 0x6f4e30
0 0x6ff918
What is wrong with this instrumentation?
When Pin is invoked with the follow_execv knob, it will create a new copy of itself in every child process that is created. The new copy is not aware that another copy is running in the parent or at all. See here:
If -follow_execv is enabled and the user has not registered to get a notification, Pin will be injected into child/exec-ed process with the same command line as of current process.
If the Pintool wasn't created with -follow_execv in mind, all copies of the Pintool will normally write to the same file. This will create strange artifacts such as what you're seeing, as different processes write to the same file and terminate it while other processes are writing after the terminator.
The simplest solution is to add a PID suffix to the file, another option is to use the Follow Child Process API (linked above) to determine which subprocess is the actual R program you want to trace. Finally, R may have support for instrumentation which you could use to instrument the program itself.

Logrotate errors

After last update of Centos 6 logrotate is not working correctly.
Anyone can point me to the source of problem?
I've got mails like this:
/etc/cron.daily/logrotate:
logrotate_script: line 1: daily: command not found
logrotate_script: line 2: rotate: command not found
logrotate_script: line 3: delaycompress: command not found`
Are you possibly putting those lines inside of a script block in your logrotate.conf script or scripts?
For example, inside a "postrotate", "prerotate", "firstaction", "lastaction" block before the "endscript" directive?
That would cause the script to treat those logrotate directives as commands in a script; since they are not commands, you'd get exactly the messages you mentioned.

Read in a file in R up to a designated point

I want to be able to read in a .txt file into R which is always going to be a n by 2 file (n rows and 2 columns). I don't know how big n is each time but at the end of the file it breaks into just one column, so the end of the file may look like this :
abc 500
def 600
--- 0
Total 0
--- 0
Ideally I would like to stop reading in when we hit the ----. This is always consistent, so read in but stop when you get to ----.

Is there a way to print out the line number of a js file in the console log

For debugging purposes, I usually use something like console.log('line number #').
Not sure if it's the best way to handle it but I think it would be helpful if I can just print out the line number of the line where I'm putting the console.log() dynamically.
Let's say:
1 //do something
2 if(file){
3 console.log('Line 3');
4 $('#uploads').css({ 'height' : 'auto' });
5 } else {
6 console.log(getLineNumber()); //just an example
7 $('#tags').val(temp);
8 }
In the above, if I happen to remove line 1 for instance, line 3 will be technically incorrect as the line number is decremented by 1 but the log will still show 3. But in line 6, suppose getLineNumber() returns the line number, then it will still make sense even after a line above has been removed.
So is there an easy way which acts like getLineNumber()?
You can use onerror event handler for that.
See the last example on this page: http://www.tutorialspoint.com/javascript/javascript_error_handling.htm
Direct link to example: http://www.tutorialspoint.com/cgi-bin/practice.cgi?file=javascript_40

Resources