Wikipedia:Reference desk/Archives/Computing/2010 October 5

= October 5 =

Scripting OpenRPG
Can someone tell me where I can find a tutorial for scripting in OpenRPG? I already can program, and I would have no trouble finding a tutorial to learn Python. I just don't know how to run scripts on it, or how I'd make scripts use stuff on it.

Alternately, can someone tell me a different program like that and a tutorial for it? — DanielLC 00:28, 5 October 2010 (UTC)

Using Eclipse as a C++ compiler
I'm trying to use Eclipse on Windows XP, and it works fine for Java, but not C++. I've installed the CDT plugin, but when I try to run a program, it says that 'no binaries were found'. Also, I've tried building it, but that didn't do anything different. Help? KyuubiSeal (talk) 00:41, 5 October 2010 (UTC)


 * From experience, I can tell you that it is quite a bit of work to get set up. And even more if you intend to do any serious, long-term work. If you are not prepared for such a task, then save yourself a lot of frustration and just install Visual C++ Express 2010. It is an excellent IDE with extremely compliant compiler even with significant support for C++0x. 180.11.188.56 (talk) 02:48, 5 October 2010 (UTC)


 * You need the MinGW package which will give you most of the GNU tool chain needed to compile C++ using GCC on Windows. --antilivedT 07:53, 5 October 2010 (UTC)


 * Okay, I installed it. The components I selected were C++ compiler and MSYS Basic System. Now it's saying nothing to build. KyuubiSeal (talk) 14:47, 5 October 2010 (UTC)


 * Also, isn't Visual C++ Express a trial edition? KyuubiSeal (talk) 20:19, 5 October 2010 (UTC)
 * I don't believe so...their page says "The Visual Studio® 2010 Express is a set of free tools which offers you an exciting experience with the new integrated development environment, a new editor built in Windows® Presentation Foundation (WPF) and support for the new .NET Framework 4. " —Preceding unsigned comment added by Smallman12q (talk • contribs) 23:06, 5 October 2010 (UTC)


 * No, it is fully functional and free. See Microsoft Visual Studio Express. 124.214.131.55 (talk) 23:10, 5 October 2010 (UTC)


 * It doesn't build still. :\ When I try, the console shows this:

**** Build of configuration Debug for project Hello World ****
 * WARNING: The "Debug" Configuration may not build ****
 * because it uses the "MinGW GCC" ****
 * tool-chain that is unsupported on this system. ****


 * Attempting to build... ****

(Cannot run program "make": Launching failed)
 * Also, the Terms of Service for Visual C++ Express, section 1b says "Trial Edition. The initial installation of the software is a trial edition. You may convert your trial rights at any time by obtaining a product key from Microsoft.  The trial software will present conversion options to you thirty (30) days after you install the trial software.  After the expiration of the 30-day trial period, without conversion, the trial software will stop running." So are the conversion options free then? KyuubiSeal (talk) 23:49, 5 October 2010 (UTC)
 * Yes, it is free. If you're using it on a computer that isn't connected to the internet, you may need a Windows Live ID (also free) to acquire the product key.  (talk) 13:49, 6 October 2010 (UTC)
 * Have you ensured that the settings in the "Tool chain editor" under "Project properties" are correct?  (talk) 13:49, 6 October 2010 (UTC)
 * It says 'Current toolchain: MinGW GCC', 'Current builder: CDT Internal Builder'. But there's a warning saying 'The configuration support is not installed on the system' So did I mess up the installation of MinGW? KyuubiSeal (talk) 14:22, 6 October 2010 (UTC)
 * Okay, I've just decided to give up on using Eclipse, and I installed Visual C++. I should have just followed the first response. :P One last question though. Is there an equivalent in Visual C++ to Eclipse's error-checking? EDIT: Okay, found it. Thank you! KyuubiSeal (talk) 21:14, 6 October 2010 (UTC)

