Jump to content

Wikipedia:Reference desk/Archives/Computing/2012 October 2

From Wikipedia, the free encyclopedia
Computing desk
< October 1 << Sep | October | Nov >> October 3 >
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.


October 2

[edit]

What screen resolution is required to not see jaggies ?

[edit]

I realize there are smoothing methods to try to disguise jaggies, but that's not what I'm asking about here. Suppose you have the worst-case scenario, of a horizontal line one pixel wide, with a one pixel offset in the middle:

@@@@@@@@@@@
           @@@@@@@@@@@@@

Would there be any resolution where this would appear smooth, or would it become invisible before it appeared smooth ? How about if we make the line thicker ? We could have 2 pixel thickness and 2 pixel offset:

@@@@@@@@@@@
@@@@@@@@@@@
           @@@@@@@@@@@@@
           @@@@@@@@@@@@@

But, presumably, this would be the same case as before. So, how about a 2 pixel thickness and a one pixel offset:

@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@
           @@@@@@@@@@@@@

Or 3 pixel thickness and one pixel offset, etc. I imagine technologies which produce "fuzzier" pixels (like CRTs) actually result in the first case looking more like the third. Has anyone studied this ? StuRat (talk) 00:42, 2 October 2012 (UTC)[reply]

Here is a nice website, Resolution of the Human Eye, quantitatively comparing an eye to several common metrics used to describe cameras. The Air Force Eye Chart, and many similar charts, use parallel lines of various widths and spacings to quantitatively measure human and instrument resolving power. In fact, eye resolution depends on more than just distance: light conditions, subject color and contrast, and physiological state, all affect the resolution; not to mention immense variation from person to person, especially in light of known optical aberrations like myopia, astigmatism, and hundreds of other special names for different-types-of-blurry-vision. So there's no specific singular answer to your question; you can easily estimate your own eye resolution, or use statistical aggregates such as the ones provided in the references and articles I linked. Finally, I'll comment that antialiasing is not merely a method to disguise sampling artifacts. It's a rigorous, mathematically-robust way to more correctly present or reproduce sampled data. Nimur (talk) 01:11, 2 October 2012 (UTC)[reply]
I don't think making everything so blurry you can't see the jaggies is really correcting it, just disguising it. Wearing glasses at the wrong prescription can produce the same result. StuRat (talk) 02:21, 2 October 2012 (UTC)[reply]
Properly designed antialiasing involves application of a low-pass filter to band-limit the (reconstructed) sampled data. A low-pass filter can be described as a "blurring" filter. Incorrect parameters will result in a low-pass filter with an overly-aggressive cutoff frequency, which is not optimal and the image will appear blurry. Correct parameters will reproduce a signal that is provably, optimally most-similar to the intended input - even closer to the desired signal than the un-antialiased signal. This is studied in great detail; we have many articles on sampling theory and antialiasing. It is unfortunate, but true, that many crude attempts at antialiasing simply result in blurred images; but any algorithm constructed crudely can mangle data; that's not unique to antialiasing. Antialiasing, implemented incorrectly, blurs the image. Quicksort, implemented incorrectly, can produce unsorted lists; but neither error is the fault of the algorithm. Nimur (talk) 02:34, 2 October 2012 (UTC)[reply]
Certainly some attempts are better than others. Still, if I want the maximum contrast between "line" and "not line", and still want the above cases to appear smooth, I can really only get that with a high resolution. With a lower resolution, I have to choose one or the other. StuRat (talk) 03:01, 2 October 2012 (UTC)[reply]
You may be interested in Subpixel rendering, which achieves a higher effective resolution around edges in order to smooth them. The animated image on the left of the article is a great demonstration. 209.131.76.183 (talk) 13:35, 2 October 2012 (UTC)[reply]

python/cmd/ipv6/ect...

[edit]

i figure i should put this all in one section, but feel free to split it up.

1: how do i tell if my pc hardware is ipv6 compatible, or does it matter? 2: how do i know/make if my router is ipv6 compatible? 3: what all should i do to get ready for the ipv6 switch?

