Jump to content

Wikipedia:Reference desk/Archives/Computing/2010 August 13

From Wikipedia, the free encyclopedia
Computing desk
< August 12 << Jul | August | Sep >> August 14 >
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.


August 13

[edit]

C Storage

[edit]
#include<stdio.h>

int  i,j;
void main()
{
 i=10;j=20;
 printf("%d %d",i,j);
}

In the above program,i and j is which type of storage class? —Preceding unsigned comment added by 122.164.62.189 (talk) 04:43, 13 August 2010 (UTC)[reply]

Take a look at C syntax#Storage duration specifiers. In the example above, no explicit storage class is specified, so it defaults to auto(Oops - see below.). For further information, I suggest you search the web for the term "storage class tutorial". There are many good tutorials out there. -- Tom N (tcncv) talk/contrib 05:04, 13 August 2010 (UTC)[reply]
i and j are not automatic variables, since they're declared outside the function. They have static storage duration and external linkage. I'm not sure what their storage class is because the C standard (actually, the N1124 draft) doesn't seem to define the term "storage class". It does define "storage-class specifier", which is one of extern, static, auto, register, or typedef (with typedef not really belonging, according to the text). Furthermore, it uses the term "storage class" in the following combinations: "register storage class", "register storage class", "storage class extern", "storage class auto or register", and "automatic storage class". Perhaps "storage class" means the storage-class specifier that appeared in some declaration, with one possibility being "none". But that can't be right because 6.8.5.3 says "The declaration part of a for statement shall only declare identifiers for objects having storage class auto or register", and most declarations in for statements use neither keyword. So the next guess is that, in the absence of an explicit keyword, you use the "default". But there is no valid default for the declaration of i and j. The only storage-class specifier you can add there without breaking the program is static, but that's obviously not right. I can only assume that i and j are supposed to have storage class extern, but I don't see how to justify that assumption from the text. This all seems like remarkable sloppiness on the part of the committee. The correct solution, as far as I can tell, is to replace "storage class auto" with "automatic storage duration", "storage class extern" with "external linkage", and "storage class register" with "declared with the register storage-class specifier" (a phrase which already appears elsewhere in the text). Then the answer to the original question is "there's no such thing as storage class". -- BenRG (talk) 06:35, 13 August 2010 (UTC)[reply]
static makes sense from the point of view that static and global variables have a default initial value of zero, auto variables have no default. --85.77.208.239 (talk) 12:16, 13 August 2010 (UTC)[reply]
This is indeed a very difficult question to answer because of the issues outlined by BenRG. I think a more relevant question would be: "What is the storage duration of i and j", to which the answer is "they both have static storage duration". decltype (talk) 21:37, 18 August 2010 (UTC)[reply]

Shell for Windows

[edit]