Phantom linux installation
While trying and failing to set up a dual-boot of Ubuntu on my Mac Pro, I accidentally installed the boot loader on my OSX hdd. My OSX install still works fine, but now whenever I start up my machine rEFIt shows a non-existent linux installation. Is there any way to get rid of this annoying behaviour? Horselover Frost (talk &middot; edits) 01:29, 5 October 2010 (UTC)
 * Presuming that Mac OS X is the only operating system left on your computer, have you tried to remove rEFIt? Xenon54 (talk) 01:36, 5 October 2010 (UTC)
 * I could, but I would like to be successful in installing a linux one of these days. Horselover Frost (talk &middot; edits) 02:13, 5 October 2010 (UTC)
 * Also, knowing that little bit of dangling code is still there kind of annoys me. Horselover Frost (talk &middot; edits) 02:14, 5 October 2010 (UTC)

Swapping 2 character arrays in C
Hi, so in C I have two character arrays: a[] = "this is a long piece of text!" b[] = "short" and I want to swap them. Can I just swap their pointers, using an intermediary middle variable, eg.: char * temp = a; &a = &b; &b = temp;

I'm just not sure if C somehow keeps track of the length of character arrays internally and I wanted to make sure switching the pointers to the variables would not screw up C's internal representations of the character arrays.

Thanks =) —Preceding unsigned comment added by Darkleg (talk • contribs) 05:09, 5 October 2010 (UTC)


 * That's fine. In C strings have a ASCII NUL character delimiting the end of each string. CS Miller (talk) 05:43, 5 October 2010 (UTC)


 * The code you showed above won't work, I'm pretty sure, because &a and &b are constants rather than variables when you declare them that way, but here is some that will:

char *a = "this is a long piece of text!"; char *b = "short"; char *temp = a; a = b;  b = temp;


 * Looie496 (talk) 05:57, 5 October 2010 (UTC)


 * Short answer, no. You seem to be a little bit confused about arrays and pointers in C. They are completely different concepts. Yes, C does keep track of the array's length, because it is part of its type. The a and b objects are of type array of char. So attempting to assign the address of one to the other won't accomplish what you're trying to do. Why do you (think) you want to swap the two arrays?  (talk) 06:03, 5 October 2010 (UTC)


 * Short answer, yes. It is not completely clear what you (the OP) mean by "swap" in this context, but you can assign the address of one string to a pointer that used to hold the address of another string, no problem.


 * I don't know what Decltype means by "completely different concepts", either, and his link is broken. C is not a high-level language, it is a structured assembler, and happily allows you to assign all kinds of things to each other that other languages, with stronger typing features, will not allow.  In C, the type "array of char" and the type "pointer to char" are closely related; a pointer to char is how an array of char is implemented, and C run-times typically do NOT keep track of the length of an array internally.  There is no mechanism for knowing, at run-time, how many elements are in an array, which is why C has the convention of putting a null character at the end of an array of characters (a.k.a. a 'string').


 * rc (talk) 15:10, 5 October 2010 (UTC)
 * All that is true to an extent, but not really relevant. (For instance, this is a compile-time issue, so the "unknown" length of arrays at run time is unimportant.)  The OP tries to assign to the result of the & operator, which is not an lvalue.  It's not proper to say that an array is "implemented" as a pointer: an array (used as an rvalue) decays into a pointer to its first element, but you can't change that value because the array is actually occupying memory there and you can't change the address of that memory.  (Since you can't assign to an array, the only way to use an array as an lvalue and see it for what it really is is to use the & or sizeof operators.)  You can of course assign to pointer variables; the line   is more or less equivalent to


 * It's also possible, of course, to exchange the contents of two arrays (if they are of appropriate length). For instance:


 * The null character in a makes it be 5 characters long as a string but with space for much more. strcpy won't overflow on any of these because it stops at the NUL.  However, you can't do this explicit copying with pointers to string literals because string literals are read-only.  --Tardis (talk) 16:03, 5 October 2010 (UTC)
 * What Tardis said. A pointer to char is not how an array is implemented, and the mechanism for determining the number of elements in an array, both at compile time, and run time, is the sizeof operator. It is true that the OP said "swap their pointers", however, in the example she is indeed trying to assign to its address (an rvalue). I stand by the statement that arrays and pointers are completely different: An array is a nonempty set of contiguous objects of a particular type; a pointer provides a reference to exactly one object.  (talk) 11:47, 6 October 2010 (UTC)


 * Because this is getting a bit complex, let me re-emphasize the main points: (1) the concept is valid; (2) the actual code shown by the OP won't work, or even compile; (3) the code that I showed above will work. Looie496 (talk) 17:43, 6 October 2010 (UTC)

