Jump to content

Wikipedia:Reference desk/Archives/Computing/2013 September 5

From Wikipedia, the free encyclopedia
Computing desk
< September 4 << Aug | September | Oct >> September 6 >
Welcome to the Wikipedia Computing Reference Desk Archives
The page you are currently viewing is an archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages.


September 5

[edit]

How to make this?

[edit]

I want to make this: http://btewiki.org/index.php?title=File:BTE_Power_diagram_260_MW.jpg but I have no idea what program that can make that 202.137.25.53 (talk) 04:34, 5 September 2013 (UTC)[reply]

It's just a simple 2D image? You could use Paint, or Inkscape, or Powerpoint, or innumerable other free or paid graphics design programs. DrewHeath (talk) 05:43, 5 September 2013 (UTC)[reply]
Well, it's easiest to use specialized diagramming software for things like that, but there are lots of such programs. Our article on diagramming software lists some of them. Microsoft Visio is probably the most widely used, since it comes with Office -- but that diagram doesn't quite have a "Visio" feel to me. Looie496 (talk) 06:08, 5 September 2013 (UTC)
However, the learning curve with such a program might make it quicker to do a one-off diagram using Paint or some other more manual software which you already know. StuRat (talk) 06:27, 5 September 2013 (UTC)[reply]
Depressingly, I draw roughly similar diagrams in PowerPoint (for commercial projects) and in Keynote (for scientific presentations and teaching). If the diagram is large, the design simple, and there is a somewhat structured textual description, I might use Graphviz, especially for repetitive tasks. --Stephan Schulz (talk) 12:42, 5 September 2013 (UTC)[reply]
You could even use lines and text boxes in Microsoft Word to create the diagram as a page, then save the image. I'm not recommending Word, because it's not designed for graphics, but it can be done. Dbfirs 14:07, 5 September 2013 (UTC)[reply]
My personal favourite is Paint.NET. --.Yellow1996.(ЬMИED¡) 02:10, 6 September 2013 (UTC)[reply]
Paint (XP edition) is the One True paint program! PaintXP FTW! The newer Paint looks to me like some kind of Paint For Slow Kids, so mostly a GUI issue.
It's not difficult to draw these things. Start with the "text in a box" tool, then draw the actual boxes, and finally connect them using either the "thick line" tool or the rectangle tool depending on the quality of your mouse and your skill. It is a bit of work but not really difficult. - ¡Ouch! (hurt me / more pain) 06:41, 6 September 2013 (UTC)[reply]
I agree, Windows XP paint is quite good. I hesitated to make the switch (er... well I was on Vista but the paint isn't much different on here fom XP) but what made me do it in the end was transparent backgrounds and layers. --.Yellow1996.(ЬMИED¡) 03:05, 7 September 2013 (UTC)[reply]
OTOH, Paint.net looks much richer than plain Paint, and they ironed a lot of the bugs out. - ¡Ouch! (hurt me / more pain) 09:05, 6 September 2013 (UTC)[reply]
So now the bugs are flat and devoid of wrinkles ? StuRat (talk) 10:57, 6 September 2013 (UTC) [reply]
Exactly. They take up more space now but at least they look a little more presentable. ;) --.Yellow1996.(ЬMИED¡) 03:05, 7 September 2013 (UTC)[reply]

Run linux command in series of directories, save output in table

[edit]

If I have such a command like:

find . *.pdf | wc

and I want to run it to count how many pdfs I have in each directory and output the result in a table like

dir1: 4 pdfs
dir2: 3 pdfs.

How can I do it? OsmanRF34 (talk) 18:28, 5 September 2013 (UTC)[reply]

Here's a not very clever way of doing it and it probably won't work if there are spaces anywhere in the path
find . -name "*.pdf" -exec dirname '{}' \; > /tmp/junk
for f in `sort -u /tmp/junk` ; do echo -en "$f \t"; grep -c $f /tmp/junk; done

--TrogWoolley (talk) 19:03, 5 September 2013 (UTC)[reply]

Here's an alternative method that avoids a temp file:
   find . -name "*.pdf" | perl -MFile::Basename -lane'$j{dirname($_)}++;END{print "$_: $j{$_}" foreach sort keys %j;}'
--Mark viking (talk) 22:55, 5 September 2013 (UTC)[reply]
Any of these should work:
find -name \*.pdf | rev | cut -d/ -f2- | rev | uniq -c
find -name \*.pdf -printf %h\\n | uniq -c
find -name \*.pdf -execdir pwd \; | uniq -c
These of course fail for files with newlines; one might be able to fix the middle one by using uniq -z, but I'm not sure. --Tardis (talk) 05:25, 9 September 2013 (UTC)[reply]