Wikipedia:Reference desk/Archives/Computing/2014 September 11

From Wikipedia, the free encyclopedia
Computing desk
< September 10 << Aug | September | Oct >> September 12 >
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 11[edit]

installing a module of 2.7 in 3.4 python[edit]

Hi there,
I'm trying to install a 2.7 module of python on 3.4 environment.
unfortunately I got this error:


C:\Program Files\FontForgeBuilds\lib\python2.7\Tools\scripts>python setup.py install
running install
running build
running build_scripts
error: file 'C:\Program Files\FontForgeBuilds\lib\python2.7\Lib\tabnanny.py' does not exist


what can I do? — Preceding unsigned comment added by Exx8 (talkcontribs) 02:17, 11 September 2014 (UTC)[reply]

I don't think Python 2.x packages will ever work on Python 3.x. Also, I don't think that's a Python package—it's a complete Python distribution bundled with FontForge. If you got this from fontforgebuilds.sourceforge.net, it looks like they offer only a 32-bit build with Python 2.7 and a HIGHLY EXPERIMENTAL (caps theirs) 64-bit build with Python 3.4. If you have 32-bit Windows, your best bet may be to write your scripts in Python 2 and use the bundled Python (ffpython.exe), if you can. -- BenRG (talk) 06:47, 11 September 2014 (UTC)[reply]
okay I succeed running this script by altering the path of 2 files and installing python 2.7, but now I got new problem. I ran py -2 setup.py install, but it doesn't recognize the module:

Python 2.7.8 (default, Jun 30 2014, 16:03:49) [MSC v.1500 32 bit (Intel)] on win 32 Type "help", "copyright", "credits" or "license" for more information. >>> import fontforge; Traceback (most recent call last):

 File "<stdin>", line 1, in <module>

ImportError: No module named fontforge Exx8 (talk) 08:30, 11 September 2014 (UTC)[reply]

As I said, I don't think this is a package that can be installed. Looking at setup.py, it appears to install some random utility scripts, not FontForge. I think setup.py's existence is an accidental side effect of the build process. -- BenRG (talk) 23:40, 11 September 2014 (UTC)[reply]

Pros and cons of networking a printer[edit]

I have a gigabit home network. I just got a printer that can be networked. In the past, I've always hooked the printer up to one of the computers by USB. Which is the best way to go?

Pro network:

  1. computer connected to the printer doesn't have to be on all the time. However, in my case it is, unless it is down for repairs or something.
  2. You can access printer settings over the network with a browser.

Con network:

  1. Slower than USB2? The printer uses USB 2 and 100Mb Ethernet, but isn't USB 2 faster than 100Mb?

Others? Bubba73 You talkin' to me? 04:39, 11 September 2014 (UTC)[reply]

USB2 is 480Mbit/sec nominal, 240Mbit/sec actual, while 100Mbit is 100Mbit/sec nominal, 50Mbit/sec actual. However, unless you have an ultrahigh speed printer, I doubt that you'll need anywhere near 50Mbit/sec. Connecting it via LAN allows you to connect your PC to your home network wirelessly, and then print. — Preceding unsigned comment added by Csmiller (talkcontribs) 11:57, 11 September 2014 (UTC)[reply]
According to List of device bit rates, USB 2.0 runs at around 480 Mbit/s - which is certainly faster than 100 Mbit Ethernet - but slower than 1 Gbit Ethernet. But it hardly matters. There is really no chance that your printer can print faster than a 100Mbits/second of data except in quite contrived situations...so you'll hardly ever be slowed significantly by the network. Imagine you're printing a full page photo. If you're printing at 150 dpi - and using an uncompressed ".PNG" file - then you'll need 150x150x8x11 pixels, 24 bits each. That's 47Mbits...which will take half a second to get there via 100Mbit Ethernet. But what printer can print a whole sheet in half a second?! Even at an ungodly 600dpi, it should only take 8 seconds to transmit the data. You have to assume that the printer is only able to use a small fraction of the available bandwidth to make 100Mbit Ethernet be a bottleneck. In practice, we mostly print JPEG files - which are typically 10x to 20x more compact than PNG files.
Some "pro's" that you missed are:
  1. Wireless access means that you can place your printer anywhere in the house. (Most networked printers have WiFi these days).
  2. You can access it from a phone, tablet or from multiple computers.
  3. If you have laptop, tablet or phone, not having to hook up a cable is really convenient.
  4. The printer can access the network directly - by itself. For example, you can tell my printer to automatically order more ink from the manufacturer's website when it's getting low.
  5. You can print from one place (eg your computer) and use another device (eg, your phone) to monitor the print queue. I did this the other day. I set a 40 page print job going in my office, then went downstairs to watch TV, using my phone to see when the printer had gotten finished.
  6. If you have more than one printer - you can easily get to any printer from any computer. (You can do this with printer sharing - but it presumes that the computer that 'belongs' to that printer is turned on, booted up, and has sharing enabled).
