Wikipedia:Reference desk/Archives/Computing/2015 February 25

Computing desk
< February 24 << Jan | February | Mar >> February 26 >
Welcome to the Wikipedia Computing Reference Desk Archives
The page you are currently viewing is an archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages.


February 25

edit

Website going in circles

edit

Can anyone explain what's going on at http://www.apastyle.org? When I view it in Internet Explorer 11 (going straight to the URL, not via Google or something else), it goes on infinite loop: http://apastyle.org changes to http://apastyle.org/?apaSessionKey=oAXlDxKHRQknjecwRT773OOF, which changes to http://apastyle.org, which changes to http://apastyle.org/?apaSessionKey=4vHUEb9uQqxDulUv7yTdFdjn, etc. — it changes multiple times per second. Is there a normal explanation for this weird behavior? Note that it works fine in Firefox 35.0.1; perhaps it's just a browser weirdness. I don't have Chrome, so I can't check that. Nyttend (talk) 03:39, 25 February 2015 (UTC)[reply]

Sounds like a bug in the website to me. I imagine they check on your browser, and if it's IE11 they send you to that other page, but they never actually coded that page, so it just returns to the calling page, which then sends you back to the IE11 page, etc. If that's it, all they need to do is comment out the line that redirects it to that (nonexistent) page and the problem should be solved. StuRat (talk) 07:53, 25 February 2015 (UTC)[reply]
Might be URL_redirection#Redirect_loops? Anecdata: when I followed your first link in firefox, the URL flickered back and forth bit, then the page loaded properly. It seemed to work more cleanly when I turned off NoScript. SemanticMantis (talk) 19:14, 25 February 2015 (UTC)[reply]
General tip: some sites give behavior like that if you don't accept cookies. --70.49.169.244 (talk) 20:41, 25 February 2015 (UTC)[reply]

How Does Ruby Store Arrays, and else, in Memory

edit

In Ruby if you call the ID of an object, you can get a pointer to that object from the return, then pass that to a dll and process the object. What I don't understand, and haven't found a good source for, is the structure of what that pointer points to. In other words, if I had an array in Ruby, what do I do in my dll with that pointer to operate on its contents (obviously an array of floats isn't going to point to a bunch of floats...so what, then?)? My main issue is that I'm not sure what to read to figure this out and I'm not sure how to figure it out myself - any direction or, sigh at the pun, pointers would be helpful. Thank you:-)Phoenixia1177 (talk) 18:57, 25 February 2015 (UTC)[reply]

It's my understanding that you can write C code using ruby.h and use the rb_ary_entry function to get the address of each element in a ruby array (which insulates you a bit if they change the format of how the Ruby runtime stores arrays. Some examples of this are here and here. But this is when you're writing extensions for Ruby - for when the C code in the DLL knows about Ruby internals - that's probably not what you want. Instead, it sounds like you want to define some code (and thus some data structures) in C, and have Ruby call them. In that case you'd use the Ruby FFI instead. First you write the DLL in C as if it was doing to be called from C (and maybe you test it first with a C executable). Then you write a Ruby wrapper using the FFI (here's another example) which just describes the C functions, their parameters, and the data structures they work on in a way the Ruby interpreter can grok. -- Finlay McWalterTalk 20:21, 25 February 2015 (UTC)[reply]
Thank you very much, that's a wonderfully helpful answer. Unfortunately, I'm working with a piece of software that has a Ruby interpreter embedded in it and doesn't allow using anything that they didn't build in. They did build in the win32api and, since object id's are based on pointer values to the object, it gives me a way of extending it a bit (the real problem is that Ruby is too slow and I need C code to do a specific operation very fast - something horrid in a loop is causing lag).Phoenixia1177 (talk) 05:17, 26 February 2015 (UTC)[reply]

Problems with my computer's text display

edit

A few weeks back, my computer automatically installed some new updates, which is fairly typical — except that it's caused problems with how the text in my browser is rendered. I've uploaded a screenshot of the main page (I use the classic design from 2010 and earlier) as an example, which can be found here. It's made Wikipedia and several other sides almost uncomfortable to browse. Does anybody have any insight into a possible solution? I've tried system restore and enabling ClearType, but neither made a difference.

Just for the record, I've been using Windows Vista since 2007; never got around to upgrading my operating system (been planning to for years). My main browser is Google Chrome, but I've also checked the font rendering on Mozilla Firefox and it seems to have the same problem. Kurtis (talk) 19:21, 25 February 2015 (UTC)[reply]

Yes, Microsoft really screwed the pooch on this one. Here's a discussion with the solution (further up this same page): Wikipedia:Reference_desk/Computing#Display_problem_in_Wikipedia_editing_window. StuRat (talk) 20:55, 25 February 2015 (UTC)[reply]
Thanks for the link. I should have realized that I might not be the only one dealing with this issue. Kurtis (talk) 18:11, 26 February 2015 (UTC)[reply]
You're welcome. Can we mark this Q resolved ? StuRat (talk) 19:55, 27 February 2015 (UTC)[reply]
Yes — in fact, that's just what I was about to do. Feel free to do it for me. ;) Kurtis (talk) 21:50, 27 February 2015 (UTC)[reply]
Done ! StuRat (talk) 22:00, 27 February 2015 (UTC)[reply]
  Resolved