4: i need i list of commands i can use in the command prompt in windows7? (ones that don't have access restrictions that make them unusable.) 5: how do i use the windows7 ftp client (c:/system32/ftp.exe)? (basic)

6: how do i get a list of functions in a given module in python? 7: how do i use the "ftplib" module in python? (basic)

8: i have windows7, a 7.5gB micro-sd with usb adapter, and a 4.5gB mkv file. when i try to copy the mkv file to the micro-sd card, windows gives an error message saying it's to big. any advice? 9: anyone have an alternative method to copy the mkv file to my friends laptop or pc? (i have no cd/dvd/bd burners, and no extra sd cards or usb drives.) — Preceding unsigned comment added by 70.114.254.43 (talk) 03:22, 2 October 2012 (UTC)[reply]

1, 2 & 3)I'm sure there will be people who will disagree, but this is precisely the same question as "what do I need to do to be W2k ready?" back in the day and the answer is the same: Don't worry about it. The people who need to worry about it are taking care of it. Some people are really making a mountain out of a mole hill. Sure there's some fairly complex stuff going on in the back end, but most internet users don't need to worry about it. For the vast majority of people, if you pay for an ISP service, it's up to them to continue the service, whatever that takes. I'll let others address the rest. Vespine (talk) 03:43, 2 October 2012 (UTC)[reply]
I'll give 8 a crack since it's a pretty easy one. Your card is probably formatted in FAT32, which means no single file can exceed about 4GB. I think you should just be able to format the SD card in NTFS which will enable it to hold larger files. Vespine (talk) 04:58, 2 October 2012 (UTC)[reply]
To answer 6, you can use dir(module) to get a list of all objects in its namespace. vars(module) will return a dictionary of everything in the namespace (including builtins), which can be unnecessarily verbose if the creator didn't define __all__. Σσς. 06:36, 2 October 2012 (UTC)[reply]
The most useful command is probably help(module), which will give you a list of functions with descriptions. Re #8, yes you can format the drive as NTFS, or make a multi-volume archive using something like 7-Zip. Re #4, Template:Windows commands is one list. -- BenRG (talk) 15:45, 2 October 2012 (UTC)[reply]

thanks Vespine , (8) i formated the drive to ntsf, and it worked. 70.114.254.43 (talk) 22:53, 3 October 2012 (UTC)[reply]

1 2 & 3 The PC hardware, including the network card, is by definition IPv6 ready. The operating system is the component that determines if your PC is capable of operating in an IPv6 environment without using one or more of the transitional technologies that are available. If you are using any more or less up to date version of Windows, OS X, or Linux then your PC is ready to deal with IPv6. Your router may not be IPv6 ready and this will determine how you will be able to use IPv6 but it will not prevent you from using Internet services that are only available at an IPv6 address. For most IPv6 capable home or small office routers, the configuration screens will have some obvious IPv6 entries. The simple thing to look for is an IPv6 address in the form of hex characters separated by ':'. Even if your router is strictly an IPv4 device, you may be able to update the firmware. After saying all that, it really doesn't matter to most users. Your ISP is not going to suddenly stop providing service to you. Most ISPs will provide something called CGN (Carrier Grade Network Address Translation) that will allow IPv6 and IPv4 to inter-operate. CGN isn't elegant, the protocol purists hate the mention of the term but it does work.Docdave (talk) 03:10, 8 October 2012 (UTC)[reply]

proxy-server

[edit]