SteveBaker (talk) 01:21, 12 September 2014 (UTC)[reply]
One possible downside is the possibility of eavesdropping. Of course that's more about securing your network than it is about printing. --Trovatore (talk) 01:27, 12 September 2014 (UTC)[reply]
Thanks. I forgot to mention that the new printer is Ethernet only, not wireless. But everything on our home network can use it. Right now we have three printers on our home network and anything on the network can use any of them. And being able to put it anywhere in the house is no advantage to me - right now I can reach the output from my office chair. Bubba73 You talkin' to me? 01:35, 12 September 2014 (UTC)[reply]
I'm not 100% sure, but i don't think printers "stream" print these days anyway> I believe that typically the print driver will "spool" a job to the printer before printing starts, so unless you are printing pdfs that are hundreds of megabytes, I don't think the "transfer" really contributes a lot to the total print time anyway. Vespine (talk) 02:00, 15 September 2014 (UTC)[reply]

A good 3D Environment for Java, for this specific situation[edit]

I would like to have the following type of 3D environment:

Various sphere shapes are suspended in a 3D environment, the user can use the mouse to determine the camera angle, and hold left mouse button (or use 'W' or 'Up Arrow') to move "forward" with the camera. In this manner, the user can "fly around" and examine the arrangement of the spheres, in a way where the spheres are not "solid".... in other words, you can fly through them, they don't stop you.

I have a reasonably intermediate knowledge of java, and would like to be able to make a wrapper around a 3D library such that you can instantiate a scene with the spheres in question... ie: Scene a = new Scene(ArrayList<Sphere>); .... where each sphere knows its location in 3D space as well as its radius (i intend to make the radius fairly small compared to the observers apparent "size".)

I know how to do simpler things like drawing on an image buffer of a sort and either displaying it on screen or flushing to a file, but ive not done anything 3D, and i know its a bit of a jump. I read this tutorial, and although its outdated i feel i understand the info regarding the camera's position, where its looking, and the related vector....

I've asked in other places where would be good to start and i got various answers.

I have tried my luck with JOGL, but the documentation is extremely poor. I had to search for a long time to see what jar files needed to be imported, and then when it comes to examples, there are some i understand really well like the one i listed at "land of kain" but they are outdated. Maybe this is an indication that JOGL is not right for me, either because of the learning curve or because of the almost non-existant clear documentation.

I would just like to know some good directions i could go in to achieve what i listed at the top of this post. Like i said i am moderately good at java, but example source code and things like this really help me to understand a 3rd party library! Any thoughts where i should start on building the wrapper i want?

216.173.144.188 (talk) 14:47, 11 September 2014 (UTC)[reply]

