Search Results

Search found 5 results on 1 pages for 'manolo'.

Page 1/1 | 1 

  • concatenate files including path in header - path contains spaces

    - by manolo
    I have to concatenate a number of files in a directory structure which contains spaces in the folder names looking like this: ./CH 0000100014/A10/11XT/11xt#001.csv find . -name "*.csv" -type f -print0 | xargs -0 cat > allmycsv.txt does the job, however now I need to include the information contained in the path, i.e. CH 0000100014/A10/11XT as a header of each inputfile to cat. find . -name "*.csv" -type f -print0 | xargs -0 -I % sh -c 'echo %; cat %' >allmycsv.txt would do the job, if I had no spaces in the path, but in my case, cat does not get along with the space in the path name. Is there a way out? Cheers, E P.S. I am working on bash on OSX

    Read the article

  • How to change .htaccess file to work right in localhost?

    - by Manolo Salsas
    I have this snippet code in my .htaccess file to prevent users from hotlinking the server's images: RewriteEngine On RewriteCond %{HTTP_REFERER} ^$ [OR] RewriteCond %{HTTP_REFERER} !^http://(www.)?itransformer.es/.*$ [NC] RewriteRule \.(gif|jpe?g|png|wbmp)$ http://itransformer.es [R,L] Of course, it is not working in my localhost, but don't know how to achieve it. My guess is that I should change the domain name with any wildcard. Any idea? Update I've finally found out the answer thanks to @Chris solution: RewriteCond %{HTTP_REFERER} ^$ [OR] RewriteCond %{HTTP_REFERER} ^https?://%{HTTP_HOST}/.*/usuarios/.*$ [NC] RewriteRule \.(gif|jpe?g|png|wbmp)$ http://%{HTTP_HOST} [R=301,L] The /usuarios/ directory is because I only want to deny direct access to files inside this directory. Update2 For some reason, it doesn't work again. Finally I think that I found out a better solution: RewriteCond %{REQUEST_FILENAME} .*/usuarios/.*$ [NC] RewriteRule \.(gif|jpe?g|png|wbmp)$ http://%{HTTP_HOST} [R=301,L] I say better solution because what I want to deny is direct access to a file (image). Update3 Well, after a while I discovered above wasn't exactly what I wanted, so the next is definitive: RewriteCond %{HTTP_REFERER} ^$ [OR] RewriteCond %{HTTP_REFERER} !^https?://itransformer.*$ [NC] RewriteRule /usuarios/.*\.(gif|jpe?g|png|wbmp)$ - [R=404,L] Just two doubts: If I change the above to: RewriteCond %{HTTP_REFERER} ^$ [OR] RewriteCond %{HTTP_REFERER} !^https?://%{HTTP_HOST}.*$ [NC] RewriteRule /usuarios/.*\.(gif|jpe?g|png|wbmp)$ - [R=404,L] it doesn't work. I don't understand why, because %{HTTP_HOST} is equal to itransformer in my localhost, and it should work. The second doubt is why is shown the default 404 page and not my custom page (that is shown in all other 404 responses).

    Read the article

  • extract data from an array without using loop in R

    - by Manolo
    I have a vector v with row positions: v<-c(10,3,100,50,...) with those positions I want to extract elements of a matrix, having a column fixed, for example lets suppose my column number is 2, so I am doing: data<-c() data<-c(matrix[[v]][[2]]) matrix has the data in the following format: [[34]] [1] "200_s_at" "4853" "1910" "3554" "2658" So for example, I want to extract from the row 342 the value 1910 only, column 2, and do the same with the next rows but I got an error when I want to do that, is it possible to do it directly? or should I have a loop that read one by one the positions in v and fill the data vector like: #algorithm for i<-1 to length(v) pos<-v[i] data[[i]]<-c(matriz[[pos]][[2]]) next i Thanks

    Read the article

  • pl/sql does not work with %rowtype

    - by Manolo
    I want to do a simple PL/SQL program on the Oracle 10g internet environment. The program is: DECLARE stud_rec students%ROWTYPE; last_name VARCHAR2:='Clinton'; BEGIN SELECT * INTO stud_rec FROM students WHERE student_id=100; END; I have a table called students with data inside of it. The issue is that when I want to run this in the SQL command window I got this message: ORA-06550: line 3, column 11: PLS-00215: String length constraints must be in range (1 .. 32767) I have checked the syntax and I cannot find the error. Any help? Thanks in advance

    Read the article

  • pointers for getting elements of an array in C

    - by Manolo
    I am a newbie in C and I would like to get the elements of an array with a function, I have tried different options, but I still do not get the elements. My function is: void getelements(int *a, int cl) { int *p; for (p=&a[0];p<&a[cl];p++) { printf("%d\n",*p); } } I know that the solution should work like that, but it only prints the first element and then memory positions. I am calling my function with: int v={10,12,20,34,45}; getelements(&v,5); Any help? I need to use arithmetic of pointers. Thanks

    Read the article

1