Wikipedia:Reference desk/Archives/Computing/2014 March 19

= March 19 =

HTML code for 'Numbered Navigation' and 'Back to top' button
Hi, Can anyone help me by providing the HTML/CSS code for getting Numbered Navigation and Back to top button as in labnol, a blog run by Amit Agarwal?-- Jos   eph   04:24, 19 March 2014 (UTC)
 * Do you mean how do you do the circles behind the navigation items?


 * HTML:

1 2 3


 * CSS:

.pagenav { min-width: 24px; min-height: 20px; text-align: center; margin: 0 3px; padding: 4px 0 0; vertical-algin: middle; display: inline-block; border-radius: 10em; }

--Canley (talk) 05:11, 19 March 2014 (UTC)
 * Yes, sir. I need a code to navigate pages with numbers as in the above mentioned blog. Also, I need a Back to top button too...-- Jos   eph   06:32, 19 March 2014 (UTC)
 * Sir, I don't have much knowledge in HTML and CSS, so I need complete codes to generate this Numbered Navigation and Back to top button as in labnol. I want to implement this in my own blog. Can you help me?-- Jos   eph   06:47, 19 March 2014 (UTC)
 * Canley has given the answer, but it might need some decoding. You need two things a Cascading Style Sheets which should appear at the top of you page in the . This defines two CSS classes .pagenav and .back-top which define how particular html elements will look

Then in the main of the page you need to give the appropriate class using the class attribute You could have everything in one line using style. A bit clunky but it works here for demonstration Displayed as 5 Its worth reading up a bit on CSS to understand this. You will also need to find how you use CSS with your blogging platform.--Salix alba (talk): 07:48, 19 March 2014 (UTC)
 * Sir, This is my blog. Can you help me figure out the errors there?-- Jos   eph   09:05, 19 March 2014 (UTC)
 * Did you have it working before? I had a look at your blog about an hour ago and the Back-to-top button had a black circle around it and went back to the top. I just looked again and it's a grey square. --Canley (talk) 10:33, 19 March 2014 (UTC)
 * Thanks for your great help, sir. I've made slight modifications in the code and implemented it on my blog. And it appears to be OK now. I need one more help from you...can you provide me the code to give a slight animation, while clicking on the back to top button? ie, the code to move to the top of the page slowly...! Also, is it possible to automatically update the page number according to posts? I used to have 6 posts in my blog and I need to arrange page wise navigation according to that..! Thanks again for your help..!-- Jos   eph   11:06, 19 March 2014 (UTC)
 * Smooth scrolling requires javascript see for example and getting this to work in your blog platform might be tricky and seems to require jQuery. Finding how many blog posts you have will require detailed information on the inner workings of blogspot and again require javascript.--Salix alba (talk): 13:19, 19 March 2014 (UTC)


 * You can do smooth scrolling with CSS transtions - e.g. -- Finlay McWalterჷTalk 13:34, 19 March 2014 (UTC)

Vertically centred tilde in MS PowerPoint
In MS Notepad and in Firefox on Wikipedia my tildes are vertically centred but in PowerPoint they are aligned at the top. How do I get them to align vertically centred? Thanks :) ~ --129.215.47.59 (talk) 14:18, 19 March 2014 (UTC)


 * Are you using different fonts in each program? I suspect that is what causes the difference. —Noiratsi (talk) 14:21, 19 March 2014 (UTC)


 * You're right. The default font is Calibri and it puts the tilde at the top for some reason. Thanks! 129.215.47.59 (talk) 18:52, 19 March 2014 (UTC)

arrays
int arr[3][2]={{1,2},{3,4},{5,6}}; printf("%d %d %d",arr[0][3],arr[1][2],arr[2][0]);

i have this piece of code in c,but i dont understand why does the output is 4 5 5.its a 3*2 matrix then how does column 3 is possible when we number columns from 0.I mean there are 3 rows 0,1,2 and 2 columns 0,1.even if the 3rd column is supposed to contain null entries then how come the output is 4 for [0][3].please sort this out.thanks.101.222.246.14 (talk) 14:32, 19 March 2014 (UTC) thanks,but whatever i know about array this line seemed to blew it off.i also knew that out of index and negative indices are not permitted.14.139.187.94 (talk) 05:30, 21 March 2014 (UTC) it came as a bit of sur prise. thanks anyway
 * Even with a 1-dimensional array, if you try to print something outside the array bounds, it will often print whatever is in that memory location, which could be random from your POV, or maybe you can figure it out based on what was put into memory immediately before or after that array. (It might even be a part of a character string which it interprets as integer data.) However, the O/S doesn't necessarily store things in the order you define them, adding another twist.  I suggest you try to print every array position inside and outside the bounds, up to the locations you've already printed, then chart them out, to see the pattern, if any. StuRat (talk) 14:51, 19 March 2014 (UTC)


 * If the array is defined like this:

0 1 -- 0 1 2 1  3 4 2  5 6


 * It's really stored like this:

