Wikipedia:Reference desk/Archives/Computing/2009 November 9

Computing desk
< November 8 << Oct | November | Dec >> November 10 >
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.


November 9

edit

Visual Dictionary for OS X?

edit

I'm looking for a visual guide to what all the parts of OS X are called. —Preceding unsigned comment added by 72.253.80.241 (talk) 03:10, 9 November 2009 (UTC)[reply]

The Apple HIG will tell you what everything is along with examples of each interface element. 206.131.39.6 (talk) 16:03, 9 November 2009 (UTC)[reply]

Video problems with Sacred 2: Fallen Angel

edit

A friend of mine recently bought this game for the PC. He installed it, created a character, and it worked perfectly fine until he tried to load his character. After that happened it wouldn't load his character. It would minimize the game and keep saying DirectX 9 failed to start, and that it would fix the problem. Then he would click back into the game and try to load the character again and it would try to minimize the screen and then would freeze, requiring us to open the task manager and end the process directly. It did this every time we tried it. We installed the latest DirectX (I believe it was 10). It still was not working. I think it is his graphics card but we are not sure. Here are the system specs. They are all above the recommended speeds for the game.

HP Laptop (Not sure of the model) Windows Vista Home 64-bit 2.00GHz processor 4GB RAM 512MB dedicated video RAM

What do you guys think, would it be the graphics card or what? Thanks guys.

RandomAccessDawg (talk) 04:38, 9 November 2009 (UTC)[reply]

Try upgrading the drivers for the video card. If that doesn't work, try loading a different character. If that STILL doesn't work, try reinstalling the game. If that STILL doesn't work, then your video card may be incompatible with the game. Since you are using a laptop, you're out of luck. Check the system requirements for the game and see if a list of supported video cards is available. If yours isn't on there, you cannot play the game. Also, the game might not be supported under Vista or 64-bit. (Wow this is a long answer)  Buffered Input Output 13:49, 9 November 2009 (UTC)[reply]
I've played that game a few months ago and remember all kinds of gripes about 64-bit issues. I don't think it works very well in Vista either and you'll be lucky to get it stable there. If you can, dual-boot into XP 32-bit; it works very well there. It's not too fussy what video card you have but you will probably lose out on nice effects with the watered-down graphics cards on laptops. Sandman30s (talk) 22:28, 9 November 2009 (UTC)[reply]

Netbeans or Eclipse

edit

I am learning J2EE....
Which tool will be better for me....
Eclipse or Netbeans....
And why???....
What is the difference between them???? —Preceding unsigned comment added by Atchays (talkcontribs) 06:12, 9 November 2009 (UTC)[reply]

Both are great tools. Eclipse was originally developed by IBM, while NetBeans was originally developed by Sun Microsystems. Both companies, who were strong proponents of Java, released the projects as a sort of "open consortium". NetBeans has a very nice integrated J2EE environment, complete with the official GlassFish J2EE web application server; it is very convenient for both toy projects and full-scale enterprise development. Eclipse has similar features and a J2EE edition; it also boasts an active user-community (probably more so than NetBeans). Both are very good tools; either will work for learning J2EE; you can learn both, or specialize to learn only one; depending on how much effort you want to put in. In my experience, more corporate J2EE development is done with Eclipse and its proprietary variants. Nimur (talk) 00:27, 10 November 2009 (UTC)[reply]
Why didn't you mention that it is far easier to develop GUIs in Netbeans? You just drag the components onto the form and double click on them and event handlers are added by the IDE.--Drknkn (talk) 10:51, 14 November 2009 (UTC)[reply]
GUIs are not part of Java EE; they are part of Java SE (which is a subset of Java EE). I was highlighting the EE toolkits. Nimur (talk) 14:37, 14 November 2009 (UTC)[reply]

Win7

edit

Why wasn't Windows 7 given an official name? jc iindyysgvxc (my contributions) 09:12, 9 November 2009 (UTC)[reply]