is there any such thing as a tunneling proxy? one to tunnel ip thru icmp, for example. so if i wanted to send data to a port my firewall blocks, i could trick it. cause i can't use yacy, cause i don't control my firewall. (also, i don't get the capchas when i save edits anymore. i don't know if that's a malfunction or not.) thank you, 70.114.254.43 (talk) 04:09, 2 October 2012 (UTC)[reply]

It's very uncommon to use ICMP for anything other than ICMP, because it lacks some pretty important pieces of a reliable internet transport protocol: error-checking and correction, automatic retransmission of lost data; sequencing, and so on. Not to mention, sending malformed or otherwise "irregular" ICMP packets is sure to draw the ire of commonplace automated security software on internet routers, potentially causing these routers to drop your packets. But, theoretically, one could append tiny amounts of arbitrary data to an ICMP packet. (This is how traceroute works). It's far more common to use an SSL-over-TCP tunnel for proxying: for example, SOCKS, or any of the numerous secure VPN protocols, are much more robust ways to securely tunnel traffic to a trusted proxy server. As far as "tricking" your router: ports are an abstraction supported by the TCP or UDP protocol; you cannot "fool" a router by sending non-TCP or non-UDP packets. Those are simply "invalid" TCP or UDP packets, and as I mentioned, are liable to be dropped, potentially with the consequence of convincing the router to drop future valid data you may wish to transmit. Nimur (talk) 04:57, 2 October 2012 (UTC)[reply]

ICMP tunnel AvrillirvA (talk) 10:39, 2 October 2012 (UTC)[reply]

It's been done, even through DNS, but hopefully you can set up a conventional proxy someplace you can actually reach through your firewall. 67.117.130.72 (talk) 05:02, 3 October 2012 (UTC)[reply]

One bit of advice, if this is a corporate environment and you are looking to bypass corporate controls, it is not likely to have a very happy ending. In addition to using firewalls, many large organizations also use tools designed to identify things like tunneling which is usually a violation of acceptable use policy. Dan Kaminsky did, in fact, use DNS to tunnel data past a firewall, that was a proof of concept and not a very useful tunneling mechanism. Using an encrypted HTTPS session to any one of the available tunneling sites will work, but more and more organizations are using devices that decrypt and inspect outgoing traffic, so you might well be caught. Docdave (talk) 03:20, 8 October 2012 (UTC)[reply]

Not to mention a lot of places (well, schools and hospitals at least) randomly pull up users' screens in remote desktop to see what they're doing, and when they do that, they see everything you see. So unless you want to end up like this person, I would advise against doing anything like this at work or school. PCHS-NJROTC (Messages) 00:52, 12 October 2012 (UTC)[reply]

low-level ram stuff

[edit]

i write software as a hobby, and i wanna know if there's any way to keep malware from reading my apps's data from the ram. or if the os may do this for me. more specifically, can my software directly prevent other software from reading the ram it's allocated, or other ram with it's data (like the frame buffer, storing a bitmap of data to be output to the screen)? or can it even detect that other software is doing this? and can the os prevent or detect it? also, can malware open files it doesn't have permissions to (overriding them the permissions)? thanks, 04:24, 2 October 2012 (UTC) — Preceding unsigned comment added by 70.114.254.43 (talk)

If malware is running while your program has things stored in RAM, I can't see any way to stop it from reading it under the current architecture. Still, there are things you can do:
A) Obviously, make sure that no malware is running.
B) Use a computer with no connection to the outside world. This means no Internet, but also no swapping CD's, DVD's, and flash drives with your friends. This would both help to keep malware off your computer, and, if it does get on there, it would also prevent it from sending your data to the bad guys.
C) An architecture with a single process running would prevent this. Embedded systems may do this.
D) An architecture which strictly limits access to RAM by process could be developed. This could work with separate processors, where each processor has it's own RAM, and only runs a single process. The performance hit might not be as bad as you think, as a processor with only a single process could avoid having to "take turns" and swap things in and out of paging space. Of course, you'd need lots of processors and RAM chips to do this for every process (like 256 ?). However, if you only need a few standalone processes, then you could let most of the processes run together on the same processor and RAM, as they do today. StuRat (talk) 04:42, 2 October 2012 (UTC)[reply]
We have an article on memory protection that answers most of your question. Provided that the operating system is functioning normally, and that you are not running esoteric computer hardware, it is the job of your operating system to guarantee memory protection. Nimur (talk) 05:06, 2 October 2012 (UTC)[reply]
In Windows there is no way from preventing one program from inspecting another's address space if they are both launched by the same user with the same privileges. If the malware is running as a normal user, it cannot inspect programs that are running as administrator. If the malware is running as administrator there is no way to stop it from doing whatever it wants to. 209.131.76.183 (talk) 15:12, 2 October 2012 (UTC)[reply]
There is no really reliable way to do this. If you have ultra-private data, put it on a separate computer with no internet connection, don't use usb keys (Stuxnet), etc. 67.117.130.72 (talk) 05:05, 3 October 2012 (UTC)[reply]

python network programing

[edit]

what do "socket.setsockopt", and "socket.options", and "socket.ip_ttl" do? and is there any way to change the fields in the ipv4 header? and does the socket module support ipv6? and does python have a way to do arp or rarp? and lastly, does python have a way to build a packet from the ground up (below the transport layer) and send it? thank you in advance, 70.114.254.43 (talk) 04:43, 2 October 2012 (UTC)[reply]

Such specific questions about the APIs are best answered by consulting Python's excellent online documentation. For your latter questions: no, Python is a high-level, platform-independent language, and does not have a mechanism to access low-level hardware interfaces such as the direct control of a network interface. Python programs can call external system libraries to execute system-specific functionality. Nimur (talk) 05:12, 2 October 2012 (UTC)[reply]

