Wikipedia:Reference desk/Computing
of the Wikipedia reference desk.
Main page: Help searching Wikipedia
How can I get my question answered?
- Select the section of the desk that best fits the general topic of your question (see the navigation column to the right).
- Post your question to only one section, providing a short header that gives the topic of your question.
- Type '~~~~' (that is, four tilde characters) at the end – this signs and dates your contribution so we know who wrote what and when.
- Don't post personal contact information – it will be removed. Any answers will be provided here.
- Please be as specific as possible, and include all relevant context – the usefulness of answers may depend on the context.
- Note:
- We don't answer (and may remove) questions that require medical diagnosis or legal advice.
- We don't answer requests for opinions, predictions or debate.
- We don't do your homework for you, though we'll help you past the stuck point.
- We don't conduct original research or provide a free source of ideas, but we'll help you find information you need.
How do I answer a question?
Main page: Wikipedia:Reference desk/Guidelines
- The best answers address the question directly, and back up facts with wikilinks and links to sources. Do not edit others' comments and do not give any medical or legal advice.
August 21
Tandy Color Computer Emulators & .ccc files
I have so far searched in vain for a Tandy Color Computer Emulator that will run on my Windows 7 System and recognize ROM files with a .ccc file extension. Can someone help me here? 69.120.136.162 (talk) 06:29, 21 August 2012 (UTC)
To answer your question, in any of the emulators just change the extension to".rom" for some and ".pak" for others. All the rompaks are basically the same. Just the extensions are diffewrent.
Bp
commandline arguements in c
Hi sir!My dout is about command line arguments in c language. 1)we can execute a c program after getting .exe file of that program.then what is the speciality of command line arguments. 2)by using command line arguments we are giving input from command prompt to main. We can use the arguments passed to main in our programme.we can pass data required by programme with out using command line arguments.then why should we send data to main()?what is use,speciality and need of command line arguements? Sir!please explain with an example. I hope you help me. — Preceding unsigned comment added by Phanihup (talk • contribs) 11:58, 21 August 2012 (UTC)
- http://webchat.freenode.net/?nick=Phanihup&channels=#friendly-coders ¦ Reisio (talk) 13:48, 21 August 2012 (UTC)
- No idea what Reisio is getting at with the above IRC link.
- To answer the question: Command line arguments can be passed to main like this: main(int argc, char *argv[]) where argc is a count of tyhe number of arguments and argv is a list of the argument values. By convention argv[0] is the command used to start the program. They are used to pass all kinds of data to the program when it is run from a terminal, things like configuration values, filenames, paths, and so on. This saves having to have an interactive prompt for each piece of data and simplifies running the program from a script that might do all kinds of pre and post-processing around the program itself. It can also be important to be able to separate the running of the program from a GUI driven program launching mechanism, particularly when testing or debugging.
- So, for example, only today I needed to run a program I had modified in debug mode. I could have done this from the GUI launcher, but I would have had to install the GUI and then think of a way to attach to the running program in gdb before it got too far. Instead, using the command line, I could simply run the program from gdb supplying the necessary startup data on the command line.
- Another example: Elsewhere in my work, we have many complex scripts that start a sequence of processing that uses many programs. Each program passes data to the next using temporary files whose names are passed in the command line arguments - a typical example here is customer invoicing pulling data from many data sources. The scripts are scheduled to run at specific time in crontab. The advantage of this is that this time consuming process all happens out of hours with no human intervention, and the resulting data is ready for the rest of the business to get working on in the morning.
- You see, not every program that is important to a business requires a flashy GUI interface or even human interaction to do its thing. Astronaut (talk) 16:23, 22 August 2012 (UTC)
Where do Web Fonts live in the latest Firefox
When you go to a page that uses Web Fonts while using the latest Firefox browser, where does that font get put in Firefox? I've gone to a page that uses web fonts and then looked in %appdata%\Mozilla\Firefox and everything below, and found nothing. (using Windows 7 OS) 20.137.18.53 (talk) 12:27, 21 August 2012 (UTC)
- Assuming it's the same from November 2011:
- "On my system (Unix) they're stored at ~/.mozilla/default/Cache/A/AA/BBBBBBBB, where A is a (presumably random) alphanumeric directory, and B is a (presumably random) alphanumeric font file."…"On Windows they appear to be stored at C:\Users\yourUser\Local Settings\Application Data\Mozilla\Firefox\Profiles\yourFirefoxProfileName\Cache\A\AA\BBBBBBBB." — Wikipedia:Reference desk/Archives/Computing/2011_November_2#Web_Fonts_in_Firefox
If you just want to download them casually, there are a few extensions for making that easier. ¦ Reisio (talk) 13:46, 21 August 2012 (UTC)
Google Spreadsheet question
I'm trying to have a cell display "Today's starting count" where it takes the closing values from yesterday. If we were closed on the day before though it will display "NOVALUE" so what I want it to do is check the column that displays the previous day's closing count and IF there's no number there (because we were closed) then it scrolls up the column until it finds the most recent closing value and will return that value instead.
So far I've got IF(ISNUMBER(T1), T1, ) It's the last bit I don't know how to do. Any thoughts? Also if I set those T values to be preceded by a dollar sign, because they do represent money, will ISNUMBER still acknowledge it as a number?199.94.68.91 (talk) 19:50, 21 August 2012 (UTC)
- I don't use Google spreadsheet, so I can't really answer your question, but, since no-one else has answered, may I suggest that you avoid the problem by just keeping a daily running total with zeros for your closed days? Dbfirs 06:51, 24 August 2012 (UTC)
All my locally stored e-mail is gone in Evolution after upgrading to Fedora 17
I decided to finally upgrade to Fedora 17 from Fedora 14. The old system was too old to update, so I had to do a full reinstall. Luckily I had kept my old home directory on a separate partition, and it seems to be intact. The first problem that struck me is at although Evolution seems to have retained my old e-mail account information, all the e-mail I had downloaded to my local hard drive is no longer accessible. Evolution just says it can't find the messages. I have the old versions of Evolution's mailbox files on my backup drive, but how can I use them in the new version of Evolution? Do I have to convert them somehow? JIP | Talk 20:12, 21 August 2012 (UTC)
- It's probably a simple matter of copying the email data from your old drive to the specific correct place on the new drive (likely the same place), but I don't follow Evolution (and therefore don't know whether they've made drastic changes in that time span). You'd get this sorted much more rapidly on an IRC channel for Fedora or Linux in general (http://freenode.net/). ¦ Reisio (talk) 23:15, 21 August 2012 (UTC)
Further problems with Fedora 17
I've now sort of managed to get my old locally stored e-mail back in Evolution. I could get this year's received mail back, but not yet any of the previous years' (they were in subfolders of the old "Received mail" folder). But there's still some things I want to get sorted out.
My first sight at the new Gnome 3.0 desktop made me instantly agree with Linus Torvalds: "Gosh, this is horrible". I made Gnome force fallback mode, even though my system seems to be able to use the new desktop. But now I can't move the taskbars around any more, and most importantly, I can't add any quick launchers to the taskbars themselves, so I wouldn't have to use the menus. Is this at all possible?
- I really can't understand the Gnome project's mentality. They seem to be thinking that the less the user can do with their computer, the better. I used to be able to move the taskbars around, add new launchers to them, move existing items on the taskbar around, and change the taskbars' colours. Now I can't do any of that any more. If it wasn't for fallback mode I wouldn't even have the taskbars any more. With the way this project is going, I wouldn't be surprised if the version of Gnome in Fedora 20 just offered two big buttons: "E-mail" and "World Wide Web". JIP | Talk 21:47, 21 August 2012 (UTC)
- Try Xfce. ¦ Reisio (talk) 00:36, 22 August 2012 (UTC)
- I noticed Cinnamon and installed it. Then when I logged out and logged back in, selecting "Cinnamon" as the session instead of "Gnome", I was very satisfied. Cinnamon is pretty much like Gnome, but with everything that Gnome 3 took away put back in. Can I now use it as my default session? JIP | Talk 18:54, 22 August 2012 (UTC)
- No particular reason you couldn't. Linux Mint does, IIRC. ¦ Reisio (talk) 02:12, 23 August 2012 (UTC)
As well as that, the old Gnome Photo Viewer seems to be gone. In its place is "Shotwell Photo Manager", which seems to comply with the Gnome project's goal to destroy direct access to the computer's actual filesystem. I can't find any way to view thumbnails of all photos in a specific directory. Instead there's artificial constructs such as "Libraries" and "Tags". The old Photo Viewer offered a directory tree on the left-hand side and thumbnails of all images in the currently selected directory on the right-hand side. Is this possible in this new-fangled "Shotwell" thingy, or can I somehow get the old Photo Viewer back? JIP | Talk 20:39, 21 August 2012 (UTC)
- The old Gnome photo viewer was called Eye of GNOME and should be in the package eog -- Finlay McWalterჷTalk 21:18, 21 August 2012 (UTC)
- Yes, I still have Eye of Gnome, and it works, but it doesn't offer me a directory tree or a grid of thumbnail images. I think the program I used to use for this was called "gphoto". Is this available for Fedora 17? Shotwell Photo Manager seems to do pretty much the same thing, except instead of a directory tree, it offers me useless artificial constructs such as "libraries" or "tags". I can't find any way to make it show the physical directory tree on my hard drive. JIP | Talk 21:22, 21 August 2012 (UTC)
- Sorry, never mind. The old program I was thinking of is "gthumb", not "gphoto". Although it doesn't show up in Fedora 17's "Add/Remove Software" menu, yum finds it, and after I installed it, it seems to work pretty much like before. I still have to configure it correctly. The mere fact that it offers me direct access to the directory structure instead of having to import pictures into an artificial "library" makes it my preferred viewer over Shotwell, hands-down. Now I still have to find out how to add quick launchers directly into the taskbar and if E-UAE and VICE exist as packages for Fedora 17 or do I have to compile them from the sources. JIP | Talk 21:36, 21 August 2012 (UTC)
- Yes, I still have Eye of Gnome, and it works, but it doesn't offer me a directory tree or a grid of thumbnail images. I think the program I used to use for this was called "gphoto". Is this available for Fedora 17? Shotwell Photo Manager seems to do pretty much the same thing, except instead of a directory tree, it offers me useless artificial constructs such as "libraries" or "tags". I can't find any way to make it show the physical directory tree on my hard drive. JIP | Talk 21:22, 21 August 2012 (UTC)
Well, to be honest, Fedora 17 did do something right. Because Fedora 14 was too old to update, I had to do a full reinstall. This meant my old personal user account was gone. I had to create a new personal user account with the same username. I was expecting Fedora 17 to replace the old home directory with a new blank directory, and me having to restore my latest backup (luckily made minutes before the upgrade), and fiddle around with user ID and user name settings. But no, Fedora 17 happily informed me "A home directory with this user name already exists. Would you like Fedora to reuse this old home directory, updating all the user IDs and permissions so that all the files would belong to the new user?". I gladly selected "Yes, please!". And when I logged in to Fedora 17, my old home directory was there, with all the files, fully accessible. Now if I could only get the programs I've become accustomed to back... JIP | Talk 22:19, 21 August 2012 (UTC)
- Too old to update doesn't really exist with free Unix systems (though so old it'd take less time to reinstall than to update does), as most of the software remains available for ages after it is obsolete. It's true it probably would've been smoother had you updated back when they'd have liked you to, but you could have done it still. It's also usually a trivial matter to list what packages you have currently installed, should you (for some truly valid reason) wish to reinstall. You can also essentially drop in a backed up
/home/user/
directory's contents into a new install and have all your prefs just work, typically. Just FFR. ¦ Reisio (talk) 23:12, 21 August 2012 (UTC)
- Too old to update doesn't really exist with free Unix systems (though so old it'd take less time to reinstall than to update does), as most of the software remains available for ages after it is obsolete. It's true it probably would've been smoother had you updated back when they'd have liked you to, but you could have done it still. It's also usually a trivial matter to list what packages you have currently installed, should you (for some truly valid reason) wish to reinstall. You can also essentially drop in a backed up
Install VICE and E-UAE on Fedora 17?
And still more problems with Fedora 17. The legacy computer emulators VICE and E-UAE are gone. Neither "Add/Remove Software" or yum can find them. Are these at all available for Fedora 17? Should I try compiling them from the sources? JIP | Talk 21:03, 21 August 2012 (UTC)
- They're available via my distro's package manager, which means (given the popularity of the RPM format) that there are probably RPMs of them that you can install, whether Fedora provides them or not. ¦ Reisio (talk) 23:19, 21 August 2012 (UTC)
I found out that all I had to do was to install the free and non-free repository RPMs from RpmFusion. Now I could install both VICE and E-UAE with yum. And they work the same way as in Fedora 14, too. E-UAE still doesn't get the sound quite right. Do I need a faster computer or something? JIP | Talk 18:54, 22 August 2012 (UTC)
- IME getting sound working well for emulating ancient systems is a matter of tweaking the configuration more than anything. Won't necessarily work just right out of the box. ¦ Reisio (talk) 02:11, 23 August 2012 (UTC)
Printing ink usage
If I use a cheap, absorbent paper, will that use more printer ink than, say, a glossy photo paper?--85.211.154.5 (talk) 21:38, 21 August 2012 (UTC)
- I don't think so. The way inkjet printers work, the print head "spits" tiny drops of inks onto the paper--the paper doesn't suck the ink out of the print head. However, with uncoated, absorbent paper, much of the ink will be absorbed into the interior of the paper beneath the surface, resulting in less brilliant color. --173.49.10.157 (talk) 03:26, 22 August 2012 (UTC)
- Note that many printers have settings for paper or media type, as well as printer quality in their drivers. Generally speaking, printing at higher quality uses more ink. As far as I know, so does printing on the glossy paper setting compared to plain paper. At least it seemed to on the Canon printers I've used based on what it looks like if you try printing with the glossy paper setting on plain paper. I believe this is to produce a higher quality print since the glossy paper can take more ink without smearing. I'm not sure how high quality matte paper compares to glossy. On Canon printers and I expect all printers with both pigment black ink and dye black ink, I believe dye ink is preferred when printing on glossy paper to pigment ink, possibly even when printing text. See also [1] (this appears to be from usenet, unfortunately I can't find a copy on Google Groups or somewhere else which doesn't mangle it as a forum post, perhaps because it wasn't supposed to be archived?), [2]. Nil Einne (talk) 12:06, 22 August 2012 (UTC)
Dots and slashes in internet addresses
Why do internet addresses have dots and slashes? Couldn't they ahve unified it? Instead of https://en.wikipedia.org/wiki/whatever we could have https..en.wikipedia.org.wiki.whatever or https://en/wikipedia/org/wiki/whatever. Comploose (talk) 23:00, 21 August 2012 (UTC)
- One of the things Berners-Lee has stated he regrets not making happen. ¦ Reisio (talk) 23:06, 21 August 2012 (UTC)
- I believe that his regret was using
http://
instead ofhttp:/
, not making a distinction between paths and domains. See [3]. Paul (Stansifer) 00:23, 22 August 2012 (UTC)- "Why do internet addresses have dots and slashes?" he asked. :p You are correct (virtually) about the specifics of what he said. The slashes are unnecessary and so is having two standard delimiters (slashes and dots), and so is having two separate directions ([less.]more.MORE/less/less/less). ¦ Reisio (talk) 00:53, 22 August 2012 (UTC)
- I believe that his regret was using
- Well the colon seems to have originated with RFC 1738 (see URL), but the slash-dot notation for networking predates it. I believe the slash notation originated with early file systems. I'm unsure where the dot notation came from to refer to sub-domains, though. BigNate37(T) 23:10, 21 August 2012 (UTC)
- The notation allows us to uniquely specify communication. It distinguishes between several steps of the process of "asking" for a digital resource:
- URI scheme, or generic communications protocol; or, what language we will be speaking;
- user, or authentication; or, how we identify ourselves;
- host, or "server;" who is providing the service we will ask for, optionally using a globally-unique name;
- A uniquely qualified path to a resource
- Query string, an arbitrarily-complex refinement to what we are asking about.
- These sub-parts are explained more formally and rigorously in our uniform resource identifier article. There are plenty of other ways to come up with an abstract, functionally-identical nomenclature and syntax for such requests. The URI had the advantage of being mostly human-readable, easy to parse by inspection, and still sophisticated enough to densely accomodate a lot of information. If the objective were strictly efficiency, we could use a 128-bit universally-unique IP address, and a universally-unique 256-bit resource-identifier, which would be completely unintelligible to any human; but could be trivially aliased by any convenient keyword or icon in a user's interface. It seems that users of the internet may be trending toward that direction, evidenced by the rise of indexed content. There is still merit to the idea that a human can deduce what a URL should be, from common sense, and locate a resource without searching or indexing; and the URI notation provides a syntax that makes such a use-case possible. Nimur (talk) 00:28, 22 August 2012 (UTC)
- The notation allows us to uniquely specify communication. It distinguishes between several steps of the process of "asking" for a digital resource:
- Well, they serve different purposes. The
en.wikipedia.org
identifies a domain; essentially "whom should I talk to?". The/wiki/Whatever
is a path; it answers the question "what am I looking for?". Thehttps://
is a protocol (in this case HTTPS, which transfers web pages securely); in other words, "how should I get it?". For more information, see URL#syntax. Paul (Stansifer) 00:21, 22 August 2012 (UTC)
- The whole URL scheme is an arbitrary one (in the sense that you could easily replace it with something else of equivalent semantic content) dreamed up by geeks who never imagined that the whole world would be typing this stuff in on a regular basis. The fact that the average user still sees "http://" in front of every URL — despite having no clue what that means — is something of a colossal design failure. (Some browsers strip that stuff out and just handle it internally, which makes sense, given that your average person does not ever need to type in http:// or https:// manually.) --Mr.98 (talk) 00:25, 22 August 2012 (UTC)
Tibetan characters in Firefox under linux
In wikimedia.org/wikipedia/meta/wiki/List_of_Wikipedias, the only characters that do not show properly are the Tibetan. How can I correct that? Not that I care much, but I would want to know how it works. Comploose (talk) 23:17, 21 August 2012 (UTC)
- The Tibetan languages article has a link to free fonts which support the letters used in Tibetan writing systems. Installing those should solve the problem. -- Finlay McWalterჷTalk 23:23, 21 August 2012 (UTC)
August 22
IPsec server question
I'm trying to setup an ipsec system as follows but the documentation is maddening and most walk-through guides I've found differ from exactly what I'm trying to do (and are low on explanation). So, my first, simplest question is, can I setup a tunnel mode, pre-shared key, where a remote client behind a NAT can connect to the server using l2tp/ipsec? The server is also behind a NAT (I cannot change this; although port-fowarding is available). When the tunnel is established all client traffic should go through the server machine, including traffic to/from outside the server's subnet. Is this configuration possible with ipsec/l2tp?
Most of the guides I'm looking at envision either one or two of the endpoints as having a public IP, and then allowing secure access to the subnet behind it which is a slightly different configuration. I'm using openswan under linux right now, although that detail shouldn't affect this question. Shadowjams (talk) 01:09, 22 August 2012 (UTC)
- Hmmm... I feel lonely. Shadowjams (talk) 23:18, 24 August 2012 (UTC)
All Audio out of sync
Hey last night suddenly all movie files (.mkv, .avi etc.) that previously worked fine suddenly had their audio out of sync to varying degrees, sometimes by as much as a minute or more.
I assumed that perhaps the CPU was doing a heap of work or perhaps the HDD was being written/read to by something else slowing it down but both of these theories were proved wrong when I copied the files across the network and two other computers had the same problem.
Nobody else on the internet seems to have ever had this problem and i'm straight up confused.
they're all running win7 with avast antavirus, using windows media player or VLC for playback, and connected by shared drives on the homegroup. --Benjamint 04:20, 22 August 2012 (UTC)
- That is a very odd issue. I doubt that all of those files were changed. As a preliminary question, can you go and look at the modified dates on the files and see if they were modified around the time you started noticing the problem? I strongly doubt it's an issue with the individual files. The next step would be to copy an example over so there's no network issues, and see if you have the same problem. Also, check the version of VLC you are currently running, and if you can, when it last updated. Shadowjams (talk) 07:09, 22 August 2012 (UTC)
- The VLC version was 1.1.11 untill i manually updated to 2.0.2 while trying to fix it. It's not only a few files, it's all files stored locally on all three machines now regardless of age or how long they've been there. virus? I'm totally flummoxed. -Benjamint 08:05, 22 August 2012 (UTC)
- Well it's not magic — something relevant is common to each machine, be it a shared software update, badware (not heard of anything of this nature), or something else you've left out. I assume you've watched a video on some other unaffected computer to at least prove to yourself that you aren't going mad or have some medical condition? A decent second opinion on badware can be had by using ClamAV from a booted [http://www.sysresccd.org/Sysresccd-manual-en_How_to_install_SystemRescueCd_on_an_USB-stick#B.29_Recommended_USB_installation_method_from_Windows SystemRescueCD image. ¦ Reisio (talk) 13:46, 22 August 2012 (UTC)
- (EC) You didn't mention whether you're using the same speaker setup (including amplifier etc) for all 3 computers. I would be surprised that it would cause such a long delay, particularly an apparently inconsistent run but definitely if you using the same setup and it's digital at any stage, I could try something else. Also when you say the files are stored locally, do you mean they've always been on the other machines (i.e. it's a problem that has occured in files that were in 3 different machines, not in files that were in 1 machine but you copied elsewhere to test)? And were they all shared over the network? Does the sync problem being as soon as you start the video or later? If it beings as soon as you start the video (I'm presuming you mean the audio takes a while to start), have you tried making sound via non video files, e.g. music files, games, OS built in sound test and seeing if that's delayed as well? Nil Einne (talk) 17:12, 22 August 2012 (UTC)
Pressing "J" or "K" while a file is playing will change the audio sync. Perhaps you pressed them accidentally on all three machines while using another program which required the use of those keys? You can check the audio desynchronization settings at Tools -> Preferences -> Show settings -> all -> Audio -> Audio desynchronization compensation. 92.233.64.26 (talk) 17:17, 22 August 2012 (UTC)
FTP Desktop Shortcut
One of my translation agents wants me to use ftp for file transfer, rather than giving me a server to log in to, or sending files by email. However, the ftp address is in an email which will end up being buried sooner or later. I tried to add a desktop shortcut (as this is a regular agent), but I just ended up with a Firefox shortcut, rather than the usual Win7 ftp window, which is what I wanted (the Win7 ftp window doesn't update loads of addons everytime you load it, causing you to close lots of tabs). Is there a way to do this? KägeTorä - (影虎) (TALK) 07:13, 22 August 2012 (UTC)
- Doesn't matter. I've done it. KägeTorä - (影虎) (TALK) 07:50, 22 August 2012 (UTC)
Java Question
Given the following statement, using the condition operator in Java, how is the initial boolean statement interpreted? Is it 'if c is equal to a and a is less than b'?
Thanks. meromorphic [talk to me] 11:53, 22 August 2012 (UTC)
- A single = symbol in java is "becomes equal", an assignment. Double equals (==) is the test for equality. -- Finlay McWalterჷTalk 12:18, 22 August 2012 (UTC)
- Right. Knowing this, and what the ?: operator is, yields the answer to the question quite easily. --Mr.98 (talk) 12:51, 22 August 2012 (UTC)
- Knowing the relative operator precedence will also clarify things. -- Finlay McWalterჷTalk 13:42, 22 August 2012 (UTC)
- Ah, I get it now. If a is less than b then c is set equal to a+b. If not, c is set equal to a-b. Thanks. meromorphic [talk to me] 14:53, 22 August 2012 (UTC)
- Knowing the relative operator precedence will also clarify things. -- Finlay McWalterჷTalk 13:42, 22 August 2012 (UTC)
UTF confusion
Copy the following text:
Mängel
Now place it into the utf-8 decoder. It states that the second character (ä) is an incomplete character in a multibyte sequence, and so it is dropped. This is causing confusion for my bot, because the PHP regular expression doesn't know what to do with the mangled character (yes, this is ironic; no, it is not intentional).
What in the world is going on with that character, and how can I get my regular expression to recognize it short of brute force altering the text? Magog the Ogre (talk•edits) 17:02, 22 August 2012 (UTC)
Nevermind, the answer is far stupider than it appears on the surface: I had part of the regular expression typed in the wrong location. I would still be interested in knowing why this site and the terminal window in Ubuntu consider this character to be incomplete and disregard it. Magog the Ogre (talk•edits) 17:21, 22 August 2012 (UTC)
- Because, technically that's not a valid UTF-8 sequence! ä is a perfectly legal character; its unicode code-point isU+x00E4. But it isn't a single byte 0xE4. In many schemes, the byte value 0xE4 will be interpreted as an a-umlaut. In ISO-8859-1, or Windows-1252, 0xE4 is a-umlaut. In Unicode UTF-16, the two-byte 0x00 0xE4 is also a-umlaut. But not in Unicode UTF-8! UTF-8 uses the top bits to indicate start-of-a-multi-byte-sequence, so an 0xE4 as a standalone byte is not a legal UTF-8 character. Any program that's interpreting this text and rendering it properly is not treating it as UTF-8: those programs are heuristically determining that the codestream looks more like a single-byte-encoding (8859, or something like that). The correct UTF-8 mechanism to represent a lower-case a-umlaut ä would be 0xC3 0xA4. Some programs may choose to take a malformed single-byte UTF-8 byte and treat it as the least-significant bits of a UTF-16 two-byte stream; or interpret it as a single byte of ISO-8859-1, or use this as a contextual cue that the entire stream should be reinterpreted as "some other encoding."
- For the sake of preserving sanity: don't try to understand copy-paste semantics. There's absolutely no guarantee that copy/paste works in any specific way, unless you've written both the source- and destination- program. Your operating system's clipboard can literally do anything it wants to text that has been copied and pasted. It can be marked up, it can be re-encoded, transcoded; the "text" that you selected might have been an arbitrarily-complex-rich-data-format-with-custom-system-clipboard-routine. The system may "paste" different data depending on the which program is receiving the "paste" call. When you copy, then paste, text, you can not assume that the data is preserved in any way. Nimur (talk) 18:44, 22 August 2012 (UTC)
- They don't; you've confused encoding with decoding. 91.125.242.241 (talk) 18:35, 22 August 2012 (UTC)
- The web site has five modes, none of which do what you seem to want (i.e., treat the Unicode input as UTF-8 and show the encoding of each character). The default "Embedded" mode only accepts ASCII according to the documentation. -- BenRG (talk) 23:59, 23 August 2012 (UTC)
HTML page break control
I have a webpage with many bridge hands on it. Each hand is separated by a horizontal rule. If someone prints the page out I would like to have the page breaks in the vicinity of the HR, ideally after, rather than split a table up across a page boundary.
I've tried
<hr align=center width="80%" size=3> <div style="page-break-inside:avoid"> <h3> Board 21 </h3> <p> Dealer: N <br> Vulnerability: N/S </p> <table cellpadding=1 border=0> <tr> <td width=80> </td> <td width=80> ( 16 ) <br> ♠JT97 <br><font color=#ff0000>♥</font>A3 <br><font color=#ff0000>♦</font>AK94 <br>♣A63 </td> <td width=80> </td> </tr> <tr> <td> ( 6 ) <br> ♠AQ62 <br><font color=#ff0000>♥</font>864 <br><font color=#ff0000>♦</font>6532 <br>♣87 </td> <td> <img src="brg_tbl.bmp" width=70 height=70> </td> <td> ( 9 ) <br> ♠854 <br><font color=#ff0000>♥</font>KQJ52 <br><font color=#ff0000>♦</font>T7 <br>♣QJ9 </td> </tr> <tr> <td> </td> <td> ( 9 ) <br> ♠K3 <br><font color=#ff0000>♥</font>T97 <br><font color=#ff0000>♦</font>QJ8 <br>♣KT542 </td> <td> </td> </tr> </table> <p> </p> </div> <hr align=center width="80%" size=3>
But it doesn't appear to work in either IE or Firefox. Any ideas what I should do? --SGBailey (talk) 17:09, 22 August 2012 (UTC)
- Control over where browsers put page-breaks is done using the Paged media CSS options. In your case I think you want page-break-inside:avoid; - but as Comparison of layout engines (Cascading Style Sheets) shows, support for that still isn't very good. While they've been getting better, it's my impression that web browser developers don't prioritise good printing support. -- Finlay McWalterჷTalk 17:21, 22 August 2012 (UTC)
- page-break-inside:avoid; is what I think I've done in the div. Have I done it wrongly or does it just not work? -- SGBailey (talk) 17:29, 22 August 2012 (UTC)
- (I evidently didn't read your example carefully enough). Try it on just the table. Failing that, break-before and -after are a bit better supported - you can do a bit more formatting for paged media (where you pick the sizes of stuff so they'll fit on a letter/A4 page) and then use break-before and -after to force in pagebreaks - that's really suboptimal, as you're back to doing things in a word-processor-like WYSIWYG model, rather than the smarter way markup should be able to do. But even with those two being somewhat better supported, expect frustration and variability in actual browsers. -- Finlay McWalterჷTalk 17:44, 22 August 2012 (UTC)
- OK, so I read this as meaning that basically browsers don't support sensible page breaks. Thanks -- SGBailey (talk) 17:49, 22 August 2012 (UTC)
- It's worth trying, and I tend to leave it in even if it doesn't work well (in the hope that browsers catch up). Most web page developers don't give two hoots about printout (happily Wikipedia does print pretty well) and don't even do basic stuff like suppressing navigation controls in printout - so perhaps the browser makers are right to infer from this that no-one cares about printing. -- Finlay McWalterჷTalk 17:59, 22 August 2012 (UTC)
- I care :-) -- SGBailey (talk) 20:21, 22 August 2012 (UTC)
- I know it is horrid, but if I really really care about the page breaks, is there a better solution than screen capture the relevant lumps and display the page as a series of images? -- SGBailey (talk) 20:24, 22 August 2012 (UTC)
- I should say that page-break-before:auto and page-break-after:auto are supposed to be hints, so do try to see how far they get you. I had one customer who rendered HTML+CSS to PDF with Prince XML, which reportedly has really good paged media support, but I wasn't involved in that myself. It's noteworthy that some sites that do care about print (websudoku, google-maps) still have a "print" button, which produces HTML+CSS optimised for page layouts. That's easier for them (as they're generating content with software) than you. -- Finlay McWalterჷTalk 20:29, 22 August 2012 (UTC)
- Incidentally, if you put in the proper thead and tfoot tags into the table (which accessibility audit software will yell at you to do anyway, at least for thead), if the table is broken over a page boundary, Firefox at least will re-show the head and foot on the subsequent fragments too (which it should). -- Finlay McWalterჷTalk 20:44, 22 August 2012 (UTC)
GIMP 2.8 questions
When I upgraded to Fedora 17, I got GIMP 2.8. It works otherwise very nice, but I have some questions:
- How bloody hard is it to get a solid 1*1 brush? I want a brush that changes the colour of the single pixel I point my mouse at directly to the colour I'm painting with, and possibly does some minor anti-aliasing for the neighbouring pixels. But all GIMP offers me are huge brushes, the smallest of which is about 10*10 pixels. I have sort-of managed to do this by creating a new spherical brush with the radius set to minimum (0.1) and the hardness set to maximum (1.00) but even that doesn't work quite right.
- I closed the toolbox, thinking this would quit GIMP like it used to on Fedora 14. But now it only closed the toolbox and left GIMP running as usual. I brought the toolbox back, but it was missing the brushes dialog. I brought it back too, but now it's in a separate window. The toolbox says "add dockable dialogs here", but how exactly do I do this? I've tried every single mouse gesture I can think of with the brushes window. Do I need to type some magic command or something?
- "Save" in GIMP now only works in its own XCF format. To be able to save JPG or PNG images, I need to select "Export" instead, which saves the image, but still leaves GIMP thinking it's unsaved. Is this weird logic somehow by design? What possible use could it be of? Can I somehow make "Save" save in JPG or PNG format like it used to? JIP | Talk 19:02, 22 August 2012 (UTC)
- I can get 1px brushes and pencils fine: I just typed 1 into the size box in the tool option. It's always worked that way, I believe.
- You might try single window mode (windows->single_window_mode), which I've wanted forever.
- That's deliberate, and not welcomed by everyone. It's discussed here (that reviewer suggests some keyboard shortcuts he thinks will help). This may well be one of those changes that grates for a while, but so does accidentally losing all your layers and stuff, so I expect I'll get used to it. -- Finlay McWalterჷTalk 20:06, 22 August 2012 (UTC)
Old PC game from the '90s
What is it called? Old PC game from the 90's maybe earlier, you play a penguin (?) I think, definately set in a freezer and there are ice cubes and you can push the ice cubes to crush these purple things, and some of the ice cubes have got purple things in them and if you push them the purple things wake up, and you can also electrify the walls of the freezer and stun them, and it's a 2d game, and what was it called and how can I play it again? Thanks Horace Grundle (talk) 19:33, 22 August 2012 (UTC)
- The original was called Pengo (video game), for Sega arcade machines. There's a freeware remake [4]. I remember playing a DOS version. Card Zero (talk) 21:34, 22 August 2012 (UTC)
- If you want to play the original arcade game, try MAME (notwithstanding the legalities of owning/downloading the original ROM image of Pengo). Aah now that brings back memories of a misspent youth feeding too many 20c coins into machines! Sandman30s (talk) 13:00, 24 August 2012 (UTC)
Xine question
Now that I've upgraded to Fedora 17, I've also installed Xine. But when it starts up, it immediately pops up a message box about an unknown codec. I tried to play a .wav file I had recorded from VICE, but it also gave a message about an unknown codec. Presumably I've only installed the player itself, not any codecs. I just typed yum install xine
. How can I install the codecs? I would also like to be able to play the numerous DVDs I've bought fully legally, but can't play with 100% free software thanks to copyright restrictions. I think I have to install xine-lib-extras-nonfree
or something, but where can I get it from?
Also, is there any way to convert .wav files to .mp3 files so I could upload them to my Creative Zen Vision W and use it to play Commodore 64 game music when I'm carrying it around? JIP | Talk 19:39, 22 August 2012 (UTC)
- Fedora is different from Ubuntu, which I'm used to, but this talks about additional repositories to yum to get non-free codecs for stuff like DVD. -- Finlay McWalterჷTalk 20:09, 22 August 2012 (UTC)
- You can encode with sox, audacity, or vlc - they'll probably all need an additional package for the mp3enc -- Finlay McWalterჷTalk 20:09, 22 August 2012 (UTC)
- LAME. If you'd prefer a GUI frontend, try WinFF, Arista, or HandBrake. ¦ Reisio (talk) 02:01, 23 August 2012 (UTC)
Varicode ambiguity
I assume varicode is used for data compression. How does ambiguity not arise when decoding a bit stream without fixed intervals? --Melab±1 ☎ 21:55, 22 August 2012 (UTC)
- You might have missed the bit that says The space between characters is indicated by a 00 sequence. That sequence doesn't appear in any other varicode. Vespine (talk) 23:05, 22 August 2012 (UTC)
- Thanks. --Melab±1 ☎ 23:21, 22 August 2012 (UTC)
Question about incorrect song size information
Some time ago, I asked a question about a song (a Latin remix of that song to be exact) that I download that was over 3 minutes long (3:48 to be exact) and over 8 MB (8.41 MB to be exact), but according to the “Properties” info, the bit rate was 192 kbps, which obviously didn’t sound right. I saw that there are many download links to this song with this incorrect info. But I found a link to that remix that was over 5 MB according to the song info and 192 kbps. Now, this sounded right and I also found many download links to the song with this info.
Now, not too long ago, I downloaded a music editing software called Sony Acid Pro 7. I decided to put each song, the one with that’s supposedly over 8 MB and the other one that is over 5 MB (5.68 MB to be exact), on each track to check and zoom into the wavelengths of both songs just to compare to see if there was any difference in their qualities by checking out their wavelengths’ size, if there were more or less or breaks in the lines and dots, and if there were more or less details. I found out that everything was exactly the same, which means that the bit rate for the song that said 8.41 MB was right, 192 kbps, but somehow, the size information was wrong.
By the way, I also have another music editing software called Audacity. In Audacity, you can decide at what bit-rate you want to export an audio track. I decided to export the song at 320 kbps to see what the size info would say after I exported it. The info said that at 320 kbps, the size would be around 8.72 MB. This further showed that the bit rate was right, 192 kbps, but that 8.41 MB as its size was incorrect.
So how can a song that is at 192 kbps and at 3:48 in length be 8.41 MB? Why and how is the song size information wrong? What could have gone wrong? Was it the way it was compressed or the way it was produced? Willminator (talk) 23:21, 22 August 2012 (UTC)
- If you're talking about closed source software (Windows Explorer?) then you can pretty much only guess. If you find open source software coming to this conclusion, it's easy to find out why. ¦ Reisio (talk) 02:25, 23 August 2012 (UTC)
- MP3 files can contain embedded artwork. In this case, the 8 megabyte MP3 file has a 3 megabyte image embedded in it. (I used Mp3tag to see it.) --Bavi H (talk) 03:10, 23 August 2012 (UTC)
August 23
Getting/ripping songs from a java web game.
I really would like to know the possible ways to 'get' the audio from a game, first of all, it seems that my computer doesn't have "stereo mix" (Yes I've read the guides, that tells how to enable. but no luck), therefore I have no way of recording it from stereomix, I have also tried decompiling the game, so I did decompiled and searched the code for a url or something obvious as where the sounds are loaded, no luck either. Is there anyway for getting the song from a process? What the process is sending to the os and capture the song? or could you scann the process memory looking for an audio file? or maybe scan the packets from the server to see if anything matches to an audio file?
I've tried almost everything, I really really want to have that song. What should I do? (Aside from learn java) 190.158.212.204 (talk) 05:36, 23 August 2012 (UTC)
- It would really help if you told us what kind of computer you're running and what operating system. --Mr.98 (talk) 12:04, 23 August 2012 (UTC)
- Right, Windows 7 ultimate 64 bit. It's toshiba m645-s4047 — Preceding unsigned comment added by 190.60.93.218 (talk) 12:17, 23 August 2012 (UTC)
- If all else fails, just re-record it from your headphone jack. There will be a some loss of quality, but I've found this to be barely detectable (to an untrained ear) in some cases, with a good digital recorder or another computer, and volume controls set carefully. Dbfirs 12:33, 23 August 2012 (UTC)
- Can you give us a link to this game? -- Finlay McWalterჷTalk 12:55, 23 August 2012 (UTC)
- I guess so.. [5], I'll save you the work to locate the jar in the html as it's here, I figured that it request the sprites while loading using the java console. 190.60.93.218 (talk) 14:49, 23 August 2012 (UTC)
- One way would be to use a program that records whatever is going to the computer's sound card. Search the web for something like record sound card or capture streaming audio. The first program I noticed is the freeware Audacity (audio editor) which looks like it can be used to edit the recording down to the interesting parts. 88.112.47.131 (talk) 16:08, 23 August 2012 (UTC)
- I'm just going to say it's for personal use, I wasn't intending to resell or distribute. Meh, thanks anyway.. 190.60.93.218 (talk) 16:59, 23 August 2012 (UTC)
- Doesn't Audacity (and all the other recording software) rely on a sound card with stereomix that can play and record at the same time? Like the OP, I've never been able to get it to record what is being played on my laptop. Dbfirs 06:43, 24 August 2012 (UTC)
- When I visited the game page, I got a prompt to allow the signed Java applet to run. Since I didn't know exactly what additional access to my computer it wanted, I clicked Cancel. An error page appeared explaining the game was unable to store temporary files to the hard drive, and suggested I create a directory c:\rscache. If you trust the applet not to harm your computer, it sounds like it might store temporary files in a c:\rscache directory. You might look there and see if there are any audio files. --Bavi H (talk) 01:53, 24 August 2012 (UTC)
You could try this app to get past the no stereo mix problem http://stereomixplus.com/ Bornmiddleaged (talk) 10:25, 26 August 2012 (UTC)
Emacs basics
If you want to type 20 times a *, how do you do it? If you have several buffers already open, what is the easiest way to jump from one to the other? C-x b nameofbuffer works fine, but it seems to be too cumbersome. I need something like Contrl + Tab. Comploose (talk) 17:26, 23 August 2012 (UTC)
- As there is tab completion in C-x b, I usually do that (that is, C-x b, type a couple of chars, tab, return). The commands previous-buffer and next-buffer are usually bound to Ctrl+x+← and Ctrl+x+→ - if not, you can bind them yourself. -- Finlay McWalterჷTalk 17:35, 23 August 2012 (UTC)
- To get simple command repetition, use C-x u. In this case, C-x u 2 0 *. Paul (Stansifer) 18:12, 23 August 2012 (UTC)
- On my system that's Ctrl+u 2 0 *, where Ctrl+u is bound to the elisp function universal-argument -- Finlay McWalterჷTalk 18:49, 23 August 2012 (UTC)
August 24
Use Android 802.11x EAP settings on Windows
So, my school has a semi-hidden network that is secured with some form of 802.11x EAP authentication. I was able to access it on my phone using my school login credentials. However, Windows 7's wireless settings are much more complicated than Android's, and my attempts to find a similar set of settings failed. Could anyone give me any assistance in converting the settings? The settings in Android are:
- EAP method: PEAP
- Phase 2 authentication: None
- CA certificate: Unspecified
- User certificate: Unspecified
- Anonymous identity: <blank>
--Hmmwhatsthisdo (talk) 02:49, 24 August 2012 (UTC)
web based 2D CAD
I am looking for a free web based 2D CAD
can someone help me? --78.48.225.165 (talk) 03:20, 24 August 2012 (UTC)
- Can you describe what you mean by web based ? For example, do you need to collaboratively edit the CAD files with others ? Do you need to access the files from multiple computers ? If you don't need either of these abilities, why does it need to be web based ? StuRat (talk) 03:29, 24 August 2012 (UTC)
- no collaboration functionality needed, on some computers you can't or don't want to install software on the local HDD, I am looking for a 2D CAD that runs out of the browser --78.48.225.165 (talk) 05:27, 24 August 2012 (UTC)
- An alternative might be to put the software on a flash drive and take it with you, along with your CAD files. StuRat (talk) 05:51, 24 August 2012 (UTC)
- I am looking for web based right here --78.48.225.165 (talk) 06:46, 24 August 2012 (UTC)
Moving parts
This feels like a stupid question before I even ask, but are there moving parts in modern smartphones or tablets? Mingmingla (talk) 05:23, 24 August 2012 (UTC)
- This smart phone appears to have some real buttons, which do move, at least a bit: [6]. (You can make buttons that detect touch, but they are rather unsatisfying, as you want to feel it click.) Also, speakers/microphones must move a tiny bit (either to cause the air to move with sound vibrations, or as a result of those sound vibrations). StuRat (talk) 05:46, 24 August 2012 (UTC)
- Also the motor that provides the vibrate functionality. --Phil Holmes (talk) 08:15, 24 August 2012 (UTC)
- The iPhone also has an accelerometer and a compass, both of which presumably involve moving parts. AndrewWTaylor (talk) 08:27, 24 August 2012 (UTC)
- Hmm, the "compass" is probably a magnetometer, as used in GPS systems. (It would be interesting to know for sure.)--Shantavira|feed me 08:56, 24 August 2012 (UTC)
- Ah, according to this the compass uses the Hall effect, so doesn't no moving parts. AndrewWTaylor (talk) 11:08, 24 August 2012 (UTC)
- Hmm, the "compass" is probably a magnetometer, as used in GPS systems. (It would be interesting to know for sure.)--Shantavira|feed me 08:56, 24 August 2012 (UTC)
- A Google search quickly reveals [7] The accelerometer and compass don't have moving parts. It looks like the only things that could count are the motor, the on-off switch and debatably the microphones/speakers. --Phil Holmes (talk) 11:20, 24 August 2012 (UTC)
- The accelerometer does have a moving part, although it's an utterly tiny part and it moves tiny distances. As the accelerometer article notes, a modern MEMS accelerometer is one (or several) little cantilevered bars (built with the same deposition-and-erosion technology as the chip from which they're fabricated). When the device is accelerated (either by moving it, or just by gravity) the little beam flexes (that is, it moves, a tiny amount, in the free space left around it). Measuring this torsion in MEMS accelerometers is implemented either using piezoresistance (the resistance of the bar changes slightly as it's deformed) or capacitively (the moving bar forms one plate of a capacitor, the fixed substrate beneath it the other - tiny movements of the bar change the distance between them, and thus the capacitance of the circuit they form). All of this is quite invisible, as the MEMS device is sealed in the usual plastic or ceramic package for integrated circuits - it just looks like a little chip on your circuit board. But it does rely on that one little thing moving, just a bit. -- Finlay McWalterჷTalk 13:21, 24 August 2012 (UTC)
- Don't forget all those moving electrons, too! :-) --Phil Holmes (talk) 15:39, 24 August 2012 (UTC)
- And as it is a semiconductor device, you could consider the holes as moving as well :-)) Astronaut (talk) 17:35, 24 August 2012 (UTC)
- Don't forget all those moving electrons, too! :-) --Phil Holmes (talk) 15:39, 24 August 2012 (UTC)
- Note that the iPhone 4, and some other phones and tablets have both a MEMS accelerometer [8] and a MEMS gyroscope [9]. It sounds like most Apple portable devices [10] and so I would guess other manufacturers use MEMS microphones as well, so I wonder if it makes sense to consider the microphone moving but not the gyroscope or accelerometer (although I don't know the relatie movement difference). Nil Einne (talk) 19:16, 24 August 2012 (UTC)
Displaying bitmaps
I'd like to be able to dynamically create bitmaps, then display them, with a program (Fortran on Win XP). My program currently does so by creating a GIF and then starting up Internet Explorer to display it. This works, but is rather slow, and, if I want to update the displayed bitmap, this involves stopping IE and restarting it with the new bitmap. I'd like to avoid this overhead by being able to update the displayed bitmap just by entering a command at the command prompt. Can this be done with IE or some other application ?
Alternatively, I'd be fine with changing the contents of the bitmap file that IE or some other app is currently displaying, but it seems likely that the bitmap file will either be locked, or the application will have made a copy for display purposes and therefore won't update to reflect the changed bitmap file. StuRat (talk) 10:25, 24 August 2012 (UTC)
- Don't use IE to display images like that — you'll run into caching issues. What you want is a dedicated but lightweight image viewer, something like IrfanView. A more rigorous approach would be to use something like ImageMagick, which can let you edit the image and display it using only command line tooks, and anything else you'd want to do. But I presume you know about this already and are avoiding it for one reason or another. --Mr.98 (talk) 11:53, 24 August 2012 (UTC)
- ImageMagick's display program expects an X server, so while it does work on Windows, it's not commonly useful there. -- Finlay McWalterჷTalk 12:09, 24 August 2012 (UTC)
- Surely there's a way to adapt it for Windows, though? It seems worth investigating for the kind of thing that StuRat's doing — command-line image editing, updating, etc. --Mr.98 (talk) 13:09, 24 August 2012 (UTC)
- display is written direct to the xlib API, so it needs an X server; adapting it to GDI+ or DirectX is essentially rewriting it. -- Finlay McWalterჷTalk 13:34, 24 August 2012 (UTC)
- The reason I used IE is that everyone already has it. I put a timestamp in the bitmap file name to avoid having it display a cached image. StuRat (talk) 20:01, 24 August 2012 (UTC)
- I'm already using ImageMagick to convert the bitmap files, so it would be great if it could also display them, but it doesn't sound easy in Windows. StuRat (talk) 20:01, 24 August 2012 (UTC)
- Can I issue a command at the command line to have IrfanViewer change the image displayed ? If so, what's the syntax ? StuRat (talk) 20:01, 24 August 2012 (UTC)
- Isn't there a simple GUI library for your Fortran runtime? With a decent high-level GUI api, simply opening a window and drawing a bitmap in it is a few lines of code. At most it's a dozen or two in GDI in C, mostly because the C api is rather verbose (not because the task is hard). That may turn out to be preferable to having to popen/exec to an external program. -- Finlay McWalterჷTalk 13:34, 24 August 2012 (UTC)
- I haven't found a GUI library (I had asked a previous Q about that here). I use GFortran, incidentally. StuRat (talk) 20:10, 24 August 2012 (UTC)
- gtk-fortran, which works with gfortran on windows. I can give you the trivial gtk-python program to display an image; converting it to fortran should be simple. -- Finlay McWalterჷTalk 20:48, 24 August 2012 (UTC)
- That link says it works in Windows 7, not Windows XP. StuRat (talk) 21:01, 24 August 2012 (UTC)
- https://github.com/jerryd/gtk-fortran/wiki/Status suggests it works, for the most part, on XP. -- Finlay McWalterჷTalk 21:06, 24 August 2012 (UTC)
- That's not my reading. They tried two tests, neither of which worked, and only one of which they were able to diagnose and fix. StuRat (talk) 22:07, 24 August 2012 (UTC)
- It would be trivial in any .Net language - c# for instance. However, on my system (Vista), Windows Photo Gallery automatically detects changed image files and reloads them. The same is true of Windows Picture and Fax viewer on XP. FWIW these are the default programs to view PNG files.--Phil Holmes (talk) 16:33, 24 August 2012 (UTC)
- I tried Windows Picture and Fax Viewer on XP. It doesn't quite do what I need. If I change the bitmap file, it doesn't update the displayed image immediately, but only if I hit the forward and then backward buttons. StuRat (talk) 20:25, 24 August 2012 (UTC)
- I can vouch for doing it with .Net. I have (long ago now) written a program in c# that does exactly what you describe - dynamically create a bitmap and redisplay it on each change. Without a suitable library/framework, you are left doing all the hard work getting your program to interact with Windows. One aside, when I last worked with Fortran even longer ago, it was a pretty trivial matter to call functions written in another language so long as you understood the differences between the various calling standards (or at least it was simple on OpenVMS using their Open Fortran compiler extensions). You could write the math and bitmap creator in Fortran and then write your own API to interact with another language and framework more suited to the task of interacting with Windows. Alternativly, maybe you could write a quick and dirty bitmap viewer in something like c# and maybe have it reload the bitmap from a file when the file changes. Astronaut (talk) 17:31, 24 August 2012 (UTC)
- I've coded in C and similar languages, and hate them with a passion, so would like to avoid doing any of that. StuRat (talk) 20:12, 24 August 2012 (UTC)
- You could try a different way, as you're already timestamping the images apparently: use a bit of javascript to install an interval that checks whether a new file has appeared 10 times a second. the Scripting.FileSystemObject, which is available through an ActiveXObject in javascript, allows you to access the filesystem. You could set it up as a HTML Application to the permission issues you'll encounter. Unilynx (talk) 11:52, 25 August 2012 (UTC)
- But once I detect that the bitmap file has changed, how do I update the display to show it ? StuRat (talk) 04:46, 26 August 2012 (UTC)
- Well, you'd not have IE open the image directly, but open a HTML page with an IMG tag pointer to the image. Then it's a matter of updating the 'SRC' attribute of the image to point to the new version. Unilynx (talk) 11:27, 26 August 2012 (UTC)
- I think I've just found demo code for writing a GDI program in Gfortran [11]. I found it on page five of this thread [12] (presumably a usenet thread). Careful reading of the thread may reveal useful information about compiler settings. Card Zero (talk) 14:46, 25 August 2012 (UTC)
- OK, I was able to compile that code and get it to run, and it creates a white window with black text centered in it. I can change the text or window title. However, that's a long way from displaying a bitmap. How do I do that ? StuRat (talk) 20:39, 25 August 2012 (UTC)
- You need to replace the "
DrawText(hdc, message, -1, rect, 37)
" with something like "SetDIBitsToDevice(hdc, 0, 0, rect.right, rect.bottom, 0, 0, 0, bitmap_height, bitmap_data, bitmap_info, DIB_RGB_COLORS)
". You will probably have to add declarations for SetDIBitsToDevice and BITMAPINFO and various constants like DIB_RGB_COLORS. It would be much easier to do this in C. Those 500 lines of Fortran would be about 30 lines of C. -- BenRG (talk) 05:28, 26 August 2012 (UTC)
- You need to replace the "
UPDATE: I downloaded IrfanView and got it to work by issuing the following commands at the command line (the "/one" flag tells it to only allow one instance, so it immediately closes any previous instances, and the /hide=15 option hides the menus, etc.):
i_view32 pane1.bmp /one /hide=15
i_view32 pane2.bmp /one /hide=15
This sequence displays the first bitmap, then replaces it with the second bitmap. It's not bad, but you do see a flicker when it changes images, because it redraws the entire window, not just the bitmap. Still, if we can't come up with a better solution, which will only update the image in the viewer, and not redisplay the entire viewer, this is the solution I will go with.
Also, there is the File + Reopen (Shift R) IrfanView menu option, which will reload an image interactively, but I haven't found a batch command to do so. StuRat (talk) 06:33, 26 August 2012 (UTC)
UPDATE2: I found a way to eliminate the flicker, using IrfanView, by putting the pics in the desktop wallpaper instead of a window (the /wall=0 flag centers the image on the desktop wallpaper, while the /killmesoftly flag is needed to prevent it from displaying in a window, too):
i_view32 pane1.bmp /wall=0 /killmesoftly
i_view32 pane2.bmp /wall=0 /killmesoftly
However, I'd still like a solution for displaying in a window, and updating, without flicker, if anyone can think of one. StuRat (talk) 07:52, 26 August 2012 (UTC)
Simple javascript
Hello everyone. I'm looking for help with Javascript. I'd like to do the following:
1) A person clicks on a button.
2) A list with different options contained in a file (let's say, example.txt) is loaded and appears on-screen.
3) The user is allowed to add his name at the end of one of the options.
4) The file example.txt is automatically updated without the user having to access example.txt directly.
Could you please show me what the best and simplest way to do this with Javascript is? Thanks a lot. Leptictidium (mt) 12:10, 24 August 2012 (UTC)
- That's not as trivial as might be imagined. I guess you mean javascript in a webpage? Firstly the "file" would have to be a resource on the web server from which the web page itself - because of the javascript/browsers's "same origin policy" you can't easily open files on the client machine. So part 2 requires storing the list in some server-side system, and part 4 requires storing that again. So in essence you need a server side program (in PHP, Python, Java, node.js) to do this; javascript on the web browser can make it appear nicer, but it's fundamentally a server-side problem. -- Finlay McWalterჷTalk 12:23, 24 August 2012 (UTC)
- What Finlay says is correct: this is rooted in a misunderstanding about what Javascript is for. Javascript is run in the browser of the user's local machine — it is "client-side" scripting — and generally prohibited from reading or writing external files for security reasons. (There are, with all things, some exceptions to this.) "Server-side" scripting, which runs on the computer that is serving up the webpage, is what modifies files (on the server) and then sends them to the user (to download, say). There's lots of interaction between client-side scripting and server-side scripting (e.g. AJAX), but this is fairly complicated stuff for someone who is new to this. The simple way to do what you want is not with Javascript, but with something like PHP, a server-side language that can take input from a browser form and add it to a file or database. --Mr.98 (talk) 13:16, 24 August 2012 (UTC)
- Well, I see it's quite more complicated than I thought. Thanks anyway.Leptictidium (mt) 13:42, 24 August 2012 (UTC)
- We could explain it in other languages — it would be easy to whip up a PHP script that did this — but are holding back unless you would like us to. --Mr.98 (talk) 01:36, 25 August 2012 (UTC)
- Well, I see it's quite more complicated than I thought. Thanks anyway.Leptictidium (mt) 13:42, 24 August 2012 (UTC)
Learning programming languages.
What is the best institution in North America to learn programming languages (e.g. C++, Python, Ruby, Smalltalk, etc.)? Thank you in advance. --190.19.96.181 (talk) 15:15, 24 August 2012 (UTC)
- Khan Academy? Normally one wouldn't study these languages at an "institution". Typically an introductory class in computer science or some other subject, would also include some material about programming in some language. After that, you should be able to pick up other languages on your own. You can even get started from a video game. 69.228.170.132 (talk) 15:40, 24 August 2012 (UTC)
- Yes, I am well aware of that as I am currently studying for a degree in web design and development. However I was thinking that a community college, a university or even a foundation either in the United States or Canada that I am not aware of would perhaps offer courses or simply training in programming languages, preferably not online. --190.19.96.181 (talk), as 190.2.41.37 (talk), 19:54, 24 August 2012 (UTC)
- Well, if you need a brick and mortar class, you will want one in your area. Computer programming isn't so hard to teach that you need to cross a continent to find a decent class. Depending on the language, I'd think a community college nearby might be the best approach. StuRat (talk) 20:34, 24 August 2012 (UTC)
- I understand what you mean, but are there any places that are considered to be the best at teaching programming, just like Yale, Harvard and Stanford are presumed to have the best law schools in the United States? --190.19.96.181 (talk) 02:57, 25 August 2012 (UTC)
- No there is really nothing like that, at the level you're talking about. There are some extremely good programs in computer science and there are some in software engineering; but a topic like "programming in Python" is something you learn by reading the manual and practicing, maybe with some benefit from live instruction if you're a complete beginner. It's like asking what place is best for learning how to use Microsoft Word. It's just not a subject that warrants deep academic treatment. 69.228.170.132 (talk) 03:28, 25 August 2012 (UTC)
- I understand what you mean, but are there any places that are considered to be the best at teaching programming, just like Yale, Harvard and Stanford are presumed to have the best law schools in the United States? --190.19.96.181 (talk) 02:57, 25 August 2012 (UTC)
- Oh ok, yes, a class at a local college or at a hackerspace might do you some good if you're just getting started. By "what is the best institution" I thought you were asking about MIT vs. Caltech or something like that. Since you are interested in web design, I'd suggest starting with PHP and Javascript. Those languages are similar under the clothes to Python and Ruby, which are on your list. I'd advise against C++ as your first language since it won't make much sense for non-experienced programmers, and will present a lot of obstacles. I'm not sure what to say about Smalltalk. 69.228.170.132 (talk) 01:48, 25 August 2012 (UTC)
Learning a computer language just for the sake of it
Is any computer language worth learning if you know upfront that you would not be working with it? For example, when it forces you to deal with some issues or to be more explicit than other languages, which might be on a higher level of abstraction? Comploose (talk) 22:14, 24 August 2012 (UTC)
- In that case, why not wait and learn that abstraction in the language you will actually be using ? The only reason I can think of to start with a language you aren't likely to use is for an introduction to computer programming class, where something like BASIC can be enough for students to determine if programming is for them. StuRat (talk) 22:21, 24 August 2012 (UTC)
- I get your point. But, imagine that you know that you won't be using Assembly at work, but you are serious about learning how computers work, wouldn't it be much instructive than to learn PHP? Or in a different setting, you want to learn about algorithms, and there are a lot of books about algorithms in C++ or Java, so, you would be learning Java or C++ just to go through the literature. Does that happen in real life? Comploose (talk) 23:01, 24 August 2012 (UTC)
- Really it's a personal question about what's important to you, and we have some very knowledgeable computer science people lurking around here that could fill in the details better than I can, but if you want to learn a language for the intellectual exercise, I think you need to gravitate towards some extreme. That is, do something extremely high-level (object oriented, based around high level design ideas) or very low level (assembly, like you say, or something crazy, like brainfuck). I think that would probably drill home certain ideas in a way that could be valuable as a learning experience. Like doing an isolation exercise. Shadowjams (talk) 23:15, 24 August 2012 (UTC)
- I get your point. But, imagine that you know that you won't be using Assembly at work, but you are serious about learning how computers work, wouldn't it be much instructive than to learn PHP? Or in a different setting, you want to learn about algorithms, and there are a lot of books about algorithms in C++ or Java, so, you would be learning Java or C++ just to go through the literature. Does that happen in real life? Comploose (talk) 23:01, 24 August 2012 (UTC)
- I don't think there is good reason to learn them in depth, but some languages are worth learning because they express a philosophy in a particularly pure way. Examples are Smalltalk, APL, and Lisp. Looie496 (talk) 23:22, 24 August 2012 (UTC)
Esoteric programming language 92.233.64.26 (talk) 23:32, 24 August 2012 (UTC)
- Ooh! Ooh! Learn Scheme! It's a kind of Lisp, like Looie mentioned, and the nice thing about it is that it combines simplicity with power. There are advantages and disadvantages to Scheme's way of doing things (no static types, lots of possibilities for abstraction), but I think that Scheme is a great teaching language because of its simplicity. The textbook that my school and several others use is free online, and so is their Scheme-like language, Racket. Scheme is especially interesting for someone interested in programming languages in general, because its powerful macro system allows the programmer to reshape the language. Paul (Stansifer) 00:34, 25 August 2012 (UTC)
- There's also a distinction to be drawn between learning the syntax of a language, and learning its methodologies and paradigms. Various programming languages are expressive for different sorts of problems. If you know Java, there's little point in learning C++ just to re-write your Java programs using double-colons. C++ is a different language, with similarities and differences; and if you just learn enough to make a Java-like program with C++ style syntax, you wasted a lot of time and effort. Similarly, if you learn Lisp and then try to use it to write an application that should be written in Java, you're again wasting your own time. Lisp has a different purpose than Java. It's expressive in different ways. It's not conducive to creating the sort of boring, practical, useful software the way Java can. Learn FORTRAN so you can learn to work with complicated vector math. Learn MATLAB so you can explore advanced optimization problems. But, don't learn FORTRAN and then try to write a 3D game with it. That's using the wrong tool for the job; and if your intent is to use the wrong tool as an exercise in solving unnecessarily-difficult-problems, then you should just work in Intercal. Nimur (talk) 01:11, 25 August 2012 (UTC)
- I'll grant that some language/problem pairs are more appropriate than others, but I don't think that this is a productive way to look at families of languages. For example, both macros and static types are language features that have huge effects on language design, and can be used for performance, safety, or expressivity. They don't gear you towards specific applications, so much as specific groups of people and modes of thought.
- Simple languages, like Scheme and Smalltalk and Haskell (well, conceptually simple, anyhow) and even Basic are good for learning with, because they engage with the problem at hand. Languages that are designed around performance, like C++ and Java and Fortran bog the user down in minutiae. It's a good thing some people struggle with C++ STL error messages, or the details of memory management in Java, so that we can have fast software, but the time that I've spent doing those things hasn't really made me a better programmer except in those narrow areas. I've never had a job where I didn't have to learn a new language (or, at least, a lot more about C++) after I got there, anyways. Fortunately, picking up new syntax and new details isn't very hard. Paul (Stansifer) 07:10, 25 August 2012 (UTC)
- There's also a distinction to be drawn between learning the syntax of a language, and learning its methodologies and paradigms. Various programming languages are expressive for different sorts of problems. If you know Java, there's little point in learning C++ just to re-write your Java programs using double-colons. C++ is a different language, with similarities and differences; and if you just learn enough to make a Java-like program with C++ style syntax, you wasted a lot of time and effort. Similarly, if you learn Lisp and then try to use it to write an application that should be written in Java, you're again wasting your own time. Lisp has a different purpose than Java. It's expressive in different ways. It's not conducive to creating the sort of boring, practical, useful software the way Java can. Learn FORTRAN so you can learn to work with complicated vector math. Learn MATLAB so you can explore advanced optimization problems. But, don't learn FORTRAN and then try to write a 3D game with it. That's using the wrong tool for the job; and if your intent is to use the wrong tool as an exercise in solving unnecessarily-difficult-problems, then you should just work in Intercal. Nimur (talk) 01:11, 25 August 2012 (UTC)
- Seven Languages in Seven Weeks looks interesting, if you want a fairly quick introduction to seven very different languages.-gadfium 04:29, 25 August 2012 (UTC)
- If you're looking for concrete suggestions, it would help if you said what your learning goals were, and what languages you use now. If I have to pick without that info, I'll suggest assembler, Scheme, and Haskell. Each of them is useful though, so there's no reason not to work with them once you've learned them. 69.228.170.132 (talk) 07:01, 25 August 2012 (UTC)
August 25
Revision control for OS
Are there any revision control systems aimed at (or directly integrated into) operating systems which would allow to keep track of modifications to the configuration of the OS? I understand that I could manually add configuration files to any revision control system, just wondering whether this has already been done. I'd be particularly interested in (debian) linux, but out of curiosity also interested in any other OS. bamse (talk) 08:40, 25 August 2012 (UTC)
- Not quite change control, but there are Versioning file systems, which keep track of every change, and filesystems like ZFS, btrfs, and Vertitas which support snapshots. -- Finlay McWalterჷTalk 14:34, 25 August 2012 (UTC)
- Not designed for the purpose, but could Subversion be suitable for the task (at least for keeping track of changes in /etc)? I know some people use Subversion as a backup tool and change control system for their /home directory (see for instance this thread). AFAIK, Subversion does a decent job with binary files, too [13]. This is just a thought, I haven't used Subversion for these purposes, and there may be downsides that I'm not aware of. --NorwegianBlue talk 11:56, 26 August 2012 (UTC)
MSIL on Wine
As far as I know, C# is compiled to MSIL, which needs the .NET framework to run on MS Windows, and Mono on Linux. So, how is it possible that AWB runs on Wine, provided that Mono is not installed? Wikipedia_talk:AutoWikiBrowser/Mono_and_Wine --151.75.107.190 (talk) 14:18, 25 August 2012 (UTC)
- Wikipedia talk:AutoWikiBrowser/Mono and Wine#Wine says that, to run it in Wine, winetricks has to download and install the .NET2 runtime from Microsoft. -- Finlay McWalterჷTalk 14:29, 25 August 2012 (UTC)
- Okay, thank you. --151.75.107.190 (talk) 14:37, 25 August 2012 (UTC)
S.M.A.R.T. Warning message
I noticed a warning message in the disk utility of my Linux server recently. See screenshot. Is this an indication that I should replace the disk, or is it a more benign warning message? Thanks, --NorwegianBlue talk 15:18, 25 August 2012 (UTC)
.
- I would certainly want to have everything on that disk backed up properly. If the disk is mission-critical (that is, if you'd suffer significantly from the downtime associated with replacing it and restoring that backup) then I'd replace it now. If not, you may wish to risk keeping using the disk. That number should certainly be zero, but its being nonzero isn't evidence enough to assume impending failure. If the number increases, that's likely evidence the disk is dirty, scratched, or contaminated, and I'd replace it then. -- Finlay McWalterჷTalk 15:27, 25 August 2012 (UTC)
- Here's the meaning of those four numbers at the bottom:
- "Normalized": A manufacturer-defined measure of healthiness where 100 (sometimes 200) is normal and smaller values are worse.
- "Worst": The lowest normalized value this parameter has ever had on this drive.
- "Threshold": The normalized value at which the drive should probably be replaced (according to the manufacturer).
- "Value": More detailed information; in this case, the actual count of reallocated sectors.
- So according to the scale set by the drive manufacturer, 5 reallocated sectors is nothing to worry about. -- BenRG (talk) 20:02, 25 August 2012 (UTC)
- There was a Google study a while back showing that SMART-reported errors of any sort were highly correlated with impending drive failure. If it were my drive I'd take it out of service immediately, rather than backing it up and waiting for it to fail. 69.228.170.132 (talk) 02:25, 26 August 2012 (UTC)
- It's not an error. The health parameter is at 100%. I don't know why this particular SMART monitor treats any nonzero raw value for this parameter as worthy of a message at all. Most wouldn't. There's a green circle next to the message, which I suppose is meant to mean that it's purely informational. -- BenRG (talk) 04:52, 26 August 2012 (UTC)
- Thanks everyone! I experienced a similar situation with the same computer a year ago. It then had three disks, which all were new. When I returned from summer holidays, all three disks had SMART-reported error messages similar to the one showed here. I then replaced all three disks. Given the time of year that these problems have occurred, I wonder if it may have been caused by transients on the power grid during thunderstorms. All the circles were green then, too. The message next to the circle when absolutely everything is ok, is "Disk is healthy". I also noticed now, that there is a mouseover message associated with the Reallocated Sector Count warning, that says:
- Type: Failure is a sign of imminent failure (Pre-Fail).
- Updates: Every time data is collected (Online)
- Raw: 0x050000000000
- I'm not really sure what to make of that information, i.e. if it is saying that there actually is a failure condition now, or if it is saying what the interpretation would be if there were a failure condition. To be on the safe side, my immediate action will be to switch the roles of the two 1.5 TB disks on the system (the problem disk holds the /home partition, the other 1.5 TB disk mirrors /home, rsynced every night). --NorwegianBlue talk 10:32, 26 August 2012 (UTC)
- Thanks everyone! I experienced a similar situation with the same computer a year ago. It then had three disks, which all were new. When I returned from summer holidays, all three disks had SMART-reported error messages similar to the one showed here. I then replaced all three disks. Given the time of year that these problems have occurred, I wonder if it may have been caused by transients on the power grid during thunderstorms. All the circles were green then, too. The message next to the circle when absolutely everything is ok, is "Disk is healthy". I also noticed now, that there is a mouseover message associated with the Reallocated Sector Count warning, that says:
- From the Google study "Failure Trends in a Large Disk Drive Population": "As with scan errors, the presence of reallocations seems to have a consistent impact on AFR for all age groups (Figure 7), even if slightly less pronounced. Drives with one or more reallocations do fail more often than those with none. The average impact on AFR appears to be between a factor of 3-6x." AFR is Annualised Failure Rate. So it does appear that this is indicating a higher than normal liklihood of disk failure. --Phil Holmes (talk) 10:00, 26 August 2012 (UTC)
- Thanks! Googling your quote, I found the study here. --NorwegianBlue talk 10:46, 26 August 2012 (UTC)
- It's not an error. The health parameter is at 100%. I don't know why this particular SMART monitor treats any nonzero raw value for this parameter as worthy of a message at all. Most wouldn't. There's a green circle next to the message, which I suppose is meant to mean that it's purely informational. -- BenRG (talk) 04:52, 26 August 2012 (UTC)
Programming for mobile/embedded devices
How would one compile a program for a mobile/embedded device? — Preceding unsigned comment added by YoungAspie (talk • contribs) 17:29, 25 August 2012 (UTC)
- You would compile it like any other program, except that the target output would be for a different CPU. See Cross compiler RudolfRed (talk) 17:33, 25 August 2012 (UTC)
Then how would one transfer the compiled code to the embedded device? — Preceding unsigned comment added by YoungAspie (talk • contribs) 17:36, 25 August 2012 (UTC)
- It depends on the device. The iPhone for example is updated over USB. Other devices might use serial port or JTAG. RudolfRed (talk) 20:56, 25 August 2012 (UTC)
- When my job was programming embedded devices (1981–4), we used a "burner" to program a read-only memory chip. I imagine that times have changed. —Tamfang (talk) 00:24, 26 August 2012 (UTC)
Legality of redistributing software available for free download
What is the legality of redistributing software that's available for free download, without permission from the copyright holder? Specifically, several companies make available software programs as a large (>2 GB) DVD images for free download. I would like to republish the ISOs on my web site as BitTorrent links, to help those with unstable Internet connections or unstable computers. I understand that copyright prohibits copying and redistribution, but does it make a difference that the copyright holder is not trying to copy-restrict the ISOs themselves, instead requiring an activation key to use the software? 63.152.89.215 (talk) 21:01, 25 August 2012 (UTC)
- You appear to be asking for legal advice. We do not answer such questions. Sorry. AndyTheGrump (talk) 21:11, 25 August 2012 (UTC)
- Though the general answer is pretty straightforward, and is not legal advice. --Mr.98 (talk) 23:09, 25 August 2012 (UTC)
- Check the license distributed with the software. It will tell you whether redistribution is allowed. Just because something is provided for no charge (gratis) does not mean it is free for you to redistribute — it does not mean that copyright does not apply, it does not mean that your own redistribution of it would not be a copyright violation. --Mr.98 (talk) 23:08, 25 August 2012 (UTC)
August 26
Counter Strike Global Off.
I am having major lag spikes in the game Counter Strike Global Off., does anyone know how to fix the game (IT IS THE GAME NOT MY INTERNET). — Preceding unsigned comment added by 76.16.47.115 (talk) 02:57, 26 August 2012 (UTC)
- Have you tried a reboot ? StuRat (talk) 04:43, 26 August 2012 (UTC)
Samsung Series 5 17.3 inch laptop
Anyone here have this particular model laptop? I need to know if I'm the only one experiencing problems with the touchpad not being sensitive enough so I can know whether to return & exchange it for another one of the same model or get a different one altogether. 70.52.79.25 (talk) 08:55, 26 August 2012 (UTC)
Fast output of plots in MATLAB
Hi,
Does anyone know of a quick way to save a MATLAB plot (to png) without actually having to call up a figure? I need to process a large number of frames (1000s) to make up an animation and at the moment I'm creating a figure and then using print(gcf,...) but this is pretty slow... Thanks, --Fir0002 11:26, 26 August 2012 (UTC)
- Per the documentation, specify the figure property 'Visible', off. Nimur (talk) 14:45, 26 August 2012 (UTC)
Location based reminders in Android
I need to accept a location from the user, compare it with the current location (using GPS) and give an alarm to the user if it matches. I'm new to android, but I do know that I need to use LocationManager and AlarmServices. Can someone please give me an outline of how to go about it and especially how to integrate alarms into GPS. I'll be most grateful for any help provided. Thank you very much. :) Zebec 15:26, 26 August 2012 (UTC)