Wikipedia:Reference desk/Archives/Computing/2010 October 23

= October 23 =

HDD over IP
Hello! I'm looking for some open software that I can install on a Linux (Debian) computer as a server and on Windows computers as clients and be able to easily write and retrieve files over an encrypted connection. Maybe something that lets me type in the IP address to the server with my Linux username and password and virtually mounts the server's hard drive to the client for easy navigation in a Windows file chooser. Thanks! Sorry if this question comes up a lot and I haven't found it in the archives --el Aprel (facta-facienda) 05:41, 23 October 2010 (UTC)


 * Samba (software) is the usual way to share disks and printers from Unix-like systems to Windows. But do you want the data to be encrypted on the network? A quick googling for CIFS encrypted suggests the standard Windows file sharing protocol doesn't have encryption. You could use an encrypted VPN link and do the sharing over it; that is not an entirely trivial thing to set up though. 88.112.56.9 (talk) 09:31, 23 October 2010 (UTC)


 * Try this and see if it helps. Might be easier than a full-scale VPN. -- 78.43.71.155 (talk) 10:03, 23 October 2010 (UTC)


 * Thank you for your responses. I do have access to a VPN, so if encryption isn't handled by the software, that's okay. I forgot to make clear that I want to transmit files over the Internet, not a LAN. I had a look at Samba, and it looks good, but I can't tell from the documentation I've read if it works over the Internet. Does it?--el Aprel (facta-facienda) 20:24, 23 October 2010 (UTC)


 * It does, but you don't want to use it over the Internet; only the encrypted VPN tunnel should go over the Internet. As far as Samba and SMB are concerned, all of your machines will be on the same LAN (that happens to be virtual).


 * Another possibility is Dokan's sshfs, but I'm not sure it's ready for prime time. If you just want to copy files back and forth with an Explorer-like application, you don't need any of this; just use WinSCP. -- BenRG (talk) 02:41, 24 October 2010 (UTC)

Extracting gegraphic coordinates from .kmz files
Is there any way to automatically extract geographic coordinates from Google Earth .kmz files to a text file or to a spreadsheet? —Preceding unsigned comment added by 113.199.216.230 (talk) 07:29, 23 October 2010 (UTC)
 * kmz files are just kml files gzip compressed. If you have a linux/unix/mac computer you can do cat your_file_here.kmz | gzip -cd > your_output_file_here.kml and then read the resulting file, which probably has the coordinates in it. I don't know the particular format of KML files but they're pretty standard and a lot of languages have modules that will understand them for you. Shadowjams (talk) 09:17, 23 October 2010 (UTC)


 * Once unzipped, Keyhole Markup Language is XML, so you'd typically use an XML parser like Beautiful Soup, libxml2, or one of those listed at Category:XML parsers to extract data from it. -- Finlay McWalter ☻ Talk 11:28, 23 October 2010 (UTC)


 * Here is an example that uses Beautiful Soup and Python to retrieve the coordinates for the course of the Bay to Breakers race (from, indirectly, Wikipedia):


 * More complicated files will, of course, require more complex code. If this was a .kmz file rather than a .kml, you'd also have to run it through zlib to unzip it. -- Finlay McWalter ☻ Talk 15:15, 23 October 2010 (UTC)

Which language is this?
I'm using Singular and I would like to know what language it's using. Let M be a 3&times;3 matrix:

M = \left(\begin{array}{ccc} m[1,1] & m[1,2] & m[1,3] \\ m[2,1] & m[2,2] & m[2,3] \\ m[3,1] & m[3,2] & m[3,3] \end{array}\right). $$ The trace of the matrix is given by tr(M) = m[1,1] + m[2,2] +m[3,3]. To calculate the trace in Singular you can use an for loop:
 * int tr; (Tells Singular that tr is an integer)
 * for (i = 1; i <= 3; i++) {tr = tr + m[i,i];} (This is the for loop)

