Re: eps to jpg conversion - which program?
On Sat, 8 Nov 2008 23:36:32 -0800, Jeremy Chadwick <[EMAIL PROTECTED]> wrote: > Also, what guarantee do you have that all the filenames that match that > wildcard lack spaces in them? Your [ and convert commands will botch > badly in that case. See below. This is completely correct. If files are present as foo.EPS, the "Windows" style of file naming, or foo.Eps in a mixed form, the *.eps wouldn't catch it. As you mentioned, it's good to assume the worst case. Not only spaces, as well special characters. Now *that's* the real fun. :-) [EMAIL PROTECTED] sent me | Copy [5] of C:\My Files\A&V with ö and ß.Eps Another mentionable comment would be: "Why do you call the variable just $f? Give it a better descriptive name." In this small example, it won't lead into significant problems if you don't do it, but I've seen shellscripts using $f, $f1, $f2, $g, $h, $y all over the file, and it was hard to find out which values they should hold. > > What people often forget while writing sh scripts is that spawning > external utilities slows down the script greatly, and destroys system > resources. You might think "My machine has 923484390GB of RAM, and has > 6500 processors; why do I care?" -- step back for a moment and think > about older/smaller boxes, or even more importantly, embedded machines > (very little memory, very little CPU). Hey, that's how software development helps hardware development, or at least software development in Redmond. :-) Hardware ressources ++ Overall usage speed = = const. Software requirements ++ q.e.d. > Also think about situations where fork() will fail due to resource > limits or existing system resource exhaustion; what then? I see this > regularly in perl scripts; people relying on `xxx` for no good reason. > I ask them, "Why are you doing this? Can you not use > instead, and avoid wasting resources and excessive risk?", and they > often have no idea what I'm talking about. And whenever I see `ssh > [EMAIL PROTECTED] "command"` in perl scripts, I cry. Ooow! Is this for real? If it is, it's a reason to hit someone's head with the keyboard. :-) > That in mind, don't let your scripting mimic that of "perl bastards" who > *intentionally* write obfuscated code just to "show off" (often citing > "its faster" as the reason, choosing to intentionally ignore that perl > is a compiled language). For complex pieces of sh that are hard to > visually parse: try to keep it simple, and take the time to write > decent/legible comments above the hairy part of the script. Indentation, comments and descriptive identifiers help a lot. If you read FreeBSD's (scripting) sources, you'll see that they are of high quality. > Also remember that double-quoting filenames or variables that are used > as filenames is a VERY good idea. Filenames with spaces are quite > common these days. It's best to assume the worst, but not be *too* > over-zealous. Especially when you're intending to use a piece of software, even if it's just a three line shell script, more than just one time, or if you want to share it with others. -- Polytropon >From Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ... ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: eps to jpg conversion - which program?
On Sun, Nov 09, 2008 at 07:25:49AM +0100, Polytropon wrote: > On Sat, 8 Nov 2008 12:12:46 +0200, Jonathan McKeown <[EMAIL PROTECTED]> wrote: > > Essentially, a Bourne-type shell with parameter expansion expands > > ${variable#prefix} or ${variable%suffix} to $variable with the prefix or > > suffix, respectively, removed. > > So this would be more efficient: > > #!/bin/sh > for f in *eps; do > [ ! -f ${f%.eps}.jpg ] && convert $f ${f%.eps}.jpg > done Significantly. Also, what guarantee do you have that all the filenames that match that wildcard lack spaces in them? Your [ and convert commands will botch badly in that case. See below. What people often forget while writing sh scripts is that spawning external utilities slows down the script greatly, and destroys system resources. You might think "My machine has 923484390GB of RAM, and has 6500 processors; why do I care?" -- step back for a moment and think about older/smaller boxes, or even more importantly, embedded machines (very little memory, very little CPU). Also think about situations where fork() will fail due to resource limits or existing system resource exhaustion; what then? I see this regularly in perl scripts; people relying on `xxx` for no good reason. I ask them, "Why are you doing this? Can you not use instead, and avoid wasting resources and excessive risk?", and they often have no idea what I'm talking about. And whenever I see `ssh [EMAIL PROTECTED] "command"` in perl scripts, I cry. That in mind, don't let your scripting mimic that of "perl bastards" who *intentionally* write obfuscated code just to "show off" (often citing "its faster" as the reason, choosing to intentionally ignore that perl is a compiled language). For complex pieces of sh that are hard to visually parse: try to keep it simple, and take the time to write decent/legible comments above the hairy part of the script. Also remember that double-quoting filenames or variables that are used as filenames is a VERY good idea. Filenames with spaces are quite common these days. It's best to assume the worst, but not be *too* over-zealous. And don't forget about "set noglob" when appropriate! -- | Jeremy Chadwickjdc at parodius.com | | Parodius Networking http://www.parodius.com/ | | UNIX Systems Administrator Mountain View, CA, USA | | Making life hard for others since 1977. PGP: 4BD6C0CB | ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: eps to jpg conversion - which program?
On Sat, 8 Nov 2008 12:12:46 +0200, Jonathan McKeown <[EMAIL PROTECTED]> wrote: > You can also save yourself repeated calls to basename by using > > for f in *eps; do > convert ${f%.eps}.jpg > done > > Look under parameter expansion in the manpage for sh(1) (or bash(1) if you > have bash installed). Yes, that's a very good hint, I will use this in the future. Note that $f as first parameter is missing (source for convert). > As far as I can tell csh/tcsh doesn't support this > useful feature. Well, I prefer the C Shell (instead of BASH) as primary dialog shell, but for scripting, I always stay with the "good old" Bourne Shell, simply because it's the standard scripting shell for UNIX, and it's compatible to most Linusi, too (where /bin/sh@ -> /bin/bash, but NB ! -f /bin/bash in FreeBSD). > Essentially, a Bourne-type shell with parameter expansion expands > ${variable#prefix} or ${variable%suffix} to $variable with the prefix or > suffix, respectively, removed. So this would be more efficient: #!/bin/sh for f in *eps; do [ ! -f ${f%.eps}.jpg ] && convert $f ${f%.eps}.jpg done -- Polytropon >From Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ... ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: eps to jpg conversion - which program?
On Friday 07 November 2008 21:19, Polytropon wrote: > On Fri, 07 Nov 2008 13:36:51 +0100, Laszlo Nagy <[EMAIL PROTECTED]> wrote: > A batch solution is simple: > > #!/bin/sh > for f in *eps; do > convert ${f} `basename ${f} .eps`.jpg > done You can also save yourself repeated calls to basename by using for f in *eps; do convert ${f%.eps}.jpg done Look under parameter expansion in the manpage for sh(1) (or bash(1) if you have bash installed). As far as I can tell csh/tcsh doesn't support this useful feature. Essentially, a Bourne-type shell with parameter expansion expands ${variable#prefix} or ${variable%suffix} to $variable with the prefix or suffix, respectively, removed. Jonathan ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: eps to jpg conversion - which program?
On Fri, 07 Nov 2008 13:36:51 +0100, Laszlo Nagy <[EMAIL PROTECTED]> wrote: > > Hi, > > I need to convert eps files into jpeg files in batch mode. Gimp works > perfectly, except that I cannot use an X display. I tried eps2png with > no success: You can use the convert command from ImageMagick: convert A batch solution is simple: #!/bin/sh for f in *eps; do convert ${f} `basename ${f} .eps`.jpg done You can add [ ! -f `basename ${f} .eps`.jpg ] && infront of the convert command to avoid repeated conversions. -- Polytropon >From Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ... ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: eps to jpg conversion - which program?
Laszlo Nagy schrieb: > I need to convert eps files into jpeg files in batch mode. Gimp works > perfectly, except that I cannot use an X display. I tried eps2png with > no success: > > > %file test.eps > test.eps: DOS EPS Binary File Postscript starts at byte 30 length 566887 > TIFF starts at byte 566917 length 4741 > %eps2png -jpg -width 1000 -verbose -output test.jpg test.eps > Producing jpg (jpeg) image. > Not EPS file: test.eps, skipped > > What port should I use to convert EPS into JPG? I would like to use a > program that shares the same library with Gimp, because we know that > Gimp works great for this task. Take a look on GhostScript, a PostScript interpreter. -- Timm ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: eps to jpg conversion - which program?
Laszlo Nagy wrote: Hi, I need to convert eps files into jpeg files in batch mode. Gimp works perfectly, except that I cannot use an X display. I tried eps2png with no success: %file test.eps test.eps: DOS EPS Binary File Postscript starts at byte 30 length 566887 TIFF starts at byte 566917 length 4741 %eps2png -jpg -width 1000 -verbose -output test.jpg test.eps Producing jpg (jpeg) image. Not EPS file: test.eps, skipped What port should I use to convert EPS into JPG? I would like to use a program that shares the same library with Gimp, because we know that Gimp works great for this task. Thanks, Laszlo How about using 'convert' from graphics/ImageMagick? It would be as simple as convert myfile.eps myfile.jpg and there are myriads of options to fiddle if you wish. I've been using it with great success for quite some time now. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
eps to jpg conversion - which program?
Hi, I need to convert eps files into jpeg files in batch mode. Gimp works perfectly, except that I cannot use an X display. I tried eps2png with no success: %file test.eps test.eps: DOS EPS Binary File Postscript starts at byte 30 length 566887 TIFF starts at byte 566917 length 4741 %eps2png -jpg -width 1000 -verbose -output test.jpg test.eps Producing jpg (jpeg) image. Not EPS file: test.eps, skipped What port should I use to convert EPS into JPG? I would like to use a program that shares the same library with Gimp, because we know that Gimp works great for this task. Thanks, Laszlo ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Which Program
My computer at work says that the Network Boot is not found. My computer is a Window's 98. Which network boot program should I download. ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: Which program for UML-modelling?
On Wed, Mar 19, 2003 at 06:45:52PM +0100, INV/Stefan K. wrote: > Hi, > > first, thanks to all who answered with all those > good hints for me. > > Nikolay, is there also a little program available, > which generates sql output from dia? I don't know. But I even didn't see how to wrote sql in UML which implemented in dia. In any way I think it is possible to write simple parser, because dia use xml. I already used such feature for automatic correcting of diagrams. > > > -- With best wishes Nikolay mail: [EMAIL PROTECTED] To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-questions" in the body of the message
Re: Which program for UML-modelling?
Ok, after googling around and looking to the dia-homepage i could find something useful for converting diagrams to sql. Stefan INV/Stefan K. schrieb: Hi, I am searching for a program which runs on FreeBSD for UML-modelling. Any idea? Thanks much, Stefan Kapfhammer RE/MAX Germany Office Nurembourg To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-questions" in the body of the message To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-questions" in the body of the message
Re: Which program for UML-modelling?
Hi, first, thanks to all who answered with all those good hints for me. Nikolay, is there also a little program available, which generates sql output from dia? Thank you in advance, Stefan Nikolay Y. Orlyuk schrieb: On Wed, Mar 19, 2003 at 11:08:30AM +0100, INV/Stefan K. wrote: Hi, I am searching for a program which runs on FreeBSD for UML-modelling. Any idea? If this is about OOP and other things. Then dia can make good diagrams and dia2code can genereate java, c and c++ To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-questions" in the body of the message
Re: Which program for UML-modelling?
On Wed, Mar 19, 2003 at 11:08:30AM +0100, INV/Stefan K. wrote: > Hi, > > I am searching for a program which runs on FreeBSD > for UML-modelling. > > Any idea? If this is about OOP and other things. Then dia can make good diagrams and dia2code can genereate java, c and c++ > > > -- With best wishes Nikolay mail: [EMAIL PROTECTED] To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-questions" in the body of the message
Re: Which program for UML-modelling?
On Wed, 2003-03-19 at 05:08, INV/Stefan K. wrote: > I am searching for a program which runs on FreeBSD > for UML-modelling. Visual Paradigm runs on FreeBSD using Linux binary support. TCM is another option, but not as nice as VP. -- Adam <[EMAIL PROTECTED]> To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-questions" in the body of the message
Re: Which program for UML-modelling?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Am Mittwoch, 19. März 2003 11:08 schrieb INV/Stefan K.: > I am searching for a program which runs on FreeBSD > for UML-modelling. www.gentleware.com -> Poseidon for UML www.argouml.org -> ArgoUML These UML Tools are running using Java so they also run ob FreBSD. With kind regards, Konrad - -- Konrad Neitzel Tel: 0172 / 689 31 45 Fax: 069 / 90 50 99 53 -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.1 (FreeBSD) iD8DBQE+eIHixlHQ37B9RLMRApOzAJ953HKqqdJKPNF0sI76L37QEFWjBwCfbQEQ xzcUzBLi9ZxB/+Eqa0W5HFI= =5TPL -END PGP SIGNATURE- To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-questions" in the body of the message
Re: Which program for UML-modelling?
Hallo Stefan, > I am searching for a program which runs on FreeBSD > for UML-modelling. You might want to have a look at "umbrello": http://uml.sourceforge.net/ It's in the port's collection (ports/devel/umbrello), but it's a KDE application, so unless you are already runnig KDE, it will install quite a bunch of dependencies. AFAIK code generation for Java, C++ and PHP is implemented. HTH, Simon pgp0.pgp Description: PGP signature
Re: Which program for UML-modelling?
Hi Danny, thank you for your answer, I will give it a try :) Stefan Danny schrieb: Dear Sefan I belive they have a program called "dia" that will allow you to "draw" diagrams in UML? This program doesn't have the functions of "Rational Rose" but no harm to try it. Yours faithfully, Danny On Wed, 19 Mar 2003, INV/Stefan K. wrote: Hi, I am searching for a program which runs on FreeBSD for UML-modelling. Any idea? Thanks much, Stefan Kapfhammer RE/MAX Germany Office Nurembourg To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-questions" in the body of the message To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-questions" in the body of the message
Which program for UML-modelling?
Hi, I am searching for a program which runs on FreeBSD for UML-modelling. Any idea? Thanks much, Stefan Kapfhammer RE/MAX Germany Office Nurembourg To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-questions" in the body of the message