Wikipedia:Reference desk/Archives/Computing/2012 July 14

From Wikipedia, the free encyclopedia
Computing desk
< July 13 << Jun | July | Aug >> July 15 >
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.


July 14[edit]

Viruses/Malware and most likely targets[edit]

I was wondering if there were particular pieces of software or certain companies that were most prone to virus attacks. I am struggling to find exact wording of this question to make it clear, but i will provide a couple of examples.

I have been told that users of windows get attacked much more often than users of linux or such. Reasons for this that ive heard are:

- Many people capable of making such attacks use/prefer linux, and hate microsoft for various crappy decisions theyve made over the years - More people are using windows, bigger victim pool. - Windows has many different protocols that allow programs to communicate with eachother, causing many loopholes and vulnerabilities that linux just doesnt have.

I do not claim massive accuracy to these reasons, they are just things i have heard, as i dont know a terrible ton about the topic.


Also, i confess that at the moment i have a setup at my house where the only thing available to me is AOL Dialup. I hear many similar things about AOL, how people hate it and that its basically the most unreliable most expensive dialup there is. For similar reasons, are users of AOL more targeted than the average user?

NOTE: This is NOT about how to avoid attacks. I don't do anything silly like go to shady websites etc etc. I'm just asking about what programs have properties that lend to high rates of attacks, and perhaps, how someone theoretically making a virus chooses their target/method. I know this is a huge topic, but id like whatever insight can be given. Am i correct to some extent about windows/AOL?

Thanks! 216.173.145.47 (talk) 00:09, 14 July 2012 (UTC)[reply]

Unfortunately, having downloadable programs be easy to use and useful makes them vulnerable. For example, if it automatically downloads new versions onto your computer and changes all your configuration files to make it work best. StuRat (talk) 00:19, 14 July 2012 (UTC)[reply]

So, somehow, auto configuration makes it worse? or is it the fact that it downloads without user consent, which can somehow be exploited?

PS: I find this funny since AOL's slogan is "So easy to use, no wonder its #1!".... although i find it bloated and only easy to use if youre not pc literate and dont know that there is better out there :o </side comment> 216.173.145.47 (talk) 00:26, 14 July 2012 (UTC)[reply]

