Jump to content

RompeRatones

Active Members
  • Posts

    6
  • Joined

  • Last visited

Posts posted by RompeRatones

  1. brainstorming

    ls -Q *.jpg | grep -v -e highlight -e thumb -e sized | xargs cp destinationdir/

    update: it didnt worked...

    i got this to work nontheless

    for pics in `ls *.jpg | grep -v -e highlight -e thumb -e sized `; do cp $pics destinationdir/ ; done

    update2: oops i just saw a very similar command just above...

    here's one with sed

    for pics in `ls | sed 's/thumb|highlight|sized/DONTCOPY/g' | grep -v DONTCOPY `; do cp $pics destdir/ ; done

  2. I dont do windows, im actually working with

    ~/.mozilla/firefox/*.default/history.dat under linux and ii have no idea if it works on windows +cygwin (you need bash powa :-) );

    #!/bin/bash

    #usage ./script path_to_history outputfile

    HISTORY=$1

    grep http $HISTORY |

    cut -d"=" -f2 |

    grep ^http |

    awk -F"//" '{ print $2}' |

    cut -d"/" -f1 |

    sort |uniq > $2

  3. Some python here

    #!/usr/bin/env python
    
    # -*- coding: UTF-8 -*-
    
    
    
    while True:
    
        try:
    
            number1= int(raw_input('input number1: '))
    
            if number1>10000 or number1< (-10000):
    
                print "number not between values 10000 -10000"
    
                raise ValueError
    
            break
    
        except ValueError:
    
            print "Not valid.  Try again..."
    
    
    
    while True:
    
        try:
    
            number2= int(raw_input('input number2: '))
    
            if number2>10000 or number2< (-10000):
    
                print "number not between values 10000 -10000"
    
                raise ValueError
    
            if number2==number1:
    
                print "both numbers are the same... choose another"
    
                raise ValueError
    
            break
    
        except ValueError:
    
            print "Not valid.  Try again..."
    
            
    
    def showMe(number):
    
            
    
            for foo in range(2, number):
    
                if  number%foo==0:
    
                    return False
    
                
    
            return True
    
            
    
    
    
        
    
    def ShowPrimes(min, max):
    
            for numero_primo in range(min,max+1):
    
                res=showMe(abs(numero_primo))
    
                if res:
    
                    if numero_primo !=0: #  division by 0 doesnt count
    
                        print numero_primo
    
            
    
            
    
    VectorControl=[number1,number2]
    
    numMin=min(VectorControl)
    
    numMax=max(VectorControl)
    
    ShowPrimes(numMin,numMax)

×
×
  • Create New...