How are my internet contributions sorted?
I'm a novice as far as computing and the internet go, but I have been posting to WP, Yahoo QA and IMBD for several years. For something to do, I put my user name, myles325, into google, and was surprised to see about 17 pages of references to myles325, mostly to me, but to some mysterious doppelganger who bears the same user name. I re-read some of my old contributions, mostly humorous ones, but now kept in strange sites that I never knew existed. And the final google pages consisted of some of my writings translated into German and a host of other languages.

What really puzzled me was how these particular pieces came to be immortalized, and not most of the stuff I wrote, which does not appear anywhere. How is it that the same 2 line quip I made on some subject back in 2007 is listed 7 times, 3 of them in garbled translations, but the vast majority of my writings does not? It all seems so random. How does this stuff get kept, and why does some material appear over and over again, while other stuff, much of it superior to the displayed material, never gets a mention? Myles325a (talk) 07:24, 5 October 2010 (UTC)


 * Because it's not up to you. ¦ Reisio (talk) 11:43, 5 October 2010 (UTC)

Many sites mirror Wikipedia and other wikis, and often don't keep their mirror up to date. So say they mirrored Wikipedia in 2007, only content up to that date will be saved. Then, that mirror is turn is mirrored by other sites and crawled by google, so you have an out of date copy of the content being displayed in google search results.There's no order or reason behind it, it's just sites duplicating content. See also Mirrors and forks 82.44.55.25 (talk) 14:04, 5 October 2010 (UTC)


 * Myles325, you asked how your typing on the Internet is "sorted". See PageRank for Google's algorithm on the order in which search results are displayed; Bing and Ask.com and all the other search engines have their own variants.  Your contributions aren't really collected in a single folder somewhere on Google's servers; rather, all the web pages that Google caches are jumbled around in some proprietary, secret order; but the important thing is PageRank's discerning of how many other pages on the Web point to each page.  Comet Tuttle (talk) 16:56, 5 October 2010 (UTC)
 * Also note that despite its popularity, Google is not the authoritative source for sorting content on the internet. They are just "the currently most popular, easy to use, public" web-page for sorting content.  Anybody else, including yourself, may make a web-page or other publication and sort your contributions in any way they choose.  Google in particular has no obligation to sort its search results based on what you want; if you want creative control, you should create your own web-page with a list of your works, and tell people who are looking for your works to use your page.  Creating such a page may indirectly cause Google's automated search system to re-prioritize search results, if their system determines that your own page is the "authoritative listing" for all Myles325a-related queries.  In this way, you can "help" Google sort your contributions according to your preferences in two ways: first, search engine optimization (which would entail structuring your contributions on the internet in such a way to "hint" to Google's algorithm); and second, by sponsored search - in other words, paying them for a contract to deliver search results in some particular order.  Google's policy regarding sponsored results is clearly outlined here: Sponsored Links from Google.  Google usually displays sponsored links in a different way than regular search query results (most obviously, if you use www.google.com in the United States, they actually place Sponsored Links in a separate div with a different color).  But depending on how somebody performs a Google search (i.e., through a vendor web-site, or a Google-powered online shopping system, and so forth), it may not be clear that your query-results are sponsored results.  Similar explanation applies to all other search portals and content aggregators.  Nimur (talk) 21:47, 5 October 2010 (UTC)

OP myles325a back. Thanks, guys. Your answers were more thorough and pertinent than I could have reasonably expected. Full marks all around, even to the guy who simply noted: "It's not up to you". Myles325a (talk) 02:51, 6 October 2010 (UTC)

Free Hardsub Video Software
Is there any other free software that allows you to add subtitles on videos besides Windows Movie Maker and DivXLand Media Subtitler? —Preceding unsigned comment added by 219.75.98.33 (talk) 08:23, 5 October 2010 (UTC)


 * http://aegisub.cellosoft.com/docs/Attaching_subtitles_to_video But this is quite a terrible thing to do, IMO. ¦ Reisio (talk) 11:46, 5 October 2010 (UTC)

Python shared reference
I'm learning python, from the excellent O'Reilly book by Mark Lutz. I am learning about in-place changes:

>>> L1 = [2,3,4] >>> L2=L1 >>> L1[0] = 24 >>> L1      [24,3,4] >>> L2     [24,3,4]

OK, I understand this. What I don't understand is why Lutz says "This behaviour is usually what you want". Why? Why would anyone bother to create two variables, L1 and L2, so that a change to L1 is reflected, possibly confusingly, in L2? Robinh (talk) 20:16, 5 October 2010 (UTC)
 * Because you conceptually treat the list as an object, with multiple references to it. If you want a different object, you can explicitly create it by calling the list constructor . Consider the opposite case: you always get a deep copy and need to explicitly call a reference operator if you want to refer to the same object. That would get tiresome very fast, and whenever you forget it, you waste plenty of time and memory. And we are not only talking about assignments, but also about parameter passing into functions and methods. --Stephan Schulz (talk) 20:35, 5 October 2010 (UTC)
 * Thanks for this. But I still don't see why anyone would want to create L2 at all.  Why not just deal with L1 and dispense completely with L2? (ie, expunge L2 from all the code)? Robinh (talk) 20:41, 5 October 2010 (UTC)


 * Consider this example:


 * In it, as we iterate through faves, numbers is assigned to each of the lists of integers in turn. As with Lutz' example that you quote, its a shallow copy; merely an assignment of a reference (rather than a deep copy, which is the alternative Stephan posits). In this case, the shallow copy is just what we want; we just want numbers to be a temporary reference to the specific list we're very briefly talking about. -- Finlay McWalter ☻ Talk 20:55, 5 October 2010 (UTC)
 * Incidentally, if you're thinking "but he's not actually assigning with the = operator", I've just used the nice python iterator syntax. That for loop is essentially the same as:


 * -- Finlay McWalter ☻ Talk 21:09, 5 October 2010 (UTC)
 * Our articles on this topic are Reference (computer science) and Pointer (computing). --Sean 21:05, 5 October 2010 (UTC)
 * Thanks guys. It will take me some considerable time to digest this.  Thanks again, Robinh (talk) 21:15, 5 October 2010 (UTC)


 * Don't worry that you've found this idea challenging. This (understanding the difference between objects and names-for-objects) is one of the deep and important ideas in programming, and once you get it lots of stuff will just make sense. Incidentally the bloke above in the is in just the same place you are. -- Finlay McWalter ☻ Talk 21:57, 5 October 2010 (UTC)


 * I kinda disagree with Lutz's assertion. This may be what you want; the behavior allows you do express some new things, but it does so at the cost of being confusing.  I generally prefer to avoid behavior like this because it can be very hard to figure out what's going on.  It's even possible to program without ever assigning or changing the value of anything, and Python provides the some of the tools necessary to make this practical: list comprehensions (which are really just filter and map in disguise) and anonymous functions. If working with shared state is confusing in some context, don't assume that you just need to think harder; try expressing the problem differently.  Paul (Stansifer) 17:27, 6 October 2010 (UTC)
 * Even with purely functional work, the distinction between a reference and an object persists: consider  and   in Lisp (admittedly not pure).  Referential transparency may make some comparisons of identity meaningless, but it's still reasonable to consider a list of things and see if it contains the same one multiple times or merely equivalent things.  Of course, you can choose to do otherwise: Mathematica has no intrinsic concept of references, and implements all assignments as notional copies (probably really copy on write or so).  And you can implement your own reference discipline by always referring to things through a dictionary (even if the dictionary never changes: define   as $$k=k'$$ and   as $$f(k)=f(k')$$).  --Tardis (talk) 17:41, 6 October 2010 (UTC)

(OP here). I have been pondering the answers above. How about "This behaviour is usually what you want, when you find yourself referring to the same mutable object using two different names (usually one short name for local use, and one long "real" name that occurs in a wider context)". Not as catchy, I know, but more helpful? Robinh (talk) 07:19, 7 October 2010 (UTC)
 * I'd say that you could cut that down to "This behavior allows you to refer to the same mutable object from different objects." Having two names for something usually isn't useful, but sometimes you want to get to something from two different paths.  For example, imagine that you're writing a simulation game involving a bunch of city-states, and you have objects representing the state of their diplomatic relationship.  If events affecting only one city-state can cause diplomatic changes, you'll want both of them to have references to that one mutable object.  It's a contrived example, but yesterday, actually, I speced out a design with someone, and the program we will write will be doing this kind of thing (it's a big search problem, and an optimization that turns out to be useful is for the search to have an idea of how interesting particular directions have been recently).  Paul (Stansifer) 14:13, 7 October 2010 (UTC)