Does anyone know if that for loop for (i = 1; i <= 3; i++) {tr = tr + m[i,i];} is from a programming language? Thanks in advance. — Fly by Night  ( talk )  11:14, 23 October 2010 (UTC)


 * It's Singular's own language; its webside says it's "an intuitive, C-like programming language". -- Finlay McWalter ☻ Talk 11:21, 23 October 2010 (UTC)
 * Cool, where did you find that? (I found the exact same if loop in the if loop article, and you're right: it was in C). — Fly by Night  ( talk )  11:28, 23 October 2010 (UTC)


 * It's on the homepage of the Singular website. While that code resembles C, it's not - C doesn't have (genuinely) multidimensional arrays. That code m[i,i] would have to be written m[i][i] to be syntactically valid C. -- Finlay McWalter ☻ Talk 13:02, 23 October 2010 (UTC)
 * C doesn't have multi-dimensional arrays, but C# does. However, C# does not have pointers or pointer arithmetics, so array indexing is the only way to access the arrays. In practice, it shouldn't matter that much. J I P  &#124; Talk 19:36, 23 October 2010 (UTC)


 * Pedantry demands that I point out that m[i,i] is in fact syntactically valid C, but doesn't do what you want. --Sean 20:09, 23 October 2010 (UTC)
 * Ah, the infamous comma operator . It's so rarely used that I think people forget it's there. What it does is evaluate its left operand, cause a sequence point, evaluate its right operand and return the value of the right operand. Just for the benefit of this discussion. J I P  &#124; Talk 13:33, 24 October 2010 (UTC)

how much faster is a mobile i7 duo than a core 2 duo at the same clock speed?
So Apple's 15inch MacBook Pro can be: - 2.53 GHz Intel Core i5 Duo - 2.4 GHz Intel Core i5 Duo - 2.66 GHz Intel Core i7 Duo - 2.8 GHz Intel Core i7 Duo While its MacBook Air is: - 1.4 GHz Intel Core 2 Duo (11-inch MacBook Air) - 1.6 GHz Intel Core 2 Duo (11-inch MacBook Air) - 1.86 GHz Intel Core 2 Duo (13-inch MacBook Air) - 2.13 GHz Intel Core 2 Duo (13-inch MacBook Air) What I would like to know is how the two architectures compare, gigahertz-for-gigahertz? They use exactly the same RAM... —Preceding unsigned comment added by 84.153.222.131 (talk) 12:06, 23 October 2010 (UTC)

Here's a list of benchmarks from cpubenchmark's website for high end CPUs. Don't know how to differentiate between the very similar model-names but basically from my read through the i5/i7 range are more powerful than the Core 2 Duo equivalent: http://www.cpubenchmark.net/high_end_cpus.html and http://www.cpubenchmark.net/mid_range_cpus.html ny156uk (talk) 19:25, 23 October 2010 (UTC)

Emacs Colour Scheme
I'm using Emacs version 21.4.22 (released January 2009). But I hate the colour scheme. The background is grey and some of the words appear in a bright, hard-to-see pink. How can I change the color scheme? I'm a total novice; this is my second time using Emacs. So a step-by-step guide would be very much appreciated. I hope you can help! — Fly by Night  ( talk )  14:49, 23 October 2010 (UTC)
 * The simplest is to change the background colour when you start emacs with e.g.  (you may want , though). If your emacs shows you many different font colours (on source code, I assume?), you probably have   enabled - I think that is the default for recent emacsen. You can configure the colours in you   file. Here is an excerpt from mine:


 * Copy this into your  file and restart emacs (or put it into a buffer and do   to test the effect first). Does this help? --Stephan Schulz (talk) 15:31, 23 October 2010 (UTC)


 * It seems like it would help, but I have a few problems. I don't seem to have any files with the extension .emacs, and secondly I don't know what a buffer is nor how to put something into one. I downloaded SINGULAR and am using that. I'm using Windows Vista and I have a single desktop icon that "starts Emacs after starting the X-server". It doesn't look like I have a stand-alone version of Emacs. Rather a bundle version is opened by another program I'm using. I was hoping that there might be an option section or something. I guess I have a few questions to make:
 * What's a buffer and how do I put that code into one to test it?
 * Is there an options menu where I can change the preferences, if so how?
 * Could I download a stand-alone version of Emacs and start SINGULAR from it myself?
 * Sorry to be a pain. But like I said: this is my second time using Emacs. — Fly by Night  ( talk )  16:42, 23 October 2010 (UTC)
 * "I'm using Windows Vista" - aha, there is you problem ;-). I'll do my best, but my experience with Windows (any version) is extremely limited. The  file is emacs' configuration file. That's the full name - under UNIX-like systems, the leading dot makes it invisible to normal operations. There is a FAQ for emacs on Windows . Check sections 3.4 and 3.5 for the init files. Emacs can edit multiple files (and, indeed, non-file data) at the same time. Each of the pieces of data resides in a separate buffer. There should be a top level menu entry called Buffers that allows you to select any of these buffers for editing. You can make new buffers various ways, the easiest is probably to open a new file via the File menu.  Normally, the initial buffer that is open is called  . You can use that for experimentation. --Stephan Schulz (talk) 17:50, 23 October 2010 (UTC) This was silently merged in here by Wikipedia resolving an edit conflict without asking me. Weird... --Stephan Schulz (talk) 17:52, 23 October 2010 (UTC)


 * Assuming you are using Linux/Unix (or you wouldn't be using Emacs)... Type cd and press enter to get to your home directory. Type <tt>ls -a</tt> to list all of the files, including the hidden ones.  You may see a file names ".emacs".  The "." at the beginning means "this is a hidden file", which is why you have to use "-a" to see it.  If you see the .emacs file, open it and edit it in your favorite text editor (emacs, vi, nano, ...).  If you don't see a .emacs file, just create one.  Next time you start Emacs, it will check your home directory for a file named ".emacs" and load any settings in that file. --  k a i n a w &trade; 17:27, 23 October 2010 (UTC)
 * As my last post said: "I'm using Windows Vista...". Emacs is available for both Linux and Windows, see here. — Fly by Night  ( talk )  17:40, 23 October 2010 (UTC)
 * It's probably best to go  (that is, hit alt-x, type "customize", and hit enter) and navigate to "Faces", "Font Lock", and then "Font Lock Faces".  It'll take a little longer to figure out, but you'll be able to use the customize interface to adjust all sorts of thing about your emacs experience.  When you've edited something, go   (that is, control-x, then control-s; same as saving a file) to save and try out your customizations; it's easier than having to restart emacs.  Paul (Stansifer) 18:34, 23 October 2010 (UTC)


 * Thanks for the advise. But I give up. It's too complicated. There are different colours for everything. I managed to change the horrible pink font colour to blue, but then when I run the program it seems to have its own default colours. I give up. I'll use the MS DOS terminal instead. At least I can read what I've written. Thanks for all your help. — Fly by Night  ( talk )  18:47, 23 October 2010 (UTC)

I very strongly recommend to upgrade to Emacs 23 if at all possible. It is the first version to finally support Xft, which gives a night-and-day improvement in the appearance of text. There are also many other important improvements over Emacs 21. Looie496 (talk) 18:52, 23 October 2010 (UTC)


 * As I mentioned above: as far as I can tell, I don't have a stand-alone copy of Emacs. I use SINGULAR which opens Emacs after it's started X-server. One of my questions above was whether I could download a stand-alone version of Emacs and then open SINGULAR in the new version. But nobody replied. — Fly by Night  ( talk )  20:08, 23 October 2010 (UTC)
 * The Singular manual says that you can run it using Emacs as an interface, and gives instructions not only on starting its bundled Emacs but also on how to separately install Emacs (any version) and then run Singular under it. You might also look for the <tt>color-theme.el</tt> package.  --Tardis (talk) 21:14, 23 October 2010 (UTC)
 * That's great. Thanks Tardis. I'll try to find a new version of Emacs and see how I go. — Fly by Night  ( talk )  00:54, 24 October 2010 (UTC)


 * I've started a new thread below that focuses on the current problems. Please move down and see if you can help this poor, foolish Windows user. (I have Ubuntu at work...) — Fly by Night  ( talk )  12:19, 24 October 2010 (UTC)

Program to build an electronic translator
Hello there,

I'm working on building an electronic translation facility for Tetun to English. I used to use the program, Tolken99, for projects such as this, but the program no longer works and has not been updated. It would simply be a programme into which one could input a custom dictionary and with an interface that translates from one language to another attached.

On a somewhat related note, does anyone know of any (preferably free) normal text to IPA transcription programs?

All the best

--178.99.129.52 (talk) 16:09, 23 October 2010 (UTC)
 * Is your goal to perform simple word substitution? In that case, almost any scripting language can perform this task; but the translations will be of poor quality.  If you want to perform actual natural language processing and machine translation, the short answer is that there is no "easy" program to use or customize.  These computerized-translations (like the ones you see on Google Translate or Microsoft Translate are very sophisticated algorithms and elaborate databases that use complex, mathematical/statistical language models.  Adding support for a rare language like Tetun will be a huge undertaking.  Can you clarify your objective?  Nimur (talk) 18:17, 23 October 2010 (UTC)

Proxy servers
The recent Wikileaks stories made me wonder about one thing connected with proxy servers and anonymity that I never quite understood: Let's assume, for argument's sake, that I work at John Doe University. In my office, I have access to the internet through the University network (johndoe.edu). I am also a consultant for Jane Roe University and I can use their proxy server, proxy.janeroe.edu

Now, say, I access a site such as wikileaks.org from my John Doe office, with proxying through janeroe.edu enabled in my browser. I know that the administrator of janeroe.edu can find out, upon investigation of server logs, that my computer is actually in the johndoe.edu network and that I am accessing wikileaks.org

But what does the johndoe.edu admin see, if he were ever to check his access logs? Would he only ever see that I was connected to proxy.janeroe.edu? Or could he in any way figure out which sites I accessed through the proxy (namely wikileaks.org) ?

Incidentally, does the situation change if you substitute "VPN" for "proxy" in the above? Thanks. (Oh and PS, if you're now eagerly awaiting a major data leak from a big US university in the next few days, you will be disappointed... ;-) --Quidquididesttimeo (talk) 18:27, 23 October 2010 (UTC)


 * For just http proxies, there's no reason anyone who runs a machine through which the traffic flows can't see and log whatever they want, and so you have no privacy. A VPN is a bit better, because the local admin only sees you connecting to the VPN server elsewhere.  But if both operators connive, they can correlate (in time) VPN packets to plain packets leaving the VPN, and can figure out who's doing what.  Networks like Tor use multiple hops of onion routing to make the it difficult to correlate input packets withoutput ones - you'd need the connivance of everyone in the virtual circuit, and if Tor can use long virtual circuits (which cross many institutional and national boundaries) this makes achieving that connivance more difficult. Note that when I say "connive" that includes operators acting under compulsion (e.g. of subpoena) or interception of traffic through their equipment (with or without their knowledge). -- Finlay McWalter ☻ Talk 18:36, 23 October 2010 (UTC)
 * Remember of course you need to trust the VPN server admin (as you would need to trust the proxy provider). The VPN server admin can log anything you do over the VPN just as your local admin can. While they usually promise some degree of anoymity and to minimise logging, there's always a risk a VPN could be worse then any local admins, since the people who run these sometimes are rather secretive and they may be run in other countries from where you live which may have less protective laws then where you live. (On the other hand, having them in another country from you may also make it harder for your local authorities to track what you're doing. There's of course also the risk one could be a honeypot. Also if you're truly worried about anonymity even if you do trust the VPN provider completely, you need to be careful to avoid leaks like DNS leaks, which can be a risk depending on what sort of VPN and OS you are using. Tor is useful, but if you aren't using end to end encryption you should be aware of the risk of exit node monitoring. They may not know which IP address your traffic originated from, but if you submit your real name, telephone number and address repeatedly unencrypted well they may not care they don't know your IP address... In this case of course you don't have any real agreement with the exit node provider, and it's quite likely some exit nodes are doing some monitoring for a variety of reasons. Of course not using end to end encryption is a bad idea anyway, and always going to be a big risk since you really have no idea who is in between you and your final destination and what they're doing. The VPN provider for example, if they are up to something, would be quite happy too have a name, telephone number and real address to correlate with your IP address and all the logs of your activity. (Then of course there's the question of who you're sending your real info to and whether you trust them.) Nil Einne (talk) 12:09, 24 October 2010 (UTC)


 * But consider the pervasive nature of internet surveillance by large government security establishments, and particularly transnational sharing schemes such as those that may exist under UKUSA Agreement. If you can surveil a significant proportion of the nodes in a given OR virtual circuit, can you start to draw worthwhile statistical inferences about the traffic through that network? If your goal is to correlate packets entering the network with ones leaving it (so you know who is sending to whom), does knowledge of a serious proportion of each node's traffic allow you to infer just a little tiny bit of a probablistic correlation. That alone isn't much use, but if you monitor a great deal of traffic, do those probabilities start to stack up - that is, is that one cable modem in Maryland that's been sending tens of megabytes of traffic into TOR for days just a pr0n provider, or is that the traffic going to Wikileaks?   We've really no idea what the capabilities of NSA, GCHQ etc. are; if I were wishing to send stuff to wikileaks, I don't know if I'd be willing to bet my life on the proposition that they don't have worthwhile traffic analysis over it. They're much smarter than I am. -- Finlay McWalter ☻ Talk 19:28, 23 October 2010 (UTC)