euglug.org

[카테고리:] Uncategorized

  • [Activism] Bush in 30 Seconds



    Bob MillerMon Jan 5 09:33:38 PST 2004

    Participatory democracy is getting weird in the 2004 presidential
    election.  Check this out.
    
    	http://www.bushin30seconds.org/
    
    Obligatory Linux content: The videos are in QuickTime format.  They
    play fine for me in xine and mplayer, but I've never figured out how
    to get mozilla's mplayer plugin to work.
    
    -- 
    Bob Miller                              K<bob>
    kbobsoft software consulting
    http://kbobsoft.com                     kbob at jogger-egg.com
    
  • [Activism] Clay Shirky on encryption



    Bob MillerWed Dec 17 14:29:08 PST 2003

    The RIAA Succeeds Where the Cypherpunks Failed 
    http://www.shirky.com/writings/riaa_encryption.html
    
    Quotes:
    
    	"[T]o a first approximation, every PC owner under the age of
    	35 is now a felon."
    
    	"The RIAA is succeeding where the Cypherpunks failed,
    	convincing users to trade a broad but penetrable privacy for
    	unbreakable anonymity under their personal control."
    
    	"It's too early to say how widely casual encryption use will
    	spread, but it isn't too early to see that the shift is both
    	profound and irreversible."
    
    
    -- 
    Bob Miller                              K<bob>
    kbobsoft software consulting
    http://kbobsoft.com                     kbob at jogger-egg.com
    
  • os.popen(‘cmd’).readlines() //Re: [Think_python] Ip address adventure



    HorstSat Dec 13 18:21:39 PST 2003

    In response to:
    
    > Date: Sat, 13 Dec 2003 18:00:22 -0800 (PST)
    > From: Horst <hbl at efn.org>
    ...
    > >
    > > # the below line should get the ip address from temp and store it in matched
    > > matched = re.search('P-t-P:\s*(\d+\.\d+\.\d+\.\d+)', temp[1])
    > > ...
     just reading what came back -- if you say
    >  	temp = os.popen('/sbin/ifconfig').readlines()
     before the 'matched = re.search...'
    you may get what you need. But would you understand what's going on in
    RE, and could you debug it?
     - Horst
    _______________________________________________
    Think_python mailing list
    Think_python at efn.org
    http://mailman.efn.org/mailman/listinfo/think_python
    
    
  • [Think_python]



    Bob MillerWed Dec 10 23:29:38 PST 2003

    john fleming wrote:
    
    > I would like to get a toe hold on this so I could start a command
    >  or process from within a py program, retrieve output back into it
    > to be processed. At this point I have no particular reason to do
    > this other than to learn how to use python and linux better.
    > Could someone with a better understanding of the practical use
    > of python in unix give me some specific examples how this
    > might be used?
    
    Here's another example.  This is part of a larger program that I use
    to process my mail.  Bogo.msg_is_spam() spawns a bogofilter process
    and uses its exit status to learn whether bogofilter thinks a given
    email message is spam.  Bogo.register_msg() keeps one or more copies
    of bogofilter running, and passes email messages to them to train
    bogofilter.
    
    In both cases, msg is an instance of email.Message.Message from the
    Python standard library.
    
    I think the last line is clever. (-: It enforces that Bogo is a
    singleton by removing the class from the module's namespace
    immediately after defining it.  No code elsewhere in the file can
    access the class definition.  It also ensures that the destructor will
    run by creating an instance with module scope.  The instance is
    destroyed when the module is destroyed.
    
    class Bogo:
    
        """thin glue layer on bogofilter."""
    
        def __init__(self):
            self.registrar = {}
    
        def __del__(self):
            for bogo in self.registrar.itervalues():
                bogo.tochild.close()
                status = bogo.wait()
    	    # # Commented out -- bogofilter exit status is unpredictable
                # assert os.WIFEXITED(status)
                # exit_status = os.WEXITSTATUS(status)
                # assert exit_status == 0
    
        def msg_is_spam(self, msg):
            """Return true if bogofilter thinks message is spam."""
            try:
                return msg['X-Bogosity'].strip().startswith('Yes')
            except (KeyError, AttributeError):
                pass
            bogo = popen2.Popen3('bogofilter -u')
            bogo.tochild.write(msg.as_string(unixfrom=True))
            bogo.tochild.close()
            status = bogo.wait()
            assert os.WIFEXITED(status)
            bogo_status = os.WEXITSTATUS(status)
            assert bogo_status in (0, 1), bogo_status
            if bogo_status is not 0:
                global exit_status
                exit_status = 1
            return bogo_status == 0
    
        def register_msg(self, msg, flags):
            """Register message in bogofilter's word list.
               flags are passed to bogofilter: s, n, sN, or nS.
            """
            if register_flag:
                if flags not in self.registrar:
                    self.registrar[flags] = popen2.Popen3('bogofilter -' +
            flags)
                bogo = self.registrar[flags]
                bogo.tochild.write(msg.as_string(unixfrom=True))
    
    Bogo = Bogo()                           # Singleton
    
    
    -- 
    Bob Miller                              K<bob>
    kbobsoft software consulting
    http://kbobsoft.com                     kbob at jogger-egg.com
    _______________________________________________
    Think_python mailing list
    Think_python at efn.org
    http://mailman.efn.org/mailman/listinfo/think_python
    
    
  • [art] LiVES – the Linux Video Editing System



    Ben BarrettFri Nov 28 09:53:32 PST 2003

    Howdy y'all, just wanted to pass along a cookie on this fantastic Buy
    Nothing Day  = )   May Free Software reign:
    
    http://www.xs4all.nl/~salsaman/lives/
    
    What is LiVES ?
    LiVES is the Linux Video Editing System. It is designed to be simple to
    use, yet powerful. It is small in size - the stripped binary is under
    400K, yet it has many advanced features.
    
    .....
    
    
    ciao,
    
       Ben
    
  • [Think_python] classes and default arguments



    HorstThu Nov 13 13:15:55 PST 2003

    In response to:
    > Date: Thu, 13 Nov 2003 09:49:34 -0800
    > From: Rob Hudson <rob at euglug.net>
    ...
    >
    > So, is this the workaround?:
    >
    > class myclass:
    >     def __init__(self, value):
    >         self.value = value
    >     def myfunc(self, arg=None):
    >         if arg is None:
    >             arg = self.value
    >         print arg
    >
    > This seems tedious to me, but maybe that's the way it is.  Any tricks to
    > do this more easily?
    ...
    Rob, I think your alternative is the common way.
    
    I used the debugger to study the problem:
    When the module is loaded (before executing the top-level code) the class
    is compiled to byte code, and at that time there is not yet an instance of
    'self'. Even static Class members don't seem to be recognized at that
    point (!?)
    During the compilation to byte code each function's 'hidden' dictionary
    gets populated -- our relevant key:val pair is
     {..., 'func_defaults' : (dflt1, dflt2,...), ...}
     My function trick() does the trick. It re-assigns the default arguments;
    for demo purposes I left it commented out in the constructor.
    But it's a hack, and I wouldn't use it.
    
    Still, it's nice to have a language let's you look under the hood :-)
     - Horst
    
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    import pdb
    globVar = "Boo"
    
    class MyClass:
        qs = 'quasiStatic'
        def __init__(self, val):
            self.value = val
            #self.trick()
    
        def myfun(self, arg=globVar):
            print arg
    
        def trick(self):
            MyClass.myfun.im_func.func_defaults = (self.value, )
    
    x = MyClass('myVal')
    x.myfun(x.value)
    
    # pdb.set_trace() # look at commands vars(), locals(), globals()
    globVar = MyClass.qs
    print globVar
    x.myfun()	# no effect yet on MyClass.myfun(arg=globVar)
    x.trick()	# this does the trick, but I don't recommend it
    x.myfun()	# default argument is now a class member !
    
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    _______________________________________________
    Think_python mailing list
    Think_python at efn.org
    http://mailman.efn.org/mailman/listinfo/think_python
    
    
  • [art] mail test



    Bob MillerFri Oct 24 12:53:23 PDT 2003

    This is a test message.  Please ignore.
    
    -- 
    Bob Miller                              K<bob>
    kbobsoft software consulting
    http://kbobsoft.com                     kbob at jogger-egg.com
    
  • [art] Vector Art



    Ben BarrettThu Oct 16 20:29:31 PDT 2003

    I just noticed Gestalter on freshmeat... it can be found at:
    
    http://www.linotux.ch/gestalter/
    
    if I copied that right  = )
    It says that the interface is loosely based on Adobe Illustrator,
    and that the bezier curve is the base element of all [most?] objects,
    and that it allows for complex paths... maybe someone with more graphics
    experience can evaluate it, and report back?
    
    cheers,
    
       Ben
    
    
    On Mon, 22 Sep 2003 22:26:52 -0700
    Ben Barrett <benb at nu-world.com> wrote:
    
    | On Thu, 14 Aug 2003 10:47:44 -0700
    | Ben B wrote after Kbob:
    | | | Adobe Illustrator -> ???
    | | | 	There's killustrator, and there's a decent draw module in
    | | | 	OpenOffice.org, but neither is as capable as Illustrator.
    | | xfig, sodipodi (vector illustrator), ...
    | 
    | Kontour (formerly known as KIllustrator) is the vector drawing program
    | for KOffice. The aim of the Kontour project is the development of a
    | freely available vector-based drawing application similiar to Corel
    | DrawTM or Adobe IllustratorTM. Kontour is part of the KOffice package.
    | (from http://freshmeat.net/projects/kontour/?topic_id=57%2C100 )
    | Which has been renamed again:
    | <@> see http://www.koffice.org/karbon/
    | 
    | Sodipodi is a general purpose vector drawing application which uses a
    | subset of W3C SVG as its file format. It uses an advanced imaging
    | engine, with antialised display, apha transparency, and vector fonts.
    | (from http://freshmeat.net/projects/sodipodi/?topic_id=107 )
    | <@> see http://sodipodi.sourceforge.net/
    | 
    | Xfig is a menu-driven tool that allows the user to draw and manipulate
    | objects interactively in an X window. The resulting pictures can be
    | saved, printed on postscript printers or converted to a variety of
    | other formats (e.g. to allow inclusion in LaTeX documents).
    | (from http://freshmeat.net/projects/xfig/?topic_id=107 )
    | <@> see http://epb.lbl.gov/xfig/
    | <@> also see
    | http://freshmeat.net/projects/transfig/?topic_id=105%2C154
    | 
    | Here is another xfig-related one I dug up on freshmeat:
    | 
    | Figurine is an X11 editor for xfig FIG3.2-format vector graphics. It
    | is simpler to use than xfig while providing a mostly similar feature
    | set. Figurine can output in any format supported by the fig2dev
    | utility(provided with the external package transfig).
    | (from http://freshmeat.net/projects/figurine/?topic_id=107 )
    | <@> see http://figurine.sourceforge.net/
    | 
    | 
    | Cheers.  The list is not dead, just ask more questions and pose more
    | authority... you are running this thing if you are reading this text!
    | Stage a meeting, ask for or give a demonstration, etc.
    | 
    | 
    | happy vectoring,
    | 
    |    Ben B
    | 
    
  • [art] Vector Art



    Bob MillerThu Oct 9 04:29:16 PDT 2003

    Back on September 17th, Maximillian wrote:
    
    > Anyone got any suggestions for a good vector art app under Linux?
    
    I just discovered sketch.  It has simple vector editing capabilities,
    and is written in Python.
    
    It claims to be able to import these vector formats:
    
    	Native
    	Adobe Illustrator
    	Corel CMX
    	Scalable Vector Graphics
    	Windows Metafile
    	XFig
    	Computer Graphics Metafile
    
    And these raster formats:
    
    	Encapsulated Postscript (EPS)  (??? I thought EPS was vector?)
    	JPEG
    	GIF
    	Portable Bitmap (PBM)
    	Portable Graymap (PGM)
    	Portable Pixmap (PPM)
    	TIFF
    	Windows, OS/2 Bitmap (BMP)
    	PCX
    
    And export these vector formats.
    
    	Native
    	Adobe Illustrator
    	Portable Document Format (PDF)
    	Scalable Vector Graphics
    	Computer Graphics Metafile
    	Postscript
    	
    Here is the project home page.  Sketch is in Gentoo, so it installed
    trivially for me, but it doesn't look too hard to install for other
    Linux distros.
    
    	http://sketch.sourceforge.net/
    
    Anyway, check it out.
    
    -- 
    Bob Miller                              K<bob>
    kbobsoft software consulting
    http://kbobsoft.com                     kbob at jogger-egg.com
    
  • [art] Vector Art



    Ben BarrettMon Sep 22 23:26:52 PDT 2003

    On Thu, 14 Aug 2003 10:47:44 -0700
    Ben B wrote after Kbob:
    | | Adobe Illustrator -> ???
    | | 	There's killustrator, and there's a decent draw module in
    | | 	OpenOffice.org, but neither is as capable as Illustrator.
    | xfig, sodipodi (vector illustrator), ...
    
    Kontour (formerly known as KIllustrator) is the vector drawing program
    for KOffice. The aim of the Kontour project is the development of a
    freely available vector-based drawing application similiar to Corel
    DrawTM or Adobe IllustratorTM. Kontour is part of the KOffice package.
    (from http://freshmeat.net/projects/kontour/?topic_id=57%2C100 )
    Which has been renamed again:
    <@> see http://www.koffice.org/karbon/
    
    Sodipodi is a general purpose vector drawing application which uses a
    subset of W3C SVG as its file format. It uses an advanced imaging
    engine, with antialised display, apha transparency, and vector fonts.
    (from http://freshmeat.net/projects/sodipodi/?topic_id=107 )
    <@> see http://sodipodi.sourceforge.net/
    
    Xfig is a menu-driven tool that allows the user to draw and manipulate
    objects interactively in an X window. The resulting pictures can be
    saved, printed on postscript printers or converted to a variety of other
    formats (e.g. to allow inclusion in LaTeX documents).
    (from http://freshmeat.net/projects/xfig/?topic_id=107 )
    <@> see http://epb.lbl.gov/xfig/
    <@> also see http://freshmeat.net/projects/transfig/?topic_id=105%2C154
    
    Here is another xfig-related one I dug up on freshmeat:
    
    Figurine is an X11 editor for xfig FIG3.2-format vector graphics. It is
    simpler to use than xfig while providing a mostly similar feature set.
    Figurine can output in any format supported by the fig2dev utility
    (provided with the external package transfig).
    (from http://freshmeat.net/projects/figurine/?topic_id=107 )
    <@> see http://figurine.sourceforge.net/
    
    
    Cheers.  The list is not dead, just ask more questions and pose more
    authority... you are running this thing if you are reading this text!
    Stage a meeting, ask for or give a demonstration, etc.
    
    
    happy vectoring,
    
       Ben B
    
    
    On Wed, 17 Sep 2003 10:15:06 -0700
    Maximillian <anaxamaxan at projectpsyche.com> wrote:
    
    | Hm, did this list die in birth?  Well, anyway:
    | 
    | Anyone got any suggestions for a good vector art app under Linux?  I 
    | have not yet approached the GIMP in depth, but that does appear to be 
    | primarily raster oriented, like Photoshop its evil twin.  I'm looking 
    | for something like Illustrator, Freehand, or best of all worlds, 
    | Fireworks.  What it comes down to is, I find myself booting into
    | Windows much more often than Linux cause that's where my webwork &
    | design apps live.  I could take the OSX path, but I don't really have
    | the financial resources for a decent Mac platform.
    | 
    | I guess I should be more specific, eh?  I am looking for something
    | with more than just line drawing.  I am looking for something that
    | allows me to draw a shape, use bezier curves and lines in a single
    | object, adjust stroke and fill easily, and be able to extend those
    | tools according to my needs and abilities.  Probably this does not
    | exist outside of Adobe/Macromedia apps, but I am no expert on OSS!
    | 
    | Suggestions?
    | 
    | Max
    |