Aha. Light goes on over head:

>>> L1 = [2,3,4] >>> fish = [1,2,L1] >>> fosh = [3,4,L1] >>> fish[2][1] = 0 >>> fosh [3, 4, [2, 0, 4]] >>>

Brilliant! Thanks Paul and the others. Best wishes Robinh (talk) 18:28, 7 October 2010 (UTC)

Internet issues
What would cause one's internet connection to become incredibly unstable, given the router has not changed and the line has likewise not been altered? —Jeremy  (v^_^v PC/SP is a show-trial!) 20:30, 5 October 2010 (UTC)
 * Maintenance or infrastructure changes at the internet service provider level can cause performance degradation and outages. Nimur (talk) 21:32, 5 October 2010 (UTC)
 * For better than a whole week? —<font color="228B22">Jeremy <font color="00008B"> (v^_^v PC/SP is a show-trial!) 21:35, 5 October 2010 (UTC)


 * It depends. What kind of instability? Do the lights on your modem change? Do you get any messages from your operating system?--Best Dog Ever (talk) 21:39, 5 October 2010 (UTC)
 * MSN signs me out every 20 or so minutes; IRC lags for chunks of 10-15 min. or more, often resetting my connection; websites load intermittently, sometimes normally, sometimes not loading up at all. —<font color="228B22">Jeremy <font color="00008B"> (v^_^v PC/SP is a show-trial!) 21:43, 5 October 2010 (UTC)