I have written extensively in JOGL and some of my code is freely available, licensed with the GPLv3. A few remarks: JOGL is a slim wrapper around OpenGL. OpenGL is a strange language; it requires thinking about the mathematics of your geometry quite extensively. It can be very efficient, because those mathematics translate directly into optimized hardware instructions of nearly every GPU of the last 25 years. JOGL, however, has a poor CPU-to-GPU work sharing scheme so it is easy to write very inefficient OpenGL code in this environment. With some effort, you can make a lot of highly-performant applications without leaving the comfort of Java. Recently JOGL underwent a major API change (for the better): it allows you a little better control over platform-specific capabilities. The documentarion is poor because "it goes without saying" that OpenGL expertise is prerequisite to writing cross-platform, cross-compiled OpenGL.
Let me know if you're interested in getting sample-code from me. I have an Eclipse project with my code, plus JOGL 2 built from source, for Linux, Mac, and Windows. The application-layer may need to be stripped down for distribution, but it evolved out of a scientific visualization utility. It may be suitable for a simple 3D game (e.g. it already supports WASD and mouselook, just like many popular games). It will require a Java 6 or newer compiler, and a C compiler (unless you want to use my JOGL binaries, or those distributed by others).
Regarding others: Java3D has poor support on most operating systems. It is a scene-based library as opposed to a graphics primitives library. I have never used FX but it is the only library that Oracle supports today (JOGL is entirely open-source software supported by a small developer community). I never heard of JMonkey.
Nimur (talk) 15:43, 11 September 2014 (UTC)[reply]

I am currently developing for windows only, and do not need another OS for this. I normally use Netbeans though. I would like to take a look at some of your code for guidance, but wont GPL force me to also be GPL? May i use it privately without need for licensing? Sorry i am unfamiliar with this. I have in fact been told about the learning curve of direct OpenGL, and maybe that approach isnt for me. I am not developing a game of any sort. My application is in mathematical research actually.

I feel like i either need assistance from someone who has already done things in 3D or something that's already out there with great documentation.

216.173.144.188 (talk) 16:22, 11 September 2014 (UTC)[reply]

Perhaps you are seeking a more user-friendly 3D programming environment, like VPython or MATLAB? VPython is available at no cost. MATLAB is commercial software and its price varies significantly depending on who you are. If you want to contact me for more information about my work, send me a description of your project.
If you are new to 3D programming, you almost certainly need guidance from an experienced developer. Even the best autodidacts commonly find that their mental efforts are insufficient to grapple with the prior art of computational representations of multidimensional mathematics. Nimur (talk) 17:38, 11 September 2014 (UTC)[reply]

At least we agree in what type of help i need! I would prefer to stay within the realm of java, but i will give VPython a look at least. Also, i do not have "Permission" to email you it seems. Edit: I now have a wiki account.

Drifter2015 (talk) 18:08, 11 September 2014 (UTC)[reply]

The keys to success[edit]

Did the possibility of professional software programming in the mathematical assembler had been a guarantee of quality consumer and guarantee of consumption possibilities from tablet computers and smartphones?--Alex Sazonov (talk) 16:47, 11 September 2014 (UTC)[reply]

This question makes no sense whatsoever. I suggest you find a website where you can ask questions in your own language. AndyTheGrump (talk) 16:50, 11 September 2014 (UTC)[reply]
Wow, the future conditional pluperfect subjunctive; don't see that used very much. OldTimeNESter (talk) 20:21, 12 September 2014 (UTC)[reply]

Full screen (For real) Webpage screen capture tool?[edit]

I've tried about 3-4 screen capture tools with the description "Full page" capture. In practice, they gave me a screen captrue of the current display itself, and not of the full page (In other words, they didn't cover up all the horizontal scrollable landscape of the screen).

What Firefox or Chrome addition does what I need? Thank your for this blessed recommendation, Ben. Ben-Natan (talk) 17:10, 11 September 2014 (UTC)[reply]