the online docs don't have info on "socket.options" or "socket.ip_ttl". and were would i get software to work below the transport layer (direct control of a network interface)? 70.114.254.43 (talk) 07:33, 2 October 2012 (UTC)[reply]

On Linux, socket.setsockopt is a thin wrapper over the setsockopt syscall, and works just like it. As that man page suggests, the options themselves depend on what kind of socket it is. So, for TCP for an example, see the "Socket Options" section of the TCP manpage. Yes, the socket module supports IPv6 - create a AF_INET6 socket. Python doesn't contain built in libraries for ARP and RARP, but you can find several libraries that do ARP at least, or you can build your own in Python (see next question). As to building your own packets - yes, you create a AF_PACKET, SOCK_RAW socket, and you can hand make ethernet frames (see this example); I think you need to be root to open a SOCK_RAW socket. If you make AF_INET, SOCK_DGRAM sockets you can write IP packets (and thus manufacture things like ICMP and IGMP packets), for which I don't think you need to be root. All the above is roughly the same on Windows, but you'd need to look up the MSDN documentation for sockets and their options. Reading and generating packets can be a chore, so packages like scapy make it easier. -- Finlay McWalterTalk 11:25, 2 October 2012 (UTC)[reply]
On Windows, a raw socket is created with socket.socket(socket.AF_INET, socket.SOCK_RAW) instead. I've checked, and to create a raw socket you definitely need to be root on Linux, or Administrator on Windows. I don't know where you're finding socket.options and socket.ip_ttl I don't see these (either as members of the socket package, or of a created socket), either on Windows or Linux. -- Finlay McWalterTalk 12:29, 2 October 2012 (UTC)[reply]
SOCK_DGRAM is for UDP packets. It won't let you send ICMP and IGMP packets (which, for obvious reasons, really require you to be root/administrator) Unilynx (talk) 20:57, 3 October 2012 (UTC)[reply]

Archive a web site

[edit]

What would be the easiest way to archive an entire existing web site, one to which I only have regular HTTP access to? Horselover Frost (talk · edits) 14:15, 2 October 2012 (UTC)[reply]

Httrack AvrillirvA (talk) 14:16, 2 October 2012 (UTC)[reply]
After giving it a quick try, it looks like it'll suit my purposes, though I do have two questions. Is there a way to restrict it from accessing certain subdirectories, and is there a way to make it archive all linked images, but keep itself restricted to the one site for other file types? Horselover Frost (talk · edits) 15:18, 2 October 2012 (UTC)[reply]
Yes, you can specify what you want to allow/disallow with the filter system. These pages explain it in detail [1] [2] [3] AvrillirvA (talk) 18:38, 2 October 2012 (UTC)[reply]
You could also use wget, look at the manual page's information on the -m and -R switches in particular. Cdwn (talk) 14:40, 3 October 2012 (UTC)[reply]

Deleting folders of bookmarks on Firefox mobile

[edit]

This seems like it should be such a simple thing but I can't get it figured out and searching brings up too many results for the desktop version of Firefox. How can I delete a folder (empty or not) from the bookmarks menu on the mobile version of Firefox? Dismas|(talk) 20:48, 2 October 2012 (UTC)[reply]

press "ctrl+shift+b", this shows all bookmarks. then find you'r folder, should be in either: "bookmarks toolbar", "bookmarks menu", or "unsorted bookmarks". then right click and hit delete. — Preceding unsigned comment added by 70.114.254.43 (talk) 02:59, 3 October 2012 (UTC)[reply]
Read my question again. The title too. I think you might have missed something. Dismas|(talk) 05:42, 3 October 2012 (UTC)[reply]

I don't have a mobile phone and have never used Firefox Mobile, so this is based purely on google search and I have no idea if it works or not. The only thing I could find which seemed relevant was to "press and hold [the folder] for a few seconds" and then apparently a popup menu will appear with options to remove the bookmark. I assume this is referring to a touch screen system. The other way to remove them would be to find and edit and bookmarks database file in the profile directory directly. 92.233.64.26 (talk) 10:50, 3 October 2012 (UTC)[reply]

Thanks but that was the first thing that I tried. You can delete individual bookmarks by "long-pressing" on them and then selecting "delete" from the pop-up menu that appears. For folders though, no menu appears and therefore no delete option. Dismas|(talk) 10:56, 3 October 2012 (UTC)[reply]

sorry, i somehow missed the word "mobile". 70.114.254.43 (talk) 22:50, 3 October 2012 (UTC)[reply]