What do you think "Windows 7" is? If you want to know why it was not given a different official name, I'd guess that Microsoft's Marketing expects more sales this way, probably because they want to try some understatement after the general disappointment with Vista. --Stephan Schulz (talk) 09:59, 9 November 2009 (UTC)[reply]
Alright, yes, that's what I meant. Why wasn't it given a name with an abbreveation or word? Why did it go back to the naming convention of the DOS/9x based operating systems? jc iindyysgvxc (my contributions) 11:26, 9 November 2009 (UTC)[reply]

hopefully they continue the trend and call the next one windows 8 or something. much less confusing than random names. —Preceding unsigned comment added by 82.43.89.85 (talk) 11:09, 9 November 2009 (UTC)[reply]

Here is a Microsoft blog post on the topic. It says that Windows 7 was the internal development code name (many products will be developed with a simple codename and then named later once marketing people have done their work), and they decided to release it under that name. Mike Nash of Microsoft explains:
The decision to use the name Windows 7 is about simplicity. Over the years, we have taken different approaches to naming Windows. We've used version numbers like Windows 3.11, or dates like Windows 98, or "aspirational" monikers like Windows XP or Windows Vista. And since we do not ship new versions of Windows every year, using a date did not make sense. Likewise, coming up with an all-new "aspirational" name does not do justice to what we are trying to achieve, which is to stay firmly rooted in our aspirations for Windows Vista, while evolving and refining the substantial investments in platform technology in Windows Vista into the next generation of Windows.
Simply put, this is the seventh release of Windows, so therefore "Windows 7" just makes sense.
So they don't have any aspirations, or rather, their aspirations are to make something just like Vista, except a Vista that actually works. --Lesleyhood (talk) 12:32, 9 November 2009 (UTC)[reply]
There are 3 things which a version name/number should do:
1) Allow you to distinguish between versions. All three MS naming schemes did that.
2) Allow you to tell which is newer and which is older. Both numbers and dates allow that, although numbers are somewhat better, in that they can have many levels to them.
3) Tell you how old a version is. Only date names did that.
So, the names like XP and Vista were the absolute worst system, while dates or version numbers are both much better. Personally I'd settle for either of those two options, as long as they remain consistent. Changing the naming scheme with each new version is truly idiotic. StuRat (talk) 13:46, 9 November 2009 (UTC)[reply]
The trouble is that Windows 7 is actually version 6.1, as you can see by opening a command prompt for example. That's the version number that's reported to applications. So the marketing name and the internal version are still different, but now they're similar enough to potentially cause confusion. -- BenRG (talk) 21:06, 9 November 2009 (UTC)[reply]
I'd be interested to know how Windows 95, 98, 2000, ME, NT, XP, and Vista map to standard version numbers. Does anyone have a list ? StuRat (talk) 00:10, 10 November 2009 (UTC)[reply]
Honestly, "does anyone have a list?"? This is Wikipedia, of course we have a list! Windows#Timeline of releases. Keep in mind, they split the development between desktop and servers at one point and then merged them again, which is why none of the numbers make any sense. --Tango (talk) 00:18, 10 November 2009 (UTC)[reply]
Thanks. It's too bad that Windows 7 doesn't match the internal version number. StuRat (talk) 13:05, 10 November 2009 (UTC)[reply]

MS PowerPoint - startup macros

edit

Hello,

I am trying to create a way of running a macro (the macro prompts the user for some text and puts it onto the slide master) as soon as the user opens a particular PowerPoint template. This makes sure that the user has to complete the text box. I have got the macro working fine but the problem is running it.

From some research online, it is not simply a case of naming the macro 'autoexec' like you can do in Word/Excel/Access. This does not work. There is a way of doing it that involves using 'Add-Ins'; I don't know anything about Add-Ins but I am pretty sure that they have to be loaded on each user's machine for this approach to work - NOT practical and way too much of a fuss, we are trying to make this as painless as possible to the end-users.