Is there a Unix shell compiled for Windows that has been modified to not use spaces as delimiters and Windows paths so paths with spaces can be used optimally. ( Ex.: Bash modified so it doesn't things like give errors like "$ bash: cd: C:\Program is not a directory" after I enter something like "$ cd C:\Program Files". --Melab±1 04:55, 13 August 2010 (UTC)[reply]

The standard solution is to use double-quotes to demarcate your file-names. It would be very difficult to design a logical and consistent shell-syntax that did not use spaces as delimiters; and though you could design a "smart" syntax that would guess when your space was part of a command-separation, and when it was part of a file-name, you can imagine the disaster that would occur when your interpreter mis-interpreted your intent. So, use the more standard:
  • ls "my long directory name"
  • cd "c:\program files\Application 1\Long Directory name"
... - this works in most shells. (In fact, tab-completion even works, intelligently and intuitively, with the double-quotes). If you are using Cygwin, there is a utility called cygpath that you will probably find useful for converting between many different styles of path-formats. Nimur (talk) 16:39, 13 August 2010 (UTC)[reply]
I'm looking for a GNU Bash or some Unix-like shell, that has been compiled for Windows, and uses Windows style directories so I don't have to resort to /cygdrive/c/whatever. --Melab±1 04:58, 15 August 2010 (UTC)[reply]
Have you tried Windows Power Shell? It accepts both Linux and Windows commands. It also accepts forward slashes and reverse slashes for paths. It does not ignore spaces, however, and I don't think there are any shells that ignore them.--Best Dog Ever (talk) 06:08, 15 August 2010 (UTC)[reply]

How to disable auto download feature in safari?

[edit]

Hello there. Currently I am using Safari as my default web browser. But I am having trouble in chatting in facebook or other social networking website. While chatting with others, browser automatically creates small sound to inform me about messages. That's normal. But the problem is, safari shows a pop up message to whether to download that sound. Each time I need to "cancel" the download and it's really annoying. I searched in option to disable that feature, but failed. Can anyone know how to disable that feature? --180.234.41.144 (talk) 10:34, 13 August 2010 (UTC)[reply]

TOC's in Category page

[edit]

Can one force a TOC in a Category: listing that spans multiple pages. Obviously the Category listing already shows A-Z, but can I make a TOC that takes one directly to the part of the alphabet they want? Any assistance on this would be appreciated Д-рСДжП,ДС 17:05, 13 August 2010 (UTC)[reply]

{{Category TOC}} and its related templates will do this. Warofdreams talk 18:04, 15 August 2010 (UTC)[reply]
Fantastic! Works like a charm! Thanks. 21:57, 17 August 2010 (UTC)

Alt-Tab didn't work

[edit]

Referring back to this question, Firefox was going crazy today. The taskbar buttons disappeared one by one and eventually there weren't any. When I tried to use Alt-Tab when two were left, it would only go between those two. Then the buttons magically started reappearing. I don't recall what made the first two come back but it was probably Alt-Tab. The other two came back on their own. Even before the second came back, I found that clicking on one of the "new " buttons twice made a page I had been on come back.

In an unrelated scenario, I was at a different college and had my choice of Firefox and Explorer, but I always choose Explorer when I get the chance. In one case, everything disappeared just after I got one of those annoying alerts about pop-up ads being blocked, where I have to click to make it go away, and if I don't know about it, it can freeze everything else. The alert said something like, "Did you notice the information bar"? Do I care? Why must you annoy me with this? And it never really went away. There was a blank box hanging around until EVERYTHING disappeared. Later, I was told Internet Explorer needed to close but not why. I can ask for an error report to be sent but it apparently doesn't go to me. At least there was a debug option in this case. Most of the time I can keep working on all other pages until everything disappears. I was able to do something similar here.Vchimpanzee · talk · contributions ·

This is a rant, not a question. Please take this elsewhere. (You have been told so before.) Thank you. -- 78.43.71.155 (talk) 18:29, 13 August 2010 (UTC)[reply]
Hey: aren't you that guy who has a bunch of worthless programs and browser add-ons installed on your computer? If I recall correctly, you refused to disable them, even temporarily, and then proceeded to complain endlessly on this page about all the minor bugs in your browser. Honestly, I've just been ignoring your complaints, as they really are trivial, and it would take a long time to type out the steps for you to take to fix the issues. Since you probably won't try anything I recommend, anyway, I figured I'd simply ignore you.--Best Dog Ever (talk) 18:31, 13 August 2010 (UTC)[reply]
I don't have any worthless programs or add-ons on my computer, and the ones that are there aren't causing problems.
For once this is about Firefox and not my computer. If you insist on a question, then I'll ask one. What causes the buttons to disappear, and why doesn't Alt-Tab work like I was told?
I was also wondering if anyone could answer what was going on with the second computer, which was also not mine.Vchimpanzee · talk · contributions · 20:52, 13 August 2010 (UTC)[reply]
So, you're not an administrator on these computers? Then, there's nothing that can be done. You need to be an administrator to fix such issues. I normally ask people to look in the event viewer for a Windows Explorer crash and then disable all the un-needed programs on their computer, but there's no point in even looking in this case.
As for the Internet Explorer crash, it's probably an issue with that web site trying to hijack your computer. But, since we don't even know what web site you're referring to, we can't even say what the issue was. There's no reason to investigate that issue, either, since you're not the web master of the site in question. I would recommend that you complain to the IT support staff for the computer lab and also to the web master of the web site in question, instead of to us. As for your assertion that the taskbar issue is unrelated to any third-party programs, I would respond that you simply don't know what you're talking about. I fix issues like this every day, and you don't.--Best Dog Ever (talk) 21:19, 13 August 2010 (UTC)[reply]
I suppose I could ask the people in charge of the computers at these various libraries, but when I said third-party programs didn't cause taskbar problems, I was referring to my computer. This hasn't happened lately. When the buttons did disappear on my computer, it was usually something related to copying and pasting in an email causing weird behavior, which I have reported here, or the cursor turning into a circle that just rotates and rotates. If these were related to third-party programs, I don't know. No one was ever able to tell me what could be going on.
How do I get to the event viewer if it happens on my computer?Vchimpanzee · talk · contributions · 21:25, 13 August 2010 (UTC)[reply]
You know, actually, there might have been stuff I could use when I clicked on "Debug". I was just so focused on saving what I was afraid I'd lose. I think there was a specific error message of some kind but I couldn't figure out what to do with it.Vchimpanzee · talk · contributions · 21:30, 13 August 2010 (UTC)[reply]
To get to the event viewer, you go to Start --> Control Panel --> Administrative Tools --> Event Viewer and then click on "Application" or "System," then look for errors. (They have red icons.) Honestly, though, I usually just skip that step nowadays and just start removing programs from startup (Start --> Run... --> msconfig --> startup), since 99% of the problems seem to be caused by third-party programs running in the background. This includes virii. I move slowly, disabling a few at a time, then restarting. If the problem disappears, then I know that what I disabled was causing the issue. I do the same with browser add-ons (Start --> Control Panel --> Internet Options --> Programs --> Manage Add Ons).--Best Dog Ever (talk) 21:35, 13 August 2010 (UTC)[reply]

Thanks. I'll give that a try sometime. This is similar to what I was told when I called Tech Support when the Internet was absolutely not working, and it turned out some new software had caused a problem and I needed to do System restore. I don't think any of this is that serious.

And I'll be sure to ask about the problems at the libraries.Vchimpanzee · talk · contributions · 21:44, 13 August 2010 (UTC)[reply]

You're welcome.--Best Dog Ever (talk) 21:54, 13 August 2010 (UTC)[reply]
This sounds like either a lack of resources like memory/disk space/processing speed, or it is the activity of some virus/malware. I don't get this kind of behavoir on my PC and I believe it is because I'm careful what I do, what I download and install, and what websites I visit. However, with publicly accessible computers like those in libraries, you cannot be sure or the machine's normal performance, what is installed, or what the previous user(s) of that PC have done before you came along. On the other hand, libraries are often poorly funded so their PCs are old, slow, low specification machines with slow CPUs, small disks, small memories and small screens; and they are usually maintained by non-expert library staff. If you have problems with a library PC, tell the staff it is faulty and move over to another machine (or to another library).
As for error messages, they should contain useful insights to what went wrong, but I have noticed that many messages are not at all helpful. In particular, Microsoft's "send error report" is certainly useful to Microsoft's engineers but is absolutely useless to normal users who usually want to click a button to get the message to go away ASAP (and let's talk about the Internet Explorer info bar telling us it wants to run a script/addon without telling us even the name of the script/addon). Astronaut (talk) 10:02, 14 August 2010 (UTC)[reply]
At the library where I had the problem with Firefox, they do have other computers, but they're older, or at least the monitors are. Not being a student, I'm expected to use the one computer unless someone else is on it. If other computers are available and there's not a class, it's not a problem for me to switch. There could be a shortage of memory too. These pop-up ads don't get blocked and I just go ahead and take advantage, which I shouldn't. Some sites are slow and I have a notepad too, so it's good to have alternate sites I can go to while waiting. The buttons disappear when new pop-up ads come up, though. I first asked the question because the site I wanted was getting replaed with the pop-up ad, only Alt-Tab would prove it wasn't. Just its button. I could ask them to check on malware or virus problems because this is new. The man who does it has a degree in history and is the historian.
Any thoughts on the other library? It could just be an old computer, but it's the same deal. The pop-up blocker is trying to work (and has done so on some ads) but then I get either the message saying Explorer has to close or everything disappears.Vchimpanzee · talk · contributions · 15:28, 14 August 2010 (UTC)[reply]
You can check how much memory is in the system by right-clicking on "My Computer" and choosing "Properties." Windows XP works well with 256 MB but 512 MB is ideal. Pentium IIIs and IIs slow down XP. It works best with Pentium IV CPUs or higher. Windows Vista and 7 work best with about 2,000 MB of RAM.--Best Dog Ever (talk) 19:10, 14 August 2010 (UTC)[reply]

I was hoping User:Comet Tuttle would come here after I mentioned this topic. He said on my talk page the problem could be in the popup blocker software. He was convinced if Alt-Tab wouldn't get me to a window that it was gone, but it wasn't.Vchimpanzee · talk · contributions · 18:37, 15 August 2010 (UTC)[reply]

I didn't have the problem today. I was hoping to show the person in charge of the library computers. Even if it had happened, it would have been hard to have him there at the exact time.Vchimpanzee · talk · contributions · 18:59, 16 August 2010 (UTC)[reply]
If you have a mobile phone with a built-in camera, or a digital camera, these devices are usually able to record short clips of video. So maybe next time you visit the library, you might want to take that along (don't forget to turn the ringer off if it's a cell phone) and shoot a video of what is happening, so you could show it to the local administrator. -- 78.43.71.155 (talk) 09:19, 18 August 2010 (UTC)[reply]
I don't have a cell phone. There's no warning when this happens. I talked to the man but he didn't know what happened just from my description. I showed him a misbehaving ad on the site where I was, which I believed was similar to what was happening when the buttons disappeared. I had a button disappear today and, because my notepad (I was composing an Excite email) didn't fill the whole screen, the site came back mysteriously without a button. But describing it didn't help, though he seemed to understand when I showed the ad. If you want to see a "misbehaving ad", go to [1], click on some articles, and watch for a Time Warner Cable ad warning people ESPN and its related networks may be gone Sept. 2. Now, I can't guarantee this will do anything. But on that Firefox computer, where I only had the notepad and the site and no other buttons, it was making the computer freeze. Also look at what happens when cdn4specificclick.net or optimimizedbyrubiconproject.com appears at the bottom of the screen where the web site you are going to comes up.Vchimpanzee · talk · contributions · 17:56, 18 August 2010 (UTC)[reply]

Files

[edit]

Any there any free online file hosting services that act like a normal hard / flash drive? I've tried dropbox already 82.43.88.151 (talk) 18:04, 13 August 2010 (UTC)[reply]

See the links below. It might help if you would specify why Dropbox wouldn't fit the bill for you. --Mr.98 (talk) 21:49, 13 August 2010 (UTC)[reply]

Any free online backup?

[edit]

Is it at all possible to backup online for free? It would need some sort of software to encrypt my documents etc before sending them online. I would not attempt to backup everything - just essential documents. This would mean I still had the information in the event of computer theft, but without the inconvenience of having to regularly insert remove and hide a pendrive or writeable disk. Is there already such a system available, or would it be easy to put one together from existing programs and resources? Thanks 92.15.11.88 (talk) 19:17, 13 August 2010 (UTC)[reply]

Sorry, I should have Googled before asking: http://www.techsupportalert.com/content/best-free-online-backup-sites.htm A worry is how long the info is kept for, and if secure private information is allowed. Found Comparison of online backup services 92.15.11.88 (talk) 19:25, 13 August 2010 (UTC)[reply]

Comparison of online backup services looks to me like a violation of WP:NOTGUIDE. Roger (talk) 20:17, 13 August 2010 (UTC)[reply]
Wikipedia has a pretty long history of such "comparison" tables about software. In any case it is hard to see any harm in it. I take the "internet guide" section to be referring to articles on programs themselves that just say their capabilities; I think the table goes a bit beyond that by making it a general comparison across programs. --Mr.98 (talk) 21:37, 13 August 2010 (UTC)[reply]
I've used Mozy before with reasonable success. I find its OS X client to be a little annoying at times (it has a bad habit of monopolizing everything for the first few minutes on a fresh boot). It is pretty easy enough to use. --Mr.98 (talk) 21:37, 13 August 2010 (UTC)[reply]