What kind of internet is it? Cable modem, ADSL, etc? 82.44.55.25 (talk) 21:51, 5 October 2010 (UTC)
 * Cable. —<font color="228B22">Jeremy <font color="00008B"> (v^_^v PC/SP is a show-trial!) 21:52, 5 October 2010 (UTC)
 * Check your modems downstream and upstream SNR levels, they should be viewable in the congif page (usually http://192.168.100.1/ or http://192.168.100.2/) If they're outside of normal limits that can cause unstable internet 82.44.55.25 (talk) 22:03, 5 October 2010 (UTC)
 * Downstream SNR (I assume that means Signal:Noise Ratio) is 37 dB. Nothing on Upstream. —<font color="228B22">Jeremy <font color="00008B"> (v^_^v PC/SP is a show-trial!) 22:09, 5 October 2010 (UTC)
 * Hello? —<font color="228B22">Jeremy <font color="00008B"> (v^_^v PC/SP is a show-trial!) 00:13, 6 October 2010 (UTC)
 * The downstream SNR should be 30 or more. So, 37 is good. Try connecting directly to your modem instead of the router and see if the problem stops. What happens to the lights on your modem when your connection starts acting up? I assume you connect to the router using a wire?--Best Dog Ever (talk) 01:08, 6 October 2010 (UTC)
 * I do use a wire to connect to the router; it and the router, AFAIK, have not changed. The only thing different was that the router was down for ~ 3 hrs two Sundays ago, and that the problems started the immediate next day. I cannot connect directly to the modem because I have no access to the modem. —<font color="228B22">Jeremy <font color="00008B"> (v^_^v PC/SP is a show-trial!) 01:38, 6 October 2010 (UTC)
 * You should have wrote, "nothing I see or control has changed," because modems and routers can start dying out of the blue, in which case the only solution is to replace the modem or router. The downstream signal level may change when you're having troubles, then go back to normal in a few minutes. There are no moving parts inside those devices, so they don't break often, but they still do break. There could also be a problem with the cable to the router. So, you could try a different cable. Also, if you cannot access the router, perhaps you should talk to whoever is in charge there and ask them to connect your computer straight to the modem. Where is this happening, by the way? And if a direct connection to the modem doesn't solve it, you should call your ISP, because it could be an indication of a problem with the modem. It could also be an indication of a problem outside of your home with the ISP's equipment.--Best Dog Ever (talk) 01:49, 6 October 2010 (UTC)
 * I would ask if not for the fact we are in the process of moving and will not be here in three weeks; those who do have access see that as the higher priority. As to where, I am in the extreme south of Everett, about three or four miles from the city boundary. —<font color="228B22">Jeremy <font color="00008B"> (v^_^v PC/SP is a show-trial!) 02:30, 6 October 2010 (UTC)
 * I suspect the router, too, for what it's worth. Out of the 8 or 10 consumer-grade routers I am responsible for, about 1 seems to "die" every year, and usually the "death" isn't a total outage, which would make it easier to diagnose, but is an annoying malfunction of some kind where the latency or throughput seems crippled.  Comet Tuttle (talk) 22:18, 6 October 2010 (UTC)
 * The situation here has changed a bit, and I have another question: Would resetting the router via the reset switch on it fix it? —<font color="228B22">Jeremy <font color="00008B"> (v^_^v PC/SP is a show-trial!) 05:25, 7 October 2010 (UTC)
 * (RI) Hello? —<font color="228B22">Jeremy <font color="00008B"> (v^_^v PC/SP is a show-trial!) 18:16, 7 October 2010 (UTC)


 * Probably not. You haven't mentioned the manufacturer and model number of your router, but usually the "Reset" button will reset the router back to a default configuration.  This may fix things if the router's firmware has some sort of bug in the firmware that causes it to suck more over time; but this seems unlikely.  On the negative side, for many or most routers, the "Reset" button will reset all the passwords and settings, so it might mess up your whole network configuration.  I'm afraid you're going to have to ask the IT people to fix the problem.  (Note for future use of the Reference Desk:  Typing "Hello?" doesn't make it more likely that volunteers will stop by to check the thread and follow up.)  Comet Tuttle (talk) 18:41, 7 October 2010 (UTC)
 * Which means I'm screwed for three weeks. Thanks. :/ —<font color="228B22">Jeremy <font color="00008B"> (v^_^v PC/SP is a show-trial!) 18:43, 7 October 2010 (UTC)


 * Actually let me retract the "let the experts fix it" part for a second &mdash; if you now have access to the router, do you also have access to try disconnecting the router from the cable modem, and plugging your computer's Ethernet cable directly into the cable modem? Comet Tuttle (talk) 18:42, 7 October 2010 (UTC)
 * I have access to the router, but not the modem. —<font color="228B22">Jeremy <font color="00008B"> (v^_^v PC/SP is a show-trial!) 18:43, 7 October 2010 (UTC)


 * In that case, if you are allowed to, you could check whether the router is the problem by (a) buying a cheap router and swapping the old router for the new one; or (b) unplugging both Ethernet cables from the router and plugging both the cables into a coupler like this one, so effectively your computer is connected directly to the cable modem. Comet Tuttle (talk) 21:27, 7 October 2010 (UTC)

Merging Myspace account with Wix website
How can i merge my myspace account with my wix website.thank you —Preceding unsigned comment added by 76.95.189.87 (talk) 23:48, 5 October 2010 (UTC)
 * Wikipedia is not Myspace and is for a different purpose. You can cross link between the two pages if you like though. Graeme Bartlett (talk) 20:50, 6 October 2010 (UTC)
 * It is probable the OP meant "Wix.com". They might find this tutorial helpful.  Nimur (talk) 20:52, 6 October 2010 (UTC)

My topic may soon be deleted :(
My topic TheTechGame.com says that it will be deleted soon. i made this page as a page for members of TheTechGame.com to find out about history and so much more about TTG. i spent a while trying to do this and it says its gunna be deleted. is there anything i can do? —Preceding unsigned comment added by Tvise2 (talk • contribs) 23:51, 5 October 2010 (UTC)
 * This page is not for help with Wikipedia en generale; see WP:Help desk instead. —<font color="228B22">Jeremy <font color="00008B"> (v^_^v PC/SP is a show-trial!) 00:07, 6 October 2010 (UTC)


 * Too late. It looks like it was speedy deleted as "Unambiguous advertising or promotion".
 * You can ask User:Athaenara about it, But probably what it was missing was some assertion of it's importance and notability. APL (talk) 14:28, 6 October 2010 (UTC)


 * You probably want to read WP:N to find out more about what is considered to be notable and what is not. --Tagishsimon (talk) 15:51, 6 October 2010 (UTC)