The number of installations is obviously a factor. Besides that, culture is important. Linux inherited some nice features of the unix culture, such as "don't do stuff as root without a good reason" - which was already deeply ingrained before Windows even had the concept of a non-privileged user.
Not only are the Windows installations more abundant, they are also less diverse (see monoculture (computer science) - oh, there's a stub that needs expanding) which means that attackers have to do less work to capture a larger slice of the target population.
Bug count comparisons aren't as important as the cultural differences and the abundance of near-identical targets. 98.226.12.79 (talk) 09:34, 14 July 2012 (UTC)[reply]
Here are my two cents-
  • windows is closed source - loopholes are harder to find (compared to linux / FOSS) but still accessible to a determined hacker. Once found, these are reported and closed less effectively. (Security through obscurity)
  • Bigger target pool in desktop users.
  • see [1]. Linux traditionally is harder to use. It does not try to be idiot proof. Instead many simple operations require quite a bit of understanding and tinkering to carry out. This makes the average linux user more tech savvy and more security aware than the average windows user. I think that this is the most important reason for the lack of linux/Free BSD malware despite most servers running them. sysadmins and hackers won't engage in risky computer behaviour and will immediately recognize most malware. (now this is changing though)
  • Then there are other strong points- applications are restricted to a tiny subset of files (apparmour /SELinux) to prevent a hacked app from reaching a users other files. (e.g. a pdf reader can only access one pdf file per instance). Hacked user apps cannot attack other users or the OS by having security clearance required at every file access, etc.
Staticd (talk) 10:56, 15 July 2012 (UTC)[reply]

Firefox Tabs issue involving scrolling through tabs[edit]

On firefox, i notice an issue that occurs sometimes when i have enough tabs at the top that i have to scroll through them (there will be left and right scroll buttons next to the tabs)

I generally have alot of tabs open, and i recall one time where i had as much as 40!!!! But this issue has occured when ive had as little as 12 or so tabs open, so im thinking its not that i max out my memory use or reach some sort of limit of the firefox browser.

Anyeay, the issue im having is that when i create a new tab, it sometimes doesnt show up on the right side. Its there, but i have to click a random tab, click "scroll tabs right", click a DIFFERENT tab, scroll again, etc, until the right most tab is fully shown. (Each time i click scroll right, it only scrolls part way over). It sometimes goofs up even more, to where if i want to scroll in either direction at all i have to use the same method.

Is this a known firefox bug for an earlier version? (Will updating to latest version fix this?) What the hell is causing it in the first place? Any thoughts?

Thanks! 216.173.145.47 (talk) 00:22, 14 July 2012 (UTC)[reply]

I have a workaround for you: Open a new window once in a while, and only have up to a dozen tabs in each window. You could have one with games, one with Wikipedia pages, etc. And, of course, try to have fewer total tabs open. (I find it hard to believe you were actually using all 40, and that will just use more resources and slow down you computer.) Also, as a practical matter, finding the tab you want when there are that many can be painful. StuRat (talk) 00:47, 14 July 2012 (UTC)[reply]
If you are really attached to using lots of tabs (as I am) you might find the firefox extension Tree Style Tab [2] useful - this presents your tabs at the side of the browser and allows you to collapse/rearrange groups of tabs. I often find myself needing to have 50+ tabs open since I receive articles from academic journals as RSS feeds, and go through them opening the articles I'm interested in for further skimming. I find it much more efficient to avoid multitasking by going through the whole list first and then going through the interesting articles afterwards - I find that this extension makes working with even that many tabs really easy. Equisetum (talk | contributions) 11:56, 16 July 2012 (UTC)[reply]

There's a pref (or two?) in about:config somewhere where you can configure the width of tabs so they collapse farther down (like to the size of the webpage shortcut icon only) instead of taking up so much space... IIRC this was the old default behavior or close to it, and I've always reverted back to it. Otherwise I'd also suggest tree style tab. ¦ Reisio (talk) 02:18, 17 July 2012 (UTC)[reply]

Your Amazon.com password has been changed[edit]

I got following message supposedly from Amazon:

"Hello Osman Rafi,

This is an important message from Amazon.com

At Amazon we take your security and privacy very seriously. As part of our routine monitoring, we discovered a list of email address and password sets posted online. While the list was not Amazon-related, we know that many customers reuse their passwords on several websites. We believe your email address and password set was on that list. So we have taken the precaution of resetting your Amazon.com password. We apologize for any inconvenience this has caused but felt that it was necessary to help protect you and your Amazon account."

The message goes on recommending me that I go to amazon.com and change my password. It looks like a phishing scam, but, the amazing thing is that there was no link in the email and no attachment. So, how does the scam work? OsmanRF34 (talk) 00:51, 14 July 2012 (UTC)[reply]

I think this is probably legit, as a large list of passwords was recently leaked (from Yahoo), and googling parts of the text of this message suggests that Amazon used it legitimately before after a similar leak (from Gawker). In any case, you should be able to find out if it's true by going to amazon.com and trying to log in. -- BenRG (talk) 02:09, 14 July 2012 (UTC)[reply]
I was afraid of going there because I thought my browser might be compromised, and they were trying to trick me into going to a site were I would have to type my password. But no. In the mean time I discovered that Amazon indeed is sending this email, since Yahoo passwords were compromised. Were it phishing, it would have been the first phishing message without spells on my whole life. OsmanRF34 (talk) 03:20, 14 July 2012 (UTC)[reply]

MS Office 2010[edit]

I have many documents created using MS Office 2000 Word and Excel. If I install MS Office 2010 Word and Excel on my computer, will I still be able to view and edit these documents using the new software? Also, will the installation automatically remove MS Office 2000 from my computer or can I keep this as well, in parallel with MS Office 2010? Grateful if anyone could advise. Thanks — Preceding unsigned comment added by Jandmtaylor (talkcontribs) 08:17, 14 July 2012 (UTC)[reply]

The 2000 docs are almost certainly readable under 2010. However, it is possible that, if you read them in 2010 and store them again, they will no longer be readable by MS Office 2000. StuRat (talk) 08:27, 14 July 2012 (UTC)[reply]
Microsoft Word and Excel 2010 are backward compatibel with 97-2003 file formats and features. That's the official version. In the practice, some things can look strange. OsmanRF34 (talk) 17:17, 14 July 2012 (UTC)[reply]
Note though that depending on your operating system, some functionality may be broken. New versions of Office for Macs, for example, no longer support VBScript, completely breaking all backwards support for spreadsheets or documents that require it.
I have, in the past, been able to store multiple versions of Office on a Mac without any difficulties. I don't know about Windows, though — if they share Registry settings it may create conflicts. --Mr.98 (talk) 17:25, 14 July 2012 (UTC)[reply]

Simple program in C++[edit]

I am trying to write the simplest opf programs in C++. All I want to do is get the program to request two inputs 'a' and 'b', add them output 'The sum of a and b is [a+b].' but the build fails every time I try it.

#include <iostream>

#include <string>

using namespace std;

int main ()

{
    int a;
    int b;
    
    cin >> a;
    cin >> b;
    
    int c;
    c=a+b;

    cout << "The sum of "<< a <<" and "<< b <<" is "<< c << "."<< endl;
    
}

Can someone please have a look at the code above and see if he or she can spot an error? Thanks. meromorphic [talk to me] 20:12, 14 July 2012 (UTC)[reply]

That looks fine, and works for me. Are you sure you're compiling it with the compiler in C++ mode (e.g. g++ not gcc) and not C mode? -- Finlay McWalterTalk 20:43, 14 July 2012 (UTC)[reply]
If you are going to ask for help with a problem, you should report what system you are using to build the program and exactly what error message you get when it fails. Looie496 (talk) 20:48, 14 July 2012 (UTC)[reply]
I am extremely new to programming in C++ and to using Xcode (in fact, prior to a few days ago I'd only ever used Matlab) so it's difficult for me to know what's what at the moment. For example, I don't know how to put it in the 'mode' (or whatever the term is) that is appropriate for my programming needs, i.e. that would make my code work. Would someone please direct me? meromorphic [talk to me] 21:04, 14 July 2012 (UTC)[reply]
Okay, you're using Xcode. That's a start. What is the error message you get when the build fails? Looie496 (talk) 21:14, 14 July 2012 (UTC)[reply]
(At all stages, please bear with me since I may give the wrong answer to seemingly obvious questions.) Xcode identifies no errors with the code but when I click on the 'play' button, it says 'Build Failed' and an exclamation mark inside a red octagon appears. When I click on it, on the LHS it says 'Dependency Analysis Error'. On investigating this, it tells me 'Build setting PRODUCT_NAME undefined'. I can't see anything else that might be of use in diagnosing the problem. Is this helpful? meromorphic [talk to me] 21:29, 14 July 2012 (UTC)[reply]
Yes, it means the problem is not in this C++ code, but in some other stuff Xcode wants you to set up so that it can create an interface for your program. Not having ever used Xcode, I can't help you with that, but maybe somebody else can. If I were facing this problem, I would hunt around for something that says "Product name", but of course I really don't know whether that would be useful. Looie496 (talk) 21:45, 14 July 2012 (UTC)[reply]
My personal prejudices militate against using an IDE (although I've never used Xcode), but simply using the tools from the command line. This Stackoverflow question shows the command-line options for using g++ to compile C++ on MacOS. -- Finlay McWalterTalk 21:48, 14 July 2012 (UTC)[reply]
Thank you for your link but please don't forget how new I am to all of this; of the three suggestions on that page, which one do I want and where exactly should it go in my code? And do any alterations need to be made to what I have currently? I've tried all three at the top of my code, to no avail. meromorphic [talk to me] 21:57, 14 July 2012 (UTC)[reply]
THe operant point is that your code is fine, but the way you're compiling it is the problem. That code simply has you invoking the command line C++ compiler directly (g++ yourcodefile.cpp). So you'd do that using a terminal window. But it looks like Looie496's suggestion should fix the particular problem you're having in this case. -- Finlay McWalterTalk 22:05, 14 July 2012 (UTC)[reply]
A quick Google search for the error message (always a good thing to try) yields the following answer: You need to modify the Product Name build setting. Set the product name to what you want the application name to be. The Product Name build setting is part of the Packaging build settings collection.. Looie496 (talk) 21:51, 14 July 2012 (UTC)[reply]
In other words, you missed a step when setting up the project. Consult the Xcode "Getting Started Guide" here: Start a Project for future reference. To fix your current project, type "Command 1" and select your project (which should be towards the top on the left) and edit your build settings, ensuring that your product name is correctly set and is valid. Again, reference Project Editor Help, Edit Basic Settings for Mac OS X Projects. (For the other readers, "product name" would equate to the argument -o output.x, were one to invoke the g++ compiler on the command line; of course, in Xcode, the product might not be a compiled binary, or might not use g++, so this more general interface automates the build configuration and generates the correct output, invoking one or more compile or build steps suitable to the product or target type). Nimur (talk) 23:16, 14 July 2012 (UTC)[reply]
OK, that seems to have made it work. Thank you all for your help. I now have a new, and, no doubt, equally simplistic, problem though. Where am I supposed to enter the value of 'a' and 'b'? When I run the code, it says 'Build Succeeded' and I think it's waiting for me to input the respective values but I don't know where/how to do so. Any ideas? I'm working in Xcode remember. Thanks. meromorphic [talk to me] 10:02, 15 July 2012 (UTC)[reply]
While I do develop on a Mac, I don't use XCode, but rather traditional UNIX tools. So take the following with a grain of salt. What you have done is build a program that reads from stdin and writes to stdout. These are I/O streams from the world of text terminals, and are by default connected to your "controlling terminal" (in practice usually the text terminal you run the program from). XCode seems to run your code in gdb, the GNU Debugger. You can access its text streams if you click on the little icon labelled "gdb" that appears when you click "Build and run". Alternatively, go to where you saved the project and run the program from the terminal: Open a terminal, enter "cd Documents/adder/build/Debug/ <return> ./adder <return>" (this assumes that your project is stored in "Documents" and is called "adder" - substitute as necessary. --Stephan Schulz (talk) 11:17, 15 July 2012 (UTC)[reply]
I can't see the gdb button (no extra buttons appear when I click 'Build and Run', at least for my setup of Xcode) and when you say terminal, do you mean the program 'Terminal' that comes as standard with a Mac? I'm also a bit confused by this suggestion; is debugging necessary? I thought I only needed to find a way to enter the values of the variables 'a' and 'b'? meromorphic [talk to me] 15:33, 15 July 2012 (UTC)[reply]
Review this document, Xcode Basics: Building and Running Your Code. Make sure that your selected scheme is configured to properly run your program. (If you missed a step during project setup, as I suspected earlier, you might also need to manually edit your scheme with the correct settings). Finally, check the Debug Area, where your program's standard in and standard out area (as well as debug information) will be displayed.
Alternately, as has been suggested, you can build your program and then launch it outside of Xcode, using the Terminal. Option-click on the build-product and "show in Finder." Navigate to that folder in terminal, and run the application.
Strictly answering your question: you do not "need" to debug your program. However, unlike the raw unix-style command-line tools, (where you either ran a debugger, or you did not)... Xcode's distinction between "running" and "debugging" lies along a continuous spectrum - especially if you are compiling with the llvm toolchain. Advanced programmers - see LLVM Compiler Overview.
As you are no doubt finding, Xcode's toolset is geared to the professional developer's workflow for developing Mac and iOS applications on OS X. It is fair to say that your "Hello World" program could be written, built, and executed, all without using Xcode, and would probably save you some difficulty. But, some day, you may progress past Hello World, and if you design application software, you may find the Xcode toolset very helpful, once you get above the early-stage learning curve. Nimur (talk) 18:19, 15 July 2012 (UTC)[reply]
[I can but hope that the rest of C++ is less complex than setting it up appears to be.] Ok, I have managed to change the debugger from LLDB to GDB. And, if I pause the program whilst it's running by clicking on the pause button at the top of the debug area, the 'Local' variables are displayed as 'a = (int) 0', preceded by a blue box with a white capital 'l' inside (and the same, respectively, for 'b' and 'c'). I still can't see how to enter the values of 'a', 'b' and 'c' though. I have looked at the documents that have been linked in to this thread but I am an extremely basic programmer and I find them confusing. I'm afraid to say that I am just not experienced enough to know what to do. Can anyone offer any more help? meromorphic [talk to me] 10:21, 16 July 2012 (UTC)[reply]

You said that you can press the pause button and see local variables...which means the program is running somewhere. It's likely that as a novice you don't exactly know where...so the problem might be is that because your program doesn't provide any output before it takes input, you might not "see" it running...it might look like an empty new line in one of the windows. Try the following...you should see "This is a simple addition program." in one of the windows:

#include <iostream>
//#include <string>//not needed yet

using namespace std;

int main ()
{
    //declaring uninitialized variables
    int a, b, c;

    cout << "This is a simple addition program." << endl;

    //Get value a
    cout << "Enter value for a: ";
    cin >> a;

    //Get value b
    cout << "Enter value for b: ";
    cin >> b;

    //Set c to sum of a and b 
    c = a + b;

    //Output result
    cout << "The sum of " << a << " and " << b << " is " << c << "." << endl;

    return 0;
}

Also, C++ is challenging...it's usually not used by novices anymore. Is there a particular reason you want to start learning programming with C++?Smallman12q (talk) 13:07, 16 July 2012 (UTC)[reply]

As Nimur has pointed out: The main problem is not C++ in this case (though that does have its own unspeakable depths), it's that XCode is not geared to make the first simple steps for a very simple program very simple - XCode is geared towards efficient development of complex programs, mostly using Apples large libraries and GUI frameworks. If you have the experience with tools, you can develop command line programs (I managed to figure it out ;-), but its not as simple as typing "g++ hello.cc; ./a.out" anymore, in particular since XCode does not offer an obvious terminal into which to type these things... --Stephan Schulz (talk) 15:51, 16 July 2012 (UTC)[reply]
Thank you so much Smallman! It is finally working. Thanks to everyone who helped, indulged and had patience with me throughout this protracted saga! Happy Editing! meromorphic [talk to me] 19:19, 16 July 2012 (UTC)[reply]
Resolved
 – Happy to help out.Smallman12q (talk) 21:43, 16 July 2012 (UTC)[reply]