Another approach I considered was setting up an object that, when clicked, runs the macro. This works fine if you run it in slideshow mode but it does not work in editing mode so definitely not ideal. Is there some way I can create a button or something that works in editing mode, runs the macro and then deletes the button itself? Or any other suggestions for this would be appreciated. It is too much to ask of our users to have to go into the slide master every time and manually edit the text box! Thanks! GaryReggae (talk) 10:23, 9 November 2009 (UTC)[reply]

I can only speak from the recent experience of getting a maacro to be invoked in opening an excel file. The solution there was to create a ThisWorkbook object underneath Microsoft Excel Objects in the Visual Basic editor, and then have that object invoke a form which provided the user interface of (in my case) a data collection system. The code in the ThisWorkbook object was nothing more than:
Private Sub Workbook_Open()
frmLayer1.Show
End Sub
PowerPoint seems to offer exactly the same VB editor as Excel, so I guess the technique will be much the same - you'll call your form which collects the information from the user and which provides a button causing the collected data to be written into the slide master. Obviously it is easier if, like me, you have a minion or two handy who has/have a clue what they're doing...but I hope this helps somewhat. --Tagishsimon (talk) 21:35, 9 November 2009 (UTC)[reply]

Vista

edit

What does the Vista part of Windows Vista's name mean? jc iindyysgvxc (my contributions) 11:26, 9 November 2009 (UTC)[reply]

See wikt:Vista. Dismas|(talk) 11:36, 9 November 2009 (UTC)[reply]
That page doesn't exist. Vimescarrot (talk) 12:43, 9 November 2009 (UTC)[reply]
This one does, though. Vimescarrot (talk) 12:43, 9 November 2009 (UTC)[reply]
That's odd. It worked for me when I posted it. And it worked for me just now. Dismas|(talk) 11:31, 10 November 2009 (UTC)[reply]

File, exported from evolution calendar

edit

Can I import this file into other calendars? (like I can import txt, doc or jpg into different applications) Quest09 (talk) 12:49, 9 November 2009 (UTC)[reply]

Not the admin of a network

edit

If I am not the admin of a network, can I scan it and discover what users are connecting to it? I suppose the user names are not encrypted, are they?--Quest09 (talk) 12:51, 9 November 2009 (UTC)[reply]

Users do not use a network. Computers do. What you will see on pretty much any modern network is a bunch of TCP/IP packets racing about. The only thing you can do is reassemble them into a message that will have source/destination IP addresses (computers, not users). However, you can't do much of that because most modern networks use switches/routers. So, you can't see much traffic other than the traffic to/from your own computer.
In the realm of Windows, you can search the Windows network. You can often see the names of computers that have joined the Windows network. Sometimes, those computer names are based on the primary user for that computer. If that is the case, you can assume that the user may or may not be using his or her computer. -- kainaw 13:13, 9 November 2009 (UTC)[reply]
Most networks consist of a router which is connected (possibly indirectly) to the Internet. The router has a load of wires coming out which connect to computers, including yourself. These are the computers in your local network. The router normally assigns each computer an IP address (using DHCP) when they are connected to the router. An IP address is a number (actually 4 numbers) which identifies the computer. The IP address the computer is given is one of the IP addresses in the Private Network address space (see rfc1918).
You can connect to computers in your local network (or the internet) using their IP address, so you can find all the computers by trying to connect to each IP address in the Private Network address space. There are tools like nmap which will do this. --h2g2bob (talk) 18:06, 9 November 2009 (UTC)[reply]

Python wont work with glade

edit

My code will not let me use the module gtk.glade

The error code is "The specified module could not be found."

I've looked and cannot find the module either. So where is it?

PS I am running Python 2.6 on Windows with PyGTK and all requirements installed.

Thanks.  Buffered Input Output 13:43, 9 November 2009 (UTC)[reply]

You should use gtk.Builder instead. It's an official part of gtk and has replaced libglade. --194.197.235.240 (talk) 14:04, 9 November 2009 (UTC)[reply]

Word (and VBA) in MS Works and MS Office

edit

