Technical FAQ
This FAQ answers some question related to the technical workings of Diyinfo, including software and hardware.
[edit] What if 2 people are editing the same page?
- When the second person (and later persons) attempts to save the page, MediaWiki will attempt to merge their changes into the current version of the text. If the merge fails then the user will receive an "edit conflict" message, and the opportunity to merge their changes manually. Multiple consecutive conflicts are noticed, and will generate a slightly different message. This is similar to Concurrent Versions System (CVS), a widely used software version management system.
[edit] How do I recover a password I have forgotten?
- If you entered your e-mail address when you signed up, you can have a new password generated. Click on the "Log in" link in the upper-right corner. Enter your user name, and click the button near the bottom of the page called "Mail me a new password". You should receive an e-mail message with a new random password; you can use it to log in, then go ahead and change your password in your preferences to something you'll remember.
[edit] How do I change my password?
- You can change your password via the 'my preferences' page (there's a link to it, normally in the top right corner of the screen); you can also find this preference page at Special:Preferences.
[edit] What software is used to run Diyinfo?
- Diyinfo originally ran HTML script, which in turn was completely overhauled to use the MediaWiki PHP script.
- MySQL is used for the database backend, Apache is the web server, and PowerDNS is used for DNS.
- The Diyinfo servers' operating system is Linux. The most widely used distribution is Fedora.
[edit] Markup language Diyinfo uses?
- Diyinfo uses a very simple markup based on UseModWiki. For more details, see Help:How to edit a page.
[edit] Why not use HTML?
- The short answer is: for simplicity and security.
- And now the longer answer. Diyinfo, and wiki's in general, are meant to be edited on the fly. HTML is not easy to use when you simply want to write an article. Creating links gives us a particularly dramatic example. To link to the HTML article using HTML, one would have to type
- <a href="HTML">HTML</a>
- Using Mediawiki markup is much easier:
- [[HTML]]
- Then there's security. Different web browser's have bugs that can be exploited via HTML. Malicious users could also do things like JavaScript popup windows or page redirects if they had full HTML ability on Diyinfo. Several "experimental" sites that allowed full-HTML editing have suffered such attacks, including a couple of other wikis that allowed arbitrary HTML.
[edit] So we can't use any HTML?!
- That's not true. Some HTML tags work. Also, HTML table tags were once the only way to create tables (but now it can be done by wiki syntax too). However, there's been some rumbling among the software developers that most HTML tags are deprecated.
- Also see Help:How to edit a page.
[edit] Non-ASCII characters, and special symbols?
- Diyinfo uses Unicode (specifically the UTF-8 encoding of unicode) and most browsers can handle it but font issues mean that more obscure characters may not work for many users (particularly Internet Explorer users as IE has very poor support for automatically using alternative fonts for obscure characters).
- See http://www.unicode.org/help/display_problems.html for instructions on how to enable Unicode support for most platforms.
[edit] Does Diyinfo use cookies?
- Cookies are not required to read or edit Diyinfo, but they are required in order to log in and link your edits to a user account.
- When you log in, the wiki will set a temporary session cookie which identifies your login session; this will be expired when your browser exits (or after an inactivity timeout), and is not saved on your hard drive.
- Another cookie will be saved which lists the user name you last logged in under, to make subsequent logins just a bit easier. (Actually two: one with your name, and one with your account's internal ID number; they must match up.) These cookies expire after 30 days. If this worries you, clear your cookies after completing your session.
- If you check the "remember my password" box on the login form, another cookie will be saved with a hash of your password (not the password itself). As long as this remains valid, you can bypass the login step on subsequent visits to the wiki. The cookie expires after 30 days, or is removed if you log out. If this worries you, don't use the option. (You should probably not use it on a public terminal!)
[edit] Why was I automatically logged out?
- This could be a result of your cookie, browser cache, or firewall/Internet security settings.
- "The kind of session isn't a network session strictly speaking, it's an HTTP session, managed by PHP's session handling functions. This kind of session works by setting a cookie, just like the "remember password" feature. The difference is that the session cookie has the "discard" attribute set, which means that it is discarded when you close your browser. This is done to prevent others from using your account after you have left the computer.
- The other difference is that PHP sessions store the user ID and other such information on the server side. Only a "session key" is sent to the user. The remember password feature stores all required authentication information in the cookie itself. On our servers, the session information is stored in the notoriously unreliable memcached system. Session information may occasionally be lost or go missing temporarily, causing users to be logged out. The simplest workaround for this is to use the remember password feature, as long as you are not worried about other people using the same computer.
- In other words: click the "remember me" box when logging in.
[edit] Can I add a page hit counter?
- Page hit counting is a feature of the MediaWiki software, but this feature is disabled at the Diyinfo site for performance reasons.
[edit] Is the "random article" feature random?
- No, although it's random enough to provide a small sample of articles reliably.
- We have an index on the page table called page_random, which is a random floating point number uniformly distributed on [0, 1). Special:Random chooses a random double-precision floating-point number, and returns the next article with a page_random value higher than the selected random number. Some articles will have a larger gap before them, in the page_random index space, and so will be more likely to be selected. So the actual probability of any given article being selected is in fact itself random.
- The page_random value for new articles, and the random value used by Special:Random, is selected by reading two 31-bit words from a Mersenne Twister, which is seeded at each request by PHP's initialisation code using a high-resolution timer and the PID. The words are combined using:
- (mt_rand() * $max + mt_rand()) / $max / $max
- Some old articles had their page_random value reset using MySQL's RAND():
- rand_st->seed1=(rand_st->seed1*3+rand_st->seed2) % rand_st->max_value;
- rand_st->seed2=(rand_st->seed1+rand_st->seed2+33) % rand_st->max_value;
- return (((double) rand_st->seed1)/rand_st->max_value_dbl);
|