1 2 3 4 5 6


 * And can possibly be indexed like this:

(0, 0)=1 (0, 1)=2 (0, 2)=3 (0, 3)=4 (0,4)=5 (0,5)=6

(1,-2)=1 (1,-1)=2 (1, 0)=3 (1, 1)=4 (1,2)=5 (1,3)=6

(2,-4)=1 (2,-3)=2 (2,-2)=3 (2,-1)=4 (2,0)=5 (2,1)=6


 * I'm not sure about the negative indexes, they might give an error, but give them a try. StuRat (talk) 15:03, 19 March 2014 (UTC)


 * The C standard forbids out-of-bounds indices—that is, anything but 0, 1, or 2 for the first index and 0 or 1 for the second. If you use anything else, the effect is undefined. It may work sometimes, or always with some implementations, but the compiler is within its rights to break it with fancy optimizations. -- BenRG (talk) 15:38, 19 March 2014 (UTC)


 * I would call that "does not support" versus "forbids". But yes, as I also hinted above, if you reference out-of-bounds values, you do so at your own risk. StuRat (talk) 16:43, 19 March 2014 (UTC)


 * "Forbids" in the sense that the behavior is undefined. The compiler is within its rights to do what you expect, or to trap the out-of-bounds references as an error, or to do something completely different such as changing the output to   or, as John F. Woods famously put it in 1992, "having demons fly out of your nose".
 * Same source:
 * Of course, if a simple application can format a partition, that's a security issue, but that's an entirely different topic. - ¡Ouch! (hurt me / more pain) 07:56, 24 March 2014 (UTC)
 * Of course, if a simple application can format a partition, that's a security issue, but that's an entirely different topic. - ¡Ouch! (hurt me / more pain) 07:56, 24 March 2014 (UTC)


 * There is one limited exception: you are allowed to compute the address where the next element of an array would be if it was one element longer. So even though   produces undefined behavior, it's legitimate to write  . This is sometimes a convenience when working with pointers that step forward or backward through the array.  --50.100.193.30 (talk) 00:50, 22 March 2014 (UTC)


 * I would only use the word "forbid" for something which should always give an error. StuRat (talk) 15:36, 22 March 2014 (UTC)
 * Since when does C have the slightest idea that you're making an out-of-bounds reference, in general? Sure, this example, the compiler might conclude you're doing something screwy because you're using constants, but if those indices were variable, the compiler would have no idea, and there's no run time checking. In C, the array reference a[i] is equivalent to *(a + i) (under the rules for pointer arithmetic) and if this results in an out of bounds access, why, you've just discovered why C is a wondrously powerful tool, and why bad or careless C programmers have been a source of income for good bug hunters from the day C was invented; I made something of a career on other people's buffer overruns.--jpgordon:==( o ) 14:39, 23 March 2014 (UTC)
 * The "point to the first element that doesn't exist" is quite useful, though. For traversing an array, one can start at that position, decrement by one element, process one element, decrement etc. in a loop that exits when the pointer equals the origin of the array.
 * Further note: The C standard defines that there is no run-time checking; even if a compiler can RT-check indices, that feature makes it a non-standard compiler when activated. The only thing the standard allows for is a warning if a constant index is bogus, and that may not be triggered by an a+SIZE case above. (An a[SIZE] access may generate a warning.) - ¡Ouch! (hurt me / more pain) 07:56, 24 March 2014 (UTC)
 * Further note: The C standard defines that there is no run-time checking; even if a compiler can RT-check indices, that feature makes it a non-standard compiler when activated. The only thing the standard allows for is a warning if a constant index is bogus, and that may not be triggered by an a+SIZE case above. (An a[SIZE] access may generate a warning.) - ¡Ouch! (hurt me / more pain) 07:56, 24 March 2014 (UTC)

How many people still use 4:3 aspect ratio monitors?
Are there any statistics on how many people still use computer monitors with 4:3 aspect ratios?

When I develop programs, I design them to come up properly on a 4:3 monitor, and I would test on such a monitor. But I'm probably putting my last 4:3 monitor in mothballs today, so I was wondering. Bubba73 You talkin' to me? 17:18, 19 March 2014 (UTC)
 * Using one right now... but it is a side monitor to the main 16:10 screen. Company's too tight to splash out on two 16:10 monitors for me.  Quite where you would get statistics, I don't know; sorry.  Astronaut (talk) 17:50, 19 March 2014 (UTC)
 * It could be quite a few shows a screen resolutions used by statcounter which seem to have about 10% with a 1024x768 resolution. As with any web statistics there can be a lot of variation due to sampling methods.--Salix alba (talk): 17:57, 19 March 2014 (UTC)
 * If one expands that question beyond monitors, 1024x768 is dominant among the smaller tablets. --Mark viking (talk) 18:14, 19 March 2014 (UTC)