Is Word the same in Word as in Office? Can they both do grammar checking? And is VBA included in both Works and Office? I only want to use Word and Excel, and possibly VBA, and I am wondering to what extent my wants will be covered by the cheaper package. (Note - please do not mention OpenOffice etc - I am already familiar with that/those and it is not the subject of this question). Thanks 92.27.152.41 (talk) 14:21, 9 November 2009 (UTC)[reply]

I assume you mean, is MS Word the same as the word processor in MS Works. My understanding is the Works is scaled down in its features—in both its word processing and its spreadsheets. I used to use it, years ago, and I recall it being fairly limited in both. Works is fairly crippled.
The biggest problem is that Works saves its documents in a different format than Word does. It can read Word documents, but it can't save in them. So if you plan to send documents to anyone else, they will have to get a converter so that their version of Word can read the Works file.
My understanding is the MS Works does not support VBA. --Mr.98 (talk) 15:22, 9 November 2009 (UTC)[reply]
Download the 60-day free trial version to check. (Sorry to sound like an MS marketing bot for supplying the link here and below, but I think it's the proper answer for both questions.) Comet Tuttle (talk) 18:23, 9 November 2009 (UTC)[reply]

Writing stock or pro-forma letters to a few addresses - freeware?

edit

I often have to write the same letter to four or five different addresses. The letter itself is a standard letter with a few details changed. Is there any freeware or no-pay software available that will help me do this quickly, rather than doing a lot of cutting and pasting in a word processor. When I worked in an office long ago, rather than people dictating complete letters they would just tell the typist to put stock paragraphs 2, 7, and 19 (for example) in the letter. I'd like to find something that can do something like that. Thanks 92.27.152.41 (talk) 14:27, 9 November 2009 (UTC)[reply]

Sounds like you need a mail merge function - Microsoft Word will do this but that isn't free! You could try OpenOffice.org, it is a freeware suite of software, including a word processor that has similiar functionality to MS Word but I can't comment on whether it will do a mail merge as I haven't used it for that. Basically, you just compile your standard letter and put in 'fields' that contain the variable sections, such as people's names', address, company name, etc...you then get a spreadsheet or database containing the data that you want to put into those fields and a mailmerge combines the two. Hope this helps GaryReggae (talk) 16:44, 9 November 2009 (UTC)[reply]
I recently used Microsoft Word to do this (the version in Microsoft Office 2007) for 70 letters I had to make. I was surprised to find it was a little more difficult than I had expected — Word has had this function for over 15 years and I would have thought that by now, it would be easier to move back and forth between using the wizard and manually doing it — but in the end it was a good time saver. As GaryReggae points out, it isn't free — though you could download the 60-day free trial version and see whether that works for you. I think the trial lets you print. Comet Tuttle (talk) 18:18, 9 November 2009 (UTC)[reply]

Thanks, although I've tried mail merging in the past, and together with your comments above I suspect that it would be quicker to do it the way I've done it in the past. Isnt there a better way to do this? I may have given the wrong impression above - the addresses I have to write to are new addresses, not routine addresses. 92.27.67.136 (talk) 22:32, 9 November 2009 (UTC)[reply]

Since it's only five addresses, why don't you just use Word (or the OpenOffice equivalent, or whatever) to write the first copy, then copy and paste it 4 times, and then manually make your minor changes to the other 4? Comet Tuttle (talk) 00:29, 10 November 2009 (UTC)[reply]
D'oh! 89.243.191.11 (talk) 17:50, 10 November 2009 (UTC)[reply]

I still have not found any suitible software to do this. Possibly a light-weight word processor might do it: the ones that can do mail-merge, are free, and operate in Linux or Windows are: AbiWord, KWord, IBM Lotus Symphony, and Open Office. Open Office is not light-weight though, have not investigated the others yet. Update: "form letter" seems to be American english for this, and searching for that finds the Form Letter Machine, a donationware program. 89.240.203.81 (talk) 14:10, 14 November 2009 (UTC)[reply]

Virtual LED vu meter

edit

I want a program that displays the sound on my computer like this. I'm using windows 7 —Preceding unsigned comment added by 82.43.89.85 (talk) 15:14, 9 November 2009 (UTC)[reply]

[1] Works on XP, not tested on 7. F (talk) 00:53, 10 November 2009 (UTC)[reply]
Doesn't work in 7, it keeps saying it can't detect a sound card. —Preceding unsigned comment added by 82.43.89.85 (talk) 10:40, 10 November 2009 (UTC)[reply]

executable decompiler

edit

Does anyone know of a decompiler that decompiles executables and shows me the source code and allows me to edit it and export another exe? I've searched the internet but none of the products I've found mention these features. -- penubag  (talk) 16:37, 9 November 2009 (UTC)[reply]

I'm not an expert by any means but I suspect the answer is no, as EXE files can be created by many different applications, programming languages and formats - Flash animations can be EXEs, Visual Basic and C++ applications use different types of code but can both create EXEs, there are also many propriatery applications that can create EXE files. Hopefully somebody more knowledgable about the subject will be able to shed further light on this for you. GaryReggae (talk) 16:48, 9 November 2009 (UTC)[reply]
You can get back to assembly code (or other high-level code) with a disassembler. But it's automatically generated code based on the machine code - it's not the code that was used to create the .exe in the first place. That means it's hard to read. Some .exe files contain symbols, which will help, but most commercial software will not have that. --h2g2bob (talk) 17:43, 9 November 2009 (UTC)[reply]
(EC) No such program can work in the general case, since after a program has been stripped parts of the source code (local variable names, for example) are simply not stored. There are many other difficulties that will make it a major project to understand any reasonably large project after decompilation. See decompiler, and the info pages for dcc and Hex Rays. --Sean 17:46, 9 November 2009 (UTC)[reply]
To paraphrase what has been said above, many tools will give you a source code, which will be functionally equivalent to the executable program; but it is generally not possible to reconstruct the exact source code which was originally used to build that binary program. The most obvious issue is that the variable-names will probably be machine-generated; but other details like certain flow-control constructs and most data structures and some program flows will be generated via disassembly - functionally equivalent to the original structures, but not at all easily usable or understandable to a human. Nimur (talk) 18:06, 9 November 2009 (UTC)[reply]

Thank you all for your answers; you've clarified for me how these things actually work. Do any of you recommend any specific decompiler for me to look into. I have a Windows so the linux applications above won't run. -- penubag  (talk) 02:09, 10 November 2009 (UTC)[reply]

Stupid Server Question

edit

Forgive my ignorance... but suppose I set up a simple server (using Ubuntu Server) on a home LAN, and I use the Samba fileserver program to set up shared folders and whatnot.

What exactly stops random Internet users from discovering and accessing files on my server just as they would on an Internet server?

I'm pretty new to networking, and I'm trying to figure out waaaay too many things at once, so any help would be appreciated. Aylad ['ɑɪlæd] 17:51, 9 November 2009 (UTC)[reply]

Your question is a smart one. If you have a router with firewall and NAT abilities, as most consumer routers now do, then when a bot on the Internet pings you to find out what ports are open at your IP address, the bot will get silence in return, thanks to the router. It won't be able to send any packets to your Ubuntu server. ShieldsUP, at www.grc.com, is a great tool you can use to ping your location and tell you whether you're visible from the outside or not. You don't have to install anything; just find the ShieldsUP web page, and tell it to probe your ports. Comet Tuttle (talk) 18:07, 9 November 2009 (UTC)[reply]
Awesome, thanks. Aylad ['ɑɪlæd] 18:10, 9 November 2009 (UTC)[reply]
Also, Samba has an authentication system, and several different levels and types of security. The Samba HOWTO for security explains how to set this up. In this case, even if a random user does penetrate your firewall and discover that you have a Samba service running, they can still be denied access to it. Depending on your needs, multiple levels of security are often advised (e.g. firewall + internal authentication); this redundancy helps mitigate security threats. Nimur (talk) 15:46, 10 November 2009 (UTC)[reply]

Adding something to XP's right-click contextual menus

edit

Used to be, on my Windows XP machine, when I right-clicked in a folder and moused over the "New >" item, I could create a new .txt (notepad) document. Now that option is missing. How do I add it? Comet Tuttle (talk) 18:09, 9 November 2009 (UTC)[reply]

Unfortunately I have forgotten if these items are stored in the registry or in the file system. However, I do remember that the "Send To" items are stored at
C:\Users\Andreas Rejbrand\AppData\Roaming\Microsoft\Windows
(replace my user name with your own), at least in Windows Vista. It is possible that the "New" items are stored somewhere near this directory as well. --Andreas Rejbrand (talk) 19:26, 9 November 2009 (UTC)[reply]
I am actually quite sure that they are stored in the file system. Indeed, when you select a "Create New" item you get a copy of this template in the current directory. --Andreas Rejbrand (talk) 19:27, 9 November 2009 (UTC)[reply]
It really should be
C:\Users\Andreas Rejbrand\AppData\Roaming\Microsoft\Windows\Templates
I think, but strangely enough, my folder is empty (as is the "All Users" quivalent). --Andreas Rejbrand (talk) 19:32, 9 November 2009 (UTC)[reply]
See http://www.extremetech.com/article2/0,2845,1838907,00.asp ---— Gadget850 (Ed) talk 19:49, 9 November 2009 (UTC)[reply]
That extremetech article was interesting — TXT was not listed as a "registered file type" on my machine — but it doesn't explain how to modify the right-click context menu to add the ability to make a new text file. It just talks about how to add the ability to run an app (Outlook, in the example given) with the selected file as a parameter. Comet Tuttle (talk) 20:36, 9 November 2009 (UTC)[reply]
Provided you have your folders set up to show full filenames, you could right click and make a new anything and then simply rename it to XXXX.txt as a work-around. 218.25.32.210 (talk) 03:03, 10 November 2009 (UTC)[reply]
This had actually never occurred to me! You're correct! Thanks! I'll give it a try. Comet Tuttle (talk) 05:19, 10 November 2009 (UTC)[reply]

Simple Java Counter

edit

I am trying to write a simple program in java that increments or decrements a counter when certain keys are pressed. It is not a graphical program, it is just in the command line. What method can i use to take use the pressing of a key, and how can it be used? Thanks —Preceding unsigned comment added by 81.132.142.60 (talk) 19:48, 9 November 2009 (UTC)[reply]

There are many ways to get keyboard input in Java. Since you have a command line program, with no graphical interface, your usage does not fit into the normal Java pattern of creating a Key Listener and attaching it to your graphic window. You can try to fit that design model on to your needs, but you might also want to consider using the Java System.in (equivalent to stdin in the C language). You can poll this - I am guessing you are a novice programmer, so you may opt for this simple design - but you should know that it is inefficient because it relies on a busy wait. Your main program would thus contain a while-loop and attempt to read from System.in. A better (but much more complicated) method would be to attach the Standard Input (System.in) to an event-listener or an asynchronous stream reader in the java.nio package. What is your ultimate goal - a quick test program, or a deployable, maintainable code? Nimur (talk) 00:37, 10 November 2009 (UTC)[reply]
It is just going to be a simple test program to try and get a simple program working with Java. Ideally i would want it to increment when a key, such as i, is pressed, without having to press enter aswell. Would the busy wait thing involve pressing enter after every increment or decrement key pressed? —Preceding unsigned comment added by 81.158.11.134 (talk) 13:36, 10 November 2009 (UTC)[reply]
Technically, that "feature" (requiring an enter after input) is a detail of your console, Windows command prompt, or linux terminal emulator. (It is unfortunately not a feature of Java, so within your code, you can't do much about it). Before your keystrokes get to your Java program, they are "owned" by your terminal or console - and the console gets to decide what to do with the individual keypresses. Apparently, your terminal is set up to buffer its input by lines and waits until it sees a "\n" before actually sending the data to stdin of the program. (See this forum-posting for similar trouble). For this reason, Java's preferred method is to create a Swing GUI and attach it to a KeyListener. This guarantees that your keystrokes are never owned by any other program; and you can process them immediately. If you specifically do not want a GUI, you will need to find a platform-specific way to reconfigure your terminal so that it doesn't buffer its input; or use a different terminal emulator.
At this point, I expect that the C-coders are probably starting to lug out the anti-Java propaganda; "why is it so hard to read one character!? I do that all the time with getc(stdin); but while C programmers may be familiar with a getchar() similar "unbuffered" single-character read from the terminal, they may be unaware that they are actually compiling a macro down to system-code for a platform-specific routine that will interfere with the operating-system's normal I/O handler. So, the "detail" that the terminal is buffering its keystrokes is often overlooked because you are overriding the system I/O handler. This also leads to numerous programming pitfalls. (Ultimately, C is a system-programming language, and you can compile code which does anything with C, circumventing any operating-system conventions which are not protected by special hardware-modes). Java forces you to properly follow the rules laid out by the operating system specification - and not to steal other programs' keystrokes until those programs politely hand them to you. This includes keystrokes in the terminal.
This is probably more than you wanted to know about buffering, terminals, and so forth; but remember that Java is a platform-independent language specification and so it must handle a huge range of different methodologies and conventions. (Not only Windows/Mac/Linux, but also Symbian, AIX, QNX, eCOS, J2ME, VCR RTOSes, ... these systems will break your average C programmers' conception of "terminal" and "stdio" convention). Again, Java's platform independent mechanism is to create a Swing GUI and keep your I/O operations in there. The KeyListener interface is very simple and extremely platform-portable. Nimur (talk) 14:58, 10 November 2009 (UTC)[reply]
In C, getc(stdin) and getchar() are buffered, OS-legal operations, just like in Java. If the OS is using buffered input and not sending characters to stdin until Return is pressed, then getc(stdin) and getchar() won't be able to read them until Return is pressed. This is a common question from newly starting C programmers as well. It is true that most OSes provide a C interface to bypass the buffering and actually read the keystrokes directly, but then you're no longer being OS-legal, and your code is intimately tied to a specific version of an OS. Although the interface is written in C, it's actually part of the OS itself, not part of C. (Most new C programmers can't actually understand the difference.) So you have the right idea all along in your reply, it's just that the example functions you mentioned don't illustrate your point. JIP | Talk 18:49, 10 November 2009 (UTC)[reply]
Thanks for the correction... subtle but important point. Even I got tripped up by it... Nimur (talk) 19:17, 10 November 2009 (UTC) [reply]
I really don't see what this has to do with system independence. getchar() ultimately calls read() on Linux and ReadFile() on Win32. A function to set raw console mode would ultimately call tcsetaddr() on Linux and SetConsoleMode() on Win32. What's the difference? Standard C and Java could have provided raw-mode-setting functionality in a platform-independent way. Not every platform supports raw mode, but, as you said, not every platform has a console to begin with, and not every platform supports Swing. Java doesn't abstract away every difference between machines. It could perfectly well have allowed you to set raw mode on platforms where that makes sense. -- BenRG (talk) 01:19, 12 November 2009 (UTC)[reply]
That's a good point. When you come to think of it, it feels like there's no reason for standard C to define setrawmode() and setcookedmode() functions. setrawmode() would feed every single keypress to the program, both allowing and forcing it to react to them instantaneously, while setcookedmode() would make the OS responsible for formatting an entire line, which was then fed to the program. It would then be the programmer's choice between having full control over every single keypress, and not having to care about whether the user has made a typo and wants to repair his input before sending it to the program. The functions would even have had return values, where if raw mode was simply not supported, a call to setrawmode() would have returned an erroneous status code and remained in cooked mode. JIP | Talk 20:44, 12 November 2009 (UTC)[reply]
Source code for a simple System.in poll
public class Poll {

public static void main(String[] args) throws Exception {
 char c;
 while((c = (char) System.in.read())!='q') {
  System.out.print(c);
 }

}}
Here is a slightly more elaborate scheme, showing a Java command-prompt reader. Nimur (talk) 00:47, 10 November 2009 (UTC)[reply]

How can I safely view a phishing scam site?

edit

I just got an e-mail purporting to be from a major bank which I don't have an account with. It claims that errors were discovered on my account and that access to my account will be restricted until I've corrected the errors. It's obviously a phishing scam. Clicking the e-mail's link appears to send you to pop zelda dot com. (I Googled and Binged the site, but didn't find anything relevent.) But I'm curious to see how the phishing site works. How can I safely browse the site? As long I don't enter any personal information, am I safe (i.e. can they access my history, bookmarks, autocomplete info, etc.)? I supposed I can create a Virtual PC with a freshly installed version of Windows, download all the security updates and turn off JavaScript, or is that overkill? 12.165.250.13 (talk) 21:19, 9 November 2009 (UTC)[reply]

If you don't enter in anynformation, they probably cannot detect anything. They cannot access your history or bookmarks. They probably cannot access your autocomplete, but it would be an interesting trick to try and get the browser to enter it into a form and then submit it (I'm not sure it can be done, but it's the only thing that seems within the realm of possibility). I am not sure you could get much information from looking at the page itself—it will at the most minimal just be a false front, at most be a complicated man-in-the-middle (e.g. they take your information, "log in" as you on the other site, and then send you the information that you would normally see). If it were me, I would view it with a non-Windows machine, first off, and secondly, I would use the "privacy mode" in Firefox that uses no cookies or autocomplete, and I would probably turn off Javascript too, just to be safe. --Mr.98 (talk) 21:25, 9 November 2009 (UTC)[reply]
The safest way to do things is to have two computers, a "secure" one that you never use to browse random sites, much less ones like this, and an "unsecure" computer you use to browse such sites, but never enter any personal information into. No names, no account numbers, nothing. In this case, there is nothing to steal. Obviously, make sure the secure and unsecure computer are not connected in any way. It might be a good idea to put one on DSL and the other on dial-up, so they don't share a network, either. StuRat (talk) 00:04, 10 November 2009 (UTC)[reply]
You could just virtualize the OS, though—you don't really need an entirely "clean machine" to do that, I don't think. Even in that case, I think with something like "privacy mode" in Firefox (or Safari, or whatever), there is no chance of them having access to your personal data, esp. if you are not using IE. --Mr.98 (talk) 01:22, 10 November 2009 (UTC)[reply]
Note that by just visiting the link you will confirm to them that your email address is accurate and someone is reading it. You may get more spam that way.F (talk) 00:50, 10 November 2009 (UTC)[reply]
You would want to strip out all of the GET variables that are passed in the url (so if it is http://fakesite.com/?id=2asd8asd8asdas you'd cut everything after the last slash, before the question mark), to avoid this. That's probably a good idea even if you aren't worried about getting more spam. --Mr.98 (talk) 01:22, 10 November 2009 (UTC)[reply]

linux's ping -M dont/want options

edit

Google doesn't seem to help much. The man pages neither. I understand that do can help me discover a network's MTU because if I set the packet to be too large I'll receive an error, but I don't get much information with the other two, it just pings normally. Help! --Belchman (talk) 21:43, 9 November 2009 (UTC)[reply]

Android and Linux

edit

Is it possible to install Android onto a mobile internet device (Archos 5G) that comes with Linux? Android is free, but where does one get it? Thanks if you can enlighten. —Preceding unsigned comment added by 83.98.238.113 (talk) 23:20, 9 November 2009 (UTC)[reply]

You might want to start at Android (operating system) to get an overview of what Android is and isn't and to find links to the official sites. Aside from that, it seems that Archos has released a model called the Archos 5G Internet Media Tablet, which already runs Android. If you have a different 5G (nice of them to confuse us by re-using model names), then you'd probably either have to find where somebody has already compiled a version of Android for that device, or modify and compile it yourself. --LarryMac | Talk 15:07, 10 November 2009 (UTC)[reply]