Fireshot comes to mind, but it is not free...—Ëzhiki (Igels Hérissonovich Ïzhakoff-Amursky) • (yo?); September 11, 2014; 18:13 (UTC)
Something which is also free?, Anyone? Ben-Natan (talk) 01:28, 12 September 2014 (UTC)[reply]
I've used screengrab before, and it worked. No guarantees if the "fix version" works (the original ceased development because of the awful firefox rapid versioning) 97.94.188.60 (talk) 12:56, 12 September 2014 (UTC)[reply]
Also (and I realize this may not work for you purposes, but since I don't know why you need this...), have you thought about perhaps simply printing the webpage into a pdf file? This is, for all intents and purposes, the same as having a "full page capture", unless you need to actually work with the result as an image and not as a document...—Ëzhiki (Igels Hérissonovich Ïzhakoff-Amursky) • (yo?); September 12, 2014; 14:25 (UTC)

error while 'making' fontforge[edit]

I've installed cygwin,
and configure successfully fontforge.
but now, when I try to 'make' fontforge I get this code:
collect2: error: ld returned 1 exit status Makefile:91: recipe for target '../libfontforge.la' failed make[1]: *** [../libfontforge.la] Error 1 make[1]: Leaving directory '/cygdrive/c/cygwin/fontforge-20120731/fontforge' Makefile:28: recipe for target 'fontforge' failed make: *** [fontforge] Error 2
what is the solution for this? — Preceding unsigned comment added by 84.228.78.88 (talk) 21:36, 11 September 2014 (UTC)[reply]

Those lines are just reports from collect2 and make that the linker failed. Hopefully the linker itself printed a more informative error message before it failed, which would appear before the lines you quoted.
Have you considered just using the bundled Python distribution from the ready-made build, as I originally suggested? Yes, it's stupid that so many Windows ports of Unix software bundle huge dependencies like Python instead of letting you use your global install of it. But it'd probably be a lot easier to go with the flow in this case. -- BenRG (talk) 23:49, 11 September 2014 (UTC)[reply]
I'll be delighted to download a made version of this, but unfortunately, it does not contain the python expansion(module). if you do have an installer to fontforge module for python, please send it to me.
here some more information:
make output
make[1]: Entering directory '/cygdrive/c/cygwin/fontforge-20120731/gdraw'
make[1]: '../libgdraw.la' is up to date.
make[1]: Leaving directory '/cygdrive/c/cygwin/fontforge-20120731/gdraw'
    Successfully remade target file 'libgdraw'.
     File 'pos' does not exist.
    Must remake target 'pos'.
ln -s ./po/*.po po
ln: failed to create symbolic link ‘po/ca.po’: File exists
ln: failed to create symbolic link ‘po/de.po’: File exists
ln: failed to create symbolic link ‘po/el.po’: File exists
ln: failed to create symbolic link ‘po/en_GB.po’: File exists
ln: failed to create symbolic link ‘po/es.po’: File exists
ln: failed to create symbolic link ‘po/fr.po’: File exists
ln: failed to create symbolic link ‘po/it.po’: File exists
ln: failed to create symbolic link ‘po/ja.po’: File exists
ln: failed to create symbolic link ‘po/ml.po’: File exists
ln: failed to create symbolic link ‘po/pl.po’: File exists
ln: failed to create symbolic link ‘po/ru.po’: File exists
ln: failed to create symbolic link ‘po/uk.po’: File exists
ln: failed to create symbolic link ‘po/vi.po’: File exists
ln: failed to create symbolic link ‘po/zh_CN.po’: File exists
ln: failed to create symbolic link ‘po/zh_TW.po’: File exists
Makefile:40: recipe for target 'pos' failed
make: [pos] Error 1 (ignored)
( cd po ; make )
GNU Make 4.0
Built for i686-pc-cygwin
Copyright (C) 1988-2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

 File 'all' does not exist.
Must remake target 'all'.
Successfully remade target file 'all'.
make[1]: Entering directory '/cygdrive/c/cygwin/fontforge-20120731/po'
make[1]: 'all' is up to date.
make[1]: Leaving directory '/cygdrive/c/cygwin/fontforge-20120731/po'
    Successfully remade target file 'pos'.
   Prerequisite 'libgunicode' of target 'fontforge' does not exist.
   Prerequisite 'libgutils' of target 'fontforge' does not exist.
   Prerequisite 'libgdraw' of target 'fontforge' does not exist.
   Prerequisite 'pos' of target 'fontforge' does not exist.
  Must remake target 'fontforge'.
( cd fontforge ; make )
GNU Make 4.0
Built for i686-pc-cygwin
Copyright (C) 1988-2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

 File 'all' does not exist.
   File '../libfontforge.la' does not exist.
  Must remake target '../libfontforge.la'.
— Preceding unsigned comment added by Exx8 (talkcontribs) 00:11, 12 September 2014 (UTC)[reply]
I think the "Prerequisite X of target 'fontforge' does not exist" lines are the problem. You need source or prebuilt versions of libgunicode, libgutils, libgdraw, and maybe pos (unless that's just the .po files), as well as whatever dependencies they have.
The bundled Python works for me. I unpacked the 32-bit portable distribution (FontForge-mingw-w64-i686-bf1870-r1.7z), ran bin\ffpython.exe, and typed import fontforge at the prompt, and it succeeded. I haven't tried actually using the module, but the symbols are there. -- BenRG (talk) 01:23, 12 September 2014 (UTC)[reply]
wow it works, thank you! just a little question for the end, how do I make it permanent? I mean I want that whenever I'll open python, I want that module will be installed.Exx8 (talk) 08:51, 12 September 2014 (UTC)[reply]

What happened here?[edit]

Why is the building so much more vertically inclined in the second image than in the first? They were taken seconds apart with the same camera on the same settings, and as you can tell from the building and the flagpole, the location is virtually identical. Nyttend (talk) 21:59, 11 September 2014 (UTC)[reply]

Because the camera was tilted clockwise by about 1.7 degrees when the first photo was taken, it looks like. If you apply a rotation to one image and recrop the edges a bit, the differences go away almost completely. --65.94.51.64 (talk) 23:09, 11 September 2014 (UTC)[reply]
Based on the position of the flagpole relative to the windows, the obscuring of the nearest windows, and the alignment of the background trees, I'd guess that the two shots were taken from positions 10 - 15 feet apart - resulting in a noticeable change in perspective. -- Tom N talk/contrib 01:34, 12 September 2014 (UTC)[reply]
That's obvious, but it doesn't explain the tilt. The camera being tilted does explain the tilt. --65.94.51.64 (talk) 05:06, 12 September 2014 (UTC)[reply]
The first one was taken at a focal length of 20mm and the second at 23mm on an APC-sized sensor. These are fairly wide-angle shots. And the 15% difference in focal lengths probably makes for some of the difference. Bubba73 You talkin' to me? 05:12, 12 September 2014 (UTC)[reply]
Then there is the Leaning tower illusion. Let's swap the images so the top one goes to the bottom. 88.112.50.121 (talk) 11:07, 12 September 2014 (UTC)[reply]
That makes a lot of sense. Though other factors listed above may contribute, I think the swap is very good evidence that the illusion is a key driver-- thanks! SemanticMantis (talk) 16:22, 12 September 2014 (UTC)[reply]
So the settings weren't quite the same. I've not yet learned to do much more than "Auto" mode on this camera — I take lots of simple pictures of buildings, without a need for artistic precision, and I typically don't have time to get all the settings just right. But I don't understand what you mean about the illusion — I first noticed the difference while viewing them on my computer, one at a time in full resolution, and the whole reason I uploaded them both was to ask here about the different I saw when viewing them one at a time. Many of the windows, and the two protrusions between the three bays, appear quite different at resolutions such as 800px; if I look at the "horizontal.jpg" version for a while and then look at the "vertical.jpg" version, I start feeling like I'm looking at an El Greco painting (example) with its elongated dimensions. Nyttend (talk) 17:13, 12 September 2014 (UTC)[reply]
I think you're noticing the optical distortion - specifically, transverse barrel distortion, in which a straight line that cuts a chord near the extrema of the image circle appears curved. This occurs because the lens is "imperfect" : its magnification (rather, its focal length) changes with respect to angle. Here's some math from SPIE: Distortion at SPIE's Optipedia. This effect can not be eliminated - a part of the effect is due to imperfection in glass, but most of the effect is a mathematical inevitability of geometric projection onto a flat imaging plane (i.e. the film or digital sensor). In practice, it can be reduced by avoiding wide-angle lenses, or by cropping to show only the center, or by spending lots more money to buy "more perfectly calibrated" glass.
Alternately: if you must have a wide field of view, you can cheat the mathematics that governs image-projection, using strip photography to synthesize a projection geometry from many individual photographs. You can increase distortion, or decrease distortion, depending on how you blend the images. Hugin (software) is free software that can accomplish this, and many people use it to compose or "stitch" panorama shots.
Somewhere on Wikipedia is a quite long panorama whose "effective focal length" is some infinitely huge value... the walls of Stanford University's main quad (some hundreds of meters apart) appear perfectly parallel, a feat of trick photography that is accessible to humankind now that we live in a digital era!
Nimur (talk) 18:05, 13 September 2014 (UTC)[reply]