Oh, well, looks like I need to keep a 4:3 monitor around, at least. Bubba73 You talkin' to me? 18:22, 19 March 2014 (UTC)
 * You don't need to keep one around if your video card supports pillarboxed 4:3 resolutions on widescreen monitors. I think they all do, as an option somewhere in the settings dialogs. -- BenRG (talk) 22:31, 19 March 2014 (UTC)

The Ipad is 4:3 and lots of people use them. 70.36.142.114 (talk) 06:05, 20 March 2014 (UTC)


 * My favorite monitors are 1600x1200. I am wondering why manufacturers stopped making them? What is wrong with that ratio? — Preceding unsigned comment added by AboutFace 22 (talk • contribs) 19:56, 21 March 2014 (UTC)


 * That is 4:3 and so many things now are designed for widescreen. Bubba73 You talkin' to me? 21:42, 21 March 2014 (UTC)
 * The funny thing is that actually, 16:9 is a relic of the past: the oldest cinemas were theaters with projectors, and theater stages were rather wide. More width allows for more seats and thus more tickets, and height doesn't. So, expanding horizontally was more economically sound than vertically.
 * With the advent of TV sets, things changed, and the tubes were by default round. The biggest rectangle inside a circle is a square, so a ratio close to 1:1 was chosen. 4:3 is actually only 4% worse than 1:1 WRT area. Because of films, the landscape format was the only one worth taking.
 * However, word processing would work better on a portrait format close to 9:7 (US Letter) or 7:5 (DIN), unless you are writing your letters in landscape format. 3:2 and 10:7 landscape, which are close to 4:3, are worth mentioning for catching half the page. Even wider formats are "useful" only for bragging rights, because the same diagonal translates into less square footage, so the manufacturers save money with the wide-screen hype.
 * This is not pure WP:OR, but I can't seem to find the source right now. - ¡Ouch! (hurt me / more pain) 07:38, 24 March 2014 (UTC)
 * Source. Still can't remember the other, more reliable source. This one wouldn't pass WP:RS criteria :( - ¡Ouch! (hurt me / more pain) 08:53, 24 March 2014 (UTC)


 * Your history is inaccurate. Most films were shot in the Academy ratio (approximately 4:3) until the mid 1950s, and the TV aspect ratio was chosen to match that. Widescreen cinema was introduced to compete with TV (see Panavision). Also, even in the widescreen era, virtually no films were ever shot in 16:9; that was apparently chosen for TVs as a compromise between aspect ratios ranging from 4:3 to 2.35:1. -- BenRG (talk) 19:31, 24 March 2014 (UTC)


 * I'm writing this on a 1600×1200 monitor that I bought used because it was 1600×1200. Solidarity! -- BenRG (talk) 19:31, 24 March 2014 (UTC)

Only secure content is displayed
Every time I go to a Wikipedia page with IE, it gives the message "Only secure content is displayed...". I don't get it with other websites. There must be a security setting or something that causes this. How can it be fixed (for Wikipedia, at least)? Bubba73 You talkin' to me? 18:21, 19 March 2014 (UTC)


 * I don't think that you should be getting that. I use IE as well, and do not get this error.  What version of IE are you using?  Perhaps more importantly, do you know how to access the IE developer tools?  With it, you can see every HTTP/HTTPS request that gets sent from your browser and you can see which specific request is causing the problem.  I just tried loading the main Wikipedia page and it generates 34 (or so) separate HTTP requests.  If you're familiar with IE developer tools, you can see which specific request is causing the problem.  A Quest For Knowledge (talk) 21:48, 19 March 2014 (UTC)
 * Doing a web search on the message finds a Microsoft page that seems related, with suggested configuration setting changes. Tried that? 88.112.50.121 (talk) 22:23, 19 March 2014 (UTC)


 * I'm using IE 11, all updated. I'm not familiar with the developer tools.  I'll check the link. Bubba73 You talkin' to me? 23:12, 19 March 2014 (UTC)

Microsoft recommends against changing that option, but I think Wikipedia is the only place I was getting the "mixed content". It would give me that message on every page load, even if I was going back to a previous page. It was too annoying! Bubba73 You talkin' to me? 23:19, 19 March 2014 (UTC)


 * If you changed the "Display mixed content" option, I hope you changed it to "Disable" (which keeps the default behavior but without the popup prompt) and not "Enable" (which loads insecure resources without asking). Either way, I think it would be better to find out what's really going on, as AQFK suggested. Wikipedia over https doesn't normally load resources over http, as far as I can tell, which means the warning indicates something screwy about your setup. It could even be adware/spyware that you don't know about (though you would probably see it on other sites too in that case). -- BenRG (talk) 23:48, 19 March 2014 (UTC)


 * Yes, I did change it to disable, and so far no problems. I don't think I've seen it on any other website.  But a little over two weeks ago I was having a lot of problems, so I replaced my C HD with a new SSD and did a clean install.  I also went to Kaspersky at that time. Bubba73 You talkin' to me? 01:14, 20 March 2014 (UTC)